Skip to content

A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.

Fix generated apps containing invalid "entity" table components

Akshay Malooa5f31e69ad5c
diff --git a/.github/workflows/model-apps-script-tests.yml b/.github/workflows/model-apps-script-tests.yml
index 69160e313..01246016b 100644
--- a/.github/workflows/model-apps-script-tests.yml
+++ b/.github/workflows/model-apps-script-tests.yml
@@ -84,7 +84,9 @@ jobs:
# The eval harness lives at the repo root (evals/model-apps/**) but is
# owned by this plugin, so it is gated by the same path filter. These are
# the offline scoring/fixture tests only — the Layer 1/2 runners need a
- # live Dataverse org and are run manually.
+ # live Dataverse org and are run manually. `evals/model-apps/tests/` holds
+ # tests for code shared by the app-builder and genpage runners; a new test
+ # directory has to be added here or it silently never runs.
- name: run-model-apps-eval-tests
shell: bash
- run: node --test evals/model-apps/app-builder/tests/*.test.js evals/model-apps/genpage/tests/*.test.js
+ run: node --test evals/model-apps/tests/*.test.js evals/model-apps/app-builder/tests/*.test.js evals/model-apps/genpage/tests/*.test.js
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 000000000..c50a462a6
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,22 @@
+# Never write registry URLs into a committed package-lock.json.
+#
+# `resolved` records the exact feed a package came from. Public npm is blocked on some Microsoft
+# networks, so a contributor installing through an internal Azure Artifacts feed would otherwise
+# rewrite every `resolved` to that internal URL and leak it into this OSS repo on the next commit.
+# Omitting the field keeps `integrity` (the sha512 that actually protects the supply chain) while
+# making the lock feed-agnostic, so it resolves against whatever registry each contributor uses.
+# Same setting microsoft/powerplatform-vscode uses.
+#
+# NOTE: npm reads the per-project .npmrc from the directory that OWNS package.json -- it does not
+# walk up. This root copy therefore does NOT cover plugins/model-apps/scripts/_vendor-build, which
+# has its own package.json and its own .npmrc (verified with `npm config get` from inside it). This
+# copy is the default for any future package.json added at the repo root.
+#
+# It likewise does NOT affect the other plugins: plugins/mobile-apps/template and the
+# plugins/power-pages/skills/create-site/assets/* packages each own a package.json, and
+# `npm config get omit-lockfile-registry-resolved` reads false in each. That is deliberate -- those
+# are templates scaffolded into USER projects, and forcing our lockfile policy onto a user's project
+# would be wrong. They also ship no lock file today. A repo-wide test
+# (plugins/model-apps/scripts/tests/run-tests.test.js) sweeps every committed package-lock.json and
+# fails if any records a non-public feed URL, so a lock added elsewhere is still covered.
+omit-lockfile-registry-resolved=true
diff --git a/evals/model-apps/app-builder/lib/fixture-loader.js b/evals/model-apps/app-builder/lib/fixture-loader.js
index 8ebcc4abe..20c10feaf 100644
--- a/evals/model-apps/app-builder/lib/fixture-loader.js
+++ b/evals/model-apps/app-builder/lib/fixture-loader.js
@@ -5,6 +5,10 @@ const path = require('node:path');
// Load each fixture subdir (named "<eval-id>-<slug>"); its app-spec.json is the graded input.
// Mirrors evals/model-apps/genpage/lib/fixture-loader.js, but the app-builder input is the App
// Spec (not .tsx). Fixture directories that lack an app-spec.json are silently skipped.
+//
+// Every failure below names the FIXTURE. A bare `JSON.parse` reports only a character offset
+// ("Expected double-quoted property name ... at position 25"), which tells an operator running a
+// corpus of fixtures nothing about which one to fix.
function loadFixtures(fixturesDir) {
if (!fs.existsSync(fixturesDir)) throw new Error(`Fixtures directory does not exist: ${fixturesDir}`);
const entries = fs.readdirSync(fixturesDir, { withFileTypes: true })
@@ -17,7 +21,21 @@ function loadFixtures(fixturesDir) {
const dir = path.join(fixturesDir, entry.name);
const specPath = path.join(dir, 'app-spec.json');
if (!fs.existsSync(specPath)) continue;
- fixtures.push({ id: parseInt(m[1], 10), dirName: entry.name, dir, spec: JSON.parse(fs.readFileSync(specPath, 'utf8')) });
+ // Strip a UTF-8 BOM: editors on Windows add one by default and `JSON.parse` rejects the
+ // leading \uFEFF, which failed the whole run for a file that is otherwise valid JSON.
+ const raw = fs.readFileSync(specPath, 'utf8').replace(/^\uFEFF/, '');
+ let spec;
+ try {
+ spec = JSON.parse(raw);
+ } catch (e) {
+ throw new Error(`Fixture ${entry.name}: ${specPath} is not valid JSON — ${e.message}`);
+ }
+ // `null`, `[]`, `"str"` and numbers all parse fine and were accepted as specs, so the real
+ // problem surfaced much later as an opaque stage-facts error. An App Spec is a JSON object.
+ if (spec === null || typeof spec !== 'object' || Array.isArray(spec)) {
+ throw new Error(`Fixture ${entry.name}: ${specPath} must contain a JSON object (an App Spec), got ${Array.isArray(spec) ? 'an array' : spec === null ? 'null' : typeof spec}`);
+ }
+ fixtures.push({ id: parseInt(m[1], 10), dirName: entry.name, dir, spec });
}
return fixtures;
}
diff --git a/evals/model-apps/app-builder/run-app-builder.js b/evals/model-apps/app-builder/run-app-builder.js
index 05fef2494..6a65bf70d 100644
--- a/evals/model-apps/app-builder/run-app-builder.js
+++ b/evals/model-apps/app-builder/run-app-builder.js
@@ -14,22 +14,15 @@ const { TapReporter } = require('../genpage/lib/reporter.js');
const { stageFacts } = require('./lib/facts.js');
const { ASSERTIONS } = require('./lib/assertions.js');
+// Known tiers, so a typo is rejected with the valid choices instead of silently matching no
+// fixture and reporting "no fixtures matched the filter" (which blames the fixtures, not the arg).
+// The parser is shared with the genpage runners — all three had the same silent-default defect.
+const { parseEvalArgs } = require('../lib/eval-args.js');
+
function parseArgs(argv) {
- const args = { fixtures: null, eval: null, tier: null };
- for (let i = 0; i < argv.length; i++) {
- const a = argv[i];
- if (a === '--fixtures') { args.fixtures = argv[++i]; }
- else if (a === '--eval') { args.eval = parseInt(argv[++i], 10); }
- else if (a === '--tier') { args.tier = argv[++i]; }
- else if (a === '--help' || a === '-h') {
- process.stdout.write('Usage: run-app-builder.js [--fixtures <dir>] [--eval <id>] [--tier <smoke|full>]\n');
- process.exit(0);
- } else {
- console.error(`Unknown argument: ${a}`);
- process.exit(2);
- }
- }
- return args;
+ return parseEvalArgs(argv, {
+ printHelp: () => process.stdout.write('Usage: run-app-builder.js [--fixtures <dir>] [--eval <id>] [--tier <smoke|full>]\n'),
+ });
}
function loadEvals() {
diff --git a/evals/model-apps/app-builder/tests/run-app-builder.test.js b/evals/model-apps/app-builder/tests/run-app-builder.test.js
index 2db0d1273..e937d6324 100644
--- a/evals/model-apps/app-builder/tests/run-app-builder.test.js
+++ b/evals/model-apps/app-builder/tests/run-app-builder.test.js
@@ -63,3 +63,113 @@ test('runner: exits 2 when the fixtures dir is missing', () => {
assert.equal(code, 2);
assert.match(stderr, /Fixtures directory does not exist/);
});
+
+// --- argument validation ---------------------------------------------------------------------
+// `argv[++i]` yields `undefined` for a trailing flag, and an undefined value is falsy — so a
+// value-less `--tier`/`--fixtures` silently fell through to "no filter" / "the built-in fixtures".
+// That is worse than an error: the run reports PASS for a scope the caller never asked for. Same
+// class as the plugin CLI fix in 2.4.0 ("a value-less flag no longer passes the usage guard").
+
+test('runner: a value-less --fixtures is rejected, not silently defaulted to the built-in fixtures', () => {
+ const { code, stderr } = run(['--fixtures']);
+ assert.equal(code, 2, 'a missing value must be a usage error');
+ assert.match(stderr, /--fixtures/, 'the message names the offending flag');
+});
+
+test('runner: a value-less --tier is rejected, not silently treated as "no tier filter"', () => {
+ const { code, stderr } = run(['--tier']);
+ assert.equal(code, 2);
+ assert.match(stderr, /--tier/);
+});
+
+test('runner: a value-less --eval is rejected', () => {
+ const { code, stderr } = run(['--eval']);
+ assert.equal(code, 2);
+ assert.match(stderr, /--eval/);
+});
+
+test('runner: a flag consumed as another flag\'s value is rejected', () => {
+ // `--tier --eval 1` used to set tier="--eval" and then silently match no tier.
+ const { code, stderr } = run(['--tier', '--eval', '1']);
+ assert.equal(code, 2);
+ assert.match(stderr, /--tier/);
+});
+
+test('runner: a non-integer --eval is rejected instead of being truncated', () => {
+ // parseInt('1.5', 10) === 1, so `--eval 1.5` silently graded fixture 1 and reported PASS.
+ for (const bad of ['1.5', 'abc', '', '-1']) {
+ const { code, stderr } = run(['--eval', bad]);
+ assert.equal(code, 2, `--eval ${JSON.stringify(bad)} must be rejected`);
+ assert.match(stderr, /--eval/, `--eval ${JSON.stringify(bad)} message names the flag`);
+ }
+});
+
+test('runner: an unknown --tier value is rejected with the valid choices', () => {
+ // A typo previously matched nothing and produced "no fixtures matched the filter", which blames
+ // the fixtures rather than the argument.
+ const { code, stderr } = run(['--tier', 'smoek']);
+ assert.equal(code, 2);
+ assert.match(stderr, /smoke/, 'the message lists the valid tiers');
+});
+
+test('runner: valid arguments still work (the guard does not over-reject)', () => {
+ const smoke = run(['--tier', 'smoke']);
+ assert.equal(smoke.code, 0, `stdout:\n${smoke.stdout}`);
+ const one = run(['--eval', '1']);
+ assert.equal(one.code, 0);
+});
+
+// --- fixture loading -------------------------------------------------------------------------
+
+test('runner: a malformed fixture names the FIXTURE, not just the JSON position', () => {
+ // The bare `JSON.parse` reported "Expected double-quoted property name ... at position 25" with
+ // no indication of WHICH fixture, so a corpus run gave the operator nothing to act on.
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'ab-eval-bad-'));
+ try {
+ fs.mkdirSync(path.join(root, '7-broken-json'), { recursive: true });
+ fs.writeFileSync(path.join(root, '7-broken-json', 'app-spec.json'), '{ "app": { "name": "x" },, }');
+ const { code, stderr } = run(['--fixtures', root]);
+ assert.equal(code, 2);
+ assert.match(stderr, /7-broken-json/, 'the failing fixture is named');
+ } finally {
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('runner: a UTF-8 BOM does not break a fixture', () => {
+ // Editors on Windows write a BOM by default; `JSON.parse` rejects the leading \uFEFF, which
+ // failed the whole run for a file that is otherwise valid JSON.
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'ab-eval-bom-'));
+ try {
+ const dir = path.join(root, '1-bom');
+ fs.mkdirSync(dir, { recursive: true });
+ const spec = {
+ solution: { uniqueName: 'S', publisherPrefix: 'new' },
+ app: { name: 'X' },
+ entities: [{ schemaName: 'new_customer', displayName: 'Customer', primaryAttribute: { schemaName: 'new_name', displayName: 'Name' }, columns: [] }],
+ appShell: { areas: [{ label: 'M', groups: [{ label: 'G', subAreas: [{ entity: 'new_customer', title: 'C' }] }] }] },
+ };
+ fs.writeFileSync(path.join(dir, 'app-spec.json'), '\uFEFF' + JSON.stringify(spec));
+ const { code, stderr } = run(['--fixtures', root, '--eval', '1']);
+ assert.notEqual(code, 2, `a BOM must not be a runner error; stderr:\n${stderr}`);
+ } finally {
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('runner: a fixture whose spec is not a JSON object is rejected by name', () => {
+ // `null`, `[]` and `"str"` all parse fine and were accepted as specs, so the failure surfaced
+ // later as an opaque stage-facts error instead of "this fixture is not an App Spec".
+ for (const body of ['null', '[]', '"nope"', '42']) {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'ab-eval-shape-'));
+ try {
+ fs.mkdirSync(path.join(root, '1-notobject'), { recursive: true });
+ fs.writeFileSync(path.join(root, '1-notobject', 'app-spec.json'), body);
+ const { code, stderr } = run(['--fixtures', root]);
+ assert.equal(code, 2, `body ${body} must be a runner error`);
+ assert.match(stderr, /1-notobject/, `body ${body} must name the fixture`);
+ } finally {
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+ }
+});
diff --git a/evals/model-apps/genpage/run-layer-1.js b/evals/model-apps/genpage/run-layer-1.js
index d1eef6cac..5544b4971 100644
--- a/evals/model-apps/genpage/run-layer-1.js
+++ b/evals/model-apps/genpage/run-layer-1.js
@@ -23,6 +23,7 @@ const path = require('node:path');
const fs = require('node:fs');
const { loadFixtures } = require('./lib/fixture-loader.js');
+const { parseEvalArgs } = require('../lib/eval-args.js');
const { TapReporter } = require('./lib/reporter.js');
const {
WORKFLOW_ASSERTIONS,
@@ -30,21 +31,10 @@ const {
} = require('./lib/assertions-layer-1.js');
function parseArgs(argv) {
- const args = { fixtures: null, eval: null, tier: null };
- for (let i = 0; i < argv.length; i++) {
- const a = argv[i];
- if (a === '--fixtures') args.fixtures = argv[++i];
- else if (a === '--eval') args.eval = parseInt(argv[++i], 10);
- else if (a === '--tier') args.tier = argv[++i];
- else if (a === '--help' || a === '-h') {
- printHelp();
- process.exit(0);
- } else {
- console.error(`Unknown argument: ${a}`);
- process.exit(2);
- }
- }
- return args;
+ // Shared with the app-builder runner: all three shipped an identical parser whose
+ // `argv[++i]` yielded `undefined` for a trailing flag, so a value-less `--tier`/`--fixtures`
+ // silently became "no filter" and the run reported PASS for a scope never asked for.
+ return parseEvalArgs(argv, { printHelp });
}
function printHelp() {
diff --git a/evals/model-apps/genpage/run-layer-2.js b/evals/model-apps/genpage/run-layer-2.js
index d5c8a1a57..03bbf976f 100644
--- a/evals/model-apps/genpage/run-layer-2.js
+++ b/evals/model-apps/genpage/run-layer-2.js
@@ -22,6 +22,7 @@ const path = require('node:path');
const fs = require('node:fs');
const { loadFixtures } = require('./lib/fixture-loader.js');
+const { parseEvalArgs } = require('../lib/eval-args.js');
const { TapReporter } = require('./lib/reporter.js');
const {
ASSERTIONS,
@@ -29,21 +30,10 @@ const {
} = require('./lib/assertions-layer-2.js');
function parseArgs(argv) {
- const args = { fixtures: null, eval: null, tier: null };
- for (let i = 0; i < argv.length; i++) {
- const a = argv[i];
- if (a === '--fixtures') args.fixtures = argv[++i];
- else if (a === '--eval') args.eval = parseInt(argv[++i], 10);
- else if (a === '--tier') args.tier = argv[++i];
- else if (a === '--help' || a === '-h') {
- printHelp();
- process.exit(0);
- } else {
- console.error(`Unknown argument: ${a}`);
- process.exit(2);
- }
- }
- return args;
+ // Shared with the app-builder runner: all three shipped an identical parser whose
+ // `argv[++i]` yielded `undefined` for a trailing flag, so a value-less `--tier`/`--fixtures`
+ // silently became "no filter" and the run reported PASS for a scope never asked for.
+ return parseEvalArgs(argv, { printHelp });
}
function printHelp() {
diff --git a/evals/model-apps/lib/eval-args.js b/evals/model-apps/lib/eval-args.js
new file mode 100644
index 000000000..6161c927a
--- /dev/null
+++ b/evals/model-apps/lib/eval-args.js
@@ -0,0 +1,59 @@
+'use strict';
+// Shared argument parsing for the model-apps eval runners (app-builder + genpage layers 1/2).
+//
+// Extracted because all three shipped a byte-identical `parseArgs` with the same defect class:
+// `argv[++i]` is `undefined` for a trailing flag, and an undefined value is FALSY, so every
+// runner treated a value-less `--tier`/`--fixtures` as "no filter" / "the built-in fixtures" and
+// then reported PASS for a scope the caller never asked for. A silent wrong-scope PASS is worse
+// than an error, because the operator believes a suite ran that did not.
+//
+// The three flags are identical across the runners; only the help text differs, so that stays
+// with each runner.
+
+/** Tiers an eval fixture can declare. A typo must be rejected here rather than matching nothing. */
+const TIERS = ['smoke', 'full'];
+
+/**
+ * @param {string[]} argv - process.argv.slice(2)
+ * @param {object} opts
+ * @param {() => void} [opts.printHelp] - called for --help/-h before exiting 0
+ * @param {(msg: string) => never} [opts.fail] - test seam; defaults to stderr + exit 2
+ * @returns {{ fixtures: string|null, eval: number|null, tier: string|null }}
+ */
+function parseEvalArgs(argv, { printHelp, fail } = {}) {
+ const die = fail || ((msg) => { console.error(`error: ${msg}`); process.exit(2); });
+ const args = { fixtures: null, eval: null, tier: null };
+ // A value that itself looks like a flag is the same mistake one keystroke earlier
+ // (`--tier --eval 1` silently set tier="--eval"), so reject that too.
+ const valueFor = (flag, i) => {
+ const v = argv[i];
+ if (v === undefined || /^--/.test(v)) die(`${flag} requires a value`);
+ return v;
+ };
+ for (let i = 0; i < argv.length; i++) {
+ const a = argv[i];
+ if (a === '--fixtures') {
+ args.fixtures = valueFor('--fixtures', ++i);
+ } else if (a === '--eval') {
+ const raw = valueFor('--eval', ++i);
+ // parseInt('1.5', 10) === 1 and parseInt('abc', 10) === NaN, so the old parse silently
+ // graded fixture 1 for `--eval 1.5`, and turned a typo into a misleading
+ // "no fixtures matched the filter" that blames the fixtures rather than the argument.
+ if (!/^\d+$/.test(raw)) die(`--eval requires a non-negative integer fixture id (got ${JSON.stringify(raw)})`);
+ args.eval = parseInt(raw, 10);
+ } else if (a === '--tier') {
+ const raw = valueFor('--tier', ++i);
+ if (!TIERS.includes(raw)) die(`--tier must be one of ${TIERS.join('|')} (got ${JSON.stringify(raw)})`);
+ args.tier = raw;
+ } else if (a === '--help' || a === '-h') {
+ if (printHelp) printHelp();
+ process.exit(0);
+ } else {
+ console.error(`Unknown argument: ${a}`);
+ process.exit(2);
+ }
+ }
+ return args;
+}
+
+module.exports = { parseEvalArgs, TIERS };
diff --git a/evals/model-apps/tests/eval-args.test.js b/evals/model-apps/tests/eval-args.test.js
new file mode 100644
index 000000000..154155af5
--- /dev/null
+++ b/evals/model-apps/tests/eval-args.test.js
@@ -0,0 +1,63 @@
+'use strict';
+// Unit tests for the SHARED eval arg parser. The runner-level tests in
+// app-builder/tests/run-app-builder.test.js spawn a process and assert exit codes; these drive the
+// function directly through its `fail` seam so every rejection path can be asserted cheaply and
+// without process.exit.
+const { test } = require('node:test');
+const assert = require('node:assert/strict');
+const { parseEvalArgs, TIERS } = require('../lib/eval-args.js');
+
+/** Collect the rejection instead of exiting, and stop parsing the way process.exit(2) would. */
+function parse(argv) {
+ const errors = [];
+ const fail = (msg) => { errors.push(msg); throw new Error(`__fail__:${msg}`); };
+ try {
+ return { args: parseEvalArgs(argv, { printHelp() {}, fail }), errors };
+ } catch (e) {
+ if (!/^__fail__:/.test(e.message)) throw e;
+ return { args: null, errors };
+ }
+}
+
+test('eval-args: valid arguments parse', () => {
+ const { args } = parse(['--fixtures', 'D:/x', '--eval', '3', '--tier', 'smoke']);
+ assert.deepEqual(args, { fixtures: 'D:/x', eval: 3, tier: 'smoke' });
+});
+
+test('eval-args: absent flags stay null (the caller decides the default)', () => {
+ const { args } = parse([]);
+ assert.deepEqual(args, { fixtures: null, eval: null, tier: null });
+});
+
+test('eval-args: a trailing flag with no value is rejected, never silently defaulted', () => {
+ // The original defect: `argv[++i]` is undefined, and undefined is falsy, so `--tier` alone
+ // became "no tier filter" and the run reported PASS for every tier.
+ for (const flag of ['--fixtures', '--eval', '--tier']) {
+ const { args, errors } = parse([flag]);
+ assert.equal(args, null, `${flag} alone must not parse`);
+ assert.match(errors[0], new RegExp(`${flag}`), `${flag} must be named in the error`);
+ }
+});
+
+test('eval-args: a value that is itself a flag is rejected', () => {
+ const { args, errors } = parse(['--tier', '--eval', '1']);
+ assert.equal(args, null);
+ assert.match(errors[0], /--tier requires a value/);
+});
+
+test('eval-args: --eval accepts only a non-negative integer', () => {
+ // parseInt('1.5', 10) === 1 silently graded the wrong fixture and reported PASS.
+ for (const bad of ['1.5', 'abc', '', '-1', '1e3', ' 1']) {
+ const { args } = parse(['--eval', bad]);
+ assert.equal(args, null, `--eval ${JSON.stringify(bad)} must be rejected`);
+ }
+ assert.equal(parse(['--eval', '0']).args.eval, 0, 'zero is a legal fixture id');
+ assert.equal(parse(['--eval', '12']).args.eval, 12);
+});
+
+test('eval-args: --tier accepts only a known tier and names the choices', () => {
+ const { args, errors } = parse(['--tier', 'smoek']);
+ assert.equal(args, null);
+ for (const t of TIERS) assert.match(errors[0], new RegExp(t), `the error lists ${t}`);
+ for (const t of TIERS) assert.equal(parse(['--tier', t]).args.tier, t);
+});
diff --git a/plugins/model-apps/.claude-plugin/plugin.json b/plugins/model-apps/.claude-plugin/plugin.json
index 981b2b5f2..c76394f6e 100644
--- a/plugins/model-apps/.claude-plugin/plugin.json
+++ b/plugins/model-apps/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "model-apps",
- "version": "2.4.1",
+ "version": "2.4.2",
"description": "Build model-driven Power Apps end to end: /app-builder authors whole apps (tables, relationships, forms, views, charts, security roles, app + sitemap) from a natural-language intent, and /genpage builds generative pages with specialist agents for planning, entity creation, and parallel code generation. Requires PAC CLI >= 2.7.0 and Azure CLI (`az`). See CHANGELOG.md for v1.x -> v2.x migration.",
"author": {
"name": "Microsoft",
diff --git a/plugins/model-apps/.plugin/plugin.json b/plugins/model-apps/.plugin/plugin.json
index 981b2b5f2..c76394f6e 100644
--- a/plugins/model-apps/.plugin/plugin.json
+++ b/plugins/model-apps/.plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "model-apps",
- "version": "2.4.1",
+ "version": "2.4.2",
"description": "Build model-driven Power Apps end to end: /app-builder authors whole apps (tables, relationships, forms, views, charts, security roles, app + sitemap) from a natural-language intent, and /genpage builds generative pages with specialist agents for planning, entity creation, and parallel code generation. Requires PAC CLI >= 2.7.0 and Azure CLI (`az`). See CHANGELOG.md for v1.x -> v2.x migration.",
"author": {
"name": "Microsoft",
diff --git a/plugins/model-apps/AGENTS.md b/plugins/model-apps/AGENTS.md
index 754f7b35b..c7815d417 100644
--- a/plugins/model-apps/AGENTS.md
+++ b/plugins/model-apps/AGENTS.md
@@ -132,6 +132,22 @@ the pipeline and delegates each script's **behavioral spec** to the entries belo
snapshot (`.maker-workspace/apply-snapshot.json`); any non-page edit (or an edit to a pre-existing app)
falls back to a full build. Teardown tombstones+deletes the snapshot. See
[`docs/changed-only-design.md`](docs/changed-only-design.md) for the v1 scope + contract.
+ **App TABLE components are pinned by OData REFERENCE** (ADO 6612527). The SDK sends
+ `{ '@odata.id': '<EntitySetName>(<MetadataId>)' }` per sitemap table, NOT an `@odata.type` instance:
+ `Microsoft.Dynamics.CRM.entity` names a real Dataverse table (metadata-as-data), so the old instance
+ payload pinned the `entity` TABLE and every app exported as
+ `<AppModuleComponent type="1" schemaName="entity" />`. The **set segment** decides the resulting
+ `objectid`; an unknown set 400s, so a typo cannot silently pin the wrong table. The reference form is
+ also the ONLY one that can express an abstract EDM table (`activitypointer`, `principal`), which an
+ instance payload rejects outright. Three consequences the build depends on: ONE bad component fails
+ the WHOLE `AddAppComponents` call (zero rows), so an unresolvable table **HALTS** the build naming it
+ rather than shipping an app whose nav points at content it lacks; `AddAppComponents` does NOT
+ de-duplicate (N components → N rows); and because a 204 says only that the request was *accepted*,
+ the SDK **reads the components back** and asserts each declared table has a `componenttype: 1` row
+ carrying that table's MetadataId, failing closed on an inconclusive read. That last point is the
+ general rule this bug taught: **assert what you PRODUCED, not what you intended** — "some table
+ component exists" was true of the corrupt apps too, and `ValidateApp` reported success on them.
+ Pinned by `scripts/tests/app-entity-components-real-bundle.test.js`.
- **`scripts/teardown-model-app.js` → `scripts/lib/sdk-teardown.js`** — the first-class, **classifier-safe**
teardown (reverse of the build), for cleaning up live-verification probes or a failed build. Deletes
exactly the artifacts a given App Spec declares, in dependency-safe order (**app module → security
@@ -183,21 +199,21 @@ the pipeline and delegates each script's **behavioral spec** to the entries belo
**Entities are the sitemap's tables UNIONED with the entities owned by the app's VIEW / CHART /
FORM components** (`appComponentEntities`) — a maker-built app can include tables reachable only via
a lookup/sub-grid/related view, with no sitemap entry of their own, and reconstructing from the
- sitemap alone drops them. Note `componenttype eq 1` (Entities) rows are deliberately NOT used:
- LIVE-verified that every one carries the same `objectid` (the `entity` metadata table's own id), so
- it identifies the component *kind*, not which table, and `RetrieveAppComponents` returned 0 rows on
- the same app. **Scope caveat:** `/app-builder` itself never creates a hidden component — a table
+ sitemap alone drops them. Note `componenttype eq 1` (Entities) rows are deliberately NOT used, but
+ the REASON changed: apps built before the entity-component fix carry junk rows that all share one
+ `objectid` (the `entity` metadata table's own id), so on those apps the row identifies the
+ component *kind*, not which table. Newly built apps now carry CORRECT per-table objectids (see the
+ build note below), so reading them is viable — it is not done yet because a legacy app's junk rows
+ would resolve to the table literally named `entity` and have to be filtered.
+ **Scope caveat:** `/app-builder` itself never creates a hidden component — a table
with no sitemap subarea does not become an app component at all (LIVE-verified: declaring `task` in
`entities[]` without nav left the app's component set unchanged), so for an app-builder-built app
the sitemap set already IS the complete set. This union therefore only adds tables for apps built
- or edited in the maker. **Closing ADO 6603388 from the BUILD side is blocked by the platform, not
- merely unimplemented:** a table (`entity`) app component cannot be pinned via `AddAppComponents` at
- all — the documented shape returns 204 but records a component pointing at the metadata table
- literally named `entity` (the same finding as the `componenttype eq 1` note above), while
- `metadataid` and a logical-name `entityid` are rejected and a `savedquery` in the SAME request pins
- correctly as a control. Direct create is unsupported too, and `ValidateApp` reports success
- regardless, which is why it went unnoticed. Tracked platform-side as **AB#39140211**. Do NOT claim
- table components are applied. The component read is best-effort: a failure degrades
+ or edited in the maker. **ADO 6603388 (download) is still open**, and a live attempt to construct
+ the hidden component it describes did not succeed: pinning `task` via `AddAppComponents` with the
+ now-correct reference shape returned 204 but wrote no row, before or after publish. So the
+ download-side fix cannot currently be verified end to end — do not implement it speculatively.
+ The component read is best-effort: a failure degrades
to the sitemap-derived set rather than failing the download. Each entity's **`primaryAttribute` comes from
real Dataverse metadata** (`primaryNameAttribute`) and is **never synthesized**. The old
`<entity>_name` guess was wrong for most OOB tables (`account` → `name`,
diff --git a/plugins/model-apps/CHANGELOG.md b/plugins/model-apps/CHANGELOG.md
index 7f0c60d25..667c0f094 100644
--- a/plugins/model-apps/CHANGELOG.md
+++ b/plugins/model-apps/CHANGELOG.md
@@ -2,7 +2,57 @@
All notable changes to the **model-apps** plugin.
-## [Unreleased] — 2.4.1
+## [Unreleased] — 2.4.2
+
+Fixes a malformed app module: generated apps did not actually contain their tables.
+
+### Fixed
+- **Generated apps contained invalid `entity` table components instead of their real tables**
+ (ADO 6612527). An exported app read `<AppModuleComponent type="1" schemaName="entity" />` where it
+ should have listed `account`, `contact`, `activitypointer` — and the malformed app then broke
+ unrelated app-processing and metadata-discovery paths. Tables are now pinned by OData **reference**
+ (`{ '@odata.id': '<EntitySetName>(<MetadataId>)' }`) instead of as an `@odata.type` instance:
+ `Microsoft.Dynamics.CRM.entity` names a real Dataverse table (metadata-as-data), so the old payload
+ pinned the `entity` table exactly as asked. The reference form is also the only one that can express
+ an abstract EDM table such as `activitypointer`.
+- **A table that cannot be resolved now halts the build, naming it.** One bad component fails the
+ whole `AddAppComponents` call, so a silently-skipped table previously emptied the app's component
+ list rather than degrading it.
+- **App components are read back and verified after the write.** `AddAppComponents` returned 204 for
+ every corrupt app — a 2xx means the request was accepted, not which rows it wrote — and
+ `ValidateApp` reported success too. The build now asserts every declared table has a
+ `componenttype: 1` row carrying that table's MetadataId, and fails closed if it cannot check.
+
+### Changed
+- **Re-vendored `cds-maker-sdk`** with the above.
+
+### Tests
+- `app-entity-components-real-bundle.test.js` drives the shipped bundle: tables sent as references,
+ an unresolvable table refused, the read-back catching both a missing component and the exact
+ 6612527 corruption (rows present but pointing at `entity`). 6 of its 7 tests fail against the
+ previous bundle.
+
+### Known limitations
+- **ADO 6603388 (download drops entity components not in the sitemap) is still open.** A live attempt
+ to construct the hidden component it describes did not succeed — pinning a table with no sitemap
+ entry returned 204 but wrote no row, before or after publish — so the download-side change cannot
+ be verified end to end yet.
+
+### Eval harness
+- **A value-less or malformed runner flag is now rejected instead of silently changing scope.**
+ `argv[++i]` is `undefined` for a trailing flag and `undefined` is falsy, so `--tier` alone became
+ "no tier filter" and `--fixtures` alone fell back to the built-in fixtures — the run then reported
+ PASS for a scope the caller never asked for. `--eval 1.5` was truncated to fixture `1` and graded
+ the wrong one; an unknown `--tier` produced "no fixtures matched the filter", blaming the fixtures
+ rather than the argument. All three runners (app-builder + genpage layers 1/2) shipped a
+ byte-identical copy of this parser, so it is now shared at `evals/model-apps/lib/eval-args.js`.
+- **A malformed fixture names the fixture.** A bare `JSON.parse` reported only a character offset,
+ which tells an operator running a corpus nothing about which fixture to fix. A UTF-8 BOM (the
+ Windows editor default) no longer fails an otherwise-valid file, and a spec that is `null`, an
+ array, a string or a number is rejected up front instead of surfacing later as an opaque
+ stage-facts error.
+
+## 2.4.1
Bug fixes for apps built on **out-of-the-box** tables, and the matching `cds-maker-sdk` uptake.
No change to any skill's public surface.
diff --git a/plugins/model-apps/scripts/_vendor-build/.npmrc b/plugins/model-apps/scripts/_vendor-build/.npmrc
new file mode 100644
index 000000000..7593c2a4a
--- /dev/null
+++ b/plugins/model-apps/scripts/_vendor-build/.npmrc
@@ -0,0 +1,6 @@
+# Never write registry URLs into this package-lock.json. See the repo-root .npmrc for the rationale.
+#
+# This copy is the load-bearing one: npm reads the per-project .npmrc from the directory that OWNS
+# package.json and does NOT walk up, so the root .npmrc does not apply here -- `npm config get
+# omit-lockfile-registry-resolved` reads false from this directory without this file.
+omit-lockfile-registry-resolved=true
diff --git a/plugins/model-apps/scripts/_vendor-build/package-lock.json b/plugins/model-apps/scripts/_vendor-build/package-lock.json
index 3b75ab734..bd4468917 100644
--- a/plugins/model-apps/scripts/_vendor-build/package-lock.json
+++ b/plugins/model-apps/scripts/_vendor-build/package-lock.json
@@ -13,7 +13,6 @@
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
"integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
"cpu": [
"ppc64"
@@ -30,7 +29,6 @@
},
"node_modules/@esbuild/android-arm": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
"integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
"cpu": [
"arm"
@@ -47,7 +45,6 @@
},
"node_modules/@esbuild/android-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
"integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
"cpu": [
"arm64"
@@ -64,7 +61,6 @@
},
"node_modules/@esbuild/android-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
"integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
"cpu": [
"x64"
@@ -81,7 +77,6 @@
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
"integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
"cpu": [
"arm64"
@@ -98,7 +93,6 @@
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
"integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
"cpu": [
"x64"
@@ -115,7 +109,6 @@
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
"integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
"cpu": [
"arm64"
@@ -132,7 +125,6 @@
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
"integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
"cpu": [
"x64"
@@ -149,7 +141,6 @@
},
"node_modules/@esbuild/linux-arm": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
"integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
"cpu": [
"arm"
@@ -166,7 +157,6 @@
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
"integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
"cpu": [
"arm64"
@@ -183,7 +173,6 @@
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
"integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
"cpu": [
"ia32"
@@ -200,7 +189,6 @@
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
"integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
"cpu": [
"loong64"
@@ -217,7 +205,6 @@
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
"integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
"cpu": [
"mips64el"
@@ -234,7 +221,6 @@
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
"integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
"cpu": [
"ppc64"
@@ -251,7 +237,6 @@
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
"integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
"cpu": [
"riscv64"
@@ -268,7 +253,6 @@
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
"integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
"cpu": [
"s390x"
@@ -285,7 +269,6 @@
},
"node_modules/@esbuild/linux-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
"integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
"cpu": [
"x64"
@@ -302,7 +285,6 @@
},
"node_modules/@esbuild/netbsd-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
"integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
"cpu": [
"arm64"
@@ -319,7 +301,6 @@
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
"integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
"cpu": [
"x64"
@@ -336,7 +317,6 @@
},
"node_modules/@esbuild/openbsd-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
"integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
"cpu": [
"arm64"
@@ -353,7 +333,6 @@
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
"integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
"cpu": [
"x64"
@@ -370,7 +349,6 @@
},
"node_modules/@esbuild/openharmony-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
"integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
"cpu": [
"arm64"
@@ -387,7 +365,6 @@
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
"integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
"cpu": [
"x64"
@@ -404,7 +381,6 @@
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
"integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
"cpu": [
"arm64"
@@ -421,7 +397,6 @@
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
"integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
"cpu": [
"ia32"
@@ -438,7 +413,6 @@
},
"node_modules/@esbuild/win32-x64": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
"integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
"cpu": [
"x64"
@@ -455,7 +429,6 @@
},
"node_modules/esbuild": {
"version": "0.28.1",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
"integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
"dev": true,
"hasInstallScript": true,
diff --git a/plugins/model-apps/scripts/tests/app-entity-components-real-bundle.test.js b/plugins/model-apps/scripts/tests/app-entity-components-real-bundle.test.js
new file mode 100644
index 000000000..52445bbbc
--- /dev/null
+++ b/plugins/model-apps/scripts/tests/app-entity-components-real-bundle.test.js
@@ -0,0 +1,201 @@
+'use strict';
+// REAL-BUNDLE contract tests for app TABLE (entity) components — ADO 6612527.
+//
+// The reported defect: an app built by the SDK came back with its Account/Contact/Activity table
+// components replaced by two rows reading `<AppModuleComponent type="1" schemaName="entity" />`,
+// and the malformed app then broke unrelated app-processing and metadata-discovery paths. Root
+// cause: a table was pinned as an `@odata.type` INSTANCE —
+// { '@odata.type': 'Microsoft.Dynamics.CRM.entity', entityid: <MetadataId> }
+// — but `entity` is itself a real Dataverse table (metadata-as-data), so the platform pinned the
+// `entity` TABLE, exactly as asked. A table is now pinned by an OData entity REFERENCE instead:
+// { '@odata.id': '<EntitySetName>(<MetadataId>)' }
+// where the SET SEGMENT decides the resulting objectid.
+//
+// Every guarantee below is one the ENGINE depends on but no mock-based test can see, because the
+// mocks in sdk-build.test.js stub `pushArtifact` wholesale. These drive the real vendored bundle.
+const test = require('node:test');
+const assert = require('node:assert');
+const os = require('node:os');
+const path = require('node:path');
+const fs = require('node:fs');
+
+const BUNDLE = path.resolve(__dirname, '..', 'vendor', 'cds-maker-sdk.cjs');
+const { appDef } = require('../lib/sdk-build.js');
+
+const APP_ID = '11111111-1111-1111-1111-111111111111';
+const APP_UNIQUE_ID = '33333333-3333-3333-3333-333333333333';
+/** Stable per-table MetadataIds so a component's objectid can be traced back to its table. */
+const META = {
+ account: 'aaaaaaaa-0000-0000-0000-000000000001',
+ contact: 'aaaaaaaa-0000-0000-0000-000000000002',
+ activitypointer: 'aaaaaaaa-0000-0000-0000-000000000003',
+};
+const SET_NAME = { account: 'accounts', contact: 'contacts', activitypointer: 'activitypointers' };
+
+const tempDirs = [];
+test.after(() => { for (const d of tempDirs) fs.rmSync(d, { recursive: true, force: true }); });
+
+/** The reporter's exact scenario: three OOB tables, all in the sitemap. */
+function specFor(tables) {
+ return {
+ solution: { uniqueName: 'EntCompA', publisherPrefix: 'contoso' },
+ app: { name: 'Customer Management', description: '' },
+ entities: tables.map((t) => ({ schemaName: t, primaryAttribute: { schemaName: 'name' }, columns: [] })),
+ appShell: {
+ areas: [{ label: 'Main', groups: [{ label: 'Records', subAreas: tables.map((t) => ({ entity: t, title: t })) }] }],
+ },
+ };
+}
+
+/**
+ * A real SDK over a fake Dataverse. `opts`:
+ * unresolvable - table logical name whose EntityDefinitions read returns nothing
+ * componentRows - override what the post-write read-back reports (models a lying platform)
+ * componentStatus - HTTP status for the component read-back
+ * noAppUnique - the app read returns no `appmoduleidunique`
+ */
+function freshSdk(tables, opts = {}) {
+ const { createMakerSdk } = require(BUNDLE);
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'entcomp-'));
+ tempDirs.push(dir);
+ const reqs = [];
+ const httpClient = {
+ get: async (url) => {
+ reqs.push({ method: 'GET', url });
+ // GET /EntityDefinitions(LogicalName='account')?$select=MetadataId,EntitySetName
+ const m = /EntityDefinitions\(LogicalName='([^']+)'\)/.exec(url);
+ if (m) {
+ const logical = m[1];
+ if (opts.unresolvable === logical) return { status: 404, headers: {}, body: null };
+ return { status: 200, headers: {}, body: { LogicalName: logical, MetadataId: META[logical] || 'aaaaaaaa-0000-0000-0000-0000000000ff', EntitySetName: SET_NAME[logical] || `${logical}s` } };
+ }
+ if (/\/appmodulecomponents/.test(url)) {
+ if (opts.componentStatus) return { status: opts.componentStatus, headers: {}, body: null };
+ const rows = opts.componentRows !== undefined
+ ? opts.componentRows
+ : tables.map((t) => ({ objectid: META[t], componenttype: 1 }));
+ return { status: 200, headers: {}, body: { value: rows } };
+ }
+ if (/\/appmodules/.test(url)) {
+ const row = { appmoduleid: APP_ID, ...(opts.noAppUnique ? {} : { appmoduleidunique: APP_UNIQUE_ID }) };
+ return { status: 200, headers: {}, body: /RetrieveUnpublishedMultiple/i.test(url) ? { value: [row] } : row };
+ }
+ return { status: 200, headers: {}, body: {} };
+ },
+ post: async (url, body) => {
+ reqs.push({ method: 'POST', url, body });
+ return { status: 204, headers: { 'odata-entityid': `https://x/y(${APP_ID})` }, body: {} };
+ },
+ patch: async (url, body) => { reqs.push({ method: 'PATCH', url, body }); return { status: 204, headers: {}, body: {} }; },
+ delete: async () => ({ status: 204, headers: {}, body: {} }),
+ put: async () => ({ status: 204, headers: {}, body: {} }),
+ };
+ const sdk = createMakerSdk({ workspacePath: dir, instanceUrl: 'https://example.crm.dynamics.com', httpClient });
+ sdk.initWorkspace();
+ return { sdk, reqs };
+}
+
+async function pushApp(sdk, tables) {
+ const def = appDef(specFor(tables), { forms: {}, views: {}, charts: {}, dashboards: {} });
+ const art = sdk.createArtifact('app', { name: def.name, uniqueName: 'contoso_customermanagement', description: '', siteMap: def.siteMap, components: def.components });
+ return sdk.pushArtifact('app', art.id);
+}
+const addComponentsCall = (reqs) => reqs.find((r) => r.method === 'POST' && /AddAppComponents/i.test(r.url));
+
+test('REAL BUNDLE: sitemap tables are pinned as OData REFERENCES, never as `entity` instances', async () => {
+ // The regression that shipped: an `@odata.type` instance payload naming the `entity` table pinned
+ // the metadata table itself, producing `schemaName="entity"` in the export.
+ const tables = ['account', 'contact', 'activitypointer'];
+ const { sdk, reqs } = freshSdk(tables);
+ await pushApp(sdk, tables);
+ const call = addComponentsCall(reqs);
+ assert.ok(call, 'AddAppComponents must be called');
+ const sent = JSON.stringify(call.body);
+ assert.ok(!/Microsoft\.Dynamics\.CRM\.entity\b/.test(sent), `a table must NOT be sent as an entity INSTANCE: ${sent}`);
+ assert.ok(!/"entityid"/.test(sent), `\`entityid\` was the broken key: ${sent}`);
+ for (const t of tables) {
+ assert.ok(
+ new RegExp(`${SET_NAME[t]}\\(`).test(sent),
+ `table '${t}' must be pinned by its entity-set reference '${SET_NAME[t]}(...)': ${sent}`
+ );
+ }
+});
+
+test('REAL BUNDLE: every declared table is pinned — none is silently dropped', async () => {
+ // The reported app had THREE sitemap tables but only TWO (junk) components, which is only
+ // explicable as one having been dropped before the call. N components must produce N rows;
+ // AddAppComponents does not de-duplicate.
+ const tables = ['account', 'contact', 'activitypointer'];
+ const { sdk, reqs } = freshSdk(tables);
+ await pushApp(sdk, tables);
+ const comps = addComponentsCall(reqs).body.Components || [];
+ const refs = comps.map((c) => c['@odata.id']).filter(Boolean);
+ assert.strictEqual(refs.length, tables.length, `expected one reference per table, got ${JSON.stringify(refs)}`);
+});
+
+test('REAL BUNDLE: an UNRESOLVABLE table refuses the whole push rather than pinning the rest', async () => {
+ // Fail closed: one bad component fails the entire AddAppComponents call (zero rows), so pinning
+ // "the rest" would leave nav pointing at a table the app does not contain. The refusal must NAME
+ // the table so the message is actionable.
+ const tables = ['account', 'contact'];
+ const { sdk, reqs } = freshSdk(tables, { unresolvable: 'contact' });
+ await assert.rejects(() => pushApp(sdk, tables), (e) => {
+ assert.ok(/contact/.test(e.message), `the refusal must name the table: ${e.message}`);
+ return true;
+ });
+ assert.ok(!addComponentsCall(reqs), 'nothing may be pinned when a table cannot be resolved');
+});
+
+test('REAL BUNDLE: components are READ BACK and a missing one fails, even though the write returned 2xx', async () => {
+ // The architectural defect behind 6612527: AddAppComponents returned 204 for every corrupt app.
+ // A 2xx says the request was accepted, not which rows it wrote. Model a platform that accepts the
+ // write and stores only one of the two tables.
+ const tables = ['account', 'contact'];
+ const { sdk } = freshSdk(tables, { componentRows: [{ objectid: META.account, componenttype: 1 }] });
+ await assert.rejects(() => pushApp(sdk, tables), (e) => {
+ assert.ok(/contact/.test(e.message), `the failure must name the missing table: ${e.message}`);
+ return true;
+ });
+});
+
+test('REAL BUNDLE: the exact 6612527 corruption is caught — components present but pointing at `entity`', async () => {
+ // "Some table component exists" was true of the corrupt apps too, so the check must compare
+ // OBJECTIDs, not counts. Here two rows come back (matching the reporter's two junk rows) but both
+ // carry the `entity` table's MetadataId instead of account's/contact's.
+ const ENTITY_TABLE_META = 'eeeeeeee-0000-0000-0000-00000000000e';
+ const tables = ['account', 'contact'];
+ const { sdk } = freshSdk(tables, {
+ componentRows: [
+ { objectid: ENTITY_TABLE_META, componenttype: 1 },
+ { objectid: ENTITY_TABLE_META, componenttype: 1 },
+ ],
+ });
+ await assert.rejects(() => pushApp(sdk, tables), (e) => {
+ assert.ok(/account/.test(e.message) && /contact/.test(e.message), `both tables must be reported missing: ${e.message}`);
+ return true;
+ });
+});
+
+test('REAL BUNDLE: an INCONCLUSIVE read-back fails closed (cannot check is not fine)', async () => {
+ for (const opts of [{ componentStatus: 503 }, { noAppUnique: true }]) {
+ const tables = ['account'];
+ const { sdk } = freshSdk(tables, opts);
+ await assert.rejects(() => pushApp(sdk, tables), `expected a refusal for ${JSON.stringify(opts)}`);
+ }
+});
+
+test('REAL BUNDLE: an app with no sitemap tables neither pins nor verifies (no phantom work)', async () => {
+ // A page-only app has nothing to pin; the verification must not invent a failure, and the SDK
+ // should not spend a network call on an empty component list.
+ const { sdk, reqs } = freshSdk([]);
+ const def = appDef(
+ { solution: { uniqueName: 'EntCompB', publisherPrefix: 'contoso' }, app: { name: 'Pageless', description: '' }, entities: [],
+ appShell: { areas: [{ label: 'Main', groups: [{ label: 'G', subAreas: [{ url: 'https://x/y', title: 'Link' }] }] }] } },
+ { forms: {}, views: {}, charts: {}, dashboards: {} }
+ );
+ const art = sdk.createArtifact('app', { name: def.name, uniqueName: 'contoso_pageless', description: '', siteMap: def.siteMap, components: def.components });
+ await assert.doesNotReject(sdk.pushArtifact('app', art.id));
+ const call = addComponentsCall(reqs);
+ const refs = call ? (call.body.Components || []).filter((c) => c['@odata.id']) : [];
+ assert.strictEqual(refs.length, 0, 'no table references for an app with no entity subareas');
+});
diff --git a/plugins/model-apps/scripts/tests/detect-browser.test.js b/plugins/model-apps/scripts/tests/detect-browser.test.js
index d215e7143..cb0fb9673 100644
--- a/plugins/model-apps/scripts/tests/detect-browser.test.js
+++ b/plugins/model-apps/scripts/tests/detect-browser.test.js
@@ -6,6 +6,13 @@ const Module = require('node:module');
const modulePath = path.join(__dirname, '..', 'lib', 'detect-browser.js');
+// The module builds its candidate paths with `path.join`, which emits the HOST separator — so on
+// Linux/macOS a simulated `platform: 'win32'` still produces `C:\Program Files/Microsoft/...`.
+// Hard-coding backslashes here made every probe miss and the detector fall through to 'chromium',
+// failing these tests on every non-Windows runner. Build the expectations the same way the module
+// does so the test asserts the LOOKUP ORDER (what it is really about) on any host.
+const winPath = (...segments) => path.join(...segments);
+
function withDetectedBrowser({ platform, existing = [], which = [], existsThrows = [] }) {
const originalLoad = Module._load;
const originalEnv = {
@@ -63,8 +70,8 @@ function withDetectedBrowser({ platform, existing = [], which = [], existsThrows
}
test('Windows prefers preinstalled Edge before Chrome when both browsers exist', () => {
- const edge = 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe';
- const chrome = 'C:\\Users\\Maker\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe';
+ const edge = winPath('C:\\Program Files (x86)', 'Microsoft', 'Edge', 'Application', 'msedge.exe');
+ const chrome = winPath('C:\\Users\\Maker\\AppData\\Local', 'Google', 'Chrome', 'Application', 'chrome.exe');
const result = withDetectedBrowser({ platform: 'win32', existing: [edge, chrome] });
@@ -73,7 +80,7 @@ test('Windows prefers preinstalled Edge before Chrome when both browsers exist',
});
test('Windows falls through to Chrome when no Edge install path exists', () => {
- const chrome = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe';
+ const chrome = winPath('C:\\Program Files', 'Google', 'Chrome', 'Application', 'chrome.exe');
const result = withDetectedBrowser({ platform: 'win32', existing: [chrome] });
@@ -82,8 +89,8 @@ test('Windows falls through to Chrome when no Edge install path exists', () => {
});
test('filesystem probe failures are treated the same as a missing browser path', () => {
- const edge = 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe';
- const chrome = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe';
+ const edge = winPath('C:\\Program Files (x86)', 'Microsoft', 'Edge', 'Application', 'msedge.exe');
+ const chrome = winPath('C:\\Program Files', 'Google', 'Chrome', 'Application', 'chrome.exe');
const result = withDetectedBrowser({
platform: 'win32',
diff --git a/plugins/model-apps/scripts/tests/golden.test.js b/plugins/model-apps/scripts/tests/golden.test.js
index 282f180f7..c1532f487 100644
--- a/plugins/model-apps/scripts/tests/golden.test.js
+++ b/plugins/model-apps/scripts/tests/golden.test.js
@@ -42,8 +42,29 @@ test('sitemap-XML golden: area + subarea icons', async () => {
// capture the sitemapxml the push serializes.
let xml = '';
const ws = fs.mkdtempSync(path.join(os.tmpdir(), 'golden-sitemap-'));
+ // A table's MetadataId is also the `objectid` its app component carries, so one constant keeps
+ // the resolve and the read-back verification consistent.
+ const TABLE_METADATA_ID = '22222222-2222-2222-2222-222222222222';
const httpClient = {
- get: async () => ({ status: 200, headers: {}, body: {} }),
+ // The SDK now pins each sitemap table as an OData REFERENCE (`<EntitySetName>(<MetadataId>)`),
+ // then READS THE COMPONENTS BACK and asserts each declared table landed. Both steps fail closed,
+ // so this fake has to answer three reads that a bare `{}` used to satisfy:
+ // GET /EntityDefinitions(LogicalName='new_gorder')?$select=MetadataId,EntitySetName
+ // GET /appmodules(<id>) (unpublished-aware) -> must carry `appmoduleidunique`
+ // GET /appmodulecomponents?$filter=_appmoduleidunique_value eq <guid> and componenttype eq 1
+ get: async (url) => {
+ const m = /EntityDefinitions\(LogicalName='([^']+)'\)/.exec(url);
+ if (m) return { status: 200, headers: {}, body: { LogicalName: m[1], MetadataId: TABLE_METADATA_ID, EntitySetName: `${m[1]}s` } };
+ if (/\/appmodulecomponents/.test(url)) {
+ return { status: 200, headers: {}, body: { value: [{ objectid: TABLE_METADATA_ID, componenttype: 1 }] } };
+ }
+ if (/\/appmodules/.test(url)) {
+ const row = { appmoduleid: '11111111-1111-1111-1111-111111111111', appmoduleidunique: '33333333-3333-3333-3333-333333333333' };
+ // The unpublished-aware read returns a result set; a by-id retrieve returns the row.
+ return { status: 200, headers: {}, body: /RetrieveUnpublishedMultiple/i.test(url) ? { value: [row] } : row };
+ }
+ return { status: 200, headers: {}, body: {} };
+ },
post: async (url, body) => { if (/\/sitemaps\b/.test(url) && body && body.sitemapxml) xml = String(body.sitemapxml); return { status: 204, headers: { 'odata-entityid': 'https://x/y(11111111-1111-1111-1111-111111111111)' }, body: {} }; },
patch: async () => ({ status: 204, headers: {}, body: {} }),
delete: async () => ({ status: 204, headers: {}, body: {} }),
diff --git a/plugins/model-apps/scripts/tests/helpers/golden.js b/plugins/model-apps/scripts/tests/helpers/golden.js
index eed477747..b083834ea 100644
--- a/plugins/model-apps/scripts/tests/helpers/golden.js
+++ b/plugins/model-apps/scripts/tests/helpers/golden.js
@@ -7,6 +7,14 @@ const assert = require('node:assert');
const GOLDEN_DIR = path.join(__dirname, '..', 'golden');
const UPDATE = process.env.UPDATE_GOLDENS === '1';
+// Golden files are text snapshots, so the comparison must not depend on how git checked them out.
+// GitHub Actions' windows runner defaults to `core.autocrlf=true`, which rewrites the committed LF
+// goldens to CRLF on checkout; the generated `actual` still uses \n, so a byte compare failed every
+// golden test on Windows CI while passing on a developer clone with autocrlf off. Normalizing both
+// sides compares the CONTENT these snapshots exist to pin. (`.gitattributes` keeps the committed
+// bytes LF; this makes the test correct even where that is not honored.)
+const normalizeEol = (s) => String(s).replace(/\r\n/g, '\n');
+
function assertGolden(name, actual) {
const file = path.join(GOLDEN_DIR, name);
if (UPDATE) {
@@ -15,7 +23,11 @@ function assertGolden(name, actual) {
return;
}
const expected = fs.readFileSync(file, 'utf8');
- assert.strictEqual(actual, expected, `golden mismatch: ${name} — re-run with UPDATE_GOLDENS=1 if the change is intended`);
+ assert.strictEqual(
+ normalizeEol(actual),
+ normalizeEol(expected),
+ `golden mismatch: ${name} — re-run with UPDATE_GOLDENS=1 if the change is intended`
+ );
}
module.exports = { assertGolden, GOLDEN_DIR, UPDATE };
diff --git a/plugins/model-apps/scripts/tests/run-tests.test.js b/plugins/model-apps/scripts/tests/run-tests.test.js
index c67f1cef1..3d679f16d 100644
--- a/plugins/model-apps/scripts/tests/run-tests.test.js
+++ b/plugins/model-apps/scripts/tests/run-tests.test.js
@@ -90,3 +90,96 @@ test('the model-apps CI workflow opts out of telemetry transmission on every job
assert.ok(jobCount >= 2, `expected at least 2 jobs, found ${jobCount}`);
assert.strictEqual(optOuts, jobCount, `every job must set the opt-out (${optOuts} set / ${jobCount} jobs)`);
});
+
+// --- committed lock files must not carry a registry URL ---------------------------------------
+// `resolved` records the exact feed a package came from. Public npm is blocked on some Microsoft
+// networks, so a contributor installing through an internal Azure Artifacts feed would rewrite
+// every `resolved` to that internal URL and leak it into this OSS repo on the next commit. The
+// `.npmrc` (`omit-lockfile-registry-resolved=true`) stops npm writing the field; this test is the
+// backstop that catches a lock regenerated without it, or committed from another machine.
+const REPO_ROOT = path.resolve(__dirname, '..', '..', '..', '..');
+const VENDOR_BUILD = path.join(REPO_ROOT, 'plugins', 'model-apps', 'scripts', '_vendor-build');
+
+test('the vendor-build lock file carries no registry URL of any kind', () => {
+ const lockPath = path.join(VENDOR_BUILD, 'package-lock.json');
+ const lock = JSON.parse(fs.readFileSync(lockPath, 'utf8'));
+ const offenders = [];
+ for (const [name, entry] of Object.entries(lock.packages || {})) {
+ if (entry && entry.resolved !== undefined) offenders.push(`packages['${name}'] -> ${entry.resolved}`);
+ }
+ for (const [name, entry] of Object.entries(lock.dependencies || {})) {
+ if (entry && entry.resolved !== undefined) offenders.push(`dependencies['${name}'] -> ${entry.resolved}`);
+ }
+ assert.deepStrictEqual(
+ offenders,
+ [],
+ `package-lock.json must not record a feed URL (an internal Azure Artifacts URL would leak into this OSS repo).\n` +
+ `Re-run \`npm install\` in ${VENDOR_BUILD} with its .npmrc present, or delete the "resolved" keys.\nFound:\n ${offenders.join('\n ')}`
+ );
+});
+
+test('the vendor-build lock still pins every platform binary WITH an integrity hash', () => {
+ // Stripping `resolved` must not cost supply-chain protection, and regenerating the lock on one
+ // OS can silently collapse the tree: a `npm install --package-lock-only` that reuses a Windows
+ // node_modules dropped 28 packages to 3, losing every non-Windows esbuild binary that CI needs.
+ const lock = JSON.parse(fs.readFileSync(path.join(VENDOR_BUILD, 'package-lock.json'), 'utf8'));
+ const pkgs = Object.entries(lock.packages || {}).filter(([name]) => name !== '');
+ const missingIntegrity = pkgs.filter(([, e]) => !e.link && e.integrity === undefined).map(([n]) => n);
+ assert.deepStrictEqual(missingIntegrity, [], 'every locked package keeps its integrity hash');
+ // esbuild ships one optional package per platform; a single-platform lock means the tree was
+ // regenerated on one OS and the others were lost.
+ const platforms = pkgs.filter(([name]) => name.startsWith('node_modules/@esbuild/'));
+ assert.ok(platforms.length >= 10, `expected the full cross-platform esbuild set, found ${platforms.length}: ${platforms.map(([n]) => n).join(', ')}`);
+});
+
+test('the .npmrc that prevents the leak sits next to the package.json it governs', () => {
+ // npm reads the per-project .npmrc from the directory that OWNS package.json and does NOT walk
+ // up, so a repo-root .npmrc alone would NOT cover this lock file — verified with `npm config
+ // get` from inside the directory. Deleting this file silently re-enables the leak.
+ const npmrc = path.join(VENDOR_BUILD, '.npmrc');
+ assert.ok(fs.existsSync(npmrc), `${npmrc} is required: without it npm rewrites "resolved" with the contributor's feed URL`);
+ assert.match(fs.readFileSync(npmrc, 'utf8'), /^\s*omit-lockfile-registry-resolved\s*=\s*true\s*$/m);
+});
+
+// The `.npmrc` that strips `resolved` only governs the directory that OWNS package.json -- npm does
+// NOT walk up -- so it protects _vendor-build and nothing else. Verified: `npm config get` reads
+// false from plugins/mobile-apps/template and from the power-pages create-site asset packages,
+// each of which has its own package.json. That is the DESIRED scope (those are templates scaffolded
+// into user projects; forcing our lockfile policy on a user's project would be wrong), but it means
+// a lock file added to any other plugin tomorrow would be unprotected. This sweep is the backstop
+// for that: it does not demand the strip everywhere, only that no committed lock leaks a NON-PUBLIC
+// feed URL, which is the actual security property.
+function findLockFiles(dir, out = []) {
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
+ if (entry.name === 'node_modules' || entry.name === '.git') continue;
+ const full = path.join(dir, entry.name);
+ if (entry.isDirectory()) findLockFiles(full, out);
+ else if (entry.name === 'package-lock.json') out.push(full);
+ }
+ return out;
+}
+
+test('NO committed lock file anywhere in the repo records a non-public registry URL', () => {
+ const locks = findLockFiles(REPO_ROOT);
+ assert.ok(locks.length > 0, 'the sweep must actually find the lock file(s) it is guarding');
+ const offenders = [];
+ for (const lockPath of locks) {
+ const lock = JSON.parse(fs.readFileSync(lockPath, 'utf8'));
+ for (const section of ['packages', 'dependencies']) {
+ for (const [name, entry] of Object.entries(lock[section] || {})) {
+ const url = entry && entry.resolved;
+ if (typeof url !== 'string' || !/^https?:/i.test(url)) continue;
+ // Public npm (and its official mirror) are fine in an OSS repo; an internal Azure Artifacts
+ // or on-prem feed URL is the leak this guards against.
+ const host = new URL(url).host.toLowerCase();
+ if (host === 'registry.npmjs.org' || host === 'registry.yarnpkg.com') continue;
+ offenders.push(`${path.relative(REPO_ROOT, lockPath)} :: ${section}['${name}'] -> ${url}`);
+ }
+ }
+ }
+ assert.deepStrictEqual(
+ offenders,
+ [],
+ `a committed package-lock.json records a non-public feed URL, which would leak an internal registry into this OSS repo:\n ${offenders.join('\n ')}`
+ );
+});
diff --git a/plugins/model-apps/scripts/tests/vendor-sdk-smoke.test.js b/plugins/model-apps/scripts/tests/vendor-sdk-smoke.test.js
index a3312ac51..055640300 100644
--- a/plugins/model-apps/scripts/tests/vendor-sdk-smoke.test.js
+++ b/plugins/model-apps/scripts/tests/vendor-sdk-smoke.test.js
@@ -263,8 +263,21 @@ test('CONTRACT: free-text sitemap titles/URLs are XML-escaped, not rejected (a s
// capture the sitemapxml the push serializes.
let sitemapXml = '';
const ws = mkTempWorkspace('sdk-esc-');
+ // This test is about XML ESCAPING, not component pinning — but the push now resolves each sitemap
+ // table to an OData reference and reads the components back, both fail-closed. Answer those reads
+ // so an unrelated refusal cannot masquerade as an escaping failure.
+ const TABLE_METADATA_ID = '22222222-2222-2222-2222-222222222222';
const httpClient = {
- get: async () => ({ status: 200, headers: {}, body: {} }),
+ get: async (url) => {
+ const m = /EntityDefinitions\(LogicalName='([^']+)'\)/.exec(url);
+ if (m) return { status: 200, headers: {}, body: { LogicalName: m[1], MetadataId: TABLE_METADATA_ID, EntitySetName: `${m[1]}s` } };
+ if (/\/appmodulecomponents/.test(url)) return { status: 200, headers: {}, body: { value: [{ objectid: TABLE_METADATA_ID, componenttype: 1 }] } };
+ if (/\/appmodules/.test(url)) {
+ const row = { appmoduleid: '11111111-1111-1111-1111-111111111111', appmoduleidunique: '33333333-3333-3333-3333-333333333333' };
+ return { status: 200, headers: {}, body: /RetrieveUnpublishedMultiple/i.test(url) ? { value: [row] } : row };
+ }
+ return { status: 200, headers: {}, body: {} };
+ },
post: async (url, body) => { if (/\/sitemaps\b/.test(url) && body && body.sitemapxml) sitemapXml = String(body.sitemapxml); return { status: 204, headers: { 'odata-entityid': 'https://x/y(11111111-1111-1111-1111-111111111111)' }, body: {} }; },
patch: async () => ({ status: 204, headers: {}, body: {} }),
delete: async () => ({ status: 204, headers: {}, body: {} }),
diff --git a/plugins/model-apps/scripts/tests/verify-model-app.test.js b/plugins/model-apps/scripts/tests/verify-model-app.test.js
index e6dd14743..1d7404017 100644
--- a/plugins/model-apps/scripts/tests/verify-model-app.test.js
+++ b/plugins/model-apps/scripts/tests/verify-model-app.test.js
@@ -357,7 +357,11 @@ test('verify CLI prints per-check status and aliases missing checks into emitRes
});
test('verify CLI accepts a positional spec, uses the default workspace, and prints PASS', async () => {
- const specPath = 'D:\\Projects\\power-platform-skills-sdk\\plugins\\model-apps\\samples\\app-spec.support-desk.json';
+ // Build the path with `path.join` rather than a hard-coded `D:\...` literal: the CLI derives the
+ // default workspace via path.join, so on a POSIX runner it produces `samples/.maker-workspace`
+ // and a backslash-anchored assertion could never match (this test failed on every non-Windows CI
+ // runner for that reason, not because the CLI was wrong).
+ const specPath = path.join(__dirname, '..', '..', 'samples', 'app-spec.support-desk.json');
const harness = loadVerifyCli({
parseResult: { positional: [specPath], flags: { env: 'https://org.example' } },
verifyResult: {
@@ -374,7 +378,7 @@ test('verify CLI accepts a positional spec, uses the default workspace, and prin
assert.match(stderr, /✓ verify PASS \(1\/1 present\)/);
assert.strictEqual(emitted.ok, true);
assert.deepStrictEqual(emitted.payload.missing, []);
- assert.ok(harness.events.some((e) => e.type === 'createMakerSdk' && /samples\\.maker-workspace$/.test(e.cfg.workspacePath)));
+ assert.ok(harness.events.some((e) => e.type === 'createMakerSdk' && e.cfg.workspacePath === path.join(__dirname, '..', '..', 'samples', '.maker-workspace')));
});
test('verify CLI entrypoint converts SDK startup errors into emitResult failures', async () => {
diff --git a/plugins/model-apps/scripts/vendor/cds-maker-sdk.cjs b/plugins/model-apps/scripts/vendor/cds-maker-sdk.cjs
index 0bcb1f313..4a80097f7 100644
--- a/plugins/model-apps/scripts/vendor/cds-maker-sdk.cjs
+++ b/plugins/model-apps/scripts/vendor/cds-maker-sdk.cjs
@@ -25,34 +25,34 @@
}
globalThis.document=globalThis.document||globalThis.window.document;
})();
-"use strict";var _D=Object.create;var ao=Object.defineProperty;var PD=Object.getOwnPropertyDescriptor;var OD=Object.getOwnPropertyNames;var FD=Object.getPrototypeOf,TD=Object.prototype.hasOwnProperty;var D=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var m=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Bt=(e,t)=>{for(var r in t)ao(e,r,{get:t[r],enumerable:!0})},Bp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of OD(t))!TD.call(e,i)&&i!==r&&ao(e,i,{get:()=>t[i],enumerable:!(n=PD(t,i))||n.enumerable});return e};var ne=(e,t,r)=>(r=e!=null?_D(FD(e)):{},Bp(t||!e||!e.__esModule?ao(r,"default",{value:e,enumerable:!0}):r,e)),kt=e=>Bp(ao({},"__esModule",{value:!0}),e);var be=m(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.IncompatibleWorkspaceError=Z.PathTraversalError=Z.AmbiguousArtifactError=Z.JsonPointerError=Z.NotImplementedError=Z.WorkspaceNotInitializedError=Z.ConnectionError=Z.VersionConflictError=Z.InvalidArgumentError=Z.ValidationError=Z.PathNotFoundError=Z.ArtifactNotFoundError=Z.SdkError=void 0;var He=class extends Error{constructor(t,r){super(r),this.code=t,Object.setPrototypeOf(this,new.target.prototype),this.name=new.target.name}};Z.SdkError=He;var _l=class extends He{constructor(t,r){super("ARTIFACT_NOT_FOUND",`Artifact ${t}/${r} not found in workspace`),this.type=t,this.id=r}};Z.ArtifactNotFoundError=_l;var Pl=class extends He{constructor(t,r,n){super("PATH_NOT_FOUND",`Path ${n} not found in ${t}/${r}`),this.type=t,this.id=r,this.pointer=n}};Z.PathNotFoundError=Pl;var Ol=class extends He{constructor(t,r,n,i){var a,o,s,l;let u=Array.isArray(n)?n:[{pointer:n,rule:i??"invalid",message:i??"invalid"}];super("VALIDATION_ERROR",`Validation failed for ${t}/${r}:
+"use strict";var PD=Object.create;var ao=Object.defineProperty;var OD=Object.getOwnPropertyDescriptor;var TD=Object.getOwnPropertyNames;var RD=Object.getPrototypeOf,FD=Object.prototype.hasOwnProperty;var D=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var m=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Bt=(e,t)=>{for(var r in t)ao(e,r,{get:t[r],enumerable:!0})},Bp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of TD(t))!FD.call(e,i)&&i!==r&&ao(e,i,{get:()=>t[i],enumerable:!(n=OD(t,i))||n.enumerable});return e};var ne=(e,t,r)=>(r=e!=null?PD(RD(e)):{},Bp(t||!e||!e.__esModule?ao(r,"default",{value:e,enumerable:!0}):r,e)),kt=e=>Bp(ao({},"__esModule",{value:!0}),e);var be=m(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.IncompatibleWorkspaceError=Z.PathTraversalError=Z.AmbiguousArtifactError=Z.JsonPointerError=Z.NotImplementedError=Z.WorkspaceNotInitializedError=Z.ConnectionError=Z.VersionConflictError=Z.InvalidArgumentError=Z.ValidationError=Z.PathNotFoundError=Z.ArtifactNotFoundError=Z.SdkError=void 0;var Je=class extends Error{constructor(t,r){super(r),this.code=t,Object.setPrototypeOf(this,new.target.prototype),this.name=new.target.name}};Z.SdkError=Je;var Pl=class extends Je{constructor(t,r){super("ARTIFACT_NOT_FOUND",`Artifact ${t}/${r} not found in workspace`),this.type=t,this.id=r}};Z.ArtifactNotFoundError=Pl;var Ol=class extends Je{constructor(t,r,n){super("PATH_NOT_FOUND",`Path ${n} not found in ${t}/${r}`),this.type=t,this.id=r,this.pointer=n}};Z.PathNotFoundError=Ol;var Tl=class extends Je{constructor(t,r,n,i){var a,o,s,l;let u=Array.isArray(n)?n:[{pointer:n,rule:i??"invalid",message:i??"invalid"}];super("VALIDATION_ERROR",`Validation failed for ${t}/${r}:
`+u.map(c=>` \u2022 ${c.pointer}: ${c.message} [${c.rule}]`).join(`
-`)),this.type=t,this.id=r,this.issues=u,this.pointer=(o=(a=u[0])===null||a===void 0?void 0:a.pointer)!==null&&o!==void 0?o:"",this.rule=(l=(s=u[0])===null||s===void 0?void 0:s.rule)!==null&&l!==void 0?l:"invalid"}};Z.ValidationError=Ol;var Fl=class extends He{constructor(t){super("INVALID_ARGUMENT",t)}};Z.InvalidArgumentError=Fl;var Tl=class extends He{constructor(t,r,n,i){super("VERSION_CONFLICT",`Version conflict for ${t}/${r}: local=${n??"(none)"}, server=${i??"(none)"}. Re-fetch and reapply changes.`),this.type=t,this.id=r,this.localEtag=n,this.serverEtag=i}};Z.VersionConflictError=Tl;var Rl=class extends He{constructor(t,r,n,i){super("CONNECTION_ERROR",r>0?`HTTP ${r} from ${t}: ${n}`:`Transport failure reaching ${t}: ${n}`),this.url=t,this.statusCode=r,this.cause=i}};Z.ConnectionError=Rl;var xl=class extends He{constructor(t){super("WORKSPACE_NOT_INITIALIZED",`Workspace not initialized at ${t}. Call initWorkspace() first.`),this.workspacePath=t}};Z.WorkspaceNotInitializedError=xl;var Ll=class extends He{constructor(t,r){super("NOT_IMPLEMENTED",`Operation '${t}' is not implemented yet${r?`: ${r}`:""}.`),this.operation=t}};Z.NotImplementedError=Ll;var Ml=class extends He{constructor(t,r){super("INVALID_JSON_POINTER",`Invalid JSON Pointer '${t}': ${r}`),this.pointer=t}};Z.JsonPointerError=Ml;var Ul=class extends He{constructor(t,r,n){super("AMBIGUOUS_ARTIFACT",`Found ${n} ${t} rows matching '${r}'; a name is not a unique key. Resolve by id / alternate key instead of relying on name-based idempotency.`),this.kind=t,this.identity=r,this.matchCount=n}};Z.AmbiguousArtifactError=Ul;var Bl=class extends He{constructor(t,r){super("PATH_TRAVERSAL",`Refusing to resolve a path outside the workspace root: '${t}' is not within '${r}'.`),this.target=t,this.root=r}};Z.PathTraversalError=Bl;var kl=class extends He{constructor(t,r){super("INCOMPATIBLE_WORKSPACE",`Workspace schema version ${t} is newer than this SDK supports (v${r}). Upgrade the SDK, or re-create the workspace with this version.`),this.workspaceVersion=t,this.supportedVersion=r}};Z.IncompatibleWorkspaceError=kl});var lo=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.JsonPointer=void 0;var dt=be(),oo=class e{static isReservedToken(t){return e.RESERVED_TOKENS.has(t)}static decodeToken(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}static encodeToken(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}static parse(t){if(t==="")return[];if(t[0]!=="/")throw new dt.JsonPointerError(t,'non-empty pointers must start with "/"');return t.substring(1).split("/").map(r=>{if(/~(?![01])/.test(r))throw new dt.JsonPointerError(t,`invalid '~' escape in token '${r}' (expected ~0 or ~1)`);return e.decodeToken(r)})}static compile(t){return t.length===0?"":"/"+t.map(r=>e.encodeToken(r)).join("/")}static resolve(t,r){let n=e.parse(r),i=t;for(let a of n)if(Array.isArray(i)){let o=e.toArrayIndex(a,i.length);if(o===void 0)return;i=i[o]}else if(i!==null&&typeof i=="object"){let o=i;if(e.isReservedToken(a)||!Object.prototype.hasOwnProperty.call(o,a))return;i=o[a]}else return;return i}static set(t,r,n){let i=e.parse(r);if(i.length===0)throw new dt.JsonPointerError(r,"cannot set the document root");let{parent:a,lastToken:o}=e.resolveParent(t,i,r);if(Array.isArray(a)){let s=e.toArrayIndex(o,a.length);if(s===void 0)throw new dt.JsonPointerError(r,`'${o}' is not a valid array index`);if(s>a.length)throw new dt.JsonPointerError(r,`array index '${o}' is out of range`);a[s]=n}else{if(e.isReservedToken(o))throw new dt.JsonPointerError(r,`refusing to write reserved property '${o}'`);a[o]=n}}static remove(t,r){let n=e.parse(r);if(n.length===0)throw new dt.JsonPointerError(r,"cannot remove the document root");let{parent:i,lastToken:a}=e.resolveParent(t,n,r);if(Array.isArray(i)){let o=e.toArrayIndex(a,i.length);if(o===void 0||o>=i.length)throw new dt.JsonPointerError(r,`array index '${a}' is out of range`);i.splice(o,1)}else{if(e.isReservedToken(a))throw new dt.JsonPointerError(r,`refusing to remove reserved property '${a}'`);delete i[a]}}static add(t,r,n,i){let a=e.parse(r);if(a.length>0&&a[a.length-1]==="-"){let l=e.compile(a.slice(0,-1)),u=e.resolve(t,l);if(!Array.isArray(u))throw new dt.JsonPointerError(r,"add target must be an array");u.push(n);return}let o=e.resolve(t,r);if(!Array.isArray(o))throw new dt.JsonPointerError(r,"add target must be an array");let s=i===void 0?o.length:i;if(s<0||s>o.length)throw new dt.JsonPointerError(r,`insert index ${s} is out of range`);o.splice(s,0,n)}static parent(t){let r=e.parse(t);return r.pop(),e.compile(r)}static lastToken(t){let r=e.parse(t);return r.length===0?"":r[r.length-1]}static append(t,r){return`${t}/${e.encodeToken(String(r))}`}static resolveParent(t,r,n){let i=r[r.length-1],a=e.compile(r.slice(0,-1)),o=e.resolve(t,a);if(o===null||typeof o!="object")throw new dt.JsonPointerError(n,"parent path does not resolve to an object or array");return{parent:o,lastToken:i}}static toArrayIndex(t,r){if(t==="-")return r;if(/^(0|[1-9][0-9]*)$/.test(t))return Number(t)}};so.JsonPointer=oo;oo.RESERVED_TOKENS=new Set(["__proto__","prototype","constructor"])});var qp=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.findElements=void 0;var kp=lo();function RD(e,t){let r=[];return ql(e,"",t,r),r}uo.findElements=RD;function ql(e,t,r,n){if(!(e===null||typeof e!="object"))if(r(e,t)&&n.push({pointer:t,value:e}),Array.isArray(e))e.forEach((i,a)=>{ql(i,kp.JsonPointer.append(t,a),r,n)});else for(let i of Object.keys(e))ql(e[i],kp.JsonPointer.append(t,i),r,n)}});var Gp=m(Je=>{"use strict";var xD=Je&&Je.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),LD=Je&&Je.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Vp=Je&&Je.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&xD(t,e,r);return LD(t,e),t};Object.defineProperty(Je,"__esModule",{value:!0});Je.WorkspaceManager=Je.WORKSPACE_SCHEMA_VERSION=void 0;var he=Vp(require("fs")),ye=Vp(require("path")),wn=be();Je.WORKSPACE_SCHEMA_VERSION=1;var co={form:"forms",view:"views",businessRule:"business-rules",app:"apps",command:"commands",chart:"charts",dashboard:"dashboards"},MD="manifest.json",po=".metadata",$p="entities",$l=class{constructor(t,r){this.workspacePath=t,this.instanceUrl=r}getRoot(){return this.workspacePath}getArtifactDir(t){return ye.join(this.workspacePath,co[t])}getArtifactFilePath(t,r){return this.assertSafeId(r),this.assertWithinRoot(ye.join(this.getArtifactDir(t),`${fo(r)}.json`))}getMetaFilePath(t,r){return this.assertSafeId(r),this.assertWithinRoot(ye.join(this.workspacePath,po,co[t],`${fo(r)}.meta.json`))}getEntityMetaFilePath(t){return this.assertSafeId(t),this.assertWithinRoot(ye.join(this.workspacePath,po,$p,`${t}.json`))}assertSafeId(t){if(typeof t!="string"||t.length===0||/[\u0000-\u001f]/.test(t)||t.includes("/")||t.includes("\\")||t.includes(":")||t==="."||t===".."||t.includes("..")||ye.basename(t)!==t)throw new wn.PathTraversalError(String(t),this.workspacePath)}assertWithinRoot(t){let r=ye.resolve(this.workspacePath),n=ye.resolve(t);if(n!==r&&!n.startsWith(r+ye.sep))throw new wn.PathTraversalError(t,this.workspacePath);let i=he.existsSync(r)?he.realpathSync(r):r,a=n,o=[];for(;!he.existsSync(a);){o.unshift(ye.basename(a));let l=ye.dirname(a);if(l===a)break;a=l}let s=ye.resolve(he.realpathSync(a),...o);if(s!==i&&!s.startsWith(i+ye.sep))throw new wn.PathTraversalError(t,this.workspacePath);return n}get manifestPath(){return ye.join(this.workspacePath,MD)}init(){for(let t of Object.keys(co))he.mkdirSync(this.getArtifactDir(t),{recursive:!0}),he.mkdirSync(ye.dirname(this.getMetaFilePath(t,"x")),{recursive:!0});if(he.mkdirSync(ye.join(this.workspacePath,po,$p),{recursive:!0}),!this.exists(this.manifestPath)){let t={instanceUrl:this.instanceUrl,createdAt:new Date().toISOString(),artifacts:[]};this.writeManifest(t)}}isInitialized(){return this.exists(this.manifestPath)}ensureInitialized(){if(!this.isInitialized())throw new wn.WorkspaceNotInitializedError(this.workspacePath)}clean(){for(let r of Object.keys(co))Vl(this.getArtifactDir(r));Vl(ye.join(this.workspacePath,po));let t=this.getManifest();t.artifacts=[],t.lastSyncAt=void 0,this.init(),this.writeManifest(t)}readArtifact(t,r){return this.ensureInitialized(),this.readJson(this.getArtifactFilePath(t,r))}writeArtifact(t,r,n){this.ensureInitialized(),this.writeJson(this.getArtifactFilePath(t,r),n),this.upsertManifestEntry(t,r,n)}deleteArtifact(t,r){this.ensureInitialized(),this.removeFile(this.getArtifactFilePath(t,r)),this.removeFile(this.getMetaFilePath(t,r));let n=fo(r),i=this.getManifest();i.artifacts=i.artifacts.filter(a=>!(a.type===t&&a.id===n)),this.writeManifest(i)}listArtifacts(t,r){return this.ensureInitialized(),this.getManifest().artifacts.filter(n=>!(t&&n.type!==t||r?.entityLogicalName&&n.entityLogicalName!==r.entityLogicalName))}readEntityMetadata(t){this.ensureInitialized();let r=this.readJson(this.getEntityMetaFilePath(t));return!r||typeof r.schemaName!="string"||typeof r.primaryNameAttribute!="string"||typeof r.primaryIdAttribute!="string"||typeof r.isCustomEntity!="boolean"?null:r}writeEntityMetadata(t,r){this.ensureInitialized(),this.writeJson(this.getEntityMetaFilePath(t),r)}getManifest(){this.ensureInitialized();let t=this.readJson(this.manifestPath);if(!t)throw new wn.WorkspaceNotInitializedError(this.workspacePath);if(t.schemaVersion!==void 0&&t.schemaVersion>Je.WORKSPACE_SCHEMA_VERSION)throw new wn.IncompatibleWorkspaceError(t.schemaVersion,Je.WORKSPACE_SCHEMA_VERSION);return t}writeManifest(t){this.writeJson(this.manifestPath,{...t,schemaVersion:Je.WORKSPACE_SCHEMA_VERSION})}updateManifest(t){let r=this.getManifest();this.writeManifest({...r,...t})}upsertManifestEntry(t,r,n){let i=this.getManifest(),a=fo(r),o=n,s=typeof o.name=="string"?o.name:`${t}:${a}`,l=typeof o.entityLogicalName=="string"?o.entityLogicalName:void 0,u=i.artifacts.find(c=>c.type===t&&c.id===a);u?(u.name=s,u.entityLogicalName=l):i.artifacts.push({type:t,id:a,name:s,entityLogicalName:l,isDirty:!1}),this.writeManifest(i)}readJson(t){return this.exists(t)?JSON.parse(he.readFileSync(t,"utf8")):null}writeJson(t,r){let n=ye.dirname(t);he.mkdirSync(n,{recursive:!0});let i=ye.join(n,`.${ye.basename(t)}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`);try{he.writeFileSync(i,`${JSON.stringify(r,null,2)}
-`,"utf8"),he.renameSync(i,t)}catch(a){try{he.existsSync(i)&&he.unlinkSync(i)}catch{}throw a}}removeFile(t){this.exists(t)&&he.unlinkSync(t)}exists(t){return he.existsSync(t)}};Je.WorkspaceManager=$l;function fo(e){let r=/^\{?([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\}?$/.exec(e);return r?r[1].toLowerCase():e.toLowerCase()}function Vl(e){let t;try{t=he.lstatSync(e)}catch{return}if(t.isSymbolicLink()){try{he.unlinkSync(e)}catch{he.rmdirSync(e)}return}if(!t.isDirectory()){he.unlinkSync(e);return}for(let r of he.readdirSync(e))Vl(ye.join(e,r));he.rmdirSync(e)}});var Jp=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.deepEqual=Nn.deepDiff=void 0;var UD=lo();function BD(e,t){let r=[];return Wp(e,t,"",r,0),r}Nn.deepDiff=BD;var mo=Symbol("missing"),ho=512;function Wp(e,t,r,n,i){if(e===t)return;if(i>ho)throw new RangeError(`deepDiff exceeded the maximum supported depth of ${ho}`);let a=go(e),o=go(t);if(a&&o&&Array.isArray(e)===Array.isArray(t)){let s=kD(e,t);for(let l of s){let u=zp(e,l),c=zp(t,l),d=UD.JsonPointer.append(r,l);u===mo?n.push({pointer:d,type:"added",newValue:c}):c===mo?n.push({pointer:d,type:"removed",oldValue:u}):Wp(u,c,d,n,i+1)}return}jp(e,t)||n.push({pointer:r,type:"modified",oldValue:e,newValue:t})}function go(e){return e!==null&&typeof e=="object"}function kD(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=Math.max(e.length,t.length),i=[];for(let a=0;a<n;a++)i.push(String(a));return i}let r=new Set([...Object.keys(e),...Object.keys(t)]);return Array.from(r)}function zp(e,t){if(Array.isArray(e)){let r=Number(t);return r<e.length?e[r]:mo}return t in e?e[t]:mo}function jp(e,t){return Hp(e,t,0)}Nn.deepEqual=jp;function Hp(e,t,r){if(e===t)return!0;if(r>ho)throw new RangeError(`deepEqual exceeded the maximum supported depth of ${ho}`);if(!go(e)||!go(t)||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every(a=>a in t&&Hp(e[a],t[a],r+1))}});var Xp=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.VersionManager=void 0;var Qp=Jp(),Gl=class{constructor(t){this.workspace=t}storeMeta(t,r,n){this.workspace.writeJson(this.workspace.getMetaFilePath(t,r),n)}getMeta(t,r){return this.workspace.readJson(this.workspace.getMetaFilePath(t,r))}isDirty(t,r){let n=this.workspace.readArtifact(t,r);if(n===null)return!1;let i=this.getMeta(t,r);return i?!(0,Qp.deepEqual)(i.snapshot,n):!0}diff(t,r){let n=this.workspace.readArtifact(t,r),i=this.getMeta(t,r),a;return n===null?a=i?[{pointer:"",type:"removed",oldValue:i.snapshot}]:[]:i?a=(0,Qp.deepDiff)(i.snapshot,n):a=[{pointer:"",type:"added",newValue:n}],{artifactType:t,artifactId:r,changes:a}}checkConflict(t,r,n){let i=this.getMeta(t,r);return!i||i.etag===null?!1:i.etag!==n}};vo.VersionManager=Gl});var Yp=m((zl,Kp)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof zl=="object"?Kp.exports=t():e.compareVersions=t()})(zl,function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(a,o){return a.indexOf(o)===-1?a.length:a.indexOf(o)}function r(a){var o=a.replace(/^v/,"").replace(/\+.*$/,""),s=t(o,"-"),l=o.substring(0,s).split(".");return l.push(o.substring(s+1)),l}function n(a){return isNaN(Number(a))?a:Number(a)}function i(a){if(typeof a!="string")throw new TypeError("Invalid argument expected string");if(!e.test(a))throw new Error("Invalid argument not valid semver ('"+a+"' received)")}return function(o,s){[o,s].forEach(i);for(var l=r(o),u=r(s),c=0;c<Math.max(l.length-1,u.length-1);c++){var d=parseInt(l[c]||0,10),f=parseInt(u[c]||0,10);if(d>f)return 1;if(f>d)return-1}var g=l[l.length-1],b=u[u.length-1];if(g&&b){var w=g.split(".").map(n),N=b.split(".").map(n);for(c=0;c<Math.max(w.length,N.length);c++){if(w[c]===void 0||typeof N[c]=="string"&&typeof w[c]=="number")return-1;if(N[c]===void 0||typeof w[c]=="string"&&typeof N[c]=="number"||w[c]>N[c])return 1;if(N[c]>w[c])return-1}}else if(g||b)return g?-1:1;return 0}})});var nf=m(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.EnvironmentFlowHostingType=fe.EnvironmentDisableReasonCode=fe.EnvironmentMigrationConstants=fe.EnvironmentProvisioningStates=fe.EnvironmentLocations=fe.EnvironmentCreationTypeConstants=fe.EnvironmentType=fe.EnvironmentSkuConstants=fe.environmentPermissions=fe.DatabaseType=void 0;var Zp;(function(e){e.CommonDataService="CommonDataService",e.None="None"})(Zp||(fe.DatabaseType=Zp={}));fe.environmentPermissions={CreatePowerApp:"CreatePowerApp",ReadEnvironment:"ReadEnvironment",GenerateResourceStorage:"GenerateResourceStorage",CreateGateway:"CreateGateway",CreateFlow:"CreateFlow",CreateCustomApi:"CreateCustomApi",AdminReadEnvironment:"AdminReadEnvironment",UpdateEnvironment:"UpdateEnvironment",DeleteEnvironment:"DeleteEnvironment",ExportEnvironmentPackage:"ExportEnvironmentPackage",SetDLPPolicy:"SetDLPPolicy",ListAnyPowerApp:"ListAnyPowerApp",ListAnyFlow:"ListAnyFlow",DeleteAnyPowerApp:"DeleteAnyPowerApp",DeleteAnyFlow:"DeleteAnyFlow",AddEnvironmentRoleAssignment:"AddEnvironmentRoleAssignment",ReadEnvironmentRoleInformation:"ReadEnvironmentRoleInformation",RemoveEnvironmentRoleAssignment:"RemoveEnvironmentRoleAssignment",ModifyDatabaseRoleAssignments:"ModifyDatabaseRoleAssignments",CreateDatabase:"CreateDatabase",ListDatabaseEntities:"ListDatabaseEntities",CreateDatabaseEntities:"CreateDatabaseEntities",UpdateDatabaseEntities:"UpdateDatabaseEntities",DeleteDatabaseEntities:"DeleteDatabaseEntities"};fe.EnvironmentSkuConstants={NotSpecified:"NotSpecified",Standard:"Standard",Premium:"Premium",Developer:"Developer",Basic:"Basic",Production:"Production",Sandbox:"Sandbox",Trial:"Trial",Default:"Default",Teams:"Teams",Platform:"Platform"};var ef;(function(e){e[e.CDS2=0]="CDS2",e[e.CDS1=1]="CDS1",e[e.Empty=2]="Empty"})(ef||(fe.EnvironmentType=ef={}));fe.EnvironmentCreationTypeConstants={NotSpecified:"NotSpecified",Legacy:"Legacy",DefaultTenant:"DefaultTenant",User:"User",CommonDataModelLegacy:"CommonDataModelLegacy"};fe.EnvironmentLocations={global:"global",unitedStates:"unitedstates",southamerica:"southamerica",europe:"europe",canada:"canada",preview:"unitedstatesfirstrelease",asia:"asia",japan:"japan",australia:"australia",india:"india",unitedkingdom:"unitedkingdom",france:"france",germany:"germany",brazil:"brazil",usgov:"usgov",usgovhigh:"usgovhigh",uae:"unitedarabemirates",switzerland:"switzerland",mooncake:"china",korea:"korea",norway:"norway",southafrica:"southafrica",dod:"usdod",singapore:"singapore",sweden:"sweden",italy:"italy",poland:"poland"};fe.EnvironmentProvisioningStates={NotSpecified:"NotSpecified",Succeeded:"Succeeded",Deleting:"Deleting",Deleted:"Deleted",FailedDeleting:"FailedDeleting",LinkedDatabaseProvisioning:"LinkedDatabaseProvisioning",LinkedDatabaseFailedProvisioning:"LinkedDatabaseFailedProvisioning",LinkedDatabaseFailedConfiguring:"LinkedDatabaseFailedConfiguring",LinkedDatabaseUnavailable:"LinkedDatabaseUnavailable",Creating:"Creating"};fe.EnvironmentMigrationConstants={phases:{completed:"Completed"}};var tf;(function(e){e.NotSpecified="NotSpecified",e.NoValidLicense="NoValidLicense",e.SuspendedLicense="SuspendedLicense",e.TrialExpiration="TrialExpiration",e.UserRequested="UserRequested",e.InstanceStateUpdate="InstanceStateUpdated",e.InactivityThreshold="InactivityThreshold",e.OperationsInitiated="OperationsInitiated",e.EnvironmentLifecycleOperation="EnvironmentLifecycleOperation",e.TenantPolicyEvaluation="TenantPolicyEvaluation"})(tf||(fe.EnvironmentDisableReasonCode=tf={}));var rf;(function(e){e.LogicApps="LogicApps",e.SelfHostSingleTenant="SelfHostSingleTenant",e.SelfHostMultiTenant="SelfHostMultiTenant"})(rf||(fe.EnvironmentFlowHostingType=rf={}))});var pf=m(y=>{"use strict";var qD=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(y,"__esModule",{value:!0});y.hasCommonDataServiceDatabase=y.getEnvironmentDiscoveryUrl=y.getEnvironmentWebApiUrl=y.getEnvironmentInstanceApiUrl=y.getEnvironmentLanguageCode=y.getEnvironmentUpdateCadence=y.checkVersions=y.isCds2EnvironmentVersionAtLeast=y.getSecurityOrConnectedGroupId=y.hasSecurityGroupId=y.doesCds2VersionSupportApiVersion9_1=y.doesCds2EnvironmentSupportApiVersion9_1=y.cdsVersionSupportingOSColorEdit=y.getEnvironmentDisplayName=y.getEnvironmentName=y.isEnvironmentInFirstReleaseCluster=y.isEnvironmentInPreprodCluster=y.isEnvironmentInTestCluster=y.isLiteEnvironmentUpgrading=y.isEnvironmentExpired=y.isEnvironmentInDeletedState=y.isEnvironmentInCreatingState=y.isDatabaseInProvisioningState=y.canUserCreateDatabase=y.isDisabledEnvironment=y.isDefaultEnvironment=y.isTrialEnvironment=y.isPlatformEnvironment=y.isTeamsEnvironment=y.isSandboxEnvironment=y.isProdEnvironment=y.isDevEnvironment=y.getEnvironmentType=y.getCrmInstanceName=y.getCrmInstanceUrl=y.getCrmAppDesignerUrl=y.getDevResourcesUrl=y.isEnvironmentInSuccessfulState=y.getAllThemesUrl=y.getAllPublishersUrl=y.getAllSolutionsUrl=y.getSecurityRolesUrl=y.getSecurityUsersUrl=y.environmentHasCds2Database=y.DEFAULT_SOLUTION_UNIQUE_NAME=y.DEFAULT_SOLUTION_ID=y.crmBapSolutionId=y.doesUserHavePermission=y.getLinkedEnvironmentMetadata=y.getCrmVersion=void 0;y.doesUserHaveFlowRunOnlyPermission=y.isUserPautoMakerWithoutDataAccess=y.isUserPautoMakerWithDataAccess=y.doesUserHaveCreateFlowPermission=y.equalsIgnoreCase=y.doesUserHaveCreateDatabasePermission=y.doesUserHaveDatabaseTablePermissions=y.isUserMakerWithoutDataAccess=y.isUserMakerWithDataAccess=y.doesUserHaveCreateAppPermission=y.doesUserHaveAdminPermission=void 0;var $D=qD(Yp()),ee=nf(),Fi=jl();function VD(e){let t=ar(e);return t&&t.version}y.getCrmVersion=VD;function ar(e){return e&&e.properties&&e.properties.linkedEnvironmentMetadata}y.getLinkedEnvironmentMetadata=ar;function ir(e,t){return e?!!e[t]:!1}y.doesUserHavePermission=ir;y.crmBapSolutionId="00000001-0000-0000-0001-00000000009b";y.DEFAULT_SOLUTION_ID="fd140aaf-4df4-11dd-bd17-0019b9312238";y.DEFAULT_SOLUTION_UNIQUE_NAME="Default";function jr(e){return!!ar(e)&&af(e)}y.environmentHasCds2Database=jr;function GD(e){if(e&&jr(e)){let t=Ir(e);return(0,Fi.getCrmAdminSecurityRolesUrl)(t)}return""}y.getSecurityUsersUrl=GD;function zD(e){if(e&&jr(e)){let t=Ir(e);return(0,Fi.getCrmAdminSecurityUsersUrl)(t)}return""}y.getSecurityRolesUrl=zD;function WD(e){if(e&&jr(e)){let t=Ir(e);(0,Fi.getCrmAllSolutionsUrl)(t)}return""}y.getAllSolutionsUrl=WD;function jD(e){if(e&&jr(e)){let t=Ir(e);return(0,Fi.getCrmAllPublishersUrl)(t)}return""}y.getAllPublishersUrl=jD;function HD(e){return e&&jr(e)?Ir(e):""}y.getAllThemesUrl=HD;function af(e){return!!e&&e.properties&&!!e.properties.provisioningState&&e.properties.provisioningState.toUpperCase()===ee.EnvironmentProvisioningStates.Succeeded.toUpperCase()}y.isEnvironmentInSuccessfulState=af;function JD(e){if(e&&jr(e)){let t=Ir(e);return(0,Fi.getCrmDevResourcesUrl)(t)}return""}y.getDevResourcesUrl=JD;function QD(e){return`${e}designer/app/{${y.crmBapSolutionId}}/CreateNewApp}}`}y.getCrmAppDesignerUrl=QD;function Ir(e){let t=ar(e);if(t){let r=t.instanceUrl;return r?r.endsWith("/")?r:r+"/":""}return""}y.getCrmInstanceUrl=Ir;function XD(e){let t=ar(e);return t?t.uniqueName:""}y.getCrmInstanceName=XD;function KD(e){return ar(e)?ee.EnvironmentType.CDS2:e&&e.properties&&e.properties.namespace?ee.EnvironmentType.CDS1:ee.EnvironmentType.Empty}y.getEnvironmentType=KD;function YD(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Developer}y.isDevEnvironment=YD;function ZD(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Production}y.isProdEnvironment=ZD;function eE(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Sandbox}y.isSandboxEnvironment=eE;function Ti(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Teams}y.isTeamsEnvironment=Ti;function tE(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Platform}y.isPlatformEnvironment=tE;var rE=e=>{var t;return((t=e.properties)===null||t===void 0?void 0:t.environmentSku)===ee.EnvironmentSkuConstants.Trial};y.isTrialEnvironment=rE;function nE(e){return e&&e.properties&&(e.properties.isDefault||e.properties.creationType===ee.EnvironmentCreationTypeConstants.DefaultTenant)}y.isDefaultEnvironment=nE;function iE(e){return e&&e.properties&&!!e.properties.states&&!!e.properties.states.runtime&&e.properties.states.runtime.id==="Disabled"}y.isDisabledEnvironment=iE;function aE(e){return e&&e.properties&&ir(e.properties.permissions,ee.environmentPermissions.CreateDatabase)}y.canUserCreateDatabase=aE;function oE(e){return!!(e&&e.properties&&e.properties.provisioningState&&df(e.properties.provisioningState,ee.EnvironmentProvisioningStates.LinkedDatabaseProvisioning))}y.isDatabaseInProvisioningState=oE;function sE(e){return!!e&&!!e.properties&&e.properties.provisioningState===ee.EnvironmentProvisioningStates.Creating}y.isEnvironmentInCreatingState=sE;function lE(e){return e&&e.properties&&(e.properties.provisioningState===ee.EnvironmentProvisioningStates.Deleted||e.properties.provisioningState===ee.EnvironmentProvisioningStates.Deleting||e.properties.provisioningState===ee.EnvironmentProvisioningStates.FailedDeleting)}y.isEnvironmentInDeletedState=lE;function uE(e){return!!e&&!!e.properties&&!!e.properties.expirationTime&&Date.parse(e.properties.expirationTime)<Date.now()}y.isEnvironmentExpired=uE;function cE(e){return!!e&&!!e.properties&&!!e.properties.linkedEnvironmentMetadata&&e.properties.linkedEnvironmentMetadata.platformSku==="Lite"&&!!e.properties.states&&!!e.properties.states.management&&e.properties.states.management.id==="Running"&&!!e.properties.ongoingOperation&&!!e.properties.ongoingOperation.type&&e.properties.ongoingOperation.type.id==="Promote"}y.isLiteEnvironmentUpgrading=cE;function dE(e){return!!e&&!!e.properties&&!!e.properties.cluster&&e.properties.cluster.category==="Test"}y.isEnvironmentInTestCluster=dE;function pE(e){return!!e&&!!e.properties&&!!e.properties.cluster&&e.properties.cluster.category==="Preprod"}y.isEnvironmentInPreprodCluster=pE;function fE(e){return!!e&&!!e.properties&&!!e.properties.cluster&&e.properties.cluster.category==="FirstRelease"}y.isEnvironmentInFirstReleaseCluster=fE;function mE(e){return e&&e.name||""}y.getEnvironmentName=mE;function hE(e){return e&&e.properties&&e.properties.displayName||""}y.getEnvironmentDisplayName=hE;var of="9.1.0.8202";y.cdsVersionSupportingOSColorEdit="9.1.0000.20708";function gE(e){return uf(e,of)}y.doesCds2EnvironmentSupportApiVersion9_1=gE;function vE(e){return Wl(e,of)}y.doesCds2VersionSupportApiVersion9_1=vE;function sf(e){let t=ar(e);if(t)return t.securityGroupId}function lf(e){return e&&e.properties&&e.properties.connectedGroups}function bE(e,t){let r=lf(e);return!!r&&!!r.find(n=>n.id===t)||sf(e)===t}y.hasSecurityGroupId=bE;function yE(e){let t=lf(e);return t&&t.length>0&&t[0].id?t[0].id:sf(e)}y.getSecurityOrConnectedGroupId=yE;function uf(e,t){let r=e.version;return r?Wl(r,t):!1}y.isCds2EnvironmentVersionAtLeast=uf;function Wl(e,t){return t?e?(0,$D.default)(e,t)>=0:!1:!0}y.checkVersions=Wl;function CE(e){return e&&e.properties&&e.properties.updateCadence&&e.properties.updateCadence.id||"NotSpecified"}y.getEnvironmentUpdateCadence=CE;function AE(e){let t=ar(e);return t?Number(t.baseLanguage):0}y.getEnvironmentLanguageCode=AE;function cf(e){let t=ar(e);return t?t.instanceApiUrl:void 0}y.getEnvironmentInstanceApiUrl=cf;function wE(e){let t=cf(e);return t?t+"/api/data/v9.2":""}y.getEnvironmentWebApiUrl=wE;function NE(e){let t=Ir(e);if(t==="")return"";let r=t.split("/");if(r.length!==4)return"";let n=r[2].split(".");return n[0]="globaldisco",r[2]=n.join("."),r.join("/")+"api/discovery/v2.0/Instances"}y.getEnvironmentDiscoveryUrl=NE;var SE=e=>{var t;return((t=e.properties)===null||t===void 0?void 0:t.databaseType)===ee.DatabaseType.CommonDataService};y.hasCommonDataServiceDatabase=SE;var DE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.AdminReadEnvironment)};y.doesUserHaveAdminPermission=DE;var EE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreatePowerApp)};y.doesUserHaveCreateAppPermission=EE;var IE=e=>(0,y.doesUserHaveAdminPermission)(e)&&(0,y.hasCommonDataServiceDatabase)(e)?!0:(0,y.doesUserHaveCreateAppPermission)(e)?Ti(e)||(0,y.doesUserHaveDatabaseTablePermissions)(e):!1;y.isUserMakerWithDataAccess=IE;var _E=e=>(0,y.doesUserHaveCreateAppPermission)(e)&&!Ti(e)&&!(0,y.doesUserHaveDatabaseTablePermissions)(e)&&(!(0,y.doesUserHaveAdminPermission)(e)||!(0,y.hasCommonDataServiceDatabase)(e));y.isUserMakerWithoutDataAccess=_E;var PE=e=>[ee.environmentPermissions.CreateDatabaseEntities,ee.environmentPermissions.ListDatabaseEntities,ee.environmentPermissions.UpdateDatabaseEntities,ee.environmentPermissions.DeleteDatabaseEntities].every(t=>{var r;return ir((r=e.properties)===null||r===void 0?void 0:r.permissions,t)});y.doesUserHaveDatabaseTablePermissions=PE;var OE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreateDatabase)};y.doesUserHaveCreateDatabasePermission=OE;function df(e,t){return!e&&!t?!0:!e||!t?!1:e.toUpperCase()===t.toUpperCase()}y.equalsIgnoreCase=df;var FE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreateFlow)};y.doesUserHaveCreateFlowPermission=FE;var TE=e=>(0,y.doesUserHaveAdminPermission)(e)&&(0,y.hasCommonDataServiceDatabase)(e)?!0:(0,y.doesUserHaveCreateFlowPermission)(e)?Ti(e)||(0,y.doesUserHaveDatabaseTablePermissions)(e):!1;y.isUserPautoMakerWithDataAccess=TE;var RE=e=>(0,y.doesUserHaveCreateFlowPermission)(e)&&!Ti(e)&&!(0,y.doesUserHaveDatabaseTablePermissions)(e)&&(!(0,y.doesUserHaveAdminPermission)(e)||!(0,y.hasCommonDataServiceDatabase)(e));y.isUserPautoMakerWithoutDataAccess=RE;var xE=e=>{var t,r;return!ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreateFlow)&&ir((r=e.properties)===null||r===void 0?void 0:r.permissions,ee.environmentPermissions.ReadEnvironment)};y.doesUserHaveFlowRunOnlyPermission=xE});var jl=m(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getRequiredComponentsQueryUrl=v.solutionComponentCountSummariesQueryUrl=v.solutionComponentSummariesQueryUrl=v.solutionComponentConfigurationsQueryUrl=v.chartsQueryUrl=v.workflowsQueryUrl=v.entityDefinitionsQueryUrl=v.solutionComponentDefinitionsQueryUrl=v.getCreateNewArticleTemplateUrl=v.getCreateNewPublisherUrl=v.getEnableSecurityRolesUrl=v.getArticleTemplateUrl=v.getFieldSecurityProfileDesignerUrl=v.getSecurityRoleDesignerUrl=v.getMailMergeTemplateDesignerUrl=v.getEmailTemplateDesignerUrl=v.getConnectionRoleDesignerUrl=v.getSiteMapDesignerUrl=v.getWebResourceFileUrl=v.getWebResourceDesignerUrl=v.getReportDesignerUrl=v.getBusinessProcessFlowDesignerUrl=v.getProcessShareUrl=v.getProcessDesignerUrl=v.getChartDesignerUrl=v.getOpenModernEntityDashboardUrl=v.getNewModernEntityDashboardUrl=v.getNewModernDashboardUrl=v.getOpenModernDashboardUrl=v.getDashboardDesignerUrl=v.getAppModuleDesignerUrl=v.privilegesQueryUrls=v.xrmApiUrl=v.getPlayAppModuleUrl=v.getCrmAdminSecurityUsersUrl=v.getCrmAdminSecurityRolesUrl=v.getCrmMyAppsUrl=v.getCrmAppDesignerUrl=v.getCrmDevResourcesUrl=v.getCrmAllPublishersUrl=v.getCrmAllSolutionsUrl=v.getSolutionPublisherUrl=v.getExportTranslationFileName=v.getExportSolutionTranslationUrl=v.getImportSolutionTranslationUrl=v.getShowSolutionDependenciesUrl=v.getShowComponentDependenciesUrl=v.cdsServiceUrl=v.ODATA_NEXT_LINK=v.ODATA_MAX_PAGE_SIZE=void 0;v.retrieveOrganizationResources=v.getUCIEntityRecordEditUrl=v.getUCIEntityRecordBaseUrl=v.getBusinessRuleDesignerUri=v.retrieveUnpublishedSuffix=v.getSavePowerSettingUri=v.getPowerSettingUri=v.getPowerSettingsUri=v.RetrievePlatform=v.getAppSettingOverrideUri=v.AppSettingOverrideName=v.getOrgSettingOverrideUri=v.OrgSettingOverrideName=v.getSettingDefinitionsUri=v.retrieveFeatureControlSettingsByNamespaceUrl=v.retrieveDeploymentPipelineConfigAppUrl=v.SPNPrincipalIdUrl=v.retrieveDeploymentEnvironmentInfoUrl=v.devSolutionInfoUrl=v.deployOperationStatusUrl=v.getAIGeneratedDeploymentNotesUrl=v.deploymentStageRunUrl=v.validatePackageAsyncUrl=v.deployPackageAsyncUrl=v.updateDeploymentStageRunUrl=v.createDeploymentStageRunUrl=v.retrieveDeploymentStagesUrl=v.retrievePipelinesUrl=v.retrieveDeploymentPipelineInfoUrl=v.getDeploymentStageRunsUrl=v.appDeploymentUrls=v.getProvisionLanguageUrl=v.getSolutionQueryUrl=v.getSolutionsByUniqueNameQueryUrl=v.solutionsQueryUrl=v.getDependentComponentsWithMetadataQueryUrl=void 0;var ff=pf();v.ODATA_MAX_PAGE_SIZE="odata.maxpagesize";v.ODATA_NEXT_LINK="@odata.nextLink";v.cdsServiceUrl="https://cds-org/";var xi;(function(e){e.AllSolutions="11",e.AllPublishers="10",e.DevResources="05"})(xi||(xi={}));function LE(e,t,r,n){return`${e}tools/dependency/dependencyviewdialog.aspx?appSolutionId=%7b${t}%7d&dType=1&objectid=%7b${r}%7d&objecttype=${n}&operationtype=showdependency`}v.getShowComponentDependenciesUrl=LE;function ME(e,t){let r=`dType=1&isproactivecheck=true&objecttype=7100&operationtype=dependenciesforuninstall&objectid=${t}`;return`${e}tools/dependency/dependencyviewdialog.aspx?${r}`}v.getShowSolutionDependenciesUrl=ME;function UE(e,t){return`${e}tools/muiProvisioning/Dialogs/LangTranslationsImport.aspx?dType=1&appSolutionId=${t}`}v.getImportSolutionTranslationUrl=UE;function BE(e,t){return`${e}_grid/cmds/dlg_exportsolution.aspx?command=exporttranslation&appSolutionId=${t}`}v.getExportSolutionTranslationUrl=BE;function kE(e,t){return e!==void 0&&t!==void 0&&`CrmTranslations_${e}_${t.replace(/[.]/g,"_")}.zip`||""}v.getExportTranslationFileName=kE;function qE(e,t,r){return r?`${e}tools/publisher/edit.aspx?appSolutionId=%7b${r}%7d&id=%7b${t}%7d`:`${e}tools/publisher/edit.aspx?id=%7b${t}%7d`}v.getSolutionPublisherUrl=qE;function Hl(e,t){return`${e}tools/systemcustomization/systemCustomization.aspx?pid=${t}`}function $E(e){return Hl(e,xi.AllSolutions)}v.getCrmAllSolutionsUrl=$E;function VE(e){return Hl(e,xi.AllPublishers)}v.getCrmAllPublishersUrl=VE;function GE(e){return Hl(e,xi.DevResources)}v.getCrmDevResourcesUrl=GE;function zE(e,t=ff.crmBapSolutionId){return`${e}designer/app/${t}#/CreateNewApp`}v.getCrmAppDesignerUrl=zE;function WE(e){return`${e}apps`}v.getCrmMyAppsUrl=WE;function jE(e){return mf(e,"role")+"&forceUCI=0"}v.getCrmAdminSecurityRolesUrl=jE;function HE(e){return`${mf(e,"systemuser")}&forceclassic=1`}v.getCrmAdminSecurityUsersUrl=HE;function mf(e,t){return`${e}main.aspx?pagetype=entitylist&etn=${t}`}function JE(e,t){return`${e}main.aspx?appid=${t}`}v.getPlayAppModuleUrl=JE;v.xrmApiUrl="api/data/v9.0";v.privilegesQueryUrls={systemUserInfo:e=>`${e}${v.xrmApiUrl}/WhoAmI`,userPrivileges:(e,t)=>`${e}${v.xrmApiUrl}/systemusers(${t})/Microsoft.Dynamics.CRM.RetrieveUserPrivileges`,systemPrivileges:e=>`${e}${v.xrmApiUrl}/privileges/Microsoft.Dynamics.CRM.RetrievePrivilegeSet`};function QE(e,t,r=ff.crmBapSolutionId){return`${e}designer/app/${r}/${t}/AppDesignerCanvas/${t}`}v.getAppModuleDesignerUrl=QE;function XE(e,t,r,n){return`${e}main.aspx?appSolutionId=%7b${r}%7d&extraqs=%26formId%3d%7b${t}%7d%26dashboardType%3d1030&pagetype=${`${n?"ic":""}dashboardeditor`}`}v.getDashboardDesignerUrl=XE;function KE(e,t,r){return`/e/${e}/s/${t}/dashboard/${r}`}v.getOpenModernDashboardUrl=KE;function YE(e,t,r){let n=r!==void 0?r.toString():void 0;return`/e/${e}/s/${t}/dashboard/new${n?`/${n}`:""}`}v.getNewModernDashboardUrl=YE;function ZE(e,t,r,n){let i=n!==void 0?n.toString():void 0;return`/e/${e}/s/${t}/n/${r}/dashboard/new${i?`/${i}`:""}`}v.getNewModernEntityDashboardUrl=ZE;function eI(e,t,r,n){return`/e/${e}/s/${t}/n/${r}/dashboard/${n}`}v.getOpenModernEntityDashboardUrl=eI;function tI(e,t,r,n){return`${e}main.aspx?appSolutionId=%7b${t}%7d&extraqs=etc=${r||""}`+(n?`%26id=${n}`:"")+"&pagetype=vizdesigner"}v.getChartDesignerUrl=tI;function rI(e,t,r){return`${e}sfa/workflow/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getProcessDesignerUrl=rI;function nI(e,t,r){return`${e}sfa/workflow/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getProcessShareUrl=nI;function iI(e,t){return`${e}Tools/ProcessControl/UnifiedProcessDesigner.aspx?id=${t}`}v.getBusinessProcessFlowDesignerUrl=iI;function aI(e,t,r){return`${e}CRMReports/reportproperty.aspx?appSolutionId=%7b${r}%7d&disablePersonal=true&id=%7b${t}%7d`}v.getReportDesignerUrl=aI;function oI(e,t,r){return`${e}main.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&etc=9333&id=%7b${t}%7d&pagetype=webresourceedit`}v.getWebResourceDesignerUrl=oI;function sI(e,t){return`${e}WebResources/${t}`}v.getWebResourceFileUrl=sI;function lI(e,t,r){return`${e}designer/sitemap/${r}/${t}/SiteMapHome/${t}`}v.getSiteMapDesignerUrl=lI;function uI(e,t,r){return`${e}connections/connectionroles/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getConnectionRoleDesignerUrl=uI;function cI(e,t,r){return`${e}tools/emailtemplateeditor/emailtemplateeditor.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getEmailTemplateDesignerUrl=cI;function dI(e,t,r){return`${e}tools/mailmerge/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getMailMergeTemplateDesignerUrl=dI;function pI(e,t,r){return`${e}biz/roles/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getSecurityRoleDesignerUrl=pI;function fI(e,t,r){return`${e}biz/fieldsecurityprofiles/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getFieldSecurityProfileDesignerUrl=fI;function mI(e,t,r){return`${e}tools/kbtemplateeditor/kbtemplateeditor.aspx?_CreateFromId=%7b${t}%7d&_CreateFromType=7100&appSolutionId=%7b${t}%7d&id=%7b${r}%7d`}v.getArticleTemplateUrl=mI;function hI(e,t,r,n){return`${e}tools/FormEditor/Dialogs/FormRoleAssignment.aspx?appSolutionId=%7b${t}%7d&dType=1&formId=%7b${r}%7d&objectTypeCode=0&type=${n}`}v.getEnableSecurityRolesUrl=hI;function gI(e){return`${e}tools/publisher/edit.aspx`}v.getCreateNewPublisherUrl=gI;function vI(e,t){return`${e}tools/kbtemplateeditor/kbtemplateeditor.aspx?appSolutionId=${t}`}v.getCreateNewArticleTemplateUrl=vI;v.solutionComponentDefinitionsQueryUrl="api/data/v9.0/solutioncomponentdefinitions";v.entityDefinitionsQueryUrl="api/data/v9.0/EntityDefinitions?$select=EntitySetName,DisplayName,LogicalName&$filter=";v.workflowsQueryUrl="api/data/v9.0/workflows";v.chartsQueryUrl="/api/data/v9.0/savedqueryvisualizations";v.solutionComponentConfigurationsQueryUrl="/api/data/v9.1/solutioncomponentconfigurations?$filter=isdisplayable eq true&$select=name";v.solutionComponentSummariesQueryUrl="/api/data/v9.0/msdyn_solutioncomponentsummaries";v.solutionComponentCountSummariesQueryUrl="/api/data/v9.0/msdyn_solutioncomponentcountsummaries";function bI(e,t){return`${v.xrmApiUrl}/RetrieveRequiredComponents(ObjectId=${e},ComponentType=${t})`}v.getRequiredComponentsQueryUrl=bI;function yI(e,t){return`${v.cdsServiceUrl}${v.xrmApiUrl}/RetrieveDependentComponentsWithMetadata(ObjectId=${e},ComponentType=${t})`}v.getDependentComponentsWithMetadataQueryUrl=yI;v.solutionsQueryUrl="/api/data/v9.0/solutions?$expand=publisherid&$filter=(isvisible eq true)";function CI(e){return`/api/data/v9.0/solutions?$expand=publisherid&$filter=(uniquename eq '${e}')`}v.getSolutionsByUniqueNameQueryUrl=CI;function AI(e){return`/api/data/v9.0/solutions(${e})?$expand=publisherid`}v.getSolutionQueryUrl=AI;function wI(e){return`${e}api/data/v9.1/ProvisionLanguageForUser`}v.getProvisionLanguageUrl=wI;v.appDeploymentUrls={associateEnvironmentToPipelineUrl:e=>`/api/data/v9.0/deploymentpipelines(${e})/deploymentpipeline_deploymentenvironment/$ref`,deploymentArtifactsUrl:"/api/data/v9.0/deploymentartifacts",deploymentEnvironmentUrl:"/api/data/v9.0/deploymentenvironments",deploymentPipelinesUrl:"/api/data/v9.0/deploymentpipelines",deploymentStagesUrl:"/api/data/v9.0/deploymentstages",retrieveDeploymentPipelinesUrl:e=>`/api/data/v9.0/RetrieveDeploymentPipelines(SourceEnvironmentId='${e}')`,deletePipelinesUrl:e=>`/api/data/v9.0/deploymentpipelines(${e})`};function NI(e,t,r,n=!1,i=!1,a=!1,o=!1,s=!1,l=!1,u=!1){return`/api/data/v9.1/deploymentstageruns
+`)),this.type=t,this.id=r,this.issues=u,this.pointer=(o=(a=u[0])===null||a===void 0?void 0:a.pointer)!==null&&o!==void 0?o:"",this.rule=(l=(s=u[0])===null||s===void 0?void 0:s.rule)!==null&&l!==void 0?l:"invalid"}};Z.ValidationError=Tl;var Rl=class extends Je{constructor(t){super("INVALID_ARGUMENT",t)}};Z.InvalidArgumentError=Rl;var Fl=class extends Je{constructor(t,r,n,i){super("VERSION_CONFLICT",`Version conflict for ${t}/${r}: local=${n??"(none)"}, server=${i??"(none)"}. Re-fetch and reapply changes.`),this.type=t,this.id=r,this.localEtag=n,this.serverEtag=i}};Z.VersionConflictError=Fl;var xl=class extends Je{constructor(t,r,n,i){super("CONNECTION_ERROR",r>0?`HTTP ${r} from ${t}: ${n}`:`Transport failure reaching ${t}: ${n}`),this.url=t,this.statusCode=r,this.cause=i}};Z.ConnectionError=xl;var Ll=class extends Je{constructor(t){super("WORKSPACE_NOT_INITIALIZED",`Workspace not initialized at ${t}. Call initWorkspace() first.`),this.workspacePath=t}};Z.WorkspaceNotInitializedError=Ll;var Ml=class extends Je{constructor(t,r){super("NOT_IMPLEMENTED",`Operation '${t}' is not implemented yet${r?`: ${r}`:""}.`),this.operation=t}};Z.NotImplementedError=Ml;var Ul=class extends Je{constructor(t,r){super("INVALID_JSON_POINTER",`Invalid JSON Pointer '${t}': ${r}`),this.pointer=t}};Z.JsonPointerError=Ul;var Bl=class extends Je{constructor(t,r,n){super("AMBIGUOUS_ARTIFACT",`Found ${n} ${t} rows matching '${r}'; a name is not a unique key. Resolve by id / alternate key instead of relying on name-based idempotency.`),this.kind=t,this.identity=r,this.matchCount=n}};Z.AmbiguousArtifactError=Bl;var kl=class extends Je{constructor(t,r){super("PATH_TRAVERSAL",`Refusing to resolve a path outside the workspace root: '${t}' is not within '${r}'.`),this.target=t,this.root=r}};Z.PathTraversalError=kl;var ql=class extends Je{constructor(t,r){super("INCOMPATIBLE_WORKSPACE",`Workspace schema version ${t} is newer than this SDK supports (v${r}). Upgrade the SDK, or re-create the workspace with this version.`),this.workspaceVersion=t,this.supportedVersion=r}};Z.IncompatibleWorkspaceError=ql});var lo=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.JsonPointer=void 0;var pt=be(),oo=class e{static isReservedToken(t){return e.RESERVED_TOKENS.has(t)}static decodeToken(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}static encodeToken(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}static parse(t){if(t==="")return[];if(t[0]!=="/")throw new pt.JsonPointerError(t,'non-empty pointers must start with "/"');return t.substring(1).split("/").map(r=>{if(/~(?![01])/.test(r))throw new pt.JsonPointerError(t,`invalid '~' escape in token '${r}' (expected ~0 or ~1)`);return e.decodeToken(r)})}static compile(t){return t.length===0?"":"/"+t.map(r=>e.encodeToken(r)).join("/")}static resolve(t,r){let n=e.parse(r),i=t;for(let a of n)if(Array.isArray(i)){let o=e.toArrayIndex(a,i.length);if(o===void 0)return;i=i[o]}else if(i!==null&&typeof i=="object"){let o=i;if(e.isReservedToken(a)||!Object.prototype.hasOwnProperty.call(o,a))return;i=o[a]}else return;return i}static set(t,r,n){let i=e.parse(r);if(i.length===0)throw new pt.JsonPointerError(r,"cannot set the document root");let{parent:a,lastToken:o}=e.resolveParent(t,i,r);if(Array.isArray(a)){let s=e.toArrayIndex(o,a.length);if(s===void 0)throw new pt.JsonPointerError(r,`'${o}' is not a valid array index`);if(s>a.length)throw new pt.JsonPointerError(r,`array index '${o}' is out of range`);a[s]=n}else{if(e.isReservedToken(o))throw new pt.JsonPointerError(r,`refusing to write reserved property '${o}'`);a[o]=n}}static remove(t,r){let n=e.parse(r);if(n.length===0)throw new pt.JsonPointerError(r,"cannot remove the document root");let{parent:i,lastToken:a}=e.resolveParent(t,n,r);if(Array.isArray(i)){let o=e.toArrayIndex(a,i.length);if(o===void 0||o>=i.length)throw new pt.JsonPointerError(r,`array index '${a}' is out of range`);i.splice(o,1)}else{if(e.isReservedToken(a))throw new pt.JsonPointerError(r,`refusing to remove reserved property '${a}'`);delete i[a]}}static add(t,r,n,i){let a=e.parse(r);if(a.length>0&&a[a.length-1]==="-"){let l=e.compile(a.slice(0,-1)),u=e.resolve(t,l);if(!Array.isArray(u))throw new pt.JsonPointerError(r,"add target must be an array");u.push(n);return}let o=e.resolve(t,r);if(!Array.isArray(o))throw new pt.JsonPointerError(r,"add target must be an array");let s=i===void 0?o.length:i;if(s<0||s>o.length)throw new pt.JsonPointerError(r,`insert index ${s} is out of range`);o.splice(s,0,n)}static parent(t){let r=e.parse(t);return r.pop(),e.compile(r)}static lastToken(t){let r=e.parse(t);return r.length===0?"":r[r.length-1]}static append(t,r){return`${t}/${e.encodeToken(String(r))}`}static resolveParent(t,r,n){let i=r[r.length-1],a=e.compile(r.slice(0,-1)),o=e.resolve(t,a);if(o===null||typeof o!="object")throw new pt.JsonPointerError(n,"parent path does not resolve to an object or array");return{parent:o,lastToken:i}}static toArrayIndex(t,r){if(t==="-")return r;if(/^(0|[1-9][0-9]*)$/.test(t))return Number(t)}};so.JsonPointer=oo;oo.RESERVED_TOKENS=new Set(["__proto__","prototype","constructor"])});var qp=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.findElements=void 0;var kp=lo();function xD(e,t){let r=[];return $l(e,"",t,r),r}uo.findElements=xD;function $l(e,t,r,n){if(!(e===null||typeof e!="object"))if(r(e,t)&&n.push({pointer:t,value:e}),Array.isArray(e))e.forEach((i,a)=>{$l(i,kp.JsonPointer.append(t,a),r,n)});else for(let i of Object.keys(e))$l(e[i],kp.JsonPointer.append(t,i),r,n)}});var Gp=m(Qe=>{"use strict";var LD=Qe&&Qe.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),MD=Qe&&Qe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Vp=Qe&&Qe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&LD(t,e,r);return MD(t,e),t};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.WorkspaceManager=Qe.WORKSPACE_SCHEMA_VERSION=void 0;var he=Vp(require("fs")),ye=Vp(require("path")),wn=be();Qe.WORKSPACE_SCHEMA_VERSION=1;var co={form:"forms",view:"views",businessRule:"business-rules",app:"apps",command:"commands",chart:"charts",dashboard:"dashboards"},UD="manifest.json",po=".metadata",$p="entities",Vl=class{constructor(t,r){this.workspacePath=t,this.instanceUrl=r}getRoot(){return this.workspacePath}getArtifactDir(t){return ye.join(this.workspacePath,co[t])}getArtifactFilePath(t,r){return this.assertSafeId(r),this.assertWithinRoot(ye.join(this.getArtifactDir(t),`${fo(r)}.json`))}getMetaFilePath(t,r){return this.assertSafeId(r),this.assertWithinRoot(ye.join(this.workspacePath,po,co[t],`${fo(r)}.meta.json`))}getEntityMetaFilePath(t){return this.assertSafeId(t),this.assertWithinRoot(ye.join(this.workspacePath,po,$p,`${t}.json`))}assertSafeId(t){if(typeof t!="string"||t.length===0||/[\u0000-\u001f]/.test(t)||t.includes("/")||t.includes("\\")||t.includes(":")||t==="."||t===".."||t.includes("..")||ye.basename(t)!==t)throw new wn.PathTraversalError(String(t),this.workspacePath)}assertWithinRoot(t){let r=ye.resolve(this.workspacePath),n=ye.resolve(t);if(n!==r&&!n.startsWith(r+ye.sep))throw new wn.PathTraversalError(t,this.workspacePath);let i=he.existsSync(r)?he.realpathSync(r):r,a=n,o=[];for(;!he.existsSync(a);){o.unshift(ye.basename(a));let l=ye.dirname(a);if(l===a)break;a=l}let s=ye.resolve(he.realpathSync(a),...o);if(s!==i&&!s.startsWith(i+ye.sep))throw new wn.PathTraversalError(t,this.workspacePath);return n}get manifestPath(){return ye.join(this.workspacePath,UD)}init(){for(let t of Object.keys(co))he.mkdirSync(this.getArtifactDir(t),{recursive:!0}),he.mkdirSync(ye.dirname(this.getMetaFilePath(t,"x")),{recursive:!0});if(he.mkdirSync(ye.join(this.workspacePath,po,$p),{recursive:!0}),!this.exists(this.manifestPath)){let t={instanceUrl:this.instanceUrl,createdAt:new Date().toISOString(),artifacts:[]};this.writeManifest(t)}}isInitialized(){return this.exists(this.manifestPath)}ensureInitialized(){if(!this.isInitialized())throw new wn.WorkspaceNotInitializedError(this.workspacePath)}clean(){for(let r of Object.keys(co))Gl(this.getArtifactDir(r));Gl(ye.join(this.workspacePath,po));let t=this.getManifest();t.artifacts=[],t.lastSyncAt=void 0,this.init(),this.writeManifest(t)}readArtifact(t,r){return this.ensureInitialized(),this.readJson(this.getArtifactFilePath(t,r))}writeArtifact(t,r,n){this.ensureInitialized(),this.writeJson(this.getArtifactFilePath(t,r),n),this.upsertManifestEntry(t,r,n)}deleteArtifact(t,r){this.ensureInitialized(),this.removeFile(this.getArtifactFilePath(t,r)),this.removeFile(this.getMetaFilePath(t,r));let n=fo(r),i=this.getManifest();i.artifacts=i.artifacts.filter(a=>!(a.type===t&&a.id===n)),this.writeManifest(i)}listArtifacts(t,r){return this.ensureInitialized(),this.getManifest().artifacts.filter(n=>!(t&&n.type!==t||r?.entityLogicalName&&n.entityLogicalName!==r.entityLogicalName))}readEntityMetadata(t){this.ensureInitialized();let r=this.readJson(this.getEntityMetaFilePath(t));return!r||typeof r.schemaName!="string"||typeof r.primaryNameAttribute!="string"||typeof r.primaryIdAttribute!="string"||typeof r.isCustomEntity!="boolean"?null:r}writeEntityMetadata(t,r){this.ensureInitialized(),this.writeJson(this.getEntityMetaFilePath(t),r)}getManifest(){this.ensureInitialized();let t=this.readJson(this.manifestPath);if(!t)throw new wn.WorkspaceNotInitializedError(this.workspacePath);if(t.schemaVersion!==void 0&&t.schemaVersion>Qe.WORKSPACE_SCHEMA_VERSION)throw new wn.IncompatibleWorkspaceError(t.schemaVersion,Qe.WORKSPACE_SCHEMA_VERSION);return t}writeManifest(t){this.writeJson(this.manifestPath,{...t,schemaVersion:Qe.WORKSPACE_SCHEMA_VERSION})}updateManifest(t){let r=this.getManifest();this.writeManifest({...r,...t})}upsertManifestEntry(t,r,n){let i=this.getManifest(),a=fo(r),o=n,s=typeof o.name=="string"?o.name:`${t}:${a}`,l=typeof o.entityLogicalName=="string"?o.entityLogicalName:void 0,u=i.artifacts.find(c=>c.type===t&&c.id===a);u?(u.name=s,u.entityLogicalName=l):i.artifacts.push({type:t,id:a,name:s,entityLogicalName:l,isDirty:!1}),this.writeManifest(i)}readJson(t){return this.exists(t)?JSON.parse(he.readFileSync(t,"utf8")):null}writeJson(t,r){let n=ye.dirname(t);he.mkdirSync(n,{recursive:!0});let i=ye.join(n,`.${ye.basename(t)}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`);try{he.writeFileSync(i,`${JSON.stringify(r,null,2)}
+`,"utf8"),he.renameSync(i,t)}catch(a){try{he.existsSync(i)&&he.unlinkSync(i)}catch{}throw a}}removeFile(t){this.exists(t)&&he.unlinkSync(t)}exists(t){return he.existsSync(t)}};Qe.WorkspaceManager=Vl;function fo(e){let r=/^\{?([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\}?$/.exec(e);return r?r[1].toLowerCase():e.toLowerCase()}function Gl(e){let t;try{t=he.lstatSync(e)}catch{return}if(t.isSymbolicLink()){try{he.unlinkSync(e)}catch{he.rmdirSync(e)}return}if(!t.isDirectory()){he.unlinkSync(e);return}for(let r of he.readdirSync(e))Gl(ye.join(e,r));he.rmdirSync(e)}});var Jp=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.deepEqual=Nn.deepDiff=void 0;var BD=lo();function kD(e,t){let r=[];return Wp(e,t,"",r,0),r}Nn.deepDiff=kD;var mo=Symbol("missing"),ho=512;function Wp(e,t,r,n,i){if(e===t)return;if(i>ho)throw new RangeError(`deepDiff exceeded the maximum supported depth of ${ho}`);let a=go(e),o=go(t);if(a&&o&&Array.isArray(e)===Array.isArray(t)){let s=qD(e,t);for(let l of s){let u=zp(e,l),c=zp(t,l),d=BD.JsonPointer.append(r,l);u===mo?n.push({pointer:d,type:"added",newValue:c}):c===mo?n.push({pointer:d,type:"removed",oldValue:u}):Wp(u,c,d,n,i+1)}return}jp(e,t)||n.push({pointer:r,type:"modified",oldValue:e,newValue:t})}function go(e){return e!==null&&typeof e=="object"}function qD(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=Math.max(e.length,t.length),i=[];for(let a=0;a<n;a++)i.push(String(a));return i}let r=new Set([...Object.keys(e),...Object.keys(t)]);return Array.from(r)}function zp(e,t){if(Array.isArray(e)){let r=Number(t);return r<e.length?e[r]:mo}return t in e?e[t]:mo}function jp(e,t){return Hp(e,t,0)}Nn.deepEqual=jp;function Hp(e,t,r){if(e===t)return!0;if(r>ho)throw new RangeError(`deepEqual exceeded the maximum supported depth of ${ho}`);if(!go(e)||!go(t)||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every(a=>a in t&&Hp(e[a],t[a],r+1))}});var Xp=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.VersionManager=void 0;var Qp=Jp(),zl=class{constructor(t){this.workspace=t}storeMeta(t,r,n){this.workspace.writeJson(this.workspace.getMetaFilePath(t,r),n)}getMeta(t,r){return this.workspace.readJson(this.workspace.getMetaFilePath(t,r))}isDirty(t,r){let n=this.workspace.readArtifact(t,r);if(n===null)return!1;let i=this.getMeta(t,r);return i?!(0,Qp.deepEqual)(i.snapshot,n):!0}diff(t,r){let n=this.workspace.readArtifact(t,r),i=this.getMeta(t,r),a;return n===null?a=i?[{pointer:"",type:"removed",oldValue:i.snapshot}]:[]:i?a=(0,Qp.deepDiff)(i.snapshot,n):a=[{pointer:"",type:"added",newValue:n}],{artifactType:t,artifactId:r,changes:a}}checkConflict(t,r,n){let i=this.getMeta(t,r);return!i||i.etag===null?!1:i.etag!==n}};vo.VersionManager=zl});var Yp=m((Wl,Kp)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Wl=="object"?Kp.exports=t():e.compareVersions=t()})(Wl,function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(a,o){return a.indexOf(o)===-1?a.length:a.indexOf(o)}function r(a){var o=a.replace(/^v/,"").replace(/\+.*$/,""),s=t(o,"-"),l=o.substring(0,s).split(".");return l.push(o.substring(s+1)),l}function n(a){return isNaN(Number(a))?a:Number(a)}function i(a){if(typeof a!="string")throw new TypeError("Invalid argument expected string");if(!e.test(a))throw new Error("Invalid argument not valid semver ('"+a+"' received)")}return function(o,s){[o,s].forEach(i);for(var l=r(o),u=r(s),c=0;c<Math.max(l.length-1,u.length-1);c++){var d=parseInt(l[c]||0,10),f=parseInt(u[c]||0,10);if(d>f)return 1;if(f>d)return-1}var h=l[l.length-1],b=u[u.length-1];if(h&&b){var w=h.split(".").map(n),N=b.split(".").map(n);for(c=0;c<Math.max(w.length,N.length);c++){if(w[c]===void 0||typeof N[c]=="string"&&typeof w[c]=="number")return-1;if(N[c]===void 0||typeof w[c]=="string"&&typeof N[c]=="number"||w[c]>N[c])return 1;if(N[c]>w[c])return-1}}else if(h||b)return h?-1:1;return 0}})});var nf=m(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.EnvironmentFlowHostingType=fe.EnvironmentDisableReasonCode=fe.EnvironmentMigrationConstants=fe.EnvironmentProvisioningStates=fe.EnvironmentLocations=fe.EnvironmentCreationTypeConstants=fe.EnvironmentType=fe.EnvironmentSkuConstants=fe.environmentPermissions=fe.DatabaseType=void 0;var Zp;(function(e){e.CommonDataService="CommonDataService",e.None="None"})(Zp||(fe.DatabaseType=Zp={}));fe.environmentPermissions={CreatePowerApp:"CreatePowerApp",ReadEnvironment:"ReadEnvironment",GenerateResourceStorage:"GenerateResourceStorage",CreateGateway:"CreateGateway",CreateFlow:"CreateFlow",CreateCustomApi:"CreateCustomApi",AdminReadEnvironment:"AdminReadEnvironment",UpdateEnvironment:"UpdateEnvironment",DeleteEnvironment:"DeleteEnvironment",ExportEnvironmentPackage:"ExportEnvironmentPackage",SetDLPPolicy:"SetDLPPolicy",ListAnyPowerApp:"ListAnyPowerApp",ListAnyFlow:"ListAnyFlow",DeleteAnyPowerApp:"DeleteAnyPowerApp",DeleteAnyFlow:"DeleteAnyFlow",AddEnvironmentRoleAssignment:"AddEnvironmentRoleAssignment",ReadEnvironmentRoleInformation:"ReadEnvironmentRoleInformation",RemoveEnvironmentRoleAssignment:"RemoveEnvironmentRoleAssignment",ModifyDatabaseRoleAssignments:"ModifyDatabaseRoleAssignments",CreateDatabase:"CreateDatabase",ListDatabaseEntities:"ListDatabaseEntities",CreateDatabaseEntities:"CreateDatabaseEntities",UpdateDatabaseEntities:"UpdateDatabaseEntities",DeleteDatabaseEntities:"DeleteDatabaseEntities"};fe.EnvironmentSkuConstants={NotSpecified:"NotSpecified",Standard:"Standard",Premium:"Premium",Developer:"Developer",Basic:"Basic",Production:"Production",Sandbox:"Sandbox",Trial:"Trial",Default:"Default",Teams:"Teams",Platform:"Platform"};var ef;(function(e){e[e.CDS2=0]="CDS2",e[e.CDS1=1]="CDS1",e[e.Empty=2]="Empty"})(ef||(fe.EnvironmentType=ef={}));fe.EnvironmentCreationTypeConstants={NotSpecified:"NotSpecified",Legacy:"Legacy",DefaultTenant:"DefaultTenant",User:"User",CommonDataModelLegacy:"CommonDataModelLegacy"};fe.EnvironmentLocations={global:"global",unitedStates:"unitedstates",southamerica:"southamerica",europe:"europe",canada:"canada",preview:"unitedstatesfirstrelease",asia:"asia",japan:"japan",australia:"australia",india:"india",unitedkingdom:"unitedkingdom",france:"france",germany:"germany",brazil:"brazil",usgov:"usgov",usgovhigh:"usgovhigh",uae:"unitedarabemirates",switzerland:"switzerland",mooncake:"china",korea:"korea",norway:"norway",southafrica:"southafrica",dod:"usdod",singapore:"singapore",sweden:"sweden",italy:"italy",poland:"poland"};fe.EnvironmentProvisioningStates={NotSpecified:"NotSpecified",Succeeded:"Succeeded",Deleting:"Deleting",Deleted:"Deleted",FailedDeleting:"FailedDeleting",LinkedDatabaseProvisioning:"LinkedDatabaseProvisioning",LinkedDatabaseFailedProvisioning:"LinkedDatabaseFailedProvisioning",LinkedDatabaseFailedConfiguring:"LinkedDatabaseFailedConfiguring",LinkedDatabaseUnavailable:"LinkedDatabaseUnavailable",Creating:"Creating"};fe.EnvironmentMigrationConstants={phases:{completed:"Completed"}};var tf;(function(e){e.NotSpecified="NotSpecified",e.NoValidLicense="NoValidLicense",e.SuspendedLicense="SuspendedLicense",e.TrialExpiration="TrialExpiration",e.UserRequested="UserRequested",e.InstanceStateUpdate="InstanceStateUpdated",e.InactivityThreshold="InactivityThreshold",e.OperationsInitiated="OperationsInitiated",e.EnvironmentLifecycleOperation="EnvironmentLifecycleOperation",e.TenantPolicyEvaluation="TenantPolicyEvaluation"})(tf||(fe.EnvironmentDisableReasonCode=tf={}));var rf;(function(e){e.LogicApps="LogicApps",e.SelfHostSingleTenant="SelfHostSingleTenant",e.SelfHostMultiTenant="SelfHostMultiTenant"})(rf||(fe.EnvironmentFlowHostingType=rf={}))});var pf=m(y=>{"use strict";var $D=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(y,"__esModule",{value:!0});y.hasCommonDataServiceDatabase=y.getEnvironmentDiscoveryUrl=y.getEnvironmentWebApiUrl=y.getEnvironmentInstanceApiUrl=y.getEnvironmentLanguageCode=y.getEnvironmentUpdateCadence=y.checkVersions=y.isCds2EnvironmentVersionAtLeast=y.getSecurityOrConnectedGroupId=y.hasSecurityGroupId=y.doesCds2VersionSupportApiVersion9_1=y.doesCds2EnvironmentSupportApiVersion9_1=y.cdsVersionSupportingOSColorEdit=y.getEnvironmentDisplayName=y.getEnvironmentName=y.isEnvironmentInFirstReleaseCluster=y.isEnvironmentInPreprodCluster=y.isEnvironmentInTestCluster=y.isLiteEnvironmentUpgrading=y.isEnvironmentExpired=y.isEnvironmentInDeletedState=y.isEnvironmentInCreatingState=y.isDatabaseInProvisioningState=y.canUserCreateDatabase=y.isDisabledEnvironment=y.isDefaultEnvironment=y.isTrialEnvironment=y.isPlatformEnvironment=y.isTeamsEnvironment=y.isSandboxEnvironment=y.isProdEnvironment=y.isDevEnvironment=y.getEnvironmentType=y.getCrmInstanceName=y.getCrmInstanceUrl=y.getCrmAppDesignerUrl=y.getDevResourcesUrl=y.isEnvironmentInSuccessfulState=y.getAllThemesUrl=y.getAllPublishersUrl=y.getAllSolutionsUrl=y.getSecurityRolesUrl=y.getSecurityUsersUrl=y.environmentHasCds2Database=y.DEFAULT_SOLUTION_UNIQUE_NAME=y.DEFAULT_SOLUTION_ID=y.crmBapSolutionId=y.doesUserHavePermission=y.getLinkedEnvironmentMetadata=y.getCrmVersion=void 0;y.doesUserHaveFlowRunOnlyPermission=y.isUserPautoMakerWithoutDataAccess=y.isUserPautoMakerWithDataAccess=y.doesUserHaveCreateFlowPermission=y.equalsIgnoreCase=y.doesUserHaveCreateDatabasePermission=y.doesUserHaveDatabaseTablePermissions=y.isUserMakerWithoutDataAccess=y.isUserMakerWithDataAccess=y.doesUserHaveCreateAppPermission=y.doesUserHaveAdminPermission=void 0;var VD=$D(Yp()),ee=nf(),Ti=Hl();function GD(e){let t=ar(e);return t&&t.version}y.getCrmVersion=GD;function ar(e){return e&&e.properties&&e.properties.linkedEnvironmentMetadata}y.getLinkedEnvironmentMetadata=ar;function ir(e,t){return e?!!e[t]:!1}y.doesUserHavePermission=ir;y.crmBapSolutionId="00000001-0000-0000-0001-00000000009b";y.DEFAULT_SOLUTION_ID="fd140aaf-4df4-11dd-bd17-0019b9312238";y.DEFAULT_SOLUTION_UNIQUE_NAME="Default";function jr(e){return!!ar(e)&&af(e)}y.environmentHasCds2Database=jr;function zD(e){if(e&&jr(e)){let t=Ir(e);return(0,Ti.getCrmAdminSecurityRolesUrl)(t)}return""}y.getSecurityUsersUrl=zD;function WD(e){if(e&&jr(e)){let t=Ir(e);return(0,Ti.getCrmAdminSecurityUsersUrl)(t)}return""}y.getSecurityRolesUrl=WD;function jD(e){if(e&&jr(e)){let t=Ir(e);(0,Ti.getCrmAllSolutionsUrl)(t)}return""}y.getAllSolutionsUrl=jD;function HD(e){if(e&&jr(e)){let t=Ir(e);return(0,Ti.getCrmAllPublishersUrl)(t)}return""}y.getAllPublishersUrl=HD;function JD(e){return e&&jr(e)?Ir(e):""}y.getAllThemesUrl=JD;function af(e){return!!e&&e.properties&&!!e.properties.provisioningState&&e.properties.provisioningState.toUpperCase()===ee.EnvironmentProvisioningStates.Succeeded.toUpperCase()}y.isEnvironmentInSuccessfulState=af;function QD(e){if(e&&jr(e)){let t=Ir(e);return(0,Ti.getCrmDevResourcesUrl)(t)}return""}y.getDevResourcesUrl=QD;function XD(e){return`${e}designer/app/{${y.crmBapSolutionId}}/CreateNewApp}}`}y.getCrmAppDesignerUrl=XD;function Ir(e){let t=ar(e);if(t){let r=t.instanceUrl;return r?r.endsWith("/")?r:r+"/":""}return""}y.getCrmInstanceUrl=Ir;function KD(e){let t=ar(e);return t?t.uniqueName:""}y.getCrmInstanceName=KD;function YD(e){return ar(e)?ee.EnvironmentType.CDS2:e&&e.properties&&e.properties.namespace?ee.EnvironmentType.CDS1:ee.EnvironmentType.Empty}y.getEnvironmentType=YD;function ZD(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Developer}y.isDevEnvironment=ZD;function eE(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Production}y.isProdEnvironment=eE;function tE(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Sandbox}y.isSandboxEnvironment=tE;function Ri(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Teams}y.isTeamsEnvironment=Ri;function rE(e){return e&&e.properties&&e.properties.environmentSku===ee.EnvironmentSkuConstants.Platform}y.isPlatformEnvironment=rE;var nE=e=>{var t;return((t=e.properties)===null||t===void 0?void 0:t.environmentSku)===ee.EnvironmentSkuConstants.Trial};y.isTrialEnvironment=nE;function iE(e){return e&&e.properties&&(e.properties.isDefault||e.properties.creationType===ee.EnvironmentCreationTypeConstants.DefaultTenant)}y.isDefaultEnvironment=iE;function aE(e){return e&&e.properties&&!!e.properties.states&&!!e.properties.states.runtime&&e.properties.states.runtime.id==="Disabled"}y.isDisabledEnvironment=aE;function oE(e){return e&&e.properties&&ir(e.properties.permissions,ee.environmentPermissions.CreateDatabase)}y.canUserCreateDatabase=oE;function sE(e){return!!(e&&e.properties&&e.properties.provisioningState&&df(e.properties.provisioningState,ee.EnvironmentProvisioningStates.LinkedDatabaseProvisioning))}y.isDatabaseInProvisioningState=sE;function lE(e){return!!e&&!!e.properties&&e.properties.provisioningState===ee.EnvironmentProvisioningStates.Creating}y.isEnvironmentInCreatingState=lE;function uE(e){return e&&e.properties&&(e.properties.provisioningState===ee.EnvironmentProvisioningStates.Deleted||e.properties.provisioningState===ee.EnvironmentProvisioningStates.Deleting||e.properties.provisioningState===ee.EnvironmentProvisioningStates.FailedDeleting)}y.isEnvironmentInDeletedState=uE;function cE(e){return!!e&&!!e.properties&&!!e.properties.expirationTime&&Date.parse(e.properties.expirationTime)<Date.now()}y.isEnvironmentExpired=cE;function dE(e){return!!e&&!!e.properties&&!!e.properties.linkedEnvironmentMetadata&&e.properties.linkedEnvironmentMetadata.platformSku==="Lite"&&!!e.properties.states&&!!e.properties.states.management&&e.properties.states.management.id==="Running"&&!!e.properties.ongoingOperation&&!!e.properties.ongoingOperation.type&&e.properties.ongoingOperation.type.id==="Promote"}y.isLiteEnvironmentUpgrading=dE;function pE(e){return!!e&&!!e.properties&&!!e.properties.cluster&&e.properties.cluster.category==="Test"}y.isEnvironmentInTestCluster=pE;function fE(e){return!!e&&!!e.properties&&!!e.properties.cluster&&e.properties.cluster.category==="Preprod"}y.isEnvironmentInPreprodCluster=fE;function mE(e){return!!e&&!!e.properties&&!!e.properties.cluster&&e.properties.cluster.category==="FirstRelease"}y.isEnvironmentInFirstReleaseCluster=mE;function hE(e){return e&&e.name||""}y.getEnvironmentName=hE;function gE(e){return e&&e.properties&&e.properties.displayName||""}y.getEnvironmentDisplayName=gE;var of="9.1.0.8202";y.cdsVersionSupportingOSColorEdit="9.1.0000.20708";function vE(e){return uf(e,of)}y.doesCds2EnvironmentSupportApiVersion9_1=vE;function bE(e){return jl(e,of)}y.doesCds2VersionSupportApiVersion9_1=bE;function sf(e){let t=ar(e);if(t)return t.securityGroupId}function lf(e){return e&&e.properties&&e.properties.connectedGroups}function yE(e,t){let r=lf(e);return!!r&&!!r.find(n=>n.id===t)||sf(e)===t}y.hasSecurityGroupId=yE;function CE(e){let t=lf(e);return t&&t.length>0&&t[0].id?t[0].id:sf(e)}y.getSecurityOrConnectedGroupId=CE;function uf(e,t){let r=e.version;return r?jl(r,t):!1}y.isCds2EnvironmentVersionAtLeast=uf;function jl(e,t){return t?e?(0,VD.default)(e,t)>=0:!1:!0}y.checkVersions=jl;function AE(e){return e&&e.properties&&e.properties.updateCadence&&e.properties.updateCadence.id||"NotSpecified"}y.getEnvironmentUpdateCadence=AE;function wE(e){let t=ar(e);return t?Number(t.baseLanguage):0}y.getEnvironmentLanguageCode=wE;function cf(e){let t=ar(e);return t?t.instanceApiUrl:void 0}y.getEnvironmentInstanceApiUrl=cf;function NE(e){let t=cf(e);return t?t+"/api/data/v9.2":""}y.getEnvironmentWebApiUrl=NE;function SE(e){let t=Ir(e);if(t==="")return"";let r=t.split("/");if(r.length!==4)return"";let n=r[2].split(".");return n[0]="globaldisco",r[2]=n.join("."),r.join("/")+"api/discovery/v2.0/Instances"}y.getEnvironmentDiscoveryUrl=SE;var DE=e=>{var t;return((t=e.properties)===null||t===void 0?void 0:t.databaseType)===ee.DatabaseType.CommonDataService};y.hasCommonDataServiceDatabase=DE;var EE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.AdminReadEnvironment)};y.doesUserHaveAdminPermission=EE;var IE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreatePowerApp)};y.doesUserHaveCreateAppPermission=IE;var _E=e=>(0,y.doesUserHaveAdminPermission)(e)&&(0,y.hasCommonDataServiceDatabase)(e)?!0:(0,y.doesUserHaveCreateAppPermission)(e)?Ri(e)||(0,y.doesUserHaveDatabaseTablePermissions)(e):!1;y.isUserMakerWithDataAccess=_E;var PE=e=>(0,y.doesUserHaveCreateAppPermission)(e)&&!Ri(e)&&!(0,y.doesUserHaveDatabaseTablePermissions)(e)&&(!(0,y.doesUserHaveAdminPermission)(e)||!(0,y.hasCommonDataServiceDatabase)(e));y.isUserMakerWithoutDataAccess=PE;var OE=e=>[ee.environmentPermissions.CreateDatabaseEntities,ee.environmentPermissions.ListDatabaseEntities,ee.environmentPermissions.UpdateDatabaseEntities,ee.environmentPermissions.DeleteDatabaseEntities].every(t=>{var r;return ir((r=e.properties)===null||r===void 0?void 0:r.permissions,t)});y.doesUserHaveDatabaseTablePermissions=OE;var TE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreateDatabase)};y.doesUserHaveCreateDatabasePermission=TE;function df(e,t){return!e&&!t?!0:!e||!t?!1:e.toUpperCase()===t.toUpperCase()}y.equalsIgnoreCase=df;var RE=e=>{var t;return ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreateFlow)};y.doesUserHaveCreateFlowPermission=RE;var FE=e=>(0,y.doesUserHaveAdminPermission)(e)&&(0,y.hasCommonDataServiceDatabase)(e)?!0:(0,y.doesUserHaveCreateFlowPermission)(e)?Ri(e)||(0,y.doesUserHaveDatabaseTablePermissions)(e):!1;y.isUserPautoMakerWithDataAccess=FE;var xE=e=>(0,y.doesUserHaveCreateFlowPermission)(e)&&!Ri(e)&&!(0,y.doesUserHaveDatabaseTablePermissions)(e)&&(!(0,y.doesUserHaveAdminPermission)(e)||!(0,y.hasCommonDataServiceDatabase)(e));y.isUserPautoMakerWithoutDataAccess=xE;var LE=e=>{var t,r;return!ir((t=e.properties)===null||t===void 0?void 0:t.permissions,ee.environmentPermissions.CreateFlow)&&ir((r=e.properties)===null||r===void 0?void 0:r.permissions,ee.environmentPermissions.ReadEnvironment)};y.doesUserHaveFlowRunOnlyPermission=LE});var Hl=m(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getRequiredComponentsQueryUrl=v.solutionComponentCountSummariesQueryUrl=v.solutionComponentSummariesQueryUrl=v.solutionComponentConfigurationsQueryUrl=v.chartsQueryUrl=v.workflowsQueryUrl=v.entityDefinitionsQueryUrl=v.solutionComponentDefinitionsQueryUrl=v.getCreateNewArticleTemplateUrl=v.getCreateNewPublisherUrl=v.getEnableSecurityRolesUrl=v.getArticleTemplateUrl=v.getFieldSecurityProfileDesignerUrl=v.getSecurityRoleDesignerUrl=v.getMailMergeTemplateDesignerUrl=v.getEmailTemplateDesignerUrl=v.getConnectionRoleDesignerUrl=v.getSiteMapDesignerUrl=v.getWebResourceFileUrl=v.getWebResourceDesignerUrl=v.getReportDesignerUrl=v.getBusinessProcessFlowDesignerUrl=v.getProcessShareUrl=v.getProcessDesignerUrl=v.getChartDesignerUrl=v.getOpenModernEntityDashboardUrl=v.getNewModernEntityDashboardUrl=v.getNewModernDashboardUrl=v.getOpenModernDashboardUrl=v.getDashboardDesignerUrl=v.getAppModuleDesignerUrl=v.privilegesQueryUrls=v.xrmApiUrl=v.getPlayAppModuleUrl=v.getCrmAdminSecurityUsersUrl=v.getCrmAdminSecurityRolesUrl=v.getCrmMyAppsUrl=v.getCrmAppDesignerUrl=v.getCrmDevResourcesUrl=v.getCrmAllPublishersUrl=v.getCrmAllSolutionsUrl=v.getSolutionPublisherUrl=v.getExportTranslationFileName=v.getExportSolutionTranslationUrl=v.getImportSolutionTranslationUrl=v.getShowSolutionDependenciesUrl=v.getShowComponentDependenciesUrl=v.cdsServiceUrl=v.ODATA_NEXT_LINK=v.ODATA_MAX_PAGE_SIZE=void 0;v.retrieveOrganizationResources=v.getUCIEntityRecordEditUrl=v.getUCIEntityRecordBaseUrl=v.getBusinessRuleDesignerUri=v.retrieveUnpublishedSuffix=v.getSavePowerSettingUri=v.getPowerSettingUri=v.getPowerSettingsUri=v.RetrievePlatform=v.getAppSettingOverrideUri=v.AppSettingOverrideName=v.getOrgSettingOverrideUri=v.OrgSettingOverrideName=v.getSettingDefinitionsUri=v.retrieveFeatureControlSettingsByNamespaceUrl=v.retrieveDeploymentPipelineConfigAppUrl=v.SPNPrincipalIdUrl=v.retrieveDeploymentEnvironmentInfoUrl=v.devSolutionInfoUrl=v.deployOperationStatusUrl=v.getAIGeneratedDeploymentNotesUrl=v.deploymentStageRunUrl=v.validatePackageAsyncUrl=v.deployPackageAsyncUrl=v.updateDeploymentStageRunUrl=v.createDeploymentStageRunUrl=v.retrieveDeploymentStagesUrl=v.retrievePipelinesUrl=v.retrieveDeploymentPipelineInfoUrl=v.getDeploymentStageRunsUrl=v.appDeploymentUrls=v.getProvisionLanguageUrl=v.getSolutionQueryUrl=v.getSolutionsByUniqueNameQueryUrl=v.solutionsQueryUrl=v.getDependentComponentsWithMetadataQueryUrl=void 0;var ff=pf();v.ODATA_MAX_PAGE_SIZE="odata.maxpagesize";v.ODATA_NEXT_LINK="@odata.nextLink";v.cdsServiceUrl="https://cds-org/";var xi;(function(e){e.AllSolutions="11",e.AllPublishers="10",e.DevResources="05"})(xi||(xi={}));function ME(e,t,r,n){return`${e}tools/dependency/dependencyviewdialog.aspx?appSolutionId=%7b${t}%7d&dType=1&objectid=%7b${r}%7d&objecttype=${n}&operationtype=showdependency`}v.getShowComponentDependenciesUrl=ME;function UE(e,t){let r=`dType=1&isproactivecheck=true&objecttype=7100&operationtype=dependenciesforuninstall&objectid=${t}`;return`${e}tools/dependency/dependencyviewdialog.aspx?${r}`}v.getShowSolutionDependenciesUrl=UE;function BE(e,t){return`${e}tools/muiProvisioning/Dialogs/LangTranslationsImport.aspx?dType=1&appSolutionId=${t}`}v.getImportSolutionTranslationUrl=BE;function kE(e,t){return`${e}_grid/cmds/dlg_exportsolution.aspx?command=exporttranslation&appSolutionId=${t}`}v.getExportSolutionTranslationUrl=kE;function qE(e,t){return e!==void 0&&t!==void 0&&`CrmTranslations_${e}_${t.replace(/[.]/g,"_")}.zip`||""}v.getExportTranslationFileName=qE;function $E(e,t,r){return r?`${e}tools/publisher/edit.aspx?appSolutionId=%7b${r}%7d&id=%7b${t}%7d`:`${e}tools/publisher/edit.aspx?id=%7b${t}%7d`}v.getSolutionPublisherUrl=$E;function Jl(e,t){return`${e}tools/systemcustomization/systemCustomization.aspx?pid=${t}`}function VE(e){return Jl(e,xi.AllSolutions)}v.getCrmAllSolutionsUrl=VE;function GE(e){return Jl(e,xi.AllPublishers)}v.getCrmAllPublishersUrl=GE;function zE(e){return Jl(e,xi.DevResources)}v.getCrmDevResourcesUrl=zE;function WE(e,t=ff.crmBapSolutionId){return`${e}designer/app/${t}#/CreateNewApp`}v.getCrmAppDesignerUrl=WE;function jE(e){return`${e}apps`}v.getCrmMyAppsUrl=jE;function HE(e){return mf(e,"role")+"&forceUCI=0"}v.getCrmAdminSecurityRolesUrl=HE;function JE(e){return`${mf(e,"systemuser")}&forceclassic=1`}v.getCrmAdminSecurityUsersUrl=JE;function mf(e,t){return`${e}main.aspx?pagetype=entitylist&etn=${t}`}function QE(e,t){return`${e}main.aspx?appid=${t}`}v.getPlayAppModuleUrl=QE;v.xrmApiUrl="api/data/v9.0";v.privilegesQueryUrls={systemUserInfo:e=>`${e}${v.xrmApiUrl}/WhoAmI`,userPrivileges:(e,t)=>`${e}${v.xrmApiUrl}/systemusers(${t})/Microsoft.Dynamics.CRM.RetrieveUserPrivileges`,systemPrivileges:e=>`${e}${v.xrmApiUrl}/privileges/Microsoft.Dynamics.CRM.RetrievePrivilegeSet`};function XE(e,t,r=ff.crmBapSolutionId){return`${e}designer/app/${r}/${t}/AppDesignerCanvas/${t}`}v.getAppModuleDesignerUrl=XE;function KE(e,t,r,n){return`${e}main.aspx?appSolutionId=%7b${r}%7d&extraqs=%26formId%3d%7b${t}%7d%26dashboardType%3d1030&pagetype=${`${n?"ic":""}dashboardeditor`}`}v.getDashboardDesignerUrl=KE;function YE(e,t,r){return`/e/${e}/s/${t}/dashboard/${r}`}v.getOpenModernDashboardUrl=YE;function ZE(e,t,r){let n=r!==void 0?r.toString():void 0;return`/e/${e}/s/${t}/dashboard/new${n?`/${n}`:""}`}v.getNewModernDashboardUrl=ZE;function eI(e,t,r,n){let i=n!==void 0?n.toString():void 0;return`/e/${e}/s/${t}/n/${r}/dashboard/new${i?`/${i}`:""}`}v.getNewModernEntityDashboardUrl=eI;function tI(e,t,r,n){return`/e/${e}/s/${t}/n/${r}/dashboard/${n}`}v.getOpenModernEntityDashboardUrl=tI;function rI(e,t,r,n){return`${e}main.aspx?appSolutionId=%7b${t}%7d&extraqs=etc=${r||""}`+(n?`%26id=${n}`:"")+"&pagetype=vizdesigner"}v.getChartDesignerUrl=rI;function nI(e,t,r){return`${e}sfa/workflow/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getProcessDesignerUrl=nI;function iI(e,t,r){return`${e}sfa/workflow/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getProcessShareUrl=iI;function aI(e,t){return`${e}Tools/ProcessControl/UnifiedProcessDesigner.aspx?id=${t}`}v.getBusinessProcessFlowDesignerUrl=aI;function oI(e,t,r){return`${e}CRMReports/reportproperty.aspx?appSolutionId=%7b${r}%7d&disablePersonal=true&id=%7b${t}%7d`}v.getReportDesignerUrl=oI;function sI(e,t,r){return`${e}main.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&etc=9333&id=%7b${t}%7d&pagetype=webresourceedit`}v.getWebResourceDesignerUrl=sI;function lI(e,t){return`${e}WebResources/${t}`}v.getWebResourceFileUrl=lI;function uI(e,t,r){return`${e}designer/sitemap/${r}/${t}/SiteMapHome/${t}`}v.getSiteMapDesignerUrl=uI;function cI(e,t,r){return`${e}connections/connectionroles/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getConnectionRoleDesignerUrl=cI;function dI(e,t,r){return`${e}tools/emailtemplateeditor/emailtemplateeditor.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getEmailTemplateDesignerUrl=dI;function pI(e,t,r){return`${e}tools/mailmerge/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getMailMergeTemplateDesignerUrl=pI;function fI(e,t,r){return`${e}biz/roles/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getSecurityRoleDesignerUrl=fI;function mI(e,t,r){return`${e}biz/fieldsecurityprofiles/edit.aspx?_CreateFromId=%7b${r}%7d&_CreateFromType=7100&appSolutionId=%7b${r}%7d&id=%7b${t}%7d`}v.getFieldSecurityProfileDesignerUrl=mI;function hI(e,t,r){return`${e}tools/kbtemplateeditor/kbtemplateeditor.aspx?_CreateFromId=%7b${t}%7d&_CreateFromType=7100&appSolutionId=%7b${t}%7d&id=%7b${r}%7d`}v.getArticleTemplateUrl=hI;function gI(e,t,r,n){return`${e}tools/FormEditor/Dialogs/FormRoleAssignment.aspx?appSolutionId=%7b${t}%7d&dType=1&formId=%7b${r}%7d&objectTypeCode=0&type=${n}`}v.getEnableSecurityRolesUrl=gI;function vI(e){return`${e}tools/publisher/edit.aspx`}v.getCreateNewPublisherUrl=vI;function bI(e,t){return`${e}tools/kbtemplateeditor/kbtemplateeditor.aspx?appSolutionId=${t}`}v.getCreateNewArticleTemplateUrl=bI;v.solutionComponentDefinitionsQueryUrl="api/data/v9.0/solutioncomponentdefinitions";v.entityDefinitionsQueryUrl="api/data/v9.0/EntityDefinitions?$select=EntitySetName,DisplayName,LogicalName&$filter=";v.workflowsQueryUrl="api/data/v9.0/workflows";v.chartsQueryUrl="/api/data/v9.0/savedqueryvisualizations";v.solutionComponentConfigurationsQueryUrl="/api/data/v9.1/solutioncomponentconfigurations?$filter=isdisplayable eq true&$select=name";v.solutionComponentSummariesQueryUrl="/api/data/v9.0/msdyn_solutioncomponentsummaries";v.solutionComponentCountSummariesQueryUrl="/api/data/v9.0/msdyn_solutioncomponentcountsummaries";function yI(e,t){return`${v.xrmApiUrl}/RetrieveRequiredComponents(ObjectId=${e},ComponentType=${t})`}v.getRequiredComponentsQueryUrl=yI;function CI(e,t){return`${v.cdsServiceUrl}${v.xrmApiUrl}/RetrieveDependentComponentsWithMetadata(ObjectId=${e},ComponentType=${t})`}v.getDependentComponentsWithMetadataQueryUrl=CI;v.solutionsQueryUrl="/api/data/v9.0/solutions?$expand=publisherid&$filter=(isvisible eq true)";function AI(e){return`/api/data/v9.0/solutions?$expand=publisherid&$filter=(uniquename eq '${e}')`}v.getSolutionsByUniqueNameQueryUrl=AI;function wI(e){return`/api/data/v9.0/solutions(${e})?$expand=publisherid`}v.getSolutionQueryUrl=wI;function NI(e){return`${e}api/data/v9.1/ProvisionLanguageForUser`}v.getProvisionLanguageUrl=NI;v.appDeploymentUrls={associateEnvironmentToPipelineUrl:e=>`/api/data/v9.0/deploymentpipelines(${e})/deploymentpipeline_deploymentenvironment/$ref`,deploymentArtifactsUrl:"/api/data/v9.0/deploymentartifacts",deploymentEnvironmentUrl:"/api/data/v9.0/deploymentenvironments",deploymentPipelinesUrl:"/api/data/v9.0/deploymentpipelines",deploymentStagesUrl:"/api/data/v9.0/deploymentstages",retrieveDeploymentPipelinesUrl:e=>`/api/data/v9.0/RetrieveDeploymentPipelines(SourceEnvironmentId='${e}')`,deletePipelinesUrl:e=>`/api/data/v9.0/deploymentpipelines(${e})`};function SI(e,t,r,n=!1,i=!1,a=!1,o=!1,s=!1,l=!1,u=!1){return`/api/data/v9.1/deploymentstageruns
?$select=artifactname,artifactversion,deploymentstagerunid,devenvironmentid,endtime,errormessage,${s?"_artifactid_value,isredeployment,":""}${n?"deploymentnotes,":""}operation,operationdetails,operationstatus,${l?"retrycount,":""}${i?"scheduledtime,":""}${u?"solutionid,":""}stagerunstatus,starttime,suboperation,targetenvironmentid,${a?"predeploymentstepnotes,":""}validationresults,${o?"approvalcomments,":""}_devdeploymentenvironment_value,_targetdeploymentenvironment_value
&$expand=deploymentstageid($select=deploymentstageid,name,_deploymentpipelineid_value),targetdeploymentenvironment($select=deploymentenvironmentid,environmentid,name),createdby($select=azureactivedirectoryobjectid,fullname,ownerid,systemuserid)${l?",RetryUser($select=azureactivedirectoryobjectid,fullname,ownerid,systemuserid)":""}
&$filter=deploymentstageid/_deploymentpipelineid_value eq ${e} and devenvironmentid eq '${t}' and artifactname eq '${r}' and ((operation ne 200000201) or (operation eq 200000201 and operationstatus eq 200000003))
- &$orderby=starttime desc`}v.getDeploymentStageRunsUrl=NI;function SI(e,t,r){return`/api/data/v9.1/RetrieveDeploymentPipelineInfo(DeploymentPipelineId=${e},SourceEnvironmentId='${t}',ArtifactName='${r}')`}v.retrieveDeploymentPipelineInfoUrl=SI;function DI(e){return`/api/data/v9.0/deploymentenvironments
+ &$orderby=starttime desc`}v.getDeploymentStageRunsUrl=SI;function DI(e,t,r){return`/api/data/v9.1/RetrieveDeploymentPipelineInfo(DeploymentPipelineId=${e},SourceEnvironmentId='${t}',ArtifactName='${r}')`}v.retrieveDeploymentPipelineInfoUrl=DI;function EI(e){return`/api/data/v9.0/deploymentenvironments
?$select=deploymentenvironmentid,environmentid,environmenttype,name
&$expand=deploymentpipeline_deploymentenvironment($select=name,description,deploymentpipelineid;$orderby=name asc)
- &$filter=(environmentid eq '${e}')`}v.retrievePipelinesUrl=DI;function EI(e){return`/api/data/v9.0/deploymentstages
+ &$filter=(environmentid eq '${e}')`}v.retrievePipelinesUrl=EI;function II(e){return`/api/data/v9.0/deploymentstages
?$filter=(_deploymentpipelineid_value eq ${e})
&$select=name,description,deploymentstageid,_previousdeploymentstageid_value
- &$expand=targetdeploymentenvironmentid($select=deploymentenvironmentid,environmentid,name)`}v.retrieveDeploymentStagesUrl=EI;function II(){return"/api/data/v9.0/deploymentstageruns?$select=deploymentstagerunid"}v.createDeploymentStageRunUrl=II;function _I(e){return`/api/data/v9.0/deploymentstageruns(${e})`}v.updateDeploymentStageRunUrl=_I;function PI(){return"/api/data/v9.0/DeployPackageAsync"}v.deployPackageAsyncUrl=PI;function OI(){return"/api/data/v9.0/ValidatePackageAsync"}v.validatePackageAsyncUrl=OI;function FI(e,t=!1,r=!1){return`/api/data/v9.0/deploymentstageruns(${e})
- ?$select=deploymentstagerunid,stagerunstatus,errormessage,operation,operationdetails,operationstatus,${t?"scheduledtime,":""}targetenvironmentid,validationresults,artifactname,deploymentsettingsjson${r?"&$expand=createdby($select=azureactivedirectoryobjectid,fullname,ownerid,systemuserid)":""}`}v.deploymentStageRunUrl=FI;function TI(e){return`/api/data/v9.0/deploymentstageruns(${e})
- ?$select=aigenerateddeploymentnotes,deploymentstagerunid`}v.getAIGeneratedDeploymentNotesUrl=TI;function RI(e){let t="";for(let r=0;r<e.length;r++)r===e.length-1?t=t.concat(`deploymentstagerunid eq ${e[r]}`):t=t.concat(`deploymentstagerunid eq ${e[r]} or `);return`/api/data/v9.0/deploymentstageruns
+ &$expand=targetdeploymentenvironmentid($select=deploymentenvironmentid,environmentid,name)`}v.retrieveDeploymentStagesUrl=II;function _I(){return"/api/data/v9.0/deploymentstageruns?$select=deploymentstagerunid"}v.createDeploymentStageRunUrl=_I;function PI(e){return`/api/data/v9.0/deploymentstageruns(${e})`}v.updateDeploymentStageRunUrl=PI;function OI(){return"/api/data/v9.0/DeployPackageAsync"}v.deployPackageAsyncUrl=OI;function TI(){return"/api/data/v9.0/ValidatePackageAsync"}v.validatePackageAsyncUrl=TI;function RI(e,t=!1,r=!1){return`/api/data/v9.0/deploymentstageruns(${e})
+ ?$select=deploymentstagerunid,stagerunstatus,errormessage,operation,operationdetails,operationstatus,${t?"scheduledtime,":""}targetenvironmentid,validationresults,artifactname,deploymentsettingsjson${r?"&$expand=createdby($select=azureactivedirectoryobjectid,fullname,ownerid,systemuserid)":""}`}v.deploymentStageRunUrl=RI;function FI(e){return`/api/data/v9.0/deploymentstageruns(${e})
+ ?$select=aigenerateddeploymentnotes,deploymentstagerunid`}v.getAIGeneratedDeploymentNotesUrl=FI;function xI(e){let t="";for(let r=0;r<e.length;r++)r===e.length-1?t=t.concat(`deploymentstagerunid eq ${e[r]}`):t=t.concat(`deploymentstagerunid eq ${e[r]} or `);return`/api/data/v9.0/deploymentstageruns
?$filter=(${t})
- &$select=_deploymentstageid_value,deploymentstagerunid,stagerunstatus,operation,operationstatus,suboperation,artifactname`}v.deployOperationStatusUrl=RI;function xI(e){return`/api/data/v9.0/solutions(${e})
- ?$select=solutionid,uniquename,version`}v.devSolutionInfoUrl=xI;function LI(e){return`/api/data/v9.0/deploymentenvironments
+ &$select=_deploymentstageid_value,deploymentstagerunid,stagerunstatus,operation,operationstatus,suboperation,artifactname`}v.deployOperationStatusUrl=xI;function LI(e){return`/api/data/v9.0/solutions(${e})
+ ?$select=solutionid,uniquename,version`}v.devSolutionInfoUrl=LI;function MI(e){return`/api/data/v9.0/deploymentenvironments
?$select=deploymentenvironmentid,environmentid,environmenttype,name
- &$filter=(environmentid eq '${e}')`}v.retrieveDeploymentEnvironmentInfoUrl=LI;var MI=e=>`/api/data/v9.0/systemusers
+ &$filter=(environmentid eq '${e}')`}v.retrieveDeploymentEnvironmentInfoUrl=MI;var UI=e=>`/api/data/v9.0/systemusers
?$select=azureactivedirectoryobjectid
- &$filter=(applicationid eq '${e}')`;v.SPNPrincipalIdUrl=MI;function UI(){return"/api/data/v9.0/appmodules?$filter=(uniquename eq 'AppDeploymentConfiguration')"}v.retrieveDeploymentPipelineConfigAppUrl=UI;v.retrieveFeatureControlSettingsByNamespaceUrl="/api/data/v9.1/RetrieveFeatureControlSettingsByNamespace";function BI(e){return`/api/data/v9.0/settingdefinitions${e}`}v.getSettingDefinitionsUri=BI;v.OrgSettingOverrideName="organizationsettings";function kI(e,t=!1){let r=`/api/data/v9.0/${v.OrgSettingOverrideName}${e}`;return t?`${v.cdsServiceUrl}${r}`:r}v.getOrgSettingOverrideUri=kI;v.AppSettingOverrideName="appsettings";function qI(e,t=!1){let r=`/api/data/v9.0/${v.AppSettingOverrideName}${e}`;return t?`${v.cdsServiceUrl.replace("/$","")}${r}`:r}v.getAppSettingOverrideUri=qI;var Ri;(function(e){e[e.All=0]="All",e[e.IsPlatformOnly=1]="IsPlatformOnly",e[e.NotPlatformOnly=2]="NotPlatformOnly"})(Ri||(v.RetrievePlatform=Ri={}));function $I(e,t,r,n=Ri.All,i=!1){let a=[];e&&a.push(`AppUniqueName='${e}'`),t!=null&&a.push(`ReleaseLevel=${t}`),r&&a.push(`RetrieveHiddenSettings=${r}`),n!==Ri.All&&a.push(`RetrievePlatformSettings=${n===Ri.IsPlatformOnly?1:0}`);let o="/api/data/v9.0/RetrieveUnpublishedOverridableSettingsInfo";return a.length&&(o=`${o}(${a.join(",")})`),i?`${v.cdsServiceUrl}${o}`:o}v.getPowerSettingsUri=$I;function VI(e,t,r,n=!1){let i=[`SettingName='${e}'`];t!==void 0&&i.push(`SolutionName='${t}'`),r!==void 0&&i.push(`AppUniqueName='${r}'`);let a="/api/data/v9.0/RetrieveUnpublishedSettingInfo";return i.length&&(a=`${a}(${i.join(",")})`),n?`${v.cdsServiceUrl}${a}`:a}v.getPowerSettingUri=VI;function GI(e=!1){let t="/api/data/v9.0/SaveSettingValue()";return e?`${v.cdsServiceUrl}${t}`:t}v.getSavePowerSettingUri=GI;v.retrieveUnpublishedSuffix="Microsoft.Dynamics.CRM.RetrieveUnpublishedMultiple()";function zI(e){return`tools/systemcustomization/businessrules/businessRulesDesigner.aspx?BRlaunchpoint=BRGrid&appSolutionId={${e}}`}v.getBusinessRuleDesignerUri=zI;function hf({environmentInstanceUrl:e,entityLogicalName:t}){return e&&t?`${e}main.aspx?cmdbar=true&forceUCI=1&navbar=off&newWindow=true&pageType=entityRecord&etn=${t}`:void 0}v.getUCIEntityRecordBaseUrl=hf;function WI({baseUrl:e,environmentInstanceUrl:t,entityLogicalName:r,recordId:n}){let i=e||hf({environmentInstanceUrl:t,entityLogicalName:r});return i&&n?`${i}&id=${n}`:void 0}v.getUCIEntityRecordEditUrl=WI;v.retrieveOrganizationResources=`${v.cdsServiceUrl}api/data/v9.0/RetrieveOrganizationResources`});var gf=m(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.DataverseClient=void 0;var jI=jl(),Sn=be(),Jl=class{constructor(t,r,n){this.instanceUrl=t,this.httpClient=r,this.solutionUniqueName=n}withSolution(t){return this.solutionUniqueName?{...t,headers:{...t?.headers,"MSCRM.SolutionUniqueName":this.solutionUniqueName}}:t}apiUrl(t){let r=this.instanceUrl.replace(/\/+$/,""),n=t.startsWith("/")?t:`/${t}`;return`${r}/${jI.xrmApiUrl}${n}`}async send(t,r){try{return await r()}catch(n){throw n instanceof Sn.SdkError?n:new Sn.ConnectionError(t,0,n instanceof Error?n.message:String(n),n)}}get(t,r){let n=this.apiUrl(t);return this.send(n,()=>this.httpClient.get(n,r))}getAbsolute(t,r){return this.assertSameOrigin(t),this.send(t,()=>this.httpClient.get(t,r))}assertSameOrigin(t){let r,n;try{r=new URL(t),n=new URL(this.instanceUrl)}catch{throw new Sn.InvalidArgumentError(`Refusing to follow a malformed absolute URL: '${t}'`)}if(r.protocol!==n.protocol||r.host!==n.host)throw new Sn.InvalidArgumentError(`Refusing to follow a cross-origin link ('${r.origin}' is not the configured instance '${n.origin}'); server-driven pagination must stay on-instance.`)}post(t,r,n){let i=this.apiUrl(t);return this.send(i,()=>this.httpClient.post(i,r,this.withSolution(n)))}get supportsAtomicBatch(){return typeof this.httpClient.postRaw=="function"}postBatch(t,r,n){if(!this.httpClient.postRaw)throw new Sn.InvalidArgumentError("The injected HttpClient does not implement postRaw(), required for atomic $batch change sets");let i=this.apiUrl("/$batch"),a={...n,headers:{...n?.headers,"Content-Type":`multipart/mixed;boundary=${r}`}};return this.send(i,()=>this.httpClient.postRaw(i,t,a))}patch(t,r,n){let i=this.apiUrl(t);return this.send(i,()=>this.httpClient.patch(i,r,this.withSolution(n)))}put(t,r,n){if(!this.httpClient.put)throw new Sn.InvalidArgumentError("The injected HttpClient does not implement put(), required for metadata replace operations (e.g. updateColumn)");let i=this.apiUrl(t);return this.send(i,()=>this.httpClient.put(i,r,this.withSolution(n)))}delete(t,r){let n=this.apiUrl(t);return this.send(n,()=>this.httpClient.delete(n,this.withSolution(r)))}};bo.DataverseClient=Jl});var ue=m(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.odataQuery=Oe.normalizeGuid=Oe.createSafeXmlElement=Oe.assertODataName=Oe.assertXmlName=Oe.xmlText=Oe.odataPathLiteral=Oe.odataLiteral=void 0;var Ql=be();function vf(e){return String(e??"").replace(/'/g,"''")}Oe.odataLiteral=vf;function HI(e){return encodeURIComponent(vf(e))}Oe.odataPathLiteral=HI;function JI(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Oe.xmlText=JI;function bf(e,t){let r=String(e??""),n=/^[A-Za-z_][0-9A-Za-z_.-]*$/,i=r.split(":");if(!(i.length<=2&&i.every(o=>n.test(o))&&!/^xmlns/i.test(r)))throw new Ql.InvalidArgumentError(`${t} must be a valid XML element name (got '${e}')`);return e}Oe.assertXmlName=bf;function QI(e,t){let r=String(e??"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(r))throw new Ql.InvalidArgumentError(`${t} must be a valid OData identifier (letters, digits, underscore): got '${e}'`);return e}Oe.assertODataName=QI;function XI(e,t,r){return e.createElement(bf(t,r))}Oe.createSafeXmlElement=XI;var KI=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;function YI(e,t){let r=String(e??""),n=r.length===38&&r.startsWith("{")&&r.endsWith("}")?r.slice(1,-1):r;if(!KI.test(n))throw new Ql.InvalidArgumentError(`${t} must be a valid GUID (got '${e}')`);return n.toLowerCase()}Oe.normalizeGuid=YI;function ZI(e){let t=[];for(let[r,n]of e)n!=null&&n!==""&&t.push(`${r}=${encodeURIComponent(String(n))}`);return t.length>0?`?${t.join("&")}`:""}Oe.odataQuery=ZI});var $e=m(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.nowIso=Ne.isAlreadyDeleted=Ne.deleteRecord=Ne.ensureSuccess=Ne.requireCreatedId=Ne.readCreatedId=Ne.readEtag=Ne.VERSION_CONFLICT_CODE=void 0;var yo=be(),Xl=ue();Ne.VERSION_CONFLICT_CODE="VERSION_CONFLICT";function e1(e){var t;let r=(t=e.headers)!==null&&t!==void 0?t:{};for(let i of Object.keys(r))if(i.toLowerCase()==="etag")return r[i];let n=e.body;return n&&typeof n["@odata.etag"]=="string"?n["@odata.etag"]:null}Ne.readEtag=e1;function yf(e,t){var r;let n=e.body;if(n&&typeof n[t]=="string")return(0,Xl.normalizeGuid)(n[t],t);let i=(r=e.headers)!==null&&r!==void 0?r:{};for(let a of Object.keys(i))if(a.toLowerCase()==="odata-entityid"){let o=/\(([0-9a-fA-F-]{36})\)/.exec(i[a]);if(o)return(0,Xl.normalizeGuid)(o[1],t)}return null}Ne.readCreatedId=yf;function t1(e,t,r){let n=yf(e,t);if(!n)throw new yo.InvalidArgumentError(`Dataverse did not return an id for the created ${r}`);return n}Ne.requireCreatedId=t1;function Cf(e,t){if(e.status===412)throw new yo.SdkError(Ne.VERSION_CONFLICT_CODE,`Version conflict (412) from ${t}`);if(e.status<200||e.status>=300)throw new yo.ConnectionError(t,e.status,r1(e.body),e.body);return e}Ne.ensureSuccess=Cf;function r1(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e;if(t.error&&typeof t.error.message=="string")return t.error.message;if(typeof t.Message=="string")return t.Message;if(typeof t.message=="string")return t.message}return"request failed"}async function n1(e,t,r){let n=(0,Xl.normalizeGuid)(r,"id"),i=`/${t}(${n})`;Cf(await e.delete(i),e.apiUrl(i))}Ne.deleteRecord=n1;function i1(e){return e instanceof yo.ConnectionError&&e.statusCode===404}Ne.isAlreadyDeleted=i1;function a1(){return new Date().toISOString()}Ne.nowIso=a1});var Af=m(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.findColumns=Pr.findTables=Pr.fetchEntityMetadataFromApi=void 0;var Kl=$e(),qt=ue();function Li(e){var t,r;return(r=(t=e?.UserLocalizedLabel)===null||t===void 0?void 0:t.Label)!==null&&r!==void 0?r:""}async function Dn(e,t){var r,n;let i=await e.get(t);return i.status<200||i.status>=300?[]:(n=(r=i.body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[]}function _r(e){return`/EntityDefinitions(LogicalName='${(0,qt.odataLiteral)(e)}')`}async function o1(e,t,r){let n=await Dn(e,`${_r(t)}/Attributes/Microsoft.Dynamics.CRM.StringAttributeMetadata${(0,qt.odataQuery)([["$select","LogicalName,MaxLength"]])}`);for(let i of n){let a=r.get(i.LogicalName);a&&typeof i.MaxLength=="number"&&(a.maxLength=i.MaxLength)}}async function s1(e,t,r){var n;let i=await Dn(e,`${_r(t)}/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata${(0,qt.odataQuery)([["$select","LogicalName"],["$expand","OptionSet($select=Options)"]])}`);for(let a of i){let o=r.get(a.LogicalName);o&&(!((n=a.OptionSet)===null||n===void 0)&&n.Options)&&(o.options=a.OptionSet.Options.map(s=>{var l;return{value:(l=s.Value)!==null&&l!==void 0?l:0,label:Li(s.Label)}}))}}async function l1(e,t,r){let n=await Dn(e,`${_r(t)}/Attributes/Microsoft.Dynamics.CRM.LookupAttributeMetadata${(0,qt.odataQuery)([["$select","LogicalName,Targets"]])}`);for(let i of n){let a=r.get(i.LogicalName);a&&i.Targets&&(a.targets=i.Targets)}}async function u1(e,t){var r,n,i,a;let o=[],s=await Dn(e,`${_r(t)}/OneToManyRelationships${(0,qt.odataQuery)([["$select","SchemaName,ReferencingEntity,ReferencingAttribute"]])}`);for(let c of s)o.push({schemaName:c.SchemaName,type:"OneToMany",relatedEntity:(r=c.ReferencingEntity)!==null&&r!==void 0?r:"",relatedAttribute:(n=c.ReferencingAttribute)!==null&&n!==void 0?n:""});let l=await Dn(e,`${_r(t)}/ManyToOneRelationships${(0,qt.odataQuery)([["$select","SchemaName,ReferencedEntity,ReferencedAttribute"]])}`);for(let c of l)o.push({schemaName:c.SchemaName,type:"ManyToOne",relatedEntity:(i=c.ReferencedEntity)!==null&&i!==void 0?i:"",relatedAttribute:(a=c.ReferencedAttribute)!==null&&a!==void 0?a:""});let u=await Dn(e,`${_r(t)}/ManyToManyRelationships${(0,qt.odataQuery)([["$select","SchemaName,Entity1LogicalName,Entity2LogicalName"]])}`);for(let c of u){let d=c.Entity1LogicalName===t?c.Entity2LogicalName:c.Entity1LogicalName;o.push({schemaName:c.SchemaName,type:"ManyToMany",relatedEntity:d??"",relatedAttribute:""})}return o}async function c1(e,t){var r,n,i,a,o;let s=`${_r(t)}`+(0,qt.odataQuery)([["$select","LogicalName,SchemaName,DisplayName,EntitySetName,IsCustomEntity,PrimaryNameAttribute,PrimaryIdAttribute"],["$expand","Attributes($select=LogicalName,DisplayName,AttributeType,IsCustomAttribute)"]]),u=(0,Kl.ensureSuccess)(await e.get(s),e.apiUrl(s)).body,c=((r=u.Attributes)!==null&&r!==void 0?r:[]).map(g=>{var b;return{logicalName:g.LogicalName,displayName:Li(g.DisplayName),attributeType:(b=g.AttributeType)!==null&&b!==void 0?b:"Unknown",isCustomAttribute:!!g.IsCustomAttribute}}),d=new Map(c.map(g=>[g.logicalName,g])),[,,,f]=await Promise.all([o1(e,t,d),s1(e,t,d),l1(e,t,d),u1(e,t)]);return{logicalName:u.LogicalName,schemaName:(n=u.SchemaName)!==null&&n!==void 0?n:u.LogicalName,displayName:Li(u.DisplayName),entitySetName:(i=u.EntitySetName)!==null&&i!==void 0?i:"",primaryNameAttribute:(a=u.PrimaryNameAttribute)!==null&&a!==void 0?a:"",primaryIdAttribute:(o=u.PrimaryIdAttribute)!==null&&o!==void 0?o:"",isCustomEntity:!!u.IsCustomEntity,attributes:c,relationships:f}}Pr.fetchEntityMetadataFromApi=c1;async function d1(e,t,r){var n,i;let a=`/EntityDefinitions${(0,qt.odataQuery)([["$select","LogicalName,SchemaName,EntitySetName,DisplayName,IsCustomEntity"]])}`,s=(i=(n=(0,Kl.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[],l=(t??"").toLowerCase(),u=s.filter(c=>!r?.customOnly||c.IsCustomEntity).map(c=>{var d,f;return{logicalName:c.LogicalName,schemaName:(d=c.SchemaName)!==null&&d!==void 0?d:c.LogicalName,displayName:Li(c.DisplayName),entitySetName:(f=c.EntitySetName)!==null&&f!==void 0?f:"",isCustom:!!c.IsCustomEntity}}).filter(c=>c.logicalName.toLowerCase().includes(l)||c.schemaName.toLowerCase().includes(l)||c.displayName.toLowerCase().includes(l));return typeof r?.top=="number"?u.slice(0,r.top):u}Pr.findTables=d1;async function p1(e,t,r,n){var i,a;let o=`${_r(t)}/Attributes`+(0,qt.odataQuery)([["$select","LogicalName,SchemaName,DisplayName,AttributeType,IsCustomAttribute"]]),l=(a=(i=(0,Kl.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:[],u=(r??"").toLowerCase(),c=l.map(d=>{var f,g;return{logicalName:d.LogicalName,schemaName:(f=d.SchemaName)!==null&&f!==void 0?f:d.LogicalName,displayName:Li(d.DisplayName),attributeType:(g=d.AttributeType)!==null&&g!==void 0?g:"Unknown",isCustom:!!d.IsCustomAttribute}}).filter(d=>d.logicalName.toLowerCase().includes(u)||d.schemaName.toLowerCase().includes(u)||d.displayName.toLowerCase().includes(u));return typeof n?.top=="number"?c.slice(0,n.top):c}Pr.findColumns=p1});var Co=m(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.updateTable=J.deleteAlternateKey=J.createAlternateKey=J.deleteGlobalOptionSet=J.createGlobalOptionSet=J.deleteRelationship=J.deleteColumn=J.updateColumn=J.deleteTable=J.createRelationship=J.insertStatusValue=J.createCustomerColumn=J.createColumn=J.createTable=J.resolveEntitySetName=void 0;var oe=$e(),X=ue(),Ot=be(),f1={String:"Microsoft.Dynamics.CRM.StringAttributeMetadata",Memo:"Microsoft.Dynamics.CRM.MemoAttributeMetadata",Integer:"Microsoft.Dynamics.CRM.IntegerAttributeMetadata",Decimal:"Microsoft.Dynamics.CRM.DecimalAttributeMetadata",Money:"Microsoft.Dynamics.CRM.MoneyAttributeMetadata",Boolean:"Microsoft.Dynamics.CRM.BooleanAttributeMetadata",DateTime:"Microsoft.Dynamics.CRM.DateTimeAttributeMetadata",Picklist:"Microsoft.Dynamics.CRM.PicklistAttributeMetadata",Lookup:"Microsoft.Dynamics.CRM.LookupAttributeMetadata"},or=1033;function ge(e,t){return{"@odata.type":"Microsoft.Dynamics.CRM.Label",LocalizedLabels:[{"@odata.type":"Microsoft.Dynamics.CRM.LocalizedLabel",Label:e,LanguageCode:t}]}}function Mi(e){return{Value:e,CanBeChanged:!0,ManagedPropertyLogicalName:"canmodifyrequirementlevelsettings"}}function Zl(e){let t=e.indexOf("_");return t>0?e.slice(0,t):e}function wf(e,t,r){let n=e[t];n&&typeof n=="object"?n.Value=r:e[t]={Value:r}}function Ui(e){let t=(0,oe.readCreatedId)(e,"MetadataId");if(!t)throw new Ot.InvalidArgumentError("Dataverse did not return a MetadataId for the created metadata component");return t}function m1(e,t,r){var n,i,a,o,s,l,u,c,d,f,g,b,w,N,_,T,R,M,W,B,j,k;switch(e){case"string":return{"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",AttributeType:"String",AttributeTypeName:{Value:"StringType"},MaxLength:(n=t.maxLength)!==null&&n!==void 0?n:100,FormatName:{Value:(i=t.stringFormat)!==null&&i!==void 0?i:"Text"}};case"memo":return{"@odata.type":"Microsoft.Dynamics.CRM.MemoAttributeMetadata",AttributeType:"Memo",AttributeTypeName:{Value:"MemoType"},MaxLength:(a=t.maxLength)!==null&&a!==void 0?a:2e3,Format:"TextArea"};case"integer":return{"@odata.type":"Microsoft.Dynamics.CRM.IntegerAttributeMetadata",AttributeType:"Integer",AttributeTypeName:{Value:"IntegerType"},Format:"None",MinValue:(o=t.minValue)!==null&&o!==void 0?o:-2147483648,MaxValue:(s=t.maxValue)!==null&&s!==void 0?s:2147483647};case"bigint":return{"@odata.type":"Microsoft.Dynamics.CRM.BigIntAttributeMetadata",AttributeType:"BigInt",AttributeTypeName:{Value:"BigIntType"}};case"double":return{"@odata.type":"Microsoft.Dynamics.CRM.DoubleAttributeMetadata",AttributeType:"Double",AttributeTypeName:{Value:"DoubleType"},Precision:(l=t.precision)!==null&&l!==void 0?l:2,MinValue:(u=t.minValue)!==null&&u!==void 0?u:-1e11,MaxValue:(c=t.maxValue)!==null&&c!==void 0?c:1e11};case"decimal":return{"@odata.type":"Microsoft.Dynamics.CRM.DecimalAttributeMetadata",AttributeType:"Decimal",AttributeTypeName:{Value:"DecimalType"},Precision:(d=t.precision)!==null&&d!==void 0?d:2,MinValue:(f=t.minValue)!==null&&f!==void 0?f:-1e11,MaxValue:(g=t.maxValue)!==null&&g!==void 0?g:1e11};case"money":return{"@odata.type":"Microsoft.Dynamics.CRM.MoneyAttributeMetadata",AttributeType:"Money",AttributeTypeName:{Value:"MoneyType"},Precision:(b=t.precision)!==null&&b!==void 0?b:2,PrecisionSource:2,MinValue:(w=t.minValue)!==null&&w!==void 0?w:0,MaxValue:(N=t.maxValue)!==null&&N!==void 0?N:1e9};case"boolean":return{"@odata.type":"Microsoft.Dynamics.CRM.BooleanAttributeMetadata",AttributeType:"Boolean",AttributeTypeName:{Value:"BooleanType"},DefaultValue:!1,OptionSet:{"@odata.type":"Microsoft.Dynamics.CRM.BooleanOptionSetMetadata",TrueOption:{Value:1,Label:ge((_=t.trueLabel)!==null&&_!==void 0?_:"Yes",r)},FalseOption:{Value:0,Label:ge((T=t.falseLabel)!==null&&T!==void 0?T:"No",r)}}};case"dateTime":return{"@odata.type":"Microsoft.Dynamics.CRM.DateTimeAttributeMetadata",AttributeType:"DateTime",AttributeTypeName:{Value:"DateTimeType"},Format:(R=t.dateFormat)!==null&&R!==void 0?R:"DateAndTime"};case"choice":return Nf(t,r,!1);case"multiChoice":return Nf(t,r,!0);case"file":return{"@odata.type":"Microsoft.Dynamics.CRM.FileAttributeMetadata",AttributeType:"Virtual",AttributeTypeName:{Value:"FileType"},MaxSizeInKB:(M=t.maxSizeKb)!==null&&M!==void 0?M:10240};case"image":return{"@odata.type":"Microsoft.Dynamics.CRM.ImageAttributeMetadata",AttributeType:"Virtual",AttributeTypeName:{Value:"ImageType"},IsPrimaryImage:(W=t.isPrimaryImage)!==null&&W!==void 0?W:!1,MaxSizeInKB:(B=t.maxSizeKb)!==null&&B!==void 0?B:10240};case"autonumber":return{"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",AttributeType:"String",AttributeTypeName:{Value:"StringType"},FormatName:{Value:"Text"},MaxLength:(j=t.maxLength)!==null&&j!==void 0?j:100,AutoNumberFormat:(k=t.autoNumberFormat)!==null&&k!==void 0?k:""};default:throw new Ot.InvalidArgumentError(`unsupported column type '${String(e)}'`)}}function Nf(e,t,r){let i={"@odata.type":r?"Microsoft.Dynamics.CRM.MultiSelectPicklistAttributeMetadata":"Microsoft.Dynamics.CRM.PicklistAttributeMetadata",AttributeType:r?"Virtual":"Picklist",AttributeTypeName:{Value:r?"MultiSelectPicklistType":"PicklistType"}};if(e.globalChoiceMetadataId)return i["[email protected]"]=`/GlobalOptionSetDefinitions(${(0,X.normalizeGuid)(e.globalChoiceMetadataId,"globalChoiceMetadataId")})`,i;if(!e.options||e.options.length===0)throw new Ot.InvalidArgumentError(`choice column '${e.schemaName}' requires at least one option (or a globalChoiceMetadataId)`);return i.OptionSet={"@odata.type":"Microsoft.Dynamics.CRM.OptionSetMetadata",IsGlobal:!1,OptionSetType:"Picklist",Options:e.options.map(a=>({Value:a.value,Label:ge(a.label,t)}))},i}var Yl=new WeakMap;async function h1(e,t){var r,n;let i=(r=Yl.get(e))===null||r===void 0?void 0:r.get(t);if(i)return i;let a=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')${(0,X.odataQuery)([["$select","EntitySetName"]])}`,s=(n=(0,oe.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.EntitySetName;if(!s)throw new Ot.InvalidArgumentError(`could not resolve EntitySetName for '${t}'`);(0,X.assertODataName)(s,`server-derived EntitySetName for '${t}'`);let l=Yl.get(e);return l||(l=new Map,Yl.set(e,l)),l.set(t,s),s}J.resolveEntitySetName=h1;async function g1(e,t){var r,n,i,a,o,s,l,u,c,d,f,g;let b=(r=t.languageCode)!==null&&r!==void 0?r:or,w=Zl(t.schemaName),N=(n=t.primaryColumnSchemaName)!==null&&n!==void 0?n:`${w}_Name`,_={"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",AttributeType:"String",AttributeTypeName:{Value:"StringType"},SchemaName:N,RequiredLevel:Mi("None"),MaxLength:(i=t.primaryColumnMaxLength)!==null&&i!==void 0?i:100,FormatName:{Value:"Text"},DisplayName:ge((a=t.primaryColumnDisplayName)!==null&&a!==void 0?a:"Name",b),IsPrimaryName:!0};t.primaryColumnAutoNumberFormat&&(_.AutoNumberFormat=t.primaryColumnAutoNumberFormat);let T={"@odata.type":"Microsoft.Dynamics.CRM.EntityMetadata",SchemaName:t.schemaName,DisplayName:ge(t.displayName,b),DisplayCollectionName:ge((o=t.pluralName)!==null&&o!==void 0?o:`${t.displayName}s`,b),OwnershipType:(s=t.ownership)!==null&&s!==void 0?s:"UserOwned",IsActivity:!1,HasActivities:(l=t.hasActivities)!==null&&l!==void 0?l:!1,HasNotes:(u=t.hasNotes)!==null&&u!==void 0?u:!1,Attributes:[_]};t.description&&(T.Description=ge(t.description,b));let R="/EntityDefinitions",M=(0,oe.ensureSuccess)(await e.post(R,T),e.apiUrl(R)),W=Ui(M),B=`/EntityDefinitions(${W})`+(0,X.odataQuery)([["$select","LogicalName,EntitySetName,PrimaryIdAttribute,PrimaryNameAttribute"]]),k=(0,oe.ensureSuccess)(await e.get(B),e.apiUrl(B)).body;return{logicalName:(c=k.LogicalName)!==null&&c!==void 0?c:t.schemaName.toLowerCase(),metadataId:W,entitySetName:(d=k.EntitySetName)!==null&&d!==void 0?d:"",primaryIdAttribute:(f=k.PrimaryIdAttribute)!==null&&f!==void 0?f:`${t.schemaName.toLowerCase()}id`,primaryNameAttribute:(g=k.PrimaryNameAttribute)!==null&&g!==void 0?g:N.toLowerCase()}}J.createTable=g1;async function v1(e,t,r){var n,i;let a=(n=r.languageCode)!==null&&n!==void 0?n:or,o={...m1(r.type,r,a),SchemaName:r.schemaName,RequiredLevel:Mi((i=r.required)!==null&&i!==void 0?i:"None"),DisplayName:ge(r.displayName,a)};r.description&&(o.Description=ge(r.description,a)),r.sourceType&&r.sourceType!=="Simple"&&(o.SourceType=r.sourceType==="Rollup"?2:1,r.formulaDefinition&&(o.FormulaDefinition=r.formulaDefinition));let s=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Attributes`,l=(0,oe.ensureSuccess)(await e.post(s,o),e.apiUrl(s));return{logicalName:r.schemaName.toLowerCase(),metadataId:Ui(l)}}J.createColumn=v1;async function b1(e,t,r){var n,i,a,o;let s=(n=r.languageCode)!==null&&n!==void 0?n:or,l=Zl(r.schemaName),u=(i=r.accountRelationshipName)!==null&&i!==void 0?i:`${l}_${t}_account`,c=(a=r.contactRelationshipName)!==null&&a!==void 0?a:`${l}_${t}_contact`,d={Lookup:{"@odata.type":"Microsoft.Dynamics.CRM.ComplexLookupAttributeMetadata",SchemaName:r.schemaName,DisplayName:ge(r.displayName,s),RequiredLevel:Mi((o=r.required)!==null&&o!==void 0?o:"None"),Targets:["account","contact"]},OneToManyRelationships:[{"@odata.type":"Microsoft.Dynamics.CRM.ComplexOneToManyRelationshipMetadata",SchemaName:u,ReferencedEntity:"account",ReferencingEntity:t},{"@odata.type":"Microsoft.Dynamics.CRM.ComplexOneToManyRelationshipMetadata",SchemaName:c,ReferencedEntity:"contact",ReferencingEntity:t}]};return(0,oe.ensureSuccess)(await e.post("/CreateCustomerRelationships",d),e.apiUrl("/CreateCustomerRelationships")),{logicalName:r.schemaName.toLowerCase(),metadataId:""}}J.createCustomerColumn=b1;async function y1(e,t,r){var n,i,a,o,s;let l=(n=r.languageCode)!==null&&n!==void 0?n:or,u={EntityLogicalName:t,AttributeLogicalName:"statuscode",Label:ge(r.label,l),StateCode:(i=r.stateCode)!==null&&i!==void 0?i:0};typeof r.value=="number"&&(u.Value=r.value),r.color&&(u.Color=r.color);let c=(0,oe.ensureSuccess)(await e.post("/InsertStatusValue",u),e.apiUrl("/InsertStatusValue"));return Number((s=(o=(a=c.body)===null||a===void 0?void 0:a.NewOptionValue)!==null&&o!==void 0?o:r.value)!==null&&s!==void 0?s:0)}J.insertStatusValue=y1;async function C1(e,t){var r,n,i,a,o;let s=(r=t.languageCode)!==null&&r!==void 0?r:or,l,u;if(t.type==="OneToMany"){if(!t.referencedEntity||!t.referencingEntity)throw new Ot.InvalidArgumentError("OneToMany relationship requires referencedEntity and referencingEntity");let f=(n=t.lookupSchemaName)!==null&&n!==void 0?n:`${Zl(t.schemaName)}_${t.referencedEntity}Id`;u=f.toLowerCase(),l={"@odata.type":"Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata",SchemaName:t.schemaName,ReferencedEntity:t.referencedEntity,ReferencingEntity:t.referencingEntity,Lookup:{"@odata.type":"Microsoft.Dynamics.CRM.LookupAttributeMetadata",AttributeType:"Lookup",AttributeTypeName:{Value:"LookupType"},SchemaName:f,RequiredLevel:Mi((i=t.lookupRequired)!==null&&i!==void 0?i:"None"),DisplayName:ge((a=t.lookupDisplayName)!==null&&a!==void 0?a:t.referencedEntity,s)}}}else{if(!t.entity1||!t.entity2)throw new Ot.InvalidArgumentError("ManyToMany relationship requires entity1 and entity2");l={"@odata.type":"Microsoft.Dynamics.CRM.ManyToManyRelationshipMetadata",SchemaName:t.schemaName,IntersectEntityName:(o=t.intersectEntityName)!==null&&o!==void 0?o:t.schemaName.toLowerCase(),Entity1LogicalName:t.entity1,Entity2LogicalName:t.entity2}}let c="/RelationshipDefinitions",d=(0,oe.ensureSuccess)(await e.post(c,l),e.apiUrl(c));return{schemaName:t.schemaName,metadataId:Ui(d),lookupLogicalName:u}}J.createRelationship=C1;async function A1(e,t){let r=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')`;(0,oe.ensureSuccess)(await e.delete(r),e.apiUrl(r))}J.deleteTable=A1;async function w1(e,t,r,n){var i,a;let o=(i=n.languageCode)!==null&&i!==void 0?i:or,s=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Attributes`,l=`${s}(LogicalName='${(0,X.odataLiteral)(r)}')${(0,X.odataQuery)([["$select","MetadataId,AttributeType"]])}`,c=(0,oe.ensureSuccess)(await e.get(l),e.apiUrl(l)).body,d=f1[(a=c.AttributeType)!==null&&a!==void 0?a:""];if(!c.MetadataId||!d)throw new Ot.InvalidArgumentError(`cannot update column '${r}' on '${t}' (type '${c.AttributeType}' not supported)`);let f=(0,X.normalizeGuid)(c.MetadataId,"MetadataId"),g=`${s}(${f})/${d}`,b=(0,oe.ensureSuccess)(await e.get(g),e.apiUrl(g)).body;for(let N of Object.keys(b))N.startsWith("@odata.")&&delete b[N];b["@odata.type"]=d,n.displayName!==void 0&&(b.DisplayName=ge(n.displayName,o)),n.description!==void 0&&(b.Description=ge(n.description,o)),n.required!==void 0&&(b.RequiredLevel=Mi(n.required)),n.maxLength!==void 0&&(b.MaxLength=n.maxLength),n.autoNumberFormat!==void 0&&(b.AutoNumberFormat=n.autoNumberFormat);let w=`${s}(${f})`;(0,oe.ensureSuccess)(await e.put(w,b,{headers:{"MSCRM.MergeLabels":"true"}}),e.apiUrl(w))}J.updateColumn=w1;async function N1(e,t,r){var n;let i=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Attributes`,a=`${i}(LogicalName='${(0,X.odataLiteral)(r)}')${(0,X.odataQuery)([["$select","MetadataId"]])}`,s=(n=(0,oe.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.MetadataId;if(!s)throw new Ot.InvalidArgumentError(`column '${r}' not found on '${t}'`);let l=`${i}(${(0,X.normalizeGuid)(s,"MetadataId")})`;(0,oe.ensureSuccess)(await e.delete(l),e.apiUrl(l))}J.deleteColumn=N1;async function S1(e,t){var r,n,i;let a=`/RelationshipDefinitions${(0,X.odataQuery)([["$filter",`SchemaName eq '${(0,X.odataLiteral)(t)}'`],["$select","MetadataId"]])}`,s=(i=(n=(r=(0,oe.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||r===void 0?void 0:r.value)===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.MetadataId;if(!s)throw new Ot.InvalidArgumentError(`relationship '${t}' not found`);let l=`/RelationshipDefinitions(${(0,X.normalizeGuid)(s,"MetadataId")})`;(0,oe.ensureSuccess)(await e.delete(l),e.apiUrl(l))}J.deleteRelationship=S1;async function Sf(e,t){var r;let n=`/GlobalOptionSetDefinitions(Name='${(0,X.odataPathLiteral)(t)}')${(0,X.odataQuery)([["$select","MetadataId"]])}`,i=await e.get(n);if(i.status===404)return;let o=(r=(0,oe.ensureSuccess)(i,e.apiUrl(n)).body)===null||r===void 0?void 0:r.MetadataId;return o?(0,X.normalizeGuid)(o,"MetadataId"):void 0}async function D1(e,t){var r;let n=t.name.toLowerCase(),i=await Sf(e,n);if(i)return{name:n,metadataId:i};let a=(r=t.languageCode)!==null&&r!==void 0?r:or,o={"@odata.type":"Microsoft.Dynamics.CRM.OptionSetMetadata",Name:n,DisplayName:ge(t.displayName,a),IsGlobal:!0,OptionSetType:"Picklist",Options:t.options.map(l=>({Value:l.value,Label:ge(l.label,a)}))};t.description&&(o.Description=ge(t.description,a));let s="/GlobalOptionSetDefinitions";try{let l=(0,oe.ensureSuccess)(await e.post(s,o),e.apiUrl(s));return{name:n,metadataId:Ui(l)}}catch(l){let u;try{u=await Sf(e,n)}catch{u=void 0}if(u)return{name:n,metadataId:u};throw l}}J.createGlobalOptionSet=D1;async function E1(e,t){let r=`/GlobalOptionSetDefinitions(Name='${(0,X.odataLiteral)(t.toLowerCase())}')`;(0,oe.ensureSuccess)(await e.delete(r),e.apiUrl(r))}J.deleteGlobalOptionSet=E1;async function I1(e,t,r){var n;let i=(n=r.languageCode)!==null&&n!==void 0?n:or,a={"@odata.type":"Microsoft.Dynamics.CRM.EntityKeyMetadata",SchemaName:r.schemaName,DisplayName:ge(r.displayName,i),KeyAttributes:r.keyAttributes},o=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Keys`,s=(0,oe.ensureSuccess)(await e.post(o,a),e.apiUrl(o));return{logicalName:r.schemaName.toLowerCase(),metadataId:Ui(s)}}J.createAlternateKey=I1;async function _1(e,t,r){var n;let i=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Keys`,a=`${i}(LogicalName='${(0,X.odataLiteral)(r.toLowerCase())}')${(0,X.odataQuery)([["$select","MetadataId"]])}`,s=(n=(0,oe.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.MetadataId;if(!s)throw new Ot.InvalidArgumentError(`alternate key '${r}' not found on '${t}'`);let l=`${i}(${(0,X.normalizeGuid)(s,"MetadataId")})`;(0,oe.ensureSuccess)(await e.delete(l),e.apiUrl(l))}J.deleteAlternateKey=_1;async function P1(e,t,r){var n;let i=(n=r.languageCode)!==null&&n!==void 0?n:or,a=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')`,s=(0,oe.ensureSuccess)(await e.get(a),e.apiUrl(a)).body,l=s.MetadataId;if(!l)throw new Ot.InvalidArgumentError(`table '${t}' not found`);let u=(0,X.normalizeGuid)(l,"MetadataId");for(let d of Object.keys(s))d.startsWith("@odata.")&&delete s[d];s["@odata.type"]="Microsoft.Dynamics.CRM.EntityMetadata",r.displayName!==void 0&&(s.DisplayName=ge(r.displayName,i)),r.pluralName!==void 0&&(s.DisplayCollectionName=ge(r.pluralName,i)),r.description!==void 0&&(s.Description=ge(r.description,i)),r.auditEnabled!==void 0&&wf(s,"IsAuditEnabled",r.auditEnabled),r.duplicateDetectionEnabled!==void 0&&wf(s,"IsDuplicateDetectionEnabled",r.duplicateDetectionEnabled),r.changeTrackingEnabled!==void 0&&(s.ChangeTrackingEnabled=r.changeTrackingEnabled),r.quickCreateEnabled!==void 0&&(s.IsQuickCreateEnabled=r.quickCreateEnabled),r.iconVectorName!==void 0&&(s.IconVectorName=r.iconVectorName),r.iconSmallName!==void 0&&(s.IconSmallName=r.iconSmallName),r.iconMediumName!==void 0&&(s.IconMediumName=r.iconMediumName),r.iconLargeName!==void 0&&(s.IconLargeName=r.iconLargeName);let c=`/EntityDefinitions(${u})`;(0,oe.ensureSuccess)(await e.put(c,s,{headers:{"MSCRM.MergeLabels":"true"}}),e.apiUrl(c))}J.updateTable=P1});var Bi=m(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.disassociateRecords=me.associateRecords=me.createRecordsBulk=me.upsertRecord=me.queryAllRecords=me.queryRecords=me.getRecord=me.deleteRecord=me.updateRecord=me.createRecord=void 0;var vt=$e(),Ve=ue(),Hr=be(),$t=Co();function Ao(e){let t=e,r=!1,n={};for(let i of Object.keys(t)){let a=t[i];Array.isArray(a)&&a.every(o=>typeof o=="number")?(n[i]=a.join(","),r=!0):n[i]=a}return r?n:e}async function O1(e,t,r){let i=`/${await(0,$t.resolveEntitySetName)(e,t)}`,a=(0,vt.ensureSuccess)(await e.post(i,Ao(r)),e.apiUrl(i)),o=(0,vt.readCreatedId)(a,`${t}id`);if(!o)throw new Hr.InvalidArgumentError(`Dataverse did not return an id for the created '${t}' row`);return{id:o,entityType:t}}me.createRecord=O1;async function F1(e,t,r,n){let i=(0,Ve.normalizeGuid)(r,"id"),o=`/${await(0,$t.resolveEntitySetName)(e,t)}(${i})`;(0,vt.ensureSuccess)(await e.patch(o,Ao(n)),e.apiUrl(o))}me.updateRecord=F1;async function T1(e,t,r){let n=(0,Ve.normalizeGuid)(r,"id"),a=`/${await(0,$t.resolveEntitySetName)(e,t)}(${n})`;(0,vt.ensureSuccess)(await e.delete(a),e.apiUrl(a))}me.deleteRecord=T1;async function R1(e,t,r,n){var i;let a=(0,Ve.normalizeGuid)(r,"id"),o=await(0,$t.resolveEntitySetName)(e,t),s=(0,Ve.odataQuery)([["$select",n&&n.length>0?n.join(","):void 0]]),l=`/${o}(${a})${s}`;return(i=(0,vt.ensureSuccess)(await e.get(l),e.apiUrl(l)).body)!==null&&i!==void 0?i:{}}me.getRecord=R1;function x1(e){return e?.fetchXml?(0,Ve.odataQuery)([["fetchXml",e.fetchXml]]):(0,Ve.odataQuery)([["$select",e?.select&&e.select.length>0?e.select.join(","):void 0],["$filter",e?.filter],["$orderby",e?.orderBy],["$expand",e?.expand],["$top",e?.top]])}async function Df(e,t,r){var n,i;if(r?.paginate){if(r.top!==void 0)throw new Hr.InvalidArgumentError("queryRecords: `paginate` cannot be combined with `top` \u2014 Dataverse honors $top as a hard cap and omits @odata.nextLink, so the result would be silently capped at one page.");if(r.fetchXml)throw new Hr.InvalidArgumentError("queryRecords: `paginate` is not supported with `fetchXml` \u2014 FetchXML paging uses a paging cookie (page / fetchxmlpagingcookie), not @odata.nextLink. Page the FetchXML manually, or use an OData query.")}let o=`/${await(0,$t.resolveEntitySetName)(e,t)}${x1(r)}`,s=(0,vt.ensureSuccess)(await e.get(o),e.apiUrl(o));if(!r?.paginate)return(i=(n=s.body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[];let l=[],u=new Set,c=e.apiUrl(o);for(;;){let d=s.body,f=d?.value;if(!Array.isArray(f))throw new Hr.ConnectionError(c,s.status,`paginated query returned a malformed page \u2014 expected an OData 'value' array but got ${L1(f)}; refusing to return partial results.`);for(let b of f)l.push(b);let g=d?.["@odata.nextLink"];if(!g)break;if(typeof g!="string")throw new Hr.ConnectionError(c,s.status,`paginated query returned a non-string @odata.nextLink (${typeof g}); cannot follow it.`);if(u.has(g))throw new Hr.InvalidArgumentError(`queryRecords: aborting pagination \u2014 the server returned a repeated @odata.nextLink ('${g}'), which would loop indefinitely.`);u.add(g),c=g,s=(0,vt.ensureSuccess)(await e.getAbsolute(g),g)}return l}me.queryRecords=Df;function L1(e){return e===null?"null":e===void 0?"undefined (missing)":`a ${typeof e}`}async function M1(e,t,r){return Df(e,t,{...r,paginate:!0})}me.queryAllRecords=M1;function U1(e){if("id"in e)return`(${(0,Ve.normalizeGuid)(e.id,"id")})`;let t=typeof e.value=="string"?`'${(0,Ve.odataPathLiteral)(e.value)}'`:e.value;return`(${(0,Ve.assertODataName)(e.key,"alternate key name")}=${t})`}async function B1(e,t,r,n){let i=U1(r),o=`/${await(0,$t.resolveEntitySetName)(e,t)}${i}`,s=(0,vt.ensureSuccess)(await e.patch(o,Ao(n)),e.apiUrl(o)),l=s.status===201,u=(0,vt.readCreatedId)(s,`${t}id`);return{id:u??("id"in r?(0,Ve.normalizeGuid)(r.id,"id"):""),created:l}}me.upsertRecord=B1;async function k1(e,t,r){var n,i;if(r.length===0)return[];let a=await(0,$t.resolveEntitySetName)(e,t),o=r.map(c=>({"@odata.type":`Microsoft.Dynamics.CRM.${t}`,...Ao(c)})),s=`/${a}/Microsoft.Dynamics.CRM.CreateMultiple`,u=(i=(n=(0,vt.ensureSuccess)(await e.post(s,{Targets:o}),e.apiUrl(s)).body)===null||n===void 0?void 0:n.Ids)!==null&&i!==void 0?i:[];if(u.length!==r.length)throw new Hr.InvalidArgumentError(`CreateMultiple on '${t}' returned ${u.length} id(s) for ${r.length} row(s)`);return u}me.createRecordsBulk=k1;async function q1(e,t,r,n){let i=(0,Ve.normalizeGuid)(r,"id"),a=(0,Ve.normalizeGuid)(n.targetId,"targetId"),o=await(0,$t.resolveEntitySetName)(e,t),s=await(0,$t.resolveEntitySetName)(e,n.targetEntity),l=(0,Ve.assertODataName)(n.relationshipName,"relationshipName"),u=`/${o}(${i})/${l}/$ref`,c={"@odata.id":e.apiUrl(`/${s}(${a})`)};(0,vt.ensureSuccess)(await e.post(u,c),e.apiUrl(u))}me.associateRecords=q1;async function $1(e,t,r,n,i){let a=(0,Ve.normalizeGuid)(r,"id"),o=(0,Ve.normalizeGuid)(i,"targetId"),s=await(0,$t.resolveEntitySetName)(e,t),l=(0,Ve.assertODataName)(n,"relationshipName"),u=`/${s}(${a})/${l}(${o})/$ref`;(0,vt.ensureSuccess)(await e.delete(u),e.apiUrl(u))}me.disassociateRecords=$1});var _f=m(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.deleteWebResource=Vt.getWebResource=Vt.updateWebResource=Vt.createWebResource=void 0;var En=$e(),ki=ue(),eu=be(),V1={html:1,css:2,js:3,xml:4,png:5,jpg:6,gif:7,xsl:9,ico:10,svg:11,resx:12};function G1(e){let t=globalThis;if(t.Buffer)return t.Buffer.from(e,"utf8").toString("base64");if(t.btoa){let r=globalThis.TextEncoder;if(r){let n=new r().encode(e),i="",a=32768;for(let o=0;o<n.length;o+=a)i+=String.fromCharCode(...n.subarray(o,o+a));return t.btoa(i)}return t.btoa(e)}throw new eu.InvalidArgumentError("no base64 encoder available; pass contentBase64 instead of content")}function Ef(e){if(e.contentBase64!==void 0)return e.contentBase64;if(e.content!==void 0)return G1(e.content)}async function If(e,t){let r=`<importexportxml><webresources><webresource>${(0,ki.xmlText)(t)}</webresource></webresources></importexportxml>`;(0,En.ensureSuccess)(await e.post("/PublishXml",{ParameterXml:r}),e.apiUrl("/PublishXml"))}async function z1(e,t){var r;let n=Ef(t);if(n===void 0)throw new eu.InvalidArgumentError(`web resource '${t.name}' requires content or contentBase64`);let i={name:t.name,displayname:(r=t.displayName)!==null&&r!==void 0?r:t.name,webresourcetype:V1[t.type],content:n};t.description&&(i.description=t.description);let a=(0,En.ensureSuccess)(await e.post("/webresourceset",i),e.apiUrl("/webresourceset")),o=(0,En.readCreatedId)(a,"webresourceid");if(!o)throw new eu.InvalidArgumentError(`Dataverse did not return an id for web resource '${t.name}'`);return t.publish!==!1&&await If(e,o),{id:o,name:t.name}}Vt.createWebResource=z1;async function W1(e,t,r){let n=(0,ki.normalizeGuid)(t,"id"),i={},a=Ef(r);a!==void 0&&(i.content=a),r.displayName!==void 0&&(i.displayname=r.displayName),r.description!==void 0&&(i.description=r.description);let o=`/webresourceset(${n})`;(0,En.ensureSuccess)(await e.patch(o,i),e.apiUrl(o)),r.publish!==!1&&await If(e,n)}Vt.updateWebResource=W1;async function j1(e,t){var r;let i=`/webresourceset(${(0,ki.normalizeGuid)(t,"id")})${(0,ki.odataQuery)([["$select","name,displayname,webresourcetype,content,description"]])}`;return(r=(0,En.ensureSuccess)(await e.get(i),e.apiUrl(i)).body)!==null&&r!==void 0?r:{}}Vt.getWebResource=j1;async function H1(e,t){let n=`/webresourceset(${(0,ki.normalizeGuid)(t,"id")})`;(0,En.ensureSuccess)(await e.delete(n),e.apiUrl(n))}Vt.deleteWebResource=H1});var Pf=m(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.deleteSolution=K.importSolution=K.exportSolution=K.removeSolutionComponent=K.addSolutionComponent=K.setSolutionVersion=K.createSolution=K.createPublisher=K.getSolution=K.fetchSolutionComponents=K.SolutionComponentType=void 0;var ft=$e(),pt=ue(),Jr=be();K.SolutionComponentType={SavedQuery:26,Workflow:29,SavedQueryVisualization:59,SystemForm:60,AppModule:80};var J1=[K.SolutionComponentType.SavedQuery,K.SolutionComponentType.Workflow,K.SolutionComponentType.SavedQueryVisualization,K.SolutionComponentType.SystemForm,K.SolutionComponentType.AppModule];async function Q1(e,t){var r;let n=(0,pt.normalizeGuid)(t,"solutionId"),i=J1.map(l=>`msdyn_componenttype eq ${l}`).join(" or "),a=`/msdyn_solutioncomponentsummaries${(0,pt.odataQuery)([["$select","msdyn_objectid,msdyn_componenttype,msdyn_workflowcategory,msdyn_displayname,msdyn_name"],["$filter",`msdyn_solutionid eq ${n} and (${i})`]])}`,o=[],s=(0,ft.ensureSuccess)(await e.get(a),e.apiUrl(a));for(;;){let l=s.body;for(let c of(r=l?.value)!==null&&r!==void 0?r:[])o.push(c);let u=l?.["@odata.nextLink"];if(!u)break;s=(0,ft.ensureSuccess)(await e.getAbsolute(u),u)}return o.filter(l=>typeof l.msdyn_objectid=="string").map(l=>({objectId:l.msdyn_objectid,componentType:Number(l.msdyn_componenttype),workflowCategory:l.msdyn_workflowcategory==null?void 0:Number(l.msdyn_workflowcategory),displayName:l.msdyn_displayname,name:l.msdyn_name}))}K.fetchSolutionComponents=Q1;function X1(e){let t=e.length===38&&e.startsWith("{")&&e.endsWith("}")?e.slice(1,-1):e;return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t)}async function K1(e,t){var r,n,i,a,o,s,l,u,c,d;let f=String(t??"").trim();if(!f)throw new Jr.InvalidArgumentError("getSolution: a solution unique name or id is required.");let g=X1(f)?`solutionid eq ${(0,pt.normalizeGuid)(f,"solutionId")}`:`uniquename eq '${(0,pt.odataLiteral)(f)}'`,b=`/solutions${(0,pt.odataQuery)([["$select","solutionid,uniquename,friendlyname,version,ismanaged"],["$expand","publisherid($select=publisherid,uniquename,customizationprefix,customizationoptionvalueprefix)"],["$filter",g]])}`,_=((n=(r=(0,ft.ensureSuccess)(await e.get(b),e.apiUrl(b)).body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0];if(!_?.solutionid)throw new Jr.InvalidArgumentError(`No solution found for '${t}'.`);let T=_.publisherid;if(!T?.publisherid)throw new Jr.InvalidArgumentError(`Solution '${(i=_.uniquename)!==null&&i!==void 0?i:t}' returned no owning publisher, so its customization prefix cannot be determined; refusing to report an empty prefix that could be mistaken for "no prefix".`);if(!("customizationprefix"in T))throw new Jr.InvalidArgumentError(`Solution '${(a=_.uniquename)!==null&&a!==void 0?a:t}' returned a publisher without a customizationprefix property (partial expansion), so its prefix cannot be determined.`);return{solutionId:(0,pt.normalizeGuid)(_.solutionid,"solutionId"),uniqueName:(o=_.uniquename)!==null&&o!==void 0?o:"",friendlyName:(s=_.friendlyname)!==null&&s!==void 0?s:"",version:(l=_.version)!==null&&l!==void 0?l:"",isManaged:!!_.ismanaged,publisherId:(0,pt.normalizeGuid)(T.publisherid,"publisherId"),publisherUniqueName:(u=T.uniquename)!==null&&u!==void 0?u:"",publisherPrefix:(c=T.customizationprefix)!==null&&c!==void 0?c:"",publisherOptionValuePrefix:(d=T.customizationoptionvalueprefix)!==null&&d!==void 0?d:0}}K.getSolution=K1;async function Y1(e,t){var r;let n={uniquename:t.uniqueName,friendlyname:t.friendlyName,customizationprefix:t.prefix,customizationoptionvalueprefix:(r=t.optionValuePrefix)!==null&&r!==void 0?r:1e4};t.description&&(n.description=t.description);let i=(0,ft.ensureSuccess)(await e.post("/publishers",n),e.apiUrl("/publishers")),a=(0,ft.readCreatedId)(i,"publisherid");if(!a)throw new Jr.InvalidArgumentError(`Dataverse did not return an id for publisher '${t.uniqueName}'`);return{id:a,uniqueName:t.uniqueName}}K.createPublisher=Y1;async function Z1(e,t){var r;let n=(0,pt.normalizeGuid)(t.publisherId,"publisherId"),i={uniquename:t.uniqueName,friendlyname:t.friendlyName,version:(r=t.version)!==null&&r!==void 0?r:"1.0.0.0","[email protected]":`/publishers(${n})`};t.description&&(i.description=t.description);let a=(0,ft.ensureSuccess)(await e.post("/solutions",i),e.apiUrl("/solutions")),o=(0,ft.readCreatedId)(a,"solutionid");if(!o)throw new Jr.InvalidArgumentError(`Dataverse did not return an id for solution '${t.uniqueName}'`);return{id:o,uniqueName:t.uniqueName}}K.createSolution=Z1;async function e_(e,t,r){let i=`/solutions(${(0,pt.normalizeGuid)(t,"solutionId")})`;(0,ft.ensureSuccess)(await e.patch(i,{version:r}),e.apiUrl(i))}K.setSolutionVersion=e_;async function t_(e,t){var r;let i={ComponentId:(0,pt.normalizeGuid)(t.componentId,"componentId"),ComponentType:t.componentType,SolutionUniqueName:t.solutionUniqueName,AddRequiredComponents:(r=t.addRequiredComponents)!==null&&r!==void 0?r:!1};t.doNotIncludeSubcomponents!==void 0&&(i.DoNotIncludeSubcomponents=t.doNotIncludeSubcomponents),(0,ft.ensureSuccess)(await e.post("/AddSolutionComponent",i),e.apiUrl("/AddSolutionComponent"))}K.addSolutionComponent=t_;async function r_(e,t,r,n){let a={SolutionComponent:{"@odata.type":"Microsoft.Dynamics.CRM.solutioncomponent",solutioncomponentid:(0,pt.normalizeGuid)(t,"componentId")},ComponentType:r,SolutionUniqueName:n};(0,ft.ensureSuccess)(await e.post("/RemoveSolutionComponent",a),e.apiUrl("/RemoveSolutionComponent"))}K.removeSolutionComponent=r_;async function n_(e,t){var r,n;let i={SolutionName:t.solutionName,Managed:(r=t.managed)!==null&&r!==void 0?r:!1},o=(n=(0,ft.ensureSuccess)(await e.post("/ExportSolution",i),e.apiUrl("/ExportSolution")).body)===null||n===void 0?void 0:n.ExportSolutionFile;if(!o)throw new Jr.InvalidArgumentError(`ExportSolution returned no file for '${t.solutionName}'`);return{base64:o}}K.exportSolution=n_;async function i_(e,t){var r,n;let i={OverwriteUnmanagedCustomizations:(r=t.overwriteUnmanagedCustomizations)!==null&&r!==void 0?r:!0,PublishWorkflows:(n=t.publishWorkflows)!==null&&n!==void 0?n:!0,CustomizationFile:t.base64};t.importJobId&&(i.ImportJobId=(0,pt.normalizeGuid)(t.importJobId,"importJobId")),(0,ft.ensureSuccess)(await e.post("/ImportSolution",i),e.apiUrl("/ImportSolution"))}K.importSolution=i_;async function a_(e,t){let n=`/solutions(${(0,pt.normalizeGuid)(t,"solutionId")})`;(0,ft.ensureSuccess)(await e.delete(n),e.apiUrl(n))}K.deleteSolution=a_});var Of=m(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Ff=m(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.default="00000000-0000-0000-0000-000000000000"});var Tf=m(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var qi=m(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});var o_=Tf();function s_(e){return typeof e=="string"&&o_.default.test(e)}iu.default=s_});var $i=m(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});var l_=qi();function u_(e){if(!(0,l_.default)(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}au.default=u_});var sr=m(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.unsafeStringify=void 0;var c_=qi(),Ue=[];for(let e=0;e<256;++e)Ue.push((e+256).toString(16).slice(1));function Rf(e,t=0){return(Ue[e[t+0]]+Ue[e[t+1]]+Ue[e[t+2]]+Ue[e[t+3]]+"-"+Ue[e[t+4]]+Ue[e[t+5]]+"-"+Ue[e[t+6]]+Ue[e[t+7]]+"-"+Ue[e[t+8]]+Ue[e[t+9]]+"-"+Ue[e[t+10]]+Ue[e[t+11]]+Ue[e[t+12]]+Ue[e[t+13]]+Ue[e[t+14]]+Ue[e[t+15]]).toLowerCase()}Vi.unsafeStringify=Rf;function d_(e,t=0){let r=Rf(e,t);if(!(0,c_.default)(r))throw TypeError("Stringified UUID is invalid");return r}Vi.default=d_});var So=m(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});var p_=require("crypto"),No=new Uint8Array(256),wo=No.length;function f_(){return wo>No.length-16&&((0,p_.randomFillSync)(No),wo=0),No.slice(wo,wo+=16)}ou.default=f_});var su=m(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.updateV1State=void 0;var xf=So(),m_=sr(),Gi={};function h_(e,t,r){let n,i=e?._v6??!1;if(e){let a=Object.keys(e);a.length===1&&a[0]==="_v6"&&(e=void 0)}if(e)n=Lf(e.random??e.rng?.()??(0,xf.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,r);else{let a=Date.now(),o=(0,xf.default)();Mf(Gi,a,o),n=Lf(o,Gi.msecs,Gi.nsecs,i?void 0:Gi.clockseq,i?void 0:Gi.node,t,r)}return t??(0,m_.unsafeStringify)(n)}function Mf(e,t,r){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=r.slice(10,16),e.node[0]|=1,e.clockseq=(r[8]<<8|r[9])&16383),e.msecs=t,e}zi.updateV1State=Mf;function Lf(e,t,r,n,i,a,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),r??=0,n??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=122192928e5;let s=((t&268435455)*1e4+r)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let l=t/4294967296*1e4&268435455;a[o++]=l>>>8&255,a[o++]=l&255,a[o++]=l>>>24&15|16,a[o++]=l>>>16&255,a[o++]=n>>>8|128,a[o++]=n&255;for(let u=0;u<6;++u)a[o++]=i[u];return a}zi.default=h_});var uu=m(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});var g_=$i(),v_=sr();function b_(e){let t=typeof e=="string"?(0,g_.default)(e):e,r=y_(t);return typeof e=="string"?(0,v_.unsafeStringify)(r):r}lu.default=b_;function y_(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var Uf=m(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});var C_=require("crypto");function A_(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),(0,C_.createHash)("md5").update(e).digest()}cu.default=A_});var Wi=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.URL=lr.DNS=lr.stringToBytes=void 0;var Bf=$i(),w_=sr();function kf(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}lr.stringToBytes=kf;lr.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";lr.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function N_(e,t,r,n,i,a){let o=typeof r=="string"?kf(r):r,s=typeof n=="string"?(0,Bf.default)(n):n;if(typeof n=="string"&&(n=(0,Bf.default)(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+o.length);if(l.set(s),l.set(o,s.length),l=t(l),l[6]=l[6]&15|e,l[8]=l[8]&63|128,i){if(a=a||0,a<0||a+16>i.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[a+u]=l[u];return i}return(0,w_.unsafeStringify)(l)}lr.default=N_});var $f=m(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.URL=Qr.DNS=void 0;var S_=Uf(),du=Wi(),qf=Wi();Object.defineProperty(Qr,"DNS",{enumerable:!0,get:function(){return qf.DNS}});Object.defineProperty(Qr,"URL",{enumerable:!0,get:function(){return qf.URL}});function pu(e,t,r,n){return(0,du.default)(48,S_.default,e,t,r,n)}pu.DNS=du.DNS;pu.URL=du.URL;Qr.default=pu});var Vf=m(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});var D_=require("crypto");fu.default={randomUUID:D_.randomUUID}});var zf=m(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});var Gf=Vf(),E_=So(),I_=sr();function __(e,t,r){if(Gf.default.randomUUID&&!t&&!e)return Gf.default.randomUUID();e=e||{};let n=e.random??e.rng?.()??(0,E_.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return(0,I_.unsafeStringify)(n)}mu.default=__});var Wf=m(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var P_=require("crypto");function O_(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),(0,P_.createHash)("sha1").update(e).digest()}hu.default=O_});var Hf=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.URL=Xr.DNS=void 0;var F_=Wf(),gu=Wi(),jf=Wi();Object.defineProperty(Xr,"DNS",{enumerable:!0,get:function(){return jf.DNS}});Object.defineProperty(Xr,"URL",{enumerable:!0,get:function(){return jf.URL}});function vu(e,t,r,n){return(0,gu.default)(80,F_.default,e,t,r,n)}vu.DNS=gu.DNS;vu.URL=gu.URL;Xr.default=vu});var Jf=m(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});var T_=sr(),R_=su(),x_=uu();function L_(e,t,r){e??={},r??=0;let n=(0,R_.default)({...e,_v6:!0},new Uint8Array(16));if(n=(0,x_.default)(n),t){if(r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;i++)t[r+i]=n[i];return t}return(0,T_.unsafeStringify)(n)}bu.default=L_});var Qf=m(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});var M_=$i(),U_=sr();function B_(e){let t=typeof e=="string"?(0,M_.default)(e):e,r=k_(t);return typeof e=="string"?(0,U_.unsafeStringify)(r):r}yu.default=B_;function k_(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var Zf=m(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.updateV7State=void 0;var Xf=So(),q_=sr(),Cu={};function $_(e,t,r){let n;if(e)n=Kf(e.random??e.rng?.()??(0,Xf.default)(),e.msecs,e.seq,t,r);else{let i=Date.now(),a=(0,Xf.default)();Yf(Cu,i,a),n=Kf(a,Cu.msecs,Cu.seq,t,r)}return t??(0,q_.unsafeStringify)(n)}function Yf(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}ji.updateV7State=Yf;function Kf(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}ji.default=$_});var em=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});var V_=qi();function G_(e){if(!(0,V_.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}Au.default=G_});var wu=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.version=Q.validate=Q.v7=Q.v6ToV1=Q.v6=Q.v5=Q.v4=Q.v3=Q.v1ToV6=Q.v1=Q.stringify=Q.parse=Q.NIL=Q.MAX=void 0;var z_=Of();Object.defineProperty(Q,"MAX",{enumerable:!0,get:function(){return z_.default}});var W_=Ff();Object.defineProperty(Q,"NIL",{enumerable:!0,get:function(){return W_.default}});var j_=$i();Object.defineProperty(Q,"parse",{enumerable:!0,get:function(){return j_.default}});var H_=sr();Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return H_.default}});var J_=su();Object.defineProperty(Q,"v1",{enumerable:!0,get:function(){return J_.default}});var Q_=uu();Object.defineProperty(Q,"v1ToV6",{enumerable:!0,get:function(){return Q_.default}});var X_=$f();Object.defineProperty(Q,"v3",{enumerable:!0,get:function(){return X_.default}});var K_=zf();Object.defineProperty(Q,"v4",{enumerable:!0,get:function(){return K_.default}});var Y_=Hf();Object.defineProperty(Q,"v5",{enumerable:!0,get:function(){return Y_.default}});var Z_=Jf();Object.defineProperty(Q,"v6",{enumerable:!0,get:function(){return Z_.default}});var eP=Qf();Object.defineProperty(Q,"v6ToV1",{enumerable:!0,get:function(){return eP.default}});var tP=Zf();Object.defineProperty(Q,"v7",{enumerable:!0,get:function(){return tP.default}});var rP=qi();Object.defineProperty(Q,"validate",{enumerable:!0,get:function(){return rP.default}});var nP=em();Object.defineProperty(Q,"version",{enumerable:!0,get:function(){return nP.default}})});var Ft=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.assignMissingIds=In.newId=void 0;var iP=wu();function tm(){return(0,iP.v4)()}In.newId=tm;function aP(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var oP=new Set(["parameters","bag"]);function sP(e){return Nu(e),e}In.assignMissingIds=sP;function Nu(e){if(Array.isArray(e)){e.forEach(t=>Nu(t));return}if(aP(e)){(typeof e.id!="string"||e.id.length===0)&&(e.id=tm());for(let t of Object.keys(e))t==="id"||oP.has(t)||Nu(e[t])}}});var _u=m(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.appApi=_n.deleteAppResolvingOnce=void 0;var Fe=$e(),ce=ue(),Du=Ft(),mt=be(),sm=(0,ce.odataQuery)([["$select","appmoduleid,name,uniquename,description"]]),lP=(0,ce.odataQuery)([["$select","appmoduleid,name,uniquename,description"]]);function Do(e,t){return"/sitemaps/Microsoft.Dynamics.CRM.RetrieveUnpublishedMultiple()"+(0,ce.odataQuery)([["$select",t],["$filter",`sitemapid eq ${e}`],["$top",1]])}function Eu(e){var t;let r=(t=e.body)===null||t===void 0?void 0:t.value;if(Array.isArray(r))return r[0]}function Iu(e){let t=e?.["@odata.etag"];return typeof t=="string"?t:null}function Hi(e){let t=new Set,r=[];for(let n of e??[])n&&!t.has(n)&&(t.add(n),r.push(n));return r}function uP(e){return`cdsapp_${(e||"").replace(/[^a-zA-Z0-9]/g,"")||"app"}`}async function lm(e,t){var r,n;let i=u=>{throw new mt.SdkError("APP_SITEMAP_UNRESOLVED",`The sitemap lookup for app uniquename '${t??""}' ${u}, so it cannot be determined whether this app has a sitemap. Retry; if the app is newly created, publish it first (an unpublished app is not readable).`)};if(!t)return i("cannot run because the app record carried no uniquename");let a=`/sitemaps${(0,ce.odataQuery)([["$select","sitemapid"],["$filter",`sitemapnameunique eq '${(0,ce.odataLiteral)(t)}'`],["$top",1]])}`,o;try{o=await e.get(a)}catch(u){return i(`failed (${u.message})`)}if(o.status<200||o.status>=300)return i(`returned HTTP ${o.status}`);let s=(r=o.body)===null||r===void 0?void 0:r.value;if(!Array.isArray(s))return i("returned a malformed body");let l=(n=s[0])===null||n===void 0?void 0:n.sitemapid;return s.length>0&&!l?i("returned a row with no sitemapid"):l}async function cP(e){let t=s=>{var l,u,c;return(c=(u=(l=s.body)===null||l===void 0?void 0:l.value)===null||u===void 0?void 0:u[0])===null||c===void 0?void 0:c.webresourceid},r=s=>`/webresourceset${(0,ce.odataQuery)([["$select","webresourceid"],["$top",1],["$filter",s]])}`,n=await e.get(r("webresourcetype eq 5 and ismanaged eq false and contains(name,'icon')")),i=t(n);if(i)return i;let a=await e.get(r("webresourcetype eq 5 and ismanaged eq false")),o=t(a);return o||t(await e.get(r("ismanaged eq false")))}async function dP(e,t){var r,n,i;try{let a=`/roles${(0,ce.odataQuery)([["$select","roleid"],["$filter","name eq 'System Administrator'"],["$top",1]])}`,s=(i=(n=(r=(await e.get(a)).body)===null||r===void 0?void 0:r.value)===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.roleid;if(!s)return;let l=`/appmodules(${t})/appmoduleroles_association/$ref`;await e.post(l,{"@odata.id":e.apiUrl(`/roles(${s})`)})}catch{}}async function pP(e,t){async function r(o,s){var l,u;try{let c=await e.get(o);return c.status<200||c.status>=300?[]:((u=(l=c.body)===null||l===void 0?void 0:l.value)!==null&&u!==void 0?u:[]).map(f=>String(f[s])).filter(f=>f&&f!=="undefined")}catch{return[]}}let[n,i,a]=await Promise.all([r(`/systemforms${(0,ce.odataQuery)([["$select","formid"],["$filter",`objecttypecode eq '${(0,ce.odataLiteral)(t)}' and type eq 2 and formactivationstate eq 1`]])}`,"formid"),r(`/savedqueries${(0,ce.odataQuery)([["$select","savedqueryid"],["$filter",`returnedtypecode eq '${(0,ce.odataLiteral)(t)}' and querytype eq 0 and statecode eq 0`]])}`,"savedqueryid"),r(`/savedqueryvisualizations${(0,ce.odataQuery)([["$select","savedqueryvisualizationid"],["$filter",`primaryentitytypecode eq '${(0,ce.odataLiteral)(t)}'`]])}`,"savedqueryvisualizationid")]);return{forms:n,views:i,charts:a}}var rm=new WeakMap;async function fP(e,t){let r=rm.get(e);r||(r=new Map,rm.set(e,r));let n=r.get(t);if(n!==void 0)return n;let i=await mP(e,t);return i&&r.set(t,i),i}async function nm(e,t,r){let n=new Array(e.length),i=0;async function a(){for(let o=i;o<e.length;o=i)i=o+1,n[o]=await r(e[o])}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>a())),n}async function mP(e,t){var r;let n=`/EntityDefinitions(LogicalName='${(0,ce.odataLiteral)(t)}')${(0,ce.odataQuery)([["$select","MetadataId"]])}`,i=await e.get(n);if(i.status>=200&&i.status<300)return(r=i.body)===null||r===void 0?void 0:r.MetadataId}async function im(e,t){let r=[],n=Hi(t.entities),i=4,a=await nm(n,i,c=>fP(e,c));for(let c of a)c&&r.push({"@odata.type":"Microsoft.Dynamics.CRM.entity",entityid:c});for(let c of Hi(t.components.forms))r.push({"@odata.type":"Microsoft.Dynamics.CRM.systemform",formid:c});for(let c of Hi(t.components.views))r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedquery",savedqueryid:c});for(let c of Hi(t.components.charts))r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedqueryvisualization",savedqueryvisualizationid:c});for(let c of Hi(t.components.dashboards))r.push({"@odata.type":"Microsoft.Dynamics.CRM.systemform",formid:c});let o=new Set(t.components.forms),s=new Set(t.components.views),l=new Set(t.components.charts),u=await nm(n,i,c=>pP(e,c));for(let c of u){for(let d of c.forms)o.has(d)||(o.add(d),r.push({"@odata.type":"Microsoft.Dynamics.CRM.systemform",formid:d}));for(let d of c.views)s.has(d)||(s.add(d),r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedquery",savedqueryid:d}));for(let d of c.charts)l.has(d)||(l.add(d),r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedqueryvisualization",savedqueryvisualizationid:d}))}return r}async function am(e,t,r){if(r.length===0)return;let n="/AddAppComponents";(0,Fe.ensureSuccess)(await e.post(n,{AppId:t,Components:r}),e.apiUrl(n))}async function hP(e,t,r){let n=`/appmodules(${t})`,i=`/sitemaps(${r.sitemapId})`;try{if(!await gP(e,r.sitemapId)){r.serverRefusedSitemap&&(0,Fe.ensureSuccess)(await e.delete(n),e.apiUrl(n));return}e.supportsAtomicBatch&&await cm(e,[{path:n,etag:r.appEtag},{path:i,etag:r.sitemapEtag}])}catch{}}async function gP(e,t){var r;let n=Do(t,"sitemapid"),i=await e.get(n);if(i.status<200||i.status>=300)throw new mt.SdkError("APP_SITEMAP_UNRESOLVED",`The unpublished-aware read of sitemap '${t}' returned HTTP ${i.status}, so it cannot be determined whether the row exists.`);let a=(r=i.body)===null||r===void 0?void 0:r.value;if(!Array.isArray(a))throw new mt.SdkError("APP_SITEMAP_UNRESOLVED",`The unpublished-aware read of sitemap '${t}' returned no readable result set, so it cannot be determined whether the row exists.`);return a.length>0}async function um(e,t){var r;let n=(0,ce.normalizeGuid)(t,"id"),i=b=>{throw new mt.SdkError("APP_SITEMAP_UNRESOLVED",`Refusing to delete app '${n}': ${b} Deleting the app would destroy the only pointer to its sitemap, stranding that row and reserving its unique name forever. Retry; if the app is newly created, publish it first (an unpublished app is not readable).`)},a=`/appmodules(${n})${sm}`,o;try{o=await e.get(a)}catch(b){return i(`reading the app failed (${b.message}).`)}if(o.status<200||o.status>=300)return i(o.status===404?"reading the app returned HTTP 404, which does NOT prove it is absent \u2014 Dataverse also reports an unpublished app that way, and such an app still owns a sitemap.":`reading the app returned HTTP ${o.status}.`);let s=(r=o.body)===null||r===void 0?void 0:r.uniquename;if(!s)return i("the app record carried no uniquename, so its sitemap cannot be located.");let l=await lm(e,s);if(!l)return{uniquename:s,appEtag:(0,Fe.readEtag)(o)};let u=(0,ce.normalizeGuid)(l,"sitemapId"),c=Do(u,"sitemapid,sitemapnameunique,sitemapxml"),d;try{d=await e.get(c)}catch(b){return i(`reading sitemap '${u}' failed (${b.message}).`)}if(d.status<200||d.status>=300)return i(`reading sitemap '${u}' returned HTTP ${d.status}.`);let f=Eu(d);if(!f)return i(`sitemap '${u}' was not returned by the unpublished-aware read.`);if(f.sitemapnameunique!==s)return i(`sitemap '${u}' now carries sitemapnameunique '${String(f.sitemapnameunique)}', not '${s}', so it is no longer this app's sitemap.`);let g=f.sitemapxml;return typeof g!="string"?i(`sitemap '${u}' returned no sitemapxml.`):{sitemapId:u,uniquename:s,sitemapXml:g,appEtag:(0,Fe.readEtag)(o),sitemapEtag:Iu(f)}}async function vP(e,t,r){let n=(0,ce.normalizeGuid)(t,"id"),i=await um(e,n);await r?.(i.sitemapXml),await dm(e,n,i)}_n.deleteAppResolvingOnce=vP;async function cm(e,t){let r=`batch_${(0,Du.newId)()}`,n=`changeset_${(0,Du.newId)()}`,i=t.map((d,f)=>[`--${n}`,"Content-Type: application/http","Content-Transfer-Encoding: binary",`Content-ID: ${f+1}`,"",`DELETE ${e.apiUrl(d.path)} HTTP/1.1`,...d.etag?[`If-Match: ${d.etag}`]:[],""].join(`\r
+ &$filter=(applicationid eq '${e}')`;v.SPNPrincipalIdUrl=UI;function BI(){return"/api/data/v9.0/appmodules?$filter=(uniquename eq 'AppDeploymentConfiguration')"}v.retrieveDeploymentPipelineConfigAppUrl=BI;v.retrieveFeatureControlSettingsByNamespaceUrl="/api/data/v9.1/RetrieveFeatureControlSettingsByNamespace";function kI(e){return`/api/data/v9.0/settingdefinitions${e}`}v.getSettingDefinitionsUri=kI;v.OrgSettingOverrideName="organizationsettings";function qI(e,t=!1){let r=`/api/data/v9.0/${v.OrgSettingOverrideName}${e}`;return t?`${v.cdsServiceUrl}${r}`:r}v.getOrgSettingOverrideUri=qI;v.AppSettingOverrideName="appsettings";function $I(e,t=!1){let r=`/api/data/v9.0/${v.AppSettingOverrideName}${e}`;return t?`${v.cdsServiceUrl.replace("/$","")}${r}`:r}v.getAppSettingOverrideUri=$I;var Fi;(function(e){e[e.All=0]="All",e[e.IsPlatformOnly=1]="IsPlatformOnly",e[e.NotPlatformOnly=2]="NotPlatformOnly"})(Fi||(v.RetrievePlatform=Fi={}));function VI(e,t,r,n=Fi.All,i=!1){let a=[];e&&a.push(`AppUniqueName='${e}'`),t!=null&&a.push(`ReleaseLevel=${t}`),r&&a.push(`RetrieveHiddenSettings=${r}`),n!==Fi.All&&a.push(`RetrievePlatformSettings=${n===Fi.IsPlatformOnly?1:0}`);let o="/api/data/v9.0/RetrieveUnpublishedOverridableSettingsInfo";return a.length&&(o=`${o}(${a.join(",")})`),i?`${v.cdsServiceUrl}${o}`:o}v.getPowerSettingsUri=VI;function GI(e,t,r,n=!1){let i=[`SettingName='${e}'`];t!==void 0&&i.push(`SolutionName='${t}'`),r!==void 0&&i.push(`AppUniqueName='${r}'`);let a="/api/data/v9.0/RetrieveUnpublishedSettingInfo";return i.length&&(a=`${a}(${i.join(",")})`),n?`${v.cdsServiceUrl}${a}`:a}v.getPowerSettingUri=GI;function zI(e=!1){let t="/api/data/v9.0/SaveSettingValue()";return e?`${v.cdsServiceUrl}${t}`:t}v.getSavePowerSettingUri=zI;v.retrieveUnpublishedSuffix="Microsoft.Dynamics.CRM.RetrieveUnpublishedMultiple()";function WI(e){return`tools/systemcustomization/businessrules/businessRulesDesigner.aspx?BRlaunchpoint=BRGrid&appSolutionId={${e}}`}v.getBusinessRuleDesignerUri=WI;function hf({environmentInstanceUrl:e,entityLogicalName:t}){return e&&t?`${e}main.aspx?cmdbar=true&forceUCI=1&navbar=off&newWindow=true&pageType=entityRecord&etn=${t}`:void 0}v.getUCIEntityRecordBaseUrl=hf;function jI({baseUrl:e,environmentInstanceUrl:t,entityLogicalName:r,recordId:n}){let i=e||hf({environmentInstanceUrl:t,entityLogicalName:r});return i&&n?`${i}&id=${n}`:void 0}v.getUCIEntityRecordEditUrl=jI;v.retrieveOrganizationResources=`${v.cdsServiceUrl}api/data/v9.0/RetrieveOrganizationResources`});var gf=m(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.DataverseClient=void 0;var HI=Hl(),Sn=be(),Ql=class{constructor(t,r,n){this.instanceUrl=t,this.httpClient=r,this.solutionUniqueName=n}withSolution(t){return this.solutionUniqueName?{...t,headers:{...t?.headers,"MSCRM.SolutionUniqueName":this.solutionUniqueName}}:t}apiUrl(t){let r=this.instanceUrl.replace(/\/+$/,""),n=t.startsWith("/")?t:`/${t}`;return`${r}/${HI.xrmApiUrl}${n}`}async send(t,r){try{return await r()}catch(n){throw n instanceof Sn.SdkError?n:new Sn.ConnectionError(t,0,n instanceof Error?n.message:String(n),n)}}get(t,r){let n=this.apiUrl(t);return this.send(n,()=>this.httpClient.get(n,r))}getAbsolute(t,r){return this.assertSameOrigin(t),this.send(t,()=>this.httpClient.get(t,r))}assertSameOrigin(t){let r,n;try{r=new URL(t),n=new URL(this.instanceUrl)}catch{throw new Sn.InvalidArgumentError(`Refusing to follow a malformed absolute URL: '${t}'`)}if(r.protocol!==n.protocol||r.host!==n.host)throw new Sn.InvalidArgumentError(`Refusing to follow a cross-origin link ('${r.origin}' is not the configured instance '${n.origin}'); server-driven pagination must stay on-instance.`)}post(t,r,n){let i=this.apiUrl(t);return this.send(i,()=>this.httpClient.post(i,r,this.withSolution(n)))}get supportsAtomicBatch(){return typeof this.httpClient.postRaw=="function"}postBatch(t,r,n){if(!this.httpClient.postRaw)throw new Sn.InvalidArgumentError("The injected HttpClient does not implement postRaw(), required for atomic $batch change sets");let i=this.apiUrl("/$batch"),a={...n,headers:{...n?.headers,"Content-Type":`multipart/mixed;boundary=${r}`}};return this.send(i,()=>this.httpClient.postRaw(i,t,a))}patch(t,r,n){let i=this.apiUrl(t);return this.send(i,()=>this.httpClient.patch(i,r,this.withSolution(n)))}put(t,r,n){if(!this.httpClient.put)throw new Sn.InvalidArgumentError("The injected HttpClient does not implement put(), required for metadata replace operations (e.g. updateColumn)");let i=this.apiUrl(t);return this.send(i,()=>this.httpClient.put(i,r,this.withSolution(n)))}delete(t,r){let n=this.apiUrl(t);return this.send(n,()=>this.httpClient.delete(n,this.withSolution(r)))}};bo.DataverseClient=Ql});var ce=m(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.odataQuery=Te.normalizeGuid=Te.createSafeXmlElement=Te.assertODataName=Te.assertXmlName=Te.xmlText=Te.odataPathLiteral=Te.odataLiteral=void 0;var Xl=be();function vf(e){return String(e??"").replace(/'/g,"''")}Te.odataLiteral=vf;function JI(e){return encodeURIComponent(vf(e))}Te.odataPathLiteral=JI;function QI(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Te.xmlText=QI;function bf(e,t){let r=String(e??""),n=/^[A-Za-z_][0-9A-Za-z_.-]*$/,i=r.split(":");if(!(i.length<=2&&i.every(o=>n.test(o))&&!/^xmlns/i.test(r)))throw new Xl.InvalidArgumentError(`${t} must be a valid XML element name (got '${e}')`);return e}Te.assertXmlName=bf;function XI(e,t){let r=String(e??"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(r))throw new Xl.InvalidArgumentError(`${t} must be a valid OData identifier (letters, digits, underscore): got '${e}'`);return e}Te.assertODataName=XI;function KI(e,t,r){return e.createElement(bf(t,r))}Te.createSafeXmlElement=KI;var YI=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;function ZI(e,t){let r=String(e??""),n=r.length===38&&r.startsWith("{")&&r.endsWith("}")?r.slice(1,-1):r;if(!YI.test(n))throw new Xl.InvalidArgumentError(`${t} must be a valid GUID (got '${e}')`);return n.toLowerCase()}Te.normalizeGuid=ZI;function e1(e){let t=[];for(let[r,n]of e)n!=null&&n!==""&&t.push(`${r}=${encodeURIComponent(String(n))}`);return t.length>0?`?${t.join("&")}`:""}Te.odataQuery=e1});var Ve=m(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.nowIso=Ne.isAlreadyDeleted=Ne.deleteRecord=Ne.ensureSuccess=Ne.requireCreatedId=Ne.readCreatedId=Ne.readEtag=Ne.VERSION_CONFLICT_CODE=void 0;var yo=be(),Kl=ce();Ne.VERSION_CONFLICT_CODE="VERSION_CONFLICT";function t1(e){var t;let r=(t=e.headers)!==null&&t!==void 0?t:{};for(let i of Object.keys(r))if(i.toLowerCase()==="etag")return r[i];let n=e.body;return n&&typeof n["@odata.etag"]=="string"?n["@odata.etag"]:null}Ne.readEtag=t1;function yf(e,t){var r;let n=e.body;if(n&&typeof n[t]=="string")return(0,Kl.normalizeGuid)(n[t],t);let i=(r=e.headers)!==null&&r!==void 0?r:{};for(let a of Object.keys(i))if(a.toLowerCase()==="odata-entityid"){let o=/\(([0-9a-fA-F-]{36})\)/.exec(i[a]);if(o)return(0,Kl.normalizeGuid)(o[1],t)}return null}Ne.readCreatedId=yf;function r1(e,t,r){let n=yf(e,t);if(!n)throw new yo.InvalidArgumentError(`Dataverse did not return an id for the created ${r}`);return n}Ne.requireCreatedId=r1;function Cf(e,t){if(e.status===412)throw new yo.SdkError(Ne.VERSION_CONFLICT_CODE,`Version conflict (412) from ${t}`);if(e.status<200||e.status>=300)throw new yo.ConnectionError(t,e.status,n1(e.body),e.body);return e}Ne.ensureSuccess=Cf;function n1(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e;if(t.error&&typeof t.error.message=="string")return t.error.message;if(typeof t.Message=="string")return t.Message;if(typeof t.message=="string")return t.message}return"request failed"}async function i1(e,t,r){let n=(0,Kl.normalizeGuid)(r,"id"),i=`/${t}(${n})`;Cf(await e.delete(i),e.apiUrl(i))}Ne.deleteRecord=i1;function a1(e){return e instanceof yo.ConnectionError&&e.statusCode===404}Ne.isAlreadyDeleted=a1;function o1(){return new Date().toISOString()}Ne.nowIso=o1});var Af=m(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.findColumns=Pr.findTables=Pr.fetchEntityMetadataFromApi=void 0;var Yl=Ve(),qt=ce();function Li(e){var t,r;return(r=(t=e?.UserLocalizedLabel)===null||t===void 0?void 0:t.Label)!==null&&r!==void 0?r:""}async function Dn(e,t){var r,n;let i=await e.get(t);return i.status<200||i.status>=300?[]:(n=(r=i.body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[]}function _r(e){return`/EntityDefinitions(LogicalName='${(0,qt.odataLiteral)(e)}')`}async function s1(e,t,r){let n=await Dn(e,`${_r(t)}/Attributes/Microsoft.Dynamics.CRM.StringAttributeMetadata${(0,qt.odataQuery)([["$select","LogicalName,MaxLength"]])}`);for(let i of n){let a=r.get(i.LogicalName);a&&typeof i.MaxLength=="number"&&(a.maxLength=i.MaxLength)}}async function l1(e,t,r){var n;let i=await Dn(e,`${_r(t)}/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata${(0,qt.odataQuery)([["$select","LogicalName"],["$expand","OptionSet($select=Options)"]])}`);for(let a of i){let o=r.get(a.LogicalName);o&&(!((n=a.OptionSet)===null||n===void 0)&&n.Options)&&(o.options=a.OptionSet.Options.map(s=>{var l;return{value:(l=s.Value)!==null&&l!==void 0?l:0,label:Li(s.Label)}}))}}async function u1(e,t,r){let n=await Dn(e,`${_r(t)}/Attributes/Microsoft.Dynamics.CRM.LookupAttributeMetadata${(0,qt.odataQuery)([["$select","LogicalName,Targets"]])}`);for(let i of n){let a=r.get(i.LogicalName);a&&i.Targets&&(a.targets=i.Targets)}}async function c1(e,t){var r,n,i,a;let o=[],s=await Dn(e,`${_r(t)}/OneToManyRelationships${(0,qt.odataQuery)([["$select","SchemaName,ReferencingEntity,ReferencingAttribute"]])}`);for(let c of s)o.push({schemaName:c.SchemaName,type:"OneToMany",relatedEntity:(r=c.ReferencingEntity)!==null&&r!==void 0?r:"",relatedAttribute:(n=c.ReferencingAttribute)!==null&&n!==void 0?n:""});let l=await Dn(e,`${_r(t)}/ManyToOneRelationships${(0,qt.odataQuery)([["$select","SchemaName,ReferencedEntity,ReferencedAttribute"]])}`);for(let c of l)o.push({schemaName:c.SchemaName,type:"ManyToOne",relatedEntity:(i=c.ReferencedEntity)!==null&&i!==void 0?i:"",relatedAttribute:(a=c.ReferencedAttribute)!==null&&a!==void 0?a:""});let u=await Dn(e,`${_r(t)}/ManyToManyRelationships${(0,qt.odataQuery)([["$select","SchemaName,Entity1LogicalName,Entity2LogicalName"]])}`);for(let c of u){let d=c.Entity1LogicalName===t?c.Entity2LogicalName:c.Entity1LogicalName;o.push({schemaName:c.SchemaName,type:"ManyToMany",relatedEntity:d??"",relatedAttribute:""})}return o}async function d1(e,t){var r,n,i,a,o;let s=`${_r(t)}`+(0,qt.odataQuery)([["$select","LogicalName,SchemaName,DisplayName,EntitySetName,IsCustomEntity,PrimaryNameAttribute,PrimaryIdAttribute"],["$expand","Attributes($select=LogicalName,DisplayName,AttributeType,IsCustomAttribute)"]]),u=(0,Yl.ensureSuccess)(await e.get(s),e.apiUrl(s)).body,c=((r=u.Attributes)!==null&&r!==void 0?r:[]).map(h=>{var b;return{logicalName:h.LogicalName,displayName:Li(h.DisplayName),attributeType:(b=h.AttributeType)!==null&&b!==void 0?b:"Unknown",isCustomAttribute:!!h.IsCustomAttribute}}),d=new Map(c.map(h=>[h.logicalName,h])),[,,,f]=await Promise.all([s1(e,t,d),l1(e,t,d),u1(e,t,d),c1(e,t)]);return{logicalName:u.LogicalName,schemaName:(n=u.SchemaName)!==null&&n!==void 0?n:u.LogicalName,displayName:Li(u.DisplayName),entitySetName:(i=u.EntitySetName)!==null&&i!==void 0?i:"",primaryNameAttribute:(a=u.PrimaryNameAttribute)!==null&&a!==void 0?a:"",primaryIdAttribute:(o=u.PrimaryIdAttribute)!==null&&o!==void 0?o:"",isCustomEntity:!!u.IsCustomEntity,attributes:c,relationships:f}}Pr.fetchEntityMetadataFromApi=d1;async function p1(e,t,r){var n,i;let a=`/EntityDefinitions${(0,qt.odataQuery)([["$select","LogicalName,SchemaName,EntitySetName,DisplayName,IsCustomEntity"]])}`,s=(i=(n=(0,Yl.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[],l=(t??"").toLowerCase(),u=s.filter(c=>!r?.customOnly||c.IsCustomEntity).map(c=>{var d,f;return{logicalName:c.LogicalName,schemaName:(d=c.SchemaName)!==null&&d!==void 0?d:c.LogicalName,displayName:Li(c.DisplayName),entitySetName:(f=c.EntitySetName)!==null&&f!==void 0?f:"",isCustom:!!c.IsCustomEntity}}).filter(c=>c.logicalName.toLowerCase().includes(l)||c.schemaName.toLowerCase().includes(l)||c.displayName.toLowerCase().includes(l));return typeof r?.top=="number"?u.slice(0,r.top):u}Pr.findTables=p1;async function f1(e,t,r,n){var i,a;let o=`${_r(t)}/Attributes`+(0,qt.odataQuery)([["$select","LogicalName,SchemaName,DisplayName,AttributeType,IsCustomAttribute"]]),l=(a=(i=(0,Yl.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:[],u=(r??"").toLowerCase(),c=l.map(d=>{var f,h;return{logicalName:d.LogicalName,schemaName:(f=d.SchemaName)!==null&&f!==void 0?f:d.LogicalName,displayName:Li(d.DisplayName),attributeType:(h=d.AttributeType)!==null&&h!==void 0?h:"Unknown",isCustom:!!d.IsCustomAttribute}}).filter(d=>d.logicalName.toLowerCase().includes(u)||d.schemaName.toLowerCase().includes(u)||d.displayName.toLowerCase().includes(u));return typeof n?.top=="number"?c.slice(0,n.top):c}Pr.findColumns=f1});var Co=m(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.updateTable=J.deleteAlternateKey=J.createAlternateKey=J.deleteGlobalOptionSet=J.createGlobalOptionSet=J.deleteRelationship=J.deleteColumn=J.updateColumn=J.deleteTable=J.createRelationship=J.insertStatusValue=J.createCustomerColumn=J.createColumn=J.createTable=J.resolveEntitySetName=void 0;var se=Ve(),X=ce(),Ot=be(),m1={String:"Microsoft.Dynamics.CRM.StringAttributeMetadata",Memo:"Microsoft.Dynamics.CRM.MemoAttributeMetadata",Integer:"Microsoft.Dynamics.CRM.IntegerAttributeMetadata",Decimal:"Microsoft.Dynamics.CRM.DecimalAttributeMetadata",Money:"Microsoft.Dynamics.CRM.MoneyAttributeMetadata",Boolean:"Microsoft.Dynamics.CRM.BooleanAttributeMetadata",DateTime:"Microsoft.Dynamics.CRM.DateTimeAttributeMetadata",Picklist:"Microsoft.Dynamics.CRM.PicklistAttributeMetadata",Lookup:"Microsoft.Dynamics.CRM.LookupAttributeMetadata"},or=1033;function ge(e,t){return{"@odata.type":"Microsoft.Dynamics.CRM.Label",LocalizedLabels:[{"@odata.type":"Microsoft.Dynamics.CRM.LocalizedLabel",Label:e,LanguageCode:t}]}}function Mi(e){return{Value:e,CanBeChanged:!0,ManagedPropertyLogicalName:"canmodifyrequirementlevelsettings"}}function eu(e){let t=e.indexOf("_");return t>0?e.slice(0,t):e}function wf(e,t,r){let n=e[t];n&&typeof n=="object"?n.Value=r:e[t]={Value:r}}function Ui(e){let t=(0,se.readCreatedId)(e,"MetadataId");if(!t)throw new Ot.InvalidArgumentError("Dataverse did not return a MetadataId for the created metadata component");return t}function h1(e,t,r){var n,i,a,o,s,l,u,c,d,f,h,b,w,N,I,R,F,M,W,B,j,k;switch(e){case"string":return{"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",AttributeType:"String",AttributeTypeName:{Value:"StringType"},MaxLength:(n=t.maxLength)!==null&&n!==void 0?n:100,FormatName:{Value:(i=t.stringFormat)!==null&&i!==void 0?i:"Text"}};case"memo":return{"@odata.type":"Microsoft.Dynamics.CRM.MemoAttributeMetadata",AttributeType:"Memo",AttributeTypeName:{Value:"MemoType"},MaxLength:(a=t.maxLength)!==null&&a!==void 0?a:2e3,Format:"TextArea"};case"integer":return{"@odata.type":"Microsoft.Dynamics.CRM.IntegerAttributeMetadata",AttributeType:"Integer",AttributeTypeName:{Value:"IntegerType"},Format:"None",MinValue:(o=t.minValue)!==null&&o!==void 0?o:-2147483648,MaxValue:(s=t.maxValue)!==null&&s!==void 0?s:2147483647};case"bigint":return{"@odata.type":"Microsoft.Dynamics.CRM.BigIntAttributeMetadata",AttributeType:"BigInt",AttributeTypeName:{Value:"BigIntType"}};case"double":return{"@odata.type":"Microsoft.Dynamics.CRM.DoubleAttributeMetadata",AttributeType:"Double",AttributeTypeName:{Value:"DoubleType"},Precision:(l=t.precision)!==null&&l!==void 0?l:2,MinValue:(u=t.minValue)!==null&&u!==void 0?u:-1e11,MaxValue:(c=t.maxValue)!==null&&c!==void 0?c:1e11};case"decimal":return{"@odata.type":"Microsoft.Dynamics.CRM.DecimalAttributeMetadata",AttributeType:"Decimal",AttributeTypeName:{Value:"DecimalType"},Precision:(d=t.precision)!==null&&d!==void 0?d:2,MinValue:(f=t.minValue)!==null&&f!==void 0?f:-1e11,MaxValue:(h=t.maxValue)!==null&&h!==void 0?h:1e11};case"money":return{"@odata.type":"Microsoft.Dynamics.CRM.MoneyAttributeMetadata",AttributeType:"Money",AttributeTypeName:{Value:"MoneyType"},Precision:(b=t.precision)!==null&&b!==void 0?b:2,PrecisionSource:2,MinValue:(w=t.minValue)!==null&&w!==void 0?w:0,MaxValue:(N=t.maxValue)!==null&&N!==void 0?N:1e9};case"boolean":return{"@odata.type":"Microsoft.Dynamics.CRM.BooleanAttributeMetadata",AttributeType:"Boolean",AttributeTypeName:{Value:"BooleanType"},DefaultValue:!1,OptionSet:{"@odata.type":"Microsoft.Dynamics.CRM.BooleanOptionSetMetadata",TrueOption:{Value:1,Label:ge((I=t.trueLabel)!==null&&I!==void 0?I:"Yes",r)},FalseOption:{Value:0,Label:ge((R=t.falseLabel)!==null&&R!==void 0?R:"No",r)}}};case"dateTime":return{"@odata.type":"Microsoft.Dynamics.CRM.DateTimeAttributeMetadata",AttributeType:"DateTime",AttributeTypeName:{Value:"DateTimeType"},Format:(F=t.dateFormat)!==null&&F!==void 0?F:"DateAndTime"};case"choice":return Nf(t,r,!1);case"multiChoice":return Nf(t,r,!0);case"file":return{"@odata.type":"Microsoft.Dynamics.CRM.FileAttributeMetadata",AttributeType:"Virtual",AttributeTypeName:{Value:"FileType"},MaxSizeInKB:(M=t.maxSizeKb)!==null&&M!==void 0?M:10240};case"image":return{"@odata.type":"Microsoft.Dynamics.CRM.ImageAttributeMetadata",AttributeType:"Virtual",AttributeTypeName:{Value:"ImageType"},IsPrimaryImage:(W=t.isPrimaryImage)!==null&&W!==void 0?W:!1,MaxSizeInKB:(B=t.maxSizeKb)!==null&&B!==void 0?B:10240};case"autonumber":return{"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",AttributeType:"String",AttributeTypeName:{Value:"StringType"},FormatName:{Value:"Text"},MaxLength:(j=t.maxLength)!==null&&j!==void 0?j:100,AutoNumberFormat:(k=t.autoNumberFormat)!==null&&k!==void 0?k:""};default:throw new Ot.InvalidArgumentError(`unsupported column type '${String(e)}'`)}}function Nf(e,t,r){let i={"@odata.type":r?"Microsoft.Dynamics.CRM.MultiSelectPicklistAttributeMetadata":"Microsoft.Dynamics.CRM.PicklistAttributeMetadata",AttributeType:r?"Virtual":"Picklist",AttributeTypeName:{Value:r?"MultiSelectPicklistType":"PicklistType"}};if(e.globalChoiceMetadataId)return i["[email protected]"]=`/GlobalOptionSetDefinitions(${(0,X.normalizeGuid)(e.globalChoiceMetadataId,"globalChoiceMetadataId")})`,i;if(!e.options||e.options.length===0)throw new Ot.InvalidArgumentError(`choice column '${e.schemaName}' requires at least one option (or a globalChoiceMetadataId)`);return i.OptionSet={"@odata.type":"Microsoft.Dynamics.CRM.OptionSetMetadata",IsGlobal:!1,OptionSetType:"Picklist",Options:e.options.map(a=>({Value:a.value,Label:ge(a.label,t)}))},i}var Zl=new WeakMap;async function g1(e,t){var r,n;let i=(r=Zl.get(e))===null||r===void 0?void 0:r.get(t);if(i)return i;let a=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')${(0,X.odataQuery)([["$select","EntitySetName"]])}`,s=(n=(0,se.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.EntitySetName;if(!s)throw new Ot.InvalidArgumentError(`could not resolve EntitySetName for '${t}'`);(0,X.assertODataName)(s,`server-derived EntitySetName for '${t}'`);let l=Zl.get(e);return l||(l=new Map,Zl.set(e,l)),l.set(t,s),s}J.resolveEntitySetName=g1;async function v1(e,t){var r,n,i,a,o,s,l,u,c,d,f,h;let b=(r=t.languageCode)!==null&&r!==void 0?r:or,w=eu(t.schemaName),N=(n=t.primaryColumnSchemaName)!==null&&n!==void 0?n:`${w}_Name`,I={"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",AttributeType:"String",AttributeTypeName:{Value:"StringType"},SchemaName:N,RequiredLevel:Mi("None"),MaxLength:(i=t.primaryColumnMaxLength)!==null&&i!==void 0?i:100,FormatName:{Value:"Text"},DisplayName:ge((a=t.primaryColumnDisplayName)!==null&&a!==void 0?a:"Name",b),IsPrimaryName:!0};t.primaryColumnAutoNumberFormat&&(I.AutoNumberFormat=t.primaryColumnAutoNumberFormat);let R={"@odata.type":"Microsoft.Dynamics.CRM.EntityMetadata",SchemaName:t.schemaName,DisplayName:ge(t.displayName,b),DisplayCollectionName:ge((o=t.pluralName)!==null&&o!==void 0?o:`${t.displayName}s`,b),OwnershipType:(s=t.ownership)!==null&&s!==void 0?s:"UserOwned",IsActivity:!1,HasActivities:(l=t.hasActivities)!==null&&l!==void 0?l:!1,HasNotes:(u=t.hasNotes)!==null&&u!==void 0?u:!1,Attributes:[I]};t.description&&(R.Description=ge(t.description,b));let F="/EntityDefinitions",M=(0,se.ensureSuccess)(await e.post(F,R),e.apiUrl(F)),W=Ui(M),B=`/EntityDefinitions(${W})`+(0,X.odataQuery)([["$select","LogicalName,EntitySetName,PrimaryIdAttribute,PrimaryNameAttribute"]]),k=(0,se.ensureSuccess)(await e.get(B),e.apiUrl(B)).body;return{logicalName:(c=k.LogicalName)!==null&&c!==void 0?c:t.schemaName.toLowerCase(),metadataId:W,entitySetName:(d=k.EntitySetName)!==null&&d!==void 0?d:"",primaryIdAttribute:(f=k.PrimaryIdAttribute)!==null&&f!==void 0?f:`${t.schemaName.toLowerCase()}id`,primaryNameAttribute:(h=k.PrimaryNameAttribute)!==null&&h!==void 0?h:N.toLowerCase()}}J.createTable=v1;async function b1(e,t,r){var n,i;let a=(n=r.languageCode)!==null&&n!==void 0?n:or,o={...h1(r.type,r,a),SchemaName:r.schemaName,RequiredLevel:Mi((i=r.required)!==null&&i!==void 0?i:"None"),DisplayName:ge(r.displayName,a)};r.description&&(o.Description=ge(r.description,a)),r.sourceType&&r.sourceType!=="Simple"&&(o.SourceType=r.sourceType==="Rollup"?2:1,r.formulaDefinition&&(o.FormulaDefinition=r.formulaDefinition));let s=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Attributes`,l=(0,se.ensureSuccess)(await e.post(s,o),e.apiUrl(s));return{logicalName:r.schemaName.toLowerCase(),metadataId:Ui(l)}}J.createColumn=b1;async function y1(e,t,r){var n,i,a,o;let s=(n=r.languageCode)!==null&&n!==void 0?n:or,l=eu(r.schemaName),u=(i=r.accountRelationshipName)!==null&&i!==void 0?i:`${l}_${t}_account`,c=(a=r.contactRelationshipName)!==null&&a!==void 0?a:`${l}_${t}_contact`,d={Lookup:{"@odata.type":"Microsoft.Dynamics.CRM.ComplexLookupAttributeMetadata",SchemaName:r.schemaName,DisplayName:ge(r.displayName,s),RequiredLevel:Mi((o=r.required)!==null&&o!==void 0?o:"None"),Targets:["account","contact"]},OneToManyRelationships:[{"@odata.type":"Microsoft.Dynamics.CRM.ComplexOneToManyRelationshipMetadata",SchemaName:u,ReferencedEntity:"account",ReferencingEntity:t},{"@odata.type":"Microsoft.Dynamics.CRM.ComplexOneToManyRelationshipMetadata",SchemaName:c,ReferencedEntity:"contact",ReferencingEntity:t}]};return(0,se.ensureSuccess)(await e.post("/CreateCustomerRelationships",d),e.apiUrl("/CreateCustomerRelationships")),{logicalName:r.schemaName.toLowerCase(),metadataId:""}}J.createCustomerColumn=y1;async function C1(e,t,r){var n,i,a,o,s;let l=(n=r.languageCode)!==null&&n!==void 0?n:or,u={EntityLogicalName:t,AttributeLogicalName:"statuscode",Label:ge(r.label,l),StateCode:(i=r.stateCode)!==null&&i!==void 0?i:0};typeof r.value=="number"&&(u.Value=r.value),r.color&&(u.Color=r.color);let c=(0,se.ensureSuccess)(await e.post("/InsertStatusValue",u),e.apiUrl("/InsertStatusValue"));return Number((s=(o=(a=c.body)===null||a===void 0?void 0:a.NewOptionValue)!==null&&o!==void 0?o:r.value)!==null&&s!==void 0?s:0)}J.insertStatusValue=C1;async function A1(e,t){var r,n,i,a,o;let s=(r=t.languageCode)!==null&&r!==void 0?r:or,l,u;if(t.type==="OneToMany"){if(!t.referencedEntity||!t.referencingEntity)throw new Ot.InvalidArgumentError("OneToMany relationship requires referencedEntity and referencingEntity");let f=(n=t.lookupSchemaName)!==null&&n!==void 0?n:`${eu(t.schemaName)}_${t.referencedEntity}Id`;u=f.toLowerCase(),l={"@odata.type":"Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata",SchemaName:t.schemaName,ReferencedEntity:t.referencedEntity,ReferencingEntity:t.referencingEntity,Lookup:{"@odata.type":"Microsoft.Dynamics.CRM.LookupAttributeMetadata",AttributeType:"Lookup",AttributeTypeName:{Value:"LookupType"},SchemaName:f,RequiredLevel:Mi((i=t.lookupRequired)!==null&&i!==void 0?i:"None"),DisplayName:ge((a=t.lookupDisplayName)!==null&&a!==void 0?a:t.referencedEntity,s)}}}else{if(!t.entity1||!t.entity2)throw new Ot.InvalidArgumentError("ManyToMany relationship requires entity1 and entity2");l={"@odata.type":"Microsoft.Dynamics.CRM.ManyToManyRelationshipMetadata",SchemaName:t.schemaName,IntersectEntityName:(o=t.intersectEntityName)!==null&&o!==void 0?o:t.schemaName.toLowerCase(),Entity1LogicalName:t.entity1,Entity2LogicalName:t.entity2}}let c="/RelationshipDefinitions",d=(0,se.ensureSuccess)(await e.post(c,l),e.apiUrl(c));return{schemaName:t.schemaName,metadataId:Ui(d),lookupLogicalName:u}}J.createRelationship=A1;async function w1(e,t){let r=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')`;(0,se.ensureSuccess)(await e.delete(r),e.apiUrl(r))}J.deleteTable=w1;async function N1(e,t,r,n){var i,a;let o=(i=n.languageCode)!==null&&i!==void 0?i:or,s=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Attributes`,l=`${s}(LogicalName='${(0,X.odataLiteral)(r)}')${(0,X.odataQuery)([["$select","MetadataId,AttributeType"]])}`,c=(0,se.ensureSuccess)(await e.get(l),e.apiUrl(l)).body,d=m1[(a=c.AttributeType)!==null&&a!==void 0?a:""];if(!c.MetadataId||!d)throw new Ot.InvalidArgumentError(`cannot update column '${r}' on '${t}' (type '${c.AttributeType}' not supported)`);let f=(0,X.normalizeGuid)(c.MetadataId,"MetadataId"),h=`${s}(${f})/${d}`,b=(0,se.ensureSuccess)(await e.get(h),e.apiUrl(h)).body;for(let N of Object.keys(b))N.startsWith("@odata.")&&delete b[N];b["@odata.type"]=d,n.displayName!==void 0&&(b.DisplayName=ge(n.displayName,o)),n.description!==void 0&&(b.Description=ge(n.description,o)),n.required!==void 0&&(b.RequiredLevel=Mi(n.required)),n.maxLength!==void 0&&(b.MaxLength=n.maxLength),n.autoNumberFormat!==void 0&&(b.AutoNumberFormat=n.autoNumberFormat);let w=`${s}(${f})`;(0,se.ensureSuccess)(await e.put(w,b,{headers:{"MSCRM.MergeLabels":"true"}}),e.apiUrl(w))}J.updateColumn=N1;async function S1(e,t,r){var n;let i=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Attributes`,a=`${i}(LogicalName='${(0,X.odataLiteral)(r)}')${(0,X.odataQuery)([["$select","MetadataId"]])}`,s=(n=(0,se.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.MetadataId;if(!s)throw new Ot.InvalidArgumentError(`column '${r}' not found on '${t}'`);let l=`${i}(${(0,X.normalizeGuid)(s,"MetadataId")})`;(0,se.ensureSuccess)(await e.delete(l),e.apiUrl(l))}J.deleteColumn=S1;async function D1(e,t){var r,n,i;let a=`/RelationshipDefinitions${(0,X.odataQuery)([["$filter",`SchemaName eq '${(0,X.odataLiteral)(t)}'`],["$select","MetadataId"]])}`,s=(i=(n=(r=(0,se.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||r===void 0?void 0:r.value)===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.MetadataId;if(!s)throw new Ot.InvalidArgumentError(`relationship '${t}' not found`);let l=`/RelationshipDefinitions(${(0,X.normalizeGuid)(s,"MetadataId")})`;(0,se.ensureSuccess)(await e.delete(l),e.apiUrl(l))}J.deleteRelationship=D1;async function Sf(e,t){var r;let n=`/GlobalOptionSetDefinitions(Name='${(0,X.odataPathLiteral)(t)}')${(0,X.odataQuery)([["$select","MetadataId"]])}`,i=await e.get(n);if(i.status===404)return;let o=(r=(0,se.ensureSuccess)(i,e.apiUrl(n)).body)===null||r===void 0?void 0:r.MetadataId;return o?(0,X.normalizeGuid)(o,"MetadataId"):void 0}async function E1(e,t){var r;let n=t.name.toLowerCase(),i=await Sf(e,n);if(i)return{name:n,metadataId:i};let a=(r=t.languageCode)!==null&&r!==void 0?r:or,o={"@odata.type":"Microsoft.Dynamics.CRM.OptionSetMetadata",Name:n,DisplayName:ge(t.displayName,a),IsGlobal:!0,OptionSetType:"Picklist",Options:t.options.map(l=>({Value:l.value,Label:ge(l.label,a)}))};t.description&&(o.Description=ge(t.description,a));let s="/GlobalOptionSetDefinitions";try{let l=(0,se.ensureSuccess)(await e.post(s,o),e.apiUrl(s));return{name:n,metadataId:Ui(l)}}catch(l){let u;try{u=await Sf(e,n)}catch{u=void 0}if(u)return{name:n,metadataId:u};throw l}}J.createGlobalOptionSet=E1;async function I1(e,t){let r=`/GlobalOptionSetDefinitions(Name='${(0,X.odataLiteral)(t.toLowerCase())}')`;(0,se.ensureSuccess)(await e.delete(r),e.apiUrl(r))}J.deleteGlobalOptionSet=I1;async function _1(e,t,r){var n;let i=(n=r.languageCode)!==null&&n!==void 0?n:or,a={"@odata.type":"Microsoft.Dynamics.CRM.EntityKeyMetadata",SchemaName:r.schemaName,DisplayName:ge(r.displayName,i),KeyAttributes:r.keyAttributes},o=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Keys`,s=(0,se.ensureSuccess)(await e.post(o,a),e.apiUrl(o));return{logicalName:r.schemaName.toLowerCase(),metadataId:Ui(s)}}J.createAlternateKey=_1;async function P1(e,t,r){var n;let i=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')/Keys`,a=`${i}(LogicalName='${(0,X.odataLiteral)(r.toLowerCase())}')${(0,X.odataQuery)([["$select","MetadataId"]])}`,s=(n=(0,se.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.MetadataId;if(!s)throw new Ot.InvalidArgumentError(`alternate key '${r}' not found on '${t}'`);let l=`${i}(${(0,X.normalizeGuid)(s,"MetadataId")})`;(0,se.ensureSuccess)(await e.delete(l),e.apiUrl(l))}J.deleteAlternateKey=P1;async function O1(e,t,r){var n;let i=(n=r.languageCode)!==null&&n!==void 0?n:or,a=`/EntityDefinitions(LogicalName='${(0,X.odataLiteral)(t)}')`,s=(0,se.ensureSuccess)(await e.get(a),e.apiUrl(a)).body,l=s.MetadataId;if(!l)throw new Ot.InvalidArgumentError(`table '${t}' not found`);let u=(0,X.normalizeGuid)(l,"MetadataId");for(let d of Object.keys(s))d.startsWith("@odata.")&&delete s[d];s["@odata.type"]="Microsoft.Dynamics.CRM.EntityMetadata",r.displayName!==void 0&&(s.DisplayName=ge(r.displayName,i)),r.pluralName!==void 0&&(s.DisplayCollectionName=ge(r.pluralName,i)),r.description!==void 0&&(s.Description=ge(r.description,i)),r.auditEnabled!==void 0&&wf(s,"IsAuditEnabled",r.auditEnabled),r.duplicateDetectionEnabled!==void 0&&wf(s,"IsDuplicateDetectionEnabled",r.duplicateDetectionEnabled),r.changeTrackingEnabled!==void 0&&(s.ChangeTrackingEnabled=r.changeTrackingEnabled),r.quickCreateEnabled!==void 0&&(s.IsQuickCreateEnabled=r.quickCreateEnabled),r.iconVectorName!==void 0&&(s.IconVectorName=r.iconVectorName),r.iconSmallName!==void 0&&(s.IconSmallName=r.iconSmallName),r.iconMediumName!==void 0&&(s.IconMediumName=r.iconMediumName),r.iconLargeName!==void 0&&(s.IconLargeName=r.iconLargeName);let c=`/EntityDefinitions(${u})`;(0,se.ensureSuccess)(await e.put(c,s,{headers:{"MSCRM.MergeLabels":"true"}}),e.apiUrl(c))}J.updateTable=O1});var Bi=m(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.disassociateRecords=me.associateRecords=me.createRecordsBulk=me.upsertRecord=me.queryAllRecords=me.queryRecords=me.getRecord=me.deleteRecord=me.updateRecord=me.createRecord=void 0;var vt=Ve(),Ge=ce(),Hr=be(),$t=Co();function Ao(e){let t=e,r=!1,n={};for(let i of Object.keys(t)){let a=t[i];Array.isArray(a)&&a.every(o=>typeof o=="number")?(n[i]=a.join(","),r=!0):n[i]=a}return r?n:e}async function T1(e,t,r){let i=`/${await(0,$t.resolveEntitySetName)(e,t)}`,a=(0,vt.ensureSuccess)(await e.post(i,Ao(r)),e.apiUrl(i)),o=(0,vt.readCreatedId)(a,`${t}id`);if(!o)throw new Hr.InvalidArgumentError(`Dataverse did not return an id for the created '${t}' row`);return{id:o,entityType:t}}me.createRecord=T1;async function R1(e,t,r,n){let i=(0,Ge.normalizeGuid)(r,"id"),o=`/${await(0,$t.resolveEntitySetName)(e,t)}(${i})`;(0,vt.ensureSuccess)(await e.patch(o,Ao(n)),e.apiUrl(o))}me.updateRecord=R1;async function F1(e,t,r){let n=(0,Ge.normalizeGuid)(r,"id"),a=`/${await(0,$t.resolveEntitySetName)(e,t)}(${n})`;(0,vt.ensureSuccess)(await e.delete(a),e.apiUrl(a))}me.deleteRecord=F1;async function x1(e,t,r,n){var i;let a=(0,Ge.normalizeGuid)(r,"id"),o=await(0,$t.resolveEntitySetName)(e,t),s=(0,Ge.odataQuery)([["$select",n&&n.length>0?n.join(","):void 0]]),l=`/${o}(${a})${s}`;return(i=(0,vt.ensureSuccess)(await e.get(l),e.apiUrl(l)).body)!==null&&i!==void 0?i:{}}me.getRecord=x1;function L1(e){return e?.fetchXml?(0,Ge.odataQuery)([["fetchXml",e.fetchXml]]):(0,Ge.odataQuery)([["$select",e?.select&&e.select.length>0?e.select.join(","):void 0],["$filter",e?.filter],["$orderby",e?.orderBy],["$expand",e?.expand],["$top",e?.top]])}async function Df(e,t,r){var n,i;if(r?.paginate){if(r.top!==void 0)throw new Hr.InvalidArgumentError("queryRecords: `paginate` cannot be combined with `top` \u2014 Dataverse honors $top as a hard cap and omits @odata.nextLink, so the result would be silently capped at one page.");if(r.fetchXml)throw new Hr.InvalidArgumentError("queryRecords: `paginate` is not supported with `fetchXml` \u2014 FetchXML paging uses a paging cookie (page / fetchxmlpagingcookie), not @odata.nextLink. Page the FetchXML manually, or use an OData query.")}let o=`/${await(0,$t.resolveEntitySetName)(e,t)}${L1(r)}`,s=(0,vt.ensureSuccess)(await e.get(o),e.apiUrl(o));if(!r?.paginate)return(i=(n=s.body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[];let l=[],u=new Set,c=e.apiUrl(o);for(;;){let d=s.body,f=d?.value;if(!Array.isArray(f))throw new Hr.ConnectionError(c,s.status,`paginated query returned a malformed page \u2014 expected an OData 'value' array but got ${M1(f)}; refusing to return partial results.`);for(let b of f)l.push(b);let h=d?.["@odata.nextLink"];if(!h)break;if(typeof h!="string")throw new Hr.ConnectionError(c,s.status,`paginated query returned a non-string @odata.nextLink (${typeof h}); cannot follow it.`);if(u.has(h))throw new Hr.InvalidArgumentError(`queryRecords: aborting pagination \u2014 the server returned a repeated @odata.nextLink ('${h}'), which would loop indefinitely.`);u.add(h),c=h,s=(0,vt.ensureSuccess)(await e.getAbsolute(h),h)}return l}me.queryRecords=Df;function M1(e){return e===null?"null":e===void 0?"undefined (missing)":`a ${typeof e}`}async function U1(e,t,r){return Df(e,t,{...r,paginate:!0})}me.queryAllRecords=U1;function B1(e){if("id"in e)return`(${(0,Ge.normalizeGuid)(e.id,"id")})`;let t=typeof e.value=="string"?`'${(0,Ge.odataPathLiteral)(e.value)}'`:e.value;return`(${(0,Ge.assertODataName)(e.key,"alternate key name")}=${t})`}async function k1(e,t,r,n){let i=B1(r),o=`/${await(0,$t.resolveEntitySetName)(e,t)}${i}`,s=(0,vt.ensureSuccess)(await e.patch(o,Ao(n)),e.apiUrl(o)),l=s.status===201,u=(0,vt.readCreatedId)(s,`${t}id`);return{id:u??("id"in r?(0,Ge.normalizeGuid)(r.id,"id"):""),created:l}}me.upsertRecord=k1;async function q1(e,t,r){var n,i;if(r.length===0)return[];let a=await(0,$t.resolveEntitySetName)(e,t),o=r.map(c=>({"@odata.type":`Microsoft.Dynamics.CRM.${t}`,...Ao(c)})),s=`/${a}/Microsoft.Dynamics.CRM.CreateMultiple`,u=(i=(n=(0,vt.ensureSuccess)(await e.post(s,{Targets:o}),e.apiUrl(s)).body)===null||n===void 0?void 0:n.Ids)!==null&&i!==void 0?i:[];if(u.length!==r.length)throw new Hr.InvalidArgumentError(`CreateMultiple on '${t}' returned ${u.length} id(s) for ${r.length} row(s)`);return u}me.createRecordsBulk=q1;async function $1(e,t,r,n){let i=(0,Ge.normalizeGuid)(r,"id"),a=(0,Ge.normalizeGuid)(n.targetId,"targetId"),o=await(0,$t.resolveEntitySetName)(e,t),s=await(0,$t.resolveEntitySetName)(e,n.targetEntity),l=(0,Ge.assertODataName)(n.relationshipName,"relationshipName"),u=`/${o}(${i})/${l}/$ref`,c={"@odata.id":e.apiUrl(`/${s}(${a})`)};(0,vt.ensureSuccess)(await e.post(u,c),e.apiUrl(u))}me.associateRecords=$1;async function V1(e,t,r,n,i){let a=(0,Ge.normalizeGuid)(r,"id"),o=(0,Ge.normalizeGuid)(i,"targetId"),s=await(0,$t.resolveEntitySetName)(e,t),l=(0,Ge.assertODataName)(n,"relationshipName"),u=`/${s}(${a})/${l}(${o})/$ref`;(0,vt.ensureSuccess)(await e.delete(u),e.apiUrl(u))}me.disassociateRecords=V1});var _f=m(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.deleteWebResource=Vt.getWebResource=Vt.updateWebResource=Vt.createWebResource=void 0;var En=Ve(),ki=ce(),tu=be(),G1={html:1,css:2,js:3,xml:4,png:5,jpg:6,gif:7,xsl:9,ico:10,svg:11,resx:12};function z1(e){let t=globalThis;if(t.Buffer)return t.Buffer.from(e,"utf8").toString("base64");if(t.btoa){let r=globalThis.TextEncoder;if(r){let n=new r().encode(e),i="",a=32768;for(let o=0;o<n.length;o+=a)i+=String.fromCharCode(...n.subarray(o,o+a));return t.btoa(i)}return t.btoa(e)}throw new tu.InvalidArgumentError("no base64 encoder available; pass contentBase64 instead of content")}function Ef(e){if(e.contentBase64!==void 0)return e.contentBase64;if(e.content!==void 0)return z1(e.content)}async function If(e,t){let r=`<importexportxml><webresources><webresource>${(0,ki.xmlText)(t)}</webresource></webresources></importexportxml>`;(0,En.ensureSuccess)(await e.post("/PublishXml",{ParameterXml:r}),e.apiUrl("/PublishXml"))}async function W1(e,t){var r;let n=Ef(t);if(n===void 0)throw new tu.InvalidArgumentError(`web resource '${t.name}' requires content or contentBase64`);let i={name:t.name,displayname:(r=t.displayName)!==null&&r!==void 0?r:t.name,webresourcetype:G1[t.type],content:n};t.description&&(i.description=t.description);let a=(0,En.ensureSuccess)(await e.post("/webresourceset",i),e.apiUrl("/webresourceset")),o=(0,En.readCreatedId)(a,"webresourceid");if(!o)throw new tu.InvalidArgumentError(`Dataverse did not return an id for web resource '${t.name}'`);return t.publish!==!1&&await If(e,o),{id:o,name:t.name}}Vt.createWebResource=W1;async function j1(e,t,r){let n=(0,ki.normalizeGuid)(t,"id"),i={},a=Ef(r);a!==void 0&&(i.content=a),r.displayName!==void 0&&(i.displayname=r.displayName),r.description!==void 0&&(i.description=r.description);let o=`/webresourceset(${n})`;(0,En.ensureSuccess)(await e.patch(o,i),e.apiUrl(o)),r.publish!==!1&&await If(e,n)}Vt.updateWebResource=j1;async function H1(e,t){var r;let i=`/webresourceset(${(0,ki.normalizeGuid)(t,"id")})${(0,ki.odataQuery)([["$select","name,displayname,webresourcetype,content,description"]])}`;return(r=(0,En.ensureSuccess)(await e.get(i),e.apiUrl(i)).body)!==null&&r!==void 0?r:{}}Vt.getWebResource=H1;async function J1(e,t){let n=`/webresourceset(${(0,ki.normalizeGuid)(t,"id")})`;(0,En.ensureSuccess)(await e.delete(n),e.apiUrl(n))}Vt.deleteWebResource=J1});var Pf=m(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.deleteSolution=K.importSolution=K.exportSolution=K.removeSolutionComponent=K.addSolutionComponent=K.setSolutionVersion=K.createSolution=K.createPublisher=K.getSolution=K.fetchSolutionComponents=K.SolutionComponentType=void 0;var mt=Ve(),ft=ce(),Jr=be();K.SolutionComponentType={SavedQuery:26,Workflow:29,SavedQueryVisualization:59,SystemForm:60,AppModule:80};var Q1=[K.SolutionComponentType.SavedQuery,K.SolutionComponentType.Workflow,K.SolutionComponentType.SavedQueryVisualization,K.SolutionComponentType.SystemForm,K.SolutionComponentType.AppModule];async function X1(e,t){var r;let n=(0,ft.normalizeGuid)(t,"solutionId"),i=Q1.map(l=>`msdyn_componenttype eq ${l}`).join(" or "),a=`/msdyn_solutioncomponentsummaries${(0,ft.odataQuery)([["$select","msdyn_objectid,msdyn_componenttype,msdyn_workflowcategory,msdyn_displayname,msdyn_name"],["$filter",`msdyn_solutionid eq ${n} and (${i})`]])}`,o=[],s=(0,mt.ensureSuccess)(await e.get(a),e.apiUrl(a));for(;;){let l=s.body;for(let c of(r=l?.value)!==null&&r!==void 0?r:[])o.push(c);let u=l?.["@odata.nextLink"];if(!u)break;s=(0,mt.ensureSuccess)(await e.getAbsolute(u),u)}return o.filter(l=>typeof l.msdyn_objectid=="string").map(l=>({objectId:l.msdyn_objectid,componentType:Number(l.msdyn_componenttype),workflowCategory:l.msdyn_workflowcategory==null?void 0:Number(l.msdyn_workflowcategory),displayName:l.msdyn_displayname,name:l.msdyn_name}))}K.fetchSolutionComponents=X1;function K1(e){let t=e.length===38&&e.startsWith("{")&&e.endsWith("}")?e.slice(1,-1):e;return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t)}async function Y1(e,t){var r,n,i,a,o,s,l,u,c,d;let f=String(t??"").trim();if(!f)throw new Jr.InvalidArgumentError("getSolution: a solution unique name or id is required.");let h=K1(f)?`solutionid eq ${(0,ft.normalizeGuid)(f,"solutionId")}`:`uniquename eq '${(0,ft.odataLiteral)(f)}'`,b=`/solutions${(0,ft.odataQuery)([["$select","solutionid,uniquename,friendlyname,version,ismanaged"],["$expand","publisherid($select=publisherid,uniquename,customizationprefix,customizationoptionvalueprefix)"],["$filter",h]])}`,I=((n=(r=(0,mt.ensureSuccess)(await e.get(b),e.apiUrl(b)).body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0];if(!I?.solutionid)throw new Jr.InvalidArgumentError(`No solution found for '${t}'.`);let R=I.publisherid;if(!R?.publisherid)throw new Jr.InvalidArgumentError(`Solution '${(i=I.uniquename)!==null&&i!==void 0?i:t}' returned no owning publisher, so its customization prefix cannot be determined; refusing to report an empty prefix that could be mistaken for "no prefix".`);if(!("customizationprefix"in R))throw new Jr.InvalidArgumentError(`Solution '${(a=I.uniquename)!==null&&a!==void 0?a:t}' returned a publisher without a customizationprefix property (partial expansion), so its prefix cannot be determined.`);return{solutionId:(0,ft.normalizeGuid)(I.solutionid,"solutionId"),uniqueName:(o=I.uniquename)!==null&&o!==void 0?o:"",friendlyName:(s=I.friendlyname)!==null&&s!==void 0?s:"",version:(l=I.version)!==null&&l!==void 0?l:"",isManaged:!!I.ismanaged,publisherId:(0,ft.normalizeGuid)(R.publisherid,"publisherId"),publisherUniqueName:(u=R.uniquename)!==null&&u!==void 0?u:"",publisherPrefix:(c=R.customizationprefix)!==null&&c!==void 0?c:"",publisherOptionValuePrefix:(d=R.customizationoptionvalueprefix)!==null&&d!==void 0?d:0}}K.getSolution=Y1;async function Z1(e,t){var r;let n={uniquename:t.uniqueName,friendlyname:t.friendlyName,customizationprefix:t.prefix,customizationoptionvalueprefix:(r=t.optionValuePrefix)!==null&&r!==void 0?r:1e4};t.description&&(n.description=t.description);let i=(0,mt.ensureSuccess)(await e.post("/publishers",n),e.apiUrl("/publishers")),a=(0,mt.readCreatedId)(i,"publisherid");if(!a)throw new Jr.InvalidArgumentError(`Dataverse did not return an id for publisher '${t.uniqueName}'`);return{id:a,uniqueName:t.uniqueName}}K.createPublisher=Z1;async function e_(e,t){var r;let n=(0,ft.normalizeGuid)(t.publisherId,"publisherId"),i={uniquename:t.uniqueName,friendlyname:t.friendlyName,version:(r=t.version)!==null&&r!==void 0?r:"1.0.0.0","[email protected]":`/publishers(${n})`};t.description&&(i.description=t.description);let a=(0,mt.ensureSuccess)(await e.post("/solutions",i),e.apiUrl("/solutions")),o=(0,mt.readCreatedId)(a,"solutionid");if(!o)throw new Jr.InvalidArgumentError(`Dataverse did not return an id for solution '${t.uniqueName}'`);return{id:o,uniqueName:t.uniqueName}}K.createSolution=e_;async function t_(e,t,r){let i=`/solutions(${(0,ft.normalizeGuid)(t,"solutionId")})`;(0,mt.ensureSuccess)(await e.patch(i,{version:r}),e.apiUrl(i))}K.setSolutionVersion=t_;async function r_(e,t){var r;let i={ComponentId:(0,ft.normalizeGuid)(t.componentId,"componentId"),ComponentType:t.componentType,SolutionUniqueName:t.solutionUniqueName,AddRequiredComponents:(r=t.addRequiredComponents)!==null&&r!==void 0?r:!1};t.doNotIncludeSubcomponents!==void 0&&(i.DoNotIncludeSubcomponents=t.doNotIncludeSubcomponents),(0,mt.ensureSuccess)(await e.post("/AddSolutionComponent",i),e.apiUrl("/AddSolutionComponent"))}K.addSolutionComponent=r_;async function n_(e,t,r,n){let a={SolutionComponent:{"@odata.type":"Microsoft.Dynamics.CRM.solutioncomponent",solutioncomponentid:(0,ft.normalizeGuid)(t,"componentId")},ComponentType:r,SolutionUniqueName:n};(0,mt.ensureSuccess)(await e.post("/RemoveSolutionComponent",a),e.apiUrl("/RemoveSolutionComponent"))}K.removeSolutionComponent=n_;async function i_(e,t){var r,n;let i={SolutionName:t.solutionName,Managed:(r=t.managed)!==null&&r!==void 0?r:!1},o=(n=(0,mt.ensureSuccess)(await e.post("/ExportSolution",i),e.apiUrl("/ExportSolution")).body)===null||n===void 0?void 0:n.ExportSolutionFile;if(!o)throw new Jr.InvalidArgumentError(`ExportSolution returned no file for '${t.solutionName}'`);return{base64:o}}K.exportSolution=i_;async function a_(e,t){var r,n;let i={OverwriteUnmanagedCustomizations:(r=t.overwriteUnmanagedCustomizations)!==null&&r!==void 0?r:!0,PublishWorkflows:(n=t.publishWorkflows)!==null&&n!==void 0?n:!0,CustomizationFile:t.base64};t.importJobId&&(i.ImportJobId=(0,ft.normalizeGuid)(t.importJobId,"importJobId")),(0,mt.ensureSuccess)(await e.post("/ImportSolution",i),e.apiUrl("/ImportSolution"))}K.importSolution=a_;async function o_(e,t){let n=`/solutions(${(0,ft.normalizeGuid)(t,"solutionId")})`;(0,mt.ensureSuccess)(await e.delete(n),e.apiUrl(n))}K.deleteSolution=o_});var Of=m(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Tf=m(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.default="00000000-0000-0000-0000-000000000000"});var Rf=m(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var qi=m(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});var s_=Rf();function l_(e){return typeof e=="string"&&s_.default.test(e)}au.default=l_});var $i=m(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});var u_=qi();function c_(e){if(!(0,u_.default)(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}ou.default=c_});var sr=m(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.unsafeStringify=void 0;var d_=qi(),Be=[];for(let e=0;e<256;++e)Be.push((e+256).toString(16).slice(1));function Ff(e,t=0){return(Be[e[t+0]]+Be[e[t+1]]+Be[e[t+2]]+Be[e[t+3]]+"-"+Be[e[t+4]]+Be[e[t+5]]+"-"+Be[e[t+6]]+Be[e[t+7]]+"-"+Be[e[t+8]]+Be[e[t+9]]+"-"+Be[e[t+10]]+Be[e[t+11]]+Be[e[t+12]]+Be[e[t+13]]+Be[e[t+14]]+Be[e[t+15]]).toLowerCase()}Vi.unsafeStringify=Ff;function p_(e,t=0){let r=Ff(e,t);if(!(0,d_.default)(r))throw TypeError("Stringified UUID is invalid");return r}Vi.default=p_});var So=m(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});var f_=require("crypto"),No=new Uint8Array(256),wo=No.length;function m_(){return wo>No.length-16&&((0,f_.randomFillSync)(No),wo=0),No.slice(wo,wo+=16)}su.default=m_});var lu=m(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.updateV1State=void 0;var xf=So(),h_=sr(),Gi={};function g_(e,t,r){let n,i=e?._v6??!1;if(e){let a=Object.keys(e);a.length===1&&a[0]==="_v6"&&(e=void 0)}if(e)n=Lf(e.random??e.rng?.()??(0,xf.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,r);else{let a=Date.now(),o=(0,xf.default)();Mf(Gi,a,o),n=Lf(o,Gi.msecs,Gi.nsecs,i?void 0:Gi.clockseq,i?void 0:Gi.node,t,r)}return t??(0,h_.unsafeStringify)(n)}function Mf(e,t,r){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=r.slice(10,16),e.node[0]|=1,e.clockseq=(r[8]<<8|r[9])&16383),e.msecs=t,e}zi.updateV1State=Mf;function Lf(e,t,r,n,i,a,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),r??=0,n??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=122192928e5;let s=((t&268435455)*1e4+r)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let l=t/4294967296*1e4&268435455;a[o++]=l>>>8&255,a[o++]=l&255,a[o++]=l>>>24&15|16,a[o++]=l>>>16&255,a[o++]=n>>>8|128,a[o++]=n&255;for(let u=0;u<6;++u)a[o++]=i[u];return a}zi.default=g_});var cu=m(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});var v_=$i(),b_=sr();function y_(e){let t=typeof e=="string"?(0,v_.default)(e):e,r=C_(t);return typeof e=="string"?(0,b_.unsafeStringify)(r):r}uu.default=y_;function C_(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var Uf=m(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});var A_=require("crypto");function w_(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),(0,A_.createHash)("md5").update(e).digest()}du.default=w_});var Wi=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.URL=lr.DNS=lr.stringToBytes=void 0;var Bf=$i(),N_=sr();function kf(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}lr.stringToBytes=kf;lr.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";lr.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function S_(e,t,r,n,i,a){let o=typeof r=="string"?kf(r):r,s=typeof n=="string"?(0,Bf.default)(n):n;if(typeof n=="string"&&(n=(0,Bf.default)(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+o.length);if(l.set(s),l.set(o,s.length),l=t(l),l[6]=l[6]&15|e,l[8]=l[8]&63|128,i){if(a=a||0,a<0||a+16>i.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[a+u]=l[u];return i}return(0,N_.unsafeStringify)(l)}lr.default=S_});var $f=m(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.URL=Qr.DNS=void 0;var D_=Uf(),pu=Wi(),qf=Wi();Object.defineProperty(Qr,"DNS",{enumerable:!0,get:function(){return qf.DNS}});Object.defineProperty(Qr,"URL",{enumerable:!0,get:function(){return qf.URL}});function fu(e,t,r,n){return(0,pu.default)(48,D_.default,e,t,r,n)}fu.DNS=pu.DNS;fu.URL=pu.URL;Qr.default=fu});var Vf=m(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});var E_=require("crypto");mu.default={randomUUID:E_.randomUUID}});var zf=m(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var Gf=Vf(),I_=So(),__=sr();function P_(e,t,r){if(Gf.default.randomUUID&&!t&&!e)return Gf.default.randomUUID();e=e||{};let n=e.random??e.rng?.()??(0,I_.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return(0,__.unsafeStringify)(n)}hu.default=P_});var Wf=m(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});var O_=require("crypto");function T_(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),(0,O_.createHash)("sha1").update(e).digest()}gu.default=T_});var Hf=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.URL=Xr.DNS=void 0;var R_=Wf(),vu=Wi(),jf=Wi();Object.defineProperty(Xr,"DNS",{enumerable:!0,get:function(){return jf.DNS}});Object.defineProperty(Xr,"URL",{enumerable:!0,get:function(){return jf.URL}});function bu(e,t,r,n){return(0,vu.default)(80,R_.default,e,t,r,n)}bu.DNS=vu.DNS;bu.URL=vu.URL;Xr.default=bu});var Jf=m(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});var F_=sr(),x_=lu(),L_=cu();function M_(e,t,r){e??={},r??=0;let n=(0,x_.default)({...e,_v6:!0},new Uint8Array(16));if(n=(0,L_.default)(n),t){if(r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;i++)t[r+i]=n[i];return t}return(0,F_.unsafeStringify)(n)}yu.default=M_});var Qf=m(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});var U_=$i(),B_=sr();function k_(e){let t=typeof e=="string"?(0,U_.default)(e):e,r=q_(t);return typeof e=="string"?(0,B_.unsafeStringify)(r):r}Cu.default=k_;function q_(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}});var Zf=m(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.updateV7State=void 0;var Xf=So(),$_=sr(),Au={};function V_(e,t,r){let n;if(e)n=Kf(e.random??e.rng?.()??(0,Xf.default)(),e.msecs,e.seq,t,r);else{let i=Date.now(),a=(0,Xf.default)();Yf(Au,i,a),n=Kf(a,Au.msecs,Au.seq,t,r)}return t??(0,$_.unsafeStringify)(n)}function Yf(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}ji.updateV7State=Yf;function Kf(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}ji.default=V_});var em=m(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});var G_=qi();function z_(e){if(!(0,G_.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}wu.default=z_});var Nu=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.version=Q.validate=Q.v7=Q.v6ToV1=Q.v6=Q.v5=Q.v4=Q.v3=Q.v1ToV6=Q.v1=Q.stringify=Q.parse=Q.NIL=Q.MAX=void 0;var W_=Of();Object.defineProperty(Q,"MAX",{enumerable:!0,get:function(){return W_.default}});var j_=Tf();Object.defineProperty(Q,"NIL",{enumerable:!0,get:function(){return j_.default}});var H_=$i();Object.defineProperty(Q,"parse",{enumerable:!0,get:function(){return H_.default}});var J_=sr();Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return J_.default}});var Q_=lu();Object.defineProperty(Q,"v1",{enumerable:!0,get:function(){return Q_.default}});var X_=cu();Object.defineProperty(Q,"v1ToV6",{enumerable:!0,get:function(){return X_.default}});var K_=$f();Object.defineProperty(Q,"v3",{enumerable:!0,get:function(){return K_.default}});var Y_=zf();Object.defineProperty(Q,"v4",{enumerable:!0,get:function(){return Y_.default}});var Z_=Hf();Object.defineProperty(Q,"v5",{enumerable:!0,get:function(){return Z_.default}});var eP=Jf();Object.defineProperty(Q,"v6",{enumerable:!0,get:function(){return eP.default}});var tP=Qf();Object.defineProperty(Q,"v6ToV1",{enumerable:!0,get:function(){return tP.default}});var rP=Zf();Object.defineProperty(Q,"v7",{enumerable:!0,get:function(){return rP.default}});var nP=qi();Object.defineProperty(Q,"validate",{enumerable:!0,get:function(){return nP.default}});var iP=em();Object.defineProperty(Q,"version",{enumerable:!0,get:function(){return iP.default}})});var Tt=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.assignMissingIds=In.newId=void 0;var aP=Nu();function tm(){return(0,aP.v4)()}In.newId=tm;function oP(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var sP=new Set(["parameters","bag"]);function lP(e){return Su(e),e}In.assignMissingIds=lP;function Su(e){if(Array.isArray(e)){e.forEach(t=>Su(t));return}if(oP(e)){(typeof e.id!="string"||e.id.length===0)&&(e.id=tm());for(let t of Object.keys(e))t==="id"||sP.has(t)||Su(e[t])}}});var _u=m(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.appApi=_n.deleteAppResolvingOnce=void 0;var Re=Ve(),ie=ce(),Eu=Tt(),Se=be(),lm=(0,ie.odataQuery)([["$select","appmoduleid,name,uniquename,description"]]),uP=(0,ie.odataQuery)([["$select","appmoduleid,name,uniquename,description"]]);function Do(e,t){return"/sitemaps/Microsoft.Dynamics.CRM.RetrieveUnpublishedMultiple()"+(0,ie.odataQuery)([["$select",t],["$filter",`sitemapid eq ${e}`],["$top",1]])}function Eo(e){var t;let r=(t=e.body)===null||t===void 0?void 0:t.value;if(Array.isArray(r))return r[0]}function Iu(e){let t=e?.["@odata.etag"];return typeof t=="string"?t:null}function Hi(e){let t=new Set,r=[];for(let n of e??[])n&&!t.has(n)&&(t.add(n),r.push(n));return r}function cP(e){return`cdsapp_${(e||"").replace(/[^a-zA-Z0-9]/g,"")||"app"}`}async function um(e,t){var r,n;let i=u=>{throw new Se.SdkError("APP_SITEMAP_UNRESOLVED",`The sitemap lookup for app uniquename '${t??""}' ${u}, so it cannot be determined whether this app has a sitemap. Retry; if the app is newly created, publish it first (an unpublished app is not readable).`)};if(!t)return i("cannot run because the app record carried no uniquename");let a=`/sitemaps${(0,ie.odataQuery)([["$select","sitemapid"],["$filter",`sitemapnameunique eq '${(0,ie.odataLiteral)(t)}'`],["$top",1]])}`,o;try{o=await e.get(a)}catch(u){return i(`failed (${u.message})`)}if(o.status<200||o.status>=300)return i(`returned HTTP ${o.status}`);let s=(r=o.body)===null||r===void 0?void 0:r.value;if(!Array.isArray(s))return i("returned a malformed body");let l=(n=s[0])===null||n===void 0?void 0:n.sitemapid;return s.length>0&&!l?i("returned a row with no sitemapid"):l}async function dP(e){let t=s=>{var l,u,c;return(c=(u=(l=s.body)===null||l===void 0?void 0:l.value)===null||u===void 0?void 0:u[0])===null||c===void 0?void 0:c.webresourceid},r=s=>`/webresourceset${(0,ie.odataQuery)([["$select","webresourceid"],["$top",1],["$filter",s]])}`,n=await e.get(r("webresourcetype eq 5 and ismanaged eq false and contains(name,'icon')")),i=t(n);if(i)return i;let a=await e.get(r("webresourcetype eq 5 and ismanaged eq false")),o=t(a);return o||t(await e.get(r("ismanaged eq false")))}async function pP(e,t){var r,n,i;try{let a=`/roles${(0,ie.odataQuery)([["$select","roleid"],["$filter","name eq 'System Administrator'"],["$top",1]])}`,s=(i=(n=(r=(await e.get(a)).body)===null||r===void 0?void 0:r.value)===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.roleid;if(!s)return;let l=`/appmodules(${t})/appmoduleroles_association/$ref`;await e.post(l,{"@odata.id":e.apiUrl(`/roles(${s})`)})}catch{}}async function fP(e,t){async function r(o,s){var l,u;try{let c=await e.get(o);return c.status<200||c.status>=300?[]:((u=(l=c.body)===null||l===void 0?void 0:l.value)!==null&&u!==void 0?u:[]).map(f=>String(f[s])).filter(f=>f&&f!=="undefined")}catch{return[]}}let[n,i,a]=await Promise.all([r(`/systemforms${(0,ie.odataQuery)([["$select","formid"],["$filter",`objecttypecode eq '${(0,ie.odataLiteral)(t)}' and type eq 2 and formactivationstate eq 1`]])}`,"formid"),r(`/savedqueries${(0,ie.odataQuery)([["$select","savedqueryid"],["$filter",`returnedtypecode eq '${(0,ie.odataLiteral)(t)}' and querytype eq 0 and statecode eq 0`]])}`,"savedqueryid"),r(`/savedqueryvisualizations${(0,ie.odataQuery)([["$select","savedqueryvisualizationid"],["$filter",`primaryentitytypecode eq '${(0,ie.odataLiteral)(t)}'`]])}`,"savedqueryvisualizationid")]);return{forms:n,views:i,charts:a}}var rm=new WeakMap;async function mP(e,t){let r=rm.get(e);r||(r=new Map,rm.set(e,r));let n=r.get(t);if(n!==void 0)return n;let i=await hP(e,t);return i&&r.set(t,i),i}async function nm(e,t,r){let n=new Array(e.length),i=0;async function a(){for(let o=i;o<e.length;o=i)i=o+1,n[o]=await r(e[o])}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>a())),n}async function hP(e,t){let r=`/EntityDefinitions(LogicalName='${(0,ie.odataLiteral)(t)}')${(0,ie.odataQuery)([["$select","MetadataId,EntitySetName"]])}`,n=await e.get(r);if(n.status>=200&&n.status<300){let i=n.body;if(i?.MetadataId&&i.EntitySetName)return{logicalName:t,metadataId:i.MetadataId,entitySetName:i.EntitySetName}}}async function im(e,t){let r=[],n=Hi(t.entities),i=4,a=await nm(n,i,f=>mP(e,f)),o=n.filter((f,h)=>!a[h]);if(o.length>0)throw new Se.SdkError("APP_ENTITY_COMPONENT_UNRESOLVED",`Refusing to build app components: table(s) ${o.map(f=>`'${f}'`).join(", ")} could not be resolved to an EntityDefinitions MetadataId + EntitySetName. Pinning the rest would produce an app whose navigation references a table the app does not contain. Verify the table name(s) exist in this environment and retry.`);let s=a.filter(f=>!!f);for(let f of s)r.push({"@odata.id":`${f.entitySetName}(${f.metadataId})`});for(let f of Hi(t.components.forms))r.push({"@odata.type":"Microsoft.Dynamics.CRM.systemform",formid:f});for(let f of Hi(t.components.views))r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedquery",savedqueryid:f});for(let f of Hi(t.components.charts))r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedqueryvisualization",savedqueryvisualizationid:f});for(let f of Hi(t.components.dashboards))r.push({"@odata.type":"Microsoft.Dynamics.CRM.systemform",formid:f});let l=new Set(t.components.forms),u=new Set(t.components.views),c=new Set(t.components.charts),d=await nm(n,i,f=>fP(e,f));for(let f of d){for(let h of f.forms)l.has(h)||(l.add(h),r.push({"@odata.type":"Microsoft.Dynamics.CRM.systemform",formid:h}));for(let h of f.views)u.has(h)||(u.add(h),r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedquery",savedqueryid:h}));for(let h of f.charts)c.has(h)||(c.add(h),r.push({"@odata.type":"Microsoft.Dynamics.CRM.savedqueryvisualization",savedqueryvisualizationid:h}))}return{components:r,tables:s}}async function am(e,t,r){if(r.length===0)return;let n="/AddAppComponents";(0,Re.ensureSuccess)(await e.post(n,{AppId:t,Components:r}),e.apiUrl(n))}function gP(e){return"/appmodules/Microsoft.Dynamics.CRM.RetrieveUnpublishedMultiple()"+(0,ie.odataQuery)([["$select","appmoduleid,appmoduleidunique"],["$filter",`appmoduleid eq ${e}`],["$top",1]])}async function om(e,t,r){var n;if(r.length===0)return;let i=gP(t),a=await e.get(i);if(a.status<200||a.status>=300)throw new Se.SdkError("APP_COMPONENTS_UNVERIFIED",`App '${t}': its components were written but could not be verified \u2014 the unpublished-aware read returned HTTP ${a.status}. Re-push to retry.`);let o=Eo(a),s=o?.appmoduleidunique;if(typeof s!="string"||!s)throw new Se.SdkError("APP_COMPONENTS_UNVERIFIED",`App '${t}': its components were written but could not be verified \u2014 the app did not return an 'appmoduleidunique' to file components under. Re-push to retry.`);let l=`/appmodulecomponents${(0,ie.odataQuery)([["$select","objectid,componenttype"],["$filter",`_appmoduleidunique_value eq ${(0,ie.normalizeGuid)(s,`App '${t}' appmoduleidunique`)} and componenttype eq 1`]])}`,u=await e.get(l);if(u.status<200||u.status>=300)throw new Se.SdkError("APP_COMPONENTS_UNVERIFIED",`App '${t}': its table components were written but could not be verified \u2014 reading them back returned HTTP ${u.status}. Re-push to retry.`);let c=(n=u.body)===null||n===void 0?void 0:n.value;if(!Array.isArray(c))throw new Se.SdkError("APP_COMPONENTS_UNVERIFIED",`App '${t}': its table components were written but could not be verified \u2014 the read-back returned no readable result set. Re-push to retry.`);let d=new Set(c.map(h=>h.objectid).filter(h=>typeof h=="string").map(h=>h.toLowerCase())),f=r.filter(h=>!d.has(h.metadataId.toLowerCase()));if(f.length>0)throw new Se.SdkError("APP_COMPONENTS_NOT_PERSISTED",`App '${t}': ${f.length} declared table(s) are NOT components of the app after AddAppComponents reported success \u2014 ${f.map(h=>`'${h.logicalName}' (expected objectid ${h.metadataId})`).join(", ")}. The app's navigation would reference content the app does not contain.`)}async function vP(e,t,r){let n=`/appmodules(${t})`,i=`/sitemaps(${r.sitemapId})`;try{if(!await bP(e,r.sitemapId)){r.serverRefusedSitemap&&(0,Re.ensureSuccess)(await e.delete(n),e.apiUrl(n));return}e.supportsAtomicBatch&&await dm(e,[{path:n,etag:r.appEtag},{path:i,etag:r.sitemapEtag}])}catch{}}async function bP(e,t){var r;let n=Do(t,"sitemapid"),i=await e.get(n);if(i.status<200||i.status>=300)throw new Se.SdkError("APP_SITEMAP_UNRESOLVED",`The unpublished-aware read of sitemap '${t}' returned HTTP ${i.status}, so it cannot be determined whether the row exists.`);let a=(r=i.body)===null||r===void 0?void 0:r.value;if(!Array.isArray(a))throw new Se.SdkError("APP_SITEMAP_UNRESOLVED",`The unpublished-aware read of sitemap '${t}' returned no readable result set, so it cannot be determined whether the row exists.`);return a.length>0}async function cm(e,t){var r;let n=(0,ie.normalizeGuid)(t,"id"),i=b=>{throw new Se.SdkError("APP_SITEMAP_UNRESOLVED",`Refusing to delete app '${n}': ${b} Deleting the app would destroy the only pointer to its sitemap, stranding that row and reserving its unique name forever. Retry; if the app is newly created, publish it first (an unpublished app is not readable).`)},a=`/appmodules(${n})${lm}`,o;try{o=await e.get(a)}catch(b){return i(`reading the app failed (${b.message}).`)}if(o.status<200||o.status>=300)return i(o.status===404?"reading the app returned HTTP 404, which does NOT prove it is absent \u2014 Dataverse also reports an unpublished app that way, and such an app still owns a sitemap.":`reading the app returned HTTP ${o.status}.`);let s=(r=o.body)===null||r===void 0?void 0:r.uniquename;if(!s)return i("the app record carried no uniquename, so its sitemap cannot be located.");let l=await um(e,s);if(!l)return{uniquename:s,appEtag:(0,Re.readEtag)(o)};let u=(0,ie.normalizeGuid)(l,"sitemapId"),c=Do(u,"sitemapid,sitemapnameunique,sitemapxml"),d;try{d=await e.get(c)}catch(b){return i(`reading sitemap '${u}' failed (${b.message}).`)}if(d.status<200||d.status>=300)return i(`reading sitemap '${u}' returned HTTP ${d.status}.`);let f=Eo(d);if(!f)return i(`sitemap '${u}' was not returned by the unpublished-aware read.`);if(f.sitemapnameunique!==s)return i(`sitemap '${u}' now carries sitemapnameunique '${String(f.sitemapnameunique)}', not '${s}', so it is no longer this app's sitemap.`);let h=f.sitemapxml;return typeof h!="string"?i(`sitemap '${u}' returned no sitemapxml.`):{sitemapId:u,uniquename:s,sitemapXml:h,appEtag:(0,Re.readEtag)(o),sitemapEtag:Iu(f)}}async function yP(e,t,r){let n=(0,ie.normalizeGuid)(t,"id"),i=await cm(e,n);await r?.(i.sitemapXml),await pm(e,n,i)}_n.deleteAppResolvingOnce=yP;async function dm(e,t){let r=`batch_${(0,Eu.newId)()}`,n=`changeset_${(0,Eu.newId)()}`,i=t.map((d,f)=>[`--${n}`,"Content-Type: application/http","Content-Transfer-Encoding: binary",`Content-ID: ${f+1}`,"",`DELETE ${e.apiUrl(d.path)} HTTP/1.1`,...d.etag?[`If-Match: ${d.etag}`]:[],""].join(`\r
`)),a=[`--${r}`,`Content-Type: multipart/mixed;boundary=${n}`,"",...i,`--${n}--`,`--${r}--`,""].join(`\r
-`),o=await e.postBatch(a,r),s=e.apiUrl("/$batch");(0,Fe.ensureSuccess)(o,s);let l=`app '${t[0].path}'`;if(typeof o.body!="string"||o.body.length===0)throw new mt.ConnectionError(s,o.status,`atomic delete of ${l} cannot be confirmed: the $batch response had no readable body, so the change set's outcome is unknown`);let u=bP(o.body,i.map((d,f)=>String(f+1)));if(u===void 0)throw new mt.ConnectionError(s,o.status,`atomic delete of ${l} cannot be confirmed: the $batch response could not be parsed as a change set, so the outcome is unknown`);let c=u.find(d=>d<200||d>=300);if(c!==void 0)throw new mt.ConnectionError(s,c,`atomic delete of ${l} was rolled back: the change set reported HTTP ${c}`);if(u.length!==i.length)throw new mt.ConnectionError(s,o.status,`atomic delete of ${l} cannot be confirmed: the $batch response reported ${u.length} operation result(s), expected exactly ${i.length}`)}function bP(e,t){var r,n,i,a;if(typeof e!="string"||e.length===0)return;let o=(r=/^--(\S+)\r?\n/.exec(e))===null||r===void 0?void 0:r[1];if(o===void 0||!e.trimEnd().endsWith(`--${o}--`))return;let s=(n=/Content-Type:\s*multipart\/mixed;\s*boundary=(\S+)/i.exec(e))===null||n===void 0?void 0:n[1];if(s===void 0||s===o)return;let l=e.split(`--${s}`);if(l.length<2||!/^--(\r?\n|$)/.test(l[l.length-1]))return;let u=new Set(t),c=[],d=new Set;for(let f of l.slice(1)){if(f.startsWith("--"))break;let g=f.indexOf(`\r
+`),o=await e.postBatch(a,r),s=e.apiUrl("/$batch");(0,Re.ensureSuccess)(o,s);let l=`app '${t[0].path}'`;if(typeof o.body!="string"||o.body.length===0)throw new Se.ConnectionError(s,o.status,`atomic delete of ${l} cannot be confirmed: the $batch response had no readable body, so the change set's outcome is unknown`);let u=CP(o.body,i.map((d,f)=>String(f+1)));if(u===void 0)throw new Se.ConnectionError(s,o.status,`atomic delete of ${l} cannot be confirmed: the $batch response could not be parsed as a change set, so the outcome is unknown`);let c=u.find(d=>d<200||d>=300);if(c!==void 0)throw new Se.ConnectionError(s,c,`atomic delete of ${l} was rolled back: the change set reported HTTP ${c}`);if(u.length!==i.length)throw new Se.ConnectionError(s,o.status,`atomic delete of ${l} cannot be confirmed: the $batch response reported ${u.length} operation result(s), expected exactly ${i.length}`)}function CP(e,t){var r,n,i,a;if(typeof e!="string"||e.length===0)return;let o=(r=/^--(\S+)\r?\n/.exec(e))===null||r===void 0?void 0:r[1];if(o===void 0||!e.trimEnd().endsWith(`--${o}--`))return;let s=(n=/Content-Type:\s*multipart\/mixed;\s*boundary=(\S+)/i.exec(e))===null||n===void 0?void 0:n[1];if(s===void 0||s===o)return;let l=e.split(`--${s}`);if(l.length<2||!/^--(\r?\n|$)/.test(l[l.length-1]))return;let u=new Set(t),c=[],d=new Set;for(let f of l.slice(1)){if(f.startsWith("--"))break;let h=f.indexOf(`\r
\r
-`);if(g===-1)return;let b=f.slice(0,g),w=f.slice(g+4);if(!/^Content-Type:\s*application\/http\b/im.test(b))return;let N=/^HTTP\/1\.[01] (\d{3})\b/.exec(w);if(!N||((i=w.match(/^HTTP\/1\.[01] \d{3}\b/gm))!==null&&i!==void 0?i:[]).length!==1)return;let _=(a=/^Content-ID:\s*(\S+)/im.exec(b))===null||a===void 0?void 0:a[1];if(_===void 0||d.has(_)||!u.has(_))return;d.add(_),c.push(Number(N[1]))}return c.length===0?void 0:c}async function om(e,t){try{let r=Do(t,"sitemapid"),n=await e.get(r);return n.status<200||n.status>=300?null:Iu(Eu(n))}catch{return null}}function yP(e){return e>=400&&e<500&&e!==408&&e!==429}function Su(e,t,r){if(!e)throw new mt.SdkError("APP_SITEMAP_UNRESOLVED",`Refusing to delete app '${t}': the ${r} read returned no ETag, so the delete cannot be made conditional on the row that was actually inspected. Without that condition a row renamed or re-pointed between the read and the delete would be destroyed. Retry.`);return e}async function dm(e,t,r){let n=`/appmodules(${t})`;if(!r.sitemapId){await CP(e,n,Su(r.appEtag,t,"app"));return}if(!e.supportsAtomicBatch)throw new mt.SdkError("APP_DELETE_NOT_ATOMIC",`Refusing to delete app '${t}': it owns a sitemap, and the injected HttpClient cannot send a raw body, so the two rows would have to be deleted as separate requests. A failure between them strands the sitemap and permanently reserves the app's unique name. Implement HttpClient.postRaw so the SDK can delete them atomically.`);await cm(e,[{path:n,etag:Su(r.appEtag,t,"app")},{path:`/sitemaps(${r.sitemapId})`,etag:Su(r.sitemapEtag,t,"sitemap")}])}async function CP(e,t,r){(0,Fe.ensureSuccess)(await e.delete(t,{headers:{"If-Match":r}}),e.apiUrl(t))}_n.appApi={async get(e,t){var r;let n=(0,ce.normalizeGuid)(t,"id"),i=`/appmodules(${n})${sm}`,o=(r=(0,Fe.ensureSuccess)(await e.get(i),e.apiUrl(i)).body)!==null&&r!==void 0?r:{},s=await lm(e,o.uniquename),l=s?(0,ce.normalizeGuid)(s,"sitemapId"):void 0,u=null;if(l){let c=Do(l,"sitemapid,sitemapname,sitemapnameunique,sitemapxml"),d=(0,Fe.ensureSuccess)(await e.get(c),e.apiUrl(c)),f=Eu(d);if(f&&f.sitemapnameunique!==o.uniquename)throw new mt.SdkError("APP_SITEMAP_UNRESOLVED",`Refusing to fetch app '${n}': sitemap '${l}' now carries sitemapnameunique '${String(f.sitemapnameunique)}', not '${String(o.uniquename)}', so it is no longer this app's sitemap. Retry.`);o.$sitemap=f??{},u=Iu(f)}return{raw:o,etag:u}},async list(e,t){var r;let n=`/appmodules${lP}`,a=(0,Fe.ensureSuccess)(await e.get(n),e.apiUrl(n)).body;return((r=a?.value)!==null&&r!==void 0?r:[]).map(s=>{var l,u;return{type:"app",id:(l=s.appmoduleid)!==null&&l!==void 0?l:"",name:(u=s.name)!==null&&u!==void 0?u:"",isDirty:!1}})},async create(e,t){let r=t,n=r.iconWebResourceId||await cP(e),i=r.appModuleUniqueName||uP(r.appModuleId),a={name:r.appModuleName,uniquename:i,clienttype:4,formfactor:1,navigationtype:0};r.appModuleDescription&&(a.description=r.appModuleDescription),n&&(a.webresourceid=n);let o="/appmodules",s=(0,Fe.ensureSuccess)(await e.post(o,a),e.apiUrl(o)),l=(0,Fe.requireCreatedId)(s,"appmoduleid","app module"),u=null,c=(0,Du.newId)(),d=!1;try{let f="/sitemaps",g=await e.post(f,{sitemapid:c,sitemapnameunique:i,sitemapname:r.sitemapname,sitemapxml:r.sitemapxml});d=yP(g.status);let b=(0,Fe.ensureSuccess)(g,e.apiUrl(f));u=(0,Fe.readEtag)(b),u||(u=await om(e,c));let w=await im(e,r);w.unshift({"@odata.type":"Microsoft.Dynamics.CRM.sitemap",sitemapid:c}),await am(e,l,w),await dP(e,l);let N="/PublishXml";(0,Fe.ensureSuccess)(await e.post(N,{ParameterXml:`<importexportxml><appmodules><appmodule>${l}</appmodule></appmodules></importexportxml>`}),e.apiUrl(N))}catch(f){throw await hP(e,l,{sitemapId:c,serverRefusedSitemap:d,appEtag:(0,Fe.readEtag)(s),sitemapEtag:u}),f}return{id:l,etag:u,serverIdentity:{sitemapId:c}}},async update(e,t,r,n){var i;let a=r,o=(0,ce.normalizeGuid)(t,"id");if(!a.sitemapId)throw new mt.ValidationError("app",o,"/sitemapId","missing sitemap identity \u2014 re-fetch the app before pushing edits");let s=(0,ce.normalizeGuid)(a.sitemapId,"sitemapId");if(!n)throw new mt.SdkError("APP_UPDATE_NO_ETAG",`Refusing to push app '${o}': no concurrency token is held for its sitemap row, so the write could not be made conditional and would silently overwrite a concurrent edit. Re-fetch the app and re-apply the change.`);let l={"If-Match":n},u=`/sitemaps(${s})`,c=(0,Fe.ensureSuccess)(await e.patch(u,{sitemapxml:a.sitemapxml,sitemapname:a.sitemapname},l?{headers:l}:void 0),e.apiUrl(u)),d=`/appmodules(${o})`;(0,Fe.ensureSuccess)(await e.patch(d,{name:a.appModuleName,description:a.appModuleDescription}),e.apiUrl(d));let f=[];try{await am(e,o,await im(e,a))}catch(g){f.push(`App '${o}': one or more components were not pinned (${g.message}). Navigation may reference content not included in the app; re-push to retry.`)}return{id:o,etag:(i=(0,Fe.readEtag)(c))!==null&&i!==void 0?i:await om(e,s),...f.length>0?{warnings:f}:{}}},async delete(e,t){let r=(0,ce.normalizeGuid)(t,"id");await dm(e,r,await um(e,r))}}});var Ji=m(Pn=>{"use strict";function AP(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(t.call(void 0,i,n,e))return i}}function Pu(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(e):e}function wP(e,t){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}var pm=Pu({HTML:"text/html",isHTML:function(e){return e===pm.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),fm=Pu({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===fm.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Pn.assign=wP;Pn.find=AP;Pn.freeze=Pu;Pn.MIME_TYPE=pm;Pn.NAMESPACE=fm});var $u=m(pr=>{var Am=Ji(),Gt=Am.find,Qi=Am.NAMESPACE;function NP(e){return e!==""}function SP(e){return e?e.split(/[\t\n\f\r ]+/).filter(NP):[]}function DP(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function mm(e){if(!e)return[];var t=SP(e);return Object.keys(t.reduce(DP,{}))}function EP(e){return function(t){return e&&e.indexOf(t)!==-1}}function Ki(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}function nt(e,t){var r=e.prototype;if(!(r instanceof t)){let i=function(){};var n=i;i.prototype=t.prototype,i=new i,Ki(r,i),e.prototype=r=i}r.constructor!=e&&(typeof e!="function"&&console.error("unknown Class:"+e),r.constructor=e)}var it={},bt=it.ELEMENT_NODE=1,Fn=it.ATTRIBUTE_NODE=2,Io=it.TEXT_NODE=3,wm=it.CDATA_SECTION_NODE=4,Nm=it.ENTITY_REFERENCE_NODE=5,IP=it.ENTITY_NODE=6,Ou=it.PROCESSING_INSTRUCTION_NODE=7,Fu=it.COMMENT_NODE=8,Sm=it.DOCUMENT_NODE=9,Dm=it.DOCUMENT_TYPE_NODE=10,ur=it.DOCUMENT_FRAGMENT_NODE=11,_P=it.NOTATION_NODE=12,Ge={},Re={},L9=Ge.INDEX_SIZE_ERR=(Re[1]="Index size error",1),M9=Ge.DOMSTRING_SIZE_ERR=(Re[2]="DOMString size error",2),rt=Ge.HIERARCHY_REQUEST_ERR=(Re[3]="Hierarchy request error",3),U9=Ge.WRONG_DOCUMENT_ERR=(Re[4]="Wrong document",4),PP=Ge.INVALID_CHARACTER_ERR=(Re[5]="Invalid character",5),B9=Ge.NO_DATA_ALLOWED_ERR=(Re[6]="No data allowed",6),k9=Ge.NO_MODIFICATION_ALLOWED_ERR=(Re[7]="No modification allowed",7),Em=Ge.NOT_FOUND_ERR=(Re[8]="Not found",8),q9=Ge.NOT_SUPPORTED_ERR=(Re[9]="Not supported",9),hm=Ge.INUSE_ATTRIBUTE_ERR=(Re[10]="Attribute in use",10),On=Ge.INVALID_STATE_ERR=(Re[11]="Invalid state",11),$9=Ge.SYNTAX_ERR=(Re[12]="Syntax error",12),V9=Ge.INVALID_MODIFICATION_ERR=(Re[13]="Invalid modification",13),G9=Ge.NAMESPACE_ERR=(Re[14]="Invalid namespace",14),z9=Ge.INVALID_ACCESS_ERR=(Re[15]="Invalid access",15);function te(e,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,Re[e]),this.message=Re[e],Error.captureStackTrace&&Error.captureStackTrace(this,te);return r.code=e,t&&(this.message=this.message+": "+t),r}te.prototype=Error.prototype;Ki(Ge,te);function cr(){}cr.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,r){for(var n=!!r&&!!r.requireWellFormed,i=[],a=0;a<this.length;a++)qu(this[a],i,e,t,null,n);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function Tn(e,t){this._node=e,this._refresh=t,Tu(this)}function Tu(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if(Bm(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];Ki(r,e),e._inc=t}}Tn.prototype.item=function(e){return Tu(this),this[e]||null};nt(Tn,cr);function _o(){}function Im(e,t){for(var r=e.length;r--;)if(e[r]===t)return r}function gm(e,t,r,n){if(n?t[Im(t,n)]=r:t[t.length++]=r,e){r.ownerElement=e;var i=e.ownerDocument;i&&(n&&Om(i,e,n),OP(i,e,r))}}function vm(e,t,r){var n=Im(t,r);if(n>=0){for(var i=t.length-1;n<i;)t[n]=t[++n];if(t.length=i,e){var a=e.ownerDocument;a&&(Om(a,e,r),r.ownerElement=null)}}else throw new te(Em,new Error(e.tagName+"@"+r))}_o.prototype={length:0,item:cr.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var r=this[t];if(r.nodeName==e)return r}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new te(hm);var r=this.getNamedItem(e.nodeName);return gm(this._ownerElement,this,e,r),r},setNamedItemNS:function(e){var t=e.ownerElement,r;if(t&&t!=this._ownerElement)throw new te(hm);return r=this.getNamedItemNS(e.namespaceURI,e.localName),gm(this._ownerElement,this,e,r),r},removeNamedItem:function(e){var t=this.getNamedItem(e);return vm(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);return vm(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){for(var r=this.length;r--;){var n=this[r];if(n.localName==t&&n.namespaceURI==e)return n}return null}};function _m(){}_m.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,r){var n=new Yi;if(n.implementation=this,n.childNodes=new cr,n.doctype=r||null,r&&n.appendChild(r),t){var i=n.createElementNS(e,t);n.appendChild(i)}return n},createDocumentType:function(e,t,r){var n=new To;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=r||"",n}};function Y(){}Y.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Oo(this,e,t)},replaceChild:function(e,t){Oo(this,e,t,Tm),t&&this.removeChild(t)},removeChild:function(e){return Fm(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Um(this.ownerDocument||this,this,e)},normalize:function(){Te(this,null,{enter:function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;r!==null&&r.nodeType===Io&&t.nodeType===Io?(e.removeChild(r),t.appendData(r.data)):t=r}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===e)return n}t=t.nodeType==Fn?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];t=t.nodeType==Fn?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function Pm(e){return e=="<"&&"&lt;"||e==">"&&"&gt;"||e=="&"&&"&amp;"||e=='"'&&"&quot;"||"&#"+e.charCodeAt()+";"}Ki(it,Y);Ki(it,Y.prototype);function Po(e,t){return Te(e,null,{enter:function(r){return t(r)?Te.STOP:!0}})===Te.STOP}function Te(e,t,r){for(var n=[{node:e,context:t,phase:Te.ENTER}];n.length>0;){var i=n.pop();if(i.phase===Te.ENTER){var a=r.enter(i.node,i.context);if(a===Te.STOP)return Te.STOP;if(n.push({node:i.node,context:a,phase:Te.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)n.push({node:o,context:a,phase:Te.ENTER}),o=o.previousSibling}else r.exit&&r.exit(i.node,i.context)}}Te.STOP=Symbol("walkDOM.STOP");Te.ENTER=0;Te.EXIT=1;function Yi(){this.ownerDocument=this}function OP(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Qi.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function Om(e,t,r,n){e&&e._inc++;var i=r.namespaceURI;i===Qi.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function Ru(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var i=t.firstChild,a=0;i;)n[a++]=i,i=i.nextSibling;n.length=a,delete n[n.length]}}}function Fm(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Ru(e.ownerDocument,e),t}function FP(e){return e&&(e.nodeType===Y.DOCUMENT_NODE||e.nodeType===Y.DOCUMENT_FRAGMENT_NODE||e.nodeType===Y.ELEMENT_NODE)}function TP(e){return e&&(zt(e)||xu(e)||dr(e)||e.nodeType===Y.DOCUMENT_FRAGMENT_NODE||e.nodeType===Y.COMMENT_NODE||e.nodeType===Y.PROCESSING_INSTRUCTION_NODE)}function dr(e){return e&&e.nodeType===Y.DOCUMENT_TYPE_NODE}function zt(e){return e&&e.nodeType===Y.ELEMENT_NODE}function xu(e){return e&&e.nodeType===Y.TEXT_NODE}function bm(e,t){var r=e.childNodes||[];if(Gt(r,zt)||dr(t))return!1;var n=Gt(r,dr);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function ym(e,t){var r=e.childNodes||[];function n(a){return zt(a)&&a!==t}if(Gt(r,n))return!1;var i=Gt(r,dr);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function RP(e,t,r){if(!FP(e))throw new te(rt,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new te(Em,"child not in parent");if(!TP(t)||dr(t)&&e.nodeType!==Y.DOCUMENT_NODE)throw new te(rt,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function xP(e,t,r){var n=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===Y.DOCUMENT_FRAGMENT_NODE){var a=i.filter(zt);if(a.length>1||Gt(i,xu))throw new te(rt,"More than one element or text in fragment");if(a.length===1&&!bm(e,r))throw new te(rt,"Element in fragment can not be inserted before doctype")}if(zt(t)&&!bm(e,r))throw new te(rt,"Only one element can be added and only after doctype");if(dr(t)){if(Gt(n,dr))throw new te(rt,"Only one doctype is allowed");var o=Gt(n,zt);if(r&&n.indexOf(o)<n.indexOf(r))throw new te(rt,"Doctype can only be inserted before an element");if(!r&&o)throw new te(rt,"Doctype can not be appended since element is present")}}function Tm(e,t,r){var n=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===Y.DOCUMENT_FRAGMENT_NODE){var a=i.filter(zt);if(a.length>1||Gt(i,xu))throw new te(rt,"More than one element or text in fragment");if(a.length===1&&!ym(e,r))throw new te(rt,"Element in fragment can not be inserted before doctype")}if(zt(t)&&!ym(e,r))throw new te(rt,"Only one element can be added and only after doctype");if(dr(t)){let l=function(u){return dr(u)&&u!==r};var s=l;if(Gt(n,l))throw new te(rt,"Only one doctype is allowed");var o=Gt(n,zt);if(r&&n.indexOf(o)<n.indexOf(r))throw new te(rt,"Doctype can only be inserted before an element")}}function Oo(e,t,r,n){RP(e,t,r),e.nodeType===Y.DOCUMENT_NODE&&(n||xP)(e,t,r);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ur){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=r?r.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=r,s?s.nextSibling=a:e.firstChild=a,r==null?e.lastChild=o:r.previousSibling=o;do{a.parentNode=e;var l=e.ownerDocument||e;Xi(a,l)}while(a!==o&&(a=a.nextSibling));return Ru(e.ownerDocument||e,e),t.nodeType==ur&&(t.firstChild=t.lastChild=null),t}function Xi(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===bt&&e.attributes)for(var r=0;r<e.attributes.length;r++){var n=e.attributes.item(r);n&&(n.ownerDocument=t)}for(var i=e.firstChild;i;)Xi(i,t),i=i.nextSibling}}function LP(e,t){t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,Ru(e.ownerDocument,e,t);var r=e.ownerDocument||e;return Xi(t,r),t}Yi.prototype={nodeName:"#document",nodeType:Sm,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ur){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Oo(this,e,t),Xi(e,this),this.documentElement===null&&e.nodeType===bt&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Fm(this,e)},replaceChild:function(e,t){Oo(this,e,t,Tm),Xi(e,this),t&&this.removeChild(t),zt(e)&&(this.documentElement=e)},importNode:function(e,t){return MP(this,e,t)},getElementById:function(e){var t=null;return Po(this.documentElement,function(r){if(r.nodeType==bt&&r.getAttribute("id")==e)return t=r,!0}),t},getElementsByClassName:function(e){var t=mm(e);return new Tn(this,function(r){var n=[];return t.length>0&&Po(r.documentElement,function(i){if(i!==r&&i.nodeType===bt){var a=i.getAttribute("class");if(a){var o=e===a;if(!o){var s=mm(a);o=t.every(EP(s))}o&&n.push(i)}}}),n})},createElement:function(e){var t=new Kr;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new cr;var r=t.attributes=new _o;return r._ownerElement=t,t},createDocumentFragment:function(){var e=new Ro;return e.ownerDocument=this,e.childNodes=new cr,e},createTextNode:function(e){var t=new Lu;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Mu;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf("]]>")!==-1)throw new te(PP,'data contains "]]>"');var t=new Uu;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new ku;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new Fo;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Bu;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new Kr,n=t.split(":"),i=r.attributes=new _o;return r.childNodes=new cr,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,i._ownerElement=r,r},createAttributeNS:function(e,t){var r=new Fo,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}};nt(Yi,Y);function Kr(){this._nsMap={}}Kr.prototype={nodeType:bt,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ur?this.insertBefore(e,null):LP(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Tn(this,function(t){var r=[];return Po(t,function(n){n!==t&&n.nodeType==bt&&(e==="*"||n.tagName==e)&&r.push(n)}),r})},getElementsByTagNameNS:function(e,t){return new Tn(this,function(r){var n=[];return Po(r,function(i){i!==r&&i.nodeType===bt&&(e==="*"||i.namespaceURI===e)&&(t==="*"||i.localName==t)&&n.push(i)}),n})}};Yi.prototype.getElementsByTagName=Kr.prototype.getElementsByTagName;Yi.prototype.getElementsByTagNameNS=Kr.prototype.getElementsByTagNameNS;nt(Kr,Y);function Fo(){}Fo.prototype.nodeType=Fn;nt(Fo,Y);function Zi(){}Zi.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(Re[rt])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){var n=this.data.substring(0,e),i=this.data.substring(e+t);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};nt(Zi,Y);function Lu(){}Lu.prototype={nodeName:"#text",nodeType:Io,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};nt(Lu,Zi);function Mu(){}Mu.prototype={nodeName:"#comment",nodeType:Fu};nt(Mu,Zi);function Uu(){}Uu.prototype={nodeName:"#cdata-section",nodeType:wm};nt(Uu,Zi);function To(){}To.prototype.nodeType=Dm;nt(To,Y);function Rm(){}Rm.prototype.nodeType=_P;nt(Rm,Y);function xm(){}xm.prototype.nodeType=IP;nt(xm,Y);function Bu(){}Bu.prototype.nodeType=Nm;nt(Bu,Y);function Ro(){}Ro.prototype.nodeName="#document-fragment";Ro.prototype.nodeType=ur;nt(Ro,Y);function ku(){}ku.prototype.nodeType=Ou;nt(ku,Y);function Lm(){}Lm.prototype.serializeToString=function(e,t,r,n){return Mm.call(e,t,r,n)};Y.prototype.toString=Mm;function Mm(e,t,r){var n=!!r&&!!r.requireWellFormed,i=[],a=this.nodeType==9&&this.documentElement||this,o=a.prefix,s=a.namespaceURI;if(s&&o==null){var o=a.lookupPrefix(s);if(o==null)var l=[{namespace:s,prefix:null}]}return qu(this,i,e,t,l,n),i.join("")}function Cm(e,t,r){var n=e.prefix||"",i=e.namespaceURI;if(!i||n==="xml"&&i===Qi.XML||i===Qi.XMLNS)return!1;for(var a=r.length;a--;){var o=r[a];if(o.prefix===n)return o.namespace!==i}return!0}function Eo(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Pm),'"')}function qu(e,t,r,n,i,a){i||(i=[]),Te(e,{ns:i,isHTML:r},{enter:function(o,s){var l=s.ns,u=s.isHTML;if(n)if(o=n(o),o){if(typeof o=="string")return t.push(o),null}else return null;switch(o.nodeType){case bt:var c=o.attributes,d=c.length,f=o.tagName;u=Qi.isHTML(o.namespaceURI)||u;var g=f;if(!u&&!o.prefix&&o.namespaceURI){for(var b,w=0;w<c.length;w++)if(c.item(w).name==="xmlns"){b=c.item(w).value;break}if(!b)for(var N=l.length-1;N>=0;N--){var _=l[N];if(_.prefix===""&&_.namespace===o.namespaceURI){b=_.namespace;break}}if(b!==o.namespaceURI)for(var N=l.length-1;N>=0;N--){var _=l[N];if(_.namespace===o.namespaceURI){_.prefix&&(g=_.prefix+":"+f);break}}}t.push("<",g);for(var T=l.slice(),R=0;R<d;R++){var M=c.item(R);M.prefix=="xmlns"?T.push({prefix:M.localName,namespace:M.value}):M.nodeName=="xmlns"&&T.push({prefix:"",namespace:M.value})}for(var R=0;R<d;R++){var M=c.item(R);if(Cm(M,u,T)){var W=M.prefix||"",B=M.namespaceURI;Eo(t,W?"xmlns:"+W:"xmlns",B),T.push({prefix:W,namespace:B})}var j=n?n(M):M;j&&(typeof j=="string"?t.push(j):Eo(t,j.name,j.value))}if(f===g&&Cm(o,u,T)){var k=o.prefix||"",B=o.namespaceURI;Eo(t,k?"xmlns:"+k:"xmlns",B),T.push({prefix:k,namespace:B})}var $=o.firstChild;if($||u&&!/^(?:meta|link|img|br|hr|input)$/i.test(f)){if(t.push(">"),u&&/^script$/i.test(f)){for(;$;)$.data?t.push($.data):qu($,t,u,n,T.slice(),a),$=$.nextSibling;return t.push("</",f,">"),null}return{ns:T,isHTML:u,tag:g}}else return t.push("/>"),null;case Sm:case ur:return{ns:l.slice(),isHTML:u,tag:null};case Fn:return Eo(t,o.name,o.value),null;case Io:return t.push(o.data.replace(/[<&>]/g,Pm)),null;case wm:if(a&&o.data.indexOf("]]>")!==-1)throw new te(On,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",o.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case Fu:if(a&&o.data.indexOf("-->")!==-1)throw new te(On,'The comment node data contains "-->"');return t.push("<!--",o.data,"-->"),null;case Dm:if(a){if(o.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(o.publicId))throw new te(On,"DocumentType publicId is not a valid PubidLiteral");if(o.systemId&&!/^("[^"]*"|'[^']*')$/.test(o.systemId))throw new te(On,"DocumentType systemId is not a valid SystemLiteral");if(o.internalSubset&&o.internalSubset.indexOf("]>")!==-1)throw new te(On,'DocumentType internalSubset contains "]>"')}var re=o.publicId,H=o.systemId;if(t.push("<!DOCTYPE ",o.name),re)t.push(" PUBLIC ",re),H&&H!="."&&t.push(" ",H),t.push(">");else if(H&&H!=".")t.push(" SYSTEM ",H,">");else{var nr=o.internalSubset;nr&&t.push(" [",nr,"]"),t.push(">")}return null;case Ou:if(a&&o.data.indexOf("?>")!==-1)throw new te(On,'The ProcessingInstruction data contains "?>"');return t.push("<?",o.target," ",o.data,"?>"),null;case Nm:return t.push("&",o.nodeName,";"),null;default:return t.push("??",o.nodeName),null}},exit:function(o,s){s&&s.tag&&t.push("</",s.tag,">")}})}function MP(e,t,r){var n;return Te(t,null,{enter:function(i,a){var o=i.cloneNode(!1);o.ownerDocument=e,o.parentNode=null,a===null?n=o:a.appendChild(o);var s=i.nodeType===Fn||r;return s?o:null}}),n}function Um(e,t,r){var n;return Te(t,null,{enter:function(i,a){var o=new i.constructor;for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var l=i[s];typeof l!="object"&&l!=o[s]&&(o[s]=l)}i.childNodes&&(o.childNodes=new cr),o.ownerDocument=e;var u=r;switch(o.nodeType){case bt:var c=i.attributes,d=o.attributes=new _o,f=c.length;d._ownerElement=o;for(var g=0;g<f;g++)o.setAttributeNode(Um(e,c.item(g),!0));break;case Fn:u=!0}return a!==null?a.appendChild(o):n=o,u?o:null}}),n}function Bm(e,t,r){e[t]=r}try{Object.defineProperty&&(Object.defineProperty(Tn.prototype,"length",{get:function(){return Tu(this),this.$$length}}),Object.defineProperty(Y.prototype,"textContent",{get:function(){if(this.nodeType===bt||this.nodeType===ur){var e=[];return Te(this,null,{enter:function(t){if(t.nodeType===bt||t.nodeType===ur)return!0;if(t.nodeType===Ou||t.nodeType===Fu)return null;e.push(t.nodeValue)}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case bt:case ur:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Bm=function(e,t,r){e["$$"+t]=r})}catch{}pr.DocumentType=To;pr.DOMException=te;pr.DOMImplementation=_m;pr.Element=Kr;pr.Node=Y;pr.NodeList=cr;pr.walkDOM=Te;pr.XMLSerializer=Lm});var qm=m(ea=>{"use strict";var km=Ji().freeze;ea.XML_ENTITIES=km({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});ea.HTML_ENTITIES=km({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
-`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});ea.entityMap=ea.HTML_ENTITIES});var Jm=m(Gu=>{var ia=Ji().NAMESPACE,Vu=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,$m=new RegExp("[\\-\\.0-9"+Vu.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Vm=new RegExp("^"+Vu.source+$m.source+"*(?::"+Vu.source+$m.source+"*)?$"),ta=0,Or=1,Rn=2,ra=3,xn=4,Ln=5,na=6,xo=7;function Mn(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Mn)}Mn.prototype=new Error;Mn.prototype.name=Mn.name;function Wm(){}Wm.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),jm(t,t={}),UP(e,t,r,n,this.errorHandler),n.endDocument()}};function UP(e,t,r,n,i){function a(le){if(le>65535){le-=65536;var tt=55296+(le>>10),Il=56320+(le&1023);return String.fromCharCode(tt,Il)}else return String.fromCharCode(le)}function o(le){var tt=le.slice(1,-1);return Object.hasOwnProperty.call(r,tt)?r[tt]:tt.charAt(0)==="#"?a(parseInt(tt.substr(1).replace("x","0x"))):(i.error("entity not found:"+le),le)}function s(le){if(le>w){var tt=e.substring(w,le).replace(/&#?\w+;/g,o);f&&l(w),n.characters(tt,0,le-w),w=le}}function l(le,tt){for(;le>=c&&(tt=d.exec(e));)u=tt.index,c=u+tt[0].length,f.lineNumber++;f.columnNumber=le-u+1}for(var u=0,c=0,d=/.*(?:\r\n?|\n)|.*$/g,f=n.locator,g=[{currentNSMap:t}],b={},w=0;;){try{var N=e.indexOf("<",w);if(N<0){if(!e.substr(w).match(/^\s*$/)){var _=n.doc,T=_.createTextNode(e.substr(w));_.appendChild(T),n.currentElement=T}return}switch(N>w&&s(N),e.charAt(N+1)){case"/":var H=e.indexOf(">",N+3),R=e.substring(N+2,H).replace(/[ \t\n\r]+$/g,""),M=g.pop();H<0?(R=e.substring(N+2).replace(/[\s<].*/,""),i.error("end tag name: "+R+" is not complete:"+M.tagName),H=N+1+R.length):R.match(/\s</)&&(R=R.replace(/[\s<].*/,""),i.error("end tag name: "+R+" maybe not complete"),H=N+1+R.length);var W=M.localNSMap,B=M.tagName==R,j=B||M.tagName&&M.tagName.toLowerCase()==R.toLowerCase();if(j){if(n.endElement(M.uri,M.localName,R),W)for(var k in W)Object.prototype.hasOwnProperty.call(W,k)&&n.endPrefixMapping(k);B||i.fatalError("end tag name: "+R+" is not match the current start tagName:"+M.tagName)}else g.push(M);H++;break;case"?":f&&l(N),H=VP(e,N,n);break;case"!":f&&l(N),H=$P(e,N,n,i);break;default:f&&l(N);var $=new Hm,re=g[g.length-1].currentNSMap,H=BP(e,N,$,re,o,i),nr=$.length;if(!$.closed&&qP(e,H,$.tagName,b)&&($.closed=!0,r.nbsp||i.warning("unclosed xml attribute")),f&&nr){for(var El=Gm(f,{}),Oi=0;Oi<nr;Oi++){var io=$[Oi];l(io.offset),io.locator=Gm(f,{})}n.locator=El,zm($,n,re)&&g.push($),n.locator=f}else zm($,n,re)&&g.push($);ia.isHTML($.uri)&&!$.closed?H=kP(e,H,$.tagName,o,n):H++}}catch(le){if(le instanceof Mn)throw le;i.error("element parse error: "+le),H=-1}H>w?w=H:s(Math.max(N,w)+1)}}function Gm(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function BP(e,t,r,n,i,a){function o(g,b,w){r.attributeNames.hasOwnProperty(g)&&a.fatalError("Attribute "+g+" redefined"),r.addValue(g,b.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),w)}for(var s,l,u=++t,c=ta;;){var d=e.charAt(u);switch(d){case"=":if(c===Or)s=e.slice(t,u),c=ra;else if(c===Rn)c=ra;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===ra||c===Or)if(c===Or&&(a.warning('attribute value must after "="'),s=e.slice(t,u)),t=u+1,u=e.indexOf(d,t),u>0)l=e.slice(t,u),o(s,l,t-1),c=Ln;else throw new Error("attribute value no end '"+d+"' match");else if(c==xn)l=e.slice(t,u),o(s,l,t),a.warning('attribute "'+s+'" missed start quot('+d+")!!"),t=u+1,c=Ln;else throw new Error('attribute value must after "="');break;case"/":switch(c){case ta:r.setTagName(e.slice(t,u));case Ln:case na:case xo:c=xo,r.closed=!0;case xn:case Or:break;case Rn:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),c==ta&&r.setTagName(e.slice(t,u)),u;case">":switch(c){case ta:r.setTagName(e.slice(t,u));case Ln:case na:case xo:break;case xn:case Or:l=e.slice(t,u),l.slice(-1)==="/"&&(r.closed=!0,l=l.slice(0,-1));case Rn:c===Rn&&(l=s),c==xn?(a.warning('attribute "'+l+'" missed quot(")!'),o(s,l,t)):((!ia.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&a.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),o(l,l,t));break;case ra:throw new Error("attribute value missed!!")}return u;case"\x80":d=" ";default:if(d<=" ")switch(c){case ta:r.setTagName(e.slice(t,u)),c=na;break;case Or:s=e.slice(t,u),c=Rn;break;case xn:var l=e.slice(t,u);a.warning('attribute "'+l+'" missed quot(")!!'),o(s,l,t);case Ln:c=na;break}else switch(c){case Rn:var f=r.tagName;(!ia.isHTML(n[""])||!s.match(/^(?:disabled|checked|selected)$/i))&&a.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),o(s,s,t),t=u,c=Or;break;case Ln:a.warning('attribute space is required"'+s+'"!!');case na:c=Or,t=u;break;case ra:c=xn,t=u;break;case xo:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function zm(e,t,r){for(var n=e.tagName,i=null,d=e.length;d--;){var a=e[d],o=a.qName,s=a.value,f=o.indexOf(":");if(f>0)var l=a.prefix=o.slice(0,f),u=o.slice(f+1),c=l==="xmlns"&&u;else u=o,l=null,c=o==="xmlns"&&"";a.localName=u,c!==!1&&(i==null&&(i={},jm(r,r={})),r[c]=i[c]=s,a.uri=ia.XMLNS,t.startPrefixMapping(c,s))}for(var d=e.length;d--;){a=e[d];var l=a.prefix;l&&(l==="xml"&&(a.uri=ia.XML),l!=="xmlns"&&(a.uri=r[l||""]))}var f=n.indexOf(":");f>0?(l=e.prefix=n.slice(0,f),u=e.localName=n.slice(f+1)):(l=null,u=e.localName=n);var g=e.uri=r[l||""];if(t.startElement(g,u,n,e),e.closed){if(t.endElement(g,u,n),i)for(l in i)Object.prototype.hasOwnProperty.call(i,l)&&t.endPrefixMapping(l)}else return e.currentNSMap=r,e.localNSMap=i,!0}function kP(e,t,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var a=e.indexOf("</"+r+">",t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(r)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,n),i.characters(o,0,o.length),a)}return t+1}function qP(e,t,r,n){var i=n[r];return i==null&&(i=e.lastIndexOf("</"+r+">"),i<t&&(i=e.lastIndexOf("</"+r)),n[r]=i),i<t}function jm(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}function $P(e,t,r,n){var i=e.charAt(t+2);switch(i){case"-":if(e.charAt(t+3)==="-"){var a=e.indexOf("-->",t+4);return a>t?(r.comment(e,t+4,a-t-4),a+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(e.substr(t+3,6)=="CDATA["){var a=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,a-t-9),r.endCDATA(),a+3}var o=GP(e,t),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var l=o[1][0],u=!1,c=!1;s>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],c=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var d=o[s-1];return r.startDTD(l,u,c),r.endDTD(),d.index+d[0].length}}return-1}function VP(e,t,r){var n=e.indexOf("?>",t);if(n){var i=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(i){var a=i[0].length;return r.processingInstruction(i[1],i[2]),n+2}else return-1}return-1}function Hm(){this.attributeNames={}}Hm.prototype={setTagName:function(e){if(!Vm.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!Vm.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function GP(e,t){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);r=i.exec(e);)if(n.push(r),r[1])return n}Gu.XMLReader=Wm;Gu.ParseError=Mn});var th=m(Mo=>{var zP=Ji(),WP=$u(),Qm=qm(),Ym=Jm(),jP=WP.DOMImplementation,Xm=zP.NAMESPACE,HP=Ym.ParseError,JP=Ym.XMLReader;function Zm(e){return e.replace(/\r[\n\u0085]/g,`
+`);if(h===-1)return;let b=f.slice(0,h),w=f.slice(h+4);if(!/^Content-Type:\s*application\/http\b/im.test(b))return;let N=/^HTTP\/1\.[01] (\d{3})\b/.exec(w);if(!N||((i=w.match(/^HTTP\/1\.[01] \d{3}\b/gm))!==null&&i!==void 0?i:[]).length!==1)return;let I=(a=/^Content-ID:\s*(\S+)/im.exec(b))===null||a===void 0?void 0:a[1];if(I===void 0||d.has(I)||!u.has(I))return;d.add(I),c.push(Number(N[1]))}return c.length===0?void 0:c}async function sm(e,t){try{let r=Do(t,"sitemapid"),n=await e.get(r);return n.status<200||n.status>=300?null:Iu(Eo(n))}catch{return null}}function AP(e){return e>=400&&e<500&&e!==408&&e!==429}function Du(e,t,r){if(!e)throw new Se.SdkError("APP_SITEMAP_UNRESOLVED",`Refusing to delete app '${t}': the ${r} read returned no ETag, so the delete cannot be made conditional on the row that was actually inspected. Without that condition a row renamed or re-pointed between the read and the delete would be destroyed. Retry.`);return e}async function pm(e,t,r){let n=`/appmodules(${t})`;if(!r.sitemapId){await wP(e,n,Du(r.appEtag,t,"app"));return}if(!e.supportsAtomicBatch)throw new Se.SdkError("APP_DELETE_NOT_ATOMIC",`Refusing to delete app '${t}': it owns a sitemap, and the injected HttpClient cannot send a raw body, so the two rows would have to be deleted as separate requests. A failure between them strands the sitemap and permanently reserves the app's unique name. Implement HttpClient.postRaw so the SDK can delete them atomically.`);await dm(e,[{path:n,etag:Du(r.appEtag,t,"app")},{path:`/sitemaps(${r.sitemapId})`,etag:Du(r.sitemapEtag,t,"sitemap")}])}async function wP(e,t,r){(0,Re.ensureSuccess)(await e.delete(t,{headers:{"If-Match":r}}),e.apiUrl(t))}_n.appApi={async get(e,t){var r;let n=(0,ie.normalizeGuid)(t,"id"),i=`/appmodules(${n})${lm}`,o=(r=(0,Re.ensureSuccess)(await e.get(i),e.apiUrl(i)).body)!==null&&r!==void 0?r:{},s=await um(e,o.uniquename),l=s?(0,ie.normalizeGuid)(s,"sitemapId"):void 0,u=null;if(l){let c=Do(l,"sitemapid,sitemapname,sitemapnameunique,sitemapxml"),d=(0,Re.ensureSuccess)(await e.get(c),e.apiUrl(c)),f=Eo(d);if(f&&f.sitemapnameunique!==o.uniquename)throw new Se.SdkError("APP_SITEMAP_UNRESOLVED",`Refusing to fetch app '${n}': sitemap '${l}' now carries sitemapnameunique '${String(f.sitemapnameunique)}', not '${String(o.uniquename)}', so it is no longer this app's sitemap. Retry.`);o.$sitemap=f??{},u=Iu(f)}return{raw:o,etag:u}},async list(e,t){var r;let n=`/appmodules${uP}`,a=(0,Re.ensureSuccess)(await e.get(n),e.apiUrl(n)).body;return((r=a?.value)!==null&&r!==void 0?r:[]).map(s=>{var l,u;return{type:"app",id:(l=s.appmoduleid)!==null&&l!==void 0?l:"",name:(u=s.name)!==null&&u!==void 0?u:"",isDirty:!1}})},async create(e,t){let r=t,n=r.iconWebResourceId||await dP(e),i=r.appModuleUniqueName||cP(r.appModuleId),a={name:r.appModuleName,uniquename:i,clienttype:4,formfactor:1,navigationtype:0};r.appModuleDescription&&(a.description=r.appModuleDescription),n&&(a.webresourceid=n);let o="/appmodules",s=(0,Re.ensureSuccess)(await e.post(o,a),e.apiUrl(o)),l=(0,Re.requireCreatedId)(s,"appmoduleid","app module"),u=null,c=(0,Eu.newId)(),d=!1;try{let f="/sitemaps",h=await e.post(f,{sitemapid:c,sitemapnameunique:i,sitemapname:r.sitemapname,sitemapxml:r.sitemapxml});d=AP(h.status);let b=(0,Re.ensureSuccess)(h,e.apiUrl(f));u=(0,Re.readEtag)(b),u||(u=await sm(e,c));let w=await im(e,r),N=w.components;N.unshift({"@odata.type":"Microsoft.Dynamics.CRM.sitemap",sitemapid:c}),await am(e,l,N),await om(e,l,w.tables),await pP(e,l);let I="/PublishXml";(0,Re.ensureSuccess)(await e.post(I,{ParameterXml:`<importexportxml><appmodules><appmodule>${l}</appmodule></appmodules></importexportxml>`}),e.apiUrl(I))}catch(f){throw await vP(e,l,{sitemapId:c,serverRefusedSitemap:d,appEtag:(0,Re.readEtag)(s),sitemapEtag:u}),f}return{id:l,etag:u,serverIdentity:{sitemapId:c}}},async update(e,t,r,n){var i;let a=r,o=(0,ie.normalizeGuid)(t,"id");if(!a.sitemapId)throw new Se.ValidationError("app",o,"/sitemapId","missing sitemap identity \u2014 re-fetch the app before pushing edits");let s=(0,ie.normalizeGuid)(a.sitemapId,"sitemapId");if(!n)throw new Se.SdkError("APP_UPDATE_NO_ETAG",`Refusing to push app '${o}': no concurrency token is held for its sitemap row, so the write could not be made conditional and would silently overwrite a concurrent edit. Re-fetch the app and re-apply the change.`);let l={"If-Match":n},u=`/sitemaps(${s})`,c=(0,Re.ensureSuccess)(await e.patch(u,{sitemapxml:a.sitemapxml,sitemapname:a.sitemapname},l?{headers:l}:void 0),e.apiUrl(u)),d=`/appmodules(${o})`;(0,Re.ensureSuccess)(await e.patch(d,{name:a.appModuleName,description:a.appModuleDescription}),e.apiUrl(d));let f=[];try{let h=await im(e,a);await am(e,o,h.components),await om(e,o,h.tables)}catch(h){f.push(`App '${o}': one or more components were not pinned (${h.message}). Navigation may reference content not included in the app; re-push to retry.`)}return{id:o,etag:(i=(0,Re.readEtag)(c))!==null&&i!==void 0?i:await sm(e,s),...f.length>0?{warnings:f}:{}}},async delete(e,t){let r=(0,ie.normalizeGuid)(t,"id");await pm(e,r,await cm(e,r))}}});var Ji=m(Pn=>{"use strict";function NP(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(t.call(void 0,i,n,e))return i}}function Pu(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(e):e}function SP(e,t){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}var fm=Pu({HTML:"text/html",isHTML:function(e){return e===fm.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),mm=Pu({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===mm.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Pn.assign=SP;Pn.find=NP;Pn.freeze=Pu;Pn.MIME_TYPE=fm;Pn.NAMESPACE=mm});var $u=m(pr=>{var wm=Ji(),Gt=wm.find,Qi=wm.NAMESPACE;function DP(e){return e!==""}function EP(e){return e?e.split(/[\t\n\f\r ]+/).filter(DP):[]}function IP(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function hm(e){if(!e)return[];var t=EP(e);return Object.keys(t.reduce(IP,{}))}function _P(e){return function(t){return e&&e.indexOf(t)!==-1}}function Ki(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}function it(e,t){var r=e.prototype;if(!(r instanceof t)){let i=function(){};var n=i;i.prototype=t.prototype,i=new i,Ki(r,i),e.prototype=r=i}r.constructor!=e&&(typeof e!="function"&&console.error("unknown Class:"+e),r.constructor=e)}var at={},bt=at.ELEMENT_NODE=1,Tn=at.ATTRIBUTE_NODE=2,_o=at.TEXT_NODE=3,Nm=at.CDATA_SECTION_NODE=4,Sm=at.ENTITY_REFERENCE_NODE=5,PP=at.ENTITY_NODE=6,Ou=at.PROCESSING_INSTRUCTION_NODE=7,Tu=at.COMMENT_NODE=8,Dm=at.DOCUMENT_NODE=9,Em=at.DOCUMENT_TYPE_NODE=10,ur=at.DOCUMENT_FRAGMENT_NODE=11,OP=at.NOTATION_NODE=12,ze={},xe={},U9=ze.INDEX_SIZE_ERR=(xe[1]="Index size error",1),B9=ze.DOMSTRING_SIZE_ERR=(xe[2]="DOMString size error",2),nt=ze.HIERARCHY_REQUEST_ERR=(xe[3]="Hierarchy request error",3),k9=ze.WRONG_DOCUMENT_ERR=(xe[4]="Wrong document",4),TP=ze.INVALID_CHARACTER_ERR=(xe[5]="Invalid character",5),q9=ze.NO_DATA_ALLOWED_ERR=(xe[6]="No data allowed",6),$9=ze.NO_MODIFICATION_ALLOWED_ERR=(xe[7]="No modification allowed",7),Im=ze.NOT_FOUND_ERR=(xe[8]="Not found",8),V9=ze.NOT_SUPPORTED_ERR=(xe[9]="Not supported",9),gm=ze.INUSE_ATTRIBUTE_ERR=(xe[10]="Attribute in use",10),On=ze.INVALID_STATE_ERR=(xe[11]="Invalid state",11),G9=ze.SYNTAX_ERR=(xe[12]="Syntax error",12),z9=ze.INVALID_MODIFICATION_ERR=(xe[13]="Invalid modification",13),W9=ze.NAMESPACE_ERR=(xe[14]="Invalid namespace",14),j9=ze.INVALID_ACCESS_ERR=(xe[15]="Invalid access",15);function te(e,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,xe[e]),this.message=xe[e],Error.captureStackTrace&&Error.captureStackTrace(this,te);return r.code=e,t&&(this.message=this.message+": "+t),r}te.prototype=Error.prototype;Ki(ze,te);function cr(){}cr.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,r){for(var n=!!r&&!!r.requireWellFormed,i=[],a=0;a<this.length;a++)qu(this[a],i,e,t,null,n);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function Rn(e,t){this._node=e,this._refresh=t,Ru(this)}function Ru(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if(km(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];Ki(r,e),e._inc=t}}Rn.prototype.item=function(e){return Ru(this),this[e]||null};it(Rn,cr);function Po(){}function _m(e,t){for(var r=e.length;r--;)if(e[r]===t)return r}function vm(e,t,r,n){if(n?t[_m(t,n)]=r:t[t.length++]=r,e){r.ownerElement=e;var i=e.ownerDocument;i&&(n&&Tm(i,e,n),RP(i,e,r))}}function bm(e,t,r){var n=_m(t,r);if(n>=0){for(var i=t.length-1;n<i;)t[n]=t[++n];if(t.length=i,e){var a=e.ownerDocument;a&&(Tm(a,e,r),r.ownerElement=null)}}else throw new te(Im,new Error(e.tagName+"@"+r))}Po.prototype={length:0,item:cr.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var r=this[t];if(r.nodeName==e)return r}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new te(gm);var r=this.getNamedItem(e.nodeName);return vm(this._ownerElement,this,e,r),r},setNamedItemNS:function(e){var t=e.ownerElement,r;if(t&&t!=this._ownerElement)throw new te(gm);return r=this.getNamedItemNS(e.namespaceURI,e.localName),vm(this._ownerElement,this,e,r),r},removeNamedItem:function(e){var t=this.getNamedItem(e);return bm(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);return bm(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){for(var r=this.length;r--;){var n=this[r];if(n.localName==t&&n.namespaceURI==e)return n}return null}};function Pm(){}Pm.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,r){var n=new Yi;if(n.implementation=this,n.childNodes=new cr,n.doctype=r||null,r&&n.appendChild(r),t){var i=n.createElementNS(e,t);n.appendChild(i)}return n},createDocumentType:function(e,t,r){var n=new Fo;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=r||"",n}};function Y(){}Y.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return To(this,e,t)},replaceChild:function(e,t){To(this,e,t,Fm),t&&this.removeChild(t)},removeChild:function(e){return Rm(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Bm(this.ownerDocument||this,this,e)},normalize:function(){Fe(this,null,{enter:function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;r!==null&&r.nodeType===_o&&t.nodeType===_o?(e.removeChild(r),t.appendData(r.data)):t=r}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===e)return n}t=t.nodeType==Tn?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];t=t.nodeType==Tn?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function Om(e){return e=="<"&&"&lt;"||e==">"&&"&gt;"||e=="&"&&"&amp;"||e=='"'&&"&quot;"||"&#"+e.charCodeAt()+";"}Ki(at,Y);Ki(at,Y.prototype);function Oo(e,t){return Fe(e,null,{enter:function(r){return t(r)?Fe.STOP:!0}})===Fe.STOP}function Fe(e,t,r){for(var n=[{node:e,context:t,phase:Fe.ENTER}];n.length>0;){var i=n.pop();if(i.phase===Fe.ENTER){var a=r.enter(i.node,i.context);if(a===Fe.STOP)return Fe.STOP;if(n.push({node:i.node,context:a,phase:Fe.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)n.push({node:o,context:a,phase:Fe.ENTER}),o=o.previousSibling}else r.exit&&r.exit(i.node,i.context)}}Fe.STOP=Symbol("walkDOM.STOP");Fe.ENTER=0;Fe.EXIT=1;function Yi(){this.ownerDocument=this}function RP(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Qi.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function Tm(e,t,r,n){e&&e._inc++;var i=r.namespaceURI;i===Qi.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function Fu(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var i=t.firstChild,a=0;i;)n[a++]=i,i=i.nextSibling;n.length=a,delete n[n.length]}}}function Rm(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Fu(e.ownerDocument,e),t}function FP(e){return e&&(e.nodeType===Y.DOCUMENT_NODE||e.nodeType===Y.DOCUMENT_FRAGMENT_NODE||e.nodeType===Y.ELEMENT_NODE)}function xP(e){return e&&(zt(e)||xu(e)||dr(e)||e.nodeType===Y.DOCUMENT_FRAGMENT_NODE||e.nodeType===Y.COMMENT_NODE||e.nodeType===Y.PROCESSING_INSTRUCTION_NODE)}function dr(e){return e&&e.nodeType===Y.DOCUMENT_TYPE_NODE}function zt(e){return e&&e.nodeType===Y.ELEMENT_NODE}function xu(e){return e&&e.nodeType===Y.TEXT_NODE}function ym(e,t){var r=e.childNodes||[];if(Gt(r,zt)||dr(t))return!1;var n=Gt(r,dr);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Cm(e,t){var r=e.childNodes||[];function n(a){return zt(a)&&a!==t}if(Gt(r,n))return!1;var i=Gt(r,dr);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function LP(e,t,r){if(!FP(e))throw new te(nt,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new te(Im,"child not in parent");if(!xP(t)||dr(t)&&e.nodeType!==Y.DOCUMENT_NODE)throw new te(nt,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function MP(e,t,r){var n=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===Y.DOCUMENT_FRAGMENT_NODE){var a=i.filter(zt);if(a.length>1||Gt(i,xu))throw new te(nt,"More than one element or text in fragment");if(a.length===1&&!ym(e,r))throw new te(nt,"Element in fragment can not be inserted before doctype")}if(zt(t)&&!ym(e,r))throw new te(nt,"Only one element can be added and only after doctype");if(dr(t)){if(Gt(n,dr))throw new te(nt,"Only one doctype is allowed");var o=Gt(n,zt);if(r&&n.indexOf(o)<n.indexOf(r))throw new te(nt,"Doctype can only be inserted before an element");if(!r&&o)throw new te(nt,"Doctype can not be appended since element is present")}}function Fm(e,t,r){var n=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===Y.DOCUMENT_FRAGMENT_NODE){var a=i.filter(zt);if(a.length>1||Gt(i,xu))throw new te(nt,"More than one element or text in fragment");if(a.length===1&&!Cm(e,r))throw new te(nt,"Element in fragment can not be inserted before doctype")}if(zt(t)&&!Cm(e,r))throw new te(nt,"Only one element can be added and only after doctype");if(dr(t)){let l=function(u){return dr(u)&&u!==r};var s=l;if(Gt(n,l))throw new te(nt,"Only one doctype is allowed");var o=Gt(n,zt);if(r&&n.indexOf(o)<n.indexOf(r))throw new te(nt,"Doctype can only be inserted before an element")}}function To(e,t,r,n){LP(e,t,r),e.nodeType===Y.DOCUMENT_NODE&&(n||MP)(e,t,r);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ur){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=r?r.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=r,s?s.nextSibling=a:e.firstChild=a,r==null?e.lastChild=o:r.previousSibling=o;do{a.parentNode=e;var l=e.ownerDocument||e;Xi(a,l)}while(a!==o&&(a=a.nextSibling));return Fu(e.ownerDocument||e,e),t.nodeType==ur&&(t.firstChild=t.lastChild=null),t}function Xi(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===bt&&e.attributes)for(var r=0;r<e.attributes.length;r++){var n=e.attributes.item(r);n&&(n.ownerDocument=t)}for(var i=e.firstChild;i;)Xi(i,t),i=i.nextSibling}}function UP(e,t){t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,Fu(e.ownerDocument,e,t);var r=e.ownerDocument||e;return Xi(t,r),t}Yi.prototype={nodeName:"#document",nodeType:Dm,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ur){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return To(this,e,t),Xi(e,this),this.documentElement===null&&e.nodeType===bt&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Rm(this,e)},replaceChild:function(e,t){To(this,e,t,Fm),Xi(e,this),t&&this.removeChild(t),zt(e)&&(this.documentElement=e)},importNode:function(e,t){return BP(this,e,t)},getElementById:function(e){var t=null;return Oo(this.documentElement,function(r){if(r.nodeType==bt&&r.getAttribute("id")==e)return t=r,!0}),t},getElementsByClassName:function(e){var t=hm(e);return new Rn(this,function(r){var n=[];return t.length>0&&Oo(r.documentElement,function(i){if(i!==r&&i.nodeType===bt){var a=i.getAttribute("class");if(a){var o=e===a;if(!o){var s=hm(a);o=t.every(_P(s))}o&&n.push(i)}}}),n})},createElement:function(e){var t=new Kr;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new cr;var r=t.attributes=new Po;return r._ownerElement=t,t},createDocumentFragment:function(){var e=new xo;return e.ownerDocument=this,e.childNodes=new cr,e},createTextNode:function(e){var t=new Lu;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Mu;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf("]]>")!==-1)throw new te(TP,'data contains "]]>"');var t=new Uu;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new ku;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new Ro;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Bu;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new Kr,n=t.split(":"),i=r.attributes=new Po;return r.childNodes=new cr,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,i._ownerElement=r,r},createAttributeNS:function(e,t){var r=new Ro,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}};it(Yi,Y);function Kr(){this._nsMap={}}Kr.prototype={nodeType:bt,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ur?this.insertBefore(e,null):UP(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Rn(this,function(t){var r=[];return Oo(t,function(n){n!==t&&n.nodeType==bt&&(e==="*"||n.tagName==e)&&r.push(n)}),r})},getElementsByTagNameNS:function(e,t){return new Rn(this,function(r){var n=[];return Oo(r,function(i){i!==r&&i.nodeType===bt&&(e==="*"||i.namespaceURI===e)&&(t==="*"||i.localName==t)&&n.push(i)}),n})}};Yi.prototype.getElementsByTagName=Kr.prototype.getElementsByTagName;Yi.prototype.getElementsByTagNameNS=Kr.prototype.getElementsByTagNameNS;it(Kr,Y);function Ro(){}Ro.prototype.nodeType=Tn;it(Ro,Y);function Zi(){}Zi.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(xe[nt])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){var n=this.data.substring(0,e),i=this.data.substring(e+t);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};it(Zi,Y);function Lu(){}Lu.prototype={nodeName:"#text",nodeType:_o,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};it(Lu,Zi);function Mu(){}Mu.prototype={nodeName:"#comment",nodeType:Tu};it(Mu,Zi);function Uu(){}Uu.prototype={nodeName:"#cdata-section",nodeType:Nm};it(Uu,Zi);function Fo(){}Fo.prototype.nodeType=Em;it(Fo,Y);function xm(){}xm.prototype.nodeType=OP;it(xm,Y);function Lm(){}Lm.prototype.nodeType=PP;it(Lm,Y);function Bu(){}Bu.prototype.nodeType=Sm;it(Bu,Y);function xo(){}xo.prototype.nodeName="#document-fragment";xo.prototype.nodeType=ur;it(xo,Y);function ku(){}ku.prototype.nodeType=Ou;it(ku,Y);function Mm(){}Mm.prototype.serializeToString=function(e,t,r,n){return Um.call(e,t,r,n)};Y.prototype.toString=Um;function Um(e,t,r){var n=!!r&&!!r.requireWellFormed,i=[],a=this.nodeType==9&&this.documentElement||this,o=a.prefix,s=a.namespaceURI;if(s&&o==null){var o=a.lookupPrefix(s);if(o==null)var l=[{namespace:s,prefix:null}]}return qu(this,i,e,t,l,n),i.join("")}function Am(e,t,r){var n=e.prefix||"",i=e.namespaceURI;if(!i||n==="xml"&&i===Qi.XML||i===Qi.XMLNS)return!1;for(var a=r.length;a--;){var o=r[a];if(o.prefix===n)return o.namespace!==i}return!0}function Io(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Om),'"')}function qu(e,t,r,n,i,a){i||(i=[]),Fe(e,{ns:i,isHTML:r},{enter:function(o,s){var l=s.ns,u=s.isHTML;if(n)if(o=n(o),o){if(typeof o=="string")return t.push(o),null}else return null;switch(o.nodeType){case bt:var c=o.attributes,d=c.length,f=o.tagName;u=Qi.isHTML(o.namespaceURI)||u;var h=f;if(!u&&!o.prefix&&o.namespaceURI){for(var b,w=0;w<c.length;w++)if(c.item(w).name==="xmlns"){b=c.item(w).value;break}if(!b)for(var N=l.length-1;N>=0;N--){var I=l[N];if(I.prefix===""&&I.namespace===o.namespaceURI){b=I.namespace;break}}if(b!==o.namespaceURI)for(var N=l.length-1;N>=0;N--){var I=l[N];if(I.namespace===o.namespaceURI){I.prefix&&(h=I.prefix+":"+f);break}}}t.push("<",h);for(var R=l.slice(),F=0;F<d;F++){var M=c.item(F);M.prefix=="xmlns"?R.push({prefix:M.localName,namespace:M.value}):M.nodeName=="xmlns"&&R.push({prefix:"",namespace:M.value})}for(var F=0;F<d;F++){var M=c.item(F);if(Am(M,u,R)){var W=M.prefix||"",B=M.namespaceURI;Io(t,W?"xmlns:"+W:"xmlns",B),R.push({prefix:W,namespace:B})}var j=n?n(M):M;j&&(typeof j=="string"?t.push(j):Io(t,j.name,j.value))}if(f===h&&Am(o,u,R)){var k=o.prefix||"",B=o.namespaceURI;Io(t,k?"xmlns:"+k:"xmlns",B),R.push({prefix:k,namespace:B})}var $=o.firstChild;if($||u&&!/^(?:meta|link|img|br|hr|input)$/i.test(f)){if(t.push(">"),u&&/^script$/i.test(f)){for(;$;)$.data?t.push($.data):qu($,t,u,n,R.slice(),a),$=$.nextSibling;return t.push("</",f,">"),null}return{ns:R,isHTML:u,tag:h}}else return t.push("/>"),null;case Dm:case ur:return{ns:l.slice(),isHTML:u,tag:null};case Tn:return Io(t,o.name,o.value),null;case _o:return t.push(o.data.replace(/[<&>]/g,Om)),null;case Nm:if(a&&o.data.indexOf("]]>")!==-1)throw new te(On,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",o.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case Tu:if(a&&o.data.indexOf("-->")!==-1)throw new te(On,'The comment node data contains "-->"');return t.push("<!--",o.data,"-->"),null;case Em:if(a){if(o.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(o.publicId))throw new te(On,"DocumentType publicId is not a valid PubidLiteral");if(o.systemId&&!/^("[^"]*"|'[^']*')$/.test(o.systemId))throw new te(On,"DocumentType systemId is not a valid SystemLiteral");if(o.internalSubset&&o.internalSubset.indexOf("]>")!==-1)throw new te(On,'DocumentType internalSubset contains "]>"')}var re=o.publicId,H=o.systemId;if(t.push("<!DOCTYPE ",o.name),re)t.push(" PUBLIC ",re),H&&H!="."&&t.push(" ",H),t.push(">");else if(H&&H!=".")t.push(" SYSTEM ",H,">");else{var nr=o.internalSubset;nr&&t.push(" [",nr,"]"),t.push(">")}return null;case Ou:if(a&&o.data.indexOf("?>")!==-1)throw new te(On,'The ProcessingInstruction data contains "?>"');return t.push("<?",o.target," ",o.data,"?>"),null;case Sm:return t.push("&",o.nodeName,";"),null;default:return t.push("??",o.nodeName),null}},exit:function(o,s){s&&s.tag&&t.push("</",s.tag,">")}})}function BP(e,t,r){var n;return Fe(t,null,{enter:function(i,a){var o=i.cloneNode(!1);o.ownerDocument=e,o.parentNode=null,a===null?n=o:a.appendChild(o);var s=i.nodeType===Tn||r;return s?o:null}}),n}function Bm(e,t,r){var n;return Fe(t,null,{enter:function(i,a){var o=new i.constructor;for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var l=i[s];typeof l!="object"&&l!=o[s]&&(o[s]=l)}i.childNodes&&(o.childNodes=new cr),o.ownerDocument=e;var u=r;switch(o.nodeType){case bt:var c=i.attributes,d=o.attributes=new Po,f=c.length;d._ownerElement=o;for(var h=0;h<f;h++)o.setAttributeNode(Bm(e,c.item(h),!0));break;case Tn:u=!0}return a!==null?a.appendChild(o):n=o,u?o:null}}),n}function km(e,t,r){e[t]=r}try{Object.defineProperty&&(Object.defineProperty(Rn.prototype,"length",{get:function(){return Ru(this),this.$$length}}),Object.defineProperty(Y.prototype,"textContent",{get:function(){if(this.nodeType===bt||this.nodeType===ur){var e=[];return Fe(this,null,{enter:function(t){if(t.nodeType===bt||t.nodeType===ur)return!0;if(t.nodeType===Ou||t.nodeType===Tu)return null;e.push(t.nodeValue)}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case bt:case ur:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),km=function(e,t,r){e["$$"+t]=r})}catch{}pr.DocumentType=Fo;pr.DOMException=te;pr.DOMImplementation=Pm;pr.Element=Kr;pr.Node=Y;pr.NodeList=cr;pr.walkDOM=Fe;pr.XMLSerializer=Mm});var $m=m(ea=>{"use strict";var qm=Ji().freeze;ea.XML_ENTITIES=qm({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});ea.HTML_ENTITIES=qm({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
+`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});ea.entityMap=ea.HTML_ENTITIES});var Qm=m(Gu=>{var ia=Ji().NAMESPACE,Vu=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Vm=new RegExp("[\\-\\.0-9"+Vu.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Gm=new RegExp("^"+Vu.source+Vm.source+"*(?::"+Vu.source+Vm.source+"*)?$"),ta=0,Or=1,Fn=2,ra=3,xn=4,Ln=5,na=6,Lo=7;function Mn(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Mn)}Mn.prototype=new Error;Mn.prototype.name=Mn.name;function jm(){}jm.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),Hm(t,t={}),kP(e,t,r,n,this.errorHandler),n.endDocument()}};function kP(e,t,r,n,i){function a(ue){if(ue>65535){ue-=65536;var rt=55296+(ue>>10),_l=56320+(ue&1023);return String.fromCharCode(rt,_l)}else return String.fromCharCode(ue)}function o(ue){var rt=ue.slice(1,-1);return Object.hasOwnProperty.call(r,rt)?r[rt]:rt.charAt(0)==="#"?a(parseInt(rt.substr(1).replace("x","0x"))):(i.error("entity not found:"+ue),ue)}function s(ue){if(ue>w){var rt=e.substring(w,ue).replace(/&#?\w+;/g,o);f&&l(w),n.characters(rt,0,ue-w),w=ue}}function l(ue,rt){for(;ue>=c&&(rt=d.exec(e));)u=rt.index,c=u+rt[0].length,f.lineNumber++;f.columnNumber=ue-u+1}for(var u=0,c=0,d=/.*(?:\r\n?|\n)|.*$/g,f=n.locator,h=[{currentNSMap:t}],b={},w=0;;){try{var N=e.indexOf("<",w);if(N<0){if(!e.substr(w).match(/^\s*$/)){var I=n.doc,R=I.createTextNode(e.substr(w));I.appendChild(R),n.currentElement=R}return}switch(N>w&&s(N),e.charAt(N+1)){case"/":var H=e.indexOf(">",N+3),F=e.substring(N+2,H).replace(/[ \t\n\r]+$/g,""),M=h.pop();H<0?(F=e.substring(N+2).replace(/[\s<].*/,""),i.error("end tag name: "+F+" is not complete:"+M.tagName),H=N+1+F.length):F.match(/\s</)&&(F=F.replace(/[\s<].*/,""),i.error("end tag name: "+F+" maybe not complete"),H=N+1+F.length);var W=M.localNSMap,B=M.tagName==F,j=B||M.tagName&&M.tagName.toLowerCase()==F.toLowerCase();if(j){if(n.endElement(M.uri,M.localName,F),W)for(var k in W)Object.prototype.hasOwnProperty.call(W,k)&&n.endPrefixMapping(k);B||i.fatalError("end tag name: "+F+" is not match the current start tagName:"+M.tagName)}else h.push(M);H++;break;case"?":f&&l(N),H=zP(e,N,n);break;case"!":f&&l(N),H=GP(e,N,n,i);break;default:f&&l(N);var $=new Jm,re=h[h.length-1].currentNSMap,H=qP(e,N,$,re,o,i),nr=$.length;if(!$.closed&&VP(e,H,$.tagName,b)&&($.closed=!0,r.nbsp||i.warning("unclosed xml attribute")),f&&nr){for(var Il=zm(f,{}),Oi=0;Oi<nr;Oi++){var io=$[Oi];l(io.offset),io.locator=zm(f,{})}n.locator=Il,Wm($,n,re)&&h.push($),n.locator=f}else Wm($,n,re)&&h.push($);ia.isHTML($.uri)&&!$.closed?H=$P(e,H,$.tagName,o,n):H++}}catch(ue){if(ue instanceof Mn)throw ue;i.error("element parse error: "+ue),H=-1}H>w?w=H:s(Math.max(N,w)+1)}}function zm(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function qP(e,t,r,n,i,a){function o(h,b,w){r.attributeNames.hasOwnProperty(h)&&a.fatalError("Attribute "+h+" redefined"),r.addValue(h,b.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),w)}for(var s,l,u=++t,c=ta;;){var d=e.charAt(u);switch(d){case"=":if(c===Or)s=e.slice(t,u),c=ra;else if(c===Fn)c=ra;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===ra||c===Or)if(c===Or&&(a.warning('attribute value must after "="'),s=e.slice(t,u)),t=u+1,u=e.indexOf(d,t),u>0)l=e.slice(t,u),o(s,l,t-1),c=Ln;else throw new Error("attribute value no end '"+d+"' match");else if(c==xn)l=e.slice(t,u),o(s,l,t),a.warning('attribute "'+s+'" missed start quot('+d+")!!"),t=u+1,c=Ln;else throw new Error('attribute value must after "="');break;case"/":switch(c){case ta:r.setTagName(e.slice(t,u));case Ln:case na:case Lo:c=Lo,r.closed=!0;case xn:case Or:break;case Fn:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),c==ta&&r.setTagName(e.slice(t,u)),u;case">":switch(c){case ta:r.setTagName(e.slice(t,u));case Ln:case na:case Lo:break;case xn:case Or:l=e.slice(t,u),l.slice(-1)==="/"&&(r.closed=!0,l=l.slice(0,-1));case Fn:c===Fn&&(l=s),c==xn?(a.warning('attribute "'+l+'" missed quot(")!'),o(s,l,t)):((!ia.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&a.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),o(l,l,t));break;case ra:throw new Error("attribute value missed!!")}return u;case"\x80":d=" ";default:if(d<=" ")switch(c){case ta:r.setTagName(e.slice(t,u)),c=na;break;case Or:s=e.slice(t,u),c=Fn;break;case xn:var l=e.slice(t,u);a.warning('attribute "'+l+'" missed quot(")!!'),o(s,l,t);case Ln:c=na;break}else switch(c){case Fn:var f=r.tagName;(!ia.isHTML(n[""])||!s.match(/^(?:disabled|checked|selected)$/i))&&a.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),o(s,s,t),t=u,c=Or;break;case Ln:a.warning('attribute space is required"'+s+'"!!');case na:c=Or,t=u;break;case ra:c=xn,t=u;break;case Lo:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function Wm(e,t,r){for(var n=e.tagName,i=null,d=e.length;d--;){var a=e[d],o=a.qName,s=a.value,f=o.indexOf(":");if(f>0)var l=a.prefix=o.slice(0,f),u=o.slice(f+1),c=l==="xmlns"&&u;else u=o,l=null,c=o==="xmlns"&&"";a.localName=u,c!==!1&&(i==null&&(i={},Hm(r,r={})),r[c]=i[c]=s,a.uri=ia.XMLNS,t.startPrefixMapping(c,s))}for(var d=e.length;d--;){a=e[d];var l=a.prefix;l&&(l==="xml"&&(a.uri=ia.XML),l!=="xmlns"&&(a.uri=r[l||""]))}var f=n.indexOf(":");f>0?(l=e.prefix=n.slice(0,f),u=e.localName=n.slice(f+1)):(l=null,u=e.localName=n);var h=e.uri=r[l||""];if(t.startElement(h,u,n,e),e.closed){if(t.endElement(h,u,n),i)for(l in i)Object.prototype.hasOwnProperty.call(i,l)&&t.endPrefixMapping(l)}else return e.currentNSMap=r,e.localNSMap=i,!0}function $P(e,t,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var a=e.indexOf("</"+r+">",t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(r)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,n),i.characters(o,0,o.length),a)}return t+1}function VP(e,t,r,n){var i=n[r];return i==null&&(i=e.lastIndexOf("</"+r+">"),i<t&&(i=e.lastIndexOf("</"+r)),n[r]=i),i<t}function Hm(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}function GP(e,t,r,n){var i=e.charAt(t+2);switch(i){case"-":if(e.charAt(t+3)==="-"){var a=e.indexOf("-->",t+4);return a>t?(r.comment(e,t+4,a-t-4),a+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(e.substr(t+3,6)=="CDATA["){var a=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,a-t-9),r.endCDATA(),a+3}var o=WP(e,t),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var l=o[1][0],u=!1,c=!1;s>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],c=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var d=o[s-1];return r.startDTD(l,u,c),r.endDTD(),d.index+d[0].length}}return-1}function zP(e,t,r){var n=e.indexOf("?>",t);if(n){var i=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(i){var a=i[0].length;return r.processingInstruction(i[1],i[2]),n+2}else return-1}return-1}function Jm(){this.attributeNames={}}Jm.prototype={setTagName:function(e){if(!Gm.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!Gm.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function WP(e,t){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);r=i.exec(e);)if(n.push(r),r[1])return n}Gu.XMLReader=jm;Gu.ParseError=Mn});var rh=m(Uo=>{var jP=Ji(),HP=$u(),Xm=$m(),Zm=Qm(),JP=HP.DOMImplementation,Km=jP.NAMESPACE,QP=Zm.ParseError,XP=Zm.XMLReader;function eh(e){return e.replace(/\r[\n\u0085]/g,`
`).replace(/[\r\u0085\u2028]/g,`
-`)}function eh(e){this.options=e||{locator:{}}}eh.prototype.parseFromString=function(e,t){var r=this.options,n=new JP,i=r.domBuilder||new aa,a=r.errorHandler,o=r.locator,s=r.xmlns||{},l=/\/x?html?$/.test(t),u=l?Qm.HTML_ENTITIES:Qm.XML_ENTITIES;o&&i.setDocumentLocator(o),n.errorHandler=QP(a,i,o),n.domBuilder=r.domBuilder||i,l&&(s[""]=Xm.HTML),s.xml=s.xml||Xm.XML;var c=r.normalizeLineEndings||Zm;return e&&typeof e=="string"?n.parse(c(e),s,u):n.errorHandler.error("invalid doc source"),i.doc};function QP(e,t,r){if(!e){if(t instanceof aa)return t;e=t}var n={},i=e instanceof Function;r=r||{};function a(o){var s=e[o];!s&&i&&(s=e.length==2?function(l){e(o,l)}:e),n[o]=s&&function(l){s("[xmldom "+o+"] "+l+zu(r))}||function(){}}return a("warning"),a("error"),a("fatalError"),n}function aa(){this.cdata=!1}function Un(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}aa.prototype={startDocument:function(){this.doc=new jP().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var i=this.doc,a=i.createElementNS(e,r||t),o=n.length;Lo(this,a),this.currentElement=a,this.locator&&Un(this.locator,a);for(var s=0;s<o;s++){var e=n.getURI(s),l=n.getValue(s),r=n.getQName(s),u=i.createAttributeNS(e,r);this.locator&&Un(n.getLocator(s),u),u.value=u.nodeValue=l,a.setAttributeNode(u)}},endElement:function(e,t,r){var n=this.currentElement,i=n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&Un(this.locator,r),Lo(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=Km.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else var n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Un(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,r){e=Km.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Un(this.locator,n),Lo(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(e,t,r);this.locator&&Un(this.locator,i),Lo(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning] "+e,zu(this.locator))},error:function(e){console.error("[xmldom error] "+e,zu(this.locator))},fatalError:function(e){throw new HP(e,this.locator)}};function zu(e){if(e)return`
-@`+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Km(e,t,r){return typeof e=="string"?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){aa.prototype[e]=function(){return null}});function Lo(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Mo.__DOMHandler=aa;Mo.normalizeLineEndings=Zm;Mo.DOMParser=eh});var Wu=m(Uo=>{var rh=$u();Uo.DOMImplementation=rh.DOMImplementation;Uo.XMLSerializer=rh.XMLSerializer;Uo.DOMParser=th().DOMParser});var nh=m(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.deleteAppCascade=void 0;var XP=_u(),ju=Bi(),KP=be(),Bo=ue(),YP=Wu();function Hu(e){return e instanceof Error?e:new Error(String(e))}function ZP(e){let t=[],r=s=>l=>t.push(`${s}: ${l}`),i=new YP.DOMParser({errorHandler:{warning:r("warning"),error:r("error"),fatalError:r("fatalError")}}).parseFromString(e,"text/xml").documentElement;if(!i||t.length>0)throw new KP.InvalidArgumentError(`The app sitemap xml could not be parsed cleanly, so its generative-page children cannot be determined${t.length>0?` (${t[0]})`:""}`);let a=[],o=s=>{if(s.nodeName==="SubArea"){let u=s.getAttribute("GenPageId");u&&a.push((0,Bo.normalizeGuid)(u,"GenPageId"))}let l=s.childNodes;for(let u=0;u<l.length;u+=1){let c=l[u];c.nodeType===1&&o(c)}};return o(i),a}async function eO(e,t,r){let n=(0,Bo.normalizeGuid)(t,"appModuleId");(0,Bo.normalizeGuid)(r,"appModuleIdUnique");let i=[],a=[],o=[];await(0,XP.deleteAppResolvingOnce)(e,n,s=>{s!==void 0&&o.push(...ZP(s))}),i.push({type:"app",id:n});for(let s of new Set(o)){let l;try{l=await(0,ju.queryAllRecords)(e,"uxagentprojectfile",{select:["uxagentprojectfileid"],filter:`_uxagentprojectid_value eq ${s}`})}catch(u){a.push({operation:"resolve",type:"genPageFile",id:s,error:Hu(u)});continue}for(let u of l??[]){let c="";try{c=(0,Bo.normalizeGuid)(String(u.uxagentprojectfileid),"uxagentprojectfileid"),await(0,ju.deleteRecord)(e,"uxagentprojectfile",c),i.push({type:"genPageFile",id:c})}catch(d){a.push({operation:"delete",type:"genPageFile",id:c,error:Hu(d)})}}try{await(0,ju.deleteRecord)(e,"uxagentproject",s),i.push({type:"genPage",id:s})}catch(u){a.push({operation:"delete",type:"genPage",id:s,error:Hu(u)})}}return{success:a.length===0,deleted:i,failures:a}}ko.deleteAppCascade=eO});var ih={};Bt(ih,{Guid:()=>I});var I,Se=D(()=>{"use strict";I=class e{guidString;guid;static get EmptyGuid(){return new e("00000000-0000-0000-0000-000000000000")}static NewGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=Math.random()*16|0,n=t=="x"?r:r&3|8;return n.toString(16)})}constructor(t,r=!1){this.guidString=t;let n=new RegExp("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");(r||n.test(t))&&(this.guid=t)}ToString(){return this.guid}}});var P,ze=D(()=>{"use strict";Ce();P=class e{static get EmptyString(){return""}static IsTrue(t){let r=!1;return r=t&&(this.IsStrictTrue(t)||this.IsYes(t)),r}static IsStrictTrue(t){let r=!1;return t&&(r=t.toLowerCase()==="true"),r}static IsYes(t){return t.toLowerCase()==="yes"||t.toLowerCase()==="y"}static get WhiteSpace(){return/ /g}static get EnglishAndNumericCharacters(){return/([a-z0-9A-Z]+)/g}static get ValidIdExpression(){return/([a-z0-9A-Z_]+)/g}static IsNullOrEmpty(t){return t==null||t==null||t==""}static Format(t,r){return e.IsNullOrEmpty(t)?t:t.replace(/\{\{|\}\}|\{(\d+)\}/g,function(n,i){return n=="{{"?"{":n=="}}"?"}":r[i]})}static EndsWithString(t,r){return t.indexOf(r,t.length-r.length)!==-1}static IsBlankString(t){return t.replace(/\s/g,"").length==0}static EscapeXml(t,r){let n=t;return this.IsNullOrEmpty(n)||(n=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r&&(n=n.replace(/"/g,"&quot;").replace(/'/g,"&apos;"))),n}static EscapeDomId(t){return t.replace(".","\\.")}static ToSnakeCase(t){let r=e.EmptyString;for(let n=0;n<t.length;n++)n!==0&&t[n]==t[n].toUpperCase()&&(r+="-"),r+=t[n].toLowerCase();return r}static GetSnakeCaseMarkup(t,r){let n="<"+this.ToSnakeCase(t);if(!S.IsNullOrUndefined(r))for(let i of r.getKeys())n+=" "+this.ToSnakeCase(i)+'="'+r.getValue(i)+'"';return n+">"}static StripBraces(t){return t&&t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?t.substr(1,t.length-2):t}static AddBraces(t){return S.IsNullOrUndefined(t)||t.charAt(0)==="{"||t.charAt(t.length-1)==="}"?t:`{${t}}`}static GuidStringEquals(t,r){return t===r?!0:!t||!r?!1:e.StripBraces(t).toUpperCase()===e.StripBraces(r).toUpperCase()}static AddBracesToArrayValues(t){return t.length>0?t.map(n=>(n.charAt(0)!=="{"&&(n="{"+n),n.charAt(n.length-1)!=="}"&&(n=n+"}"),n)):t}static StripBracesOnArrayValues(t){return t.length>0?t.map(n=>{let i;return n.charAt(0)==="{"&&(i=n.substr(1,n.length-1)),n.charAt(n.length-1)==="}"&&(i=i.substr(0,n.length-2)),i}):t}}});var ah={};Bt(ah,{ScriptUtilities:()=>S});var S,Ce=D(()=>{"use strict";Se();ze();S=class e{static IsNullOrUndefined(t){return t==null||t===void 0}static IsMacMachine(){return navigator.platform.indexOf("Mac")!==-1}static IsNullOrEmptyGuid(t){return P.IsNullOrEmpty(t.ToString())?!0:I.EmptyGuid.ToString()===t.ToString()}static IsNullOrUndefinedNested(t,r){return r.split(".").every(i=>typeof t!="object"||t==null||!(i in t)||t[i]==null?!1:(t=t[i],!0))}static ParseXml(t){return new DOMParser().parseFromString(t,"text/xml")}static IsWellFormedXml(t){return!e.ParseXml(t).querySelector("parsererror")}static getNamedItemValue(t,r){let n=t.getNamedItem(r);return e.IsNullOrUndefined(n)?null:n.value}static getBooleanValue(t,r){let n=e.getNamedItemValue(t,r);return e.IsNullOrUndefined(n)?null:P.IsTrue(n)}static getNumericValue(t){return e.IsNullOrUndefined(t)?null:parseInt(t)}static getAllUniqueTagNames(t){let r=new Set;return e.getAllUniqueTagNamesHelper(t,r),r}static getAllUniqueTagNamesHelper(t,r){if(t.nodeType===Node.ELEMENT_NODE&&(r.add(t.tagName),t.hasChildNodes()))for(let n=0;n<t.children.length;n++)this.getAllUniqueTagNamesHelper(t.children.item(n),r)}}});var qo,$o,Yr,Vo,Ju,Go,Qu=D(()=>{"use strict";(function(e){e[e.FormElementNodeChange=0]="FormElementNodeChange",e[e.FormElementAttributeChange=1]="FormElementAttributeChange"})(qo||(qo={}));$o=class{type;targetNode;constructor(t,r){this.type=t,this.targetNode=r}},Yr=class extends $o{key;oldValue;newValue;constructor(t,r,n,i){super(qo.FormElementNodeChange,t),this.key=r,this.oldValue=n,this.newValue=i}apply(){this.targetNode.replaceObjectPropertyValue(this.key,this.newValue)}revert(){this.targetNode.replaceObjectPropertyValue(this.key,this.oldValue)}},Vo=class extends $o{property;oldValue;newValue;constructor(t,r,n,i){super(qo.FormElementAttributeChange,t),this.property=r,this.oldValue=n,this.newValue=i}apply(){this.targetNode.replaceAttributeValue(this.property,this.newValue)}revert(){this.targetNode.replaceAttributeValue(this.property,this.oldValue)}},Ju=class{changeSet;reversedChangeSet;constructor(t){this.changeSet=t,this.changeSet&&(this.reversedChangeSet=this.changeSet.slice().reverse())}length(){return this.changeSet?this.changeSet.length:0}apply(){this.changeSet&&this.changeSet.length>0&&this.changeSet.forEach(t=>{t.apply()})}revert(){this.reversedChangeSet&&this.reversedChangeSet.length>0&&this.reversedChangeSet.forEach(t=>{t.revert()})}},Go=class{isTracking;_trackedChanges;_trackedChangeSets;constructor(t=!1){this.isTracking=t,this._trackedChanges=[],this._trackedChangeSets=[]}addChange(t){this.isTracking&&this._trackedChanges.push(t)}collectChanges(){let t=new Ju(this._trackedChanges.slice());return this._trackedChanges=[],t}pushChangeSet(t){this._trackedChangeSets.push(t)}popChangeSet(){if(this._trackedChangeSets?.length>0)return this._trackedChangeSets.pop()}getChangeSets(){return this._trackedChangeSets}}});var oh={};Bt(oh,{ChartGridMode:()=>yt,ColumnLayoutWidths:()=>aO,ComponentCategory:()=>Wo,ComponentType:()=>Xu,ControlLayoutTypes:()=>nc,DisplayConditionsInfo:()=>nO,ElementNames:()=>h,ElementProperties:()=>p,ElementType:()=>Yu,EntityAttributeProperty:()=>Zu,EventType:()=>oa,FormActivationState:()=>rc,FormCanvasServiceScope:()=>vO,FormDesignerSideBarTab:()=>Ku,FormPresentation:()=>ec,FormState:()=>zo,FormType:()=>De,HeaderDensityType:()=>Fr,LookUpTable:()=>Wt,MORE_TAB_PREFIX:()=>sO,NavBarChildElementType:()=>tc,PREVIEW_ID_HEADER_FLYOUT:()=>dO,PREVIEW_ID_HEADER_OVERFLOW_BUTTON:()=>fO,PREVIEW_ID_NAVIGATION_AREA:()=>uO,PREVIEW_ID_QUICKCREATE_ROOT:()=>hO,PREVIEW_ID_TAB:()=>mO,PREVIEW_ID_TAB_LIST:()=>pO,PREVIEW_ID_TAB_PANEL:()=>cO,PropertyModelKeys:()=>oc,PropertyModelSectionKeys:()=>oO,RELATED_TAB_ID:()=>sc,RELATED_TAB_PREFIX:()=>lO,SectionDefaultProperties:()=>iO,SectionLayoutTypes:()=>pe,TabContentType:()=>ic,TabDefaultProperties:()=>Tr,TabLayoutTypes:()=>de,TelemetryPropertyNames:()=>gO,UnboundControlPropertyKeys:()=>ac,compositeAddressFields:()=>rO,compositeFieldNames:()=>ht,compositeFields:()=>tO});var De,Xu,Ku,h,p,Yu,ht,tO,rO,Zu,Wt,zo,Fr,ec,nO,tc,rc,de,iO,Tr,pe,nc,ic,aO,ac,oc,oO,oa,yt,sc,sO,lO,uO,cO,dO,pO,fO,mO,hO,gO,Wo,vO,G=D(()=>{"use strict";(function(e){e[e.Dashboard=0]="Dashboard",e[e.AppointmentBook=1]="AppointmentBook",e[e.Main=2]="Main",e[e.MiniCampaignBO=3]="MiniCampaignBO",e[e.Preview=4]="Preview",e[e.MobileExpress=5]="MobileExpress",e[e.QuickViewForm=6]="QuickViewForm",e[e.QuickCreate=7]="QuickCreate",e[e.Dialog=8]="Dialog",e[e.TaskFlowForm=9]="TaskFlowForm",e[e.InteractionCentricDashboard=10]="InteractionCentricDashboard",e[e.Card=11]="Card",e[e.MainInteractiveExperience=12]="MainInteractiveExperience",e[e.Other=100]="Other",e[e.MainBackup=101]="MainBackup",e[e.AppointmentBookBackup=102]="AppointmentBookBackup",e[e.PowerBIDashboard=103]="PowerBIDashboard"})(De||(De={}));(function(e){e[e.Form=0]="Form",e[e.Dialog=1]="Dialog"})(Xu||(Xu={}));(function(e){e[e.Components=0]="Components",e[e.Properties=1]="Properties",e[e.Relationship=2]="Relationship",e[e.BusinessRules=3]="BusinessRules"})(Ku||(Ku={}));(function(e){e.form="form",e.formTab="tab",e.formColumn="column",e.formSection="section",e.formRow="row",e.formCell="cell",e.formLabel="label",e.formControl="control",e.formEvent="event",e.dependency="dependency",e.queryStringParameter="querystringparameter",e.controlDescriptions="controlDescriptions",e.controlDescription="controlDescription",e.customControl="customControl",e.dataset="data-set",e.formFooter="footer",e.formHeader="header",e.formNavigation="Navigation",e.formTabs="tabs",e.formColumns="columns",e.formSections="sections",e.formRows="rows",e.formEvents="events",e.quickFormDependencies="externaldependencies",e.controlParameters="parameters",e.formDependencies="dependencies",e.formNavBarAreas="NavBarAreas",e.formNavBarArea="NavBarArea",e.formNavBar="NavBar",e.spacerControl="SpacerControl",e.formField="Field",e.formNavBarByRelationshipItem="NavBarByRelationshipItem",e.formNavBarItem="NavBarItem",e.Title="Title",e.Titles="Titles",e.NavigationLink="Navigation Link",e.Relationship="Relationship",e.NavigationLinkIconClass="mscrm-glyph-NavLinkIcon",e.formDisplayConditions="DisplayConditions",e.formLibraries="formLibraries",e.internalLibraries="internaljscriptfile",e.eventHandlers="Handlers",e.handler="Handler",e.library="Library",e.formRoles="Role",e.formEveryOne="Everyone",e.Handler="Handler",e.EventHandlers="Handlers",e.InternalEventHandlers="InternalHandlers",e.HiddenControl="hiddencontrols",e.EventDependencies="dependencies",e.EventDependency="dependency",e.isvisibleinmocaonly="msinternal.isvisibleinmocaonly"})(h||(h={}));p={ShowImage:"showImage",ShowNavigationbar:"shownavigationbar",MaxWidth:"maxWidth",HeaderDensityType:"headerdensity",OnLoadEvent:"onload",EventActive:"active",EventAttribute:"attribute",Relationship:"relationship",Control:"control",HandlerUniqueId:"handlerUniqueId",functionName:"functionName",libraryNameEventHandler:"libraryName",enabledForField:"enabled",passExecutionContext:"passExecutionContext",parameters:"parameters",eventFunctionName:"eventFunctionName",eventEnabled:"eventEnabled",indicationOfSubgrid:"indicationOfSubgrid",Name:"name",Type:"type",TitleResourceId:"TitleResourceId",Show:"Show",RelationshipName:"RelationshipName",Sequence:"Sequence",Area:"Area",headerPrefix:"header_",application:"application",labelId:"labelid",showbar:"showbar",layout:"layout",classid:"classid",uniqueid:"uniqueid",isUnbound:"isunbound",isRequired:"isrequired",rowspan:"rowspan",rowheight:"rowheight",colspan:"colspan",width:"width",IsUserDefined:"IsUserDefined",expanded:"expanded",related:"related",showlabel:"showlabel",locklevel:"locklevel",datafieldname:"datafieldname",formFactor:"formFactor",static:"static",disabled:"disabled",description:"description",languagecode:"languagecode",LCID:"LCID",groupName:"group",contentType:"contenttype",showCommandBar:"showcommandbar",showBody:"showbody",showTabNavigator:"showtabnavigator",userspacer:"userspacer",columnName:"columns",LabelWidth:"labelwidth",Fieldlabelalignment:"celllabelalignment",Fieldlabelposition:"celllabelposition",availableforphone:"availableforphone",Locked:"bLocked",ReadOnly:"bDisabled",visible:"visible",ForControl:"forControl",text:"Text",url:"Url",passParameters:"PassParameters",autoExpand:"AutoExpand",auto:"auto",Auto:"Auto",Fixed:"Fixed",icon:"Icon",id:"id",Id:"Id",showOnMobileClient:"ShowOnMobileClient",webResourceId:"WebResourceId",viewName:"ViewName",failureTimeField:"FailureTimeField",successCondition:"SuccessConditionName",successConditionValue:"SuccessConditionValue",failureCondition:"FailureConditionName",failureConditionValue:"FailureConditionValue",warningCondition:"WarningConditionName",warningConditionValue:"WarningConditionValue",cancelCondition:"CancelConditionName",cancelConditionValue:"CancelConditionValue",pauseCondition:"PauseConditionName",pauseConditionValue:"PauseConditionValue",filterResults:"FilterResults",autoSuggestionSource:"AutoSuggestionSource",numberOfResults:"NumberOfResults",addressField:"AddressField",displayAsCustomer360Tile:"DisplayAsCustomer360Tile",hideQuickFormBorder:"HideQuickFormBorder",quickForms:"QuickForms",entityName:"EntityName",controlMode:"ControlMode",headerColorCode:"HeaderColorCode",targetEntityType:"TargetEntityType",enableQuickFind:"EnableQuickFind",enableViewPicker:"EnableViewPicker",enableChartPicker:"EnableChartPicker",recordsPerPage:"RecordsPerPage",chartGridMode:"ChartGridMode",referencePanelSubgridIconUrl:"ReferencePanelSubgridIconUrl",referencePanelQuickFormCollectionIconUrl:"ReferencePanelQuickFormCollectionIconUrl",referencePanelSearchWidgetIconUrl:"ReferencePanelSearchWidgetIconUrl",viewId:"ViewId",isUserView:"IsUserView",enableJumpBar:"EnableJumpBar",isUserChart:"IsUserChart",viewIds:"ViewIds",filteredViewIds:"FilteredViewIds",visualizationId:"VisualizationId",teamTemplateId:"TeamTemplateId",selectDefaultLanguage:"SelectDefaultLanguage",allowChangingFiltersOnUI:"AllowChangingFiltersOnUI",enableAutoSuggestions:"EnableAutoSuggestions",enableRating:"EnableRating",searchForAutoSuggestionsUsing:"SearchForAutoSuggestionsUsing",showContextualActions:"ShowContextualActions",showDepartmentFilter:"ShowDepartmentFilter",showLanguageFilter:"ShowLanguageFilter",showRatingUsing:"ShowRatingUsing",actionList:"ActionList",Order:"Order",FallbackForm:"FallbackForm",allowSearchFilter:"allowSearchFilter",socialInstanceParameters:"<Parameters>k__BackingField",signalUrl:"SignalUrl",border:"Border",scrolling:"Scrolling",security:"Security",BingMapsAddress1Composite:"address1_composite",BingMapsAddress2Composite:"address2_composite",UrlHttpsProtocolPrefix:"https://",UrlHttpProtocolPrefix:"http://",showAll:"ShowAll",ShowFilterPane:"UClientShowFilterPane",ExpandFilterPane:"UClientExpandFilterPane",SortOption:"UClientOrderBy",DefaultModuleCreateExperience:"UClientDefaultModuleForCreateExperience",RecordPerPages:"UClientRecordPerPage",moduleList:"UClientModules",showAllModule:"Show All",showSelectedModule:"Show Selected",Ascending:"Ascending",Descending:"Descending",Activities:"Activities",Posts:"Posts",Notes:"Notes",CardForm:"CardForm",SelectActivity:"SelectActivity",DisplayActivity:"UClientDisplayActivityUsing",CreateActivity:"UClientCreateActivityUsing",DisplayActivityHeader:"UClientDisplayActivityHeaderUsing",SortTimeLine:"UClientSortActivitiesByValue",activityList:"UClientActivities",CardActivityMap:"UClientActivityCardMap",DefaultTabId:"DefaultTabId",EmailConversationView:"EmailConversationView",OrderByActivityWall:"OrderByActivityWall",ShowArticleTab:"ShowArticleTab",SortActivityWall:"SortActivityWall",TimelineUniqueName:"UClientUniqueName",SortTimeLineBy:"modifiedon",SelectActivityListDefault:"appointment",SelectCardDefault:"Select Card Form",AscendingValue:"ascending",DescendingValue:"descending",DefaultTabIdValue:"ActivitiesTab",EmailConversationViewDefault:"true",ShowArticleTabDefault:"false",SelectDefaultLanguage:"SelectDefaultLanguage",SelectDefaultLanguageValue:"00000000-0000-0000-0000-000000000000",SortActivityWallDefault:"modifiedon",RecordPerPagesDefault:"10",TimelineNameLabel:"Timeline",showSelectedActions:"Show Selected",defaultFormat:"defaultformat",fieldLabels:"fieldlabels",QuickCreateForm:"quickcreateform",QuickFormNameToIdXMLTempate:"<QuickFormId e,yname={0}>{1}</QuickFormId>",QuickFormIdListXMLTempate:"<QuickFormId,}</QuickFormIds>",AllowFilterOff:"AllowFilterOff",AutoResolve:"AutoResolve",DefaultViewId:"DefaultViewId",DependentAttributeName:"DependentAttributeName",DependentAttributeType:"DependentAttributeType",DisableMru:"DisableMru",UseMFDForCreate:"useMainFormDialogForCreate",UseMFDForEdit:"useMainFormDialogForEdit",DisableQuickFind:"DisableQuickFind",DisableViewPicker:"DisableViewPicker",FilterRelationshipName:"FilterRelationshipName",AvailableViewIds:"AvailableViewIds",MainForm:"mainform",DefaultsFields:"defaultfields",TimeLineCardForm:"cardform",libraryUniqueId:"libraryUniqueId",libraryName:"name",displayName:"displayName",OnChangeEvent:"onchange",ViewIdRAControlDefault:"{92AFD454-0F2E-4397-A1C8-05E37C6AD699}",TargetEntityTypeRAControlDefault:"actioncard",ChartGridModeRAControlDefault:"All",RecordsPerPageRAControlDefault:"4",RAControlDefaultValue:"false",RAcontrolDefaultHeaderColorCode:"#000000",DropdownSelectedDefaultValue:"1",selectPrimaryCustomer:"SelectPrimaryCustomer",bindAttribute:"BindAttribute"};(function(e){e[e.TAB=0]="TAB",e[e.SECTION=1]="SECTION",e[e.BASIC_CONTROL=2]="BASIC_CONTROL",e[e.HEADER=3]="HEADER",e[e.FOOTER=4]="FOOTER",e[e.UB_CONTROL=5]="UB_CONTROL",e[e.RELATIONSHIPITEM=6]="RELATIONSHIPITEM",e[e.RELATIONSHIPGROUP=7]="RELATIONSHIPGROUP",e[e.NAVIGATIONLINK=8]="NAVIGATIONLINK",e[e.FORMMODEL=9]="FORMMODEL",e[e.UNDEFINED=10]="UNDEFINED"})(Yu||(Yu={}));ht={fullname:"fullname",yomifullname:"yomifullname",address1_composite:"address1_composite",address2_composite:"address2_composite",address3_composite:"address3_composite",billto:"billto_composite",shipto:"shipto_composite"},tO=[ht.fullname,ht.yomifullname,ht.address1_composite,ht.address2_composite,ht.address3_composite,ht.billto,ht.shipto],rO=[ht.address1_composite,ht.address2_composite,ht.address3_composite,ht.billto,ht.shipto];(function(e){e[e.IsValidForForm=0]="IsValidForForm",e[e.IsValidForCreate=1]="IsValidForCreate"})(Zu||(Zu={}));(function(e){e[e.DependencyFieldTable=0]="DependencyFieldTable",e[e.LockedFieldTable=1]="LockedFieldTable"})(Wt||(Wt={}));(function(e){e[e.Published=0]="Published",e[e.Draft=1]="Draft",e[e.New=2]="New",e[e.SaveAs=3]="SaveAs"})(zo||(zo={}));(function(e){e.Low="Low",e.HighReadOnlyValues="HighReadOnlyValues",e.HighWithControls="HighWithControls"})(Fr||(Fr={}));(function(e){e[e.ClassicForm=0]="ClassicForm",e[e.AirForm=1]="AirForm",e[e.ConvertedICForm=2]="ConvertedICForm"})(ec||(ec={}));nO={TopOrderFormId:"topOrderFormId",NextDisplayOrder:"nextDisplayOrder"};(function(e){e[e.NavBarRelationShipItem=0]="NavBarRelationShipItem",e[e.NavBarItem=1]="NavBarItem"})(tc||(tc={}));(function(e){e[e.InActive=0]="InActive",e[e.Active=1]="Active"})(rc||(rc={}));(function(e){e[e.ONE_COLUMN=0]="ONE_COLUMN",e[e.TWO_COLUMN_EQUAL=1]="TWO_COLUMN_EQUAL",e[e.TWO_COLUMN_WIDER_LEFT=2]="TWO_COLUMN_WIDER_LEFT",e[e.TWO_COLUMN_WIDER_RIGHT=3]="TWO_COLUMN_WIDER_RIGHT",e[e.TWO_COLUMN_CUSTOM_LAYOUT=4]="TWO_COLUMN_CUSTOM_LAYOUT",e[e.THREE_COLUMN_EQUAL=5]="THREE_COLUMN_EQUAL",e[e.THREE_COLUMN_WIDER_MID=6]="THREE_COLUMN_WIDER_MID",e[e.THREE_COLUMN_CUSTOM_LAYOUT=7]="THREE_COLUMN_CUSTOM_LAYOUT"})(de||(de={}));iO={ShowLabel:"false",LockLevel:"0",IsUserDefined:"0",LabelWidth:"115",columns:"1",ShowBar:"false",Layout:"varwidth",namePrefix:"_section_"},Tr={namePrefix:"tab_",ShowLabel:"true",LockLevel:"0",IsUserDefined:"0"};(function(e){e[e.ONE_COLUMN=0]="ONE_COLUMN",e[e.TWO_COLUMN=1]="TWO_COLUMN",e[e.THREE_COLUMN=2]="THREE_COLUMN",e[e.FOUR_COLUMN=3]="FOUR_COLUMN",e[e.REFERENCE_PANEL=4]="REFERENCE_PANEL"})(pe||(pe={}));(function(e){e[e.SUBGRID=0]="SUBGRID",e[e.SPACER=1]="SPACER",e[e.QUICK_VIEW=2]="QUICK_VIEW",e[e.WEB_RESOURCE=3]="WEB_RESOURCE",e[e.IFRAME=4]="IFRAME",e[e.BING_MAPS=5]="BING_MAPS",e[e.TIMER=6]="TIMER",e[e.TIMELINE=7]="TIMELINE",e[e.NOTES=8]="NOTES",e[e.SOCIAL_INSIGHTS=9]="SOCIAL_INSIGHTS",e[e.KB_SEARCH=10]="KB_SEARCH",e[e.INTERACTION_WALL=11]="INTERACTION_WALL",e[e.ACI_CONTROL=12]="ACI_CONTROL",e[e.RELATIONSHIP_ASSISTANT=13]="RELATIONSHIP_ASSISTANT",e[e.REFERENCE_PANEL=14]="REFERENCE_PANEL",e[e.REF_PANEL_QUICKVIEW=15]="REF_PANEL_QUICKVIEW",e[e.REF_PANEL_SUBGRID=16]="REF_PANEL_SUBGRID",e[e.REF_PANEL_KBSEARCH=17]="REF_PANEL_KBSEARCH",e[e.WEB_RESOURCE_HTML=18]="WEB_RESOURCE_HTML",e[e.PRED_LEAD_SCORING=19]="PRED_LEAD_SCORING"})(nc||(nc={}));(function(e){e.cardSections="cardSections",e.singleComponent="singleComponent",e.default="default",e.expandAvailableSpace="expandAvailableSpace"})(ic||(ic={}));aO={ONE_COLUMN:"100",TWO_COLUMN:"50",THREE_COLUMN:"33.33",FOUR_COLUMN:"25"};(function(e){e.minValue="MinValue",e.maxValue="MaxValue",e.precision="Precision",e.maxLength="MaxLength",e.entityLogicalName="EntityLogicalName",e.defaultViewId="DefaultViewId",e.optionSetDefaultValue="DefaultValue",e.optionSetId="OptionSetId"})(ac||(ac={}));(function(e){e.entityName="entityName",e.formName="formName",e.formDisplayName="formDisplayName",e.description="description",e.maxWidth="maxWidth",e.showNavigation="showNavigation",e.showImageCheck="showImageCheck",e.downloadFormXml="downloadFormXml",e.downloadRawFormXml="downloadRawFormXml",e.expandTab="expandTab",e.singleComponent="singleComponent",e.label="label",e.name="name",e.hiddenByDefault="hiddenByDefault",e.hideForPhone="hideForPhone",e.tabLayout="tabLayout",e.column1Width="column1Width",e.column2Width="column2Width",e.column3Width="column3Width",e.hideLabel="hideLabel",e.lockElement="lockElement",e.sectionLayout="sectionLayout",e.labelWidth="labelWidth",e.fieldLabelAlignment="fieldLabelAlignment",e.fieldLabelPosition="fieldLabelPosition",e.cellWidth="cellWidth",e.fieldHeight="fieldHeight",e.cellHeight="cellHeight",e.showLine="showLine",e.readonly="readonly",e.required="required",e.maxLength="maxLength",e.isTitle="isTitle",e.minValue="minValue",e.maxValue="maxValue",e.precision="precision",e.autoExpand="autoExpand",e.highDensityEnabled="highDensityEnabled",e.hideExtendedHeader="hideExtendedHeader",e.defaultViewProperty="defaultViewProperty",e.defaultChartProperty="defaultChartProperty",e.teamTemplateProperty="teamTemplateProperty",e.datasourceProperty="datasourceProperty",e.eventType="eventType",e.addEvent="addEvent",e.cellOnChange="cellOnChange",e.cellOnChangeEventDependencies="cellOnChangeEventDependencies",e.cellOnChangeHandlers="cellOnChangeHandlers",e.gridOnChange="gridOnChange",e.gridOnChangeEventDependencies="gridOnChangeEventDependencies",e.gridOnChangeHandlers="gridOnChangeHandlers",e.gridOnChangeTargetField="gridOnChangeTargetField",e.gridOnRecordSelect="gridOnRecordSelect",e.gridOnRecordSelectEventDependencies="gridOnRecordSelectEventDependencies",e.gridOnRecordSelectHandlers="gridOnRecordSelectHandlers",e.cellOnReadyStateEventDependencies="cellOnReadyStateEventDependencies",e.cellOnReadyStateHandlers="cellOnReadyStateEventHandlers",e.tabOnChange="tabOnChange",e.tabOnChangeEventDependencies="tabOnChangeEventDependencies",e.tabOnChangeHandlers="tabOnChangeHandlers",e.formOnLoad="formOnLoad",e.formOnLoadEventDependencies="formOnLoadEventDependencies",e.formOnLoadHandlers="formOnLoadHandlers",e.formOnSave="formOnSave",e.formOnSaveDependencies="formOnSaveDependencies",e.formOnSaveHandlers="formOnSaveHandlers",e.gridOnSave="gridOnSave",e.gridOnSaveDependencies="gridOnSaveDependencies",e.gridOnSaveHandlers="gridOnSaveHandlers",e.formHasNoLibraries="formHasNoLibraries",e.hideHeaderCommandBar="hideHeaderCommandBar",e.hideHeaderBody="hideHeaderBody",e.hideHeaderTabNavigator="hideHeaderTabNavigator",e.hideFooter="hideFooter",e.scrollingDropdown="scrollingDropdown",e.displayBorder="displayBorder",e.crossScripting="crossScripting",e.passParams="passParams",e.webResourceCustomParamData="webResourceCustomParameterData",e.webResourceAltText="webResourceAltText",e.verticalAlignment="verticalAlignment",e.horizontalAlignment="horizontalAlignment",e.specificSize="specificSize",e.urlProperty="urlProperty",e.enableViewPicker="enableViewPicker",e.enableChartPicker="enableChartPicker",e.chartGridMode="chartGridMode",e.relatedRecords="relatedRecords",e.hideSearchBox="hideSearchBox",e.showAllViews="showAllViews",e.availableViewsProperty="availableViewsProperty",e.recordsPerPage="recordsPerPage",e.businessRulePill="business-rule-pill-",e.addBusinessRule="addBusinessRule",e.rowHeight="rowHeight",e.refPanelSectionTabs="refPanelSectionTabs",e.editCanvasAppProperty="editCanvasAppProperty"})(oc||(oc={}));oO={display:"DisplayOptions",format:"Formatting",control:"Controls",data:"DataOptions",form:"FormProperties",events:"EventProperties",activeBusinessRules:"activeBusinessRules",addBusinessRule:"addBusinessRule",inactiveBusinessRules:"inactiveBusinessRules"};(function(e){e.onChange="onchange",e.onTabStateChange="tabstatechange",e.onLoad="onload",e.onSave="onsave",e.onReadyStateComplete="onreadystatecomplete",e.onRecordSelect="onrecordselect"})(oa||(oa={}));(function(e){e.All="All",e.Chart="Chart",e.Grid="Grid"})(yt||(yt={}));sc="tab_related3b554255-7717-4d17-bb7f-9936fb1e75ca",sO="more_tab_",lO="related_tab_",uO="preview_id_navigation_area",cO="tab-section",dO="headerFieldsFlyout",pO="tablist",fO="header_overflowButton",mO="tab",hO="quickCreateRoot",gO={defaultVisibility:"Default visibility"};(function(e){e.input="input",e.layout="layout",e.grid="grid",e.relatedData="relatedData",e.display="display",e.powerbi="powerbi",e.artificialIntelligence="artificialIntelligence",e.media="media",e.collaboration="collaboration",e.more="more",e.test="test",e.popular="popular"})(Wo||(Wo={}));vO="CellCanvasServiceScope"});var sh={};Bt(sh,{Attribute:()=>jo,FormElementNode:()=>q});var jo,q,xe=D(()=>{"use strict";Ce();ze();Qu();G();Se();jo=class{key;value;constructor(t,r){this.key=t,this.value=r}},q=class e{nodeName;properties;childrenNodes;parentNode;nodeId;isTransient;constructor(t,r){this.nodeName=t,this.properties=[],this.childrenNodes=[],this.parentNode=r,this.isTransient=!1,this.nodeId=`nodeId-${I.NewGuid()}`}getProperty(t){for(let r of this.properties)if(r.key===t)return r.value;return null}getNodeId(){return this.nodeId}getNodeName(){return this.nodeName}setNodeName(t){this.trackObjectPropertyChange("nodeName",t)}get NodeName(){return this.getNodeName()}getAllProperties(){return this.properties}replaceAttributeValue(t,r){this.properties.find(n=>n===t)&&(t.value=r)}replaceObjectPropertyValue(t,r){this[t]=r}getAllChildren(){return this.childrenNodes}getParentNode(){return this.parentNode}visit(t){let r=!1;if(t){r=!!t(this);let n=this.childrenNodes;if(!r&&n)for(let i=0;!r&&i<n.length;i++)r=n[i].visit(t)}return r}findAll(t){let r=[];return t&&this.visit(n=>{t(n)&&r.push(n)}),r}findFirst(t){let r=null;return t&&this.visit(n=>{if(t(n))return r=n,!0}),r}raiseMetadataChange(t){let r=this.getAncestor(h.form);r&&r.raiseMetadataChange(t)}trackPropertyAddition(t,r){this.trackPropertyCollectionChange(()=>{this.properties.push(new jo(t,r))})}trackPropertyDeletion(t){this.trackPropertyCollectionChange(()=>{let r=this.properties.findIndex(n=>n.key===t);r>-1&&this.properties.splice(r,1)})}trackPropertyCollectionChange(t){let r=this.changeTracker();if(r&&r.isTracking){let n=this.properties.slice();t(),r.addChange(new Yr(this,"properties",n,this.properties.slice()))}else t()}trackChildrenCollectionChange(t){let r=this.changeTracker();if(r&&r.isTracking){let n=this.childrenNodes.slice();t(),r.addChange(new Yr(this,"childrenNodes",n,this.childrenNodes.slice()))}else t()}trackParentNodeChange(t){let r=this.changeTracker();if(r&&r.isTracking){let n=this.parentNode;if(t(),n===this.parentNode)return;r.addChange(new Yr(this,"parentNode",n,this.parentNode))}else t()}trackAttributeValueChange(t,r){let n=this.changeTracker();if(n&&n.isTracking){let i=t.value;if(i===r)return;t.value=r,n.addChange(new Vo(this,t,i,r))}else t.value=r}trackObjectPropertyChange(t,r){let n=this.changeTracker();if(n&&n.isTracking){let i=this[t];if(i===r)return;this[t]=r,n.addChange(new Yr(this,t,i,r))}else this[t]=r}setProperty(t,r){if(!t)throw new Error("Invalid property key");let n=this.properties.find(i=>i.key===t);n?this.trackAttributeValueChange(n,r):this.addProperty(t,r)}addProperty(t,r){if(!t)throw new Error("Invalid property key");this.trackPropertyAddition(t,r)}removeProperty(t){this.trackPropertyDeletion(t)}addChild(t){t.trackParentNodeChange(()=>{t.parentNode=this}),this.trackChildrenCollectionChange(()=>{this.childrenNodes.push(t)})}insertChildAtIndex(t,r){S.IsNullOrUndefined(t)||(t.trackParentNodeChange(()=>{t.parentNode=this}),this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(r,0,t)}))}moveChild(t,r){let n=this.childrenNodes.indexOf(t);if(n<0)return!1;let i=Math.min(Math.max(0,n+r),this.childrenNodes.length-1);return n!==i&&this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(i,0,this.childrenNodes.splice(n,1)[0])}),!0}getChildren(t){let r=[];for(let n of this.childrenNodes)n.nodeName===t&&r.push(n);return r}getFirstChild(t){for(let r of this.childrenNodes)if(r.nodeName===t)return r;return null}getAllGrandChildren(t){let r=this.getChildren(t),n=null;return r.length===0?new Array:(n=r[0],n.childrenNodes)}deleteChild(t){if(S.IsNullOrUndefined(t))return-1;for(let r=0;r<this.childrenNodes.length;r++)if(this.childrenNodes[r]===t)return this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(r,1)}),r;return-1}deleteAllChildren(){this.trackChildrenCollectionChange(()=>{this.childrenNodes=[]})}getParent(){return this.parentNode}getParentType(){return this.parentNode?this.parentNode.nodeName:P.EmptyString}updateChild(t,r){let n=this.childrenNodes.indexOf(t);return n>-1?(r.trackParentNodeChange(()=>{r.parentNode=this}),this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(n,1,r)}),!0):!1}getAncestor(t){let r=this.getParent(),n=this.getParentType();for(;r;){if(n===t)return r;n=r.getParentType(),r=r.getParent()}return null}deleteFirstGrandChildOfName(t,r){return this.getChildren(t)[0].deleteChild(r)}deleteChildren(t,r){r=S.IsNullOrUndefined(r)?this.childrenNodes.length:r,this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(t,r)})}deleteGrandChildren(t,r,n){this.getChildren(t)[0].deleteChildren(r,n)}addGrandChild(t,r){let n=this.getChildren(t),i=null;n.length===0?(i=new e(t,this),this.addChild(i)):i=n[0],i.addChild(r)}addGrandChildAtIndex(t,r,n){let i=this.getChildren(t),a=null;i.length===0?(a=new e(t,this),this.addChild(a)):a=i[0],a.insertChildAtIndex(r,n)}GetPropertyByParameter(t){return this.getProperty(t)}getSemanticParent(){switch(this.getNodeName()){case h.formCell:let t=this.getAncestor(h.formSection);return t||(t=this.getAncestor(h.formHeader),t)||(t=this.getAncestor(h.formFooter),t)?t:null;case h.formSection:return this.getAncestor(h.formTab);case h.formTab:return this.getAncestor(h.form);default:return null}}isDirty(){return this.visit(t=>t.isInChangeSet())}isInChangeSet(){return this.changeTracker().getChangeSets().some(r=>r.changeSet.some(n=>n.targetNode.getNodeId()===this.getNodeId()))}changeTracker(){let t=this.getAncestor(h.form);return t?t.changeTracker():null}}});var lh={};Bt(lh,{ControlClassId:()=>A,ControlNamePrefixes:()=>Ho,getControlDisplayNames:()=>bO});function bO(e){return{[A.AccessPrivilegeControl]:e("controls.controlNames.accessPrivilege"),[A.AccessTeamTablePickerControl]:e("controls.controlNames.accessTeamTablePicker"),[A.ACIControl]:e("controls.controlNames.aci"),[A.ActivitiesContainerControl]:e("controls.controlNames.activitiesContainer"),[A.ActivitiesWallControl]:e("controls.controlNames.activitiesWall"),[A.AppliedFiltersControl]:e("controls.controlNames.appliedFilters"),[A.ArticleContentControl]:e("controls.controlNames.articleContent"),[A.BooleanControl]:e("controls.controlNames.twoOption"),[A.ButtonControl]:e("controls.controlNames.button"),[A.CheckboxControl]:e("controls.controlNames.checkbox"),[A.CompositionLinkControl]:e("controls.controlNames.compositionLink"),[A.ConnectionControl]:e("controls.controlNames.connection"),[A.ConnectionRoleObjectTypeListControl]:e("controls.controlNames.connectionRoleObjectTypeList"),[A.CoverageChoiceControl]:e("controls.controlNames.coverageChoice"),[A.DashboardControl]:e("controls.controlNames.dashboard"),[A.DynamicPropertyListControl]:e("controls.controlNames.dynamicPropertyList"),[A.EditFilterControl]:e("controls.controlNames.editFilter"),[A.ErrorStatusControl]:e("controls.controlNames.errorStatus"),[A.GlobalFilterControl]:e("controls.controlNames.globalFilter"),[A.HiddenInputControl]:e("controls.controlNames.hiddenInput"),[A.KBViewerControl]:e("controls.controlNames.kbViewer"),[A.LabelControl]:e("controls.controlNames.label"),[A.MailMergeLanguagePickerControl]:e("controls.controlNames.mailMergeLanguagePicker"),[A.MapLinkControl]:e("controls.controlNames.mapLink"),[A.OrgInsightsControl]:e("controls.controlNames.orgInsights"),[A.ChoiceLookupControl]:e("controls.controlNames.choiceLookup"),[A.PowerBIControl]:e("controls.controlNames.powerBI"),[A.ProcessControl]:e("controls.controlNames.process"),[A.RelatedInformationControl]:e("controls.controlNames.relatedInformation"),[A.RelationshipRoleChoiceControl]:e("controls.controlNames.relationshipRoleChoice"),[A.ReportControl]:e("controls.controlNames.report"),[A.StreamsControl]:e("controls.controlNames.streams"),[A.WebResourceSilverlightControl]:e("controls.controlNames.webResourceSilverlight"),[A.CurrencyControl]:e("controls.controlNames.currency"),[A.DateTimeControl]:e("controls.controlNames.dateAndTime"),[A.DecimalControl]:e("controls.controlNames.decimal"),[A.DurationControl]:e("controls.controlNames.duration"),[A.EmailAddressControl]:e("controls.controlNames.email"),[A.FileControl]:e("controls.controlNames.file"),[A.FloatingNumberControl]:e("controls.controlNames.floatingNumber"),[A.IframeControl]:e("controls.controlNames.iframe"),[A.ImageControl]:e("controls.controlNames.image"),[A.LookupControl]:e("controls.controlNames.lookup"),[A.MapsControl]:e("controls.controlNames.maps"),[A.PhoneNumberControl]:e("controls.controlNames.phoneNumber"),[A.ChoiceControl]:e("controls.controlNames.choice"),[A.QuickViewControl]:e("controls.controlNames.quickView"),[A.QuickFormControl]:e("controls.controlNames.quickForm"),[A.CustomControl]:e("controls.controlNames.customControl"),[A.SearchWidgetControl]:e("controls.controlNames.searchWidget"),[A.SocialInsightsControl]:e("controls.controlNames.socialInsights"),[A.SubgridControl]:e("controls.controlNames.subgrid"),[A.TextAreaControl]:e("controls.controlNames.textArea"),[A.TextboxControl]:e("controls.controlNames.textBox"),[A.TickerControl]:e("controls.controlNames.ticker"),[A.UrlControl]:e("controls.controlNames.url"),[A.WebResourceHTMLControl]:e("controls.controlNames.webResourceHTML"),[A.WebResourceImageControl]:e("controls.controlNames.webResourceImage"),[A.IntegerControl]:e("controls.controlNames.integer"),[A.TimerControl]:e("controls.controlNames.timer"),[A.TimelineControl]:e("controls.controlNames.timeline"),[A.EmailBodyControl]:e("controls.controlNames.emailBody"),[A.PartyListControl]:e("controls.controlNames.partyList"),[A.TimezoneControl]:e("controls.controlNames.timezone"),[A.LanguageControl]:e("controls.controlNames.language"),[A.ChoiceStatusControl]:e("controls.controlNames.choiceStatus"),[A.ChoicesControl]:e("controls.controlNames.choices"),[A.RegardingControl]:e("controls.controlNames.regarding"),[A.EmailEngagementActionsControl]:e("controls.controlNames.emailEngagementActions"),[A.EmailRecipientActivityControl]:e("controls.controlNames.emailRecipientActivity"),[A.ReferencePanelSearchWidgetControl]:e("controls.controlNames.referencePanelSearchWidget"),[A.ReferencePanelQuickViewControl]:e("controls.controlNames.referencePanelQuickView"),[A.ReferencePanelSubgridControl]:e("controls.controlNames.referencePanelSubgrid"),[A.KBEditorControl]:e("controls.controlNames.KBEditor"),[A.LinkControl]:e("controls.controlNames.link")}}var A,Ho,Zr=D(()=>{"use strict";(function(e){e.AccessPrivilegeControl="F93A31B2-99AC-4084-8EC2-D4027C31369A",e.AccessTeamTablePickerControl="3f4e2a56-f102-4b4d-ab9c-f1574ca5bfda",e.ACIControl="C8BFBBEF-6851-4401-A0CC-7450062FE085",e.ActivitiesContainerControl="C72511AB-84E5-4FB7-A543-25B4FC01E83E",e.ActivitiesWallControl="6636847D-B74D-4994-B55A-A6FAF97ECEA2",e.AppliedFiltersControl="9C310A73-A360-42C5-8943-47A06F1B51EA",e.ArticleContentControl="F02EF977-2564-4B9A-B2F0-DF083D8A019B",e.BooleanControl="67FAC785-CD58-4F9F-ABB3-4B7DDC6ED5ED",e.ButtonControl="00AD73DA-BD4D-49C6-88A8-2F4F4CAD4A20",e.CheckboxControl="B0C6723A-8503-4FD7-BB28-C8A06AC933C2",e.CompositionLinkControl="DB1284EF-9FFC-4E99-B382-0CC082FE2364",e.ConnectionControl="3246F906-1F71-45F7-B11F-D7BE0F9D04C9",e.ConnectionRoleObjectTypeListControl="821ACF1A-7E46-4A0C-965D-FE14A57D78C7",e.CoverageChoiceControl="4168A05C-D857-46AF-8457-5BB47EB04EA1",e.DashboardControl="D2561F53-B292-42D9-B222-478E40FFE29F",e.DynamicPropertyListControl="6896F004-B17A-4202-861E-8B7EA2080E0B",e.EditFilterControl="1479835F-F852-4679-B864-C6892A2844C9",e.ErrorStatusControl="F4C16ECA-CA81-4E39-9448-834B8378721E",e.GlobalFilterControl="FFF0E632-9D7B-4F21-BBC1-05D1567AD144",e.HiddenInputControl="5546E6CD-394C-4BEE-94A8-4425E17EF6C6",e.KBViewerControl="A62B6FA9-169E-406C-B1AA-EAB828CB6026",e.LabelControl="39354E4A-5015-4D74-8031-EA9EB73A1322",e.MailMergeLanguagePickerControl="B634828E-C390-444A-AFE6-E07315D9D970",e.MapLinkControl="91DC0675-C8B9-4421-B1E0-261CEBF02BAC",e.OrgInsightsControl="76b9e25e-695e-4fef-ac69-f05cfa96739c",e.ChoiceLookupControl="2305e33a-bad3-4022-9e15-1856cf218333",e.PowerBIControl="8C54228C-1B25-4909-A12A-F2B968BB0D62",e.ProcessControl="06E9F7AF-1F54-4681-8EEC-1E21A1CEB465",e.RelatedInformationControl="163B90A6-EB64-49D2-9DF8-3C84A4F0A0F8",e.RelationshipRoleChoiceControl="5F986642-5961-4D9F-AB5E-643D71E231E9",e.ReportControl="A28F441B-916C-4865-87FD-0C5D53BD59C9",e.StreamsControl="EE9078C8-6946-4E2C-B8F8-35E65F4BE6A8",e.WebResourceSilverlightControl="080677DB-86EC-4544-AC42-F927E74B491F",e.CurrencyControl="533B9E00-756B-4312-95A0-DC888637AC78",e.CustomControl="F9A8A302-114E-466A-B582-6771B2AE0D92",e.DateTimeControl="5B773807-9FB2-42DB-97C3-7A91EFF8ADFF",e.DecimalControl="C3EFE0C3-0EC6-42BE-8349-CBD9079DFD8E",e.DurationControl="AA987274-CE4E-4271-A803-66164311A958",e.EmailAddressControl="ADA2203E-B4CD-49BE-9DDF-234642B43B52",e.EmailBodyControl="6F3FB987-393B-4D2D-859F-9D0F0349B6AD",e.EmailEngagementActionsControl="F454228D-1D25-4319-E12F-D27968BC0234",e.EmailRecipientActivityControl="26E9760F-7454-40DE-BB07-F6DCCCB82040",e.FileControl="0A7FF475-B016-4687-9CE5-042BFDBD6519",e.FloatingNumberControl="0D2C745A-E5A8-4C8F-BA63-C6D3BB604660",e.IframeControl="FD2A7985-3187-444E-908D-6624B21F69C0",e.ImageControl="7E548B0D-209C-477B-9DCD-F0F44472381D",e.LanguageControl="671A9387-CA5A-4D1E-8AB7-06E39DDCF6B5",e.LookupControl="270BD3DB-D9AF-4782-9025-509E298DEC0A",e.MapsControl="62B0DF79-0464-470F-8AF7-4483CFEA0C7D",e.ChoicesControl="4AA28AB7-9C13-4F57-A73D-AD894D048B5F",e.IntegerControl="C6D124CA-7EDA-4A60-AEA9-7FB8D318B68F",e.PartyListControl="CBFB742C-14E7-4A17-96BB-1A13F7F64AA2",e.PhoneNumberControl="8C10015A-B339-4982-9474-A95FE05631A5",e.ChoiceControl="3EF39988-22BB-4F0B-BBBE-64B5A3748AEE",e.ChoiceStatusControl="5D68B988-0661-4DB2-BC3E-17598AD3BE6C",e.QuickViewControl="5C5600E0-1D6E-4205-A272-BE80DA87FD42",e.QuickFormControl="69AF7DCA-2E3B-4EE7-9201-0DA731DD2413",e.RegardingControl="F3015350-44A2-4AA0-97B5-00166532B5E9",e.SearchWidgetControl="E616A57F-20E0-4534-8662-A101B5DDF4E0",e.SocialInsightsControl="86B9E25E-695E-4FEF-AC69-F05CFA96739C",e.SubgridControl="E7A81278-8635-4D9E-8D4D-59480B391C5B",e.TextAreaControl="E0DECE4B-6FC8-4A8F-A065-082708572369",e.TextboxControl="4273EDBD-AC1D-40D3-9FB2-095C621B552D",e.TickerControl="1E1FC551-F7A8-43AF-AC34-A8DC35C7B6D4",e.TimerControl="9C5CA0A1-AB4D-4781-BE7E-8DFBE867B87E",e.TimelineControl="06375649-C143-495E-A496-C962E5B4488E",e.TimezoneControl="7C624A0B-F59E-493D-9583-638D34759266",e.UrlControl="71716B6C-711E-476C-8AB8-5D11542BFB47",e.WebResourceHTMLControl="9FDF5F91-88B1-47F4-AD53-C11EFC01A01D",e.WebResourceImageControl="587CDF98-C1D5-4BDE-8473-14A0BC7644A7",e.ReferencePanelSearchWidgetControl="7CCD1494-1F7A-4E3A-8BDE-F32069DAEB9F",e.ReferencePanelSubgridControl="02D4264B-47E2-4B4C-AA95-F439F3F4D458",e.ReferencePanelQuickViewControl="B68B05F0-A46D-43F8-843B-917920AF806A",e.KBEditorControl="F94DB24F-263D-44A7-B38E-A35E9854812B",e.LinkControl="DFDF1CDE-837B-4AC9-98CF-AC74361FD89D"})(A||(A={}));Ho={[A.WebResourceHTMLControl]:"WebResource",[A.WebResourceImageControl]:"WebResource",[A.IframeControl]:"IFRAME",[A.SearchWidgetControl]:"Search widget",[A.SubgridControl]:"Subgrid",[A.TimelineControl]:"Timeline",[A.QuickViewControl]:"QuickviewControl"}});var en=m((s8,ch)=>{var sa=new Proxy(function(){return sa},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:sa},apply:function(){return sa},construct:function(){return{}}}),uh=function(){return sa};Object.setPrototypeOf(uh,sa);ch.exports=uh});var Qe,fr,dh,ph,Bn=D(()=>{"use strict";Qe="cds-designer-models",fr="FormCustomControl",dh="FormCell",ph="Form"});var kn,Xe,la=D(()=>{"use strict";kn=class{keys;values;constructor(){this.keys=[],this.values=[]}add(t,r){return this.containsKey(t)?!1:(this.keys.push(t),this.values.push(r),!0)}upsert(t,r){this.update(t,r)||this.add(t,r)}sortedUpsert(t,r){if(!this.update(t,r)){let n=0;for(;n<this.keys.length&&this.keys[n]<t;)n++;this.keys.splice(n,0,t),this.values.splice(n,0,r)}}clear(){this.keys=[],this.values=[]}containsKey(t){return this.keys.indexOf(t)!==-1}containsValue(t){return this.values.indexOf(t)!==-1}count(){return this.keys.length}getValue(t){let r=this.keys.indexOf(t);return r!==-1?this.values[r]:!1}getKeys(){return this.keys.slice()}getValues(){return this.values.slice()}remove(t){let r=this.keys.indexOf(t);return r!==-1?(this.keys.splice(r,1),this.values.splice(r,1),!0):!1}update(t,r){let n=this.keys.indexOf(t);return n!==-1?(this.values[n]=r,!0):!1}},Xe=class{data={};add(t,r){return this.containsKey(t)?!1:(this.data[t]=r,!0)}upsert(t,r){this.data[t]=r}clear(){this.data={}}containsKey(t){return this.data.hasOwnProperty(t)}containsValue(t){for(let r in this.data)if(this.data[r]===t)return!0;return!1}count(){return Object.keys(this.data).length}getValue(t){return this.containsKey(t)?this.data[t]:!1}getKeys(){return Object.keys(this.data)}getValues(){let t=[];for(let r in this.data)t.push(this.data[r]);return t}remove(t){return this.containsKey(t)?delete this.data[t]:!1}update(t,r){return this.containsKey(t)?(this.data[t]=r,!0):!1}getInternalObject(){return this.data}}});var tn,lc=D(()=>{"use strict";la();G();tn=class e{static lockedFieldCount=new Xe;static dependencyFieldCount=new Xe;static getNecessaryLookUpTable(t){switch(t){case Wt.DependencyFieldTable:return e.dependencyFieldCount;case Wt.LockedFieldTable:return e.lockedFieldCount}}static initCanvasLockedFieldLookUp(t){switch(t){case Wt.DependencyFieldTable:e.dependencyFieldCount=new Xe;case Wt.LockedFieldTable:e.lockedFieldCount=new Xe}}}});var Jo,fh=D(()=>{"use strict";Se();Ce();G();xe();Jo=class extends q{constructor(t){super(h.controlDescription,t)}get forControl(){let t=this.getProperty(p.ForControl);return S.IsNullOrUndefined(t)?null:(t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),new I(t))}set forControl(t){this.setProperty(p.ForControl,`{${t.ToString()}}`)}get customControls(){return this.getChildren(h.customControl)}set customControls(t){this.deleteAllChildren();for(let r of t)this.addChild(r)}get DefaultControlClassId(){for(let t of this.customControls)if(!S.IsNullOrUndefined(t.id))return t.id;return null}get DefaultCustomControl(){for(let t of this.customControls)if(!S.IsNullOrUndefined(t.id))return t;return null}get DefaultCustomControls(){let t=[];for(let r of this.customControls)S.IsNullOrUndefined(r.id)||t.push(r);return t}async toJSON(t){let r=await this.getCustomControlsJSON(t);return r?{UniqueId:this.forControl.guidString,CustomControls:r,VersionNumber:0,OverallVersionNumber:0}:null}async getCustomControlsJSON(t){if(this.customControls){let r=[];for(let n of this.customControls){let i=await n.toJSON(t);i&&r.push(i)}return r}return null}}});var hh,gh,Ke,E,mh,Rr,rn,qn,uc,cc,$n=D(()=>{"use strict";hh={Name:"Name",Value:"Value",Type:"Type",TypeGroup:"TypeGroup",Usage:"Usage",Static:"Static",Primary:"Primary",Columns:"Columns",EnableViewPicker:"EnableViewPicker",EntityName:"EntityName",FilteredViewIds:"FilteredViewIds",ReferencingName:"ReferencingName",RelationshipName:"RelationshipName",RelationshipType:"RelationshipType",TargetEntityType:"TargetEntityType",ViewId:"ViewId",DependentAttributeName:"DependentAttributeName",DependentAttributeType:"DependentAttributeType",DefaultViewId:"DefaultViewId",BindAttribute:"BindAttribute",FilterRelationshipName:"FilterRelationshipName",AvailableViewIds:"AvailableViewIds",QuickForms:"QuickForms",EntityNameKey:"EntityNameKey",CardFormType:"Form.Card",CardFormId:"CardFormId",Hidden:"Hidden",Required:"Required",DefaultValue:"DefaultValue"},gh={GroupDefinition:"GroupDefinition"},Ke={Control:"control",Resources:"resources",DisplayNameKey:"display-name-key",descriptionKey:"description-key",value:"value",name:"name",defaultKey:"default",groups:"groups",group:"group",property:"property",hidden:"hidden",required:"required",typeGroup:"type-group",type:"type",usage:"usage",ofType:"of-type",ofTypeGroup:"of-type-group",ImageURL:"preview-image",DefaultValue:"default-value",static:"static",dataset:"data-set",propertySet:"property-set",initialDatasetFetch:"initial-data-set-fetch",editable:"editable",cdsDatasetOptions:"cds-data-set-options",allowDefaultSelectedItems:"allow-default-selected-items",resettable:"resettable",isGroup:"isGroup",entityName:"entityname"};(function(e){e.Boolean="Boolean",e.Currency="Currency",e.DateAndTimeDateAndTime="DateAndTime.DateAndTime",e.DateAndTimeDateOnly="DateAndTime.DateOnly",e.Decimal="Decimal",e.Enum="Enum",e.FP="FP",e.File="File",e.Guid="Guid",e.Image="Image",e.LookupCustomer="Lookup.Customer",e.LookupOwner="Lookup.Owner",e.LookupPartyList="Lookup.PartyList",e.LookupRegarding="Lookup.Regarding",e.LookupSimple="Lookup.Simple",e.Multiple="Multiple",e.MultiSelectOptionSet="MultiSelectOptionSet",e.OptionSet="OptionSet",e.SingleLineEmail="SingleLine.Email",e.SingleLinePhone="SingleLine.Phone",e.SingleLineText="SingleLine.Text",e.SingleLineTextArea="SingleLine.TextArea",e.SingleLineTickerSymbol="SingleLine.Ticker",e.SingleLineURL="SingleLine.URL",e.TwoOptions="TwoOptions",e.WholeDuration="Whole.Duration",e.WholeLanguage="Whole.Language",e.WholeNone="Whole.None",e.WholeTimeZone="Whole.TimeZone",e.BusinessProcessFlow="BusinessProcessFlow",e.CardForm="Form.Card",e.Dashboard="Dashboard",e.FormMain="Form.Main",e.Grid="Grid",e.PowerBIReport="PowerBI.Report",e.QuickForm="Form.QuickForm",e.Search="Search",e.SearchWidget="SearchWidget",e.TimelineWall="TimelineWall",e.UnboundCustomControl="Unbound",e.WebResourceHtmlControl="WebResource.HTML"})(E||(E={}));(function(e){e.BooleanType="CC_FlipLabel_Name",e.DateTimeType="CC_TextBox_Name",e.DecimalType="CC_TextBox_Name",e.DoubleType="CC_TextBox_Name",e.IntegerType="CC_TextBox_Name",e.LookupType="CC_TextBox_Name",e.MemoType="CC_TextArea_Name",e.MoneyType="CC_TextBox_Name",e.OptionSetType="CC_OptionSet_Name",e.StringType="CC_TextBox_Name",e.GridType="CC_ReadOnlyGrid_Name",e.UnboundCustomControlType="CC_UnboundCustomControl_Name"})(mh||(mh={}));(function(e){e.ArcKnobControl="MscrmControls.Knob.ArcKnobControl",e.CardFeedNameControl="MscrmControls.CardFeedContainer.CardFeedContainer",e.CheckboxControl="MscrmControls.FieldControls.CheckboxControl",e.DateTimeControl="MscrmControls.FieldControls.DateTimeControl",e.DurationControl="MscrmControls.FieldControls.DurationControl",e.EditableGridControl="MscrmControls.Grid.GridControl",e.EmailEngagementActionsControl="MscrmControls.EmailEngagement.EmailEngagementActionsControl",e.FormComponent="MscrmControls.ModelForm.ModelFormControl",e.LanguageCodeControl="MscrmControls.FieldControls.LanguagePickerControl",e.LinearSliderControl="MscrmControls.Slider.LinearSliderControl",e.MultiSelectOptionSetControl="MscrmControls.MultiSelectPicklist.UpdMSPicklistControl",e.OptionSetControl="MscrmControls.OptionSet.OptionSetControl",e.PowerBIPCFControl="MscrmControls.PowerBIPCFControl",e.PredictiveScoringWidget="MscrmControls.Sales.PredictiveScoringWidget.PredictiveScoringWidget",e.ReadonlyGrid="MscrmControls.Grid.ReadOnlyGrid",e.SimilarCasesGrid="MscrmControls.Containers.SimilarCasesGridControl",e.StarRatingControl="MscrmControls.Rating.StarRatingControl",e.TimeZoneControl="MscrmControls.FieldControls.TimeZonePickListControl",e.ModelFormControl="MscrmControls.ModelForm.ModelFormControl",e.AutoCompleteControl="MscrmControls.AutoComplete.AutoCompleteControl",e.CanvasAppControl="MscrmControls.Canvas.CanvasControl",e.PowerAppsOneGrid="Microsoft.PowerApps.PowerAppsOneGrid"})(Rr||(Rr={}));(function(e){e[e.Read=0]="Read",e[e.Edit=1]="Edit",e[e.Both=2]="Both",e[e.Container=3]="Container",e[e.Unknown=4]="Unknown"})(rn||(rn={}));(function(e){e[e.Bound=0]="Bound",e[e.Input=1]="Input",e[e.Output=2]="Output"})(qn||(qn={}));uc=[E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding,E.LookupSimple],cc=[E.WholeNone,E.WholeDuration,E.WholeLanguage,E.WholeTimeZone,E.FP,E.Decimal]});function mr(){return jt||(jt=window._makerConfig,jt&&window?.location?.search?.indexOf("useProductionConfig")>-1&&(jt={...jt,region:"prod",graphQLEndpoint:"https://graph.make.powerapps.com/"}),jt?.region==="prod"&&(jt={endpoints:{eu:{ch:{graphql:"https://graph-make.ch-cm001.gateway.prod.cm.powerapps.com/"},de:{graphql:"https://graph-make.de-cm001.gateway.prod.cm.powerapps.com/"},fr:{graphql:"https://graph-make.fr-cm001.gateway.prod.cm.powerapps.com/"},no:{graphql:"https://graph-make.no-cm001.gateway.prod.cm.powerapps.com/"},default:{graphql:"https://graph-make.eu-cm001.gateway.prod.cm.powerapps.com/"}}},...jt}),jt||{aadClientId:"a8f7a65c-f5ba-4859-b2d6-df772c264e9d",location:"cus",region:"test",publicPath:"/",graphQLEndpoint:"https://graph.make.test.powerapps.com/"})}var jt,Qo=D(()=>{"use strict";});function vh(e,t,r){if(!e)return Xo.has(e)||(window._ppux?.log?.("PPUX/Geo/NonExistent",{eventType:"Trace",team:"Shell",severity:"Error",errorCode:"GeoIsEmpty"}),Xo.add("")),!1;if(e){if(e=e.toLowerCase(),Xo.has(e))return!1;if(!(e in t))return window._ppux?.log?.("PPUX/Geo/NonExistent",{eventType:"Trace",team:"Shell",severity:"Error",errorCode:"GeoNonExistent",eventInfo:{missinggeo:e,parent:r}}),Xo.add(e),!1}return!0}function yO(e){return vh(e,dc,"Location dictionary")?dc[e.toLowerCase()]:"us"}function CO(){let e=mr().location.toLowerCase();return vh(e,dc,"Current location dictionary")?e:"us"}var Xo,dc,w8,bh=D(()=>{"use strict";Qo();Xo=new Set,dc={cae:"ae",nae:"ae",eas:"as",seas:"as",eau:"au",seau:"au",sbr:"br",cca:"ca",eca:"ca",nch:"ch",wch:"ch",nde:"de",wcde:"de",neu:"eu",weu:"eu",cfr:"fr",sfr:"fr",cin:"in",sin:"in",ejp:"jp",wjp:"jp",suk:"uk",wuk:"uk",eus:"us",wus:"us",cus:"us",ude:"us",udc:"us",ugtx:"us",ugva:"us",eus2:"us",wus2:"us",nza:"za",wza:"za",cne2:"cn",cnn2:"cn",skr:"kr",ckr:"kr",eno:"no",wno:"no",wrx:"us",erx:"us",wex:"us",eex:"us",unitedstates:"us",europe:"eu",asia:"as",australia:"au",japan:"jp",canada:"ca",india:"in",italy:"it",unitedstatesfirstrelease:"us",unitedkingdom:"uk",southamerica:"br",france:"fr",unitedarabemirates:"ae",germany:"de",sweden:"se",switzerland:"ch",korea:"kr",norway:"no",usgov:"us",usgovhigh:"us",usdod:"us",china:"cn",usnat:"us",ussec:"us",southafrica:"za",singapore:"sg",newzealand:"nz",poland:"pl",qatar:"qa",as:"as",au:"au",ca:"ca",in:"in",jp:"jp",kr:"kr",nz:"nz",ae:"ae",qa:"qa",us:"us",uk:"uk",eu:"eu",de:"de",ch:"ch",no:"no",fr:"fr",se:"se",it:"it",pl:"pl",be:"eu",bel:"eu",gr:"eu",grc:"eu",lt:"eu",ltu:"eu",pt:"eu",prt:"eu",bg:"eu",bgr:"eu",es:"eu",esp:"eu",lu:"eu",lux:"eu",ro:"eu",rou:"eu",cz:"eu",cze:"eu",hu:"eu",hun:"eu",si:"eu",svn:"eu",dk:"eu",dnk:"eu",hr:"eu",hrv:"eu",mt:"eu",mlt:"eu",sk:"eu",svk:"eu",nit:"it",nl:"eu",nld:"eu",fi:"eu",fin:"eu",ee:"eu",est:"eu",cy:"eu",cyp:"eu",at:"eu",aut:"eu",swe:"se",cse:"se",ie:"eu",irl:"eu",lv:"eu",lva:"eu",cpl:"pl",nnz:"nz",cqa:"qa",sg:"sg",br:"br",za:"za",sa:"za"};w8=yO(CO())});var x,S8,yh=D(()=>{"use strict";x={USWest:"westus",USWest2:"westus2",USCentral:"centralus",USEast:"eastus",USEast2:"eastus2",USNorthCentral:"northcentralus",USSouthCentral:"southcentralus",USWestCentral:"westcentralus",CanadaCentral:"canadacentral",CanadaEast:"canadaeast",BrazilSouth:"brazilsouth",EuropeNorth:"northeurope",EuropeWest:"westeurope",UKSouth:"uksouth",UKWest:"ukwest",FranceCentral:"francecentral",FranceSouth:"francesouth",SwitzerlandNorth:"switzerlandnorth",SwitzerlandWest:"switzerlandwest",GermanyNorth:"germanynorth",GermanyWestCentral:"germanywestcentral",NorwayWest:"norwaywest",NorwayEast:"norwayeast",SwedenCentral:"swedencentral",ItalyNorth:"italynorth",PolandCentral:"polandcentral",AsiaEast:"eastasia",AsiaSouthEast:"southeastasia",JapanEast:"japaneast",JapanWest:"japanwest",AustraliaEast:"australiaeast",AustraliaSouthEast:"australiasoutheast",AustraliaCentral:"australiacentral",AustraliaCentral2:"australiacentral2",IndiaCentral:"centralindia",IndiaSouth:"southindia",IndiaWest:"westindia",KoreaSouth:"koreasouth",KoreaCentral:"koreacentral",NewZealandNorth:"newzealandnorth",UAECentral:"uaecentral",UAENorth:"uaenorth",SouthAfricaNorth:"southafricanorth",SouthAfricaWest:"southafricawest",QatarCentral:"qatarcentral",GermanyCentral:"germanycentral",GermanyNorthEast:"germanynortheast",SingaporeSouthEast:"southeastasia",GovernmentUSVirginia:"usgovvirginia",GovernmentUSIowa:"usgoviowa",GovernmentUSArizona:"usgovarizona",GovernmentUSTexas:"usgovtexas",GovernmentUSDodEast:"usdodeast",GovernmentUSDodCentral:"usdodcentral",ChinaNorth:"chinanorth",ChinaNorth2:"chinanorth2",ChinaNorth3:"chinanorth3",ChinaEast:"chinaeast",ChinaEast2:"chinaeast2",ChinaEast3:"chinaeast3",UssecEast:"usseceast",UssecWest:"ussecwest",UsnatEast:"usnateast",UsnatWest:"usnatwest"},S8={[x.USWest]:{geoName:"us",regionShortName:"wus"},[x.USCentral]:{geoName:"us",regionShortName:"cus"},[x.USEast]:{geoName:"us",regionShortName:"eus"},[x.USEast2]:{geoName:"us",regionShortName:"eus2"},[x.USWestCentral]:{geoName:"us",regionShortName:"wcus"},[x.USWest2]:{geoName:"us",regionShortName:"wus2"},[x.USSouthCentral]:{geoName:"br",regionShortName:"scus"},[x.BrazilSouth]:{geoName:"br",regionShortName:"sbr"},[x.UKSouth]:{geoName:"uk",regionShortName:"suk"},[x.UKWest]:{geoName:"uk",regionShortName:"wuk"},[x.JapanEast]:{geoName:"jp",regionShortName:"ejp"},[x.JapanWest]:{geoName:"jp",regionShortName:"wjp"},[x.IndiaCentral]:{geoName:"in",regionShortName:"cin"},[x.IndiaSouth]:{geoName:"in",regionShortName:"sin"},[x.ItalyNorth]:{geoName:"it",regionShortName:"nit"},[x.GermanyWestCentral]:{geoName:"de",regionShortName:"wcde"},[x.GermanyNorth]:{geoName:"de",regionShortName:"nde"},[x.EuropeNorth]:{geoName:"eu",regionShortName:"neu"},[x.EuropeWest]:{geoName:"eu",regionShortName:"weu"},[x.AustraliaEast]:{geoName:"au",regionShortName:"eau"},[x.AustraliaSouthEast]:{geoName:"au",regionShortName:"seau"},[x.AsiaSouthEast]:{geoName:"as",regionShortName:"seas"},[x.AsiaEast]:{geoName:"as",regionShortName:"eas"},[x.CanadaCentral]:{geoName:"ca",regionShortName:"cca"},[x.CanadaEast]:{geoName:"ca",regionShortName:"eca"},[x.SouthAfricaNorth]:{geoName:"za",regionShortName:"nza"},[x.SouthAfricaWest]:{geoName:"za",regionShortName:"wza"},[x.FranceCentral]:{geoName:"fr",regionShortName:"cfr"},[x.FranceSouth]:{geoName:"fr",regionShortName:"sfr"},[x.UAENorth]:{geoName:"ae",regionShortName:"nae"},[x.UAECentral]:{geoName:"ae",regionShortName:"cae"},[x.SwedenCentral]:{geoName:"se",regionShortName:"cse"},[x.SwitzerlandNorth]:{geoName:"ch",regionShortName:"nch"},[x.SwitzerlandWest]:{geoName:"ch",regionShortName:"wch"},[x.NorwayEast]:{geoName:"no",regionShortName:"eno"},[x.NorwayWest]:{geoName:"no",regionShortName:"wno"},[x.KoreaCentral]:{geoName:"kr",regionShortName:"ckr"},[x.KoreaSouth]:{geoName:"kr",regionShortName:"skr"},[x.SingaporeSouthEast]:{geoName:"sg",regionShortName:"seas"},[x.PolandCentral]:{geoName:"pl",regionShortName:"cpl"},[x.QatarCentral]:{geoName:"qa",regionShortName:"cqa"},[x.NewZealandNorth]:{geoName:"nz",regionShortName:"nnz"},[x.GovernmentUSTexas]:{geoName:"us",regionShortName:"ugtx"},[x.GovernmentUSVirginia]:{geoName:"us",regionShortName:"ugva"},[x.GovernmentUSDodCentral]:{regionShortName:"udc"},[x.GovernmentUSDodEast]:{regionShortName:"ude"},[x.ChinaEast]:{regionShortName:"cne"},[x.ChinaEast2]:{regionShortName:"cne2"},[x.ChinaEast3]:{regionShortName:"cne3"},[x.ChinaNorth]:{regionShortName:"cnn"},[x.ChinaNorth2]:{regionShortName:"cnn2"},[x.ChinaNorth3]:{regionShortName:"cnn3"},[x.UssecEast]:{geoName:"us",regionShortName:"erx"},[x.UssecWest]:{geoName:"us",regionShortName:"wrx"},[x.UsnatEast]:{geoName:"us",regionShortName:"eex"},[x.UsnatWest]:{geoName:"us",regionShortName:"wex"}}});var Ch=D(()=>{"use strict";Qo();});var ua=D(()=>{"use strict";Qo();bh();yh();Ch();});function ca(e,t){return Ah?Ah.isOverridden(e,t):{overridden:!1}}var Ah,da=D(()=>{"use strict";});var pc=D(()=>{"use strict";ua();da();});function AO(e,t){let{region:r}=mr();return()=>{let n=e.settings[t];if(n.allowOverrides){let s=ca(e.packageName,t);if(s.overridden)return typeof s.value=="string"?wO(s.value):s.value}let a=n.values,o=process.env.SETTINGS_FALLBACK_REGION?.[r];return a[r]!==void 0?a[r]:o&&a[o]!==void 0?a[o]:a.default}}function wO(e){return isNaN(Number(e))?e==="true"?!0:e==="false"?!1:e:Number(e)}function NO(e){let t=e.packageName;if(Ko.has(t)){let r=`settings has already been created for this package ${t}`;throw console.error(r),new Error(r)}if(Object.keys(e.settings).some(r=>mc(t,r))){let r=`error parsing settings config for package ${t}, a feature gate with the same name exists`;throw console.error(r),new Error(r)}Object.keys(e.settings).forEach(r=>{if(Object.keys(e.settings[r].values).filter(i=>i!=="default").some(i=>!Zo(i))){let i=`error parsing settings config for package ${t}, setting ${r} has invalid region`;throw console.error(i),new Error(i)}})}function pa(e){NO(e);let t={};return Object.keys(e.settings).forEach(r=>{t[r]={enumerable:!0,get:AO(e,r)}}),Ko.set(e.packageName,e),Object.defineProperties({},t)}function fc(e,t){return Ko.has(e)?!!Ko.get(e).settings[t]:!1}var Ko,Yo=D(()=>{"use strict";ua();da();hc();fa();Ko=new Map});function wh(e,t){let{region:r}=mr();return()=>{let n=ca(e.packageName,t);if(n.overridden)return n.value.toString()==="true";let i=e.features[t].enabledFor,a=process.env.SETTINGS_FALLBACK_REGION?.[r];return i[r]!==void 0?!!i[r]:a&&i[a]!==void 0?!!i[a]:!1}}function SO(e){let t=e.packageName;if(es.has(t)){let r="feature gates has already been created for this package";throw console.error(r),new Error(r)}if(Object.keys(e.features).some(r=>fc(t,r))){let r=`error parsing feature gates config for package ${t}, a setting with the same name exists`;throw console.error(r),new Error(r)}Object.keys(e.features).forEach(r=>{if(Object.keys(e.features[r].enabledFor).some(i=>!Zo(i))){let i=`error parsing feature gates config for package ${t}, feature ${r} has invalid region`;throw console.error(i),new Error(i)}})}function gc(e){SO(e);let t={};Object.keys(e.features).forEach(i=>{t[i]={enumerable:!0,configurable:!0,get:wh(e,i)}});let r={},n=new Set;return t.dangerouslySet={enumerable:!1,value:(i,a)=>{n.add(i),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,value:a})}},t.dangerouslyReset={enumerable:!1,value:()=>{let i={};n.forEach(a=>{i[a.toString()]={enumerable:!0,configurable:!0,get:wh(e,a.toString())}}),Object.defineProperties(r,i),n.clear()}},es.set(e.packageName,e),Object.defineProperties(r,t)}function mc(e,t){return es.has(e)?!!es.get(e).features[t]:!1}var es,hc=D(()=>{"use strict";ua();fa();da();Yo();es=new Map});var Sh=m((Q8,Nh)=>{"use strict";Nh.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}});var Ih=m(vc=>{"use strict";var DO=Object.prototype.hasOwnProperty,EO;function Dh(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Eh(e){try{return encodeURIComponent(e)}catch{return null}}function IO(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var i=Dh(n[1]),a=Dh(n[2]);i===null||a===null||i in r||(r[i]=a)}return r}function _O(e,t){t=t||"";var r=[],n,i;typeof t!="string"&&(t="?");for(i in e)if(DO.call(e,i)){if(n=e[i],!n&&(n===null||n===EO||isNaN(n))&&(n=""),i=Eh(i),n=Eh(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?t+r.join("&"):""}vc.stringify=_O;vc.parse=IO});var Cc=m((K8,Rh)=>{"use strict";var Ph=Sh(),ts=Ih(),Oh=/[\n\r\t]/g,PO=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,OO=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,FO=/^[a-zA-Z]:/,TO=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function yc(e){return(e||"").toString().replace(TO,"")}var bc=[["#","hash"],["?","query"],function(t,r){return Ht(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],_h={hash:1,query:1};function Fh(e){var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},i=typeof e,a;if(e.protocol==="blob:")n=new Jt(unescape(e.pathname),{});else if(i==="string"){n=new Jt(e,{});for(a in _h)delete n[a]}else if(i==="object"){for(a in e)a in _h||(n[a]=e[a]);n.slashes===void 0&&(n.slashes=PO.test(e.href))}return n}function Ht(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Th(e,t){e=yc(e),e=e.replace(Oh,""),t=t||{};var r=OO.exec(e),n=r[1]?r[1].toLowerCase():"",i=!!r[2],a=!!r[3],o=0,s;return i?a?(s=r[2]+r[3]+r[4],o=r[2].length+r[3].length):(s=r[2]+r[4],o=r[2].length):a?(s=r[3]+r[4],o=r[3].length):s=r[4],n==="file:"?o>=2&&(s=s.slice(2)):Ht(n)?s=r[4]:n?i&&(s=s.slice(2)):o>=2&&Ht(t.protocol)&&(s=r[4]),{protocol:n,slashes:i||Ht(n),slashesCount:o,rest:s}}function RO(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,i=r[n-1],a=!1,o=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),o++):o&&(n===0&&(a=!0),r.splice(n,1),o--);return a&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Jt(e,t,r){if(e=yc(e),e=e.replace(Oh,""),!(this instanceof Jt))return new Jt(e,t,r);var n,i,a,o,s,l,u=bc.slice(),c=typeof t,d=this,f=0;for(c!=="object"&&c!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=ts.parse),t=Fh(t),i=Th(e||"",t),n=!i.protocol&&!i.slashes,d.slashes=i.slashes||n&&t.slashes,d.protocol=i.protocol||t.protocol||"",e=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||FO.test(e))||!i.slashes&&(i.protocol||i.slashesCount<2||!Ht(d.protocol)))&&(u[3]=[/(.*)/,"pathname"]);f<u.length;f++){if(o=u[f],typeof o=="function"){e=o(e,d);continue}a=o[0],l=o[1],a!==a?d[l]=e:typeof a=="string"?(s=a==="@"?e.lastIndexOf(a):e.indexOf(a),~s&&(typeof o[2]=="number"?(d[l]=e.slice(0,s),e=e.slice(s+o[2])):(d[l]=e.slice(s),e=e.slice(0,s)))):(s=a.exec(e))&&(d[l]=s[1],e=e.slice(0,s.index)),d[l]=d[l]||n&&o[3]&&t[l]||"",o[4]&&(d[l]=d[l].toLowerCase())}r&&(d.query=r(d.query)),n&&t.slashes&&d.pathname.charAt(0)!=="/"&&(d.pathname!==""||t.pathname!=="")&&(d.pathname=RO(d.pathname,t.pathname)),d.pathname.charAt(0)!=="/"&&Ht(d.protocol)&&(d.pathname="/"+d.pathname),Ph(d.port,d.protocol)||(d.host=d.hostname,d.port=""),d.username=d.password="",d.auth&&(s=d.auth.indexOf(":"),~s?(d.username=d.auth.slice(0,s),d.username=encodeURIComponent(decodeURIComponent(d.username)),d.password=d.auth.slice(s+1),d.password=encodeURIComponent(decodeURIComponent(d.password))):d.username=encodeURIComponent(decodeURIComponent(d.auth)),d.auth=d.password?d.username+":"+d.password:d.username),d.origin=d.protocol!=="file:"&&Ht(d.protocol)&&d.host?d.protocol+"//"+d.host:"null",d.href=d.toString()}function xO(e,t,r){var n=this;switch(e){case"query":typeof t=="string"&&t.length&&(t=(r||ts.parse)(t)),n[e]=t;break;case"port":n[e]=t,Ph(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var i=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==i?i+t:t}else n[e]=t;break;case"username":case"password":n[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(n.username=t.slice(0,a),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(a+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t))}for(var o=0;o<bc.length;o++){var s=bc[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Ht(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function LO(e){(!e||typeof e!="function")&&(e=ts.stringify);var t,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var a=i+(r.protocol&&r.slashes||Ht(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):r.protocol!=="file:"&&Ht(r.protocol)&&!n&&r.pathname!=="/"&&(a+="@"),n[n.length-1]===":"&&(n+=":"),a+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(a+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(a+=r.hash),a}Jt.prototype={set:xO,toString:LO};Jt.extractProtocol=Th;Jt.location=Fh;Jt.trimLeft=yc;Jt.qs=ts;Rh.exports=Jt});var MO,xh=D(()=>{"use strict";MO=ne(Cc());});function Ac(e,t,r){let n=Object.keys(r).sort();if(n.length===0)throw new Error(`ECS feature has no properties: ${e}.${t}`);let i=`ecs.${e}.${t}`;return n.length===1?`${i}.${n[0]}`:`${i}.{${n.join(";")}}`}var rs=D(()=>{"use strict";});var wc,Nc,Sc=D(()=>{"use strict";rs();wc=class{features=new Map;register(t,r){let n=Ac(r,t.teamName,t.fallback),i={clientName:r,teamName:t.teamName,fullName:n,description:t.description,owners:t.owners,ecsURL:t.ecsURL,createdOn:t.createdOn,fallbackConfig:t.fallback,feature:t,displayTeam:t.displayTeam,tags:t.tags,category:t.category};this.features.set(n,i)}getAll(){return Array.from(this.features.values())}get(t){return this.features.get(t)}has(t){return this.features.has(t)}getByClient(t){return this.getAll().filter(r=>r.clientName===t)}getByTeam(t){return this.getAll().filter(r=>r.teamName===t)}search(t){let r=t.toLowerCase();return this.getAll().filter(n=>n.fullName.toLowerCase().includes(r)||n.description?.toLowerCase().includes(r)||n.teamName.toLowerCase().includes(r)||n.clientName.toLowerCase().includes(r))}getClientNames(){let t=new Set;return this.features.forEach(r=>t.add(r.clientName)),Array.from(t)}getTeamNames(){let t=new Set;return this.features.forEach(r=>t.add(r.teamName)),Array.from(t)}clear(){this.features.clear()}},Nc=new wc});var Dc=D(()=>{"use strict";});function Zo(e){return UO.has(e)}var UO,fa=D(()=>{"use strict";pc();hc();Yo();da();pc();xh();Sc();rs();Dc();UO=new Set(["tie","test","prod","preview","preprod","gov","high","dod","mooncake","ex","rx"])});var BO,Lh=D(()=>{"use strict";fa();BO=pa({packageName:"cds-designer-models",settings:{testCustomControls:{description:"Test Custom Controls to show up in the component picker.",allowOverrides:!0,values:{default:"",test:"",preprod:"",preview:"",gov:""}}}})});var ns,O,L,nn,Vn,is,Mh,Uh,Ec,ma=D(()=>{"use strict";la();ns=class{name;constructor(t){this.name=t}toString(){return this.name}getName(){return this.name}getDisplayNameResourceKey(){return Ec.getDisplayNameResourceKey(this.name)}};(function(e){e.BigInt="BigIntType",e.CalendarRulesType="CalendarRulesType",e.Currency="MoneyType",e.Customer="Customer",e.CustomerType="CustomerType",e.DateTime="DateTimeType",e.DecimalNumber="DecimalType",e.EntityNameType="EntityNameType",e.FloatingPointNumber="DoubleType",e.Image="ImageType",e.File="FileType",e.Lookup="Lookup",e.LookupType="LookupType",e.ManagedPropertyType="ManagedPropertyType",e.MultipleLineofText="MemoType",e.MultiSelectOptionSet="MultiSelectPicklistType",e.OptionSet="PicklistType",e.Owner="Owner",e.OwnerType="OwnerType",e.PartyList="PartyList",e.PartyListType="PartyListType",e.PrimaryNameAttributeType="String",e.SingleLineofText="StringType",e.State="StateType",e.Status="StatusType",e.Subject="Subject",e.TimeStamp="TimeStampType",e.TwoOptions="BooleanType",e.UniqueIdentifier="Uniqueidentifier",e.UniqueIdentifierType="UniqueidentifierType",e.VirtualType="VirtualType",e.WholeNumber="IntegerType"})(O||(O={}));(function(e){e.Email="Email",e.Text="Text",e.TextArea="TextArea",e.Url="Url",e.TickerSymbol="TickerSymbol",e.PhoneticGuide="PhoneticGuide",e.VersionNumber="VersionNumber",e.Phone="Phone",e.None="None",e.Duration="Duration",e.TimeZone="TimeZone",e.Language="Language",e.Locale="Locale",e.DateOnly="DateOnly",e.DateAndTime="DateAndTime",e.Picklist="Picklist",e.State="State",e.Status="Status",e.Boolean="Boolean",e.Regarding="Regarding"})(L||(L={}));nn=class extends ns{constructor(t){super(t)}static get None(){return"None"}static get SystemRequired(){return"SystemRequired"}static get ApplicationRequired(){return"ApplicationRequired"}static get Recommended(){return"Recommended"}},Vn=class e extends ns{constructor(t){super(t),t||(this.name=e.None)}static get None(){return"None"}static get Persistent(){return"Persistent"}static get Calculated(){return"Calculated"}static get Rollup(){return"Rollup"}GetValue(){return this.name===e.None?is.Persistent:parseInt(is[this.name])}};(function(e){e[e.Persistent=0]="Persistent",e[e.Calculated=1]="Calculated",e[e.Rollup=2]="Rollup"})(is||(is={}));(function(e){e[e.Undefined=0]="Undefined",e[e.Simple=1]="Simple",e[e.Related=2]="Related",e[e.Logical=4]="Logical",e[e.Calculated=8]="Calculated",e[e.Rollup=16]="Rollup",e[e.Invalid=32]="Invalid"})(Mh||(Mh={}));(function(e){e[e.Attribute=0]="Attribute",e[e.Organization=1]="Organization",e[e.Currency=2]="Currency"})(Uh||(Uh={}));Ec=class e{static resourceKeyMap=e.initResourceKeyMap();static initResourceKeyMap(){let t=new kn;return t.add(O.TwoOptions,"SystemCustomization.type.bit.label"),t.add(O.Customer,"SystemCustomization.type.customer.label"),t.add(O.CustomerType,"SystemCustomization.type.customer.label"),t.add(O.DateTime,"SystemCustomization.type.datetime.label"),t.add(O.DecimalNumber,"SystemCustomization.type.decimal.label"),t.add(O.FloatingPointNumber,"SystemCustomization.type.float.label"),t.add(O.WholeNumber,"SystemCustomization.type.int.label"),t.add(O.LookupType,"SystemCustomization.type.lookup.label"),t.add(O.Lookup,"SystemCustomization.type.lookup.label"),t.add(O.MultipleLineofText,"SystemCustomization.type.ntext.label"),t.add(O.Currency,"SystemCustomization.type.money.label"),t.add(O.Owner,"SystemCustomization.type.owner.label"),t.add(O.OwnerType,"SystemCustomization.type.owner.label"),t.add(O.PartyList,"SystemCustomization.type.partylist.label"),t.add(O.PartyListType,"SystemCustomization.type.partylist.label"),t.add(O.OptionSet,"SystemCustomization.type.picklist.label"),t.add(O.State,"SystemCustomization.type.state.label"),t.add(O.Status,"SystemCustomization.type.status.label"),t.add(O.SingleLineofText,"SystemCustomization.type.nvarchar.label"),t.add(O.UniqueIdentifier,"SystemCustomization.type.uniqueidentifier.label"),t.add(O.UniqueIdentifierType,"SystemCustomization.type.uniqueidentifiertype.label"),t.add(O.CalendarRulesType,"SystemCustomization.type.calendarrules.label"),t.add(O.VirtualType,"SystemCustomization.type.virtual.label"),t.add(O.BigInt,"SystemCustomization.type.bigint.label"),t.add(O.ManagedPropertyType,"SystemCustomization.type.managedproperty.label"),t.add(O.EntityNameType,"SystemCustomization.type.entityname.label"),t.add(O.Image,"SystemCustomization.type.image.label"),t.add(O.MultiSelectOptionSet,"SystemCustomization.type.multiselectpicklist.label"),t.add(O.PrimaryNameAttributeType,"SystemCustomization.type.primaryname.label"),t.add(O.LookupType,"SystemCustomization.type.lookuptype.label"),t.add(O.Subject,"SystemCustomization.type.subject.label"),t.add(L.Email,"SystemCustomization.String.Format.email"),t.add(L.Text,"SystemCustomization.String.Format.text"),t.add(L.TextArea,"SystemCustomization.String.Format.textarea"),t.add(L.Url,"SystemCustomization.String.Format.url"),t.add(L.TickerSymbol,"SystemCustomization.String.Format.tickersymbol"),t.add(L.PhoneticGuide,"SystemCustomization.String.Format.phoneticguide"),t.add(L.VersionNumber,"SystemCustomization.String.Format.versionnumber"),t.add(L.Phone,"SystemCustomization.String.Format.phone"),t.add(L.None,"SystemCustomization.Integer.Format."),t.add(L.Duration,"SystemCustomization.Integer.Format.duration"),t.add(L.TimeZone,"SystemCustomization.Integer.Format.timezone"),t.add(L.Language,"SystemCustomization.Integer.Format.language"),t.add(L.Locale,"SystemCustomization.Integer.Format.language"),t.add(L.DateOnly,"SystemCustomization.DateTime.Format.date"),t.add(L.DateAndTime,"SystemCustomization.DateTime.Format.datetime"),t.add(L.Regarding,"SystemCustomization.Lookup.Format.regarding"),t.add(Vn.Persistent,"SystemCustomization.String.Source.persistent"),t.add(Vn.Calculated,"SystemCustomization.String.Source.calculated"),t.add(Vn.Rollup,"SystemCustomization.String.Source.rollup"),t.add(Vn.None,"SystemCustomization.String.Source.none"),t}static getDisplayNameResourceKey(t){return e.resourceKeyMap.getValue(t)}}});var $h,_c,Gn,an,Ic,as,zn,hr,se,Bh,kh,qh,Tt=D(()=>{"use strict";$h={ThreeEqColumn_FirstColumn:34,ThreeEqColumn_SecondColumn:33,ThreeEqColumn_ThirdColumn:33,FiveEqColumn:20},_c={ONE_COLUMN:"1",TWO_COLUMN:"2",THREE_COLUMN:"3",FOUR_COLUMN:"4"};(function(e){e[e.SUBGRID=0]="SUBGRID",e[e.SPACER=1]="SPACER",e[e.QUICK_VIEW=2]="QUICK_VIEW",e[e.WEB_RESOURCE=3]="WEB_RESOURCE",e[e.IFRAME=4]="IFRAME",e[e.BING_MAPS=5]="BING_MAPS",e[e.TIMER=6]="TIMER",e[e.TIMELINE=7]="TIMELINE",e[e.SOCIAL_INSIGHTS=8]="SOCIAL_INSIGHTS",e[e.KB_SEARCH=9]="KB_SEARCH",e[e.ACI_CONTROL=10]="ACI_CONTROL",e[e.RELATIONSHIP_ASSISTANT=11]="RELATIONSHIP_ASSISTANT",e[e.REFERENCE_PANEL=12]="REFERENCE_PANEL",e[e.REF_PANEL_QUICKVIEW=13]="REF_PANEL_QUICKVIEW",e[e.REF_PANEL_SUBGRID=14]="REF_PANEL_SUBGRID",e[e.REF_PANEL_KBSEARCH=15]="REF_PANEL_KBSEARCH",e[e.WEB_RESOURCE_HTML=16]="WEB_RESOURCE_HTML",e[e.PRED_LEAD_SCORING=17]="PRED_LEAD_SCORING"})(Gn||(Gn={}));(function(e){e.Left="Left",e.Right="Right",e.Center="Center"})(an||(an={}));(function(e){e[e.Mobile=0]="Mobile",e[e.Tablet=1]="Tablet",e[e.Web=2]="Web"})(Ic||(Ic={}));as=class{static ONE_COLUMN=1;static TWO_COLUMN=2;static THREE_COLUMN=3;static FIVE_COLUMN=5};(function(e){e.Left="Left",e.Top="Top"})(zn||(zn={}));hr=class{static StartTag="<"},se={ShowLabel:"true",LockLevel:"0",IsUserDefined:"0",LabelWidth:"115",columns:"1",ShowBar:"false",Layout:"varwidth",namePrefix:"_section_",labelAlignment:an.Left,labelPosition:zn.Left,MarginalControlColumns:"111",referencePanelNamePrefix:"ref_pan_"};(function(e){e.AddFormBodyFieldToReadOnlyHeader="AddFormBodyFieldToReadOnlyHeader",e.AddFieldPaneFieldToReadOnlyHeader="AddFieldPaneFieldToReadOnlyHeader",e.AddFieldExceedsReadOnlyHeaderLimit="AddFieldExceedsReadOnlyHeaderLimit",e.AddCustomComponentToReadOnlyHeader="AddCustomComponentToReadOnlyHeader",e.AddNonDisplayableComponentToReadOnlyHeader="AddNonDisplayableComponentToReadOnlyHeader",e.AddFieldToFlyoutOnly="AddFieldToFlyoutOnly",e.DisplayedFieldToFlyout="DisplayedFieldToFlyout",e.FlyoutFieldToDisplayed="FlyoutFieldToDisplayed",e.AddControlBeforeDefaultLabel="AddControlBeforeDefaultLabel"})(Bh||(Bh={}));(function(e){e.TabWithLockedFieldRemoval="TabWithLockedFieldRemoval",e.SectionWithLockedFieldRemoval="SectionWithLockedFieldRemoval",e.LockedSectionRemoval="LockedSectionRemoval",e.LockedFieldRemoval="LockedFieldRemoval",e.RequiredFieldRemoval="RequiredFieldRemoval",e.LastRemainingTab="LastRemainingTab",e.UnknownRemoval="UnknownRemoval"})(kh||(kh={}));(function(e){e.IsHeader="IsHeader",e.IsFooter="IsFooter",e.ContainedInHeader="ContainedInHeader",e.ContainedInFooter="ContainedInFooter",e.NoElementFound="NoElementFound",e.NoTarget="NoTarget",e.CannotAddControlToHeader="CannotAddControlToHeader",e.CannotAddControlToFooter="CannotAddControlToFooter"})(qh||(qh={}))});var ha=m(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.DateTimeBehavior=C.PrecisionSource=C.StringFormatName=C.SourceType=C.ImeMode=C.SolutionEntityTypeCodeExtToComponentTypeCode=C.SolutionComponentTypeCodeToEntityTypeCodeExt=C.SolutionComponentVirtualAttributeSubtype=C.EntityTypeCode=C.SolutionComponentTypeCodeExt=C.RootComponentBehavior=C.SolutionComponentTypeCode=C.EntityKeyIndexStatus=C.ViewStateCode=C.ViewStatusCode=C.RelationshipSecurityTypes=C.CascadeType=C.RelationshipTypeExt=C.RelationshipType=C.AppSubType=C.BusinessProcessType=C.WorkflowCategory=C.WorkflowScope=C.WorkflowTypeCode=C.StatusCodeEnabledDisabled=C.StateCodeEnabledDisabled=C.StatusCode=C.StateCode=C.OptionSetType=C.AttributeTypeCodeNum=C.AttributeFormatName=C.AttributeFormatCode=C.AttributeTypeName=C.AttributeTypeCode=C.PluginSourceType=C.AuthType=C.PluginIsolationMode=C.ComponentState=C.ChartType=C.ChartsType=C.ViewType=C.AttributeType=C.ActivationState=C.FormPresentation=C.FormType=C.TableTypeCode=C.TableTypes=C.ActivityTypeMask=C.PrincipalType=C.OwnershipTypes=void 0;C.QueryType=C.KnownCustomSolutionComponentEntitySetName=C.TeamTypeEnum=C.EnvironmentVariableDefinitionTypeEnum=C.ConnectorTypeEnum=C.RoleInheritance=C.DefaultRoleTemplates=C.DeleteDependencyErrorCode=C.ServiceEndpointConnectionMode=C.ServiceEndpointContract=C.ServiceNamespaceFormat=C.ConnectionRoleCategory=C.ReportTypeCode=C.SdkMessageProcessingMode=C.SupportedDeployment=C.SdkMessageProcessingStage=C.WebResourceTypeCode=C.IntegerFormat=C.DateTimeFormat=void 0;var Vh;(function(e){e.None="None",e.UserOwned="UserOwned",e.TeamOwned="TeamOwned",e.BusinessOwned="BusinessOwned",e.OrganizationOwned="OrganizationOwned",e.BusinessParented="BusinessParented",e.Filtered="Filtered"})(Vh||(C.OwnershipTypes=Vh={}));var Gh;(function(e){e.User="Microsoft.Dynamics.CRM.systemuser",e.Team="Microsoft.Dynamics.CRM.team"})(Gh||(C.PrincipalType=Gh={}));var zh;(function(e){e[e.DoNotDisplayInActivityMenus=0]="DoNotDisplayInActivityMenus",e[e.DisplayInActivityMenus=1]="DisplayInActivityMenus"})(zh||(C.ActivityTypeMask=zh={}));var Wh;(function(e){e.Activity="Activity",e.Virtual="Virtual",e.Standard="Standard",e.Elastic="Elastic"})(Wh||(C.TableTypes=Wh={}));var jh;(function(e){e.Standard="Standard",e.Virtual="Virtual",e.Elastic="Elastic"})(jh||(C.TableTypeCode=jh={}));var Hh;(function(e){e[e.Dashboard=0]="Dashboard",e[e.AppointmentBook=1]="AppointmentBook",e[e.Main=2]="Main",e[e.MiniCampaignBO=3]="MiniCampaignBO",e[e.Preview=4]="Preview",e[e.MobileExpress=5]="MobileExpress",e[e.QuickViewForm=6]="QuickViewForm",e[e.QuickCreate=7]="QuickCreate",e[e.Dialog=8]="Dialog",e[e.TaskFlowForm=9]="TaskFlowForm",e[e.InteractionCentricDashboard=10]="InteractionCentricDashboard",e[e.Card=11]="Card",e[e.MainInteractiveExperience=12]="MainInteractiveExperience",e[e.Other=100]="Other",e[e.MainBackup=101]="MainBackup",e[e.AppointmentBookBackup=102]="AppointmentBookBackup",e[e.PowerBIDashboard=103]="PowerBIDashboard"})(Hh||(C.FormType=Hh={}));var Jh;(function(e){e[e.ClassicForm=0]="ClassicForm",e[e.AirForm=1]="AirForm",e[e.ConvertedICForm=2]="ConvertedICForm"})(Jh||(C.FormPresentation=Jh={}));var Qh;(function(e){e[e.Inactive=0]="Inactive",e[e.Active=1]="Active"})(Qh||(C.ActivationState=Qh={}));var Xh;(function(e){e[e.String=0]="String",e[e.Number=1]="Number",e[e.Picklist=2]="Picklist"})(Xh||(C.AttributeType=Xh={}));var Kh;(function(e){e[e.Public=0]="Public",e[e.AdvancedFind=1]="AdvancedFind",e[e.Associated=2]="Associated",e[e.QuickFind=4]="QuickFind",e[e.Lookup=64]="Lookup"})(Kh||(C.ViewType=Kh={}));var Yh;(function(e){e[e.ASPChart=0]="ASPChart",e[e.PowerBI=1]="PowerBI"})(Yh||(C.ChartsType=Yh={}));var Zh;(function(e){e[e.DataAndInteractionCentric=0]="DataAndInteractionCentric",e[e.InteractionCentric=1]="InteractionCentric"})(Zh||(C.ChartType=Zh={}));var eg;(function(e){e[e.Published=0]="Published",e[e.Unpublished=1]="Unpublished",e[e.Deleted=2]="Deleted",e[e.DeletedUnpublished=3]="DeletedUnpublished"})(eg||(C.ComponentState=eg={}));var tg;(function(e){e[e.None=1]="None",e[e.Sandbox=2]="Sandbox",e[e.External=3]="External"})(tg||(C.PluginIsolationMode=tg={}));var rg;(function(e){e[e.BasicAuth=0]="BasicAuth"})(rg||(C.AuthType=rg={}));var ng;(function(e){e[e.Database=0]="Database",e[e.Disk=1]="Disk",e[e.Normal=2]="Normal",e[e.AzureWebApp=3]="AzureWebApp"})(ng||(C.PluginSourceType=ng={}));var ig;(function(e){e.Boolean="Boolean",e.Customer="Customer",e.Date="Date",e.DateTime="DateTime",e.DateTimeNoTimeZone="DateTimeNoTimeZone",e.Decimal="Decimal",e.Double="Double",e.Integer="Integer",e.Lookup="Lookup",e.Memo="Memo",e.Money="Money",e.Owner="Owner",e.PartyList="PartyList",e.Picklist="Picklist",e.State="State",e.Status="Status",e.String="String",e.Uniqueidentifier="Uniqueidentifier",e.CalendarRules="CalendarRules",e.Virtual="Virtual",e.BigInt="BigInt",e.ManagedProperty="ManagedProperty",e.EntityName="EntityName"})(ig||(C.AttributeTypeCode=ig={}));var ag;(function(e){e.DateTimeType="DateTimeType",e.ImageType="ImageType",e.IntegerType="IntegerType",e.FileType="FileType",e.BooleanType="BooleanType",e.CustomerType="CustomerType",e.MemoType="MemoType",e.MultiSelectPicklistType="MultiSelectPicklistType",e.MoneyType="MoneyType",e.DecimalType="DecimalType",e.DoubleType="DoubleType",e.LookupType="LookupType",e.BigIntType="BigIntType",e.UniqueidentifierType="UniqueidentifierType",e.StringType="StringType",e.OwnerType="OwnerType",e.PicklistType="PicklistType",e.StateType="StateType",e.StatusType="StatusType",e.EntityNameType="EntityNameType"})(ag||(C.AttributeTypeName=ag={}));var og;(function(e){e.Email="Email",e.Text="Text",e.TextArea="TextArea",e.Url="Url",e.TickerSymbol="TickerSymbol",e.PhoneticGuide="PhoneticGuide",e.VersionNumber="VersionNumber",e.Phone="Phone",e.Json="Json",e.RichText="RichText",e.DateOnly="DateOnly",e.DateAndTime="DateAndTime",e.None="None",e.Duration="Duration",e.TimeZone="TimeZone",e.Language="Language",e.Locale="Locale"})(og||(C.AttributeFormatCode=og={}));var sg;(function(e){e.Text="Text",e.TextArea="TextArea",e.Email="Email",e.Url="Url",e.Phone="Phone",e.Json="Json",e.RichText="RichText",e.TickerSymbol="TickerSymbol",e.PhoneticGuide="PhoneticGuide",e.VersionNumber="VersionNumber",e.DateOnly="DateOnly",e.DateAndTime="DateAndTime"})(sg||(C.AttributeFormatName=sg={}));var lg;(function(e){e[e.Boolean=0]="Boolean",e[e.Customer=1]="Customer",e[e.DateTime=2]="DateTime",e[e.Decimal=3]="Decimal",e[e.Double=4]="Double",e[e.Integer=5]="Integer",e[e.Lookup=6]="Lookup",e[e.Memo=7]="Memo",e[e.Money=8]="Money",e[e.Owner=9]="Owner",e[e.PartyList=10]="PartyList",e[e.Picklist=11]="Picklist",e[e.State=12]="State",e[e.Status=13]="Status",e[e.String=14]="String",e[e.Uniqueidentifier=15]="Uniqueidentifier",e[e.CalendarRules=16]="CalendarRules",e[e.Virtual=17]="Virtual",e[e.BigInt=18]="BigInt",e[e.ManagedProperty=19]="ManagedProperty",e[e.EntityName=20]="EntityName"})(lg||(C.AttributeTypeCodeNum=lg={}));var ug;(function(e){e.Picklist="Picklist",e.State="State",e.Status="Status",e.Boolean="Boolean"})(ug||(C.OptionSetType=ug={}));var cg;(function(e){e[e.Draft=0]="Draft",e[e.Activated=1]="Activated"})(cg||(C.StateCode=cg={}));var dg;(function(e){e[e.Draft=1]="Draft",e[e.Activated=2]="Activated"})(dg||(C.StatusCode=dg={}));var pg;(function(e){e[e.Enabled=0]="Enabled",e[e.Disabled=1]="Disabled"})(pg||(C.StateCodeEnabledDisabled=pg={}));var fg;(function(e){e[e.Enabled=1]="Enabled",e[e.Disabled=2]="Disabled"})(fg||(C.StatusCodeEnabledDisabled=fg={}));var mg;(function(e){e[e.Definition=1]="Definition",e[e.Activation=2]="Activation",e[e.Template=3]="Template"})(mg||(C.WorkflowTypeCode=mg={}));var hg;(function(e){e[e.User=1]="User",e[e.BusinessUnit=2]="BusinessUnit",e[e.ParentChildBusinessUnit=3]="ParentChildBusinessUnit",e[e.Organization=4]="Organization"})(hg||(C.WorkflowScope=hg={}));var gg;(function(e){e[e.Workflow=0]="Workflow",e[e.Dialog=1]="Dialog",e[e.BusinessRule=2]="BusinessRule",e[e.Action=3]="Action",e[e.BusinessProcessFlow=4]="BusinessProcessFlow",e[e.Flow=5]="Flow",e[e.UIFlow=6]="UIFlow"})(gg||(C.WorkflowCategory=gg={}));var vg;(function(e){e[e.None=-1]="None",e[e.BusinessFlow=0]="BusinessFlow",e[e.TaskFlow=1]="TaskFlow"})(vg||(C.BusinessProcessType=vg={}));var bg;(function(e){e[e.CanvasApp=0]="CanvasApp",e[e.ComponentLibrary=1]="ComponentLibrary",e[e.CustomCanvasPage=2]="CustomCanvasPage",e[e.UnifiedApp=3]="UnifiedApp",e[e.CodeApp=4]="CodeApp",e[e.MobileApp=5]="MobileApp"})(bg||(C.AppSubType=bg={}));var yg;(function(e){e.OneToManyRelationship="OneToManyRelationship",e.ManyToManyRelationship="ManyToManyRelationship"})(yg||(C.RelationshipType=yg={}));var Cg;(function(e){e.ManyToOneRelationship="ManyToOneRelationship",e.OneToManyRelationship="OneToManyRelationship",e.ManyToManyRelationship="ManyToManyRelationship"})(Cg||(C.RelationshipTypeExt=Cg={}));var Ag;(function(e){e.NoCascade="NoCascade",e.Cascade="Cascade",e.Active="Active",e.UserOwned="UserOwned",e.RemoveLink="RemoveLink",e.Restrict="Restrict"})(Ag||(C.CascadeType=Ag={}));var wg;(function(e){e.None="None",e.Append="Append",e.ParentChild="ParentChild",e.Pointer="Pointer",e.Inheritance="Inheritance"})(wg||(C.RelationshipSecurityTypes=wg={}));var Ng;(function(e){e[e.Active=1]="Active",e[e.Inactive=2]="Inactive"})(Ng||(C.ViewStatusCode=Ng={}));var Sg;(function(e){e[e.Active=0]="Active",e[e.Inactive=1]="Inactive"})(Sg||(C.ViewStateCode=Sg={}));var Dg;(function(e){e.Active="Active",e.Failed="Failed",e.InProgress="InProgress",e.Pending="Pending"})(Dg||(C.EntityKeyIndexStatus=Dg={}));var Eg;(function(e){e[e.Entity=1]="Entity",e[e.Attribute=2]="Attribute",e[e.OptionSet=9]="OptionSet",e[e.EntityRelationship=10]="EntityRelationship",e[e.EntityKey=14]="EntityKey",e[e.Role=20]="Role",e[e.DisplayString=22]="DisplayString",e[e.SavedQuery=26]="SavedQuery",e[e.Workflow=29]="Workflow",e[e.Report=31]="Report",e[e.Template=36]="Template",e[e.ContractTemplate=37]="ContractTemplate",e[e.KbArticleTemplate=38]="KbArticleTemplate",e[e.MailMergeTemplate=39]="MailMergeTemplate",e[e.RibbonCustomization=50]="RibbonCustomization",e[e.SavedQueryVisualization=59]="SavedQueryVisualization",e[e.SystemForm=60]="SystemForm",e[e.WebResource=61]="WebResource",e[e.SiteMap=62]="SiteMap",e[e.ConnectionRole=63]="ConnectionRole",e[e.HierarchyRule=65]="HierarchyRule",e[e.CustomControl=66]="CustomControl",e[e.FieldSecurityProfile=70]="FieldSecurityProfile",e[e.AppModule=80]="AppModule",e[e.PluginAssembly=91]="PluginAssembly",e[e.SdkMessageProcessingStep=92]="SdkMessageProcessingStep",e[e.ServiceEndpoint=95]="ServiceEndpoint",e[e.RoutingRule=150]="RoutingRule",e[e.SLA=152]="SLA",e[e.ConvertRule=154]="ConvertRule",e[e.MobileOfflineProfile=161]="MobileOfflineProfile",e[e.EntityDataProvider=181]="EntityDataProvider",e[e.EntityDataSource=183]="EntityDataSource",e[e.SdkMessage=201]="SdkMessage",e[e.CanvasApp=300]="CanvasApp",e[e.Connector=372]="Connector",e[e.EnvironmentVariableDefinition=380]="EnvironmentVariableDefinition",e[e.EnvironmentVariableValue=381]="EnvironmentVariableValue",e[e.AIModel=401]="AIModel",e[e.Dataflow=418]="Dataflow",e[e.DataflowEntities=419]="DataflowEntities",e[e.DualWriteEntityMap=500]="DualWriteEntityMap",e[e.DataIntegrationConnection=501]="DataIntegrationConnection",e[e.ExportToDataLakeConfig=510]="ExportToDataLakeConfig",e[e.Tour=10061]="Tour"})(Eg||(C.SolutionComponentTypeCode=Eg={}));var Ig;(function(e){e[e.IncludeSubcomponents=0]="IncludeSubcomponents",e[e.DoNotIncludeSubcomponents=1]="DoNotIncludeSubcomponents",e[e.IncludeAsShellOnly=2]="IncludeAsShellOnly"})(Ig||(C.RootComponentBehavior=Ig={}));var os;(function(e){e[e.Entity=1]="Entity",e[e.Attribute=2]="Attribute",e[e.OptionSet=9]="OptionSet",e[e.EntityRelationship=10]="EntityRelationship",e[e.EntityKey=14]="EntityKey",e[e.Role=20]="Role",e[e.DisplayString=22]="DisplayString",e[e.SavedQuery=26]="SavedQuery",e[e.Workflow=29]="Workflow",e[e.Report=31]="Report",e[e.Template=36]="Template",e[e.ContractTemplate=37]="ContractTemplate",e[e.KbArticleTemplate=38]="KbArticleTemplate",e[e.MailMergeTemplate=39]="MailMergeTemplate",e[e.RibbonCustomization=50]="RibbonCustomization",e[e.SavedQueryVisualization=59]="SavedQueryVisualization",e[e.SystemForm=60]="SystemForm",e[e.WebResource=61]="WebResource",e[e.SiteMap=62]="SiteMap",e[e.ConnectionRole=63]="ConnectionRole",e[e.HierarchyRule=65]="HierarchyRule",e[e.CustomControl=66]="CustomControl",e[e.FieldSecurityProfile=70]="FieldSecurityProfile",e[e.AppModule=80]="AppModule",e[e.PluginAssembly=91]="PluginAssembly",e[e.SdkMessageProcessingStep=92]="SdkMessageProcessingStep",e[e.ServiceEndpoint=95]="ServiceEndpoint",e[e.RoutingRule=150]="RoutingRule",e[e.SLA=152]="SLA",e[e.ConvertRule=154]="ConvertRule",e[e.MobileOfflineProfile=161]="MobileOfflineProfile",e[e.EntityDataProvider=181]="EntityDataProvider",e[e.EntityDataSource=183]="EntityDataSource",e[e.SdkMessage=201]="SdkMessage",e[e.CanvasApp=300]="CanvasApp",e[e.Connector=372]="Connector",e[e.EnvironmentVariableDefinition=380]="EnvironmentVariableDefinition",e[e.EnvironmentVariableValue=381]="EnvironmentVariableValue",e[e.AIModel=401]="AIModel",e[e.Dataflow=418]="Dataflow",e[e.DataflowEntities=419]="DataflowEntities",e[e.DualWriteEntityMap=500]="DualWriteEntityMap",e[e.DataIntegrationConnection=501]="DataIntegrationConnection",e[e.ExportToDataLakeConfig=510]="ExportToDataLakeConfig",e[e.DataWorkspace=10282]="DataWorkspace",e[e.Dashboard=100001]="Dashboard",e[e.InteractionCentricDashboard=100002]="InteractionCentricDashboard",e[e.Dialog=100003]="Dialog",e[e.PowerBIDashboard=100004]="PowerBIDashboard",e[e.BusinessRule=100021]="BusinessRule",e[e.ProcessFlow=100024]="ProcessFlow",e[e.Flow=100025]="Flow",e[e.UIFlow=100026]="UIFlow",e[e.ProcessNoFlow=100031]="ProcessNoFlow",e[e.AllDashboards=100032]="AllDashboards",e[e.FormsOnly=100033]="FormsOnly",e[e.ComponentLibrary=100034]="ComponentLibrary",e[e.CanvasAppsOnly=100035]="CanvasAppsOnly",e[e.CustomCanvasPage=100038]="CustomCanvasPage",e[e.CodeApp=100039]="CodeApp",e[e.MobileApp=100046]="MobileApp",e[e.ProcessNoFlowNoUIFlowNoBusinessRule=100036]="ProcessNoFlowNoUIFlowNoBusinessRule",e[e.ActionDefinition=100040]="ActionDefinition",e[e.ActionTemplate=100041]="ActionTemplate",e[e.DialogDefinition=100042]="DialogDefinition",e[e.DialogTemplate=100043]="DialogTemplate",e[e.WorkflowDefinition=100044]="WorkflowDefinition",e[e.WorkflowTemplate=100045]="WorkflowTemplate"})(os||(C.SolutionComponentTypeCodeExt=os={}));var ss;(function(e){e[e.Entity=9801]="Entity",e[e.Attribute=9802]="Attribute",e[e.OptionSet=9804]="OptionSet",e[e.EntityRelationship=9805]="EntityRelationship",e[e.EntityKey=9812]="EntityKey",e[e.Role=1036]="Role",e[e.DisplayString=4102]="DisplayString",e[e.SavedQuery=1039]="SavedQuery",e[e.Workflow=4703]="Workflow",e[e.Report=9100]="Report",e[e.Template=2010]="Template",e[e.ContractTemplate=2011]="ContractTemplate",e[e.KbArticleTemplate=1016]="KbArticleTemplate",e[e.MailMergeTemplate=9106]="MailMergeTemplate",e[e.SavedQueryVisualization=1111]="SavedQueryVisualization",e[e.SystemForm=1030]="SystemForm",e[e.WebResource=9333]="WebResource",e[e.SiteMap=4709]="SiteMap",e[e.ConnectionRole=3231]="ConnectionRole",e[e.HierarchyRule=8840]="HierarchyRule",e[e.CustomControl=9753]="CustomControl",e[e.FieldSecurityProfile=1200]="FieldSecurityProfile",e[e.AppModule=9006]="AppModule",e[e.PluginAssembly=4605]="PluginAssembly",e[e.SdkMessageProcessingStep=4608]="SdkMessageProcessingStep",e[e.ServiceEndpoint=4618]="ServiceEndpoint",e[e.RoutingRule=8181]="RoutingRule",e[e.SLA=9750]="SLA",e[e.ConvertRule=9300]="ConvertRule",e[e.MobileOfflineProfile=9866]="MobileOfflineProfile",e[e.EntityDataSource=85]="EntityDataSource",e[e.SdkMessage=4606]="SdkMessage",e[e.RibbonCustomization=1120]="RibbonCustomization",e[e.EntityDataProvider=181]="EntityDataProvider",e[e.CanvasApp=300]="CanvasApp",e[e.Connector=372]="Connector",e[e.MaskingRule=373]="MaskingRule",e[e.AttributeMaskingRule=374]="AttributeMaskingRule",e[e.EnvironmentVariableDefinition=380]="EnvironmentVariableDefinition",e[e.EnvironmentVariableValue=381]="EnvironmentVariableValue",e[e.AIModel=401]="AIModel",e[e.Plan=10283]="Plan",e[e.Dataflow=418]="Dataflow",e[e.DataflowEntities=419]="DataflowEntities",e[e.DualWriteEntityMap=500]="DualWriteEntityMap",e[e.DataIntegrationConnection=501]="DataIntegrationConnection",e[e.ExportToDataLakeConfig=510]="ExportToDataLakeConfig",e[e.TeamTemplate=511]="TeamTemplate",e[e.DataWorkspace=10282]="DataWorkspace",e[e.Dashboard=1030]="Dashboard",e[e.InteractionCentricDashboard=1032]="InteractionCentricDashboard",e[e.PowerBIDashboard=1034]="PowerBIDashboard",e[e.Dialog=1030]="Dialog",e[e.WebResourceImage=9333]="WebResourceImage",e[e.WebResourceSilverlight=9333]="WebResourceSilverlight",e[e.WebResourceCode=9333]="WebResourceCode",e[e.WebResourceData=9333]="WebResourceData",e[e.BusinessRule=4703]="BusinessRule",e[e.ActionDefinition=4703]="ActionDefinition",e[e.ActionTemplate=4703]="ActionTemplate",e[e.DialogDefinition=4703]="DialogDefinition",e[e.DialogTemplate=4703]="DialogTemplate",e[e.WorkflowDefinition=4703]="WorkflowDefinition",e[e.WorkflowTemplate=4703]="WorkflowTemplate",e[e.ProcessFlow=4703]="ProcessFlow",e[e.Flow=4703]="Flow",e[e.UIFlow=4703]="UIFlow",e[e.ProcessNoFlow=4703]="ProcessNoFlow",e[e.ProcessNoFlowNoUIFlowNoBusinessRule=4703]="ProcessNoFlowNoUIFlowNoBusinessRule",e[e.AllDashboards=1030]="AllDashboards",e[e.FormsOnly=1030]="FormsOnly",e[e.ComponentLibrary=300]="ComponentLibrary",e[e.CanvasAppsOnly=300]="CanvasAppsOnly",e[e.CustomCanvasPage=300]="CustomCanvasPage",e[e.CodeApp=300]="CodeApp",e[e.MobileApp=300]="MobileApp",e[e.Chatbot=10030]="Chatbot",e[e.Card=10276]="Card"})(ss||(C.EntityTypeCode=ss={}));var _g;(function(e){e.MultiSelectPicklist="MultiSelectPicklist",e.File="File",e.Image="Image"})(_g||(C.SolutionComponentVirtualAttributeSubtype=_g={}));function kO(e){let t=os[e];return ss[t]}C.SolutionComponentTypeCodeToEntityTypeCodeExt=kO;function qO(e){let t=ss[e];return os[t]}C.SolutionEntityTypeCodeExtToComponentTypeCode=qO;var Pg;(function(e){e.Active="Active",e.Auto="Auto",e.Disabled="Disabled",e.Inactive="Inactive"})(Pg||(C.ImeMode=Pg={}));var Og;(function(e){e[e.Simple=0]="Simple",e[e.Calculated=1]="Calculated",e[e.Rollup=2]="Rollup",e[e.Formula=3]="Formula",e[e.Prompt=4]="Prompt"})(Og||(C.SourceType=Og={}));var Fg;(function(e){e.Email="Email",e.Phone="Phone",e.PhoneticGuide="PhoneticGuide",e.Text="Text",e.TextArea="TextArea",e.TickerSymbol="TickerSymbol",e.Url="Url",e.VersionNumber="VersionNumber"})(Fg||(C.StringFormatName=Fg={}));var Tg;(function(e){e[e.PrecisionProperty=0]="PrecisionProperty",e[e.Organization=1]="Organization",e[e.TransactionCurrency=2]="TransactionCurrency"})(Tg||(C.PrecisionSource=Tg={}));var Rg;(function(e){e.UserLocal="UserLocal",e.DateOnly="DateOnly",e.TimeZoneIndependent="TimeZoneIndependent"})(Rg||(C.DateTimeBehavior=Rg={}));var xg;(function(e){e.DateOnly="DateOnly",e.DateAndTime="DateAndTime"})(xg||(C.DateTimeFormat=xg={}));var Lg;(function(e){e.None="None",e.Duration="Duration",e.TimeZone="TimeZone",e.Language="Language",e.Locale="Locale"})(Lg||(C.IntegerFormat=Lg={}));var Mg;(function(e){e[e.HTML=1]="HTML",e[e.CSS=2]="CSS",e[e.JScript=3]="JScript",e[e.XML=4]="XML",e[e.PNG=5]="PNG",e[e.JPG=6]="JPG",e[e.GIF=7]="GIF",e[e.Silverlight=8]="Silverlight",e[e.XSL=9]="XSL",e[e.ICO=10]="ICO",e[e.SVG=11]="SVG",e[e.RESX=12]="RESX"})(Mg||(C.WebResourceTypeCode=Mg={}));var Ug;(function(e){e[e.Initial=5]="Initial",e[e.PreValidation=10]="PreValidation",e[e.InternalPreOperationBeforeExternal=15]="InternalPreOperationBeforeExternal",e[e.PreOperation=20]="PreOperation",e[e.InternalPreOperationAfterExternal=25]="InternalPreOperationAfterExternal",e[e.MainOperation=30]="MainOperation",e[e.InternalPostOperationBeforeExternal=35]="InternalPostOperationBeforeExternal",e[e.PostOperation=40]="PostOperation",e[e.InternalPostOperationAfterExternal=45]="InternalPostOperationAfterExternal",e[e.PostOperationDeprecated=50]="PostOperationDeprecated",e[e.FinalPostOperation=55]="FinalPostOperation"})(Ug||(C.SdkMessageProcessingStage=Ug={}));var Bg;(function(e){e[e.ServerOnly=0]="ServerOnly",e[e.OutlookClientOnly=1]="OutlookClientOnly",e[e.Both=2]="Both"})(Bg||(C.SupportedDeployment=Bg={}));var kg;(function(e){e[e.Synchronous=0]="Synchronous",e[e.Asynchronous=1]="Asynchronous"})(kg||(C.SdkMessageProcessingMode=kg={}));var qg;(function(e){e[e.ReportingServicesReport=1]="ReportingServicesReport",e[e.OtherReport=2]="OtherReport",e[e.LinkedReport=3]="LinkedReport"})(qg||(C.ReportTypeCode=qg={}));var $g;(function(e){e[e.Business=1]="Business",e[e.Family=2]="Family",e[e.Social=3]="Social",e[e.Sales=4]="Sales",e[e.Other=5]="Other",e[e.Stakeholder=1e3]="Stakeholder",e[e.SalesTeam=1001]="SalesTeam",e[e.Service=1002]="Service"})($g||(C.ConnectionRoleCategory=$g={}));var Vg;(function(e){e[e.Name=1]="Name",e[e.Address=2]="Address"})(Vg||(C.ServiceNamespaceFormat=Vg={}));var Gg;(function(e){e[e.OneWay=1]="OneWay",e[e.Queue=2]="Queue",e[e.Rest=3]="Rest",e[e.TwoWay=4]="TwoWay",e[e.Topic=5]="Topic",e[e.PersistentQueue=6]="PersistentQueue",e[e.EventHub=7]="EventHub",e[e.WebHook=8]="WebHook"})(Gg||(C.ServiceEndpointContract=Gg={}));var zg;(function(e){e[e.Normal=1]="Normal",e[e.Federated=2]="Federated"})(zg||(C.ServiceEndpointConnectionMode=zg={}));var Wg;(function(e){e.CannotDeleteInUseComponent="0x8004f01f",e.CannotDeleteInUseAttribute="0x80048418",e.CannotDeleteInUseOptionSet="0x80048417",e.CannotDeleteInUseEntity="0x80048420",e.CannotUninstallWithDependencies="0x8004F01D"})(Wg||(C.DeleteDependencyErrorCode=Wg={}));var jg;(function(e){e.SystemAdministrator="627090FF-40A3-4053-8790-584EDC5BE201",e.SystemCustomizer="119F245C-3CC8-4B62-B31C-D1A046CED15D"})(jg||(C.DefaultRoleTemplates=jg={}));var Hg;(function(e){e[e.DefaultTeamPrivilege=0]="DefaultTeamPrivilege",e[e.DirectUserAndTeamPrivilege=1]="DirectUserAndTeamPrivilege"})(Hg||(C.RoleInheritance=Hg={}));var Jg;(function(e){e[e.NotSpecified=0]="NotSpecified",e[e.CustomConnector=1]="CustomConnector"})(Jg||(C.ConnectorTypeEnum=Jg={}));var Qg;(function(e){e[e.String=1e8]="String",e[e.Number=100000001]="Number",e[e.Boolean=100000002]="Boolean",e[e.JSON=100000003]="JSON",e[e.ConnectionReference=100000004]="ConnectionReference",e[e.Secret=100000005]="Secret"})(Qg||(C.EnvironmentVariableDefinitionTypeEnum=Qg={}));var Xg;(function(e){e[e.Owner=0]="Owner",e[e.Access=1]="Access",e[e.AADSecurityGroup=2]="AADSecurityGroup",e[e.AADOfficeGroup=3]="AADOfficeGroup"})(Xg||(C.TeamTypeEnum=Xg={}));var Kg;(function(e){e.Bots="bots"})(Kg||(C.KnownCustomSolutionComponentEntitySetName=Kg={}));var Yg;(function(e){e[e.MainApplicationView=0]="MainApplicationView",e[e.AdvancedSearch=1]="AdvancedSearch",e[e.SubGrid=2]="SubGrid",e[e.QuickFindSearch=4]="QuickFindSearch",e[e.Reporting=8]="Reporting",e[e.OfflineFilters=16]="OfflineFilters",e[e.MASearch=32]="MASearch",e[e.LookupView=64]="LookupView",e[e.SMAppointmentBookView=128]="SMAppointmentBookView",e[e.OutlookFilters=256]="OutlookFilters",e[e.AddressBookFilters=512]="AddressBookFilters",e[e.SavedQueryTypeOther=2048]="SavedQueryTypeOther",e[e.InteractiveWorkflowView=4096]="InteractiveWorkflowView",e[e.OfflineTemplate=8192]="OfflineTemplate",e[e.OutlookTemplate=131072]="OutlookTemplate",e[e.CustomDefinedView=16384]="CustomDefinedView"})(Yg||(C.QueryType=Yg={}))});var Pc,Zg=D(()=>{"use strict";(function(e){e.DefaultValue="defaultValue",e.Loaded="loaded"})(Pc||(Pc={}))});var r0,$O,e0,X6,K6,ga,t0,Y6,Z6,n0=D(()=>{"use strict";r0=ne(en());Ce();Bn();Lh();ma();Tt();$n();G();$O=ne(ha());Zg();(function(e){e.Model="Model",e.Canvas="Canvas",e.CustomPages="CustomPages"})(e0||(e0={}));X6={Read:rn.Read,Edit:rn.Edit,Both:rn.Both,Container:rn.Container},K6={input:qn.Input,bound:qn.Bound,output:qn.Output};(function(e){e[e.dataset=0]="dataset",e[e.property=1]="property",e[e.groups=2]="groups",e[e.group=3]="group"})(ga||(ga={}));(function(e){e[e.None=0]="None",e[e.HiddenControl=1]="HiddenControl",e[e.CompatibleDataTypesIsMissing=2]="CompatibleDataTypesIsMissing",e[e.TagNameIsUnsupported=3]="TagNameIsUnsupported",e[e.PropertyTypeIsUnsupported=4]="PropertyTypeIsUnsupported",e[e.PropertyTypeGroupIsUnsupported=5]="PropertyTypeGroupIsUnsupported"})(t0||(t0={}));Y6=new Set([E.Currency,E.Decimal,E.FP,E.Multiple,E.SingleLineEmail,E.SingleLinePhone,E.SingleLineText,E.SingleLineTextArea,E.SingleLineURL,E.SingleLineTickerSymbol,E.WholeNone,E.WholeDuration,E.WholeLanguage,E.WholeTimeZone,E.Enum,E.LookupSimple,E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding,E.TwoOptions,E.Boolean,E.PowerBIReport,E.DateAndTimeDateAndTime,E.DateAndTimeDateOnly,E.OptionSet,E.MultiSelectOptionSet,E.CardForm]),Z6={numbers:[E.WholeNone,E.FP,E.Decimal,E.Currency],text:[E.SingleLineText,E.SingleLineTextArea,E.Multiple],lookup:[E.LookupSimple,E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding],dates:[E.DateAndTimeDateOnly,E.DateAndTimeDateAndTime],allFields:[E.TwoOptions,E.DateAndTimeDateOnly,E.DateAndTimeDateAndTime,E.FP,E.Decimal,E.WholeNone,E.WholeDuration,E.WholeTimeZone,E.WholeLanguage,E.LookupSimple,E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding,E.Multiple,E.OptionSet,E.SingleLineText,E.SingleLineTextArea,E.SingleLineEmail,E.SingleLineURL,E.SingleLineTickerSymbol,E.SingleLinePhone]}});var Rt,ls,i0=D(()=>{"use strict";Rt=ne(en());Se();Ce();ze();Bn();$n();n0();ma();G();xe();Tt();ls=class extends q{constructor(t){super(h.customControl,t)}customControlId;get id(){let t=this.getProperty(p.id);return S.IsNullOrUndefined(t)?null:t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?new I(t.substr(1,t.length-2)):new I(t)}getParameters(){let t=new Map,r=this.getAllChildren();if(r&&r.length!==0&&r[0]){let n=r[0].getAllChildren();if(n!=null){for(let i of n)if(i&&i.getAllChildren().length>0){let a=i.getNodeName();t.get(a)?t.get(a).push(i):t.set(a,[i])}}}return t}getFormComponentValueByParameterName(t){let r=this.getParameters()?.get(Ke.value);if(r?.length>0){let n=r[0],i=n?.getAllChildren()?.length>0?n.getAllChildren().find(o=>o.getNodeName()===t):null,a=i?.getAllChildren()?.length>0?i.getAllChildren()[0].getNodeName():"";return this.normalizePropertyValue(a)}}getParameterValue(t){let r=this.getParameterNodeChild(t);return r&&this.normalizePropertyValue(r.getNodeName())}getParameterNodeChild(t){let r=this.getParameters().get(t);return r?.length>0&&r[0].getAllChildren()?.length>0?r[0].getAllChildren()[0]:null}getDatasetName(t){return t.getAllProperties().find(r=>r.key===Ke.name)?.value}getParameterChildrenValues(t,r,n){if(this.isDataSet(t)){let i=r.find(u=>u.key===Ke.name)?.value,a={Name:i,Type:E.Grid,Columns:[]},l=this.getParameters().get(Ke.dataset).find(u=>this.getDatasetName(u)===i).getAllChildren();for(let u of l){let c=u.getNodeName();if(u&&u.getAllChildren().length>0){let d=this.normalizePropertyValue(u.getAllChildren()[0].getNodeName());a[c]=d}}return a}}getParameterIsStatic(t){let r=!1,n=this.getParameters().get(t)[0],i=n&&n.getAllProperties();if(i){for(let a of i)if(a.key===p.static&&a.value==="true"){r=!0;break}}return r}get name(){return this.getProperty(p.Name)}get formFactor(){return this.getProperty(p.formFactor)}set formFactor(t){this.setProperty(p.formFactor,t)}async toJSON(t){if(this.id)return null;let r=await this.parametersToJSON(t),n=parseInt(this.formFactor,10);return{CustomControlId:this.customControlId,FormFactor:isNaN(n)?-1:n,Name:this.name,Version:null,Parameters:r,ShouldOverrideControlVisible:!1}}normalizePropertyValue(t){return t.startsWith(hr.StartTag)&&(t=t.substring(1)),t}async parametersToJSON(t){let r=[];if(!this.name)return r;try{let n=await t.formModelService.customControlDiscoveryService.getCustomControlMetadata(this.name);if(n)if(n.configurations){let i=n.configurations,a=this.getParameters();for(let[o,s]of a)if(this.isDataSet(o))for(let l of a.get(o)){let u=l.getAllProperties(),c=this.getDatasetName(l),d=i.get(c),f=await this.parameterJSON(o,u,d,t);r.push({Name:c,Value:f})}else if(this.isGroups(s))r.push({Name:o,Value:{Type:gh.GroupDefinition,Value:this.normalizePropertyValue(this.getParameterNodeChild(s[0].NodeName).NodeName)}}),i.get(o).groupSet?.forEach(u=>{u.groupConfigurableProperties.forEach(async c=>{let d=c.name;c.propertyType===ga.dataset?a.get(Ke.dataset)?.some(g=>this.getDatasetName(g)===d)||r.push({Name:d,Value:{Name:d,Columns:[],Type:E.Grid}}):c.propertyType===ga.property&&(a.has(d)||r.push({Name:d,Value:{Usage:c.usage}}))})});else{let l=s[0].getAllProperties(),u=i.get(o),c=await this.parameterJSON(o,l,u,t);if(c)r.push({Name:o,Value:c});else{(0,Rt.trackInfoTrace)(Qe,{eventName:`${fr}/parametersToJSON`,eventData:{message:`Configuration metadata for custom control parameter ${o} is not available for custom control : ${this.name}.`}}),r=[];break}}}else(0,Rt.trackErrorTrace)(Qe,{eventName:`${fr}/parametersToJSON`,eventData:{message:"Custom Control Manifest Property Info not available"}},new Error(`Custom Control Manifest Property Info not available for custom control : ${this.name}.`));else(0,Rt.trackErrorTrace)(Qe,{eventName:`${fr}/parametersToJSON`,eventData:{message:"Custom Control Manifest not found"}},new Error(`No custom control manifest found for ${this.name}`))}catch(n){(0,Rt.trackErrorTrace)(Qe,{eventName:`${fr}/parametersToJSON`,eventData:{message:"parameters to json failed"}},n)}return r}async parameterJSON(t,r,n,i){if(this.isDataSet(t)){let a=n,o=r.find(s=>s.key===Ke.name)?.value;if(a)return this.getParameterChildrenValues(t,r);{let s=new Error(`No dataset manifest info for ${o}`);(0,Rt.trackErrorTrace)(Qe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing custom control manifest dataset info"}},s)}}else{let a=n,o=r&&r.find(l=>l.key===p.Type),s=a&&!a.ofTypeGroup.every(l=>!uc.includes(l));if(this.isLookupType(o?.value)||this.isLookupType(a?.ofType)||s)if(a){let l=a.usage,u=this.getParameterIsStatic(t),c=a.isPrimary;if(this.name===Rr.FormComponent){let d=this.getFormComponentValueByParameterName(p.bindAttribute),f=await i.formModelService.loadLookupModel(d),g=f.lookupColumn,b=this.getLookupDataTypeFromAttributeMetadata(g);return{Name:t,Type:b,Usage:l,Static:u,Primary:c,EntityName:f.primaryTableName,Value:d,ViewId:this.getFormComponentValueByParameterName(hh.DefaultViewId),TargetEntityType:g.targets[0],FilterRelationshipName:this.getFormComponentValueByParameterName(p.FilterRelationshipName),AvailableViewIds:this.getFormComponentValueByParameterName(p.AvailableViewIds),DependentAttributeName:this.getFormComponentValueByParameterName(p.DependentAttributeName),DependentAttributeType:this.getFormComponentValueByParameterName(p.DependentAttributeType),AllowFilterOff:P.IsStrictTrue(this.getFormComponentValueByParameterName(p.AllowFilterOff)),DisableQuickFind:P.IsStrictTrue(this.getFormComponentValueByParameterName(p.DisableQuickFind)),EnableViewPicker:!P.IsStrictTrue(this.getFormComponentValueByParameterName(p.DisableViewPicker))}}return{Name:t,Usage:l,Static:u,Primary:c,Value:this.getParameterValue(t)}}else{let l=new Error(`No lookup manifest info for ${t}`);(0,Rt.trackErrorTrace)(Qe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing custom control manifest lookup property info"}},l)}if(a){let l=a.usage,u=this.getParameterIsStatic(t),c=this.getParameterValue(t),d=a.isPrimary;if(o){let g=o.value;return{Type:g,Static:u,Usage:l,Value:this.isNumberTypeProperty(a,g)&&Number(c)?Number(c):c,Primary:d}}if(a.ofType)return{Type:a.ofType,Static:u,Usage:l,Value:c,Primary:!0};if(a.ofTypeGroup)return{Static:u,Usage:l,Value:c,Primary:!0};let f=new Error(`No property type info for ${t}`);(0,Rt.trackErrorTrace)(Qe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing property type info"}},f)}else{let l=new Error(`No property manifest info for ${t}`);(0,Rt.trackWarningTrace)(Qe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing custom control manifest property info"}},l)}}return null}getLookupDataTypeFromAttributeMetadata(t){let{attributeType:r,format:n}=t;switch(r){case O.Customer:return E.LookupCustomer;case O.Owner:return E.LookupOwner;case O.PartyList:return E.LookupPartyList;default:return n===L.Regarding?E.LookupRegarding:E.LookupSimple}}isLookupType(t){return uc.includes(t)}isNumberTypeProperty(t,r){return cc.includes(r)||t.ofTypeGroup.some(n=>cc.includes(n))}isDataSet(t){return Ke.dataset===t}isGroups(t){return!!t[0].getAllProperties().find(n=>n.key==="isGroup"&&n.value==="true")}}});var U,Oc=D(()=>{"use strict";U=class{static get CustomControl(){return"CustomControl"}static get ACIControl(){return"ACIControl"}static get ReferencePanelSearchWidget(){return"ReferencePanelSearchWidget"}static get SearchWidgetControl(){return"SearchWidgetControl"}static get SocialInsightControl(){return"SocialInsightControl"}static get NotesControl(){return"notescontrol"}static get TimerControl(){return"TimerControl"}static get MapsControl(){return"MapsControl"}static get IframeControl(){return"IframeControl"}static get WebResourceHtmlControl(){return"WebResourceHtmlControl"}static get QuickFormCollectionControl(){return"QuickFormCollectionControl"}static get QuickFormControl(){return"QuickFormControl"}static get GridControl(){return"GridControl"}static get SubGridControl(){return"SubGridControl"}static get WebResourceImageControl(){return"WebResourceImageControl"}static get TimeLineControl(){return"TimeLineControl"}static get LeadScoringControl(){return"LeadScoringControl"}}});var F,Wn,Ee,us=D(()=>{"use strict";Se();la();Ce();ze();ma();Zr();Oc();Tt();F=class{static get TextBoxControl(){return"4273EDBD-AC1D-40d3-9FB2-095C621B552D"}static get TickerControl(){return"1E1FC551-F7A8-43af-AC34-A8DC35C7B6D4"}static get UrlControl(){return"71716B6C-711E-476c-8AB8-5D11542BFB47"}static get PhoneNumberControl(){return"8C10015A-B339-4982-9474-A95FE05631A5"}static get EmailAddressControl(){return"ADA2203E-B4CD-49be-9DDF-234642B43B52"}static get RadioControl(){return"67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED"}static get LookupControl(){return"270BD3DB-D9AF-4782-9025-509E298DEC0A"}static get DateTimeControl(){return"5B773807-9FB2-42db-97C3-7A91EFF8ADFF"}static get IntegerControl(){return"C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F"}static get MoneyControl(){return"533B9E00-756B-4312-95A0-DC888637AC78"}static get FloatControl(){return"0D2C745A-E5A8-4c8f-BA63-C6D3BB604660"}static get DecimalControl(){return"C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E"}static get TextAreaControl(){return"E0DECE4B-6FC8-4a8f-A065-082708572369"}static get PicklistControl(){return"3EF39988-22BB-4f0b-BBBE-64B5A3748AEE"}static get HiddenInputControl(){return"5546E6CD-394C-4BEE-94A8-4425E17EF6C6"}static get GridControl(){return"E7A81278-8635-4D9E-8D4D-59480B391C5B"}static get CheckBoxControl(){return"B0C6723A-8503-4fd7-BB28-C8A06AC933C2"}static get IframeControl(){return"FD2A7985-3187-444e-908D-6624B21F69C0"}static get SocialInsightControl(){return"86B9E25E-695E-4FEF-AC69-F05CFA96739C"}static get OrgInsightsControl(){return"76B9E25E-695E-4FEF-AC69-F05CFA96739C"}static get DurationControl(){return"AA987274-CE4E-4271-A803-66164311A958"}static get RegardingControl(){return"F3015350-44A2-4aa0-97B5-00166532B5E9"}static get PartyListControl(){return"CBFB742C-14E7-4a17-96BB-1A13F7F64AA2"}static get TimeLineControl(){return"06375649-c143-495e-a496-c962e5b4488e"}static get TimeLineControlUC(){return"06375649-C143-495E-A496-C962E5B4488E"}static get TimeZonePicklistControl(){return"7C624A0B-F59E-493d-9583-638D34759266"}static get LanguagePickerControl(){return"671A9387-CA5A-4d1e-8AB7-06E39DDCF6B5"}static get AccessTeamTablePickerControl(){return"3F4E2A56-F102-4B4D-AB9C-F1574CA5BFDA"}static get KBViewerControl(){return"A62B6FA9-169E-406C-B1AA-EAB828CB6026"}static get PicklistStatusControl(){return"5D68B988-0661-4db2-BC3E-17598AD3BE6C"}static get EmailBodyControl(){return"6F3FB987-393B-4d2d-859F-9D0F0349B6AD"}static get PicklistLookupControl(){return"2305E33A-BAD3-4022-9E15-1856CF218333"}static get RelationshipRolePicklistControl(){return"5F986642-5961-4D9F-AB5E-643D71E231E9"}static get RelatedInformationControl(){return"163B90A6-EB64-49D2-9DF8-3C84A4F0A0F8"}static get CoverPagePicklistControl(){return"4168A05C-D857-46AF-8457-5BB47EB04EA1"}static get MailMergeLanguagePickerControl(){return"B634828E-C390-444A-AFE6-E07315D9D970"}static get ConnectionControl(){return"3246F906-1F71-45F7-B11F-D7BE0F9D04C9"}static get ConnectionRoleObjectTypeListControl(){return"821ACF1A-7E46-4A0C-965D-FE14A57D78C7"}static get MapsControl(){return"62B0DF79-0464-470F-8AF7-4483CFEA0C7D"}static get MapLinkControl(){return"91DC0675-C8B9-4421-B1E0-261CEBF02BAC"}static get WebResourceHtmlControl(){return"9FDF5F91-88B1-47F4-AD53-C11EFC01A01D"}static get WebResourceImageControl(){return"587CDF98-C1D5-4BDE-8473-14A0BC7644A7"}static get WebResourceSilverlightControl(){return"080677DB-86EC-4544-AC42-F927E74B491F"}static get ReportControl(){return"A28F441B-916C-4865-87FD-0C5D53BD59C9"}static get ArticleContentControl(){return"F02EF977-2564-4B9A-B2F0-DF083D8A019B"}static get ProcessControl(){return"06E9F7AF-1F54-4681-8EEC-1E21A1CEB465"}static get ActivitiesWallControl(){return"6636847D-B74D-4994-B55A-A6FAF97ECEA2"}static get QuickFormControl(){return"69AF7DCA-2E3B-4EE7-9201-0DA731DD2413"}static get QuickFormCollectionControl(){return"5C5600E0-1D6E-4205-A272-BE80DA87FD42"}static get LinkControl(){return"DFDF1CDE-837B-4AC9-98CF-AC74361FD89D"}static get CompositionLinkControl(){return"DB1284EF-9FFC-4E99-B382-0CC082FE2364"}static get ErrorStatusControl(){return"F4C16ECA-CA81-4E39-9448-834B8378721E"}static get ActivitiesContainerControl(){return"C72511AB-84E5-4FB7-A543-25B4FC01E83E"}static get AccessPrivilegeControl(){return"F93A31B2-99AC-4084-8EC2-D4027C31369A"}static get TimerControl(){return"9C5CA0A1-AB4D-4781-BE7E-8DFBE867B87E"}static get DynamicPropertyListControl(){return"6896F004-B17A-4202-861E-8B7EA2080E0B"}static get ButtonControl(){return"00AD73DA-BD4D-49C6-88A8-2F4F4CAD4A20"}static get SearchWidgetControl(){return"E616A57F-20E0-4534-8662-A101B5DDF4E0"}static get EmailRecipientActivityControl(){return"26E9760F-7454-40DE-BB07-F6DCCCB82040"}static get LabelControl(){return"39354E4A-5015-4D74-8031-EA9EB73A1322"}static get CustomControl(){return"F9A8A302-114E-466A-B582-6771B2AE0D92"}static get EditFilterControl(){return"1479835F-F852-4679-B864-C6892A2844C9"}static get RichEditorControl(){return"F94DB24F-263D-44A7-B38E-A35E9854812B"}static get PowerBIControl(){return"8C54228C-1B25-4909-A12A-F2B968BB0D62"}static get EmailEngagementActionsControl(){return"F454228D-1D25-4319-E12F-D27968BC0234"}static get ACIControl(){return"C8BFBBEF-6851-4401-A0CC-7450062FE085"}static get ChoicesControl(){return"4AA28AB7-9C13-4F57-A73D-AD894D048B5F"}static get ReferencePanelSubgridControl(){return"02D4264B-47E2-4B4C-AA95-F439F3F4D458"}static get ReferencePanelSearchWidget(){return"7CCD1494-1F7A-4E3A-8BDE-F32069DAEB9F"}static get ReferencePanelQuickFormCollectionControl(){return"B68B05F0-A46D-43F8-843B-917920AF806A"}static get SpacerControl(){return"E4BAB03A-A9A5-4C23-CC3B-54AA680150E2"}},Wn=class{static get RelationshipAssistant(){return"3ff9a528-dd50-4aca-8f10-2e5ed73513ad"}static get PredictiveLeadScoring(){return"6f503f2a-d033-4106-b62c-f8f2e5f01a57"}},Ee=class e{static FieldControlIds=e.initializeFieldControls();static UnboundControlIds=e.initializeUnboundControls();static ControlsAllowedForReferencePanel=e.initializeReferencePanelControls();static ControlsAllowedForFooter=e.initializeFooterControls();static CustomControlIdMap=new Xe;static initializeFieldControls(){let t=new Xe,r=e.getControlName(O.SingleLineofText,L.Phone);t.add(r,new I(F.PhoneNumberControl));let n=e.getControlName(O.SingleLineofText,L.TextArea);t.add(n,new I(F.TextAreaControl));let i=e.getControlName(O.SingleLineofText,L.Text);t.add(i,new I(F.TextBoxControl));let a=e.getControlName(O.SingleLineofText,L.Email);t.add(a,new I(F.EmailAddressControl));let o=e.getControlName(O.SingleLineofText,L.Url);t.add(o,new I(F.UrlControl));let s=e.getControlName(O.SingleLineofText,L.TickerSymbol);t.add(s,new I(F.TickerControl));let l=e.getControlName(O.SingleLineofText,L.PhoneticGuide);t.add(l,new I(F.TextBoxControl));let u=e.getControlName(O.WholeNumber,L.Duration);t.add(u,new I(F.DurationControl));let c=e.getControlName(O.WholeNumber,L.Language);t.add(c,new I(F.LanguagePickerControl));let d=e.getControlName(O.WholeNumber,L.TimeZone);t.add(d,new I(F.TimeZonePicklistControl));let f=e.getControlName(O.WholeNumber,L.None);t.add(f,new I(F.IntegerControl));let g=e.getControlName(O.DateTime,L.DateOnly);t.add(g,new I(F.DateTimeControl));let b=e.getControlName(O.DateTime,L.DateAndTime);t.add(b,new I(F.DateTimeControl));let w=e.getControlName(O.LookupType,L.None);t.add(w,new I(F.LookupControl));let N=e.getControlName(O.CustomerType,L.None);t.add(N,new I(F.LookupControl));let _=e.getControlName(O.FloatingPointNumber,L.None);t.add(_,new I(F.FloatControl));let T=e.getControlName(O.DecimalNumber,L.None);t.add(T,new I(F.DecimalControl));let R=e.getControlName(O.Currency,L.None);t.add(R,new I(F.MoneyControl));let M=e.getControlName(O.MultipleLineofText,L.None);t.add(M,new I(F.TextAreaControl));let W=e.getControlName(O.MultipleLineofText,L.Text);t.add(W,new I(F.TextAreaControl));let B=e.getControlName(O.MultipleLineofText,L.TextArea);t.add(B,new I(F.TextAreaControl));let j=e.getControlName(O.MultipleLineofText,L.Email);t.add(j,new I(F.EmailBodyControl));let k=e.getControlName(O.OptionSet,L.None);t.add(k,new I(F.PicklistControl));let $=e.getControlName(O.TwoOptions,L.None);t.add($,new I(F.RadioControl));let re=e.getControlName(O.Image,L.None);t.add(re,new I(F.WebResourceImageControl));let H=e.getControlName(O.Image,L.None);t.add(H,new I(F.WebResourceHtmlControl));let nr=e.getControlName(O.TwoOptions,"Radio");t.add(nr,new I(F.RadioControl));let El=e.getControlName(O.TwoOptions,"CheckBox");t.add(El,new I(F.CheckBoxControl));let Oi=e.getControlName(O.TwoOptions,"List");t.add(Oi,new I(F.PicklistControl));let io=e.getControlName(O.State,L.None);t.add(io,new I(F.PicklistControl));let le=e.getControlName(O.Status,L.None);t.add(le,new I(F.PicklistStatusControl));let tt=e.getControlName(O.OwnerType,L.None);t.add(tt,new I(F.LookupControl));let Il=e.getControlName(O.PartyListType,L.None);t.add(Il,new I(F.PartyListControl));let ED=e.getControlName(O.LookupType,L.Regarding);t.add(ED,new I(F.RegardingControl));let ID=e.getControlName(O.MultiSelectOptionSet,L.None);return t.add(ID,new I(F.ChoicesControl)),t}static getControlName(t,r){return t+"_"+r}static getControlIdByTypeAndFormat(t,r){let n=e.getControlName(t.toString(),r.toString());return e.FieldControlIds.containsKey(n)?e.FieldControlIds.getValue(n):null}static getTypeAndFormatByControlOrUniqueId(t){for(let r in e.FieldControlIds.getKeys())if(e.FieldControlIds.getValue(e.FieldControlIds.getKeys()[r]).guidString.toLowerCase()===t)return e.FieldControlIds.getKeys()[r]}static getControlDataTypeByControlOrUniqueId(t){if(!S.IsNullOrEmptyGuid(t)){let r=e.getTypeAndFormatByControlOrUniqueId(t.guidString.toLowerCase());return r=S.IsNullOrUndefined(r)?e.getUnboundControlNameFromIdentifier(t):r.substring(0,r.indexOf("_")),r}return null}static isCustomControl(t){return S.IsNullOrUndefined(t.control)||S.IsNullOrUndefined(t.control.ClassId)||t.control.ClassId.guidString===F.CustomControl}static initializeUnboundControls(){let t=new Xe;return t.add(F.ACIControl,U.ACIControl),t.add(F.IframeControl,U.IframeControl),t.add(F.SearchWidgetControl,U.SearchWidgetControl),t.add(F.MapsControl,U.MapsControl),t.add(F.QuickFormCollectionControl,U.QuickFormCollectionControl),t.add(F.GridControl,U.SubGridControl),t.add(F.WebResourceImageControl,U.WebResourceImageControl),t.add(F.WebResourceHtmlControl,U.WebResourceHtmlControl),t.add(F.ReferencePanelSearchWidget,U.SearchWidgetControl),t.add(F.ReferencePanelQuickFormCollectionControl,U.QuickFormCollectionControl),t.add(F.ReferencePanelSubgridControl,U.SubGridControl),t.add(F.TimerControl,U.TimerControl),t.add(F.TimeLineControl,U.NotesControl),t.add(F.TimeLineControlUC,U.NotesControl),t.add(F.SocialInsightControl,U.SocialInsightControl),t.add(Wn.RelationshipAssistant,U.CustomControl),t}static initializeReferencePanelControls(){let t=new Xe;return t.add(F.IframeControl,U.IframeControl),t.add(F.ReferencePanelSearchWidget,U.SearchWidgetControl),t.add(F.ReferencePanelQuickFormCollectionControl,U.QuickFormCollectionControl),t.add(F.ReferencePanelSubgridControl,U.SubGridControl),t.add(F.WebResourceHtmlControl,U.WebResourceHtmlControl),t.add(F.WebResourceImageControl,U.WebResourceHtmlControl),t}static initializeFooterControls(){let t=new kn;return t.add(Gn.IFRAME,!0),t.add(Gn.SPACER,!0),t.add(Gn.WEB_RESOURCE_HTML,!0),t}static isUnboundFormControl(t){if(S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.control)||S.IsNullOrUndefined(t.control.ClassId))return!1;let r=e.getUniqueIdentifierForControl(t.control);return e.UnboundControlIds.containsKey(r.guidString)}static isReferencePanelSection(t){return!S.IsNullOrUndefined(t)&&!S.IsNullOrUndefined(t.Name)&&t.Name.indexOf(se.referencePanelNamePrefix)===0}static isUnboundFormControlByIdentifier(t){return S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.guidString)?!1:e.UnboundControlIds.containsKey(t.guidString)}static getUnboundFormControlName(t){let r=P.EmptyString;if(S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.control)||S.IsNullOrUndefined(t.control.ClassId))return r;let n=e.getUniqueIdentifierForControl(t.control);return e.UnboundControlIds.getValue(n.guidString).toString()}static getUnboundControlNameFromIdentifier(t){return S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.guidString)?P.EmptyString:e.UnboundControlIds.getValue(t.guidString).toString()}static isSpacerControl(t){return t===F.SpacerControl}static GetRowSpan(t){let r=t.ClassId;if(e.isRelationshipAssistantControl(t))r=t.UniqueId;else if(r.guidString===F.CustomControl&&!S.IsNullOrUndefined(t.UniqueId)){let n=t.UniqueId.ToString();e.CustomControlIdMap.containsKey(n)&&(r=e.CustomControlIdMap.getValue(n))}switch(e.UnboundControlIds.getValue(r.guidString)){case U.IframeControl:case U.ACIControl:case U.SocialInsightControl:return 6;case U.SubGridControl:case U.CustomControl:return 4;case U.WebResourceImageControl:return 15;case U.WebResourceHtmlControl:return 15;case U.MapsControl:return 8;case U.SearchWidgetControl:return 10;case U.NotesControl:case U.TimeLineControl:return 15;case U.TimerControl:return 2;default:}}static isLookUpControl(t){return!S.IsNullOrUndefined(t)&&t.ClassId.guidString===F.LookupControl}static isRelationshipAssistantOrLeadScoringControl(t){return!S.IsNullOrUndefined(t)&&e.isRelationshipAssistantOrLeadScoring(t.UniqueId)}static isRelationshipAssistantOrLeadScoring(t){return!S.IsNullOrUndefined(t)&&(t.guidString===Wn.RelationshipAssistant||t.guidString===Wn.PredictiveLeadScoring)}static isRelationshipAssistantControl(t){return!S.IsNullOrUndefined(t)&&e.isRelationshipAssistant(t.UniqueId)}static isRelationshipAssistant(t){return!S.IsNullOrUndefined(t)&&t.guidString===Wn.RelationshipAssistant}static getUniqueIdentifierForControl(t){if(S.IsNullOrUndefined(t))return null;let r=t.ClassId;if(e.isRelationshipAssistantControl(t))r=t.UniqueId;else if(r.guidString===F.CustomControl&&!S.IsNullOrUndefined(t.UniqueId)){let n=t.UniqueId.ToString();e.CustomControlIdMap.containsKey(n)&&(r=e.CustomControlIdMap.getValue(n))}return r}}});var cs,a0=D(()=>{"use strict";cs=class{listeners=[];listenersOncer=[];on(t){return this.listeners.push(t),{dispose:()=>this.off(t)}}once(t){this.listenersOncer.push(t)}off(t){let r=this.listeners.indexOf(t);r>-1&&this.listeners.splice(r,1)}emit(t){this.listeners.forEach(r=>r(t)),this.listenersOncer.forEach(r=>r(t)),this.listenersOncer=[]}pipe(t){return this.on(r=>t.emit(r))}}});var on,jn,o0,s0,xr,l0,u0,Fc=D(()=>{"use strict";(function(e){e[e.Center=0]="Center",e[e.Left=1]="Left",e[e.Right=2]="Right"})(on||(on={}));(function(e){e[e.Left=0]="Left",e[e.Top=1]="Top"})(jn||(jn={}));(function(e){e[e.Top=0]="Top",e[e.Middle=1]="Middle"})(o0||(o0={}));(function(e){e[e.None=0]="None",e[e.Create=1]="Create",e[e.Existing=2]="Existing",e[e.ReadOnly=3]="ReadOnly",e[e.Disabled=4]="Disabled",e[e.BulkEdit=6]="BulkEdit",e[e.Merge=7]="Merge",e[e.Print=8]="Print",e[e.FollowUp=9]="FollowUp"})(s0||(s0={}));(function(e){e[e.None=-1]="None",e[e.AppointmentBook=0]="AppointmentBook",e[e.Hardcoded=1]="Hardcoded",e[e.Main=2]="Main",e[e.MiniCampaignBO=3]="MiniCampaignBO",e[e.Preview=4]="Preview",e[e.Dashboard=5]="Dashboard",e[e.Quick=6]="Quick",e[e.Mobile=7]="Mobile",e[e.Read=8]="Read",e[e.QuickCreate=9]="QuickCreate",e[e.Dialog=10]="Dialog",e[e.Card=11]="Card",e[e.TaskBasedForm=12]="TaskBasedForm",e[e.InteractionCentricDashboard=13]="InteractionCentricDashboard"})(xr||(xr={}));(function(e){e[e.None=0]="None",e[e.SystemRequired=1]="SystemRequired",e[e.ApplicationRequired=2]="ApplicationRequired",e[e.Recommended=3]="Recommended"})(l0||(l0={}));(function(e){e[e.Boolean=0]="Boolean",e[e.Customer=1]="Customer",e[e.DateTime=2]="DateTime",e[e.Decimal=3]="Decimal",e[e.Double=4]="Double",e[e.Integer=5]="Integer",e[e.Lookup=6]="Lookup",e[e.Memo=7]="Memo",e[e.Money=8]="Money",e[e.Owner=9]="Owner",e[e.PartyList=10]="PartyList",e[e.Picklist=11]="Picklist",e[e.State=12]="State",e[e.Status=13]="Status",e[e.String=14]="String",e[e.Uniqueidentifier=15]="Uniqueidentifier",e[e.CalendarRules=16]="CalendarRules",e[e.Virtual=17]="Virtual",e[e.BigInt=18]="BigInt",e[e.ManagedProperty=19]="ManagedProperty",e[e.EntityName=20]="EntityName"})(u0||(u0={}))});var Hn,c0=D(()=>{"use strict";fa();Hn=gc({packageName:"cds-designer-models",features:{showAllPCFControls:{owner:"anchoudh",description:"Do not only show the controls that exist on the whitelist",enabledFor:{test:!1,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1}},showTestControls:{owner:"lucorre",description:"Show advanced custom controls for testing (designated in Authoring Manifest with isTestOnly=true)",enabledFor:{test:!0,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1}},enablePrefetchGetMoreComponentsLocalization:{owner:"vajagarl",description:"Enables prefetching the localization files for controls displayed in custom control picker",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0}},showMapControl:{owner:"vayilavarapu",createdDate:"07/19/2022",description:"Show map control",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}},enableFallbackFormTemplate:{owner:"vajagarl",createdDate:"01/03/2023",description:"Enable default form template as fallback if unable to retrieve a form template from Dataverse",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}},enableAutoInsertionOfCellInRow:{owner:"debeshd",createdDate:"09/01/2023",description:"Enable the auto insertion of cell in a row when a section is initialized",enabledFor:{test:!1,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1,ex:!1,rx:!1}},enableOneGridEvents:{owner:"aansu",createdDate:"08/21/2024",description:"Enable OneGrid events in form designer",enabledFor:{test:!0,preprod:!0,prod:!0,preview:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}},disablePBIComponents:{owner:"adekulkarni",createdDate:"02/13/2025",description:"Disables PBI components and cleans them up from the form",enabledFor:{test:!0,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1,ex:!1,rx:!1}},enableAgentResponse:{owner:"jennietu",createdDate:"04/24/2025",description:"Enables agent response in form designer",enabledFor:{test:!0,preprod:!0,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1,ex:!1,rx:!1}},enableDelayedLocalizationForCustomControls:{owner:"aansu",createdDate:"06/08/2025",description:"Enables delayed localization of custom control",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}}}})});function d0(e){return{...e,extractConfig:t=>VO(t,Object.keys(e.fallback))}}function VO(e,t){let r={};for(let n of t)typeof e[n]<"u"&&(r[n]=e[n]);return r}var Tc=D(()=>{"use strict";});var Rc=m((I7,f0)=>{var va=new Proxy(function(){return va},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:va},apply:function(){return va},construct:function(){return{}}}),p0=function(){return va};Object.setPrototypeOf(p0,va);f0.exports=p0});var g0=m((_7,h0)=>{var ba=new Proxy(function(){return ba},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:ba},apply:function(){return ba},construct:function(){return{}}}),m0=function(){return ba};Object.setPrototypeOf(m0,ba);h0.exports=m0});var xc=m((P7,b0)=>{var ya=new Proxy(function(){return ya},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:ya},apply:function(){return ya},construct:function(){return{}}}),v0=function(){return ya};Object.setPrototypeOf(v0,ya);b0.exports=v0});var C0=m((O7,y0)=>{function GO(){this.__data__=[],this.size=0}y0.exports=GO});var Jn=m((F7,A0)=>{function zO(e,t){return e===t||e!==e&&t!==t}A0.exports=zO});var Ca=m((T7,w0)=>{var WO=Jn();function jO(e,t){for(var r=e.length;r--;)if(WO(e[r][0],t))return r;return-1}w0.exports=jO});var S0=m((R7,N0)=>{var HO=Ca(),JO=Array.prototype,QO=JO.splice;function XO(e){var t=this.__data__,r=HO(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():QO.call(t,r,1),--this.size,!0}N0.exports=XO});var E0=m((x7,D0)=>{var KO=Ca();function YO(e){var t=this.__data__,r=KO(t,e);return r<0?void 0:t[r][1]}D0.exports=YO});var _0=m((L7,I0)=>{var ZO=Ca();function eF(e){return ZO(this.__data__,e)>-1}I0.exports=eF});var O0=m((M7,P0)=>{var tF=Ca();function rF(e,t){var r=this.__data__,n=tF(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}P0.exports=rF});var Aa=m((U7,F0)=>{var nF=C0(),iF=S0(),aF=E0(),oF=_0(),sF=O0();function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=nF;Qn.prototype.delete=iF;Qn.prototype.get=aF;Qn.prototype.has=oF;Qn.prototype.set=sF;F0.exports=Qn});var R0=m((B7,T0)=>{var lF=Aa();function uF(){this.__data__=new lF,this.size=0}T0.exports=uF});var L0=m((k7,x0)=>{function cF(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}x0.exports=cF});var U0=m((q7,M0)=>{function dF(e){return this.__data__.get(e)}M0.exports=dF});var k0=m(($7,B0)=>{function pF(e){return this.__data__.has(e)}B0.exports=pF});var Lc=m((V7,q0)=>{var fF=typeof global=="object"&&global&&global.Object===Object&&global;q0.exports=fF});var xt=m((G7,$0)=>{var mF=Lc(),hF=typeof self=="object"&&self&&self.Object===Object&&self,gF=mF||hF||Function("return this")();$0.exports=gF});var wa=m((z7,V0)=>{var vF=xt(),bF=vF.Symbol;V0.exports=bF});var j0=m((W7,W0)=>{var G0=wa(),z0=Object.prototype,yF=z0.hasOwnProperty,CF=z0.toString,Na=G0?G0.toStringTag:void 0;function AF(e){var t=yF.call(e,Na),r=e[Na];try{e[Na]=void 0;var n=!0}catch{}var i=CF.call(e);return n&&(t?e[Na]=r:delete e[Na]),i}W0.exports=AF});var J0=m((j7,H0)=>{var wF=Object.prototype,NF=wF.toString;function SF(e){return NF.call(e)}H0.exports=SF});var sn=m((H7,K0)=>{var Q0=wa(),DF=j0(),EF=J0(),IF="[object Null]",_F="[object Undefined]",X0=Q0?Q0.toStringTag:void 0;function PF(e){return e==null?e===void 0?_F:IF:X0&&X0 in Object(e)?DF(e):EF(e)}K0.exports=PF});var gr=m((J7,Y0)=>{function OF(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}Y0.exports=OF});var ds=m((Q7,Z0)=>{var FF=sn(),TF=gr(),RF="[object AsyncFunction]",xF="[object Function]",LF="[object GeneratorFunction]",MF="[object Proxy]";function UF(e){if(!TF(e))return!1;var t=FF(e);return t==xF||t==LF||t==RF||t==MF}Z0.exports=UF});var tv=m((X7,ev)=>{var BF=xt(),kF=BF["__core-js_shared__"];ev.exports=kF});var iv=m((K7,nv)=>{var Mc=tv(),rv=(function(){var e=/[^.]+$/.exec(Mc&&Mc.keys&&Mc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function qF(e){return!!rv&&rv in e}nv.exports=qF});var Uc=m((Y7,av)=>{var $F=Function.prototype,VF=$F.toString;function GF(e){if(e!=null){try{return VF.call(e)}catch{}try{return e+""}catch{}}return""}av.exports=GF});var sv=m((Z7,ov)=>{var zF=ds(),WF=iv(),jF=gr(),HF=Uc(),JF=/[\\^$.*+?()[\]{}|]/g,QF=/^\[object .+?Constructor\]$/,XF=Function.prototype,KF=Object.prototype,YF=XF.toString,ZF=KF.hasOwnProperty,eT=RegExp("^"+YF.call(ZF).replace(JF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tT(e){if(!jF(e)||WF(e))return!1;var t=zF(e)?eT:QF;return t.test(HF(e))}ov.exports=tT});var uv=m((eV,lv)=>{function rT(e,t){return e?.[t]}lv.exports=rT});var Lr=m((tV,cv)=>{var nT=sv(),iT=uv();function aT(e,t){var r=iT(e,t);return nT(r)?r:void 0}cv.exports=aT});var ps=m((rV,dv)=>{var oT=Lr(),sT=xt(),lT=oT(sT,"Map");dv.exports=lT});var Sa=m((nV,pv)=>{var uT=Lr(),cT=uT(Object,"create");pv.exports=cT});var hv=m((iV,mv)=>{var fv=Sa();function dT(){this.__data__=fv?fv(null):{},this.size=0}mv.exports=dT});var vv=m((aV,gv)=>{function pT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}gv.exports=pT});var yv=m((oV,bv)=>{var fT=Sa(),mT="__lodash_hash_undefined__",hT=Object.prototype,gT=hT.hasOwnProperty;function vT(e){var t=this.__data__;if(fT){var r=t[e];return r===mT?void 0:r}return gT.call(t,e)?t[e]:void 0}bv.exports=vT});var Av=m((sV,Cv)=>{var bT=Sa(),yT=Object.prototype,CT=yT.hasOwnProperty;function AT(e){var t=this.__data__;return bT?t[e]!==void 0:CT.call(t,e)}Cv.exports=AT});var Nv=m((lV,wv)=>{var wT=Sa(),NT="__lodash_hash_undefined__";function ST(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=wT&&t===void 0?NT:t,this}wv.exports=ST});var Dv=m((uV,Sv)=>{var DT=hv(),ET=vv(),IT=yv(),_T=Av(),PT=Nv();function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=DT;Xn.prototype.delete=ET;Xn.prototype.get=IT;Xn.prototype.has=_T;Xn.prototype.set=PT;Sv.exports=Xn});var _v=m((cV,Iv)=>{var Ev=Dv(),OT=Aa(),FT=ps();function TT(){this.size=0,this.__data__={hash:new Ev,map:new(FT||OT),string:new Ev}}Iv.exports=TT});var Ov=m((dV,Pv)=>{function RT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}Pv.exports=RT});var Da=m((pV,Fv)=>{var xT=Ov();function LT(e,t){var r=e.__data__;return xT(t)?r[typeof t=="string"?"string":"hash"]:r.map}Fv.exports=LT});var Rv=m((fV,Tv)=>{var MT=Da();function UT(e){var t=MT(this,e).delete(e);return this.size-=t?1:0,t}Tv.exports=UT});var Lv=m((mV,xv)=>{var BT=Da();function kT(e){return BT(this,e).get(e)}xv.exports=kT});var Uv=m((hV,Mv)=>{var qT=Da();function $T(e){return qT(this,e).has(e)}Mv.exports=$T});var kv=m((gV,Bv)=>{var VT=Da();function GT(e,t){var r=VT(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Bv.exports=GT});var fs=m((vV,qv)=>{var zT=_v(),WT=Rv(),jT=Lv(),HT=Uv(),JT=kv();function Kn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Kn.prototype.clear=zT;Kn.prototype.delete=WT;Kn.prototype.get=jT;Kn.prototype.has=HT;Kn.prototype.set=JT;qv.exports=Kn});var Vv=m((bV,$v)=>{var QT=Aa(),XT=ps(),KT=fs(),YT=200;function ZT(e,t){var r=this.__data__;if(r instanceof QT){var n=r.__data__;if(!XT||n.length<YT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new KT(n)}return r.set(e,t),this.size=r.size,this}$v.exports=ZT});var Bc=m((yV,Gv)=>{var eR=Aa(),tR=R0(),rR=L0(),nR=U0(),iR=k0(),aR=Vv();function Yn(e){var t=this.__data__=new eR(e);this.size=t.size}Yn.prototype.clear=tR;Yn.prototype.delete=rR;Yn.prototype.get=nR;Yn.prototype.has=iR;Yn.prototype.set=aR;Gv.exports=Yn});var Wv=m((CV,zv)=>{var oR="__lodash_hash_undefined__";function sR(e){return this.__data__.set(e,oR),this}zv.exports=sR});var Hv=m((AV,jv)=>{function lR(e){return this.__data__.has(e)}jv.exports=lR});var Qv=m((wV,Jv)=>{var uR=fs(),cR=Wv(),dR=Hv();function ms(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new uR;++t<r;)this.add(e[t])}ms.prototype.add=ms.prototype.push=cR;ms.prototype.has=dR;Jv.exports=ms});var Kv=m((NV,Xv)=>{function pR(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}Xv.exports=pR});var Zv=m((SV,Yv)=>{function fR(e,t){return e.has(t)}Yv.exports=fR});var kc=m((DV,eb)=>{var mR=Qv(),hR=Kv(),gR=Zv(),vR=1,bR=2;function yR(e,t,r,n,i,a){var o=r&vR,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,g=r&bR?new mR:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var b=e[d],w=t[d];if(n)var N=o?n(w,b,d,t,e,a):n(b,w,d,e,t,a);if(N!==void 0){if(N)continue;f=!1;break}if(g){if(!hR(t,function(_,T){if(!gR(g,T)&&(b===_||i(b,_,r,n,a)))return g.push(T)})){f=!1;break}}else if(!(b===w||i(b,w,r,n,a))){f=!1;break}}return a.delete(e),a.delete(t),f}eb.exports=yR});var qc=m((EV,tb)=>{var CR=xt(),AR=CR.Uint8Array;tb.exports=AR});var nb=m((IV,rb)=>{function wR(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}rb.exports=wR});var ab=m((_V,ib)=>{function NR(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}ib.exports=NR});var cb=m((PV,ub)=>{var ob=wa(),sb=qc(),SR=Jn(),DR=kc(),ER=nb(),IR=ab(),_R=1,PR=2,OR="[object Boolean]",FR="[object Date]",TR="[object Error]",RR="[object Map]",xR="[object Number]",LR="[object RegExp]",MR="[object Set]",UR="[object String]",BR="[object Symbol]",kR="[object ArrayBuffer]",qR="[object DataView]",lb=ob?ob.prototype:void 0,$c=lb?lb.valueOf:void 0;function $R(e,t,r,n,i,a,o){switch(r){case qR:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case kR:return!(e.byteLength!=t.byteLength||!a(new sb(e),new sb(t)));case OR:case FR:case xR:return SR(+e,+t);case TR:return e.name==t.name&&e.message==t.message;case LR:case UR:return e==t+"";case RR:var s=ER;case MR:var l=n&_R;if(s||(s=IR),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;n|=PR,o.set(e,t);var c=DR(s(e),s(t),n,i,a,o);return o.delete(e),c;case BR:if($c)return $c.call(e)==$c.call(t)}return!1}ub.exports=$R});var pb=m((OV,db)=>{function VR(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}db.exports=VR});var Mr=m((FV,fb)=>{var GR=Array.isArray;fb.exports=GR});var hb=m((TV,mb)=>{var zR=pb(),WR=Mr();function jR(e,t,r){var n=t(e);return WR(e)?n:zR(n,r(e))}mb.exports=jR});var vb=m((RV,gb)=>{function HR(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}gb.exports=HR});var yb=m((xV,bb)=>{function JR(){return[]}bb.exports=JR});var wb=m((LV,Ab)=>{var QR=vb(),XR=yb(),KR=Object.prototype,YR=KR.propertyIsEnumerable,Cb=Object.getOwnPropertySymbols,ZR=Cb?function(e){return e==null?[]:(e=Object(e),QR(Cb(e),function(t){return YR.call(e,t)}))}:XR;Ab.exports=ZR});var Sb=m((MV,Nb)=>{function ex(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}Nb.exports=ex});var Ur=m((UV,Db)=>{function tx(e){return e!=null&&typeof e=="object"}Db.exports=tx});var Ib=m((BV,Eb)=>{var rx=sn(),nx=Ur(),ix="[object Arguments]";function ax(e){return nx(e)&&rx(e)==ix}Eb.exports=ax});var Vc=m((kV,Ob)=>{var _b=Ib(),ox=Ur(),Pb=Object.prototype,sx=Pb.hasOwnProperty,lx=Pb.propertyIsEnumerable,ux=_b((function(){return arguments})())?_b:function(e){return ox(e)&&sx.call(e,"callee")&&!lx.call(e,"callee")};Ob.exports=ux});var Tb=m((qV,Fb)=>{function cx(){return!1}Fb.exports=cx});var hs=m((Ea,Zn)=>{var dx=xt(),px=Tb(),Lb=typeof Ea=="object"&&Ea&&!Ea.nodeType&&Ea,Rb=Lb&&typeof Zn=="object"&&Zn&&!Zn.nodeType&&Zn,fx=Rb&&Rb.exports===Lb,xb=fx?dx.Buffer:void 0,mx=xb?xb.isBuffer:void 0,hx=mx||px;Zn.exports=hx});var gs=m(($V,Mb)=>{var gx=9007199254740991,vx=/^(?:0|[1-9]\d*)$/;function bx(e,t){var r=typeof e;return t=t??gx,!!t&&(r=="number"||r!="symbol"&&vx.test(e))&&e>-1&&e%1==0&&e<t}Mb.exports=bx});var Gc=m((VV,Ub)=>{var yx=9007199254740991;function Cx(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yx}Ub.exports=Cx});var kb=m((GV,Bb)=>{var Ax=sn(),wx=Gc(),Nx=Ur(),Sx="[object Arguments]",Dx="[object Array]",Ex="[object Boolean]",Ix="[object Date]",_x="[object Error]",Px="[object Function]",Ox="[object Map]",Fx="[object Number]",Tx="[object Object]",Rx="[object RegExp]",xx="[object Set]",Lx="[object String]",Mx="[object WeakMap]",Ux="[object ArrayBuffer]",Bx="[object DataView]",kx="[object Float32Array]",qx="[object Float64Array]",$x="[object Int8Array]",Vx="[object Int16Array]",Gx="[object Int32Array]",zx="[object Uint8Array]",Wx="[object Uint8ClampedArray]",jx="[object Uint16Array]",Hx="[object Uint32Array]",ie={};ie[kx]=ie[qx]=ie[$x]=ie[Vx]=ie[Gx]=ie[zx]=ie[Wx]=ie[jx]=ie[Hx]=!0;ie[Sx]=ie[Dx]=ie[Ux]=ie[Ex]=ie[Bx]=ie[Ix]=ie[_x]=ie[Px]=ie[Ox]=ie[Fx]=ie[Tx]=ie[Rx]=ie[xx]=ie[Lx]=ie[Mx]=!1;function Jx(e){return Nx(e)&&wx(e.length)&&!!ie[Ax(e)]}Bb.exports=Jx});var $b=m((zV,qb)=>{function Qx(e){return function(t){return e(t)}}qb.exports=Qx});var Gb=m((Ia,ei)=>{var Xx=Lc(),Vb=typeof Ia=="object"&&Ia&&!Ia.nodeType&&Ia,_a=Vb&&typeof ei=="object"&&ei&&!ei.nodeType&&ei,Kx=_a&&_a.exports===Vb,zc=Kx&&Xx.process,Yx=(function(){try{var e=_a&&_a.require&&_a.require("util").types;return e||zc&&zc.binding&&zc.binding("util")}catch{}})();ei.exports=Yx});var vs=m((WV,jb)=>{var Zx=kb(),eL=$b(),zb=Gb(),Wb=zb&&zb.isTypedArray,tL=Wb?eL(Wb):Zx;jb.exports=tL});var Wc=m((jV,Hb)=>{var rL=Sb(),nL=Vc(),iL=Mr(),aL=hs(),oL=gs(),sL=vs(),lL=Object.prototype,uL=lL.hasOwnProperty;function cL(e,t){var r=iL(e),n=!r&&nL(e),i=!r&&!n&&aL(e),a=!r&&!n&&!i&&sL(e),o=r||n||i||a,s=o?rL(e.length,String):[],l=s.length;for(var u in e)(t||uL.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||oL(u,l)))&&s.push(u);return s}Hb.exports=cL});var bs=m((HV,Jb)=>{var dL=Object.prototype;function pL(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||dL;return e===r}Jb.exports=pL});var jc=m((JV,Qb)=>{function fL(e,t){return function(r){return e(t(r))}}Qb.exports=fL});var Kb=m((QV,Xb)=>{var mL=jc(),hL=mL(Object.keys,Object);Xb.exports=hL});var Zb=m((XV,Yb)=>{var gL=bs(),vL=Kb(),bL=Object.prototype,yL=bL.hasOwnProperty;function CL(e){if(!gL(e))return vL(e);var t=[];for(var r in Object(e))yL.call(e,r)&&r!="constructor"&&t.push(r);return t}Yb.exports=CL});var Pa=m((KV,ey)=>{var AL=ds(),wL=Gc();function NL(e){return e!=null&&wL(e.length)&&!AL(e)}ey.exports=NL});var ry=m((YV,ty)=>{var SL=Wc(),DL=Zb(),EL=Pa();function IL(e){return EL(e)?SL(e):DL(e)}ty.exports=IL});var iy=m((ZV,ny)=>{var _L=hb(),PL=wb(),OL=ry();function FL(e){return _L(e,OL,PL)}ny.exports=FL});var sy=m((eG,oy)=>{var ay=iy(),TL=1,RL=Object.prototype,xL=RL.hasOwnProperty;function LL(e,t,r,n,i,a){var o=r&TL,s=ay(e),l=s.length,u=ay(t),c=u.length;if(l!=c&&!o)return!1;for(var d=l;d--;){var f=s[d];if(!(o?f in t:xL.call(t,f)))return!1}var g=a.get(e),b=a.get(t);if(g&&b)return g==t&&b==e;var w=!0;a.set(e,t),a.set(t,e);for(var N=o;++d<l;){f=s[d];var _=e[f],T=t[f];if(n)var R=o?n(T,_,f,t,e,a):n(_,T,f,e,t,a);if(!(R===void 0?_===T||i(_,T,r,n,a):R)){w=!1;break}N||(N=f=="constructor")}if(w&&!N){var M=e.constructor,W=t.constructor;M!=W&&"constructor"in e&&"constructor"in t&&!(typeof M=="function"&&M instanceof M&&typeof W=="function"&&W instanceof W)&&(w=!1)}return a.delete(e),a.delete(t),w}oy.exports=LL});var uy=m((tG,ly)=>{var ML=Lr(),UL=xt(),BL=ML(UL,"DataView");ly.exports=BL});var dy=m((rG,cy)=>{var kL=Lr(),qL=xt(),$L=kL(qL,"Promise");cy.exports=$L});var fy=m((nG,py)=>{var VL=Lr(),GL=xt(),zL=VL(GL,"Set");py.exports=zL});var hy=m((iG,my)=>{var WL=Lr(),jL=xt(),HL=WL(jL,"WeakMap");my.exports=HL});var Ny=m((aG,wy)=>{var Hc=uy(),Jc=ps(),Qc=dy(),Xc=fy(),Kc=hy(),Ay=sn(),ti=Uc(),gy="[object Map]",JL="[object Object]",vy="[object Promise]",by="[object Set]",yy="[object WeakMap]",Cy="[object DataView]",QL=ti(Hc),XL=ti(Jc),KL=ti(Qc),YL=ti(Xc),ZL=ti(Kc),ln=Ay;(Hc&&ln(new Hc(new ArrayBuffer(1)))!=Cy||Jc&&ln(new Jc)!=gy||Qc&&ln(Qc.resolve())!=vy||Xc&&ln(new Xc)!=by||Kc&&ln(new Kc)!=yy)&&(ln=function(e){var t=Ay(e),r=t==JL?e.constructor:void 0,n=r?ti(r):"";if(n)switch(n){case QL:return Cy;case XL:return gy;case KL:return vy;case YL:return by;case ZL:return yy}return t});wy.exports=ln});var Fy=m((oG,Oy)=>{var Yc=Bc(),eM=kc(),tM=cb(),rM=sy(),Sy=Ny(),Dy=Mr(),Ey=hs(),nM=vs(),iM=1,Iy="[object Arguments]",_y="[object Array]",ys="[object Object]",aM=Object.prototype,Py=aM.hasOwnProperty;function oM(e,t,r,n,i,a){var o=Dy(e),s=Dy(t),l=o?_y:Sy(e),u=s?_y:Sy(t);l=l==Iy?ys:l,u=u==Iy?ys:u;var c=l==ys,d=u==ys,f=l==u;if(f&&Ey(e)){if(!Ey(t))return!1;o=!0,c=!1}if(f&&!c)return a||(a=new Yc),o||nM(e)?eM(e,t,r,n,i,a):tM(e,t,l,r,n,i,a);if(!(r&iM)){var g=c&&Py.call(e,"__wrapped__"),b=d&&Py.call(t,"__wrapped__");if(g||b){var w=g?e.value():e,N=b?t.value():t;return a||(a=new Yc),i(w,N,r,n,a)}}return f?(a||(a=new Yc),rM(e,t,r,n,i,a)):!1}Oy.exports=oM});var Ly=m((sG,xy)=>{var sM=Fy(),Ty=Ur();function Ry(e,t,r,n,i){return e===t?!0:e==null||t==null||!Ty(e)&&!Ty(t)?e!==e&&t!==t:sM(e,t,r,n,Ry,i)}xy.exports=Ry});var Uy=m((lG,My)=>{var lM=Ly();function uM(e,t){return lM(e,t)}My.exports=uM});var Zc=m((uG,By)=>{var cM=Lr(),dM=(function(){try{var e=cM(Object,"defineProperty");return e({},"",{}),e}catch{}})();By.exports=dM});var Cs=m((cG,qy)=>{var ky=Zc();function pM(e,t,r){t=="__proto__"&&ky?ky(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}qy.exports=pM});var ed=m((dG,$y)=>{var fM=Cs(),mM=Jn();function hM(e,t,r){(r!==void 0&&!mM(e[t],r)||r===void 0&&!(t in e))&&fM(e,t,r)}$y.exports=hM});var Gy=m((pG,Vy)=>{function gM(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}Vy.exports=gM});var Wy=m((fG,zy)=>{var vM=Gy(),bM=vM();zy.exports=bM});var Xy=m((Oa,ri)=>{var yM=xt(),Qy=typeof Oa=="object"&&Oa&&!Oa.nodeType&&Oa,jy=Qy&&typeof ri=="object"&&ri&&!ri.nodeType&&ri,CM=jy&&jy.exports===Qy,Hy=CM?yM.Buffer:void 0,Jy=Hy?Hy.allocUnsafe:void 0;function AM(e,t){if(t)return e.slice();var r=e.length,n=Jy?Jy(r):new e.constructor(r);return e.copy(n),n}ri.exports=AM});var Zy=m((mG,Yy)=>{var Ky=qc();function wM(e){var t=new e.constructor(e.byteLength);return new Ky(t).set(new Ky(e)),t}Yy.exports=wM});var tC=m((hG,eC)=>{var NM=Zy();function SM(e,t){var r=t?NM(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}eC.exports=SM});var nC=m((gG,rC)=>{function DM(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}rC.exports=DM});var oC=m((vG,aC)=>{var EM=gr(),iC=Object.create,IM=(function(){function e(){}return function(t){if(!EM(t))return{};if(iC)return iC(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();aC.exports=IM});var td=m((bG,sC)=>{var _M=jc(),PM=_M(Object.getPrototypeOf,Object);sC.exports=PM});var uC=m((yG,lC)=>{var OM=oC(),FM=td(),TM=bs();function RM(e){return typeof e.constructor=="function"&&!TM(e)?OM(FM(e)):{}}lC.exports=RM});var dC=m((CG,cC)=>{var xM=Pa(),LM=Ur();function MM(e){return LM(e)&&xM(e)}cC.exports=MM});var mC=m((AG,fC)=>{var UM=sn(),BM=td(),kM=Ur(),qM="[object Object]",$M=Function.prototype,VM=Object.prototype,pC=$M.toString,GM=VM.hasOwnProperty,zM=pC.call(Object);function WM(e){if(!kM(e)||UM(e)!=qM)return!1;var t=BM(e);if(t===null)return!0;var r=GM.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&pC.call(r)==zM}fC.exports=WM});var rd=m((wG,hC)=>{function jM(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}hC.exports=jM});var nd=m((NG,gC)=>{var HM=Cs(),JM=Jn(),QM=Object.prototype,XM=QM.hasOwnProperty;function KM(e,t,r){var n=e[t];(!(XM.call(e,t)&&JM(n,r))||r===void 0&&!(t in e))&&HM(e,t,r)}gC.exports=KM});var bC=m((SG,vC)=>{var YM=nd(),ZM=Cs();function eU(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],l=n?n(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),i?ZM(r,s,l):YM(r,s,l)}return r}vC.exports=eU});var CC=m((DG,yC)=>{function tU(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}yC.exports=tU});var wC=m((EG,AC)=>{var rU=gr(),nU=bs(),iU=CC(),aU=Object.prototype,oU=aU.hasOwnProperty;function sU(e){if(!rU(e))return iU(e);var t=nU(e),r=[];for(var n in e)n=="constructor"&&(t||!oU.call(e,n))||r.push(n);return r}AC.exports=sU});var id=m((IG,NC)=>{var lU=Wc(),uU=wC(),cU=Pa();function dU(e){return cU(e)?lU(e,!0):uU(e)}NC.exports=dU});var DC=m((_G,SC)=>{var pU=bC(),fU=id();function mU(e){return pU(e,fU(e))}SC.exports=mU});var FC=m((PG,OC)=>{var EC=ed(),hU=Xy(),gU=tC(),vU=nC(),bU=uC(),IC=Vc(),_C=Mr(),yU=dC(),CU=hs(),AU=ds(),wU=gr(),NU=mC(),SU=vs(),PC=rd(),DU=DC();function EU(e,t,r,n,i,a,o){var s=PC(e,r),l=PC(t,r),u=o.get(l);if(u){EC(e,r,u);return}var c=a?a(s,l,r+"",e,t,o):void 0,d=c===void 0;if(d){var f=_C(l),g=!f&&CU(l),b=!f&&!g&&SU(l);c=l,f||g||b?_C(s)?c=s:yU(s)?c=vU(s):g?(d=!1,c=hU(l,!0)):b?(d=!1,c=gU(l,!0)):c=[]:NU(l)||IC(l)?(c=s,IC(s)?c=DU(s):(!wU(s)||AU(s))&&(c=bU(l))):d=!1}d&&(o.set(l,c),i(c,l,n,a,o),o.delete(l)),EC(e,r,c)}OC.exports=EU});var ad=m((OG,RC)=>{var IU=Bc(),_U=ed(),PU=Wy(),OU=FC(),FU=gr(),TU=id(),RU=rd();function TC(e,t,r,n,i){e!==t&&PU(t,function(a,o){if(i||(i=new IU),FU(a))OU(e,t,o,r,TC,n,i);else{var s=n?n(RU(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),_U(e,o,s)}},TU)}RC.exports=TC});var od=m((FG,xC)=>{function xU(e){return e}xC.exports=xU});var MC=m((TG,LC)=>{function LU(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}LC.exports=LU});var kC=m((RG,BC)=>{var MU=MC(),UC=Math.max;function UU(e,t,r){return t=UC(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=UC(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),MU(e,this,s)}}BC.exports=UU});var $C=m((xG,qC)=>{function BU(e){return function(){return e}}qC.exports=BU});var zC=m((LG,GC)=>{var kU=$C(),VC=Zc(),qU=od(),$U=VC?function(e,t){return VC(e,"toString",{configurable:!0,enumerable:!1,value:kU(t),writable:!0})}:qU;GC.exports=$U});var jC=m((MG,WC)=>{var VU=800,GU=16,zU=Date.now;function WU(e){var t=0,r=0;return function(){var n=zU(),i=GU-(n-r);if(r=n,i>0){if(++t>=VU)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}WC.exports=WU});var JC=m((UG,HC)=>{var jU=zC(),HU=jC(),JU=HU(jU);HC.exports=JU});var XC=m((BG,QC)=>{var QU=od(),XU=kC(),KU=JC();function YU(e,t){return KU(XU(e,t,QU),e+"")}QC.exports=YU});var YC=m((kG,KC)=>{var ZU=Jn(),eB=Pa(),tB=gs(),rB=gr();function nB(e,t,r){if(!rB(r))return!1;var n=typeof t;return(n=="number"?eB(r)&&tB(t,r.length):n=="string"&&t in r)?ZU(r[t],e):!1}KC.exports=nB});var sd=m((qG,ZC)=>{var iB=XC(),aB=YC();function oB(e){return iB(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&aB(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t})}ZC.exports=oB});var tA=m(($G,eA)=>{var sB=ad(),lB=sd(),uB=lB(function(e,t,r,n){sB(e,t,r,n)});eA.exports=uB});var Ct,Fa=D(()=>{"use strict";(function(e){e[e.NotLoaded=0]="NotLoaded",e[e.Initialized=1]="Initialized",e[e.ConfigsLoaded=2]="ConfigsLoaded",e[e.Error=3]="Error"})(Ct||(Ct={}))});function nA(e,t,r="PROD"){let n=i=>`ShellSettings_ECS_ClientCache_${e}_${rA.EcsConfigType[i]}_${r}`;return{getData:i=>{let a=t.getItem(n(i));return Promise.resolve(a?JSON.parse(a):void 0)},putData:(i,a)=>(t.setItem(n(i),JSON.stringify(a)),Promise.resolve())}}var rA,cB,iA=D(()=>{"use strict";rA=ne(xc()),cB=ne(Rc());});var ld,aA=D(()=>{"use strict";Yo();ld=pa({packageName:"shell-settings",settings:{prodEcsEndpoint:{description:"The url for the PROD ECS endpoint",values:{default:"https://ecs.office.com",dod:"https://config.ecs.dod.teams.microsoft.us",high:"https://config.ecs.gov.teams.microsoft.us",ex:"https://config.ecs.teams.eaglex.ic.gov",rx:"https://config.ecs.teams.microsoft.scloud"}},integrationEcsEndpoint:{description:"The url for the INT ECS endpoint",values:{default:"https://config.edge.skype.net"}}}})});var sA,lA,uA,cA,ud,dB,As,oA,cd=D(()=>{"use strict";sA=ne(Rc()),lA=ne(g0()),uA=ne(xc()),cA=ne(Uy()),ud=ne(tA());Fa();iA();aA();dB=60*1e3,As=class{clientName;logger;ecsEndpoint;resolveLoadingPromise;loadingPromise=new Promise(t=>this.resolveLoadingPromise=t);_status=Ct.NotLoaded;endpointType;clientConfigOverride;get status(){return this._status}constructor(t,r,n="PROD"){this.clientName=t,this.logger=r,this.endpointType=n,this.ecsEndpoint=n==="PROD"?ld.prodEcsEndpoint:ld.integrationEcsEndpoint}client=new lA.default;init=async({clientVersion:t,getFilters:r,cacheStorage:n=sA.StorageHelper.transientWithGlobalFallback,updateIntervalInMinutes:i,overrideEcsInitParams:a})=>{this.client.telemetryEventAdded.subscribe(this.logger.logEvent),this.client.configUpdated.subscribe(this.handleConfigUpdated);let o=(async()=>{let s=await r();return this.logEvent("FeaturesClient/configRequested",{ecsClientName:this.clientName,filters:s}),s});try{await this.client.initialize({clientName:this.clientName,clientVersion:t??"1.0.0.0",configsToFetch:[uA.EcsConfigType.Default],hosts:[this.ecsEndpoint],initialAppActiveState:!0,getEcsParameters:o,databaseInterface:nA(this.clientName,n,this.endpointType),...a}),this.client.requestUpdate(),this._status===Ct.NotLoaded&&(this._status=Ct.Initialized)}catch(s){this._status=Ct.Error,this.resolveLoadingPromise(),this.logEvent("FeaturesClient/initializationFailed",{ecsClientName:this.clientName,error:s},"Error")}i&&window.setInterval(()=>this.client.requestUpdate(),i*dB)};getConfig=t=>{let r=this.getMergedClientConfigByTeamName(t.teamName),n=r?t.extractConfig(r):{};return(0,ud.default)({},t.fallback,n,t.override,oA)};getAllConfigs=()=>this.getMergedClientConfig();getAllConfigsByTeamName=t=>this.getMergedClientConfigByTeamName(t);requestConfigUpdate=()=>{this.client.requestUpdate()};subscribe=(t,r)=>{let n=this.getConfig(t),i=this.client.configUpdated.subscribe(()=>{let a=this.getConfig(t);(0,cA.default)(a,n)||(n={...a},r(a))});return{unsubscribe:()=>i.unsubscribe()}};waitUntilLoaded=async t=>{if(t!==void 0){let r,n=new Promise((i,a)=>{r=window.setTimeout(()=>{a(new Error("Timed out waiting for configuration to load"))},t)});await Promise.race([this.loadingPromise,n]),clearTimeout(r)}else await this.loadingPromise};overrideClientConfig(t){this.logger.logEvent("FeaturesClient/overrideClientConfig",{clientConfigOverride:t}),this.clientConfigOverride=t}undoClientConfigOverride(){this.clientConfigOverride=void 0,this.logger.logEvent("FeaturesClient/undoClientConfigOverride")}getMergedClientConfig=()=>(0,ud.default)({},this.client.getConfig()?.config,this.clientConfigOverride,oA);getMergedClientConfigByTeamName=t=>this.getMergedClientConfig()?.[t];handleConfigUpdated=()=>{let t=this.client.getConfig();if(t===void 0)return;this.resolveLoadingPromise(),this._status=Ct.ConfigsLoaded;let{ConfigIDs:r,Headers:n}=t.config;this.logEvent("FeaturesClient/configUpdated",{ecsClientName:this.clientName,configIDs:r,ETag:n?.ETag})};logEvent=(t,r)=>{this.logger.logEvent(t,{ecsClientName:this.clientName,ecsEndpointType:this.endpointType,...r})}},oA=(e,t)=>{if(Array.isArray(t))return t}});var pA=m((XG,dA)=>{"use strict";var pB=()=>{let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e};dA.exports=pB});var dd=m((KG,mA)=>{var Ta=new Proxy(function(){return Ta},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:Ta},apply:function(){return Ta},construct:function(){return{}}}),fA=function(){return Ta};Object.setPrototypeOf(fA,Ta);mA.exports=fA});var vA=m((YG,gA)=>{var Ra=new Proxy(function(){return Ra},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:Ra},apply:function(){return Ra},construct:function(){return{}}}),hA=function(){return Ra};Object.setPrototypeOf(hA,Ra);gA.exports=hA});var SA=m((ZG,NA)=>{"use strict";var pd=vA(),fB={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},mB={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},hB={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},AA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fd={};fd[pd.ForwardRef]=hB;fd[pd.Memo]=AA;function bA(e){return pd.isMemo(e)?AA:fd[e.$$typeof]||fB}var gB=Object.defineProperty,vB=Object.getOwnPropertyNames,yA=Object.getOwnPropertySymbols,bB=Object.getOwnPropertyDescriptor,yB=Object.getPrototypeOf,CA=Object.prototype;function wA(e,t,r){if(typeof t!="string"){if(CA){var n=yB(t);n&&n!==CA&&wA(e,n,r)}var i=vB(t);yA&&(i=i.concat(yA(t)));for(var a=bA(e),o=bA(t),s=0;s<i.length;++s){var l=i[s];if(!mB[l]&&!(r&&r[l])&&!(o&&o[l])&&!(a&&a[l])){var u=bB(t,l);try{gB(e,l,u)}catch{}}}}return e}NA.exports=wA});function EA(e,t,r){let[n,i]=(0,ni.useState)(e.getConfig(t));return(0,ni.useEffect)(()=>{if(!r?.subscribe&&e.status===Ct.ConfigsLoaded)return;let a=e.subscribe(t,o=>{i(o),r?.subscribe||a.unsubscribe()});return a?.unsubscribe},[]),n}function IA(e){return function(t,r){return EA(e,t,r)}}function _A(e,t,r,n){let i=a=>{let o=EA(e,t,n),s={...a,...o};return ni.default.createElement(r,{...s})};return(0,DA.default)(i,r),i.displayName=`WithFeature(${r.name})`,i}function PA(e,t,r,n){return t.reduce((i,a)=>_A(e,a,i,n),r)}function OA(e){return function(t,r,n){return _A(e,t,r,n)}}var DA,ni,md=D(()=>{"use strict";DA=ne(SA()),ni=ne(dd());Fa();});var TA=m((rz,FA)=>{var CB=ad(),AB=sd(),wB=AB(function(e,t,r){CB(e,t,r)});FA.exports=wB});var ws=m((nz,RA)=>{var NB=sn(),SB=Ur(),DB="[object Symbol]";function EB(e){return typeof e=="symbol"||SB(e)&&NB(e)==DB}RA.exports=EB});var LA=m((iz,xA)=>{var IB=Mr(),_B=ws(),PB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OB=/^\w*$/;function FB(e,t){if(IB(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||_B(e)?!0:OB.test(e)||!PB.test(e)||t!=null&&e in Object(t)}xA.exports=FB});var BA=m((az,UA)=>{var MA=fs(),TB="Expected a function";function hd(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(TB);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(hd.Cache||MA),r}hd.Cache=MA;UA.exports=hd});var qA=m((oz,kA)=>{var RB=BA(),xB=500;function LB(e){var t=RB(e,function(n){return r.size===xB&&r.clear(),n}),r=t.cache;return t}kA.exports=LB});var VA=m((sz,$A)=>{var MB=qA(),UB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BB=/\\(\\)?/g,kB=MB(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(UB,function(r,n,i,a){t.push(i?a.replace(BB,"$1"):n||r)}),t});$A.exports=kB});var zA=m((lz,GA)=>{function qB(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}GA.exports=qB});var XA=m((uz,QA)=>{var WA=wa(),$B=zA(),VB=Mr(),GB=ws(),zB=1/0,jA=WA?WA.prototype:void 0,HA=jA?jA.toString:void 0;function JA(e){if(typeof e=="string")return e;if(VB(e))return $B(e,JA)+"";if(GB(e))return HA?HA.call(e):"";var t=e+"";return t=="0"&&1/e==-zB?"-0":t}QA.exports=JA});var YA=m((cz,KA)=>{var WB=XA();function jB(e){return e==null?"":WB(e)}KA.exports=jB});var ew=m((dz,ZA)=>{var HB=Mr(),JB=LA(),QB=VA(),XB=YA();function KB(e,t){return HB(e)?e:JB(e,t)?[e]:QB(XB(e))}ZA.exports=KB});var rw=m((pz,tw)=>{var YB=ws(),ZB=1/0;function ek(e){if(typeof e=="string"||YB(e))return e;var t=e+"";return t=="0"&&1/e==-ZB?"-0":t}tw.exports=ek});var aw=m((fz,iw)=>{var tk=nd(),rk=ew(),nk=gs(),nw=gr(),ik=rw();function ak(e,t,r,n){if(!nw(e))return e;t=rk(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var l=ik(t[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=o){var c=s[l];u=n?n(c,l,s):void 0,u===void 0&&(u=nw(c)?c:nk(t[i+1])?[]:{})}tk(s,l,u),s=s[l]}return e}iw.exports=ak});var sw=m((mz,ow)=>{var ok=aw();function sk(e,t,r){return e==null?e:ok(e,t,r)}ow.exports=sk});function dw(e){let{query:t}=(0,cw.default)(window.location.href,!0);return uk(e,t),e}function uk(e,t){let r=lk+e.clientName,n=Object.keys(t).filter(a=>a.startsWith(r));if(!n)return;let i={};n.forEach(a=>{let o=t[a];if(o)try{let s=JSON.parse(o),l=r+pw,u={};if(a===r)u=s;else if(a.startsWith(l)){let c=a.substring(l.length);(0,uw.default)(u,c,s)}(0,lw.default)(i,u)}catch{}}),Object.keys(i).length>0&&e.overrideClientConfig(i)}var lw,uw,cw,pw,lk,fw=D(()=>{"use strict";lw=ne(TA()),uw=ne(sw()),cw=ne(Cc());pw=".",lk="ecs"+pw});function Ss(e,t,r){let n=dw(new As(e,t,r));function i(a){(0,Ns.useEffect)(()=>{n.init(a)},[])}return{featuresClient:n,createFeature:dk(n),useFeaturesClientInitParams:i,withFeatures:(a,o,s)=>PA(n,a,o,s)}}function dk(e){let t=IA(e),r=OA(e);return function(i){let a=d0(i);return a.getConfig=()=>e.getConfig(a),a.isLoaded=()=>e.status===Ct.ConfigsLoaded,Nc.register(a,e.clientName),{useFeature:o=>t(a,o),withFeature:(o,s)=>r(a,o,s),feature:a}}}var ck,Ns,gd=D(()=>{"use strict";ck=ne(pA()),Ns=ne(dd());Tc();cd();Fa();md();fw();Sc();});var mw=D(()=>{"use strict";Tc();cd();gd();Fa();md();rs();Dc();});function Ds(e){return{logEvent:(t,r,n)=>{switch(n){case"Error":(0,ii.trackErrorTrace)(e,{eventName:t,eventData:r});break;case"Warning":(0,ii.trackWarningTrace)(e,{eventName:t,eventData:r});break;default:(0,ii.trackInfoTrace)(e,{eventName:t,eventData:r});break}}}}var ii,vd=D(()=>{"use strict";ii=ne(en());});var xz,Lz,Mz,hw=D(()=>{"use strict";mw();vd();({featuresClient:xz,createFeature:Lz,useFeaturesClientInitParams:Mz}=Ss("PowerApps-Shell-Test",Ds("shell-features")))});var bw=m((Bz,vw)=>{var xa=new Proxy(function(){return xa},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:xa},apply:function(){return xa},construct:function(){return{}}}),gw=function(){return xa};Object.setPrototypeOf(gw,xa);vw.exports=gw});var pk,fk,yw=D(()=>{"use strict";ua();pk=ne(bw()),fk=ne(en());});var Cw=D(()=>{"use strict";hw();vd();yw();});var Hz,ai,Jz,Aw=D(()=>{"use strict";Cw();gd();({featuresClient:Hz,createFeature:ai,useFeaturesClientInitParams:Jz}=Ss("PowerApps-MakerPortal",Ds("powerapps-features")))});var ww,Nw,Yz,Zz,eW,tW,bd=D(()=>{"use strict";c0();Aw();({feature:ww}=ai({teamName:"MakerPortal",owners:["debeshd"],description:"Enable the auto insertion of cell in a row when a section is initialized",createdOn:"09/01/2023",fallback:{enableAutoInsertionOfCellInRow:Hn.enableAutoInsertionOfCellInRow}})),{feature:Nw}=ai({teamName:"MakerPortal",owners:["aansu"],description:"Enable the one grid events for form designer",createdOn:"08/21/2024",fallback:{enableOneGridEventsForFormDesigner:Hn.enableOneGridEvents}}),{feature:Yz}=ai({teamName:"MakerPortal",owners:["adekulkarni"],description:"Disables PBI components and cleans them up from the form",createdOn:"01/03/2023",fallback:{enableFallbackFormTemplate:Hn.disablePBIComponents}}),{feature:Zz}=ai({teamName:"MakerPortal",owners:["jennietu"],description:"Enables agent response in form designer. This feature is used to enable the agent response in form designer",createdOn:"04/24/2025",fallback:{enableAgentResponse:Hn.enableAgentResponse}}),{feature:eW,useFeature:tW}=ai({teamName:"MakerPortal",owners:["aansu"],description:"Enables delayed localization of custom control",createdOn:"06/08/2025",fallback:{enableDelayedLocalizationForCustomControls:Hn.enableDelayedLocalizationForCustomControls}})});var Ew=m((nW,Dw)=>{var La=new Proxy(function(){return La},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:La},apply:function(){return La},construct:function(){return{}}}),Sw=function(){return La};Object.setPrototypeOf(Sw,La);Dw.exports=Sw});var We,Br=D(()=>{"use strict";Se();Ce();ze();us();G();xe();We=class extends q{static HighestUsedIndexByClass=new Map;get colspan(){let t=this.getProperty(p.colspan);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}set colspan(t){S.IsNullOrUndefined(t)||this.setProperty(p.colspan,String(t))}constructor(t,r){super(t,r)}get id(){let t=this.getProperty(p.id);return t==null?null:t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?new I(t.substr(1,t.length-2)):new I(t)}set id(t){this.setProperty(p.id,`{${t.ToString()}}`)}set labelId(t){this.setProperty(p.labelId,`{${t.ToString()}}`)}get labelId(){let t=this.getProperty(p.labelId);return t&&t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?new I(t.substr(1,t.length-2)):new I(t)}get Name(){return this.getProperty(p.Name)}set Name(t){this.setProperty(p.Name,t)}setDisplayName(t,r){for(let i of this.getAllLabels())if(+i.getProperty(p.languagecode)===r){i.setProperty(p.description,t);return}let n=new q(h.formLabel,null);n.setProperty(p.description,t),n.setProperty(p.languagecode,String(r)),this.addGrandChild("labels",n)}getDisplayName(t){for(let r of this.getAllLabels())if(+r.getProperty(p.languagecode)===t)return r.getProperty(p.description)}getAllLabels(){let t=this.getChildren("labels");return t.length!==1?[]:t[0].getChildren("label")}get isLocked(){return+this.getProperty(p.locklevel)==1}set isLocked(t){!this.IsUnboundControl&&this.setProperty(p.locklevel,t?"1":"0")}get availableforphone(){return this.getProcessedValue(p.availableforphone)}set availableforphone(t){S.IsNullOrUndefined(t)||!this.IsAllowedUBCForAvailableOnPhone()||this.setProperty(p.availableforphone,String(t))}get visible(){return this.getProcessedValue(p.visible)}set visible(t){S.IsNullOrUndefined(t)||!this.IsAllowedUBCForVisibleByDefault()||this.setProperty(p.visible,String(t))}isLockLevelSettable(){return!this.IsUnboundControl}get showlabel(){return this.getProcessedValue(p.showlabel)}set showlabel(t){S.IsNullOrUndefined(t)||this.setProperty(p.showlabel,String(t))}isAvailableForPhoneSettable(){return this.IsAllowedUBCForAvailableOnPhone()}isVisibleSettable(){return this.IsAllowedUBCForVisibleByDefault()}getProcessedValue(t){let r=this.getProperty(t);return S.IsNullOrUndefined(r)||this.getProperty(t)==="true"}get readonly(){let t=this.getFirstChild(h.formControl);return t?t.disabled:!1}set readonly(t){let r=this.getFirstChild(h.formControl);r&&(r.disabled=t)}get allowfilteroff(){let t=this.getFirstChild(h.formControl);if(t)return t.getParam(p.AllowFilterOff)==="true"}set allowfilteroff(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.AllowFilterOff,t)}get autoresolve(){let t=this.getFirstChild(h.formControl);if(t)return t.getParam(p.AutoResolve)==="true"}set autoresolve(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.AutoResolve,t)}get defaultviewid(){let t=this.getFirstChild(h.formControl);return t?t.getParam(p.DefaultViewId):P.EmptyString}set defaultviewid(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DefaultViewId,t)}get dependentattributename(){let t=this.getFirstChild(h.formControl);return t?t.getParam(p.DependentAttributeName):P.EmptyString}set dependentattributename(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DependentAttributeName,t)}get dependentattributetype(){let t=this.getFirstChild(h.formControl);return t?t.getParam(p.DependentAttributeType):P.EmptyString}set dependentattributetype(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DependentAttributeType,t)}get disablequickfind(){let t=this.getFirstChild(h.formControl);if(t)return t.getParam(p.DisableQuickFind)==="true"}set disablequickfind(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DisableQuickFind,t)}get disableviewpicker(){let t=this.getFirstChild(h.formControl);if(t)return t.getParam(p.DisableViewPicker)==="true"}set disableviewpicker(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DisableViewPicker,t)}get filterrelationshipname(){let t=this.getFirstChild(h.formControl);return t?t.getParam(p.FilterRelationshipName):P.EmptyString}set filterrelationshipname(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.FilterRelationshipName,t)}get availableviewids(){let t=this.getFirstChild(h.formControl);return t?t.getParam(p.AvailableViewIds):P.EmptyString}set availableviewids(t){let r=this.getFirstChild(h.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.AvailableViewIds,t)}get IsUnboundControl(){let t=this.getFirstChild(h.formControl);if(t&&t.ClassId){let r=Ee.getUniqueIdentifierForControl(t);return!S.IsNullOrUndefined(r)&&Ee.isUnboundFormControlByIdentifier(r)}else return!1}IsAllowedUBCForAvailableOnPhone(){let t=this.getFirstChild(h.formControl);if(t){let n=Ee.getUniqueIdentifierForControl(t).guidString,i=n===F.GridControl||n===F.TimeLineControl||n===F.TimeLineControlUC;return this.IsUnboundControl?i:!0}return this.NodeName===h.formSection||this.NodeName===h.formTab}IsAllowedUBCForVisibleByDefault(){let t=this.getFirstChild(h.formControl);if(t){let n=Ee.getUniqueIdentifierForControl(t).guidString,i=n===F.MapsControl||n===F.WebResourceHtmlControl||n===F.WebResourceImageControl||n===F.IframeControl||n===F.SocialInsightControl;return this.IsUnboundControl?i:!0}else return!0}get events(){let t=this.getChildren(h.formEvents);return t.length===1?t[0].getAllChildren():[]}addEvent(t){this.addGrandChild(h.formEvents,t)}getUsedNodeNameSet(t){return null}getHighestIndexById(t,r){return null}}});var oi,yd=D(()=>{"use strict";ze();G();xe();oi=class extends q{constructor(t,r){super(h.dependency,t),P.IsNullOrEmpty(r)||this.setDefaultProperties(r)}set id(t){this.setProperty(p.id,t)}get id(){return this.getProperty(p.id)}setDefaultProperties(t){this.id=t}}});var Iw,si,Cd=D(()=>{"use strict";Ce();yd();G();xe();Br();(function(e){e[e.Form=0]="Form",e[e.Cell=1]="Cell",e[e.Tab=2]="Tab",e[e.Control=3]="Control"})(Iw||(Iw={}));si=class extends We{constructor(t,r){super(h.formEvent,t),r&&(this.eventName=r,this.application="false",this.active="false")}set eventName(t){this.setProperty(p.Name,t)}get eventName(){return this.getProperty(p.Name)}set application(t){this.setProperty(p.application,t)}get application(){return this.getProperty(p.application)}set attribute(t){this.setProperty(p.EventAttribute,t)}get attribute(){return this.getProperty(p.EventAttribute)}set relationship(t){this.setProperty(p.Relationship,t)}get relationship(){return this.getProperty(p.Relationship)}set control(t){this.setProperty(p.Control,t)}get control(){return this.getProperty(p.Control)}set active(t){this.setProperty(p.EventActive,t)}get active(){return this.getProperty(p.EventActive)}getAllHandlers(){let t=this.getChildren(h.EventHandlers);return t&&t.length?t[0].getChildren(h.handler):[]}getAllDependencies(){let t=this.getChildren(h.formDependencies);return t.length===0?[]:t[0].getAllChildren()}setDependencies(t){let r=this.getFirstChild(h.formDependencies);if(S.IsNullOrUndefined(r)){if(t.length===0)return;this.addChild(new q(h.formDependencies,this)),r=this.getFirstChild(h.formDependencies)}if(t.length===0)r.getParentNode().deleteChild(r);else{r.deleteAllChildren();for(let n of t)r.addChild(new oi(r,n.toString()))}}}});var Lt,Ma=D(()=>{"use strict";Se();la();Ce();Zr();G();xe();Tt();Lt=class extends q{previewVersion;constructor(t){super(h.formControl,t)}updatePreview(){this.previewVersion=Date.now()}get ClassId(){let t=this.getProperty(p.classid);return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),new I(t)}set ClassId(t){this.setProperty(p.classid,`{${t.ToString()}}`)}get dataFieldName(){return this.getProperty(p.datafieldname)}set dataFieldName(t){this.setProperty(p.datafieldname,t)}set id(t){this.setProperty(p.id,t)}get id(){return this.getProperty(p.id)}get UniqueId(){let t=this.getProperty(p.uniqueid);return S.IsNullOrUndefined(t)?null:(t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),new I(t))}set UniqueId(t){this.setProperty(p.uniqueid,`{${t.ToString()}}`)}get isRequired(){return this.getProperty(p.isRequired)==="true"}set isRequired(t){S.IsNullOrUndefined(t)||this.setProperty(p.isRequired,String(t))}get disableMru(){return this.getParam(p.DisableMru)==="true"}set disableMru(t){S.IsNullOrUndefined(t)||this.setParameter(p.DisableMru,t)}get useMFDForCreate(){return this.getParam(p.UseMFDForCreate)==="true"}set useMFDForCreate(t){S.IsNullOrUndefined(t)||this.setParameter(p.UseMFDForCreate,t)}get useMFDForEdit(){return this.getParam(p.UseMFDForEdit)==="true"}set useMFDForEdit(t){S.IsNullOrUndefined(t)||this.setParameter(p.UseMFDForEdit,t)}get disabled(){return this.getProperty(p.disabled)==="true"}set disabled(t){S.IsNullOrUndefined(t)||this.setProperty(p.disabled,String(t))}get indicationOfSubgrid(){return this.getProperty(p.indicationOfSubgrid)==="true"}set indicationOfSubgrid(t){this.setProperty(p.indicationOfSubgrid,String(t))}getAllParameters(){let t=new Xe,r=this.getFirstChild(p.parameters);return r&&r.getAllChildren().forEach(n=>{if(n){let i=n.getAllChildren(),a=i&&i.length>0&&i[0];a&&t.add(n.getNodeName(),a.getNodeName())}}),t}setParameter(t,r){let n=!1;r===null&&(n=!0);let i=(hr.StartTag+r).toString(),a=this.parametersNode;if(a){let o=a.findFirst(s=>s&&s.getNodeName()===t);if(o)if(n){this.deleteFirstGrandChildOfName(h.controlParameters,o);return}else{let s=o.getAllChildren();s&&s.length>0&&s[0]?s[0].setNodeName(i):o.addChild(new q(i,o))}else n||(o=new q(t,a),o.addChild(new q(i,o)),a.addChild(o))}else if(!n){a=new q("parameters",this);let o=new q(t,a);o.addChild(new q(i,o)),a.addChild(o),this.addChild(a)}}getParam(t){if(this.parametersNode){let r=this.parametersNode.findFirst(n=>n&&n.getNodeName()===t);if(r){let n=r.getAllChildren(),i=n&&n.length>0&&n[0];if(i){let a=i.getNodeName();return a.charAt(0)===hr.StartTag?a.substring(1):a}}}return null}get parametersNode(){let t=this.getChildren(p.parameters);return t.length===0?null:t[0]}async serializeParameters(t,r){let n=new Xe;switch(this.ClassId.guidString.toUpperCase()){case A.LookupControl:if(t&&t.getKeys())if(t.getKeys().forEach(o=>{n.add(o,this.getParam(o))}),t&&t.containsKey("DefaultViewId")){let o=this.getParam("DefaultViewId").replace("{","").replace("}","");n.upsert("DefaultViewId",o)}else{let o=this.getParent(),s=await r.formModelService.lookupControlService.populateDefaultView(this,o.getParentForm().entityName);s&&s.id&&n.upsert("DefaultViewId",s.id.replace("{","").replace("}",""))}break;default:t&&t.getKeys()&&t.getKeys().forEach(o=>{n.add(o,this.getParam(o))});break}let i=n.getInternalObject(),a=[];for(let o in i)i.hasOwnProperty(o)&&a.push({Name:o,Value:i[o]});return a}getIsUnbound(){return this.getProperty(p.isUnbound)==="true"}getAttributeTypeFromClassId(t){if(t)switch(t.toUpperCase()){case A.BooleanControl:case A.CheckboxControl:return 0;case A.DateTimeControl:return 2;case A.DecimalControl:return 3;case A.FloatingNumberControl:return 4;case A.IntegerControl:case A.DurationControl:case A.LanguageControl:case A.TimezoneControl:return 5;case A.LookupControl:return 6;case A.CurrencyControl:return 8;case A.PartyListControl:return 10;case A.ChoiceControl:case A.RelationshipRoleChoiceControl:return 11;case A.ChoiceStatusControl:return 13;case A.TextAreaControl:case A.TextboxControl:case A.LabelControl:case A.EmailAddressControl:case A.UrlControl:case A.TickerControl:case A.ButtonControl:case A.PhoneNumberControl:return 14;case A.ChoicesControl:return 24;default:return}return 14}async toJSON(t){let r=this.getParent(),n=t&&t.formModelService&&t.formModelService.getFormType()===De.QuickViewForm?!0:this.disabled,i=await this.serializeParameters(this.getAllParameters(),t);return{ClassId:this.ClassId&&this.ClassId.guidString,Parameters:i,Disabled:n,ControlLayout:0,RequiredLevel:0,Type:this.getAttributeTypeFromClassId(this.ClassId.guidString),IsUnbound:this.getIsUnbound(),IsRequired:this.isRequired,DataFieldName:this.dataFieldName,UniqueId:this.UniqueId&&this.UniqueId.guidString,Id:this.previewVersion?this.id+this.previewVersion:this.id,Label:r.getDisplayName(t.langCode),LabelId:r.labelId&&r.labelId.guidString,Name:null,ShowLabel:r.showlabel,PreviewId:r&&r.id.guidString,Visible:r.visible||t.formModelService.showHiddenElements}}}});var li,Ad=D(()=>{"use strict";ze();$n();Ma();G();xe();li=class extends Lt{constructor(t){super(t)}get targetEntityType(){return this.getParam(p.targetEntityType)||P.EmptyString}set targetEntityType(t){this.setParameter(p.targetEntityType,t)}get viewId(){return P.StripBraces(this.getParam(p.viewId))||P.EmptyString}set viewId(t){this.setParameter(p.viewId,P.AddBraces(t))}get viewIds(){return this.getParam(p.viewIds)||P.EmptyString}set viewIds(t){this.setParameter(p.viewIds,t)}get relationshipName(){return this.getParam(p.RelationshipName)||P.EmptyString}set relationshipName(t){this.setParameter(p.RelationshipName,t)}get isUserView(){return P.IsStrictTrue(this.getParam(p.isUserView))}set isUserView(t){this.setParameter(p.isUserView,t.toString())}get enableViewPicker(){return P.IsStrictTrue(this.getParam(p.enableViewPicker))}set enableViewPicker(t){this.setParameter(p.enableViewPicker,t)}get autoExpand(){return this.getParent().autoexpand&&this.getParam(p.autoExpand)===p.Auto}set autoExpand(t){let r=this.getParent();this.setParameter(p.autoExpand,t?p.Auto:p.Fixed),r.autoexpand=t}get recordsPerPage(){return this.getParam(p.recordsPerPage)?Number(this.getParam(p.recordsPerPage)):Number(p.RecordsPerPageRAControlDefault)}set recordsPerPage(t){this.setParameter(p.recordsPerPage,String(t))}get enableQuickFind(){return P.IsStrictTrue(this.getParam(p.enableQuickFind))}set enableQuickFind(t){this.setParameter(p.enableQuickFind,t)}get teamTemplateId(){return P.StripBraces(this.getParam(p.teamTemplateId))||P.EmptyString}set teamTemplateId(t){this.setParameter(p.teamTemplateId,P.AddBraces(t))}get chartId(){return this.getParam(p.visualizationId)||P.EmptyString}set chartId(t){this.setParameter(p.visualizationId,t)}get enableChartPicker(){return P.IsStrictTrue(this.getParam(p.enableChartPicker))}set enableChartPicker(t){this.setParameter(p.enableChartPicker,t)}get chartGridMode(){switch(this.getParam(p.chartGridMode)){case yt.Chart:return yt.Chart;case yt.Grid:return yt.Grid;default:return yt.All}}set chartGridMode(t){this.setParameter(p.chartGridMode,t)}updateChartGridMode(t){t?this.chartGridMode=yt.Chart:this.chartGridMode=this.enableChartPicker?yt.All:yt.Grid}updateDefaultProperties(t,r){for(let n of t)switch(n.getNodeName()){case p.targetEntityType:n.getAllChildren()[0].setNodeName("<"+r.targetEntityType);break;case p.viewId:n.getAllChildren()[0].setNodeName("<"+P.AddBraces(r.viewId));break;case p.isUserView:n.getAllChildren()[0].setNodeName("<"+r.isUserView);break;case p.enableViewPicker:n.getAllChildren()[0].setNodeName("<"+r.enableViewPicker);break;case p.RelationshipName:let i=n.getAllChildren(),a="<"+r.relationshipName;i.length?n.getAllChildren()[0].setNodeName(a):n.addChild(new q(a,n));break;default:break}}updateControlDescription(t){let r=t.getControlDescriptionByForControl(this.UniqueId);if(r){let n=r.customControls;for(let i=0;i<n.length;i++){let a=n[i].getParameters().get(Ke.dataset)?n[i].getParameters().get(Ke.dataset)[0]:null;if(a){let o=a.getAllChildren();this.updateDefaultProperties(o,this)}else{let o=n[i].getAllChildren()[0].getAllChildren();this.updateDefaultProperties(o,this)}}}}}});var ui,wd=D(()=>{"use strict";ze();$n();Ma();G();ui=class extends Lt{constructor(t){super(t)}get defaultViewId(){return P.StripBraces(this.getParam(p.DefaultViewId))||P.EmptyString}set defaultViewId(t){this.setParameter(p.DefaultViewId,P.AddBraces(t))}get autoResolve(){return P.IsStrictTrue(this.getParam(p.AutoResolve))}set autoResolve(t){this.setParameter(p.AutoResolve,t)}get disableQuickFind(){return P.IsStrictTrue(this.getParam(p.DisableQuickFind))}set disableQuickFind(t){this.setParameter(p.DisableQuickFind,t)}get disableViewPicker(){return P.IsStrictTrue(this.getParam(p.DisableViewPicker))}set disableViewPicker(t){this.setParameter(p.DisableViewPicker,t)}get allowFilterOff(){return P.IsStrictTrue(this.getParam(p.AllowFilterOff))}set allowFilterOff(t){this.setParameter(p.AllowFilterOff,t)}get disableMru(){return P.IsStrictTrue(this.getParam(p.DisableMru))}set disableMru(t){this.setParameter(p.DisableMru,t)}get dependentAttributeName(){return this.getParam(p.DependentAttributeName)||P.EmptyString}set dependentAttributeName(t){this.setParameter(p.DependentAttributeName,t)}get dependentAttributeType(){return this.getParam(p.DependentAttributeType)||P.EmptyString}set dependentAttributeType(t){this.setParameter(p.DependentAttributeType,t)}get filterRelationshipName(){return this.getParam(p.FilterRelationshipName)||P.EmptyString}set filterRelationshipName(t){this.setParameter(p.FilterRelationshipName,t)}get availableViewIds(){return this.getParam(p.AvailableViewIds)||P.EmptyString}set availableViewIds(t){this.setParameter(p.AvailableViewIds,t)}updateDefaultProperties(t,r){for(let n of t)switch(n.getNodeName()){case p.datafieldname:case p.bindAttribute:n.getAllChildren()[0].setNodeName("<"+r.dataFieldName);break;case p.DefaultViewId:n.getAllChildren()[0].setNodeName("<"+P.AddBraces(r.defaultViewId));break;case p.AllowFilterOff:n.getAllChildren()[0].setNodeName("<"+r.allowFilterOff);break;case p.DisableQuickFind:n.getAllChildren()[0].setNodeName("<"+r.disableQuickFind);break;case p.DisableViewPicker:n.getAllChildren()[0].setNodeName("<"+r.disableViewPicker);break;case p.FilterRelationshipName:n.getAllChildren()[0].setNodeName("<"+r.filterRelationshipName);break;case p.DependentAttributeName:n.getAllChildren()[0].setNodeName("<"+r.dependentAttributeName);break;case p.DependentAttributeType:n.getAllChildren()[0].setNodeName("<"+r.dependentAttributeType);break;case p.AvailableViewIds:n.getAllChildren()[0].setNodeName("<"+r.availableViewIds);break;case p.DisableMru:n.getAllChildren()[0].setNodeName("<"+r.disableMru);break;case p.AutoResolve:n.getAllChildren()[0].setNodeName("<"+r.autoResolve);break;default:break}}updateControlDescription(t){let r=t.getControlDescriptionByForControl(this.UniqueId);if(r){let n=r.customControls;for(let i=0;i<n.length;i++){let a=n[i].getParameters().get(Ke.value)?n[i].getParameters().get(Ke.value)[0]:null;if(a){let o=a.getAllChildren();this.updateDefaultProperties(o,this)}else{let o=n[i].getAllChildren()[0].getAllChildren();this.updateDefaultProperties(o,this)}}}}}});var _w,Nd,at,Ua=D(()=>{"use strict";_w=ne(Ew());Br();G();Ce();Se();Cd();Ma();us();Oc();lc();Tt();Zr();Bn();Ad();wd();Sd();ma();Nd="_",at=class e extends We{fieldPlaceholder;fieldRequiredLevel;isNewField;cellColType;dependentFields=[];constructor(t){super(h.formCell,t),this.isNewField=!1}get cellType(){return this.cellColType}set cellType(t){this.cellColType=t}setDefaultProperties(t){this.showlabel=t,this.isLocked=!1,S.IsNullOrUndefined(this.getProperty(p.id))&&(this.id=new I(I.NewGuid()))}addControl(t,r,n,i,a,o,s){n instanceof Lt?this.addChild(n):n instanceof I&&this.addChild(this.getControlWithControlSpecificProperties(t,r,n,i,a,o,s))}removeControl(){return this.deleteChild(this.control)>=0}get isIndependent(){if(!S.IsNullOrUndefined(this.control))return S.IsNullOrUndefined(this.control.dataFieldName)?S.IsNullOrUndefined(this.control.id)?!0:!tn.dependencyFieldCount.containsKey(this.control.id):!tn.dependencyFieldCount.containsKey(this.control.dataFieldName)}createOnLoadEvent(){this.addEvent(new si(this,oa.onLoad))}get dependencies(){let t=this.getChildren(h.formEvents);for(let r of t){let n=r.getChildren(h.formEvent);for(let i of n)this.buildDependencyList(i,this.dependentFields)}return this.dependentFields}getNextAvailableControlName(t,r,n,i){let a;if(i&&Ho[i])a=Ho[i].replace(/ /g,Nd)+Nd;else{a="Control_";let u=new Error("Control class id does not exist or is undefined");(0,_w.trackErrorTrace)(Qe,{eventName:`${dh}/getNextAvailableControlName`},u)}let o="new_",s=this.getHighestIndexById(t,i)+1,l=`${a}${o}${s}`;for(;n.has(l);)s++,l=`${a}${o}${s}`;return l}getUnboundControlProperties(t){e.prototype.setProperty.call(t,p.isUnbound,"true"),e.prototype.setProperty.call(t,p.isRequired,"false")}getControlWithControlSpecificProperties(t,r,n,i,a,o,s){let l;a===At.Grid?(l=new li(this),l.indicationOfSubgrid=!0):a===At.Lookup?l=new ui(this):l=new Lt(this);let u=n.guidString,c=o||this.getNextAvailableControlName(t,i,this.getUsedNodeNameSet(t),u);if(e.prototype.setProperty.call(l,p.id,c),l.ClassId=n,!S.IsNullOrUndefined(s)&&(l.UniqueId=s),!o&&r)this.getUnboundControlProperties(l);else{let d=Ee.getUniqueIdentifierForControl(l);S.IsNullOrUndefined(d)||(Ee.getControlDataTypeByControlOrUniqueId(d)===U.QuickFormCollectionControl||!Ee.isUnboundFormControlByIdentifier(d)?a!==At.Grid&&o&&u!==A.IframeControl&&u!==A.SubgridControl&&u!==A.ReferencePanelSubgridControl&&(l.dataFieldName=o,e.prototype.setProperty.call(l,p.disabled,"false")):(this.rowspan=Ee.GetRowSpan(l),(Ee.getControlDataTypeByControlOrUniqueId(d)===U.NotesControl||Ee.getControlDataTypeByControlOrUniqueId(d)===U.TimeLineControl)&&(e.prototype.setProperty.call(l,p.disabled,"false"),l.id=U.NotesControl)),(Ee.getUnboundControlNameFromIdentifier(n)===U.SubGridControl||Ee.getUnboundControlNameFromIdentifier(n)===U.NotesControl||Ee.getUnboundControlNameFromIdentifier(n)===U.TimeLineControl)&&(this.availableforphone=!0))}return l}buildDependencyList(t,r){if(S.IsNullOrUndefined(t))return;let n=t.getAllChildren();for(let i of n){let a=i.getAllChildren();for(let o of a){let s=o.GetPropertyByParameter(p.id);o.getNodeName()===h.dependency&&s?r.push(s):this.buildDependencyList(o,r)}}}get control(){return this.getFirstChild(h.formControl)}set rowspan(t){this.setProperty(p.rowspan,String(t))}get rowspan(){let t=this.getProperty(p.rowspan);return S.IsNullOrUndefined(t)?1:parseInt(t,10)}set autoexpand(t){this.setProperty(p.auto,String(t))}get autoexpand(){return this.getProperty(p.auto)==="true"}set colspan(t){let r=Number(_c.ONE_COLUMN),n=Number(_c.FOUR_COLUMN);S.IsNullOrUndefined(t)||t>n||t<r||this.setProperty(p.colspan,String(t))}get colspan(){let t=this.getProperty(p.colspan);return S.IsNullOrUndefined(t)?1:parseInt(t,10)}getParentRow(){return this.getAncestor(h.formRow)}getParentSection(){return this.getAncestor(h.formSection)}getParentTab(){return this.getAncestor(h.formTab)}getParentForm(){return this.getAncestor(h.form)}isInHeader(){let t=this.getAncestor(h.formHeader);return!S.IsNullOrUndefined(t)}isInFooter(){let t=this.getAncestor(h.formFooter);return!S.IsNullOrUndefined(t)}isEmpty(){return S.IsNullOrUndefined(this.control)&&!this.IsUserSpacer}getHeaderFooter(){return this.isInHeader()?this.getAncestor(h.formHeader):this.isInFooter()?this.getAncestor(h.formFooter):null}get FieldRequiredLevel(){return this.fieldRequiredLevel}set FieldRequiredLevel(t){this.fieldRequiredLevel=t}get FieldPlaceholder(){return this.fieldPlaceholder}set FieldPlaceholder(t){this.fieldPlaceholder=t}get IsNewField(){return this.isNewField}set IsNewField(t){this.isNewField=t}get IsUserSpacer(){let t=this.getProperty(p.userspacer);return S.IsNullOrUndefined(t)?!1:t==="true"}SetUserSpacer(){this.setProperty(p.userspacer,"true")}ClearUserSpacer(){this.setProperty(p.userspacer,"false")}get columns(){let t=this.getProperty(p.columnName);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}getColumnLayoutValue(t){let r;switch(t){case pe.TWO_COLUMN:r="11";break;case pe.THREE_COLUMN:r="111";break;case pe.FOUR_COLUMN:r="1111";break;default:r="1"}return r}findRowIndexByCellId(t){let r=this.getParentRow().cells.indexOf(this);for(let n=0;n<t.rows.length;n++)if(!S.IsNullOrUndefined(t.rows[n].cells[r])&&this.id.ToString()===t.rows[n].cells[r].id.ToString())return n;return-1}setAutoExpandDetailsForTab(){let t=this.getParentTab();S.IsNullOrUndefined(t)||(t.autoExpandCell=this,t.tabContainsAutoExpandControl=!0)}isCellRequiredOrLocked(t,r,n){let i=this.getParentForm();if(this?.control){if(this.IsUserSpacer)return!1;{if(this.isLocked||r().has(this.control.dataFieldName))return!0;let a=i.isDuplicateCell(this,n),o=this.getRequiredLevel(t);if((o===nn.ApplicationRequired||o===nn.SystemRequired)&&!a||this.isCellLockedByExternal(t)&&!a)return!0}}return!1}getRequiredLevel(t){return!this.control?.dataFieldName||!this.control?.id||this.IsNewField||!this.control?.ClassId?nn.None:t.getEntityAttributeByName(this.control.dataFieldName)?.requiredLevel?.toString()??nn.None}isCellLockedByExternal(t){return this.control||this.IsUnboundControl?!1:t.getEntityAttributeByName(this.control.dataFieldName).isRequiredForForm||!this.isIndependent}async toJSON(t){return{Id:this.id&&this.id.guidString,Name:this.Name,Label:this.getDisplayName(t.langCode),ShowLabel:this.showlabel,Visible:this.visible||t.formModelService.showHiddenElements,LabelId:this.labelId.guidString,PreviewId:this.id&&this.id.guidString,ColSpan:this.colspan,RowSpan:this.rowspan,AutoExpand:this.autoexpand,IsInFirstColumnOfSection:!1,IsInLastColumnOfSection:!1,AvailableForPhone:this.availableforphone,UserSpacer:this.IsUserSpacer,IsPreviewCell:!1,IsStreamCell:!1,IsChartCell:!1,IsTileCell:!1,Control:this.control&&await this.control.toJSON(t)}}getUsedNodeNameSet(t){let r=new Set;return t&&t.visit(n=>{if(n.getNodeName()===h.formCell){let i=n;i.control&&i!==this&&r.add(n.control.id)}return!1}),r}getHighestIndexById(t,r){let n=t.findAll(a=>a.getNodeName()===h.formCell&&a.control&&a.control.ClassId.guidString===r),i=0;return n.forEach(a=>{i=Math.max(this.parseControlNameIndex(a.control.id),i)}),i}parseControlNameIndex(t){let r=t.length-1,n=0;for(;r>0&&parseInt(t.charAt(r),10);)r--;return r>0&&r!==t.length-1&&t.charAt(r)===Nd&&(r++,n=parseInt(t.substr(r,t.length-r),10)),n}}});var ci,Dd=D(()=>{"use strict";ze();G();xe();ci=class extends q{isInternal;constructor(t,r,n,i){super(h.library,t),this.isInternal=!!i,P.IsNullOrEmpty(n)||(this.name=r,this.libraryUniqueId=n)}get libraryUniqueId(){let t=this.getProperty(p.libraryUniqueId);return t&&t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),t?.toUpperCase()}set libraryUniqueId(t){this.setProperty(p.libraryUniqueId,t)}get name(){return this.getProperty(p.libraryName)}set name(t){this.setProperty(p.libraryName,t)}get displayName(){return this.getProperty(p.displayName)}set displayName(t){this.setProperty(p.displayName,t)}get description(){return this.getProperty(p.description)}set description(t){this.setProperty(p.description,t)}}});var un,Ed=D(()=>{"use strict";Ce();Ua();G();xe();un=class extends q{isRowAddedOnDragOver;constructor(t){super(h.formRow,t)}addCell(t){this.addChild(t)}appendCells(t){for(let r of t)this.addChild(r)}updateCell(t,r){return this.updateChild(t,r)}removeCell(t){return S.IsNullOrUndefined(t)?!1:this.deleteChild(t)>=0}insertCellAtIndex(t,r){return S.IsNullOrUndefined(t)?!1:(this.insertChildAtIndex(t,r),!0)}isEmpty(){return!this.cells||this.cells.every(t=>t.isEmpty())}getParentSection(){return this.getAncestor(h.formSection)}insertPaddingCellAtIndex(t){let r=new at(this);r.setDefaultProperties(),this.insertCellAtIndex(r,t)}get firstCell(){let t=this.cells;return t.length>0?t[0]:null}get cells(){return this.getChildren(h.formCell)}get rowColspan(){return this.cells.reduce((t,r)=>t+r.colspan,0)}set IsRowAddedOnDragOver(t){this.isRowAddedOnDragOver=t}get IsRowAddedOnDragOver(){return this.isRowAddedOnDragOver}async getCellsJSON(t){let r=[],n=[];if(this.cells){for(let i of this.cells)n.push(i.toJSON(t));for(let i of n)r.push(await i)}return r}async toJSON(t){return{Cells:await this.getCellsJSON(t),Visible:!0,Height:"0"}}}});function mk(e){switch(e){case an.Left:return on.Left;case an.Right:return on.Right;case an.Center:return on.Center;default:return on.Left}}function hk(e){switch(e){case zn.Left:return jn.Left;case zn.Top:return jn.Top;default:return jn.Left}}function Pw(e){switch(e){case 1:return 1;case 2:return 11;case 3:return 111;case 4:return 1111;default:return 1}}var gk,Qt,Ba=D(()=>{"use strict";Fc();Se();Ce();ze();bd();Ua();G();Tt();Br();Ed();gk=115,Qt=class e extends We{colSpan=1;constructor(t,r){super(t,r)}getSectionType(){let t;switch(this.columns){case 1:t=pe.ONE_COLUMN;break;case 11:t=pe.TWO_COLUMN;break;case 111:t=pe.THREE_COLUMN;break;case 1111:t=pe.FOUR_COLUMN;break;default:t=this.colSpan-1}return t}setUniqueName(){let t=this.getParentTab(),r=se.namePrefix;if(t){let n=t.Name,i=t.TotalSectionsCount+1;r=n+se.namePrefix+i.toString()}else r+=Math.floor(Math.random()*1e3);this.setProperty(p.Name,r)}initializeDefaultProperties(t,r,n){if(n===pe.REFERENCE_PANEL){this.addProperty(p.rowheight,"25");let i=`${se.referencePanelNamePrefix}${I.NewGuid()}${se.namePrefix}`;this.addProperty(p.Name,i)}else this.setUniqueName();if(this.addProperty(p.id,new I(I.NewGuid()).guidString),this.addProperty(p.IsUserDefined,se.IsUserDefined),this.addProperty(p.locklevel,se.LockLevel),this.addProperty(p.showlabel,se.ShowLabel),this.addProperty(p.showbar,se.ShowBar),this.addProperty(p.layout,se.Layout),this.addProperty(p.Fieldlabelalignment,se.labelAlignment),this.addProperty(p.Fieldlabelposition,se.labelPosition),S.IsNullOrUndefined(n))this.addProperty(p.columnName,se.columns);else{let i=this.getColumnLayoutValue(n);this.addProperty(p.columnName,i)}this.addProperty(p.LabelWidth,se.LabelWidth),this.setDisplayName(r,t)}getColumnLayoutValue(t){let r;switch(t){case pe.TWO_COLUMN:r="11";break;case pe.THREE_COLUMN:r="111";break;case pe.FOUR_COLUMN:r="1111";break;default:r="1"}return r}getNumberOfColumns(){return e.getNumericColumnLayoutValue(this.columns)}static getNumericColumnLayoutValue(t){switch(t){case 1:return 1;case 11:return 2;case 111:return 3;case 1111:return 4;default:throw new Error("Unexpected Section Layout Value.")}}getColumnCountValue(){let t=0;return S.IsNullOrUndefined(this.columns)?t=this.ColSpan:this.columns.toString().split(P.EmptyString).forEach(r=>{t+=parseInt(r,10)}),t}get ColSpan(){return this.colSpan}initializeRow(t){if(t>0&&t<5){let r=new un(null);if(this.addGrandChild(h.formRows,r),ww.getConfig().enableAutoInsertionOfCellInRow)for(let n=0;n<t;n++){let i=new at(r);i.setDefaultProperties(!1),r.addCell(i)}}}initialize(t,r,n){this.initializeDefaultProperties(t,r,n),n===pe.REFERENCE_PANEL&&(n=pe.ONE_COLUMN),this.initializeRow(n+1)}setColSpan(t){this.colSpan=t}appendRow(t){this.addGrandChild(h.formRows,t)}insertRowAtIndex(t,r){this.addGrandChildAtIndex(h.formRows,t,r)}insertRowsAtIndex(t,r){if(t&&t.length>0)for(let n=0;n<t.length;n++)this.addGrandChildAtIndex(h.formRows,t[n],r+n)}indexOfRow(t){return this.rows.indexOf(t)}deleteRow(t){return this.deleteFirstGrandChildOfName(h.formRows,t)}deleteRows(t,r){this.deleteGrandChildren(h.formRows,t,r)}get rows(){return this.getRows()}getRows(){let t=this.getChildren(h.formRows);return t.length===0?[]:t[0].getChildren(h.formRow)}get columns(){let t=this.getProperty(p.columnName),r=S.IsNullOrUndefined(t)?NaN:parseInt(t,10);if(isNaN(r)){let n=1;for(let i of this.rows)n=Math.max(n,i.cells.length);return Pw(n)}return r}set columns(t){S.IsNullOrUndefined(t)||this.setProperty(p.columnName,String(t))}get rowHeight(){let t=this.getProperty(p.rowheight);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}set rowHeight(t){this.setProperty(p.rowheight,String(t))}set autoexpand(t){this.setProperty(p.autoExpand.toLowerCase(),String(t))}get autoexpand(){return this.getProperty(p.autoExpand.toLowerCase())==="true"}get isUserDefined(){return+this.getProperty(p.IsUserDefined)!=0}set isUserDefined(t){t?this.setProperty(p.IsUserDefined,"1"):this.setProperty(p.IsUserDefined,"0")}getParentColumn(){return this.getAncestor(h.formColumn)}getParentTab(){return this.getAncestor(h.formTab)}get hasMultiColumnRow(){return this.getColumnCountValue()>1}get showlabel(){return this.getProperty(p.showlabel)==="true"}set showlabel(t){S.IsNullOrUndefined(t)||this.setProperty(p.showlabel,String(t))}get fieldLabelAlignment(){let t=se.labelAlignment,r=this.getProperty(p.Fieldlabelalignment);return S.IsNullOrUndefined(r)?t:r}set fieldLabelAlignment(t){S.IsNullOrUndefined(t)||this.setProperty(p.Fieldlabelalignment,t)}get fieldLabelPosition(){let t=this.getProperty(p.Fieldlabelposition);return S.IsNullOrUndefined(t)?se.labelPosition:t}set fieldLabelPosition(t){S.IsNullOrUndefined(t)||this.setProperty(p.Fieldlabelposition,String(t))}get showbar(){return this.getProperty(p.showbar)==="true"}set showbar(t){S.IsNullOrUndefined(t)||this.setProperty(p.showbar,String(t))}get labelwidth(){let t=+this.getProperty(p.LabelWidth);return t===0?gk:t}set labelwidth(t){S.IsNullOrUndefined(t)||t>283&&t<57||this.setProperty(p.LabelWidth,t.toString())}async getRowsJSON(t){let r=[],n=[];if(this.rows){for(let i of this.rows)n.push(i.toJSON(t));for(let i of n)r.push(await i)}return r}async toJSON(t){return{Name:this.Name,Id:this.id&&this.id.guidString,Label:this.getDisplayName(t.langCode),ShowLabel:this.showlabel,Visible:this.visible||t.formModelService.showHiddenElements,LabelId:this.labelId&&this.labelId.guidString,PreviewId:this.id&&this.id.guidString,Rows:await this.getRowsJSON(t),CellLabel:{Width:this.labelwidth,Alignment:mk(this.fieldLabelAlignment),Position:hk(this.fieldLabelPosition)},Columns:Pw(this.getColumnCountValue()),AvailableForPhone:this.availableforphone,Height:this.rowHeight&&this.rowHeight.toString()}}getUsedNodeNameSet(t){let r=new Set;return t&&t.visit(n=>{if(n.getNodeName()===h.formSection){let i=n;i.Name&&!P.GuidStringEquals(i.id.guidString,this.id.guidString)&&r.add(n.Name)}return!1}),r}isReferencePanelSection(){return!S.IsNullOrUndefined(this)&&!S.IsNullOrUndefined(this.Name)&&this.Name.indexOf(se.referencePanelNamePrefix)===0}getAllMultiRowCells(){return this.findAll(t=>{if(t.getNodeName()===h.formCell){let r=t;return!r.isEmpty()&&r.rowspan>1}return!1})}isHeaderOrFooterSection(){return this.NodeName===h.formFooter||this.NodeName===h.formHeader}}});var kr,Es=D(()=>{"use strict";G();xe();Ba();kr=class e extends q{constructor(t){super(h.formColumn,t)}initializeDefaultProperties(t){this.addProperty(p.width,t.toString()+"%")}insertSectionAtIndex(t,r){this.addGrandChildAtIndex(h.formSections,t,r)}static createAndInitNewSection(t,r,n){let i=new Qt(h.formSection,null);return i.initialize(t,r,n),i}addSectionAtIndex(t,r){this.addGrandChildAtIndex(h.formSections,t,r)}initialize(t,r,n,i=pe.ONE_COLUMN){this.initializeDefaultProperties(t);let a=e.createAndInitNewSection(r,n,i);this.addSectionAtIndex(a,this.sections.length),a.setUniqueName()}get parentTab(){return this.getAncestor(h.formTab)}get sections(){let t=this.getChildren("sections");return t.length!==1?[]:t[0].getChildren(h.formSection)}get width(){return this.getProperty(p.width)}set width(t){this.setProperty(p.width,t)}deleteSection(t){return this.deleteFirstGrandChildOfName(h.formSections,t)}async getSectionsJSON(t){let r=[];if(this.sections)for(let n of this.sections)r.push(await n.toJSON(t));return r}async toJSON(t){return{Name:this.getProperty(p.Name),Id:this.getProperty(p.id),Label:null,ShowLabel:!1,Visible:!0,LabelId:null,PreviewId:this.getProperty(p.id),Sections:await this.getSectionsJSON(t),Width:this.width}}}});var Is,Ow=D(()=>{"use strict";Se();G();Tt();Ba();Is=class extends Qt{initializeNavArea(t,r,n){this.initializeNavAreaProps(t,r,n)}get AreaName(){return this.Name}initializeNavAreaProps(t,r,n){this.addProperty(p.Name,n),this.addProperty(p.id,new I(I.NewGuid()).guidString),this.addProperty(p.columnName,se.columns),this.setDisplayName(r,t)}}});var _s,Fw=D(()=>{"use strict";Es();G();Ow();_s=class extends kr{addAndIntializeNavBarSection(t,r,n,i){let a=new Is(h.formSection,null);return a.initializeNavArea(t,r,i),this.addGrandChildAtIndex(h.formSections,a,n),a}}});var vr,Ps=D(()=>{"use strict";Se();Ce();ze();Es();G();xe();Br();vr=class extends We{tabContainsAutoExpandControl;autoExpandCell;constructor(t,r){super(h.formTab,t),this.tabContainsAutoExpandControl=!1}getParentForm(){return this.getAncestor(h.form)}getTabLayoutType(){let t;switch(this.columns.length){case 1:t=de.ONE_COLUMN;break;case 2:if(parseInt(this.columns[0].width,10)===50&&parseInt(this.columns[1].width,10)===50){t=de.TWO_COLUMN_EQUAL;break}if(parseInt(this.columns[0].width,10)===67&&parseInt(this.columns[1].width,10)===33){t=de.TWO_COLUMN_WIDER_LEFT;break}if(parseInt(this.columns[0].width,10)===34&&parseInt(this.columns[1].width,10)===66){t=de.TWO_COLUMN_WIDER_RIGHT;break}t=de.TWO_COLUMN_CUSTOM_LAYOUT;break;case 3:if(parseInt(this.columns[0].width,10)===34&&parseInt(this.columns[1].width,10)===33&&parseInt(this.columns[2].width,10)===33){t=de.THREE_COLUMN_EQUAL;break}if(parseInt(this.columns[0].width,10)===28&&parseInt(this.columns[1].width,10)===44&&parseInt(this.columns[2].width,10)===28){t=de.THREE_COLUMN_WIDER_MID;break}t=de.THREE_COLUMN_CUSTOM_LAYOUT;break;default:}return t}initializeProperties(t,r,n){this.addProperty(p.Name,Tr.namePrefix+t.toString()),this.addProperty(p.id,new I(I.NewGuid()).guidString),this.addProperty(p.IsUserDefined,Tr.IsUserDefined),this.addProperty(p.locklevel,Tr.LockLevel),this.addProperty(p.showlabel,Tr.ShowLabel),this.setDisplayName(n,r)}get TotalSectionsCount(){let t=0;for(let r of this.columns)t+=r.sections.length;return t}initializeColumns(t,r,n,i=pe.ONE_COLUMN,a=!0,o){let s=this.getChildren(h.formColumns)[0],l=[];switch(t){case de.ONE_COLUMN:l.push(100);break;case de.TWO_COLUMN_EQUAL:l.push(50),l.push(50);break;case de.TWO_COLUMN_WIDER_LEFT:l.push(67),l.push(33);break;case de.TWO_COLUMN_WIDER_RIGHT:l.push(34),l.push(66);break;case de.THREE_COLUMN_EQUAL:l.push(34),l.push(33),l.push(33);break;case de.THREE_COLUMN_WIDER_MID:l.push(28),l.push(44),l.push(28);break;default:}for(let u of l){let c=new kr(s);c.initialize(u,r,n,i),this.addGrandChild(h.formColumns,c)}}initialize(t,r,n,i,a,o=pe.ONE_COLUMN,s=!0,l){this.addChild(new q(h.formColumns,this)),this.initializeProperties(r,n,i),this.initializeColumns(t,n,a,o,s,l)}get columns(){let t=this.getChildren(h.formColumns);return t.length!==1?[]:t[0].getChildren(h.formColumn)}get expanded(){return this.getProcessedValue(p.expanded)}set expanded(t){S.IsNullOrUndefined(t)||this.setProperty(p.expanded,String(t))}get groupName(){return this.getProperty(p.groupName)}get contentType(){return this.getProperty(p.contentType)}set contentType(t){this.setProperty(p.contentType,t)}insertNewColumnAtIndex(t,r,n,i,a){t.initialize(n,i,a),this.addGrandChildAtIndex(h.formColumns,t,r)}insertColumnAtIndex(t,r){this.addGrandChildAtIndex(h.formColumns,t,r)}deleteColumn(t){return this.deleteFirstGrandChildOfName(h.formColumns,t)}async getColumnsJSON(t){let r=[],n=[];if(this.columns){for(let i of this.columns)n.push(i.toJSON(t));for(let i of n)r.push(await i)}return r}async toJSON(t){return{Name:this.Name,Id:this.id&&this.id.guidString,Label:this.getDisplayName(t.langCode)+(!this.visible&&t.formModelService.showHiddenElements?"\u3000\u3000":""),ShowLabel:this.showlabel,Visible:this.visible||t.formModelService.showHiddenElements,LabelId:this.labelId&&this.labelId.guidString,UniqueId:this.id&&this.id.guidString,PreviewId:this.id&&this.id.guidString,Columns:await this.getColumnsJSON(t),EventHandlers:[],Expanded:this.expanded,ContentType:this.contentType,AvailableForPhone:this.availableforphone,Header:void 0,Footer:void 0}}getUsedNodeNameSet(t){let r=new Set;return t&&t.visit(n=>{if(n.getNodeName()===h.formTab){let i=n;i.Name&&!P.GuidStringEquals(i.id.guidString,this.id.guidString)&&r.add(n.Name)}return!1}),r}}});var cn,Id=D(()=>{"use strict";Se();G();xe();Tt();Fw();Ps();cn=class extends vr{constructor(t,r,n){super(t,de.THREE_COLUMN_EQUAL),this.setDisplayName(r,n),this.id=new I(I.NewGuid())}initializeDefaultProps(){this.addChild(new q(h.formColumns,this)),this.initializeFiveColumns()}get columns(){let t=this.getChildren("columns");return t.length!==1?[]:t[0].getChildren(h.formColumn)}getNavSectionForArea(t){for(let r of this.columns)for(let n of r.sections)if(n.AreaName===t)return n;return null}getNavCellFromNavId(t){for(let r of this.columns)for(let n of r.sections)for(let i of n.rows)for(let a of i.cells)if(a.NavId===t)return a;return null}initializeFiveColumns(){for(let t=0;t<as.FIVE_COLUMN;t++){let r=new _s(this.getChildren(h.formColumns)[0]);r.initializeDefaultProperties($h.FiveEqColumn),this.addGrandChild(h.formColumns,r)}}}});function bk(e){switch(e){case De.Main:return xr.Main;case De.QuickCreate:return xr.QuickCreate;case De.QuickViewForm:return xr.Quick;case De.Dialog:return xr.Dialog;default:return xr.None}}function yk(e,t){if(t===De.Main){if(e)switch(e.toLowerCase()){case"low":return Fr.Low;case"highreadonlyvalues":return Fr.HighReadOnlyValues;default:return Fr.HighWithControls}return Fr.Low}}var Fs,vk,Os,Tw=D(()=>{"use strict";a0();Fs=ne(en());Fc();Ce();ze();Bn();bd();G();$n();Qu();Zr();Ua();G();Br();Dd();Id();Ps();vk="1920";Os=class e extends We{_formUniqueName;isHeaderDefaulted;consistencyStrong=!1;_formId;_rawFormXml;_entityName;_entityDisplayName;_status;_formName;_langCode;_description;_formType;_formPresentation;parameters=[];_formactivationstate;_changeTracker;_metadataChangeEvent;_etag;constructor(t,r,n,i,a,o,s,l,u){super(h.form,null),this._formUniqueName=a,this._formId=t,this._entityName=r,this._status=n,this._formName=i,this._description=l,this._formType=o,this._formPresentation=s,this._formactivationstate=u,this._changeTracker=new Go,this._metadataChangeEvent=new cs}get FormLibraries(){let t=this.getFirstChild(h.formLibraries),r=t?t.getAllChildren():[],n=this._getInternalLibraries();return r.concat(n)}getAllEvents(){let t=[],r=this.events;r&&(t=t.concat(r));for(let n of this.tabs){let i=n.events;i&&(t=t.concat(i)),n.findAll(a=>a instanceof at).forEach(a=>{let o=a.events;o&&(t=t.concat(o))})}return t}getEventsForNode(t){if(t instanceof e){let r=t.events;return r?r.filter(n=>!n.control&&!n.attribute):null}else if(t instanceof at){if(t.control?.dataFieldName){let r=this.events;return r?r.filter(n=>n.attribute&&t.control.dataFieldName===n.attribute):null}else if(this.isCellEditableGridControl(t)){let r=this.events;return r?r.filter(n=>n.control&&t.control.id===n.control):null}}return t?.events}_getInternalLibraries(){let t=this.findAll(i=>i.getNodeName()===h.internalLibraries),r=[],n="src";return t.length>0&&(r=t.map(i=>{let a=i.GetPropertyByParameter(n).replace("$webresource:",""),o=new ci(void 0,void 0,"",!0);return o.name=a,o.displayName=a,o})),r}getDependentFields(){let t=this.getAllEvents(),r=new Set;return t.forEach(n=>{try{n.getAllDependencies().forEach(a=>{r.add(a.id)})}catch(i){throw(0,Fs.trackErrorTrace)(ph,{eventName:"GetDependentFields_MissingDependencies",eventData:{Message:`Failed get dependencies for form event in form ${this.formId.guidString}.`,Attribute:n.attribute,EventName:n.eventName}}),i}}),r}get Parameters(){return this.parameters}set Parameters(t){this.parameters=t}get ShowImagecheck(){return P.IsNullOrEmpty(this.getProperty(p.ShowImage))?!0:this.getProperty(p.ShowImage)!=="false"}set ShowImagecheck(t){t?this.setProperty(p.ShowImage,String(t)):this.setProperty(p.ShowImage,"false")}get ShowNavigation(){return P.IsNullOrEmpty(this.getProperty(p.ShowNavigationbar))?!0:this.getProperty(p.ShowNavigationbar)!=="false"}set ShowNavigation(t){t?this.setProperty(p.ShowNavigationbar,String(t)):this.setProperty(p.ShowNavigationbar,"false")}get MaxWidth(){return P.IsNullOrEmpty(this.getProperty(p.MaxWidth))?vk:this.getProperty(p.MaxWidth)}set MaxWidth(t){this.setProperty(p.MaxWidth,t)}get headerDensityType(){return this.getProperty(p.HeaderDensityType)}set headerDensityType(t){t&&this.formType===De.Main?this.setProperty(p.HeaderDensityType,t):this.formType!==De.Main&&this.headerDensityType&&this.removeProperty(p.HeaderDensityType)}IsMainOrQuickCreateForm(){return this.formType===De.Main||this.formType===De.QuickCreate}get FormPresentation(){return this._formPresentation}get LanguageCode(){return this._langCode}set LanguageCode(t){this._langCode=t}get header(){let t=this.getChildren(h.formHeader);return t.length!==1?null:t[0]}set header(t){S.IsNullOrUndefined(t)||(this.deleteChild(this.header),this.addChild(t))}getAllDependencies(){return this.getChildren(h.quickFormDependencies).length===0?[]:this.ConvertModelToArray(this.getChildren(h.quickFormDependencies)[0].getAllChildren())}ConvertModelToArray(t){let r=[];return S.IsNullOrUndefined(t)||t.forEach(n=>{r.push(n.id)}),r}get footer(){let t=this.getChildren(h.formFooter);return t.length!==1?null:t[0]}set footer(t){S.IsNullOrUndefined(t)||(this.deleteChild(this.footer),this.addChild(t))}createAndInitNewTab(t,r,n){let i=new vr(null,t),a=this.getNextTabCounter(this.tabs.length+1);return i.initialize(t,a,this.LanguageCode,r,n),i}addTabAtIndex(t,r){this.addGrandChildAtIndex(h.formTabs,t,r)}createAndInitNewTabWithMarginalControl(t,r,n,i,a){let o=new vr(null,de.ONE_COLUMN),s=this.getNextTabCounter(this.tabs.length+1);o.initialize(de.ONE_COLUMN,s,this.LanguageCode,r,n,a,!1),this.addGrandChildAtIndex(h.formTabs,o,i);let l=o.columns[0].sections[0];for(let u=0;u<t.rows.length;u++)l.appendRow(t.rows[u])}getNextTabCounter(t){for(let r=0;r<this.tabs.length;r++)if(this.tabs[r].Name===Tr.namePrefix+t.toString())return this.getNextTabCounter(t+1);return t}get allTabs(){let t=this.getChildren(h.formTabs);return t.length!==1?[]:t[0].getChildren(h.formTab)}get CanvasNavigationTab(){if(this.tabs.length>0){let t=this.tabs[this.tabs.length-1];if(t instanceof cn)return t}return null}get NavigationNode(){let t=this.getChildren(h.formNavigation);return t.length!==1?null:t[0]}set NavigationNode(t){let n=this.getAllChildren().indexOf(this.NavigationNode);n>=0&&(this.deleteChild(this.NavigationNode),this.insertChildAtIndex(t,n))}addNavigatioNode(t){this.addChild(t)}get tabs(){return this.allTabs}deleteTab(t){return this.deleteFirstGrandChildOfName(h.formTabs,t)}insertTabAtIndex(t,r){this.addGrandChildAtIndex(h.formTabs,t,r)}insertRelatedTab(t){let r=this.getAllGrandChildren(h.formTabs);if(!S.IsNullOrUndefined(r)){let n=r.length;this.insertTabAtIndex(t,n)}}get isfooterPresent(){return this.getChildren(h.formFooter).length>0}get displayCondition(){let t=this.getChildren(h.formDisplayConditions);return t.length>0?t[0]:null}set displayCondition(t){this.deleteChild(this.displayCondition),this.addChild(t)}get entityName(){return this._entityName}get formId(){return this._formId}set formId(t){this._formId=t}get rawFormXml(){return this._rawFormXml}set rawFormXml(t){this._rawFormXml=t}get status(){return this._status}set status(t){this._status=t}get formName(){return this._formName}set formName(t){this.trackObjectPropertyChange("_formName",t)}get formUniqueName(){return this._formUniqueName}set formUniqueName(t){this.trackObjectPropertyChange("_formUniqueName",t)}get formType(){return this._formType}get tabCount(){return this.allTabs.length}get description(){return this._description}set description(t){this.trackObjectPropertyChange("_description",t)}get formactivationstate(){return this._formactivationstate}set formactivationstate(t){this.trackObjectPropertyChange("_formactivationstate",t)}get entityDisplayName(){return this._entityDisplayName}set entityDisplayName(t){this._entityDisplayName=t}get etag(){return this._etag}set etag(t){this._etag=t}indexOfTab(t){return this.getAllGrandChildren(h.formTabs).indexOf(t)}get ControlDescriptions(){return this.getAllGrandChildren(h.controlDescriptions)}addControlDescriptionNode(t){this.addGrandChild(h.controlDescriptions,t)}deleteControlDescByForControlId(t){let r=this.getControlDescriptionByForControl(t);S.IsNullOrUndefined(r)||this.deleteFirstGrandChildOfName(h.controlDescriptions,r)}getControlDescriptionByForControl(t){if(!t)return null;for(let r of this.ControlDescriptions)if(r.forControl.guidString===t.guidString)return r;return null}cellHasCustomControlWithName(t,r){if(!t?.control||!r)return!1;let n=this.getControlDescriptionByForControl(t.control.UniqueId);return n?!!n.customControls.find(i=>i.name===r):!1}isDuplicateCell(t,r){return!!this.findFirst(i=>{if(!(i instanceof at))return!1;let a=!0;return r==="Tab"?a=i.getParentTab()!==t.getParentTab():r==="Section"?a=i.getParentSection()!==t.getParentSection():a=i!==t,i instanceof at&&i.control&&t.control&&a&&i.control.dataFieldName===t.control.dataFieldName})}isCellEditableGridControl(t){return!t?.control?.indicationOfSubgrid||t.control.ClassId.guidString.toUpperCase()!==A.CustomControl?!1:this.cellHasCustomControlWithName(t,Rr.EditableGridControl)||Nw.getConfig()?.enableOneGridEventsForFormDesigner&&this.cellHasCustomControlWithName(t,Rr.PowerAppsOneGrid)}isCellCanvasAppControl(t){return t?.control?.ClassId.guidString.toUpperCase()===A.CustomControl&&this.cellHasCustomControlWithName(t,Rr.CanvasAppControl)}findFormNodeById(t,r=this){return r===null?null:r.findFirst(n=>{if(n===this&&t===this.formId.ToString()||n.id?.ToString?.()===t)return!0})}findFormCellByClassId(t,r=this){return r?r.findFirst(n=>{if(n.getNodeName()===h.formCell){let i=n;return i&&i.control&&i.control.ClassId.guidString===t}return!1}):null}async getTabsJSON(t){let r=this.tabs,n=[],i=[];if(r){for(let a of r)if(!(a instanceof cn)){let o=a.toJSON(t);n.push(o)}for(let a of n)i.push(await a)}return i}async getControlDescriptionsToJSON(t){let r=[];for(let n of this.ControlDescriptions){let i=await n.toJSON(t);i&&r.push(i)}return r}async toJSON(t){let r=[];r=await this.getControlDescriptionsToJSON(t);let n=this.NavigationNode&&await this.NavigationNode.toJSON(t);return{Id:this._formId.guidString,Name:this.formName,Label:this.getDisplayName(t.langCode),ShowLabel:this.showlabel,Visible:this.visible,LabelId:this.labelId&&this.labelId.guidString,PreviewId:this._formId.guidString,PreviewSessionId:(0,Fs.getSessionId)(),EntityLogicalName:this._entityName,FormId:this._formId.guidString,TabAttributes:{},Tabs:await this.getTabsJSON(t),HiddenFields:[],Header:this.header&&await this.header.toJSON(t),Footer:this.footer&&await this.footer.toJSON(t),...this.formType===De.Main?{HeaderDensity:yk(this.headerDensityType,this.formType)}:{},InlineEditGridRow:[],InlineQuickForms:[],QuickFormEntities:[],EventHandlers:[],LinkControlSections:[],FormType:bk(this.formType),SubGrids:[],Views:void 0,Charts:void 0,CustomControlConfigurations:r,BusinessLogic:void 0,FormLibraries:[],Navigation:n,ShowNavigationBar:this.ShowNavigation||t.formModelService.showHiddenElements,ClientResources:[]}}changeTracker(){return this._changeTracker}onMetadataChange=t=>this._metadataChangeEvent.on(t);raiseMetadataChange(t){this._metadataChangeEvent.emit(t)}}});var Ts,_d,Rw=D(()=>{"use strict";Se();Ce();G();xe();Br();Ts=class extends We{constructor(t){super(h.formDisplayConditions,t)}get Order(){let t=this.getProperty(p.Order);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}set Order(t){this.setProperty(p.Order,t.toString())}get FallbackForm(){return this.getProperty(p.FallbackForm)==="true"}set FallbackForm(t){this.setProperty(p.FallbackForm,t.toString())}addRoles(t){this.deleteAllChildren();for(let r=0;r<t.length;r++)this.addChild(t[r])}isRoleEveryone(){return!!(this.getChildren(h.formEveryOne)&&this.getChildren(h.formEveryOne)[0])}setRoleEveryone(){this.deleteAllChildren(),this.addChild(new _d(this))}},_d=class extends q{constructor(t){super(h.formEveryOne,t)}}});var Rs,xw=D(()=>{"use strict";G();xe();Rs=class extends q{constructor(t,r){super(h.Handler,r),t.length>0&&this.setDefaultProperties(t)}setDefaultProperties(t){this.FunctionName=t[0],this.LibraryName=t[1],this.HandlerUniqueID=t[2],this.Enabled=t[3],this.Parameters=t[4],this.PassExecutionContext=t[5]}get HandlerUniqueID(){return this.getProperty(p.HandlerUniqueId)}set HandlerUniqueID(t){this.setProperty(p.HandlerUniqueId,t)}get FunctionName(){return this.getProperty(p.functionName)}set FunctionName(t){this.setProperty(p.functionName,t)}get LibraryName(){return this.getProperty(p.libraryNameEventHandler)}set LibraryName(t){this.setProperty(p.libraryNameEventHandler,t)}get Enabled(){return this.getProperty(p.enabledForField)}set Enabled(t){this.setProperty(p.enabledForField,t)}get PassExecutionContext(){return this.getProperty(p.passExecutionContext)}set PassExecutionContext(t){this.setProperty(p.passExecutionContext,t)}get Parameters(){return this.getProperty(p.parameters)}set Parameters(t){this.setProperty(p.parameters,t)}}});var di,Pd=D(()=>{"use strict";G();Ba();di=class extends Qt{constructor(t,r){super(t,r)}get cells(){let t=this.getRows(),r=[];if(this.rows&&t.length){for(let n of this.rows)if(n.cells){let i=n.getChildren(h.formCell);for(let a of i)r.push(a)}}return r}get occupiedCells(){return this.cells.filter(t=>!t.isEmpty())}get maxColumns(){return super.getColumnCountValue()}}});var ka,Lw=D(()=>{"use strict";G();Pd();ka=class extends di{_customFooter;constructor(t,r){super(h.formFooter,t),this._customFooter=r}get customFooter(){return this._customFooter}set customFooter(t){this._customFooter=t}async getControls(t){let r=[];if(this.rows){for(let n of this.rows)if(n.cells)for(let i of n.cells)i.control&&r.push(await i.control.toJSON(t))}return r}async toJSON(t){return{AvailableForPhone:this.availableforphone,Controls:await this.getControls(t),UniqueId:this.id&&this.id.guidString,PreviewId:this.id&&this.id.guidString}}isEmpty(){return!this.cells.find(t=>!!t.control)}}});var qa,Mw=D(()=>{"use strict";G();Pd();qa=class extends di{_customHeader;constructor(t,r){super(h.formHeader,t),this._customHeader=r}get customHeader(){return this._customHeader}set customHeader(t){this._customHeader=t}get showCommandBar(){return this.getProcessedValue(p.showCommandBar)}set showCommandBar(t){t!=null&&this.setProperty(p.showCommandBar,String(t))}get showBody(){return this.getProcessedValue(p.showBody)}set showBody(t){t!=null&&this.setProperty(p.showBody,String(t))}get showTabNavigator(){return this.getProcessedValue(p.showTabNavigator)}set showTabNavigator(t){t!=null&&this.setProperty(p.showTabNavigator,String(t))}async getControls(t){let r=[];if(this.rows){for(let n of this.rows)if(n.cells)for(let i of n.cells)i.control&&r.push(await i.control.toJSON(t))}return r}async toJSON(t){return{AvailableForPhone:this.availableforphone,Controls:await this.getControls(t),UniqueId:this.id&&this.id.guidString,PreviewId:this.id&&this.id.guidString}}}});var ot,dn=D(()=>{"use strict";Se();ze();G();Br();ot=class e extends We{constructor(t,r){super(t,r)}getTitle(t){for(let r of this.getAllTitles())if(+r.getProperty(p.LCID)===t)return r.getProperty(p.text);return null}getAllTitles(){let t=this.getChildren(h.Titles);return t.length===0?[]:t[0].getChildren(h.Title)}setTitle(t,r){for(let i of this.getAllTitles())if(+i.getProperty(p.LCID)===r){i.setProperty(p.text,t);return}let n=new e(h.Title,null);n.setProperty(p.text,t),n.setProperty(p.LCID,String(r)),this.addGrandChild(h.Titles,n)}get Sequence(){return+this.getProperty(p.Sequence)}set Sequence(t){this.setProperty(p.Sequence,t.toString())}get Area(){return this.getProperty(p.Area)}set Area(t){this.setProperty(p.Area,t)}set Id(t){this.setProperty(p.Id,t)}get Id(){return this.getProperty(p.Id)}get id(){return new I(this.Id??"",!0)}set id(t){this.Id=t.guidString}get Show(){return!0}get Icon(){return this.getProperty(p.icon)}set Icon(t){t=t||P.EmptyString,this.setProperty(p.icon,t)}updateCommonProperties(t,r){this.Area=t.Area,this.Sequence=t.Sequence,this.setTitle(t.getDisplayName(r),r)}}});var $a,Uw=D(()=>{"use strict";(function(e){e[e.NavLinkNotAvailable=-1]="NavLinkNotAvailable",e[e.NavLinkIdConflict=-2]="NavLinkIdConflict",e[e.NavBarNotAvailable=-3]="NavBarNotAvailable"})($a||($a={}))});var xs,Bw=D(()=>{"use strict";Ce();G();dn();Uw();xs=class extends ot{constructor(t){super(h.formNavBar,t)}addChildElement(t){this.addChild(t)}getAllActiveNavBarChildren(){return this.getAllChildren().filter(n=>n.Show)}getAllInActiveActiveNavBarChildren(){return this.getAllChildren().filter(n=>!n.Show)}get AllRelationShipItems(){return this.getChildren("NavBarByRelationshipItem")}get AllNavLinkItems(){return this.getChildren("NavBarItem")}removeNavLink(t){let r=this.getNavBarLinkItemById(t);return S.IsNullOrUndefined(r)?$a.NavLinkNotAvailable:r.length===1?this.deleteChild(r[0]):$a.NavLinkIdConflict}getRelationShipItemsByArea(t){let r=this.AllRelationShipItems,n=[];for(let i of r)i.Area===t&&i.Show===!0&&n.push(i);return n}getNavBarRelationShipItemsByNavId(t){return this.AllRelationShipItems.filter(n=>n.Id===t)}getNavBarLinkItemById(t){let r=this.AllNavLinkItems.filter(n=>n.Id===t);return r.length>0?r:null}getAllActiveChildrenForGivenArea(t){let r=this.getAllChildren(),n=[];for(let i of r)i.Area===t&&i.Show&&n.push(i);return n}}});var ae,Ck,kw,jH,pi,Od=D(()=>{"use strict";Se();G();dn();(function(e){e.Info="_NA_Info",e.Sales="_NA_SFA",e.Service="_NA_CS",e.Marketing="_NA_MA",e.InternetMarketing="_NA_IMA",e.ProcessCenter="_NA_PROC",e.Async="_NA_AO"})(ae||(ae={}));Ck=new Map([[ae.Info,"Info"],[ae.Sales,"Sales"],[ae.Service,"Service"],[ae.Marketing,"Marketing"],[ae.ProcessCenter,"ProcessCenter"]]),kw=new Map([["Info",ae.Info],["Sales",ae.Sales],["Service",ae.Service],["Marketing",ae.Marketing],["ProcessCenter",ae.ProcessCenter]]),jH=new Map([[ae.Info,9e3],[ae.Sales,9200],[ae.Service,9400],[ae.Marketing,9600],[ae.ProcessCenter,9800],[ae.InternetMarketing,1e4],[ae.Async,10200]]),pi=class extends ot{constructor(t,r){super(h.formNavBarArea,r)}setDefaultPropertiesByType(t,r,n){this.AreaId=Ck.get(t);let i=n?.(`navBarArea.title.${this.AreaId}`)??this.AreaId;this.setTitle(i,r)}get ParentNavigation(){return this.getAncestor(h.formNavigation)}get AreaId(){return this.getProperty(p.Id)}set AreaId(t){this.setProperty(p.Id,t)}get id(){return new I(this.AreaId??"",!0)}set id(t){this.AreaId=t.guidString}async toJSON(t){return{Id:this.AreaId,Titles:[{LCID:t.langCode,Text:this.getTitle(t.langCode)}],PreviewId:this.AreaId}}}});var fi,Fd=D(()=>{"use strict";G();dn();fi=class extends ot{constructor(t,r){super(h.formNavBarAreas,r)}get AllNavBarAreaItems(){return this.getChildren(h.formNavBarArea)}get ParentNavigation(){return this.getAncestor(h.formNavigation)}addNavBarArea(t){this.addChild(t)}}});var Ls,qw=D(()=>{"use strict";Ce();G();dn();Ls=class extends ot{RelationshipNameUCIRuntime;constructor(t){super(h.formNavBarByRelationshipItem,t)}get RelationshipName(){return this.getProperty(p.RelationshipName)}set RelationshipName(t){this.setProperty(p.RelationshipName,t)}set Show(t){this.setProperty(p.Show,String(t))}get Show(){let t=this.getProperty(p.Show);return S.IsNullOrUndefined(t)||t==="true"}get TitleResourceId(){return this.getProperty(p.TitleResourceId)}async toJSON(t){return{Area:this.Area,Show:this.Show||t.formModelService.showHiddenElements,Id:this.Id,Titles:[{Name:t.langCode.toString(),Value:this.getTitle(t.langCode)}],Sequence:this.Sequence.toString(),Privileges:[],TooltipTitles:[],AvailableOffline:!0,PreviewId:this.Id,RelationshipName:this.RelationshipNameUCIRuntime??this.RelationshipName,Icon:null,ViewId:null,Client:null,TitleResourceId:null}}}});var Ms,$w=D(()=>{"use strict";G();dn();Ms=class extends ot{constructor(t){super(h.formNavBarItem,t)}get Url(){return this.getProperty(p.url)}set Url(t){this.setProperty(p.url,t)}}});var Us,Vw=D(()=>{"use strict";Se();G();Od();Fd();dn();Us=class extends ot{constructor(t,r){super(t,r)}getNavBarAreaByAreaName(t){let r=this.navBarAreas.AllNavBarAreaItems.filter(n=>n.AreaId===t);return r.length===0?null:r[0]}get navBarAreas(){return this.getFirstChild(h.formNavBarAreas)}setDefaultNavBarAreas(t,r){let n=[ae.Info,ae.Sales,ae.Service,ae.Marketing,ae.ProcessCenter];if(this.navBarAreas){let i=this.navBarAreas?.AllNavBarAreaItems;if(i&&i.length>0){let a=new Set(i.map(o=>kw.get(o.AreaId)));n=n.filter(o=>!a.has(o))}}else{let i=new fi(h.formNavBarAreas,this);i.isTransient=!0,this.addChild(i)}return n.length>0?(n.forEach(i=>{let a=new pi(h.formNavBarArea,this.navBarAreas);a.setDefaultPropertiesByType(i,t,r),this.navBarAreas.addNavBarArea(a)}),!0):!1}get navBar(){return this.getFirstChild(h.formNavBar)}get id(){return new I(sc,!0)}replaceNavAreaToGivenIndex(t,r){this.navBarAreas?.AllNavBarAreaItems.indexOf(r)!==-1&&(this.deleteFirstGrandChildOfName(h.formNavBarAreas,r),this.addGrandChildAtIndex(h.formNavBarAreas,r,t))}async getNavBarAreasJSON(t){let r=[],n=[];if(this.navBarAreas?.AllNavBarAreaItems){for(let a of this.navBarAreas.AllNavBarAreaItems)n.push(a.toJSON(t));r=await Promise.all(n)}return r}async getNavBarRelationshipItemsJSON(t){let r=[],n=[];if(this.navBar?.AllRelationShipItems){for(let i of this.navBar.AllRelationShipItems)n.push(i.toJSON(t));r=await Promise.all(n)}return r}async toJSON(t){let r=await this.getNavBarAreasJSON(t),n=await this.getNavBarRelationshipItemsJSON(t);return{NavBarAreas:{NavBarAreas:r},NavBarByRelationshipItems:n,NavBarItems:[],NavPaneIsvItems:{NavBarIsvItems:[]},ShowEmptyNavBarAreas:t.formModelService.showHiddenElements}}}});var Gw={};Bt(Gw,{ControlType:()=>At,DeserializationService:()=>xd,DeserializationServiceScope:()=>Rd,DeserializedFormElementNode:()=>st});var Td,st,Rd,At,xd,Sd=D(()=>{"use strict";Td=ne(en());Se();Ce();ze();Bn();lc();Zr();fh();i0();us();Tw();Ua();Es();Ma();yd();G();G();Rw();xe();Tt();Cd();xw();Lw();Ad();wd();Mw();Dd();Ed();Ba();Ps();Bw();Od();Fd();qw();$w();Vw();st=class extends q{constructor(t,r){super(t,r)}insertProperty(t,r){this.addProperty(t,r)}insertChild(t){this.addChild(t)}},Rd="DeserializationService";(function(e){e.Grid="Grid",e.Lookup="Lookup",e.Base="Base"})(At||(At={}));xd=class{lcid;constructor(t){this.lcid=t}deSerializeFormXml(t,r,n,i,a,o,s,l,u,c){if(!t)throw new Error("Formxml could not be parsed.");let d=t.getElementsByTagName("form");if(d.length!==1){let g="";throw d.length===0?g="FormXml has no form node.":g="FormXml has multiple form nodes.",(0,Td.trackErrorTrace)(Qe,{eventName:Rd,eventData:{error:g}}),new Error(g)}let f=this.createFormModel(d.item(0),r,n,i,a,o,s,l,u,c);return S.IsNullOrUndefined(f.displayCondition)&&s!==De.Dialog&&this.appendDefaultDisplayCondition(f),f}upsertFieldCount(t,r){let n=tn.getNecessaryLookUpTable(r),i=1;n.containsKey(t)&&(i+=n.getValue(t)),n.upsert(t,i)}appendDefaultDisplayCondition(t){let r='<DisplayConditions Order="0" FallbackForm="true"><Everyone/></DisplayConditions>';if(!S.IsNullOrUndefined(t)){let n=S.ParseXml(r);n!==null&&this.populateElementChildren(t,n.childNodes)}}createFormModel(t,r,n,i,a,o,s,l,u,c){let d=new Os(r,n,i,a,o,s,l,u,c);return this.populateElementProperties(d,t.attributes),this.populateElementChildren(d,t.childNodes),s===De.Main&&(this.insertHeaderFooterElementProperties(h.formHeader,d,d.header),this.insertHeaderFooterElementProperties(h.formFooter,d,d.footer)),d}insertHeaderFooterElementProperties(t,r,n){if(S.IsNullOrUndefined(n)){let i=t===h.formHeader?new qa(r,!0):new ka(r,!0);st.prototype.insertProperty.call(i,p.id,"{"+I.NewGuid()+"}"),st.prototype.insertProperty.call(i,p.Fieldlabelposition,"Top"),st.prototype.insertProperty.call(i,p.columnName,se.MarginalControlColumns),st.prototype.insertProperty.call(i,p.LabelWidth,se.LabelWidth),st.prototype.insertProperty.call(i,p.Fieldlabelalignment,"Left");let a=null,o=new un(a);for(let s=0;s<i.maxColumns;s++){let l=new at(o);st.prototype.insertProperty.call(l,p.id,"{"+I.NewGuid()+"}"),l.setDisplayName(P.EmptyString,this.lcid),st.prototype.insertProperty.call(l,p.showlabel,"false"),o.addCell(l)}i.appendRow(o),t===h.formHeader?r.header=i:r.footer=i}}deSerializeFormXmlNode(t,r){if(t&&t.nodeValue&&(t.nodeType===Node.TEXT_NODE||t.nodeType===Node.CDATA_SECTION_NODE))return new st(`<${t.nodeValue}`,r);if(t.nodeType===Node.COMMENT_NODE)return;let n=this.createModelNode(t,r);return this.populateElementProperties(n,t.attributes),this.populateElementChildren(n,t.childNodes),n}populateElementProperties(t,r){if(!r){let n="attributes is undefined for element: "+t.getNodeName();throw(0,Td.trackErrorTrace)(Qe,{eventName:Rd,eventData:{error:n}}),new Error(n)}for(let n=0;n<r.length;n++){let i=r.item(n);i&&(st.prototype.insertProperty.call(t,i.name,i.value),t.getNodeName()===h.formCell&&i.name===p.auto&&i.value==="true"&&t.setAutoExpandDetailsForTab())}}populateElementChildren(t,r){for(let n=0;n<r.length;n++){let i=r.item(n),a=this.deSerializeFormXmlNode(i,t);a&&st.prototype.insertChild.call(t,a)}}createModelNode(t,r){switch(t.nodeName){case h.form:throw new Error("Form node shouldn't be created using this method");case h.formTab:return new vr(r);case h.formColumn:return new kr(r);case h.formHeader:return new qa(r,!1);case h.formFooter:return new ka(r,!1);case h.formSection:return new Qt(h.formSection,r);case h.formRow:return new un(r);case h.formCell:return new at(r);case h.formControl:let n=t.attributes,i=t.childNodes.length>0?t.childNodes[0].childNodes:null,a;for(let s=0;s<n.length;s++){let l=n.item(s);if(l.name===p.indicationOfSubgrid&&l.value==="true"||l.name===p.classid&&(l.value?.toLocaleUpperCase()===`{${A.SubgridControl}}`||l.value?.toLocaleUpperCase()===`{${A.ReferencePanelSubgridControl}}`))a=At.Grid;else if(l.name===p.classid&&l.value?.toLocaleUpperCase()===`{${A.LookupControl}}`)a=At.Lookup;else if(l.name===p.classid&&l.value?.toLocaleUpperCase()===`{${A.CustomControl}}`)for(let u=0;u<i?.length;u++)i[u].nodeName===p.DefaultViewId&&(a=At.Lookup)}return a===At.Grid?new li(r):a===At.Lookup?new ui(r):new Lt(r);case h.formEvent:return new si(r,P.EmptyString);case h.dependency:return this.populateDependencyTable(t),new oi(r,P.EmptyString);case h.Handler:let o=[];return new Rs(o,r);case h.formNavigation:return new Us(t.nodeName,r);case h.formNavBarArea:return new pi(t.nodeName,r);case h.formNavBarAreas:return new fi(t.nodeName,r);case h.formNavBar:return new xs(r);case h.formNavBarByRelationshipItem:return new Ls(r);case h.formNavBarItem:return new Ms(r);case h.formDisplayConditions:return new Ts(r);case h.library:return new ci(r,P.EmptyString,P.EmptyString);case h.controlDescription:return new Jo(r);case h.customControl:return this.populateCustomControlConfigurationId(t),new ls(r);default:return new st(t.nodeName,r)}}populateDependencyTable(t){let r=t.attributes;for(let n=0;n<r.length;n++){let i=r.item(n);i.name===p.id&&this.upsertFieldCount(i.value,Wt.DependencyFieldTable)}}populateCustomControlConfigurationId(t){let r=t.attributes;for(let n=0;n<r.length;n++){let i=r.item(n);if(i.name===p.id){let a=new I(i.value.substr(1,i.value.length-2));for(let o=0;o<t.parentNode.attributes.length;o++){let s=t.parentNode.attributes.item(o);if(s.name===p.ForControl){let l=s.value.substr(1,i.value.length-2);Ee.CustomControlIdMap.upsert(l,a);break}}break}}}}});var zw={};Bt(zw,{SerializationService:()=>Ld,SerializationServiceScope:()=>Ak,SerializedFormElementNode:()=>mi});var Ak,mi,Ld,Ww=D(()=>{"use strict";ze();xe();Tt();Id();Ak="SerializationService",mi=class extends q{fetchNodeName(){return this.getNodeName()}enumerateProperties(){return this.getAllProperties()}enumerateChildren(){return this.getAllChildren()}},Ld=class{langCode;constructor(t){this.langCode=t}serializeFormXmlNode(t){let r=mi.prototype.fetchNodeName.call(t);if(r.charAt(0)===hr.StartTag)return P.EscapeXml(r.substr(1),!1);if(t.isTransient&&!t.isDirty())return P.EmptyString;let n=mi.prototype.enumerateProperties.call(t),i=mi.prototype.enumerateChildren.call(t);if(!(t instanceof cn)){let a=`<${r}`;if(n.length!==0&&(a+=` ${this.getPropertiesString(n)}`),i.length===0)a+=" />";else{let o=P.EmptyString;for(let s of i)o+=this.serializeFormXmlNode(s);a+=`>${o}</${r}>`}return a}return P.EmptyString}getPropertiesString(t){let r=P.EmptyString;return t.forEach((n,i)=>{i!==0&&(r+=" "),r+=`${n.key}="${P.EscapeXml(n.value,!0)}"`}),r}}});var pn=m(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.rebuildRaw=lt.assembleChildren=lt.spliceChildren=lt.mergeAttrs=lt.rawFromNode=lt.emptyBag=void 0;var qr=be(),jw=1e6,ks=512;function wk(){return{a:[],c:[]}}lt.emptyBag=wk;function Hw(e,t=0){if(t>ks)throw new qr.InvalidArgumentError(`Artifact node tree exceeds the maximum depth of ${ks}`);return{n:e.getNodeName(),a:e.getAllProperties().map(r=>[r.key,r.value]),c:e.getAllChildren().map(r=>Hw(r,t+1))}}lt.rawFromNode=Hw;function Nk(e,t){let r=new Map;for(let[a,o]of t)r.set(a,o);let n=new Set,i=[];for(let[a,o]of e)r.has(a)?i.push([a,r.get(a)]):i.push([a,o]),n.add(a);for(let[a,o]of t)n.has(a)||(i.push([a,o]),n.add(a));return i}lt.mergeAttrs=Nk;function Bs(e,t){let r=new Set;for(let s of e){let l=s.i;if(!Number.isInteger(l)||l<0||l>jw)throw new qr.InvalidArgumentError(`Bag child index must be an integer in [0, ${jw}] (got ${String(l)})`);if(r.has(l))throw new qr.InvalidArgumentError(`Duplicate bag child index ${l}`);r.add(l)}let n=[...e].sort((s,l)=>s.i-l.i),i=[],a=0,o=0;for(let s of n){for(;o<s.i&&a<t.length;)i.push(t[a]),a+=1,o+=1;o<s.i&&(o=s.i),i.push(s.node),o+=1}for(;a<t.length;)i.push(t[a]),a+=1;return i}lt.spliceChildren=Bs;function Sk(e,t){if(e.w){let r={n:e.w.n,a:e.w.a.map(n=>[n[0],n[1]]),c:Bs(e.w.c,t)};return Bs(e.c,[r])}return Bs(e.c,t)}lt.assembleChildren=Sk;function Jw(e,t,r,n=0){if(n>ks)throw new qr.InvalidArgumentError(`Artifact node tree exceeds the maximum depth of ${ks}`);Dk(e,n);let i=t.make(e.n,r);for(let[a,o]of e.a)t.setProp(i,a,o);for(let a of e.c)t.addChild(i,Jw(a,t,i,n+1));return i}lt.rebuildRaw=Jw;function Dk(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new qr.InvalidArgumentError(`Malformed hybrid node at depth ${t}: expected a JSON object`);let r=e;if(typeof r.n!="string")throw new qr.InvalidArgumentError(`Malformed hybrid node at depth ${t}: 'n' (tag name) must be a string`);if(!Array.isArray(r.a)||!Array.isArray(r.c))throw new qr.InvalidArgumentError(`Malformed hybrid node '${r.n}': 'a' and 'c' must be arrays`);for(let n of r.a)if(!Array.isArray(n)||n.length!==2||typeof n[0]!="string"||typeof n[1]!="string")throw new qr.InvalidArgumentError(`Malformed hybrid node '${r.n}': each attribute must be a [string, string] pair`)}});var $r=m(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.childObjects=ut.optionalGuidId=ut.optionalEnum=ut.eachObject=ut.issue=ut.isJsonObject=void 0;function Qw(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}ut.isJsonObject=Qw;function Va(e,t,r,n){return n?{pointer:e,rule:t,message:r,fatal:n}:{pointer:e,rule:t,message:r}}ut.issue=Va;function Xw(e,t,r,n){if(!Array.isArray(e))return[];let i=[];return e.forEach((a,o)=>{Qw(a)?i.push({node:a,index:o}):n.push(Va(`${t}/${o}`,`${r}-must-be-object`,`a ${r} must be a JSON object, got ${a===null?"null":typeof a}`))}),i}ut.eachObject=Xw;function Ek(e,t,r,n,i,a){let o=e[t];o!==void 0&&(typeof o!="string"||!r.includes(o))&&a.push(Va(`${n}/${t}`,i,`${t} must be one of ${r.map(s=>`'${s}'`).join(", ")}, got ${JSON.stringify(o)}`))}ut.optionalEnum=Ek;var Ik=/^(?:\{[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}\}|[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})$/;function _k(e,t,r,n,i){let a=e[t];typeof a=="string"&&a!==""&&!Ik.test(a)&&i.push(Va(`${r}/${t}`,n,`${t} must be a GUID or empty, got '${a}'`))}ut.optionalGuidId=_k;function Pk(e,t,r,n,i){let a=e[t],o=`${r}/${t}`;return a===void 0?[]:Array.isArray(a)?Xw(a,o,n,i):(i.push(Va(o,`${n}-list-must-be-array`,`${t} must be an array when present, got ${typeof a}`)),[])}ut.childObjects=Pk});var Kw=m(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.formApi=void 0;var br=$e(),Ga=ue(),Ok="formid,formxml,name,type,objecttypecode,formpresentation,formactivationstate,uniquename,description,versionnumber",Fk="formid,name,type,objecttypecode",Tk=2;qs.formApi={async get(e,t){let n=`/systemforms(${(0,Ga.normalizeGuid)(t,"id")})${(0,Ga.odataQuery)([["$select",Ok]])}`,i=(0,br.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,br.readEtag)(i)}},async list(e,t){var r;let n=[`type eq ${Tk}`];t?.entityLogicalName&&n.push(`objecttypecode eq '${(0,Ga.odataLiteral)(t.entityLogicalName)}'`);let i=`/systemforms${(0,Ga.odataQuery)([["$select",Fk],["$filter",n.join(" and ")]])}`,o=(0,br.ensureSuccess)(await e.get(i),e.apiUrl(i)).body;return((r=o?.value)!==null&&r!==void 0?r:[]).map(l=>{var u,c;return{type:"form",id:(u=l.formid)!==null&&u!==void 0?u:"",name:(c=l.name)!==null&&c!==void 0?c:"",entityLogicalName:l.objecttypecode,isDirty:!1}})},async create(e,t){let r="/systemforms",n=(0,br.ensureSuccess)(await e.post(r,t),e.apiUrl(r));return{id:(0,br.requireCreatedId)(n,"formid","form"),etag:(0,br.readEtag)(n)}},async update(e,t,r,n){let i=(0,Ga.normalizeGuid)(t,"id"),a=`/systemforms(${i})`,o=n?{"If-Match":n}:void 0,s=(0,br.ensureSuccess)(await e.patch(a,r,o?{headers:o}:void 0),e.apiUrl(a));return{id:i,etag:(0,br.readEtag)(s)}},delete(e,t){return(0,br.deleteRecord)(e,"systemforms",t)}}});var fn=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.installDomShim=void 0;var Yw=Wu(),Zw=!1,Rk={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};function xk(){if(Zw)return;let e=globalThis;typeof e.DOMParser>"u"&&(e.DOMParser=Yw.DOMParser),typeof e.XMLSerializer>"u"&&(e.XMLSerializer=Yw.XMLSerializer),typeof e.Node>"u"&&(e.Node=Rk),Zw=!0}$s.installDomShim=xk});var f2=m(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.classIdForAttributeType=ct.QUICK_VIEW_CLASS_ID=ct.NOTES_CLASS_ID=ct.SUBGRID_CLASS_ID=ct.formRegistration=ct.FormAdapter=void 0;var wt=(Se(),kt(ih)),Lk=(Ce(),kt(ah)),Mk=(xe(),kt(sh)),je=(G(),kt(oh)),Ie=(Zr(),kt(lh)),Uk=(Sd(),kt(Gw)),Bk=(Ww(),kt(zw)),_e=pn(),mn=$r(),kk=Kw(),qk=Ft(),kd=ue(),i2=fn(),Xt=1033,$k={[je.FormType.Main]:"Main",[je.FormType.QuickCreate]:"QuickCreate",[je.FormType.QuickViewForm]:"QuickView",[je.FormType.Card]:"Card"},Md={Main:je.FormType.Main,QuickCreate:je.FormType.QuickCreate,QuickView:je.FormType.QuickViewForm,Card:je.FormType.Card},Vk=new Map(Object.entries(Ie.ControlClassId).map(([e,t])=>[String(t).toUpperCase(),e]));function a2(e){var t;return e&&(t=Vk.get(e.toUpperCase()))!==null&&t!==void 0?t:"Unknown"}function za(e){return e.getAllProperties().map(t=>[t.key,t.value])}function hn(e){let t=new Map;for(let r of e.getAllProperties())t.has(r.key)||t.set(r.key,r.value);return t}function o2(e,t){return e.getAllChildren().find(r=>r.getNodeName()===t)}function qd(e){var t,r;let n=o2(e,"labels");if(!n)return"";let i=n.getAllChildren().filter(o=>o.getNodeName()==="label"),a=(t=i.find(o=>hn(o).get("languagecode")===String(Xt)))!==null&&t!==void 0?t:i[0];return a&&(r=hn(a).get("description"))!==null&&r!==void 0?r:""}function Gk(e){let t=o2(e,"parameters"),r={};if(!t)return r;for(let n of t.getAllChildren()){let i=n.getNodeName();if(i.charAt(0)==="<"||i.charAt(0)==="#")continue;let a=n.getAllChildren()[0],o=a?a.getNodeName():"";o.charAt(0)==="<"&&(o=o.substring(1)),r[i]=o}return r}function s2(e){return/^1+$/.test(e)&&e.length>=1&&e.length<=4?e.length:1}function Ud(e){let t=Math.min(Math.max(Math.trunc(e),1),4);return"1".repeat(t)}function gn(e){return e.replace(/[{}]/g,"")}function Bd(e){return`{${gn(e)}}`}function e2(e,t){if(e===void 0||e==="")return t;let r=Number(e);return Number.isNaN(r)?t:r}function Gs(e,t,r){let n=e.getAllChildren(),i=n.findIndex(u=>u.getNodeName()===t),a=[];if(n.forEach((u,c)=>{c!==i&&a.push({i:c,node:(0,_e.rawFromNode)(u)})}),i<0)return{modeled:[],bag:{a:za(e),c:a}};let o=n[i],s=[],l=[];return o.getAllChildren().forEach((u,c)=>{u.getNodeName()===r?s.push(u):l.push({i:c,node:(0,_e.rawFromNode)(u)})}),{modeled:s,bag:{a:za(e),c:a,w:{n:o.getNodeName(),a:za(o),c:l}}}}function l2(e,t,r){let n=[],i=[];return e.getAllChildren().forEach((a,o)=>{a.getNodeName()===t&&(!r||n.length===0)?n.push(a):i.push({i:o,node:(0,_e.rawFromNode)(a)})}),{modeled:n,bag:{a:za(e),c:i}}}function zk(e){let{modeled:t,bag:r}=Gs(e,"tabs","tab");return{tabs:t.map(Wk),bag:r}}function Wk(e){var t,r;let n=hn(e),{modeled:i,bag:a}=Gs(e,"columns","column");return{id:(t=n.get("id"))!==null&&t!==void 0?t:"",name:(r=n.get("name"))!==null&&r!==void 0?r:"",label:qd(e),expanded:n.get("expanded")==="true",visible:n.has("visible")?n.get("visible")==="true":!0,columns:i.map(jk),bag:a}}function jk(e){let t=hn(e),{modeled:r,bag:n}=Gs(e,"sections","section");return{width:t.get("width"),sections:r.map(Hk),bag:n}}function Hk(e){var t,r,n;let i=hn(e),{modeled:a,bag:o}=Gs(e,"rows","row");return{id:(t=i.get("id"))!==null&&t!==void 0?t:"",name:(r=i.get("name"))!==null&&r!==void 0?r:"",label:qd(e),visible:i.has("visible")?i.get("visible")==="true":!0,showLabel:i.get("showlabel")==="true",columns:s2((n=i.get("columns"))!==null&&n!==void 0?n:"1"),rows:a.map(Jk),bag:o}}function Jk(e){let{modeled:t,bag:r}=l2(e,"cell",!1);return{cells:t.map(Qk),bag:r}}function Qk(e){var t;let r=hn(e),{modeled:n,bag:i}=l2(e,"control",!0),a=qd(e),o=r.get("showlabel")==="true",s=n[0]?Xk(n[0],a,o):null;return{id:(t=r.get("id"))!==null&&t!==void 0?t:"",visible:r.has("visible")?r.get("visible")==="true":!0,colspan:e2(r.get("colspan"),1),rowspan:e2(r.get("rowspan"),1),control:s,bag:i}}function Xk(e,t,r){var n,i;let a=hn(e),o=gn((n=a.get("classid"))!==null&&n!==void 0?n:""),s=a.get("datafieldname");return{id:(i=a.get("id"))!==null&&i!==void 0?i:"",classId:o,fieldName:s||null,type:a2(o),isRequired:a.get("isrequired")==="true",isReadOnly:a.get("disabled")==="true",label:t,showLabel:r,parameters:Gk(e),bag:{a:za(e),c:e.getAllChildren().map((l,u)=>({i:u,node:(0,_e.rawFromNode)(l)}))}}}function hi(e){return e.a.length===0&&e.c.length===0&&!e.w}function u2(e,t){let r=e.a.find(n=>n[0]===t);return r?r[1]:void 0}function vn(e,t){var r;let n=new Set(e.a.map(o=>o[0])),i=hi(e),a=[];for(let o of t)if(n.has(o.key)){let s=(r=u2(e,o.key))!==null&&r!==void 0?r:"";o.matches(s)||a.push([o.key,o.render()])}else i?a.push([o.key,o.render()]):o.matches(o.absentDefault)||a.push([o.key,o.render()]);return(0,_e.mergeAttrs)(e.a,a)}var Vr=(e,t)=>({key:e,matches:r=>r===t,render:()=>t,absentDefault:""}),Gr=(e,t,r=!1)=>({key:e,matches:n=>n==="true"===t,render:()=>String(t),absentDefault:String(r)}),t2=(e,t,r=1)=>({key:e,matches:n=>Number(n)===t,render:()=>String(t),absentDefault:String(r)});function $d(e){return{n:"labels",a:[],c:[{n:"label",a:[["description",e],["languagecode",String(Xt)]],c:[]}]}}function c2(e){return{n:"parameters",a:[],c:Object.keys(e).map(t=>({n:(0,kd.assertXmlName)(t,"Form control parameter name"),a:[],c:[{n:`<${e[t]}`,a:[],c:[]}]}))}}function Kk(e){var t,r;let n=e.c.find(a=>a.n==="label"&&a.a.some(o=>o[0]==="languagecode"&&o[1]===String(Xt))),i=n??e.c.find(a=>a.n==="label");return(r=(t=i?.a.find(a=>a[0]==="description"))===null||t===void 0?void 0:t[1])!==null&&r!==void 0?r:""}function Yk(e,t){let r=!1,n=e.c.map(i=>i.n!=="label"||!i.a.some(o=>o[0]==="languagecode"&&o[1]===String(Xt))?i:(r=!0,{...i,a:i.a.map(o=>o[0]==="description"?["description",t]:o)}));return r||n.push({n:"label",a:[["description",t],["languagecode",String(Xt)]],c:[]}),{...e,c:n}}function Vd(e,t){let r=e.c.findIndex(i=>i.node.n==="labels");if(r<0||Kk(e.c[r].node)===t)return e;let n=Yk(e.c[r].node,t);return{...e,c:e.c.map((i,a)=>a===r?{...i,node:n}:i)}}function Zk(e){let t={};for(let r of e.c){let n=r.n;if(n.charAt(0)==="<"||n.charAt(0)==="#")continue;let i=r.c[0],a=i?i.n:"";a.charAt(0)==="<"&&(a=a.substring(1)),t[n]=a}return t}function e3(e,t){let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(i=>e[i]===t[i])}function t3(e,t){return e.a.some(r=>r[0]===t)?{...e,a:e.a.filter(r=>r[0]!==t)}:e}function r3(e,t){let r=e.c.findIndex(i=>i.node.n==="parameters");if(r<0||e3(Zk(e.c[r].node),t))return e;let n=c2(t);return{...e,c:e.c.map((i,a)=>a===r?{...i,node:n}:i)}}function zs(e,t,r,n){if(e.w){let o={n:e.w.n,a:e.w.a.map(s=>[s[0],s[1]]),c:(0,_e.spliceChildren)(e.w.c,r)};return(0,_e.spliceChildren)(e.c,[o])}let i=n(),a={n:t,a:[],c:r};return e.c.length===0?[...i,a]:(0,_e.spliceChildren)(e.c,[...i,a])}function n3(e){let t=e.tabs.map(i3);return{n:"form",a:vn(e.bag,[]),c:e.tabs.length===0&&hi(e.bag)?[]:zs(e.bag,"tabs",t,()=>[])}}function i3(e){let t=[Vr("id",e.id),Vr("name",e.name),Gr("expanded",e.expanded),Gr("visible",e.visible,!0)],r=e.columns.map(a3),n=Vd(e.bag,e.label);return{n:"tab",a:vn(n,t),c:zs(n,"columns",r,()=>e.label?[$d(e.label)]:[])}}function a3(e){let t=e.width!==void 0?[Vr("width",e.width)]:[],r=e.sections.map(o3);return{n:"column",a:vn(e.bag,t),c:zs(e.bag,"sections",r,()=>[])}}function o3(e){let t=[Vr("id",e.id),Vr("name",e.name),Gr("showlabel",e.showLabel),Gr("visible",e.visible,!0),{key:"columns",matches:i=>s2(i)===e.columns,render:()=>Ud(e.columns),absentDefault:Ud(1)}],r=e.rows.map(s3),n=Vd(e.bag,e.label);return{n:"section",a:vn(n,t),c:zs(n,"rows",r,()=>e.label?[$d(e.label)]:[])}}function s3(e){let t=e.cells.map(l3);return{n:"row",a:vn(e.bag,[]),c:hi(e.bag)?t:(0,_e.assembleChildren)(e.bag,t)}}function l3(e){let t=e.control?e.control.showLabel:u2(e.bag,"showlabel")==="true",r=[Vr("id",e.id),Gr("showlabel",t),Gr("visible",e.visible,!0),t2("colspan",e.colspan),t2("rowspan",e.rowspan)],n=e.control?[u3(e.control)]:[],i;if(hi(e.bag))i=[...e.control&&e.control.label?[$d(e.control.label)]:[],...n];else{let a=e.control?Vd(e.bag,e.control.label):e.bag;i=(0,_e.assembleChildren)(a,n)}return{n:"cell",a:vn(e.bag,r),c:i}}function u3(e){let t=[Vr("id",e.id),{key:"classid",matches:i=>gn(i)===e.classId,render:()=>Bd(e.classId),absentDefault:""}];e.fieldName!==null&&t.push(Vr("datafieldname",e.fieldName)),t.push(Gr("disabled",e.isReadOnly)),t.push(Gr("isrequired",e.isRequired));let r=e.fieldName===null?t3(e.bag,"datafieldname"):e.bag,n;return hi(r)?n=Object.keys(e.parameters).length>0?[c2(e.parameters)]:[]:n=(0,_e.assembleChildren)(r3(r,e.parameters),[]),{n:"control",a:vn(r,t),c:n}}var c3={make:(e,t)=>new Mk.FormElementNode(e,t),setProp:(e,t,r)=>e.setProperty(t,r),addChild:(e,t)=>e.addChild(t)};function r2(e,t){(0,i2.installDomShim)();let r=p3(e,t),n=(0,_e.rebuildRaw)(n3(r),c3,null);return new Bk.SerializationService(Xt).serializeFormXmlNode(n)}function d3(e){return JSON.parse(JSON.stringify(e))}function p3(e,t){var r;let n=d3(e);n.bag||(n.bag=(0,_e.emptyBag)()),C3(n.bag),t&&f3(n,t);for(let i of(r=n.tabs)!==null&&r!==void 0?r:[])m3(i);return n}function f3(e,t){var r;let n=(r=e.entityLogicalName)!==null&&r!==void 0?r:"";d2(e,i=>{let a=i.fieldName,o=i;if(!a||o.label!==void 0&&o.classId!==void 0)return;let s=t.resolveField(n,a);s&&(o.label===void 0&&s.displayName&&(o.label=s.displayName),o.classId===void 0&&s.attributeType&&(o.classId=p2(s.attributeType)))})}function d2(e,t){var r,n,i,a,o;for(let s of(r=e.tabs)!==null&&r!==void 0?r:[])for(let l of(n=s.columns)!==null&&n!==void 0?n:[])for(let u of(i=l.sections)!==null&&i!==void 0?i:[])for(let c of(a=u.rows)!==null&&a!==void 0?a:[])for(let d of(o=c.cells)!==null&&o!==void 0?o:[])d.control&&t(d.control)}function m3(e){e.id||(e.id=wt.Guid.NewGuid()),e.name===void 0&&(e.name=""),e.label===void 0&&(e.label=""),e.expanded===void 0&&(e.expanded=!0),e.visible===void 0&&(e.visible=!0),e.columns||(e.columns=[]);for(let t of e.columns)h3(t);e.bag||(e.bag=(0,_e.emptyBag)())}function h3(e){e.sections||(e.sections=[]);for(let t of e.sections)g3(t);e.bag||(e.bag=(0,_e.emptyBag)()),e.width===void 0&&hi(e.bag)&&(e.width="100%")}function g3(e){e.id||(e.id=wt.Guid.NewGuid()),e.name===void 0&&(e.name=""),e.label===void 0&&(e.label=""),e.showLabel===void 0&&(e.showLabel=!1),e.visible===void 0&&(e.visible=!0),e.columns===void 0&&(e.columns=1),e.rows||(e.rows=[]);for(let t of e.rows)v3(t);e.bag||(e.bag=(0,_e.emptyBag)())}function v3(e){e.cells||(e.cells=[]);for(let t of e.cells)b3(t);e.bag||(e.bag=(0,_e.emptyBag)())}function b3(e){e.id||(e.id=wt.Guid.NewGuid()),e.visible===void 0&&(e.visible=!0),e.colspan===void 0&&(e.colspan=1),e.rowspan===void 0&&(e.rowspan=1),e.control===void 0&&(e.control=null),e.control&&y3(e.control),e.bag||(e.bag=(0,_e.emptyBag)())}function y3(e){var t;e.id||(e.id=wt.Guid.NewGuid()),e.classId===void 0&&(e.classId=String(Ie.ControlClassId.TextboxControl)),e.fieldName===void 0&&(e.fieldName=null),e.type===void 0&&(e.type=e.fieldName?"Field":a2(String(e.classId))),e.isRequired===void 0&&(e.isRequired=!1),e.isReadOnly===void 0&&(e.isReadOnly=!1),e.label===void 0&&(e.label=(t=e.fieldName)!==null&&t!==void 0?t:""),e.showLabel===void 0&&(e.showLabel=!0),(e.parameters===void 0||e.parameters===null)&&(e.parameters={});for(let r of Object.keys(e.parameters))(0,kd.assertXmlName)(r,"Form control parameter name");e.bag||(e.bag=(0,_e.emptyBag)())}function C3(e){for(let t of e.c){let r=t.node;if(r.n==="events"){for(let n of r.c)if(n.n==="event"){for(let i of n.c)if(i.n==="Handlers")for(let a of i.c)a.n==="Handler"&&!n2(a,"handlerUniqueId")&&a.a.push(["handlerUniqueId",Bd(wt.Guid.NewGuid())])}}else if(r.n==="formLibraries")for(let n of r.c)n.n==="Library"&&!n2(n,"libraryUniqueId")&&n.a.push(["libraryUniqueId",Bd(wt.Guid.NewGuid())])}}var Vs=class{toArtifact(t){var r,n,i;let{tabs:a,bag:o}=zk(t);return{id:t.formId?t.formId.guidString:"",name:(r=t.formName)!==null&&r!==void 0?r:"",entityLogicalName:(n=t.entityName)!==null&&n!==void 0?n:"",formType:(i=$k[t.formType])!==null&&i!==void 0?i:"Main",status:this.readActivationStatus(t),tabs:a,bag:o}}fromArtifact(t){return this.deserialize({formxml:r2(t),formid:t.id||wt.Guid.NewGuid(),objecttypecode:t.entityLogicalName,type:Md[t.formType],name:t.name,uniquename:t.name,description:"",formpresentation:je.FormPresentation.AirForm,formactivationstate:t.status==="Active"?je.FormActivationState.Active:je.FormActivationState.InActive})}fromApiResponse(t){var r,n,i,a,o,s;let l=t,u=this.deserialize({formxml:(r=l.formxml)!==null&&r!==void 0?r:"",formid:(n=l.formid)!==null&&n!==void 0?n:wt.Guid.NewGuid(),objecttypecode:(i=l.objecttypecode)!==null&&i!==void 0?i:"",type:l.type,name:(a=l.name)!==null&&a!==void 0?a:"",uniquename:(o=l.uniquename)!==null&&o!==void 0?o:"",description:(s=l.description)!==null&&s!==void 0?s:"",formpresentation:l.formpresentation,formactivationstate:l.formactivationstate});return this.toArtifact(u)}toApiPayload(t,r,n){return{formxml:r2(t,n),name:t.name,type:Md[t.formType],objecttypecode:t.entityLogicalName}}metadataNeeds(t){let r=t.entityLogicalName;if(!r)return[];let n=new Set,i=[];return d2(t,a=>{let o=a.fieldName,s=a;!o||s.label!==void 0&&s.classId!==void 0||n.has(o)||(n.add(o),i.push({entityLogicalName:r,fieldName:o}))}),i}createDefault(t){var r,n,i,a,o,s,l,u,c,d;let f=t.tabs&&t.tabs.length>0?void 0:P3,g=f!==void 0?f:t.tabs.map(N=>A3(N)).join(""),b=this.deserialize({formxml:`<form><tabs>${g}</tabs></form>`,formid:t.id||wt.Guid.NewGuid(),objecttypecode:(r=t.entityLogicalName)!==null&&r!==void 0?r:"",type:Md[(n=t.formType)!==null&&n!==void 0?n:"Main"],name:(i=t.name)!==null&&i!==void 0?i:"New Form",uniquename:(a=t.name)!==null&&a!==void 0?a:"New Form",description:"",formpresentation:je.FormPresentation.AirForm,formactivationstate:((o=t.status)!==null&&o!==void 0?o:"Active")==="Active"?je.FormActivationState.Active:je.FormActivationState.InActive}),w=this.toArtifact(b);return{id:(s=t.id)!==null&&s!==void 0?s:w.id,name:(l=t.name)!==null&&l!==void 0?l:"New Form",entityLogicalName:(u=t.entityLogicalName)!==null&&u!==void 0?u:"",formType:(c=t.formType)!==null&&c!==void 0?c:"Main",status:(d=t.status)!==null&&d!==void 0?d:"Active",tabs:w.tabs,bag:w.bag}}assignMissingIds(t){return(0,qk.assignMissingIds)(t)}validate(t){return F3(t)}deserialize(t){(0,i2.installDomShim)();let r=Lk.ScriptUtilities.ParseXml(t.formxml),n=new Uk.DeserializationService(Xt).deSerializeFormXml(r,new wt.Guid(t.formid),t.objecttypecode,je.FormState.Draft,t.name,t.uniquename,t.type,t.formpresentation,t.description,t.formactivationstate);if(!n)throw new Error("FormXml could not be deserialized into a Form model.");return n}readActivationStatus(t){return t.formactivationstate===je.FormActivationState.InActive?"Inactive":"Active"}};ct.FormAdapter=Vs;function Mt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Gd(e){return e?`<labels><label description="${Mt(e)}" languagecode="${Xt}" /></labels>`:""}function A3(e){let t=(e.columns.length>0?e.columns:[_3()]).map(r=>w3(r)).join("");return`<tab id="{${Mt(gn(e.id))}}" name="${Mt(e.name)}" expanded="${e.expanded}" visible="${e.visible}">${Gd(e.label)}<columns>${t}</columns></tab>`}function w3(e){var t;let r=e.sections.map(n=>N3(n)).join("");return`<column width="${Mt((t=e.width)!==null&&t!==void 0?t:"100%")}"><sections>${r}</sections></column>`}function N3(e){let t=e.rows.map(r=>S3(r)).join("");return`<section id="{${Mt(gn(e.id))}}" name="${Mt(e.name)}" showlabel="${e.showLabel}" visible="${e.visible}" columns="${Ud(e.columns)}">${Gd(e.label)}<rows>${t}</rows></section>`}function S3(e){return`<row>${e.cells.map(t=>D3(t)).join("")}</row>`}function D3(e){let t=e.control,r=t?Gd(t.label):"",n=t?E3(t):"";return`<cell id="{${Mt(gn(e.id))}}" showlabel="${t?t.showLabel:!1}" visible="${e.visible}" colspan="${e.colspan}" rowspan="${e.rowspan}">${r}${n}</cell>`}function E3(e){let t=e.fieldName?` datafieldname="${Mt(e.fieldName)}"`:"",r=I3(e.parameters);return`<control id="${Mt(e.id)}" classid="{${Mt(gn(e.classId))}}"${t} disabled="${e.isReadOnly}" isrequired="${e.isRequired}">${r}</control>`}function I3(e){let t=Object.keys(e);return t.length===0?"":(t.forEach(n=>(0,kd.assertXmlName)(n,"Form control parameter name")),`<parameters>${t.map(n=>`<${n}>${Mt(e[n])}</${n}>`).join("")}</parameters>`)}function _3(){return{width:"100%",sections:[],bag:{a:[],c:[]}}}var P3=`<tab id="{${wt.Guid.NewGuid()}}" name="tab_general" expanded="true" visible="true"><labels><label description="General" languagecode="${Xt}" /></labels><columns><column width="100%"><sections><section id="{${wt.Guid.NewGuid()}}" name="section_general" showlabel="false" visible="true" columns="1"><labels><label description="General" languagecode="${Xt}" /></labels><rows></rows></section></sections></column></columns></tab>`;function O3(){return{adapter:new Vs,api:kk.formApi}}ct.formRegistration=O3;function F3(e){let t=[];return(0,mn.childObjects)(e,"tabs","","tab",t).forEach(({node:n,index:i})=>{(0,mn.childObjects)(n,"columns",`/tabs/${i}`,"column",t).forEach(({node:o,index:s})=>{let l=`/tabs/${i}/columns/${s}`;(0,mn.childObjects)(o,"sections",l,"section",t).forEach(({node:c,index:d})=>{let f=`${l}/sections/${d}`;(0,mn.childObjects)(c,"rows",f,"row",t).forEach(({node:b,index:w})=>{let N=`${f}/rows/${w}`;(0,mn.childObjects)(b,"cells",N,"cell",t).forEach(({node:T,index:R})=>{let M=T.control;M!=null&&!(0,mn.isJsonObject)(M)&&t.push((0,mn.issue)(`${N}/cells/${R}/control`,"control-must-be-object-or-null",`a cell control must be a JSON object or null, got ${typeof M}`))})})})})}),t}ct.SUBGRID_CLASS_ID=Ie.ControlClassId.SubgridControl;ct.NOTES_CLASS_ID=Ie.ControlClassId.TimelineControl;ct.QUICK_VIEW_CLASS_ID=Ie.ControlClassId.QuickViewControl;var T3={Lookup:String(Ie.ControlClassId.LookupControl),Customer:String(Ie.ControlClassId.LookupControl),Owner:String(Ie.ControlClassId.LookupControl),PartyList:String(Ie.ControlClassId.PartyListControl),Boolean:String(Ie.ControlClassId.BooleanControl),DateTime:String(Ie.ControlClassId.DateTimeControl),Decimal:String(Ie.ControlClassId.DecimalControl),Double:String(Ie.ControlClassId.FloatingNumberControl),Money:String(Ie.ControlClassId.CurrencyControl),Integer:String(Ie.ControlClassId.IntegerControl),BigInt:String(Ie.ControlClassId.IntegerControl),Memo:String(Ie.ControlClassId.TextAreaControl),String:String(Ie.ControlClassId.TextboxControl)},R3="3EF39988-22BB-4F0B-BBBE-64B5A3748AEE";function p2(e){return e==="Picklist"||e==="State"||e==="Status"?R3:e&&T3[e]||String(Ie.ControlClassId.TextboxControl)}ct.classIdForAttributeType=p2;function n2(e,t){let r=e.a.find(n=>n[0]===t);return r?r[1]:void 0}});var ja=m(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.projectElementBag=ve.serializeNode=ve.domEngine=ve.nodeLikeFromDom=ve.parseXmlRoot=ve.EMPTY_FORM_SENTINEL=ve.TEXT_SENTINEL=void 0;var x3=pn(),Wa=be();ve.TEXT_SENTINEL="#text";ve.EMPTY_FORM_SENTINEL="#empty";var js=new WeakSet;function L3(e,t){let r=e&&e.trim()!==""?e:t,i=new DOMParser().parseFromString(r,"text/xml").documentElement;if(!i)throw new Wa.InvalidArgumentError("XML source has no root element (empty or malformed input)");return U3(i),B3(i),$3(i,r),i}ve.parseXmlRoot=L3;var M3=new Set([1,3]);function U3(e){let t=[e];for(;t.length>0;){let n=t.pop().childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];if(!M3.has(a.nodeType))throw new Wa.InvalidArgumentError(`Unsupported XML node type ${a.nodeType} (CDATA / comment / processing-instruction) is outside the hybrid projection's lossless grammar and cannot be round-tripped`);t.push(a)}}}function B3(e){var t,r;let n=(t=e.ownerDocument)!==null&&t!==void 0?t:e.parentNode;if(!n)return;let i=n.childNodes;for(let a=0;a<i.length;a+=1){let o=i[a];if(o!==e&&!(o.nodeType===3&&((r=o.nodeValue)!==null&&r!==void 0?r:"").trim()===""))throw new Wa.InvalidArgumentError(`Unsupported document-level XML node (type ${o.nodeType}: declaration / comment / processing-instruction outside the root element) cannot be round-tripped`)}}function k3(e){let t=[],r=/<([^>]*)>/g;for(let n=r.exec(e);n!==null;n=r.exec(e)){let i=n[1];i.startsWith("/")||i.startsWith("?")||i.startsWith("!")||t.push(i.endsWith("/"))}return t}function q3(e){let t=[],r=[e];for(;r.length>0;){let n=r.pop();t.push(n);let i=n.childNodes;for(let a=i.length-1;a>=0;a-=1){let o=i[a];o.nodeType===1&&r.push(o)}}return t}function h2(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r].nodeType;if(n===1||n===3)return!0}return!1}function $3(e,t){let r=k3(t),n=q3(e),i=Math.min(r.length,n.length);for(let a=0;a<i;a+=1){if(r[a])continue;let o=n[a];h2(o)||js.add(o)}}function zd(e){let t=e.nodeType===3;return{getNodeName:()=>t?ve.TEXT_SENTINEL:e.tagName,getAllProperties:()=>{var r;if(t)return[{key:ve.TEXT_SENTINEL,value:(r=e.nodeValue)!==null&&r!==void 0?r:""}];let n=e.attributes,i=[];for(let a=0;a<n.length;a+=1)i.push({key:n[a].name,value:n[a].value});return js.has(e)&&!h2(e)&&i.push({key:ve.EMPTY_FORM_SENTINEL,value:"1"}),i},getAllChildren:()=>{if(t)return[];let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];(a.nodeType===1||a.nodeType===3)&&r.push(zd(a))}return r}}}ve.nodeLikeFromDom=zd;function V3(e){return{make:t=>t===ve.TEXT_SENTINEL?e.createTextNode(""):e.createElement(t),setProp:(t,r,n)=>{t.nodeType===3?t.nodeValue=n:r===ve.EMPTY_FORM_SENTINEL?js.add(t):t.setAttribute(r,n)},addChild:(t,r)=>{t.appendChild(r)}}}ve.domEngine=V3;function g2(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r<=31&&r!==9&&r!==10&&r!==13||r===65534||r===65535)throw Ws(r);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))throw Ws(r);t+=1;continue}if(r>=56320&&r<=57343)throw Ws(r)}}function Ws(e){let t=e.toString(16).toUpperCase().padStart(4,"0");return new Wa.InvalidArgumentError(`Value contains U+${t}, a character not permitted in XML 1.0 (control char / lone surrogate / non-character); it cannot be serialized losslessly`)}function G3(e){return g2(e),String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\r/g,"&#xD;").replace(/\n/g,"&#xA;").replace(/\t/g,"&#x9;")}function z3(e){return g2(e),String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function W3(e){return v2(e,0)}ve.serializeNode=W3;var m2=512;function v2(e,t){var r;if(t>m2)throw new Wa.InvalidArgumentError(`XML nesting exceeds the maximum supported depth of ${m2}`);if(e.nodeType===3)return z3((r=e.nodeValue)!==null&&r!==void 0?r:"");let n=e,i="<"+n.tagName,a=n.attributes;for(let l=0;l<a.length;l+=1)i+=" "+a[l].name+'="'+G3(a[l].value)+'"';let o=[],s=n.childNodes;for(let l=0;l<s.length;l+=1){let u=s[l];(u.nodeType===1||u.nodeType===3)&&o.push(u)}if(o.length===0)return js.has(n)?i+"></"+n.tagName+">":i+" />";i+=">";for(let l of o)i+=v2(l,t+1);return i+"</"+n.tagName+">"}function j3(e){let t=zd(e);return{a:t.getAllProperties().map(r=>[r.key,r.value]),c:t.getAllChildren().map((r,n)=>({i:n,node:(0,x3.rawFromNode)(r)}))}}ve.projectElementBag=j3});var Wd=m(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.viewApi=gi.findDefaultViews=void 0;var Kt=$e(),yr=ue(),H3="savedqueryid,name,description,fetchxml,layoutxml,querytype,returnedtypecode,isdefault",J3="savedqueryid,name,returnedtypecode,querytype,isdefault";async function Q3(e,t,r={}){var n,i,a;let o=new Set(((n=r.excludeViewIds)!==null&&n!==void 0?n:[]).filter(Boolean)),s=`returnedtypecode eq '${(0,yr.odataLiteral)(t)}' and querytype eq 0`,l=`/savedqueries${(0,yr.odataQuery)([["$select","savedqueryid,name,isdefault"],["$filter",s],["$top",50]])}`;return((a=(i=(0,Kt.ensureSuccess)(await e.get(l),e.apiUrl(l)).body)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:[]).filter(d=>{var f;return d.savedqueryid&&!o.has(d.savedqueryid)&&(d.isdefault||/^(Active|Inactive)\b/i.test((f=d.name)!==null&&f!==void 0?f:""))}).map(d=>{var f;return{id:String(d.savedqueryid),name:String((f=d.name)!==null&&f!==void 0?f:"")}})}gi.findDefaultViews=Q3;async function X3(e,t){var r;let n=`/EntityDefinitions(LogicalName='${(0,yr.odataLiteral)(t)}')${(0,yr.odataQuery)([["$select","ObjectTypeCode"]])}`,i=await e.get(n);if(i.status>=200&&i.status<300){let a=(r=i.body)===null||r===void 0?void 0:r.ObjectTypeCode;return typeof a=="number"?a:void 0}}async function b2(e,t,r){if(!r||!/<grid\b/.test(t)||/<grid[^>]*\bobject=/.test(t))return t;let n=await X3(e,r);return n===void 0?t:t.replace(/<grid\b/,`<grid object="${n}"`)}gi.viewApi={async get(e,t){let n=`/savedqueries(${(0,yr.normalizeGuid)(t,"id")})${(0,yr.odataQuery)([["$select",H3]])}`,i=(0,Kt.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,Kt.readEtag)(i)}},async list(e,t){var r;let n=`/savedqueries${(0,yr.odataQuery)([["$select",J3],["$filter",t?.entityLogicalName?`returnedtypecode eq '${(0,yr.odataLiteral)(t.entityLogicalName)}'`:void 0]])}`,a=(0,Kt.ensureSuccess)(await e.get(n),e.apiUrl(n)).body;return((r=a?.value)!==null&&r!==void 0?r:[]).map(s=>{var l,u;return{type:"view",id:(l=s.savedqueryid)!==null&&l!==void 0?l:"",name:(u=s.name)!==null&&u!==void 0?u:"",entityLogicalName:s.returnedtypecode,isDirty:!1}})},async create(e,t){let r=t,n="/savedqueries",i=await b2(e,r.layoutxml,r.returnedtypecode),a=(0,Kt.ensureSuccess)(await e.post(n,{name:r.name,description:r.description,fetchxml:r.fetchxml,layoutxml:i,returnedtypecode:r.returnedtypecode,querytype:r.querytype,isdefault:r.isdefault}),e.apiUrl(n));return{id:(0,Kt.requireCreatedId)(a,"savedqueryid","view"),etag:(0,Kt.readEtag)(a)}},async update(e,t,r,n){let i=r,a=(0,yr.normalizeGuid)(t,"id"),o=`/savedqueries(${a})`,s=n?{"If-Match":n}:void 0,l=await b2(e,i.layoutxml,i.returnedtypecode),u=(0,Kt.ensureSuccess)(await e.patch(o,{name:i.name,description:i.description,fetchxml:i.fetchxml,layoutxml:l},s?{headers:s}:void 0),e.apiUrl(o));return{id:a,etag:(0,Kt.readEtag)(u)}},delete(e,t){return(0,Kt.deleteRecord)(e,"savedqueries",t)}}});var O2=m(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.viewRegistration=bi.ViewAdapter=void 0;var vi=$r(),jd=pn(),bn=ja(),K3=Wd(),Hd=fn(),Y3=Ft(),w2=100,Hs=class{toArtifact(t){var r,n,i,a,o,s,l,u;(0,Hd.installDomShim)();let c=(r=t.fetchxml)!==null&&r!==void 0?r:"",d=(n=t.layoutxml)!==null&&n!==void 0?n:"",f=(0,bn.parseXmlRoot)(c,"<fetch/>"),g=(0,bn.parseXmlRoot)(d,"<grid/>");return{id:(i=t.savedqueryid)!==null&&i!==void 0?i:"",name:(a=t.name)!==null&&a!==void 0?a:"",description:(o=t.description)!==null&&o!==void 0?o:"",entityLogicalName:(s=t.returnedtypecode)!==null&&s!==void 0?s:Z3(f),queryType:(l=t.querytype)!==null&&l!==void 0?l:0,isDefault:(u=t.isdefault)!==null&&u!==void 0?u:!1,columns:S2(g,f),filters:I2(f),sort:E2(f),fetchBag:c?(0,bn.projectElementBag)(f):void 0,layoutBag:d?(0,bn.projectElementBag)(g):void 0}}fromArtifact(t){(0,Hd.installDomShim)();let{fetchxml:r,layoutxml:n}=y2(t);return{savedqueryid:t.id,name:t.name,description:t.description,returnedtypecode:t.entityLogicalName,querytype:t.queryType,isdefault:t.isDefault,fetchxml:r,layoutxml:n}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t){var r,n,i,a,o;(0,Hd.installDomShim)();let{fetchxml:s,layoutxml:l}=y2(t);return{name:(r=t.name)!==null&&r!==void 0?r:"",description:(n=t.description)!==null&&n!==void 0?n:"",fetchxml:s,layoutxml:l,returnedtypecode:(i=t.entityLogicalName)!==null&&i!==void 0?i:"",querytype:(a=t.queryType)!==null&&a!==void 0?a:0,isdefault:(o=t.isDefault)!==null&&o!==void 0?o:!1}}createDefault(t){var r,n,i,a,o,s,l,u;let c=(r=t.entityLogicalName)!==null&&r!==void 0?r:"";return{id:(n=t.id)!==null&&n!==void 0?n:(0,Y3.newId)(),name:(i=t.name)!==null&&i!==void 0?i:"New View",description:(a=t.description)!==null&&a!==void 0?a:"",entityLogicalName:c,queryType:(o=t.queryType)!==null&&o!==void 0?o:0,isDefault:(s=t.isDefault)!==null&&s!==void 0?s:!1,columns:t.columns&&t.columns.length>0?t.columns:[{name:`${c}id`,width:300,order:0}],filters:(l=t.filters)!==null&&l!==void 0?l:{type:"and",conditions:[],groups:[]},sort:(u=t.sort)!==null&&u!==void 0?u:[]}}assignMissingIds(t){return t}validate(t){let r=[],n=t;(0,vi.childObjects)(n,"columns","","column",r),(0,vi.childObjects)(n,"sort","","sort",r);let i=n.filters;return i!=null&&((0,vi.isJsonObject)(i)?N2(i,"/filters",r):r.push((0,vi.issue)("/filters","filters-must-be-object",`filters must be a JSON object, got ${typeof i}`))),r}};bi.ViewAdapter=Hs;function N2(e,t,r){(0,vi.childObjects)(e,"conditions",t,"condition",r),(0,vi.childObjects)(e,"groups",t,"filterGroup",r).forEach(({node:i,index:a})=>N2(i,`${t}/groups/${a}`,r))}function Z3(e){var t;let r=e.getElementsByTagName("entity")[0];return(t=r?.getAttribute("name"))!==null&&t!==void 0?t:""}function S2(e,t){var r;let n=D2(t),i=e.getElementsByTagName("cell"),a=[],o=0;for(let s=0;s<i.length;s+=1){let l=i[s];if(l.getAttribute("ishidden")==="1")continue;let u=l.getAttribute("name");if(!u)continue;let c=parseInt((r=l.getAttribute("width"))!==null&&r!==void 0?r:"",10),d={name:u,width:Number.isNaN(c)?w2:c,order:o},f=n.get(u);f&&(d.relatedEntity=f),o+=1,a.push(d)}return a}function D2(e){var t;let r=new Map,n=e.getElementsByTagName("link-entity");for(let i=0;i<n.length;i+=1){let a=n[i],o=a.getAttribute("name");if(!o)continue;let s=a.getElementsByTagName("attribute");for(let l=0;l<s.length;l+=1){let u=s[l],c=(t=u.getAttribute("alias"))!==null&&t!==void 0?t:u.getAttribute("name");c&&r.set(c,o)}}return r}function E2(e){var t;let r=e.getElementsByTagName("entity")[0];if(!r)return[];let n=[],i=r.childNodes;for(let a=0;a<i.length;a+=1){let o=i[a];if(o.nodeType===1&&o.tagName==="order"){let s=o.getAttribute("attribute");s&&n.push({attribute:s,descending:((t=o.getAttribute("descending"))!==null&&t!==void 0?t:"").toLowerCase()==="true"})}}return n}function I2(e){let t=e.getElementsByTagName("entity")[0],r={type:"and",conditions:[],groups:[]};if(!t)return r;let n=Nt(t,"filter").filter(i=>!_2(i)).map(P2);return n.length===0?r:n.length===1?n[0]:{type:"and",conditions:[],groups:n}}function _2(e){if(Nt(e,"filter").length>0)return!1;let t=Nt(e,"condition");return t.length===0?!1:t.some(r=>r.getAttribute("isquickfindfields")==="1"||Nt(r,"value").length>0)}function P2(e){var t,r;let n=((t=e.getAttribute("type"))!==null&&t!==void 0?t:"and").toLowerCase()==="or"?"or":"and",i=[],a=[],o=e.childNodes;for(let s=0;s<o.length;s+=1){let l=o[s];if(l.nodeType===1)if(l.tagName==="condition"){if(l.getAttribute("isquickfindfields")==="1")continue;let u=l.getAttribute("attribute");if(!u)continue;let c={attribute:u,operator:(r=l.getAttribute("operator"))!==null&&r!==void 0?r:""},d=l.getAttribute("value");d!==null&&(c.value=d),i.push(c)}else l.tagName==="filter"&&a.push(P2(l))}return{type:n,conditions:i,groups:a}}function Nt(e,t){let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];a.nodeType===1&&a.tagName===t&&r.push(a)}return r}function y2(e){let t=eq(e.columns);if(!C2(e.fetchBag)||!C2(e.layoutBag))return{fetchxml:cq({...e,columns:t}),layoutxml:dq({...e,columns:t},`${e.entityLogicalName}id`)};let r=new DOMParser().parseFromString("<root/>","text/xml"),n=A2(e.fetchBag,"fetch",r),i=A2(e.layoutBag,"grid",r),a=S2(i,n),o=!Jd(t,a),s=!Jd(e.sort,E2(n)),l=!Jd(e.filters,I2(n));return o&&(tq(r,n,t,a),aq(r,i,t)),s&&lq(r,n,e.sort),l&&uq(r,n,e.filters),{fetchxml:(0,bn.serializeNode)(n),layoutxml:(0,bn.serializeNode)(i)}}function eq(e){return(e??[]).map((t,r)=>{var n,i;return{name:String(t.name).toLowerCase(),width:(n=t.width)!==null&&n!==void 0?n:w2,order:(i=t.order)!==null&&i!==void 0?i:r,...t.relatedEntity?{relatedEntity:t.relatedEntity}:{}}})}function C2(e){return!!e&&(e.c.length>0||e.a.length>0)}function A2(e,t,r){let n={n:t,a:(0,jd.mergeAttrs)(e.a,[]),c:(0,jd.spliceChildren)(e.c,[])};return(0,jd.rebuildRaw)(n,(0,bn.domEngine)(r),null)}function tq(e,t,r,n){var i;let a=t.getElementsByTagName("entity")[0];if(!a)return;let o=new Set(r.map(u=>{var c;return`${(c=u.relatedEntity)!==null&&c!==void 0?c:""}:${u.name}`}));for(let u of n)o.has(`${(i=u.relatedEntity)!==null&&i!==void 0?i:""}:${u.name}`)||rq(a,u);let s=D2(t),l=new Set(Nt(a,"attribute").map(u=>u.getAttribute("name")).filter(u=>!!u));for(let u of[...r].sort((c,d)=>c.order-d.order))if(u.relatedEntity){if(s.get(u.name)===u.relatedEntity)continue;let c=nq(e,a,u.relatedEntity),d=e.createElement("attribute");d.setAttribute("name",u.name),c.appendChild(d),s.set(u.name,u.relatedEntity)}else{if(l.has(u.name))continue;let c=e.createElement("attribute");c.setAttribute("name",u.name),iq(a,c),l.add(u.name)}}function rq(e,t){var r;if(t.relatedEntity){for(let n of Nt(e,"link-entity"))if(n.getAttribute("name")===t.relatedEntity){for(let i of Nt(n,"attribute"))if(((r=i.getAttribute("alias"))!==null&&r!==void 0?r:i.getAttribute("name"))===t.name){n.removeChild(i);return}}return}for(let n of Nt(e,"attribute"))if(n.getAttribute("name")===t.name){e.removeChild(n);return}}function nq(e,t,r){for(let i of Nt(t,"link-entity"))if(i.getAttribute("name")===r)return i;let n=e.createElement("link-entity");return n.setAttribute("name",r),t.appendChild(n),n}function iq(e,t){let r=e.childNodes;for(let n=0;n<r.length;n+=1){let i=r[n];if(i.nodeType===1&&i.tagName!=="attribute"){e.insertBefore(t,i);return}}e.appendChild(t)}function aq(e,t,r){let n=t.getElementsByTagName("row")[0];if(!n)return;let i=[...r].sort((s,l)=>s.order-l.order),a=oq(n);if(sq(a,i)){for(let s=0;s<i.length;s+=1){let l=String(i[s].width);a[s].getAttribute("width")!==l&&a[s].setAttribute("width",l)}return}let o=new Map;for(let s of a){let l=s.getAttribute("name");l&&o.set(l,s),n.removeChild(s)}for(let s of i){let l=o.get(s.name);l||(l=e.createElement("cell"),l.setAttribute("name",s.name)),l.setAttribute("width",String(s.width)),n.appendChild(l)}}function oq(e){return Nt(e,"cell").filter(t=>!!t.getAttribute("name")&&t.getAttribute("ishidden")!=="1")}function sq(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r].getAttribute("name")!==t[r].name)return!1;return!0}function lq(e,t,r){let n=t.getElementsByTagName("entity")[0];if(n){for(let i of Nt(n,"order"))n.removeChild(i);for(let i of r){let a=e.createElement("order");a.setAttribute("attribute",i.attribute),a.setAttribute("descending",String(i.descending)),n.appendChild(a)}}}function uq(e,t,r){let n=t.getElementsByTagName("entity")[0];if(n){for(let i of Nt(n,"filter"))_2(i)||n.removeChild(i);(r.conditions.length>0||r.groups.length>0)&&n.appendChild(Qd(e,r))}}function Jd(e,t){return JSON.stringify(e)===JSON.stringify(t)}function cq(e){let t=new DOMParser().parseFromString("<fetch/>","text/xml"),r=t.documentElement;r.setAttribute("version","1.0"),r.setAttribute("mapping","logical");let n=t.createElement("entity");n.setAttribute("name",e.entityLogicalName),r.appendChild(n);let i=new Map;for(let a of[...e.columns].sort((o,s)=>o.order-s.order)){let o=t.createElement("attribute");if(o.setAttribute("name",a.name),a.relatedEntity){let s=i.get(a.relatedEntity);s||(s=t.createElement("link-entity"),s.setAttribute("name",a.relatedEntity),n.appendChild(s),i.set(a.relatedEntity,s)),s.appendChild(o)}else n.appendChild(o)}for(let a of e.sort){let o=t.createElement("order");o.setAttribute("attribute",a.attribute),o.setAttribute("descending",String(a.descending)),n.appendChild(o)}return(e.filters.conditions.length>0||e.filters.groups.length>0)&&n.appendChild(Qd(t,e.filters)),new XMLSerializer().serializeToString(t)}function Qd(e,t){let r=e.createElement("filter");r.setAttribute("type",t.type);for(let n of t.conditions){let i=e.createElement("condition");i.setAttribute("attribute",n.attribute),i.setAttribute("operator",n.operator),n.value!==void 0&&i.setAttribute("value",n.value),r.appendChild(i)}for(let n of t.groups)r.appendChild(Qd(e,n));return r}function dq(e,t){var r;let n=new DOMParser().parseFromString("<grid/>","text/xml"),i=n.documentElement,a=[...e.columns].sort((s,l)=>s.order-l.order);i.setAttribute("name","resultset"),i.setAttribute("jump",((r=a[0])===null||r===void 0?void 0:r.name)||t||`${e.entityLogicalName}id`),i.setAttribute("select","1"),i.setAttribute("icon","1"),i.setAttribute("preview","1");let o=n.createElement("row");o.setAttribute("name","result"),o.setAttribute("id",t||`${e.entityLogicalName}id`),i.appendChild(o);for(let s of a){let l=n.createElement("cell");l.setAttribute("name",s.name),l.setAttribute("width",String(s.width)),o.appendChild(l)}return new XMLSerializer().serializeToString(n)}function pq(){return{adapter:new Hs,api:K3.viewApi}}bi.viewRegistration=pq});function F2(e,t=0){return(Be[e[t+0]]+Be[e[t+1]]+Be[e[t+2]]+Be[e[t+3]]+"-"+Be[e[t+4]]+Be[e[t+5]]+"-"+Be[e[t+6]]+Be[e[t+7]]+"-"+Be[e[t+8]]+Be[e[t+9]]+"-"+Be[e[t+10]]+Be[e[t+11]]+Be[e[t+12]]+Be[e[t+13]]+Be[e[t+14]]+Be[e[t+15]]).toLowerCase()}var Be,T2=D(()=>{Be=[];for(let e=0;e<256;++e)Be.push((e+256).toString(16).slice(1))});function Xd(){return Js>Qs.length-16&&((0,R2.randomFillSync)(Qs),Js=0),Qs.slice(Js,Js+=16)}var R2,Qs,Js,x2=D(()=>{R2=require("crypto"),Qs=new Uint8Array(256),Js=Qs.length});var L2,Kd,M2=D(()=>{L2=require("crypto"),Kd={randomUUID:L2.randomUUID}});function fq(e,t,r){if(Kd.randomUUID&&!t&&!e)return Kd.randomUUID();e=e||{};let n=e.random??e.rng?.()??Xd();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return F2(n)}var gt,U2=D(()=>{M2();x2();T2();gt=fq});var Yd=D(()=>{U2()});var B2=m(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.WorkflowConditionOperator=St.WorkflowAttributeType=St.SystemStep=St.FieldRequiredLevelTypes=St.AttributeDateTimeBehavior=void 0;St.AttributeDateTimeBehavior={None:0,Dynamic:1,DateOnly:2,StaticTimeZoneInvariant:3,UserLocal:4};St.FieldRequiredLevelTypes={None:"0",Required:"1",Recommended:"2"};St.SystemStep={IdentifyContact:"IdentifyContact",IdentifyAccount:"IdentifyAccount",IdentifyCustomer:"IdentifyCustomer",IdentifyCase:"IdentifyCase",Solution:"Solution",Resolve:"Resolve"};St.WorkflowAttributeType={Boolean:"0",Customer:"1",DateTime:"2",Decimal:"3",Float:"4",Integer:"5",Lookup:"6",Money:"7",Owner:"8",PartyList:"9",Picklist:"10",Key:"11",State:"12",Status:"13",String:"14",UniqueIdentifier:"15",EntityNameReference:"16",Entity:"17",EntityCollection:"18",BpfProcess:"19",BpfStageCategory:"20",BpfStage:"21",EntityReferenceCollection:"22",MultiSelectPicklist:"23",BigType:"24"};St.WorkflowConditionOperator={IsNull:"0",NotNull:"1",LogicalAnd:"2",LogicalOr:"3",IN:"4",NotIn:"5",NotInNull:"51",Equal:"6",NotEqual:"7",Contains:"8",DoesNotContain:"9",BeginsWith:"10",DoesNotBeginWith:"11",EndsWith:"12",DoesNotEndWith:"13",GreaterThan:"14",GreaterThanOrEqual:"15",LessThan:"16",LessThanOrEqual:"17",EqualUserId:"18",NotEqualUserId:"19",On:"20",NotOn:"21",OnOrAfter:"22",OnOrBefore:"23",Yesterday:"24",Today:"25",Tomorrow:"26",NextSevenDays:"27",LastSevenDays:"28",NextWeek:"29",LastWeek:"30",ThisWeek:"31",NextMonth:"32",LastMonth:"33",ThisMonth:"34",NextYear:"35",LastYear:"36",ThisYear:"37",Anytime:"38",LastXHours:"39",NextXHours:"40",LastXDays:"41",NextXDays:"42",LastXWeeks:"43",NextXWeeks:"44",LastXMonths:"45",NextXMonths:"46",LastXYears:"47",NextXYears:"48",Under:"49",NotUnder:"50"}});var Y2={};Bt(Y2,{deserializeWorkflowJson:()=>Dq,serializeToWorkflowJson:()=>Eq});function k2(e){return e.__class==="BinaryExpression:#Microsoft.Crm.Workflow.Expressions"}function mq(e){return e.__class==="ConditionBranchStep:#Microsoft.Crm.Workflow.ObjectModel"}function Ha(){return{list:[]}}function W2(e){return{__class:"PrimaryEntity:#Microsoft.Crm.Workflow.Expressions",parameterName:"primaryEntity",entityName:e}}function tp(e,t,r){return{__class:"EntityAttributeExpression:#Microsoft.Crm.Workflow.Expressions",type:r,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,entity:W2(t),attributeName:e}}function np(e,t){return{__class:"PrimitiveExpression:#Microsoft.Crm.Workflow.Expressions",type:t,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,primitiveValue:e}}function hq(){return np("true",z.WorkflowAttributeType.Boolean)}function q2(e,t){let r=z.WorkflowAttributeType.String,n=ep[e.operator]??z.WorkflowConditionOperator.Equal,i=tp(e.field,t,r),a;return e.operator==="ContainsData"||e.operator==="DoesNotContainData"?a=[]:e.valueType==="Field"&&e.valueField?a=[tp(e.valueField,t,r)]:a=[np(e.value??"",r)],{__class:"BinaryExpression:#Microsoft.Crm.Workflow.Expressions",type:r,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,conditionOperatoroperator:n,left:i,right:a}}function gq(e,t,r){if(e.length===0)return null;if(e.length===1)return q2(e[0],r);let n=t==="AND"?z.WorkflowConditionOperator.LogicalAnd:z.WorkflowConditionOperator.LogicalOr,[i,...a]=e.map(o=>q2(o,r));return{__class:"BinaryExpression:#Microsoft.Crm.Workflow.Expressions",type:z.WorkflowAttributeType.String,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,conditionOperatoroperator:n,left:i,right:a}}function rp(e){return e?e.__class==="EntityAttributeExpression:#Microsoft.Crm.Workflow.Expressions"?{valueType:"Field",valueField:e.attributeName}:e.__class==="PrimitiveExpression:#Microsoft.Crm.Workflow.Expressions"?{valueType:"Value",value:e.primitiveValue!=null?String(e.primitiveValue):""}:{valueType:"Value",value:""}:{valueType:"Value",value:""}}function Zd(e){let t=z2[e.conditionOperatoroperator]??"Equals",r=e.left.__class==="EntityAttributeExpression:#Microsoft.Crm.Workflow.Expressions"?e.left.attributeName:"",i=t==="ContainsData"||t==="DoesNotContainData"?{valueType:"Value"}:rp(e.right[0]);return{id:gt(),field:r,fieldDisplayName:r,operator:t,...i}}function j2(e){if(!e||e.__class!=="BinaryExpression:#Microsoft.Crm.Workflow.Expressions")return{clauses:[],logic:"AND"};let t=e.conditionOperatoroperator;if(t===z.WorkflowConditionOperator.LogicalAnd||t===z.WorkflowConditionOperator.LogicalOr){let r=t===z.WorkflowConditionOperator.LogicalAnd?"AND":"OR";return{clauses:[...k2(e.left)?[Zd(e.left)]:[],...e.right.filter(k2).map(Zd)],logic:r}}return{clauses:[Zd(e)],logic:"AND"}}function $2(e,t,r,n){return e==="Field"&&r?tp(r,n,z.WorkflowAttributeType.String):np(t??"",z.WorkflowAttributeType.String)}function V2(e,t){return{propertyName:e,propertyValueExpr:t}}function yi(e){return`Step_${e.value++}`}function Dt(e,t){let r=(t.counts[e]??0)+1,n=`${e}${r}`;for(;t.used.has(n);)r+=1,n=`${e}${r}`;return t.counts[e]=r,t.used.add(n),n}function vq(e,t,r){return e&&!r.used.has(e)?(r.used.add(e),e):Dt(t,r)}function bq(e,t,r){return{__class:"ActionStep:#Microsoft.Crm.Workflow.ObjectModel",id:Dt("ActionStep",r),name:yi(t),description:"Action step",stepLabels:{list:[{labelId:gt(),languageCode:1033,description:e}]},steps:{list:[]},actionId:null,actionType:"4",processId:gt(),uniqueName:`id_${gt().replace(/-/g,"")}ActionStep`}}function yq(e,t,r,n){let i=W2(t),a=e.stepName??yi(r),o=e.stepLabels??Ha(),s={name:a,stepLabels:o,description:e.displayName},l=e.type;switch(l){case"SetFieldValue":return{...s,id:Dt("SetAttributeValueStep",n),__class:"SetAttributeValueStep:#Microsoft.Crm.Workflow.ObjectModel",entity:i,specification:V2(e.field,$2(e.valueType,e.value,e.valueField,t))};case"SetDefaultValue":return{...s,id:Dt("SetDefaultValueStep",n),__class:"SetDefaultValueStep:#Microsoft.Crm.Workflow.ObjectModel",entity:i,specification:V2(e.field,$2(e.valueType,e.value,e.valueField,t))};case"LockUnlock":return{...s,id:Dt("SetDisplayModeStep",n),__class:"SetDisplayModeStep:#Microsoft.Crm.Workflow.ObjectModel",controlId:e.field,controlType:"attribute",isReadOnly:e.lock,entity:i};case"SetBusinessRequired":return{...s,id:Dt("SetFieldRequiredLevelStep",n),__class:"SetFieldRequiredLevelStep:#Microsoft.Crm.Workflow.ObjectModel",controlId:e.field,controlType:"attribute",requiredLevel:e.required?z.FieldRequiredLevelTypes.Required:z.FieldRequiredLevelTypes.None,entity:i};case"SetVisibility":return{...s,id:Dt("SetVisibilityStep",n),__class:"SetVisibilityStep:#Microsoft.Crm.Workflow.ObjectModel",controlId:e.field,controlType:"attribute",isVisible:e.visible,entity:i};case"ShowErrorMessage":return{...s,id:Dt("SetMessageStep",n),__class:"SetMessageStep:#Microsoft.Crm.Workflow.ObjectModel",name:e.errorMessage||e.displayName,controlId:e.field,entity:i,level:e.messageLevel??"error",actionSteps:e.messageActionSteps??{list:[]}};case"Recommendation":{let u=e.messageText||e.recommendationTitle||e.displayName,c=e.stepLabels&&e.stepLabels.list.length>0?e.stepLabels:{list:[{labelId:gt(),languageCode:1033,description:u}]},d=e.recommendationActionSteps,f=d&&d.list.length>0?d:{list:[bq(u,r,n)]};return{...s,id:Dt("SetMessageStep",n),__class:"SetMessageStep:#Microsoft.Crm.Workflow.ObjectModel",stepLabels:c,description:e.recommendationTitle||e.displayName,controlId:e.field,entity:i,level:"RECOMMENDATION",actionSteps:f}}default:throw new Error(`Unsupported action type: ${l}`)}}function Cq(e){switch(e.__class){case"SetAttributeValueStep:#Microsoft.Crm.Workflow.ObjectModel":{let t=rp(e.specification.propertyValueExpr);return{kind:"action",id:e.id,type:"SetFieldValue",displayName:e.description||e.name||"Set Field Value",stepName:e.name,stepLabels:e.stepLabels,field:e.specification.propertyName,...t}}case"SetDefaultValueStep:#Microsoft.Crm.Workflow.ObjectModel":{let t=rp(e.specification.propertyValueExpr);return{kind:"action",id:e.id,type:"SetDefaultValue",displayName:e.description||e.name||"Set Default Value",stepName:e.name,stepLabels:e.stepLabels,field:e.specification.propertyName,...t}}case"SetDisplayModeStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"LockUnlock",displayName:e.description||e.name||"Lock/Unlock",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,lock:e.isReadOnly};case"SetFieldRequiredLevelStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"SetBusinessRequired",displayName:e.description||e.name||"Set Business Required",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,required:e.requiredLevel!==z.FieldRequiredLevelTypes.None};case"SetVisibilityStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"SetVisibility",displayName:e.description||e.name||"Set Visibility",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,visible:e.isVisible};case"SetMessageStep:#Microsoft.Crm.Workflow.ObjectModel":{let t=e.stepLabels?.list,r=t&&t.length>0?t[0].description??"":"";return(e.level??"").toUpperCase()==="RECOMMENDATION"?{kind:"action",id:e.id,type:"Recommendation",displayName:e.description||"Recommendation",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,recommendationTitle:e.description||"",messageText:r,recommendationActionSteps:e.actionSteps}:{kind:"action",id:e.id,type:"ShowErrorMessage",displayName:e.description||"Show Error Message",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,errorMessage:r||e.name||"",messageLevel:e.level??void 0,messageActionSteps:e.actionSteps}}case"ActionStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"Recommendation",displayName:e.name||"Recommendation",stepName:e.name,stepLabels:e.stepLabels,field:e.actionControl?.controlId??"",recommendationTitle:e.name||"",messageText:e.description||""};default:return null}}function H2(e,t,r,n){let i=e.stepName??yi(r),a=Dt("ConditionStep",n),o=[],s=e,l=!0;for(;s;){let u=gq(s.clauses,s.logic,t),c=l?s.branchName??yi(r):yi(r),f={__class:"ConditionBranchStep:#Microsoft.Crm.Workflow.ObjectModel",id:l?vq(s.branchId,"ConditionBranchStep",n):Dt("ConditionBranchStep",n),name:c,description:s.displayName,stepLabels:Ha(),conditionExpression:u??void 0,steps:{list:s.trueBranch.map(b=>J2(b,t,r,n))}};o.push(f);let g=s.falseBranch;if(g.length===1&&g[0].kind==="condition"){s=g[0],l=!1;continue}g.length>0&&o.push(Aq(g,t,r,n)),s=void 0}return{__class:"ConditionStep:#Microsoft.Crm.Workflow.ObjectModel",id:a,name:i,description:"",stepLabels:Ha(),containsElsebranch:o.length>1,steps:{list:o}}}function Aq(e,t,r,n){return{__class:"ConditionBranchStep:#Microsoft.Crm.Workflow.ObjectModel",id:Dt("ConditionBranchStep",n),name:yi(r),description:null,stepLabels:Ha(),conditionExpression:hq(),steps:{list:e.map(i=>J2(i,t,r,n))}}}function J2(e,t,r,n){return e.kind==="condition"?H2(e,t,r,n):yq(e,t,r,n)}function Q2(e){let t=(e.steps?.list??[]).filter(mq);return X2(t,e,!0)}function X2(e,t,r){let[n,...i]=e,{clauses:a,logic:o}=j2(n?.conditionExpression),s=K2(n?.steps?.list??[]),l=wq(i,t),u=n?.description||n?.name||t.description||t.name||"Condition";return{kind:"condition",id:(r?t.id:n?.id)??gt(),displayName:u,clauses:a,logic:o,trueBranch:s,falseBranch:l,isCollapsed:!1,stepName:r?t.name:void 0,branchId:r?n?.id:void 0,branchName:r?n?.name:void 0}}function wq(e,t){if(e.length===0)return[];let[r]=e,{clauses:n}=j2(r.conditionExpression);return n.length===0?K2(r.steps?.list??[]):[X2(e,t,!1)]}function K2(e){return e.map(t=>t.__class==="ConditionStep:#Microsoft.Crm.Workflow.ObjectModel"?Q2(t):Cq(t)).filter(t=>t!==null)}function Nq(e){return e===G2.StateCode.Activated?"Active":"Draft"}function Sq(e,t){let r=e.processtriggerscope,n=e.processtriggerformid;return r===1&&n?n:r===2?"Entity":t??"Entity"}function Dq(e){let t=e,r=null,n;if(e.wfomJson)try{let i=JSON.parse(e.wfomJson);n={id:i.id==="WorkflowStep0"||!i.id?e.workflowid??gt():i.id,name:i.name,description:i.description,nextStepIndex:i.nextStepIndex,category:i.category==="0"||i.category===0?"2":i.category,businessProcessType:i.businessProcessType,mode:i.mode,title:i.title||e.name||"",primaryEntityName:i.primaryEntityName==="1"||!i.primaryEntityName?e.primaryentity??"":i.primaryEntityName,workflowEntityId:i.workflowEntityId==="00000000-0000-0000-0000-000000000000"||!i.workflowEntityId?e.workflowid??"":i.workflowEntityId,formId:i.formId,variables:i.variables,inputs:i.inputs};let o=(i.steps?.list??[]).find(s=>s.__class==="ConditionStep:#Microsoft.Crm.Workflow.ObjectModel");o&&(r=Q2(o))}catch{}return{ruleId:e.workflowid??null,name:e.name??"",description:e.description??"",entityLogicalName:e.primaryentity??"",scope:Sq(t,n?.formId),status:Nq(e.statecode),rootCondition:r,wfomRoot:n}}function Eq(e){let t=e.entityLogicalName,r=e.wfomRoot,n={value:r?Number(r.nextStepIndex):1},i={counts:{},used:new Set},a=e.scope!=="Entity"&&e.scope!=="AllForms"?e.scope:null,o=e.rootCondition?[H2(e.rootCondition,t,n,i)]:[],s={__class:"WorkflowStep:#Microsoft.Crm.Workflow.ObjectModel",id:r?.id??e.ruleId??gt(),name:r?.name??"Step_0",description:r!==void 0?r.description:e.description||null,stepLabels:Ha(),argumentsArray:[],primaryEntityName:r?.primaryEntityName??t,nextStepIndex:String(n.value),isCrmUIWorkflow:!0,category:r?.category??"2",businessProcessType:r?.businessProcessType??"0",mode:r?.mode??"0",title:r?.title??e.name,formId:a,workflowEntityId:r?.workflowEntityId??e.ruleId??"",variables:r?.variables??[],inputs:r?.inputs??[],steps:{list:o}};return JSON.stringify(s)}var G2,z,ep,z2,Z2=D(()=>{"use strict";Yd();G2=ne(ha()),z=ne(B2());ep={Equals:z.WorkflowConditionOperator.Equal,DoesNotEqual:z.WorkflowConditionOperator.NotEqual,IsGreaterThan:z.WorkflowConditionOperator.GreaterThan,IsLessThan:z.WorkflowConditionOperator.LessThan,IsGreaterThanEqualTo:z.WorkflowConditionOperator.GreaterThanOrEqual,IsLessThanEqualTo:z.WorkflowConditionOperator.LessThanOrEqual,Contains:z.WorkflowConditionOperator.Contains,DoesNotContain:z.WorkflowConditionOperator.DoesNotContain,BeginsWith:z.WorkflowConditionOperator.BeginsWith,DoesNotBeginWith:z.WorkflowConditionOperator.DoesNotBeginWith,EndsWith:z.WorkflowConditionOperator.EndsWith,DoesNotEndWith:z.WorkflowConditionOperator.DoesNotEndWith,On:z.WorkflowConditionOperator.On,NotOn:z.WorkflowConditionOperator.NotOn,ContainsData:z.WorkflowConditionOperator.NotNull,DoesNotContainData:z.WorkflowConditionOperator.IsNull},z2={};for(let e of Object.keys(ep))z2[ep[e]]=e});function ip(e){return!Iq.has(e)}function eN(e){return _q.has(e)?"string":e==="Money"?"money":e==="Integer"||e==="BigInt"?"integer":e==="Decimal"||e==="Double"?"decimal":Pq.has(e)?"date":Oq.has(e)?"boolean":"other"}function tN(e,t){let r=eN(e),n=eN(t);return r==="other"||n==="other"?e===t:r===n}var Iq,_q,Pq,Oq,rN=D(()=>{"use strict";Iq=new Set(["ContainsData","DoesNotContainData"]);_q=new Set(["String","Memo","EntityName"]),Pq=new Set(["DateTime"]),Oq=new Set(["Boolean"])});var dN={};Bt(dN,{addElseIfInTree:()=>xq,appendToBranch:()=>Tq,buildBreadcrumb:()=>$q,collectUsedFields:()=>kq,createEmptyAction:()=>Bq,createEmptyCondition:()=>lN,findNode:()=>aN,findParent:()=>Ci,getBranchPosition:()=>Uq,hasAnyTriggerGeneratingAction:()=>sp,isTriggerGeneratingAction:()=>iN,moveBranchItemInTree:()=>Mq,removeElseIfInTree:()=>Lq,removeNodeFromTree:()=>oN,updateActionInTree:()=>ap,updateConditionInTree:()=>yn,validateTree:()=>qq});function iN(e){return Fq.has(e.type)}function sp(e){if(!e)return!1;for(let t of[...e.trueBranch,...e.falseBranch])if(t.kind==="action"){if(iN(t))return!0}else if(sp(t))return!0;return!1}function aN(e,t){if(e.id===t)return e;for(let r of[...e.trueBranch,...e.falseBranch]){if(r.id===t)return r;if(r.kind==="condition"){let n=aN(r,t);if(n)return n}}return null}function Ci(e,t){for(let r=0;r<e.trueBranch.length;r++){let n=e.trueBranch[r];if(n.id===t)return{node:e,branch:"true",index:r};if(n.kind==="condition"){let i=Ci(n,t);if(i)return i}}for(let r=0;r<e.falseBranch.length;r++){let n=e.falseBranch[r];if(n.id===t)return{node:e,branch:"false",index:r};if(n.kind==="condition"){let i=Ci(n,t);if(i)return i}}return null}function oN(e,t){return{...e,trueBranch:nN(e.trueBranch,t),falseBranch:nN(e.falseBranch,t)}}function nN(e,t){return e.filter(r=>r.id!==t).map(r=>r.kind==="condition"?oN(r,t):r)}function yn(e,t,r){return e.id===t?r(e):{...e,trueBranch:e.trueBranch.map(n=>n.kind==="condition"?yn(n,t,r):n),falseBranch:e.falseBranch.map(n=>n.kind==="condition"?yn(n,t,r):n)}}function ap(e,t,r){return{...e,trueBranch:e.trueBranch.map(n=>n.kind==="action"&&n.id===t?r(n):n.kind==="condition"?ap(n,t,r):n),falseBranch:e.falseBranch.map(n=>n.kind==="action"&&n.id===t?r(n):n.kind==="condition"?ap(n,t,r):n)}}function Tq(e,t,r,n){return yn(e,t,i=>({...i,trueBranch:r==="true"?[...i.trueBranch,n]:i.trueBranch,falseBranch:r==="false"?[...i.falseBranch,n]:i.falseBranch}))}function Rq(e){return e.length===1&&e[0].kind==="condition"}function xq(e,t){return yn(e,t,r=>sN(r))}function sN(e){if(Rq(e.falseBranch))return{...e,falseBranch:[sN(e.falseBranch[0])]};let t=lN();return t.falseBranch=e.falseBranch,{...e,falseBranch:[t]}}function Lq(e,t){let r=Ci(e,t);if(!r||r.branch!=="false")return e;let n=r.node.falseBranch[r.index];if(!n||n.kind!=="condition")return e;let i=n.falseBranch;return yn(e,r.node.id,a=>({...a,falseBranch:i}))}function Mq(e,t,r){let n=Ci(e,t);if(!n)return e;let i=a=>{let o=[...a],s=o[n.index+r];return s?(o[n.index+r]=o[n.index],o[n.index]=s,o):a};return yn(e,n.node.id,a=>({...a,trueBranch:n.branch==="true"?i(a.trueBranch):a.trueBranch,falseBranch:n.branch==="false"?i(a.falseBranch):a.falseBranch}))}function Uq(e,t){let r=Ci(e,t);if(!r)return null;let n=r.branch==="true"?r.node.trueBranch:r.node.falseBranch;return{isFirst:r.index===0,isLast:r.index===n.length-1}}function lN(){return{kind:"condition",id:gt(),displayName:"New Condition",clauses:[],logic:"AND",trueBranch:[],falseBranch:[],isCollapsed:!1}}function Bq(e){let t={kind:"action",id:gt(),type:e,displayName:`New ${e}`};switch(e){case"Recommendation":return{...t,type:"Recommendation",field:"",recommendationTitle:"",messageText:""};case"LockUnlock":return{...t,type:"LockUnlock",field:"",lock:!0};case"ShowErrorMessage":return{...t,type:"ShowErrorMessage",field:"",errorMessage:""};case"SetFieldValue":return{...t,type:"SetFieldValue",field:"",valueType:"Value",value:""};case"SetDefaultValue":return{...t,type:"SetDefaultValue",field:"",valueType:"Value",value:""};case"SetBusinessRequired":return{...t,type:"SetBusinessRequired",field:"",required:!0};case"SetVisibility":return{...t,type:"SetVisibility",field:"",visible:!0};default:return{...t,type:"SetFieldValue",field:"",valueType:"Value",value:""}}}function kq(e){if(!e)return[];let t=[];return uN(e,t),[...new Set(t)]}function uN(e,t){e.clauses.forEach(r=>{r.field&&t.push(r.field)}),[...e.trueBranch,...e.falseBranch].forEach(r=>{r.kind==="condition"?uN(r,t):"field"in r&&r.field&&t.push(r.field)})}function qq(e,t=[]){if(!e)return[{nodeId:"root",kind:"NO_CONDITION",message:"A business rule must include at least one condition."}];let r=[],n=new Map(t.map(i=>[i.logicalName,i]));return cN(e,r,n),sp(e)||r.push({nodeId:"root",kind:"NO_ACTION",message:"A business rule must include at least one action step."}),r}function cN(e,t,r){e.clauses.length===0&&t.push({nodeId:e.id,kind:"EMPTY_CLAUSE_FIELD",message:"Add at least one clause to this condition."}),e.clauses.forEach(n=>{if(!n.field)t.push({nodeId:e.id,kind:"EMPTY_CLAUSE_FIELD",message:"Please select a field for this clause."});else if(ip(n.operator)&&n.valueType==="Value"&&!n.value)t.push({nodeId:e.id,kind:"EMPTY_CLAUSE_VALUE",message:"Please enter a value for this clause."});else if(ip(n.operator)&&n.valueType==="Value"&&n.value){let i=r.get(n.field);i?.maxLength&&n.value.length>i.maxLength&&t.push({nodeId:e.id,kind:"CLAUSE_VALUE_TOO_LONG",message:`Value exceeds the field's maximum length of ${i.maxLength} characters.`})}}),[...e.trueBranch,...e.falseBranch].forEach(n=>{if(n.kind==="condition")cN(n,t,r);else if(!("field"in n)||!n.field)t.push({nodeId:n.id,kind:"EMPTY_ACTION_FIELD",message:`${n.type}: a target field is required.`});else if((n.type==="SetFieldValue"||n.type==="SetDefaultValue")&&n.valueType==="Value"&&n.value){let i=r.get(n.field);i?.maxLength&&n.value.length>i.maxLength&&t.push({nodeId:n.id,kind:"ACTION_VALUE_TOO_LONG",message:`${n.type}: value exceeds the field's maximum length of ${i.maxLength} characters.`})}else if((n.type==="SetFieldValue"||n.type==="SetDefaultValue")&&n.valueType==="Field"){if(!n.valueField)t.push({nodeId:n.id,kind:"EMPTY_ACTION_VALUE",message:`${n.type}: please select a field to copy from.`});else if(r.size>0){let i=r.get(n.field),a=r.get(n.valueField);i&&a&&!tN(i.attributeType,a.attributeType)&&t.push({nodeId:n.id,kind:"EMPTY_ACTION_VALUE",message:`${n.type}: the source field's type is not compatible with the target field.`})}}})}function $q(e,t){let r=[];return op(e,t,r),r}function op(e,t,r){if(e.id===t)return r.push({conditionId:e.id,label:e.displayName}),!0;for(let n of e.trueBranch)if(n.kind==="condition"){if(r.push({conditionId:e.id,label:e.displayName}),op(n,t,r))return!0;r.pop()}for(let n of e.falseBranch)if(n.kind==="condition"){if(r.push({conditionId:e.id,label:e.displayName}),op(n,t,r))return!0;r.pop()}return!1}var Fq,pN=D(()=>{"use strict";Yd();rN();Fq=new Set(["LockUnlock","ShowErrorMessage","SetFieldValue","SetDefaultValue","SetBusinessRequired","SetVisibility"])});var hN=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.businessRuleApi=void 0;var Xs=ha(),Yt=$e(),Ai=ue(),fN="00000000-0000-0000-0000-000000000000",Ks={"Content-Type":"application/json",Accept:"application/json"},Vq="workflowid,name,description,primaryentity,statecode,category,type",Gq="category eq 2 and type eq 1";async function mN(e,t,r){if(r==="Draft")return;let n=(0,Ai.normalizeGuid)(t,"workflowid"),i=r==="Active",a={statecode:i?Xs.StateCode.Activated:Xs.StateCode.Draft,statuscode:i?Xs.StatusCode.Activated:Xs.StatusCode.Draft},o=`/workflows(${n})`;(0,Yt.ensureSuccess)(await e.patch(o,a,{headers:Ks}),e.apiUrl(o))}Ys.businessRuleApi={async get(e,t){let n=`/workflows(${(0,Ai.normalizeGuid)(t,"id")})/Microsoft.Dynamics.CRM.RetrieveProcessWithWfomJson`,i=(0,Yt.ensureSuccess)(await e.post(n,{},{headers:Ks}),e.apiUrl(n));return{raw:i.body,etag:(0,Yt.readEtag)(i)}},async list(e,t){var r;let n=[Gq];t?.entityLogicalName&&n.push(`primaryentity eq '${(0,Ai.odataLiteral)(t.entityLogicalName)}'`);let i=`/workflows${(0,Ai.odataQuery)([["$select",Vq],["$filter",n.join(" and ")]])}`,o=(0,Yt.ensureSuccess)(await e.get(i),e.apiUrl(i)).body;return((r=o?.value)!==null&&r!==void 0?r:[]).map(l=>{var u,c;return{type:"businessRule",id:(u=l.workflowid)!==null&&u!==void 0?u:"",name:(c=l.name)!==null&&c!==void 0?c:"",entityLogicalName:l.primaryentity,isDirty:!1}})},async create(e,t){let r=t,n=`/workflows(${fN})/Microsoft.Dynamics.CRM.CreateProcessWithWfomJson`,i=(0,Yt.ensureSuccess)(await e.post(n,r,{headers:Ks}),e.apiUrl(n)),a=(0,Ai.normalizeGuid)(r.Entity.workflowid,"workflowid");try{await mN(e,a,r.status)}catch(o){try{await(0,Yt.deleteRecord)(e,"workflows",a)}catch{}throw o}return{id:a,etag:(0,Yt.readEtag)(i)}},async update(e,t,r,n){let i=r,a=(0,Ai.normalizeGuid)(t,"id"),o=`/workflows(${fN})/Microsoft.Dynamics.CRM.UpdateProcessWithWfomJson`,s={...Ks};n&&(s["If-Match"]=n);let l=(0,Yt.ensureSuccess)(await e.post(o,i,{headers:s}),e.apiUrl(o));return await mN(e,a,i.status),{id:a,etag:(0,Yt.readEtag)(l)}},delete(e,t){return(0,Yt.deleteRecord)(e,"workflows",t)}}});var yN=m(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.BUSINESS_RULE_NULL_GUID=zr.businessRuleRegistration=zr.BusinessRuleAdapter=void 0;var gN=wu(),lp=ha(),vN=(Z2(),kt(Y2)),zq=(pN(),kt(dN)),Ja=$r(),Wq=hN(),jq=Ft(),Hq="00000000-0000-0000-0000-000000000000";zr.BUSINESS_RULE_NULL_GUID=Hq;var Jq=new Set(["Recommendation","LockUnlock","ShowErrorMessage","SetFieldValue","SetDefaultValue","SetBusinessRequired","SetVisibility"]),Qq=["ruleId","name","description","entityLogicalName","scope","status","rootCondition"],Xq=["kind","id","displayName","logic","clauses","trueBranch","falseBranch"],Zs=class{toArtifact(t){let r=this.residualBag(t,Qq),n={id:t.ruleId,name:t.name,description:t.description,entityLogicalName:t.entityLogicalName,scope:t.scope,status:t.status,rootCondition:t.rootCondition?this.conditionToJson(t.rootCondition):null};return r&&(n.bag=r),n}fromArtifact(t){var r;let n=t.rootCondition?this.conditionFromJson(t.rootCondition):null;return{...(r=t.bag)!==null&&r!==void 0?r:{},ruleId:t.id,name:t.name,description:t.description,entityLogicalName:t.entityLogicalName,scope:t.scope,status:t.status,rootCondition:n}}fromApiResponse(t){var r;let n=t??{},i={...(r=n.Entity)!==null&&r!==void 0?r:{},wfomJson:n.WfomJson},a=(0,vN.deserializeWorkflowJson)(i);return this.toArtifact(a)}toApiPayload(t){var r;let n=this.fromArtifact(t);n.wfomRoot&&(n.wfomRoot={...n.wfomRoot,name:t.name,title:t.name,primaryEntityName:t.entityLogicalName||n.wfomRoot.primaryEntityName});let i=(0,vN.serializeToWorkflowJson)(n),a=(r=n.ruleId)!==null&&r!==void 0?r:(0,gN.v4)();return{Entity:this.buildWorkflowEntity(n,a),WfomJson:i,status:t.status}}createDefault(t){var r,n,i,a,o,s;let l={ruleId:(r=t.id)!==null&&r!==void 0?r:null,name:(n=t.name)!==null&&n!==void 0?n:"New business rule",description:(i=t.description)!==null&&i!==void 0?i:"",entityLogicalName:(a=t.entityLogicalName)!==null&&a!==void 0?a:"",scope:(o=t.scope)!==null&&o!==void 0?o:"Entity",status:(s=t.status)!==null&&s!==void 0?s:"Draft",rootCondition:(0,zq.createEmptyCondition)()},u=this.toArtifact(l);return u.id||(u.id=(0,gN.v4)()),u}assignMissingIds(t){return(0,jq.assignMissingIds)(t)}validate(t){let r=[],n=t.rootCondition;return n==null?r:(0,Ja.isJsonObject)(n)?(bN(n,"/rootCondition",r),r):(r.push((0,Ja.issue)("/rootCondition","condition-must-be-object",`rootCondition must be a JSON object or null, got ${typeof n}`)),r)}residualBag(t,r){let n=new Set(r),i={};for(let a of Object.keys(t)){if(n.has(a))continue;let o=t[a];o!==void 0&&(i[a]=o)}return Object.keys(i).length>0?i:void 0}buildWorkflowEntity(t,r){let n=t.scope!=="Entity"&&t.scope!=="AllForms";return{"@odata.type":"#Microsoft.Dynamics.CRM.workflow",name:t.name,description:t.description,workflowid:r,ondemand:!1,subprocess:!1,triggeroncreate:!1,triggerondelete:!1,category:lp.WorkflowCategory.BusinessRule,type:lp.WorkflowTypeCode.Definition,mode:1,scope:lp.WorkflowScope.Organization,primaryentity:t.entityLogicalName,iscrmuiworkflow:!0,processtriggerscope:n?1:2,...n?{processtriggerformid:t.scope}:{}}}conditionToJson(t){let r=this.residualBag(t,Xq),n={id:t.id,displayName:t.displayName,logic:t.logic,clauses:t.clauses.map(i=>this.clauseToJson(i)),trueBranch:t.trueBranch.map(i=>this.branchItemToJson(i)),falseBranch:t.falseBranch.map(i=>this.branchItemToJson(i))};return r&&(n.bag=r),n}clauseToJson(t){return{id:t.id,field:t.field,fieldDisplayName:t.fieldDisplayName,operator:t.operator,valueType:t.valueType,...t.value!==void 0?{value:t.value}:{},...t.valueField!==void 0?{valueField:t.valueField}:{}}}branchItemToJson(t){return t.kind==="condition"?this.conditionToJson(t):this.actionToJson(t)}actionToJson(t){return{...t}}conditionFromJson(t){var r;return{kind:"condition",isCollapsed:!1,...(r=t.bag)!==null&&r!==void 0?r:{},id:t.id,displayName:t.displayName,logic:t.logic,clauses:t.clauses.map(i=>this.clauseFromJson(i)),trueBranch:t.trueBranch.map(i=>this.branchItemFromJson(i)),falseBranch:t.falseBranch.map(i=>this.branchItemFromJson(i))}}clauseFromJson(t){var r;return{id:t.id,field:t.field,fieldDisplayName:(r=t.fieldDisplayName)!==null&&r!==void 0?r:t.field,operator:t.operator,valueType:t.valueType,...t.value!==void 0?{value:t.value}:{},...t.valueField!==void 0?{valueField:t.valueField}:{}}}branchItemFromJson(t){return this.isConditionJson(t)?this.conditionFromJson(t):this.actionFromJson(t)}actionFromJson(t){if(!Jq.has(t.type))throw new Error(`Unsupported business-rule action type: ${t.type}`);return{...t,kind:"action",type:t.type}}isConditionJson(t){return Object.prototype.hasOwnProperty.call(t,"clauses")&&Object.prototype.hasOwnProperty.call(t,"logic")&&!Object.prototype.hasOwnProperty.call(t,"type")}};zr.BusinessRuleAdapter=Zs;function bN(e,t,r){(0,Ja.optionalEnum)(e,"logic",["AND","OR"],t,"condition-logic-invalid",r),(0,Ja.childObjects)(e,"clauses",t,"clause",r);for(let n of["trueBranch","falseBranch"])(0,Ja.childObjects)(e,n,t,"branchItem",r).forEach(({node:a,index:o})=>{("clauses"in a||"trueBranch"in a||"falseBranch"in a)&&bN(a,`${t}/${n}/${o}`,r)})}function Kq(){return{adapter:new Zs,api:Wq.businessRuleApi}}zr.businessRuleRegistration=Kq});var EN=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.appRegistration=Ni.AppAdapter=void 0;var wi=$r(),Le=pn(),Xa=ja(),Yq=_u(),up=fn(),Zq=Ft(),fp="1033",rl="7.0.0.0",CN=`<SiteMap IntroducedVersion="${rl}"></SiteMap>`,e$="/_imgs/imagestrips/transparent_spacer.gif",t$="/_imgs/TableIconsFluentV9/document_one_page_sparkle.svg",r$=["Entity","Url","DefaultDashboard","Page","GenPageId"],Qa="sitemapId",AN="sitemapName",n$="sitemapNameUnique",nl=class{toArtifact(t){let{bag:r,modeledEls:n}=el(t,"Area");return{id:"",name:"",uniqueName:"",description:"",siteMap:{areas:n.map(i=>this.areaToJson(i)),bag:r},bag:(0,Le.emptyBag)()}}fromArtifact(t){(0,up.installDomShim)();let r=this.assignMissingIds(JSON.parse(JSON.stringify(t))),n=new DOMParser().parseFromString("<root/>","text/xml"),i=this.rootToRaw(r);return(0,Le.rebuildRaw)(i,(0,Xa.domEngine)(n),null)}fromApiResponse(t){var r,n,i,a,o,s,l,u,c,d;(0,up.installDomShim)();let f=t??{},g=(r=f.$sitemap)!==null&&r!==void 0?r:f,b=(0,Xa.parseXmlRoot)((n=g.sitemapxml)!==null&&n!==void 0?n:CN,CN),w=this.toArtifact(b);return w.id=(i=f.appmoduleid)!==null&&i!==void 0?i:"",w.name=(a=f.name)!==null&&a!==void 0?a:"",w.uniqueName=(o=f.uniquename)!==null&&o!==void 0?o:"",w.description=(s=f.description)!==null&&s!==void 0?s:"",w.bag={a:[[Qa,(u=(l=g.sitemapid)!==null&&l!==void 0?l:f._sitemapid_value)!==null&&u!==void 0?u:""],[AN,(c=g.sitemapname)!==null&&c!==void 0?c:""],[n$,(d=g.sitemapnameunique)!==null&&d!==void 0?d:""]],c:[]},w}toApiPayload(t){var r,n,i,a,o,s,l,u,c,d,f,g,b,w;(0,up.installDomShim)();let N=(0,Xa.serializeNode)(this.fromArtifact(t)),_=[],T=[];for(let M of(n=(r=t.siteMap)===null||r===void 0?void 0:r.areas)!==null&&n!==void 0?n:[])for(let W of(i=M.groups)!==null&&i!==void 0?i:[])for(let B of(a=W.subAreas)!==null&&a!==void 0?a:[])B.type==="Entity"&&B.entity?_.push(B.entity):B.type==="DashBoard"&&B.dashboardId&&T.push(B.dashboardId);let R=(o=t.bag)!==null&&o!==void 0?o:(0,Le.emptyBag)();return{sitemapId:(s=NN(R,Qa))!==null&&s!==void 0?s:"",sitemapxml:N,sitemapname:NN(R,AN)||t.name,appModuleId:t.id,appModuleName:t.name,appModuleDescription:t.description,appModuleUniqueName:t.uniqueName,...t.iconWebResourceId?{iconWebResourceId:t.iconWebResourceId}:{},entities:_,components:{forms:(u=(l=t.components)===null||l===void 0?void 0:l.forms)!==null&&u!==void 0?u:[],views:(d=(c=t.components)===null||c===void 0?void 0:c.views)!==null&&d!==void 0?d:[],charts:(g=(f=t.components)===null||f===void 0?void 0:f.charts)!==null&&g!==void 0?g:[],dashboards:[...(w=(b=t.components)===null||b===void 0?void 0:b.dashboards)!==null&&w!==void 0?w:[],...T]}}}createDefault(t){var r,n,i,a;let o=t.siteMap&&t.siteMap.areas.length>0?t.siteMap.areas:[{id:"",title:"Area",groups:[{id:"",title:"Group",subAreas:[]}]}];return{id:(r=t.id)!==null&&r!==void 0?r:(0,Zq.newId)(),name:(n=t.name)!==null&&n!==void 0?n:"New App",uniqueName:(i=t.uniqueName)!==null&&i!==void 0?i:"",description:(a=t.description)!==null&&a!==void 0?a:"",siteMap:{areas:o},...t.iconWebResourceId?{iconWebResourceId:t.iconWebResourceId}:{},...t.components?{components:t.components}:{}}}assignMissingIds(t){let r=t;if(!r||typeof r!="object")return t;let n=r.siteMap;return n&&Array.isArray(n.areas)?n.areas.forEach(pp):Array.isArray(r.areas)?r.areas.forEach(pp):Array.isArray(r.groups)?pp(r):Array.isArray(r.subAreas)?DN(r):"type"in r&&il(r,"subarea"),t}validate(t){let r=[],n=t.siteMap;return n==null?r:(0,wi.isJsonObject)(n)?((0,wi.childObjects)(n,"areas","/siteMap","area",r).forEach(({node:a,index:o})=>{let s=`/siteMap/areas/${o}`;(0,wi.childObjects)(a,"groups",s,"group",r).forEach(({node:u,index:c})=>{let d=`${s}/groups/${c}`;(0,wi.childObjects)(u,"subAreas",d,"subArea",r).forEach(({node:g,index:b})=>{(0,wi.optionalEnum)(g,"type",["Entity","URL","DashBoard","CustomPage","GenPage"],`${d}/subAreas/${b}`,"subarea-type-invalid",r)})})}),r):(r.push((0,wi.issue)("/siteMap","sitemap-must-be-object",`siteMap must be a JSON object, got ${typeof n}`)),r)}applyServerIdentity(t,r){let n=r[Qa];if(!n)return;t.bag||(t.bag=(0,Le.emptyBag)());let i=t.bag.a.find(a=>a[0]===Qa);i?i[1]=n:t.bag.a.push([Qa,n])}areaToJson(t){var r;let{bag:n,modeledEls:i}=el(t,"Group"),a={id:(r=t.getAttribute("Id"))!==null&&r!==void 0?r:"",title:cp(t),groups:i.map(l=>this.groupToJson(l)),bag:n},o=t.getAttribute("Icon");o&&(a.icon=o);let s=t.getAttribute("VectorIcon");return s&&(a.vectorIcon=s),a}groupToJson(t){var r;let{bag:n,modeledEls:i}=el(t,"SubArea");return{id:(r=t.getAttribute("Id"))!==null&&r!==void 0?r:"",title:cp(t),subAreas:i.map(a=>this.subAreaToJson(a)),bag:n}}subAreaToJson(t){var r;let{bag:n}=el(t,null),i=i$(t),a={id:(r=t.getAttribute("Id"))!==null&&r!==void 0?r:"",type:i,title:cp(t),bag:n};if(i==="Entity"){let l=t.getAttribute("Entity");l&&(a.entity=l)}else if(i==="DashBoard"){let l=t.getAttribute("DefaultDashboard");l&&(a.dashboardId=l);let u=t.getAttribute("Url");u&&(a.dashboardUrl=u)}else if(i==="CustomPage"){let l=t.getAttribute("Page");l&&(a.page=l)}else if(i==="GenPage"){let l=t.getAttribute("GenPageId");l&&(a.genPageId=l)}else{let l=t.getAttribute("Url");l&&(a.url=l)}let o=t.getAttribute("Icon");o&&o!==e$&&(a.icon=o);let s=t.getAttribute("VectorIcon");return s&&(a.vectorIcon=s),a}rootToRaw(t){var r,n,i,a;let o=(n=(r=t.siteMap)===null||r===void 0?void 0:r.bag)!==null&&n!==void 0?n:(0,Le.emptyBag)(),l=tl(o)?[["IntroducedVersion",rl]]:[],u=((a=(i=t.siteMap)===null||i===void 0?void 0:i.areas)!==null&&a!==void 0?a:[]).map(c=>this.areaToRaw(c));return{n:"SiteMap",a:(0,Le.mergeAttrs)(o.a,l),c:(0,Le.spliceChildren)(o.c,u)}}areaToRaw(t){var r;let n=(r=t.bag)!==null&&r!==void 0?r:(0,Le.emptyBag)(),i=tl(n),a=[];t.id&&a.push(["Id",t.id]),i&&a.push(["ShowGroups","true"],["ResourceId","SitemapDesigner.NewTitle"],["DescriptionResourceId","SitemapDesigner.NewTitle"],["IntroducedVersion",rl]),t.icon!==void 0&&a.push(["Icon",t.icon]),t.vectorIcon!==void 0&&a.push(["VectorIcon",t.vectorIcon]);let o=t.groups.map(l=>this.groupToRaw(l)),s=dp((0,Le.spliceChildren)(n.c,o),t.title,i);return{n:"Area",a:(0,Le.mergeAttrs)(n.a,a),c:s}}groupToRaw(t){var r;let n=(r=t.bag)!==null&&r!==void 0?r:(0,Le.emptyBag)(),i=tl(n),a=[];t.id&&a.push(["Id",t.id]),i&&a.push(["ResourceId","SitemapDesigner.NewGroup"],["DescriptionResourceId","SitemapDesigner.NewGroup"],["ToolTipResourseId","SitemapDesigner.Unknown"],["IntroducedVersion",rl],["IsProfile","false"]);let o=t.subAreas.map(l=>this.subAreaToRaw(l)),s=dp((0,Le.spliceChildren)(n.c,o),t.title,i);return{n:"Group",a:(0,Le.mergeAttrs)(n.a,a),c:s}}subAreaToRaw(t){var r;let n=(r=t.bag)!==null&&r!==void 0?r:(0,Le.emptyBag)(),i=tl(n),a=o$(n.a,t.type),o=[];t.id&&o.push(["Id",t.id]),l$(o,t),i?(o.push(["ResourceId","SitemapDesigner.NewSubArea"],["Client","All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web"],["Sku","All,OnPremise,Live,SPLA"],["AvailableOffline","true"],["PassParams","false"]),t.icon&&o.push(["Icon",t.icon])):t.icon!==void 0&&o.push(["Icon",t.icon]),t.vectorIcon!==void 0?o.push(["VectorIcon",t.vectorIcon]):t.type==="GenPage"&&!a$(a,"VectorIcon")&&o.push(["VectorIcon",t$]);let s=dp((0,Le.spliceChildren)(n.c,[]),t.title,i);return{n:"SubArea",a:(0,Le.mergeAttrs)(a,o),c:s}}};Ni.AppAdapter=nl;function el(e,t){let r=(0,Xa.nodeLikeFromDom)(e).getAllProperties().map(s=>[s.key,s.value]),n=[],i=[],a=e.childNodes,o=0;for(let s=0;s<a.length;s+=1){let l=a[s];l.nodeType!==1&&l.nodeType!==3||(l.nodeType===1&&t!==null&&l.tagName===t?i.push(l):n.push({i:o,node:(0,Le.rawFromNode)((0,Xa.nodeLikeFromDom)(l))}),o+=1)}return{bag:{a:r,c:n},modeledEls:i}}function wN(e,t){let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];a.nodeType===1&&a.tagName===t&&r.push(a)}return r}function cp(e){var t;let r=wN(e,"Titles")[0];if(!r)return"";let i=wN(r,"Title").find(a=>a.getAttribute("LCID")===fp);return i&&(t=i.getAttribute("Title"))!==null&&t!==void 0?t:""}function i$(e){return e.getAttribute("GenPageId")?"GenPage":e.getAttribute("Entity")?"Entity":e.getAttribute("Page")?"CustomPage":e.getAttribute("DefaultDashboard")?"DashBoard":"URL"}function tl(e){return e.a.length===0&&e.c.length===0}function a$(e,t){return e.some(([r])=>r===t)}function NN(e,t){let r=e.a.find(([n])=>n===t);return r?r[1]:void 0}function o$(e,t){let r=s$(t);return e.filter(([n])=>!r$.includes(n)||r.has(n)).map(n=>[n[0],n[1]])}function s$(e){switch(e){case"Entity":return new Set(["Entity"]);case"URL":return new Set(["Url"]);case"DashBoard":return new Set(["DefaultDashboard","Url"]);case"CustomPage":return new Set(["Page"]);case"GenPage":return new Set(["GenPageId"]);default:return new Set}}function l$(e,t){var r,n,i,a,o;switch(t.type){case"Entity":e.push(["Entity",(r=t.entity)!==null&&r!==void 0?r:""]);break;case"URL":e.push(["Url",(n=t.url)!==null&&n!==void 0?n:""]);break;case"DashBoard":e.push(["DefaultDashboard",(i=t.dashboardId)!==null&&i!==void 0?i:""]),t.dashboardUrl!==void 0&&e.push(["Url",t.dashboardUrl]);break;case"CustomPage":e.push(["Page",(a=t.page)!==null&&a!==void 0?a:""]);break;case"GenPage":e.push(["GenPageId",(o=t.genPageId)!==null&&o!==void 0?o:""]);break;default:break}}function dp(e,t,r){if(!t)return e;let n=e.findIndex(i=>i.n==="Titles");if(n>=0){let i=e.slice();return i[n]=u$(e[n],t),i}return r?[c$(t),...e]:e}function u$(e,t){let r=!1,n=e.c.map(i=>!r&&i.n==="Title"&&d$(i,"LCID")===fp?(r=!0,{n:i.n,a:(0,Le.mergeAttrs)(i.a,[["Title",t]]),c:i.c}):i);return r||n.unshift(SN(t)),{n:e.n,a:e.a.map(i=>[i[0],i[1]]),c:n}}function c$(e){return{n:"Titles",a:[],c:[SN(e)]}}function SN(e){return{n:"Title",a:[["LCID",fp],["Title",e]],c:[]}}function d$(e,t){let r=e.a.find(([n])=>n===t);return r?r[1]:void 0}function p$(e){let t="0123456789abcdef",r="";for(let n=0;n<e;n+=1)r+=t[Math.floor(Math.random()*t.length)];return r}function il(e,t){e&&(typeof e.id!="string"||e.id.length===0)&&(e.id=`${t}_${p$(8)}`)}function pp(e){var t;il(e,"area");for(let r of(t=e.groups)!==null&&t!==void 0?t:[])DN(r)}function DN(e){var t;il(e,"group");for(let r of(t=e.subAreas)!==null&&t!==void 0?t:[])il(r,"subarea")}function f$(){return{adapter:new nl,api:Yq.appApi}}Ni.appRegistration=f$});var IN={};Bt(IN,{ActionType:()=>hp,AppActionOrigin:()=>Np,AppActionVisibilityType:()=>wp,ButtonType:()=>vp,CannotUpdateAppActionColumns:()=>m$,Context:()=>yp,IconType:()=>gp,Location:()=>bp,OnClickEventType:()=>Ap,Scope:()=>Cp,VisibilityType:()=>mp});var mp,hp,gp,vp,bp,yp,Cp,Ap,wp,Np,m$,_N=D(()=>{"use strict";(function(e){e[e.NotSupported=0]="NotSupported",e[e.Show=1]="Show",e[e.ClassicRules=2]="ClassicRules",e[e.Expression=3]="Expression"})(mp||(mp={}));(function(e){e[e.NotSupported=0]="NotSupported",e[e.None=1]="None",e[e.JavaScript=2]="JavaScript",e[e.Expression=3]="Expression"})(hp||(hp={}));(function(e){e[e.NoIcon=0]="NoIcon",e[e.UseIcon=1]="UseIcon",e[e.UseWebResource=2]="UseWebResource"})(gp||(gp={}));(function(e){e[e.Standard=0]="Standard",e[e.Dropdown=1]="Dropdown",e[e.Split=2]="Split",e[e.Group=3]="Group"})(vp||(vp={}));(function(e){e[e.Form=0]="Form",e[e.HomePageGrid=1]="HomePageGrid",e[e.SubGridStandard=2]="SubGridStandard",e[e.SubGridAssociated=3]="SubGridAssociated",e[e.QuickForm=4]="QuickForm",e[e.Global=5]="Global",e[e.Dashboard=6]="Dashboard"})(bp||(bp={}));(function(e){e[e.All=0]="All",e[e.Entity=1]="Entity"})(yp||(yp={}));(function(e){e[e.App=0]="App",e[e.Entity=1]="Entity",e[e.Global=2]="Global"})(Cp||(Cp={}));(function(e){e[e.None=0]="None",e[e.Formula=1]="Formula",e[e.JavaScript=2]="JavaScript"})(Ap||(Ap={}));(function(e){e[e.None=0]="None",e[e.Formula=1]="Formula",e[e.ClassicRules=2]="ClassicRules"})(wp||(wp={}));(function(e){e[e.Default=0]="Default",e[e.Migrated=1]="Migrated",e[e.MigratedClone=2]="MigratedClone"})(Np||(Np={}));m$=["appactionid","appmoduleid","context","contextvalue","location","name","type","uniquename","isdisabled","origin"]});var ON=m(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.commandApi=void 0;var Cr=$e(),Zt=ue(),h$="OnClickEventJavaScriptWebResourceId($select=name,webresourceid),IconWebResourceId($select=name,webresourceid)";async function Sp(e,t){let r=`/EntityDefinitions(LogicalName='${(0,Zt.odataLiteral)(t)}')${(0,Zt.odataQuery)([["$select","MetadataId"]])}`,i=(0,Cr.ensureSuccess)(await e.get(r),e.apiUrl(r)).body,a=i?.MetadataId;return a?(0,Zt.normalizeGuid)(a,"entityMetadataId"):""}al.commandApi={async get(e,t){var r;let n=t,i=await Sp(e,n),a=i?`_contextentity_value eq ${i}`:`contextvalue eq '${(0,Zt.odataLiteral)(n)}'`,o=`/appactions${(0,Zt.odataQuery)([["$expand",h$],["$filter",a]])}`,s=(0,Cr.ensureSuccess)(await e.get(o),e.apiUrl(o)),l=s.body;return{raw:{entityLogicalName:n,entityMetadataId:i,appActions:(r=l?.value)!==null&&r!==void 0?r:[]},etag:(0,Cr.readEtag)(s)}},async list(e,t){let r=t?.entityLogicalName;return r?[{type:"command",id:r,name:`${r} commands`,entityLogicalName:r,isDirty:!1}]:[]},async create(e,t){let r=t,n=r.entityMetadataId||await Sp(e,r.entityLogicalName);return PN(e,{...r,entityMetadataId:n},!1)},async update(e,t,r,n){return PN(e,r,!0)},async delete(e,t){var r,n;let i=await Sp(e,t),a=i?`_contextentity_value eq ${i}`:`contextvalue eq '${(0,Zt.odataLiteral)(t)}'`,o=`/appactions${(0,Zt.odataQuery)([["$select","appactionid"],["$filter",a]])}`,l=(n=(r=(0,Cr.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[];for(let u of l)u.appactionid&&await(0,Cr.deleteRecord)(e,"appactions",u.appactionid)}};async function PN(e,t,r){var n;let i=t.entityMetadataId?(0,Zt.normalizeGuid)(t.entityMetadataId,"entityMetadataId"):"",a=g$(t.rows);for(let o of a)if(r&&o.exists){let l=`/appactions(${(0,Zt.normalizeGuid)(o.appactionid,"id")})`,u=o.etag?{"If-Match":o.etag}:void 0;(0,Cr.ensureSuccess)(await e.patch(l,o.body,u?{headers:u}:void 0),e.apiUrl(l))}else{let s="/appactions",l={...o.body};i&&l["[email protected]"]===void 0&&(l["[email protected]"]=`/entities(${i})`);let u=(0,Cr.ensureSuccess)(await e.post(s,l),e.apiUrl(s));(0,Cr.readCreatedId)(u,"appactionid")}for(let o of[...(n=t.deletedRowIds)!==null&&n!==void 0?n:[]].reverse())await(0,Cr.deleteRecord)(e,"appactions",(0,Zt.normalizeGuid)(o,"id"));return{id:t.entityLogicalName,etag:null}}function g$(e){let t=new Map(e.map(a=>[a.appactionid,a])),r=new Set,n=[],i=a=>{if(r.has(a.appactionid))return;let o=a.body["[email protected]"];if(typeof o=="string"){let s=/\(([^)]+)\)/.exec(o),l=s?t.get(s[1]):void 0;l&&i(l)}r.add(a.appactionid),n.push(a)};return e.forEach(i),n}});var GN=m(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.commandRegistration=Si.CommandAdapter=void 0;var Pe=(_N(),kt(IN)),Et=$r(),v$=ON(),TN=Ft(),Ka=ue(),Ep="$ClientSvg:",Ip=".svg",b$=2,RN="entityMetadataId",y$=new Set(["@odata.etag","IconWebResourceId","OnClickEventJavaScriptWebResourceId","VisibilityFormulaComponentLibraryId","OnClickEventFormulaComponentLibraryId","ContextEntity","_appmoduleid_value","_contextentity_value","_createdby_value","_createdonbehalfby_value","_iconwebresourceid_value","_modifiedby_value","_modifiedonbehalfby_value","_onclickeventformulacomponentlibraryid_value","_onclickeventjavascriptwebresourceid_value","_organizationid_value","_parentappactionid_value","_visibilityformulacomponentlibraryid_value","createdon","modifiedon","overriddencreatedon","overwritetime","componentstate","componentidunique","solutionid","ismanaged","iscustomizable","versionnumber","importsequencenumber","timezoneruleversionnumber","utcconversiontimezonecode","statecode","statuscode","scope"]),ol=class{toArtifact(t){var r,n,i,a,o,s;let l=(r=t.appActions)!==null&&r!==void 0?r:[],u=(n=t.entityLogicalName)!==null&&n!==void 0?n:"",c=new Map;for(let g of l){let b=typeof g._parentappactionid_value=="string"&&g._parentappactionid_value?g._parentappactionid_value:"",w=(i=c.get(b))!==null&&i!==void 0?i:[];w.push(g),c.set(b,w)}let d=new Map;for(let g of(a=c.get(""))!==null&&a!==void 0?a:[]){let b=S$(g.location),w=(o=d.get(b))!==null&&o!==void 0?o:[];w.push(g),d.set(b,w)}let f=[];for(let[g,b]of d)f.push({location:g,groups:A$(b,c,BN(g),u)});return{id:u,entityLogicalName:u,commandBars:N$(f),bag:{a:[[RN,(s=t.entityMetadataId)!==null&&s!==void 0?s:""]]}}}fromArtifact(t){return{entityLogicalName:t.entityLogicalName,entityMetadataId:Pp(t),appActions:Dp(t).map(r=>r.row)}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t,r){let n=new Set(r?Dp(r).map(l=>l.appactionid):[]),i=Dp(t),a=new Set(i.map(l=>l.appactionid)),o=i.map(l=>{let u=l.exists||n.has(l.appactionid);return{appactionid:l.appactionid,exists:u,etag:l.etag,body:u?L$(l.row):VN(l.row)}}),s=[...n].filter(l=>!a.has(l));return{entityLogicalName:t.entityLogicalName,entityMetadataId:Pp(t),rows:o,...s.length>0?{deletedRowIds:s}:{}}}createDefault(t){var r,n,i,a;let o=(n=(r=t.entityLogicalName)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"";return{id:(i=t.id)!==null&&i!==void 0?i:o,entityLogicalName:o,commandBars:(a=t.commandBars)!==null&&a!==void 0?a:[]}}assignMissingIds(t){return(0,TN.assignMissingIds)(t)}validate(t){let r=[];return(0,Et.childObjects)(t,"commandBars","","commandBar",r).forEach(({node:i,index:a})=>{let o=`/commandBars/${a}`;(0,Et.optionalEnum)(i,"location",["MainTab","ContextualTab","HomeTab"],o,"bar-location-invalid",r),(0,Et.childObjects)(i,"groups",o,"group",r).forEach(({node:l,index:u})=>{let c=`${o}/groups/${u}`;(0,Et.optionalGuidId)(l,"id",c,"group-id-invalid",r),xN((0,Et.childObjects)(l,"controls",c,"control",r),`${c}/controls`,r)})}),r}};Si.CommandAdapter=ol;function xN(e,t,r){e.forEach(({node:n,index:i})=>{let a=`${t}/${i}`;(0,Et.optionalGuidId)(n,"id",a,"control-id-invalid",r),(0,Et.optionalEnum)(n,"type",["Button","FlyoutAnchor","SplitButton"],a,"control-type-invalid",r);let o=n.location;o!==void 0&&(typeof o!="number"||!Number.isInteger(o)||o<0||o>6)&&r.push((0,Et.issue)(`${a}/location`,"control-location-invalid",`location must be an integer 0-6 when present, got ${JSON.stringify(o)}`)),n.action!==void 0&&n.action!==null&&((0,Et.isJsonObject)(n.action)?(0,Et.optionalEnum)(n.action,"type",["javascript"],`${a}/action`,"action-type-invalid",r):r.push((0,Et.issue)(`${a}/action`,"control-action-must-be-object",`a control action must be a JSON object when present, got ${typeof n.action}`)));let s=(0,Et.childObjects)(n,"children",a,"control",r);s.length>0&&xN(s,`${a}/children`,r)})}function LN(e){return{a:Object.entries(e)}}function C$(e){return Object.fromEntries(e.a)}function _p(e,t){if(e){for(let[r,n]of e.a)if(r===t)return n}}function Pp(e){let t=_p(e.bag,RN);return typeof t=="string"?t:""}function A$(e,t,r,n){var i,a;let o=[],s=[];for(let l of ll(e))l.type===Pe.ButtonType.Group?o.push({id:UN(l.name,n),title:typeof l.grouptitle=="string"?l.grouptitle:"",controls:ll((a=t.get((i=l.appactionid)!==null&&i!==void 0?i:""))!==null&&a!==void 0?a:[]).map(u=>sl(u,t,r,n)),bag:LN(l)}):s.push(sl(l,t,r,n));return s.length>0&&o.unshift({id:(0,TN.newId)(),title:"",controls:s}),o}function sl(e,t,r,n){var i,a,o,s;let l=UN(e.name,n),u={id:l,type:D$(e.type),label:typeof e.buttonlabeltext=="string"?e.buttonlabeltext:"",command:typeof e.appactionid=="string"?e.appactionid:l,bag:LN(e)},c=MN(e);c&&(u.icon=c);let d=w$(e);d&&(u.action=d),typeof e.hidden=="boolean"&&(u.hidden=e.hidden),typeof e.isdisabled=="boolean"&&(u.disabled=e.isdisabled),typeof e.location=="number"&&e.location!==r&&(u.location=e.location);let f=t.get((i=e.appactionid)!==null&&i!==void 0?i:"");if(f&&f.length>0){let g=[];for(let b of ll(f))if(b.type===Pe.ButtonType.Group){u.flyoutGroupId=(a=b.appactionid)!==null&&a!==void 0?a:void 0;for(let w of ll((s=t.get((o=b.appactionid)!==null&&o!==void 0?o:""))!==null&&s!==void 0?s:[]))g.push(sl(w,t,r,n))}else g.push(sl(b,t,r,n));u.children=g}return u}function MN(e){var t;if(!((t=e.IconWebResourceId)===null||t===void 0)&&t.name)return e.IconWebResourceId.name;if(e.fonticon)return e.fonticon.startsWith(Ep)?e.fonticon.slice(Ep.length)+Ip:e.fonticon}function w$(e){var t;let r=e.onclickeventjavascriptfunctionname;if(typeof r!="string"||!r)return;let n=e.OnClickEventJavaScriptWebResourceId,i=e._onclickeventjavascriptwebresourceid_value,a={type:"javascript",webResourceId:(t=typeof i=="string"?i:n?.webresourceid)!==null&&t!==void 0?t:"",functionName:r};n?.name&&(a.libraryName=n.name);let o=e.onclickeventjavascriptparameters;return typeof o=="string"&&o&&(a.parameters=o),a}function FN(e){return typeof e.sequence=="number"?e.sequence:typeof e.buttonsequencepriority=="number"?e.buttonsequencepriority:0}function ll(e){return[...e].sort((t,r)=>FN(t)-FN(r))}function N$(e){let t={MainTab:0,ContextualTab:1,HomeTab:2};return[...e].sort((r,n)=>{var i,a;return((i=t[r.location])!==null&&i!==void 0?i:9)-((a=t[n.location])!==null&&a!==void 0?a:9)})}function UN(e,t){if(!e)return"";if(e.indexOf("{!EntityLogicalName}")>=0)return e.replace("{!EntityLogicalName}",t);let r=e.split("!");return r.length===2?r[1]:e}function S$(e){switch(e){case Pe.Location.Form:case Pe.Location.QuickForm:return"MainTab";case Pe.Location.HomePageGrid:case Pe.Location.Dashboard:return"HomeTab";default:return"ContextualTab"}}function BN(e){switch(e){case"MainTab":return Pe.Location.Form;case"HomeTab":return Pe.Location.HomePageGrid;default:return Pe.Location.SubGridStandard}}function D$(e){switch(e){case Pe.ButtonType.Dropdown:return"FlyoutAnchor";case Pe.ButtonType.Split:return"SplitButton";default:return"Button"}}function E$(e){switch(e){case"FlyoutAnchor":return Pe.ButtonType.Dropdown;case"SplitButton":return Pe.ButtonType.Split;default:return Pe.ButtonType.Standard}}function I$(e){var t;return e.bag&&e.bag.a.length>0?!0:((t=e.title)!==null&&t!==void 0?t:"").length>0}function Dp(e){var t,r,n;let i=[],a=Pp(e);for(let o of(t=e.commandBars)!==null&&t!==void 0?t:[]){let s=BN(o.location);for(let l of(r=o.groups)!==null&&r!==void 0?r:[]){let u;if(I$(l)){let c=P$(l,s,void 0,e,a);i.push(c),u=c.appactionid}for(let c of(n=l.controls)!==null&&n!==void 0?n:[])kN(c,s,u,e,a,i)}}return i}function kN(e,t,r,n,i,a){var o;let s=_$(e,t,r,n,i);a.push(s);let l=(o=e.children)!==null&&o!==void 0?o:[];if(l.length===0)return;let u=e.flyoutGroupId||x$(s.appactionid);a.push(O$(u,t,s.appactionid,n,i));for(let c of l)kN(c,t,u,n,i,a)}function _$(e,t,r,n,i){let a=qN(e,t,r,n,i),o=a.row,s=MN(o);return e.location!==void 0&&(o.location=e.location),o.type=E$(e.type),o.buttonlabeltext=e.label,F$(o,e.icon,s),T$(o,e.action),e.hidden!==void 0&&(o.hidden=e.hidden),e.disabled!==void 0&&(o.isdisabled=e.disabled),{...a,row:o}}function P$(e,t,r,n,i){let a=qN(e,t,r,n,i);return a.row.type=Pe.ButtonType.Group,a.row.grouptitle=e.title,a}function O$(e,t,r,n,i){let a=$N(e,t,n,i);return a["[email protected]"]=`/appactions(${(0,Ka.normalizeGuid)(r,"Command flyout group id")})`,a.type=Pe.ButtonType.Group,a.grouptitle===void 0&&(a.grouptitle=""),a.isgrouptitlehidden=!0,{appactionid:e,exists:!1,etag:null,row:a}}function qN(e,t,r,n,i){let a,o,s,l;if(e.bag&&e.bag.a.length>0){a=C$(e.bag),o=!0;let u=_p(e.bag,"@odata.etag");s=typeof u=="string"?u:null;let c=_p(e.bag,"appactionid");l=typeof c=="string"&&c?c:e.id}else l=e.id,a=$N(l,t,n,i),o=!1,s=null;return r&&(a["[email protected]"]=`/appactions(${(0,Ka.normalizeGuid)(r,"Command parent appaction id")})`),{appactionid:l,exists:o,etag:s,row:a}}function $N(e,t,r,n){let i={appactionid:e,name:`${e}!${e.replace(/-/g,"").slice(0,32)}`,uniquename:"",location:t,context:Pe.Context.Entity,contextvalue:r.entityLogicalName,scope:Pe.Scope.Entity};return n&&(i["[email protected]"]=`/entities(${(0,Ka.normalizeGuid)(n,"Command context entity metadata id")})`),i}function F$(e,t,r){if(t===r){let n=e._iconwebresourceid_value;typeof n=="string"&&n&&!e.fonticon&&(e["[email protected]"]=`/webresourceset(${(0,Ka.normalizeGuid)(n,"Command icon web resource id")})`);return}if(t===void 0){e.fonticon="",e.IconWebResourceId=null;return}e.fonticon=t.toLowerCase().endsWith(Ip)?Ep+t.slice(0,t.length-Ip.length):t,e.IconWebResourceId=null}function T$(e,t){if(!(!t||t.type!=="javascript")){if(e.onclickeventtype=b$,t.webResourceId){let r=(0,Ka.normalizeGuid)(t.webResourceId,"Command action web resource id");e["[email protected]"]=`/webresourceset(${r})`}e.onclickeventjavascriptfunctionname=t.functionName,t.parameters!==void 0&&(e.onclickeventjavascriptparameters=t.parameters)}}function R$(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}function x$(e){let t="";for(let r=0;r<4;r+=1)t+=R$(`${r}:flyout-group:${e}`).toString(16).padStart(8,"0");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function VN(e){let t={...e};for(let r of y$)delete t[r];return t}function L$(e){let t=VN(e);for(let r of Pe.CannotUpdateAppActionColumns)delete t[r];return t}function M$(){return{adapter:new ol,api:v$.commandApi}}Si.commandRegistration=M$});var zN=m(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.chartApi=void 0;var Ar=$e(),Ya=ue(),U$="savedqueryvisualizationid,name,description,primaryentitytypecode,datadescription,presentationdescription,charttype,type,isdefault",B$="savedqueryvisualizationid,name,primaryentitytypecode,charttype,isdefault";ul.chartApi={async get(e,t){let n=`/savedqueryvisualizations(${(0,Ya.normalizeGuid)(t,"id")})/Microsoft.Dynamics.CRM.RetrieveUnpublished()`+(0,Ya.odataQuery)([["$select",U$]]),i=(0,Ar.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,Ar.readEtag)(i)}},async list(e,t){var r;let n=`/savedqueryvisualizations${(0,Ya.odataQuery)([["$select",B$],["$filter",t?.entityLogicalName?`primaryentitytypecode eq '${(0,Ya.odataLiteral)(t.entityLogicalName)}'`:void 0]])}`,a=(0,Ar.ensureSuccess)(await e.get(n),e.apiUrl(n)).body;return((r=a?.value)!==null&&r!==void 0?r:[]).map(s=>{var l,u;return{type:"chart",id:(l=s.savedqueryvisualizationid)!==null&&l!==void 0?l:"",name:(u=s.name)!==null&&u!==void 0?u:"",entityLogicalName:s.primaryentitytypecode,isDirty:!1}})},async create(e,t){let r=t,n="/savedqueryvisualizations",i=(0,Ar.ensureSuccess)(await e.post(n,{name:r.name,description:r.description,datadescription:r.datadescription,presentationdescription:r.presentationdescription,primaryentitytypecode:r.primaryentitytypecode,charttype:r.charttype,isdefault:r.isdefault}),e.apiUrl(n));return{id:(0,Ar.requireCreatedId)(i,"savedqueryvisualizationid","chart"),etag:(0,Ar.readEtag)(i)}},async update(e,t,r,n){let i=r,a=(0,Ya.normalizeGuid)(t,"id"),o=`/savedqueryvisualizations(${a})`,s=n?{"If-Match":n}:void 0,l=(0,Ar.ensureSuccess)(await e.patch(o,{name:i.name,description:i.description,datadescription:i.datadescription,presentationdescription:i.presentationdescription},s?{headers:s}:void 0),e.apiUrl(o));return{id:a,etag:(0,Ar.readEtag)(l)}},delete(e,t){return(0,Ar.deleteRecord)(e,"savedqueryvisualizations",t)}}});var aS=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.chartRegistration=Di.ChartAdapter=void 0;var Op=pn(),WN=$r(),wr=ja(),k$=zN(),Fp=fn(),q$=Ft(),$$=["Column","StackedColumn","StackedColumn100","Bar","StackedBar","StackedBar100","Area","StackedArea","StackedArea100","Line","Pie","Doughnut","Funnel","Tag"],V$=new Map($$.map(e=>[e.toLowerCase(),e]));function QN(e){var t;return e&&(t=V$.get(e.toLowerCase()))!==null&&t!==void 0?t:"Column"}function G$(){return'<Chart Palette="BrightPastel"><Series><Series ChartType="Column" ChartArea="Default" /></Series><ChartAreas><ChartArea Name="Default" /></ChartAreas><Legends><Legend Name="Default" /></Legends></Chart>'}function z$(e){var t,r;let n=e.entityLogicalName,i=e.series.map((u,c)=>({alias:`agg_${c}`,series:u})),a=e.categories.map((u,c)=>({alias:`grp_${c}`,category:u})),o=i.map(u=>`<attribute alias="${u.alias}" name="${Za(u.series.attribute)}" aggregate="${Za(u.series.aggregate)}" />`).join("")+a.map(u=>`<attribute alias="${u.alias}" name="${Za(u.category.attribute)}" groupby="true"${u.category.dateGrouping?` dategrouping="${Za(u.category.dateGrouping)}"`:""} />`).join(""),s=i.map(u=>`<measure alias="${u.alias}" />`).join(""),l=(r=(t=a[0])===null||t===void 0?void 0:t.alias)!==null&&r!==void 0?r:"";return`<datadefinition><fetchcollection><fetch mapping="logical" aggregate="true"><entity name="${Za(n)}">${o}</entity></fetch></fetchcollection><categorycollection><category alias="${l}"><measurecollection>${s}</measurecollection></category></categorycollection></datadefinition>`}var cl=class{toArtifact(t){var r,n,i,a,o,s,l;(0,Fp.installDomShim)();let u=(r=t.datadescription)!==null&&r!==void 0?r:"",c=(n=t.presentationdescription)!==null&&n!==void 0?n:"",d=(0,wr.parseXmlRoot)(u,"<datadefinition/>"),f=(0,wr.parseXmlRoot)(c,"<Chart/>");return{id:(i=t.savedqueryvisualizationid)!==null&&i!==void 0?i:"",name:(a=t.name)!==null&&a!==void 0?a:"",description:(o=t.description)!==null&&o!==void 0?o:"",entityLogicalName:(s=t.primaryentitytypecode)!==null&&s!==void 0?s:"",chartType:XN(f),isDefault:(l=t.isdefault)!==null&&l!==void 0?l:!1,series:ZN(d),categories:eS(d),presentation:KN(f),dataBag:u?(0,wr.projectElementBag)(d):void 0,presentationBag:c?(0,wr.projectElementBag)(f):void 0,rowBag:W$(t.charttype,t.type)}}fromArtifact(t){(0,Fp.installDomShim)();let{datadescription:r,presentationdescription:n}=j$(t);return{savedqueryvisualizationid:t.id,name:t.name,description:t.description,primaryentitytypecode:t.entityLogicalName,datadescription:r,presentationdescription:n,charttype:jN(t.rowBag,"charttype"),type:jN(t.rowBag,"type"),isdefault:t.isDefault}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t){var r,n,i,a,o,s,l;let u=this.fromArtifact(t);return{name:(r=u.name)!==null&&r!==void 0?r:"",description:(n=u.description)!==null&&n!==void 0?n:"",datadescription:(i=u.datadescription)!==null&&i!==void 0?i:"",presentationdescription:(a=u.presentationdescription)!==null&&a!==void 0?a:"",primaryentitytypecode:(o=u.primaryentitytypecode)!==null&&o!==void 0?o:"",charttype:(s=u.charttype)!==null&&s!==void 0?s:0,isdefault:(l=u.isdefault)!==null&&l!==void 0?l:!1}}createDefault(t){var r,n,i,a,o,s,l;(0,Fp.installDomShim)();let u=(r=t.entityLogicalName)!==null&&r!==void 0?r:"";return{id:(n=t.id)!==null&&n!==void 0?n:(0,q$.newId)(),name:(i=t.name)!==null&&i!==void 0?i:"New Chart",description:(a=t.description)!==null&&a!==void 0?a:"",entityLogicalName:u,chartType:(o=t.chartType)!==null&&o!==void 0?o:"Column",isDefault:(s=t.isDefault)!==null&&s!==void 0?s:!1,series:t.series&&t.series.length>0?t.series:[{attribute:"createdon",aggregate:"count"}],categories:t.categories&&t.categories.length>0?t.categories:[{attribute:"createdon",dateGrouping:"month"}],presentation:(l=t.presentation)!==null&&l!==void 0?l:{palette:"BrightPastel",showLegend:!0}}}assignMissingIds(t){return t}validate(t){let r=[],n=t;return(0,WN.childObjects)(n,"series","","series",r),(0,WN.childObjects)(n,"categories","","category",r),r}};Di.ChartAdapter=cl;function W$(e,t){let r=[];return e!==void 0&&r.push(["charttype",String(e)]),t!==void 0&&r.push(["type",String(t)]),r.length>0?{a:r,c:[]}:void 0}function jN(e,t){if(!e)return;let r=e.a.find(([i])=>i===t);if(!r)return;let n=parseInt(r[1],10);return Number.isNaN(n)?void 0:n}function XN(e){let t=e.getElementsByTagName("Series");for(let r=0;r<t.length;r+=1)if(t[r].getAttribute("ChartType"))return QN(t[r].getAttribute("ChartType"));return"Column"}function KN(e){var t;let r={showLegend:e.getElementsByTagName("Legend").length>0},n=e.getAttribute("Palette");n&&(r.palette=n);let i=e.getElementsByTagName("Title")[0],a=((t=i?.textContent)!==null&&t!==void 0?t:"").trim();return a&&(r.title=a),r}function dl(e){return e.getElementsByTagName("fetch")[0]}function YN(e){var t;let r=new Map;if(!e)return r;let n=e.getElementsByTagName("link-entity");for(let i=0;i<n.length;i+=1){let a=n[i],o=a.getAttribute("name");if(!o)continue;let s=a.getElementsByTagName("attribute");for(let l=0;l<s.length;l+=1){let u=s[l],c=(t=u.getAttribute("alias"))!==null&&t!==void 0?t:u.getAttribute("name");c&&r.set(c,o)}}return r}function ZN(e){let t=dl(e);if(!t)return[];let r=YN(t),n=t.getElementsByTagName("attribute"),i=[];for(let a=0;a<n.length;a+=1){let o=n[a],s=o.getAttribute("aggregate");if(!s)continue;let l=o.getAttribute("name");if(!l)continue;let u={attribute:l,aggregate:s},c=o.getAttribute("charttype");c&&(u.seriesType=QN(c));let d=o.getAttribute("alias");d&&(u.alias=d);let f=d??l,g=r.get(f);g&&(u.relatedEntity=g),i.push(u)}return i}function eS(e){var t;let r=dl(e);if(!r)return[];let n=YN(r),i=r.getElementsByTagName("attribute"),a=[];for(let o=0;o<i.length;o+=1){let s=i[o];if(((t=s.getAttribute("groupby"))!==null&&t!==void 0?t:"").toLowerCase()!=="true")continue;let l=s.getAttribute("name");if(!l)continue;let u={attribute:l},c=s.getAttribute("dategrouping");c&&(u.dateGrouping=c);let d=s.getAttribute("alias");d&&(u.alias=d);let f=d??l,g=n.get(f);g&&(u.relatedEntity=g),a.push(u)}return a}function j$(e){if(!HN(e.dataBag)||!HN(e.presentationBag))return{datadescription:z$(e),presentationdescription:p4(e)};let t=new DOMParser().parseFromString("<root/>","text/xml"),r=JN(e.dataBag,"datadefinition",t),n=JN(e.presentationBag,"Chart",t);return Tp(e.series,ZN(r))||(J$(t,r,e.series),H$(t,n,e.series.length,e.chartType)),Tp(e.categories,eS(r))||Q$(t,r,e.categories),e.chartType!==XN(n)&&nS(n,e.chartType),Tp(e.presentation,KN(n))||iS(n,e.presentation),{datadescription:(0,wr.serializeNode)(r),presentationdescription:(0,wr.serializeNode)(n)}}function HN(e){return!!e&&(e.c.length>0||e.a.length>0)}function H$(e,t,r,n){let i,a=t.childNodes;for(let l=0;l<a.length;l+=1)if(a[l].nodeType===1&&a[l].tagName==="Series"){i=a[l];break}i||(i=e.createElement("Series"),t.insertBefore(i,t.firstChild));let o=[],s=i.childNodes;for(let l=0;l<s.length;l+=1)s[l].nodeType===1&&s[l].tagName==="Series"&&o.push(s[l]);for(let l=o.length;l<r;l+=1){let u=e.createElement("Series");u.setAttribute("ChartType",n),i.appendChild(u)}for(let l=r;l<o.length;l+=1)i.removeChild(o[l])}function JN(e,t,r){let n={n:t,a:(0,Op.mergeAttrs)(e.a,[]),c:(0,Op.spliceChildren)(e.c,[])};return(0,Op.rebuildRaw)(n,(0,wr.domEngine)(r),null)}function J$(e,t,r){let n=dl(t),i=n?.getElementsByTagName("entity")[0];!n||!i||tS(e,t,i,r4(n),r,i4,{aliasPrefix:"aggregate_column",addRef:Y$,removeRef:t4})}function Q$(e,t,r){let n=dl(t),i=n?.getElementsByTagName("entity")[0];!n||!i||tS(e,t,i,n4(n),r,a4,{aliasPrefix:"groupby_column",addRef:Z$,removeRef:e4})}function tS(e,t,r,n,i,a,o){let s=new Map;for(let f of n){let g=f.getAttribute("alias");g&&s.set(g,f)}let l=new Set,u=[];for(let f of i){let g=f.alias?s.get(f.alias):void 0;g&&!l.has(g)?(a(g,f),l.add(g)):u.push(f)}let c=n.filter(f=>!l.has(f)),d=0;for(let f of u)if(d<c.length){let g=c[d];a(g,f),l.add(g),d+=1}else{let g=e.createElement("attribute"),b=f.alias||K$(t,o.aliasPrefix);g.setAttribute("alias",b),a(g,f),o4(e,r,g,f.relatedEntity),o.addRef(e,t,b)}for(let f of n)if(!l.has(f)){let g=f.getAttribute("alias");g&&o.removeRef(t,g),l4(f)}}function X$(e){let t=new Set;for(let r of["attribute","measure","category"]){let n=e.getElementsByTagName(r);for(let i=0;i<n.length;i+=1){let a=n[i].getAttribute("alias");a&&t.add(a)}}return t}function K$(e,t){let r=X$(e);if(!r.has(t))return t;for(let n=2;;n+=1){let i=`${t}_${n}`;if(!r.has(i))return i}}function rS(e,t){let r=t.getElementsByTagName("categorycollection")[0];if(r)return r;let n=e.createElement("categorycollection");return t.appendChild(n),n}function Y$(e,t,r){let n=rS(e,t),i=n.getElementsByTagName("category")[0];i||(i=e.createElement("category"),n.appendChild(i));let a=e.createElement("measurecollection"),o=e.createElement("measure");o.setAttribute("alias",r),a.appendChild(o),i.appendChild(a)}function Z$(e,t,r){let n=rS(e,t),i=e.createElement("category");i.setAttribute("alias",r),n.appendChild(i)}function e4(e,t){let r=e.getElementsByTagName("category");for(let n=0;n<r.length;n+=1)r[n].getAttribute("alias")===t&&r[n].removeAttribute("alias")}function t4(e,t){var r;let n=e.getElementsByTagName("measure"),i=[];for(let a=0;a<n.length;a+=1)n[a].getAttribute("alias")===t&&i.push(n[a]);for(let a of i){let o=a.parentNode;o?.removeChild(a),o&&o.tagName==="measurecollection"&&!c4(o)&&((r=o.parentNode)===null||r===void 0||r.removeChild(o))}}function r4(e){let t=[],r=e.getElementsByTagName("attribute");for(let n=0;n<r.length;n+=1)r[n].getAttribute("aggregate")&&t.push(r[n]);return t}function n4(e){var t;let r=[],n=e.getElementsByTagName("attribute");for(let i=0;i<n.length;i+=1)((t=n[i].getAttribute("groupby"))!==null&&t!==void 0?t:"").toLowerCase()==="true"&&r.push(n[i]);return r}function i4(e,t){e.setAttribute("name",t.attribute),e.setAttribute("aggregate",t.aggregate),t.seriesType&&e.setAttribute("charttype",t.seriesType)}function a4(e,t){e.setAttribute("name",t.attribute),e.setAttribute("groupby","true"),t.dateGrouping?e.setAttribute("dategrouping",t.dateGrouping):e.getAttribute("dategrouping")!==null&&e.removeAttribute("dategrouping")}function o4(e,t,r,n){n?s4(e,t,n).appendChild(r):t.appendChild(r)}function s4(e,t,r){let n=t.getElementsByTagName("link-entity");for(let a=0;a<n.length;a+=1)if(n[a].getAttribute("name")===r)return n[a];let i=e.createElement("link-entity");return i.setAttribute("name",r),t.appendChild(i),i}function l4(e){let t=e.parentNode;if(t&&(t.removeChild(e),t.tagName==="link-entity"&&!u4(t))){let r=t.parentNode;r&&r.removeChild(t)}}function u4(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r];if(n.nodeType===1){let i=n.tagName;if(i==="attribute"||i==="link-entity")return!0}}return!1}function c4(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1)if(t[r].nodeType===1)return!0;return!1}function nS(e,t){let r=e.getElementsByTagName("Series"),n=!1;for(let i=0;i<r.length;i+=1)r[i].getAttribute("ChartType")&&(r[i].setAttribute("ChartType",t),n=!0);if(!n){for(let i=0;i<r.length;i+=1)if(!d4(r[i])){r[i].setAttribute("ChartType",t);return}}}function d4(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r];if(n.nodeType===1&&n.tagName==="Series")return!0}return!1}function iS(e,t){var r;let n=e.ownerDocument;if(t.palette!==void 0&&e.setAttribute("Palette",t.palette),t.showLegend!==void 0){let i=[],a=e.getElementsByTagName("Legends");for(let o=0;o<a.length;o+=1)i.push(a[o]);if(t.showLegend&&i.length===0){let o=n.createElement("Legends"),s=n.createElement("Legend");s.setAttribute("Name","Default"),o.appendChild(s),e.appendChild(o)}else if(!t.showLegend)for(let o of i)(r=o.parentNode)===null||r===void 0||r.removeChild(o)}if(t.title!==void 0){let i=e.getElementsByTagName("Title")[0];i&&(i.textContent=t.title)}}function p4(e){let t=(0,wr.parseXmlRoot)(G$(),"<Chart/>");return nS(t,e.chartType),iS(t,e.presentation),(0,wr.serializeNode)(t)}function Tp(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Za(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function f4(){return{adapter:new cl,api:k$.chartApi}}Di.chartRegistration=f4});var oS=m(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.dashboardApi=void 0;var Nr=$e(),eo=ue(),m4="formid,name,description,formxml,type,objecttypecode,istabletenabled,iscustomizable,componentstate,versionnumber",h4="formid,name,type,objecttypecode",g4=0,v4=10;pl.dashboardApi={async get(e,t){let n=`/systemforms(${(0,eo.normalizeGuid)(t,"id")})${(0,eo.odataQuery)([["$select",m4]])}`,i=(0,Nr.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,Nr.readEtag)(i)}},async list(e,t){var r;let n=[`(type eq ${g4} or type eq ${v4})`];t?.entityLogicalName&&n.push(`objecttypecode eq '${(0,eo.odataLiteral)(t.entityLogicalName)}'`);let i=`/systemforms${(0,eo.odataQuery)([["$select",h4],["$filter",n.join(" and ")]])}`,o=(0,Nr.ensureSuccess)(await e.get(i),e.apiUrl(i)).body;return((r=o?.value)!==null&&r!==void 0?r:[]).map(l=>{var u,c;return{type:"dashboard",id:(u=l.formid)!==null&&u!==void 0?u:"",name:(c=l.name)!==null&&c!==void 0?c:"",entityLogicalName:l.objecttypecode,isDirty:!1}})},async create(e,t){let r=t,n="/systemforms",i={name:r.name,description:r.description,formxml:r.formxml,istabletenabled:r.istabletenabled,type:r.type};r.objecttypecode&&(i.objecttypecode=r.objecttypecode);let a=(0,Nr.ensureSuccess)(await e.post(n,i),e.apiUrl(n));return{id:(0,Nr.requireCreatedId)(a,"formid","dashboard"),etag:(0,Nr.readEtag)(a)}},async update(e,t,r,n){let i=r,a=(0,eo.normalizeGuid)(t,"id"),o=`/systemforms(${a})`,s=n?{"If-Match":n}:void 0,l=(0,Nr.ensureSuccess)(await e.patch(o,{name:i.name,description:i.description,formxml:i.formxml,istabletenabled:i.istabletenabled},s?{headers:s}:void 0),e.apiUrl(o));return{id:a,etag:(0,Nr.readEtag)(l)}},delete(e,t){return(0,Nr.deleteRecord)(e,"systemforms",t)}}});var vS=m(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.dashboardRegistration=er.TILE_CLASS_ID=er.DashboardAdapter=void 0;var ro=pn(),It=ja(),to=$r(),b4=oS(),Rp=fn(),Cn=Ft(),pS=ue(),ml=1033,sS="0",xp="10",y4=new Map([["{E7A81278-8635-4D9E-8D4D-59480B391C5B}","chart"],["{FD2A7985-3187-444E-908D-6624B21F69C0}","iframe"],["{9FDF5F91-88B1-47F4-AD53-C11EFC01A01D}","webresource"],["{EE9078C8-6946-4E2C-B8F8-35E65F4BE6A8}","stream"],["{06375649-C143-495E-A496-C962E5B4488E}","timeline"],["{8C54228C-1B25-4909-A12A-F2B968BB0D62}","powerbi"],["{F9A8A302-114E-466A-B582-6771B2AE0D92}","assistant"]]),C4="{3FF9A528-DD50-4ACA-8F10-2E5ED73513AD}",hl=class{toArtifact(t){var r,n,i,a;(0,Rp.installDomShim)();let o=(r=t.formxml)!==null&&r!==void 0?r:"",s=(0,It.parseXmlRoot)(o,"<form/>");return{id:(n=t.formid)!==null&&n!==void 0?n:"",name:(i=t.name)!==null&&i!==void 0?i:"",description:(a=t.description)!==null&&a!==void 0?a:"",dashboardType:A4(t.type),entityLogicalName:t.objecttypecode?t.objecttypecode:null,enabledForMobile:!!t.istabletenabled,layoutType:w4(s),components:lS(s),bag:(0,It.projectElementBag)(s)}}fromArtifact(t){var r;return(0,Rp.installDomShim)(),{formid:t.id,name:t.name,description:t.description,type:t.dashboardType==="Interactive"?xp:sS,objecttypecode:(r=t.entityLogicalName)!==null&&r!==void 0?r:"",istabletenabled:t.enabledForMobile,formxml:uS(t)}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t){return{name:t.name,description:t.description,formxml:uS(t),istabletenabled:t.enabledForMobile,type:t.dashboardType==="Interactive"?xp:sS,objecttypecode:t.entityLogicalName}}createDefault(t){var r,n,i,a,o,s,l,u;(0,Rp.installDomShim)();let c=(0,It.parseXmlRoot)(L4(),"<form/>");return{id:(r=t.id)!==null&&r!==void 0?r:(0,Cn.newId)(),name:(n=t.name)!==null&&n!==void 0?n:"New Dashboard",description:(i=t.description)!==null&&i!==void 0?i:"",dashboardType:(a=t.dashboardType)!==null&&a!==void 0?a:"Standard",entityLogicalName:(o=t.entityLogicalName)!==null&&o!==void 0?o:null,enabledForMobile:(s=t.enabledForMobile)!==null&&s!==void 0?s:!1,layoutType:(l=t.layoutType)!==null&&l!==void 0?l:0,components:(u=t.components)!==null&&u!==void 0?u:lS(c),bag:(0,It.projectElementBag)(c)}}assignMissingIds(t){if(t&&typeof t=="object"&&!Array.isArray(t)&&"position"in t&&!("components"in t)){let r=t;(typeof r.id!="string"||r.id.length===0)&&(r.id=(0,Cn.newId)())}return t}validate(t){let r=[],n=(0,to.childObjects)(t,"components","","component",r),i=new Set;return n.forEach(({node:a,index:o})=>{let s=`/components/${o}`;for(let l of["position","parameters"]){let u=a[l];u!==void 0&&!(0,to.isJsonObject)(u)&&r.push((0,to.issue)(`${s}/${l}`,`component-${l}-must-be-object`,`a component ${l} must be a JSON object when present, got ${u===null?"null":typeof u}`))}if((0,to.isJsonObject)(a.position)){let l=no(a.position);i.has(l)?r.push((0,to.issue)(`${s}/position`,"component-position-collision",`two components occupy the same dashboard position (${l}); move one to a free cell`)):i.add(l)}}),r}};er.DashboardAdapter=hl;function A4(e){return String(e??"")===xp?"Interactive":"Standard"}function w4(e){var t;let r=(t=e?.getAttribute("formLayout"))!==null&&t!==void 0?t:e?.getAttribute("layoutType"),n=parseInt(r??"",10);return Number.isNaN(n)?0:n}function V(e,t){let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];a.nodeType===1&&a.tagName.toLowerCase()===t&&r.push(a)}return r}function lS(e){let t=[];return V(e,"tabs").flatMap(n=>V(n,"tab")).forEach((n,i)=>{V(n,"columns").flatMap(o=>V(o,"column")).forEach((o,s)=>{V(o,"sections").flatMap(u=>V(u,"section")).forEach((u,c)=>{N4(u,{tabIndex:i,columnIndex:s,sectionIndex:c},t)})})}),t}function N4(e,t,r){V(e,"rows").flatMap(i=>V(i,"row")).forEach((i,a)=>{V(i,"cell").forEach((o,s)=>{let l=S4(o,{...t,rowIndex:a,cellIndex:s});l&&r.push(l)})})}function S4(e,t){var r,n,i;let a=hS((r=e.getAttribute("id"))!==null&&r!==void 0?r:"");if(a.toLowerCase().startsWith("spacer"))return null;let o=V(e,"control")[0];if(!o)return null;let s=(n=o.getAttribute("classid"))!==null&&n!==void 0?n:"",l=I4(o),u=_4(s,l,o),c=D4(o);return{id:(i=o.getAttribute("id"))!==null&&i!==void 0?i:a,type:u,name:mS(e),classId:s,position:t,colspan:Lp(e,"colspan",1),rowspan:Lp(e,"rowspan",1),parameters:l,bag:(0,It.projectElementBag)(e),...c?{icProperties:c}:{}}}function fS(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r];if(n.nodeType===1&&n.tagName.toLowerCase()==="icproperties")return n}}function D4(e){let t=fS(e);return t?(0,It.serializeNode)(t):void 0}function E4(e,t,r){let n=fS(t);if(!r){n&&t.removeChild(n);return}let i=new DOMParser().parseFromString(r,"text/xml").documentElement,a=(0,ro.rebuildRaw)((0,ro.rawFromNode)((0,It.nodeLikeFromDom)(i)),(0,It.domEngine)(e),null);n&&(0,It.serializeNode)(n)===(0,It.serializeNode)(a)||(n?t.replaceChild(a,n):t.appendChild(a))}function mS(e){var t,r;let n=V(e,"labels")[0];if(!n)return"";let i=V(n,"label"),a=(t=i.find(o=>o.getAttribute("languagecode")===String(ml)))!==null&&t!==void 0?t:i[0];return(r=a?.getAttribute("description"))!==null&&r!==void 0?r:""}function I4(e){var t;let r={},n=V(e,"parameters")[0];if(!n)return r;let i=n.childNodes;for(let a=0;a<i.length;a+=1){let o=i[a];o.nodeType===1&&(r[o.tagName]=((t=o.textContent)!==null&&t!==void 0?t:"").trim())}return r}function _4(e,t,r){var n;let i=y4.get(e.toUpperCase());return i?i==="chart"?t.ChartGridMode==="Chart"?"chart":"list":i==="assistant"&&((n=r.getAttribute("uniqueid"))!==null&&n!==void 0?n:"").toUpperCase()===C4?"assistant":i:"unknown"}function Lp(e,t,r){var n;let i=parseInt((n=e.getAttribute(t))!==null&&n!==void 0?n:"",10);return Number.isNaN(i)?r:i}function hS(e){return e.replace(/^\{/,"").replace(/\}$/,"")}function P4(e,t){let r={n:"form",a:(0,ro.mergeAttrs)(e.bag.a,[]),c:(0,ro.spliceChildren)(e.bag.c,[])};return(0,ro.rebuildRaw)(r,(0,It.domEngine)(t),null)}function uS(e){let t=new DOMParser().parseFromString("<root/>","text/xml"),r=P4(e,t);return T4(t,r,e.components),O4(t,r,e.components),(0,It.serializeNode)(r)}function O4(e,t,r){let n=gS(t);for(let i of r)n.has(no(i.position))||F4(e,t,i)}function F4(e,t,r){var n,i,a,o;let s=(i=(n=r.position)===null||n===void 0?void 0:n.sectionIndex)!==null&&i!==void 0?i:0,l=M4(t,e,s);for(let $ of V(l,"row"))V($,"cell").some(re=>V(re,"control").length>0)||l.removeChild($);let u=r.classId||er.TILE_CLASS_ID[r.type]||er.TILE_CLASS_ID.iframe,c=r.rowspan&&r.rowspan>0?r.rowspan:4,d=r.bag&&cS(r.bag,"id")?String(cS(r.bag,"id")):fl((0,Cn.newId)()),f=r.id?fl(r.id):fl((0,Cn.newId)()),g=l.parentNode,b=Math.max(1,parseInt(g&&g.getAttribute&&g.getAttribute("columns")||"1",10)||1),w=Math.min(Math.max(1,r.colspan&&r.colspan>0?r.colspan:1),b),N=V(l,"row"),_=N[N.length-1],T=_?V(_,"cell").reduce(($,re)=>$+Lp(re,"colspan",1),0):0;(!_||T+w>b)&&(_=e.createElement("row"),l.appendChild(_));let R=e.createElement("cell");R.setAttribute("id",d),R.setAttribute("colspan",String(w)),R.setAttribute("rowspan",String(c)),R.setAttribute("showlabel","true");let M=e.createElement("labels"),W=e.createElement("label");W.setAttribute("description",(a=r.name)!==null&&a!==void 0?a:""),W.setAttribute("languagecode",String(ml)),M.appendChild(W),R.appendChild(M);let B=e.createElement("control");B.setAttribute("id",f),B.setAttribute("classid",fl(u));let j=e.createElement("parameters"),k=(o=r.parameters)!==null&&o!==void 0?o:{};for(let $ of Object.keys(k)){let re=(0,pS.createSafeXmlElement)(e,$,"dashboard tile parameter");re.textContent=k[$],j.appendChild(re)}B.appendChild(j),R.appendChild(B),_.appendChild(R)}function cS(e,t){if(!e)return;let r=e.a.find(n=>n[0]===t);return r?r[1]:void 0}function T4(e,t,r){var n;let i=gS(t),a=new Set(r.map(o=>no(o.position)));for(let o of r){let s=i.get(no(o.position));if(!s)continue;let l=V(s,"control")[0];l&&(R4(e,s,o.name),x4(e,l,o.parameters),dS(s,"colspan",o.colspan),dS(s,"rowspan",o.rowspan),o.icProperties!==void 0&&E4(e,l,o.icProperties))}for(let[o,s]of i)a.has(o)||(n=s.parentNode)===null||n===void 0||n.removeChild(s)}function gS(e){let t=new Map;return V(e,"tabs").flatMap(n=>V(n,"tab")).forEach((n,i)=>{V(n,"columns").flatMap(o=>V(o,"column")).forEach((o,s)=>{V(o,"sections").flatMap(u=>V(u,"section")).forEach((u,c)=>{V(u,"rows").flatMap(f=>V(f,"row")).forEach((f,g)=>{V(f,"cell").forEach((b,w)=>{var N;hS((N=b.getAttribute("id"))!==null&&N!==void 0?N:"").toLowerCase().startsWith("spacer")||V(b,"control")[0]&&t.set(no({tabIndex:i,columnIndex:s,sectionIndex:c,rowIndex:g,cellIndex:w}),b)})})})})}),t}function no(e){let t=e??{};return`${t.tabIndex}.${t.columnIndex}.${t.sectionIndex}.${t.rowIndex}.${t.cellIndex}`}function R4(e,t,r){if(r===mS(t))return;let n=V(t,"labels")[0];n||(n=e.createElement("labels"),t.appendChild(n));let i=V(n,"label").find(a=>a.getAttribute("languagecode")===String(ml));i||(i=V(n,"label")[0]),i||(i=e.createElement("label"),i.setAttribute("languagecode",String(ml)),n.appendChild(i)),i.setAttribute("description",r)}function x4(e,t,r){var n;if(!r)return;let i=Object.keys(r);if(i.length===0)return;let a=V(t,"parameters")[0];a||(a=e.createElement("parameters"),t.appendChild(a));let o=new Map,s=a.childNodes;for(let l=0;l<s.length;l+=1){let u=s[l];u.nodeType===1&&o.set(u.tagName,u)}for(let l of i){let u=r[l],c=o.get(l);if(c)((n=c.textContent)!==null&&n!==void 0?n:"")!==u&&(c.textContent=u);else{let d=(0,pS.createSafeXmlElement)(e,l,"dashboard component parameter");d.textContent=u,a.appendChild(d)}}}function dS(e,t,r){var n;((n=e.getAttribute(t))!==null&&n!==void 0?n:"")!==String(r)&&e.setAttribute(t,String(r))}function L4(e=2){let t=`{${(0,Cn.newId)()}}`,r=`{${(0,Cn.newId)()}}`,n=`{${(0,Cn.newId)()}}`,i=Math.max(1,Math.floor(e));return`<form><tabs><tab id="${t}" name="General" showlabel="true" expanded="true" verticallayout="true"><columns><column width="100%"><sections><section id="${r}" name="Section 1" showlabel="false" columns="${i}"><rows><row><cell id="${n}" rowspan="12" colspan="${i}" showlabel="true" /></row></rows></section></sections></column></columns></tab></tabs></form>`}er.TILE_CLASS_ID={chart:"E7A81278-8635-4D9E-8D4D-59480B391C5B",list:"E7A81278-8635-4D9E-8D4D-59480B391C5B",iframe:"FD2A7985-3187-444E-908D-6624B21F69C0",webresource:"9FDF5F91-88B1-47F4-AD53-C11EFC01A01D"};function fl(e){return`{${e.replace(/[{}]/g,"")}}`}function M4(e,t,r){var n;let i=V(e,"tabs").flatMap(u=>V(u,"tab"))[0];if(!i)throw new Error("addDashboardTile: dashboard formxml has no <tab>");let a=V(i,"columns").flatMap(u=>V(u,"column"))[0];if(!a)throw new Error("addDashboardTile: dashboard formxml has no <column>");let o=V(a,"sections").flatMap(u=>V(u,"section")),s=(n=o[r])!==null&&n!==void 0?n:o[0];if(!s)throw new Error("addDashboardTile: dashboard formxml has no <section>");let l=V(s,"rows")[0];return l||(l=t.createElement("rows"),s.appendChild(l)),l}function U4(){return{adapter:new hl,api:b4.dashboardApi}}er.dashboardRegistration=U4});var bS=m(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.buildRegistrations=void 0;var B4=f2(),k4=O2(),q4=yN(),$4=EN(),V4=GN(),G4=aS(),z4=vS();function W4(){let e=new Map;return e.set("form",(0,B4.formRegistration)()),e.set("view",(0,k4.viewRegistration)()),e.set("businessRule",(0,q4.businessRuleRegistration)()),e.set("app",(0,$4.appRegistration)()),e.set("command",(0,V4.commandRegistration)()),e.set("chart",(0,G4.chartRegistration)()),e.set("dashboard",(0,z4.dashboardRegistration)()),e}gl.buildRegistrations=W4});var yS=m(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.cloneJson=void 0;function j4(e){return JSON.parse(JSON.stringify(e))}vl.cloneJson=j4});var IS=m(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.removeRowSummary=Ae.configureRowSummary=Ae.buildGptDynamicPrompt=Ae.setAppAiFeatures=Ae.getAiReadiness=Ae.saveSettingValue=Ae.retrieveSetting=Ae.AI_GATE=void 0;var Ut=$e(),Me=ue(),CS=Ft(),Sr=be();Ae.AI_GATE={formFill:"FormFillBarUXEnabled",nlSearch:"EnableNLGridSearch",nlChart:"NLChartVisualizationSetting",summaries:"EnableFormInsights",m365:"m365copilotmodelappenabled"};var H4={formFill:"FormFillBarUXEnabled",nlSearch:"NLGridSearchSetting",nlChart:"NLChartDataVisualizationSetting",m365:"m365copilotmodelappenabled"},bl=1e6;function J4(e,t){let r=()=>{throw new Sr.InvalidArgumentError(`setAppAiFeatures: '${t}' must be a boolean or an integer between 0 and ${bl} (e.g. 0, 1, 2); got '${String(e)}'.`)};if(typeof e=="boolean")return e?"1":"0";if(typeof e=="number")return!Number.isSafeInteger(e)||e<0||e>bl?r():String(e);if(typeof e=="string"){let n=e.trim(),i=n.toLowerCase();if(i==="true")return"1";if(i==="false")return"0";if(/^[0-9]+$/.test(n)){let a=n.replace(/^0+(?=[0-9])/,"");return a.length>String(bl).length||Number(a)>bl?r():a}}return r()}function Q4(e){return e!=="0"}async function X4(e,t){var r,n,i;let a=`/appmodules${(0,Me.odataQuery)([["$select","appmoduleid"],["$filter",`uniquename eq '${(0,Me.odataLiteral)(t)}'`]])}`,o=await e.get(a);return o.status>=200&&o.status<300?(i=((n=(r=o.body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0])===null||i===void 0?void 0:i.appmoduleid:void 0}async function K4(e,t){var r,n;let i=`/appmodules${(0,Me.odataQuery)([["$select","appmoduleid"],["$filter",`uniquename eq '${(0,Me.odataLiteral)(t)}'`]])}`,a;try{a=await e.get(i)}catch(l){throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup failed (${l.message}). Retry, or omit appModuleId to verify by name.`)}if(a.status<200||a.status>=300)throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup returned HTTP ${a.status}. Retry, or omit appModuleId to verify by name.`);let o=(r=a.body)===null||r===void 0?void 0:r.value;if(!Array.isArray(o))throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup returned a malformed body.`);if(o.length===0)return;let s=(n=o[0])===null||n===void 0?void 0:n.appmoduleid;if(!s)throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup returned a row with no appmoduleid.`);return s}var AS=new WeakMap;async function Y4(e,t){var r,n,i;let a=AS.get(e);if(a||(a=new Map,AS.set(e,a)),a.has(t))return a.get(t);let o=`/settingdefinitions${(0,Me.odataQuery)([["$select","settingdefinitionid"],["$filter",`uniquename eq '${(0,Me.odataLiteral)(t)}'`]])}`,s=await e.get(o),l=s.status>=200&&s.status<300?(i=((n=(r=s.body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0])===null||i===void 0?void 0:i.settingdefinitionid:void 0;return l&&a.set(t,l),l}async function Z4(e,t,r){var n,i;let a=await Y4(e,r);if(!t||!a)return;let o=`/appsettings${(0,Me.odataQuery)([["$select","value"],["$filter",`_parentappmoduleid_value eq ${t} and _settingdefinitionid_value eq ${a}`]])}`,s=await e.get(o);if(s.status<200||s.status>=300)return;let l=(i=(n=s.body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[];return l.length>0?{exists:!0,value:l[0].value}:{exists:!1}}var e5=4,t5=500,wS=20,NS=3e4;function r5(e){if(e===void 0)return e5;if(!Number.isFinite(e))throw new Sr.InvalidArgumentError(`setAppAiFeatures: verifyAttempts must be a finite integer between 1 and ${wS}; got ${e}.`);return Math.min(wS,Math.max(1,Math.floor(e)))}function n5(e){if(e===void 0)return t5;if(!Number.isFinite(e))throw new Sr.InvalidArgumentError(`setAppAiFeatures: verifyDelayMs must be a finite number between 0 and ${NS}; got ${e}.`);return Math.min(NS,Math.max(0,Math.floor(e)))}function i5(e){return e>0?new Promise(t=>setTimeout(t,e)):Promise.resolve()}async function a5(e,t,r,n,i,a,o){let s,l,u,c=!1;for(let d=0;d<a;d+=1){d>0&&await i5(o*d);let f;try{let g=await t();g?(f=await Z4(e,g,n),f===void 0&&(u="the app-scope override row could not be read (insufficient access or unresolvable ids)")):u=`the app '${r}' could not be resolved to an appmoduleid \u2014 a newly created app is not readable until it is published, so either publish it first or pass \`appModuleId\` in the options to verify without the lookup`}catch(g){f=void 0,u=g.message}c=f!==void 0,l=f?.exists;try{s=(await yl(e,n,{appUniqueName:r})).value}catch{}if(f?.exists&&f.value===i)return{result:"proven",effectiveValue:f.value,appOverrideExists:!0}}return c?{result:"absent",effectiveValue:s,appOverrideExists:l}:{result:"unverifiable",effectiveValue:s,appOverrideExists:void 0,reason:u}}function SS(e,t){return t===2?String(e).toLowerCase()==="true":e!=null&&e!=="0"&&e!==""}async function yl(e,t,r={}){var n,i;let a=[`SettingName='${(0,Me.odataPathLiteral)(t)}'`];r.appUniqueName&&a.push(`AppUniqueName='${(0,Me.odataPathLiteral)(r.appUniqueName)}'`);let o=`/RetrieveSetting(${a.join(",")})`,l=(i=(n=(0,Ut.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||n===void 0?void 0:n.SettingDetail)!==null&&i!==void 0?i:{};return{value:l.Value,dataType:l.DataType}}Ae.retrieveSetting=yl;async function DS(e,t,r,n={}){let i={SettingName:t,Value:r};n.appUniqueName&&(i.AppUniqueName=n.appUniqueName),n.solutionUniqueName&&(i.SolutionUniqueName=n.solutionUniqueName),(0,Ut.ensureSuccess)(await e.post("/SaveSettingValue",i),e.apiUrl("/SaveSettingValue"))}Ae.saveSettingValue=DS;async function o5(e,t={}){let r={};for(let[n,i]of Object.entries(Ae.AI_GATE)){let{value:a,dataType:o}=await yl(e,i,t);r[n]={enabled:SS(a,o),setting:i,value:a}}return r}Ae.getAiReadiness=o5;async function s5(e,t,r,n={}){var i,a,o;if(!t||!t.trim())throw new Sr.InvalidArgumentError("setAppAiFeatures: a non-empty appUniqueName is required (an empty value would write the setting at organization scope, affecting every app).");let s=r5(n.verifyAttempts),l=n5(n.verifyDelayMs),u=[];for(let[N,_]of Object.entries(r)){if(_===void 0)continue;let T=H4[N];T&&u.push({feature:N,setting:T,requestedValue:J4(_,N)})}let c=[],d=n.appModuleId?(0,Me.normalizeGuid)(n.appModuleId,"appModuleId"):void 0;if(d){let N=await K4(e,t);if(N&&(0,Me.normalizeGuid)(N,"appModuleId")!==d)throw new Sr.InvalidArgumentError(`setAppAiFeatures: appModuleId '${d}' does not belong to app '${t}' (which resolves to '${N}'). Settings are written by unique name, so verifying against a different app would report success for a write that never landed.`)}let f,g=async()=>d||(f||(f=await X4(e,t)),f),b=new Map,w=async N=>{let _=Ae.AI_GATE[N];if(_){if(!b.has(_)){let{value:T,dataType:R}=await yl(e,_);b.set(_,{enabled:SS(T,R),setting:_,value:T})}return b.get(_)}};for(let{feature:N,setting:_,requestedValue:T}of u)try{if(Q4(T)){let W=await w(N);if(!W?.enabled){c.push({feature:N,setting:_,requestedValue:T,status:"skipped",reason:`the org readiness gate '${(i=W?.setting)!==null&&i!==void 0?i:N}' is off, so the feature cannot be enabled for this app`});continue}}await DS(e,_,T,{appUniqueName:t,solutionUniqueName:n.solutionUniqueName});let R=await a5(e,g,t,_,T,s,l),M={feature:N,setting:_,requestedValue:T,effectiveValue:R.effectiveValue,appOverrideExists:R.appOverrideExists};R.result==="proven"?c.push({...M,status:"applied"}):R.result==="absent"?c.push({...M,status:"notPersisted",reason:`the write reported success but no app-scope override holding '${T}' was observed for '${_}' after ${s} attempt(s) \u2014 it reads '${(a=R.effectiveValue)!==null&&a!==void 0?a:""}' for this app (Dataverse can accept an app-scope write without storing it)`}):c.push({...M,status:"unverified",reason:`the write was issued but could not be confirmed: ${(o=R.reason)!==null&&o!==void 0?o:"the app-scope override row could not be read"}. The value may or may not be in force \u2014 verify manually before relying on it.`})}catch(R){c.push({feature:N,setting:_,requestedValue:T,status:"failed",reason:R.message})}return{applied:c.filter(N=>N.status==="applied").map(N=>N.feature),skipped:c.filter(N=>N.status==="skipped").map(N=>N.feature),notPersisted:c.filter(N=>N.status==="notPersisted").map(N=>N.feature),unverified:c.filter(N=>N.status==="unverified").map(N=>N.feature),failed:c.filter(N=>N.status==="failed").map(N=>N.feature),outcomes:c}}Ae.setAppAiFeatures=s5;var l5="GptPowerPrompt",u5='{ "consumptionSource": "Api", "partnerSource": "AIBuilder", "consumptionSourceVersion": "GptApiClient"}';function ES(e){var t,r,n,i;let a=e.entityLogicalName,o=[{type:"literal",text:e.instruction.replace(/\s*$/,"")+" "}];return e.columns.forEach((s,l)=>{o.push({type:"data",id:`${a}.${s.logical}`,text:s.display}),l<e.columns.length-1&&o.push({type:"literal",text:", "})}),{version:"GptDynamicPrompt-2",prompt:o,definitions:{inputs:[{id:"RecordId",text:"RecordId",type:"text"},{id:"LanguageCode",text:"LanguageCode",type:"text"}],formulas:[],data:[{id:a,displayName:a,type:"dataverseTable",filters:[{filterType:"equal",attribute:e.primaryKey,valueType:"inputVariable",value:"RecordId"}]}],output:{formats:[(t=e.outputFormat)!==null&&t!==void 0?t:"text"]}},modelParameters:{modelType:"default",gptParameters:{temperature:(r=e.temperature)!==null&&r!==void 0?r:0}},settings:{recordRetrievalLimit:(n=e.recordRetrievalLimit)!==null&&n!==void 0?n:30,shouldPreserveRecordLinks:null,runtime:null,enableReasoning:(i=e.enableReasoning)!==null&&i!==void 0?i:!0},code:"",signature:""}}Ae.buildGptDynamicPrompt=ES;async function c5(e,t){var r,n;let i=`/EntityDefinitions(LogicalName='${(0,Me.odataPathLiteral)(t)}')${(0,Me.odataQuery)([["$select","MetadataId"]])}`;return(n=(r=(0,Ut.ensureSuccess)(await e.get(i),e.apiUrl(i)).body)===null||r===void 0?void 0:r.MetadataId)!==null&&n!==void 0?n:""}async function d5(e,t,r={}){var n,i,a,o,s;let l=`ais_RowSummary_${t.entityLogicalName}`,u=`/aiskillconfigs${(0,Me.odataQuery)([["$select","aiskillconfigid,_aimodel_value"],["$filter",`uniquename eq '${(0,Me.odataLiteral)(l)}'`],["$top",1]])}`,c=((i=(n=(0,Ut.ensureSuccess)(await e.get(u),e.apiUrl(u)).body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[])[0];if(c)return{modelId:c._aimodel_value,aiSkillConfigId:c.aiskillconfigid};let d=`/msdyn_aitemplates${(0,Me.odataQuery)([["$select","msdyn_aitemplateid"],["$filter",`msdyn_uniquename eq '${l5}'`],["$top",1]])}`,f=((s=(o=(a=(0,Ut.ensureSuccess)(await e.get(d),e.apiUrl(d)).body)===null||a===void 0?void 0:a.value)===null||o===void 0?void 0:o[0])!==null&&s!==void 0?s:{}).msdyn_aitemplateid,g=(0,CS.newId)(),b=(0,CS.newId)(),w=JSON.stringify(ES(t)),N={ModelId:g,RunConfigurationId:b,ModelName:`${t.entityLogicalName} row summary`,TemplateId:f,CustomConfiguration:w,Source:u5,RunConfiguration:""};(0,Ut.ensureSuccess)(await e.post("/AIModelPublish",N),e.apiUrl("/AIModelPublish"));try{let _=await c5(e,t.entityLogicalName),T={uniquename:l,description:`${t.entityLogicalName} row summary`,"[email protected]":`/entities(${_})`,"[email protected]":`/msdyn_aimodels(${g})`,aiskill:"RowSummary"},R=(0,Ut.ensureSuccess)(await e.post("/aiskillconfigs",T),e.apiUrl("/aiskillconfigs")),M=(0,Ut.requireCreatedId)(R,"aiskillconfigid","row-summary skill");return{modelId:g,aiSkillConfigId:M}}catch(_){try{await e.delete(`/msdyn_aimodels(${g})`)}catch{}throw _}}Ae.configureRowSummary=d5;async function p5(e,t){var r,n;let i=`ais_RowSummary_${t.entityLogicalName}`,a=`/aiskillconfigs${(0,Me.odataQuery)([["$select","aiskillconfigid,_aimodel_value"],["$filter",`uniquename eq '${(0,Me.odataLiteral)(i)}'`],["$top",1]])}`,o=((n=(r=(0,Ut.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0];if(!o)return;let s=`/aiskillconfigs(${o.aiskillconfigid})`;if((0,Ut.ensureSuccess)(await e.delete(s),e.apiUrl(s)),o._aimodel_value){let l=`/msdyn_aimodels(${o._aimodel_value})`;(0,Ut.ensureSuccess)(await e.delete(l),e.apiUrl(l))}}Ae.removeRowSummary=p5});var _S=m(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.findArtifact=Ei.resolveArtifact=void 0;var Ye=ue(),tr=Bi(),f5=be();async function m5(e,t,r){var n,i,a,o,s,l,u,c,d,f,g;switch(t){case"app":{let b=await(0,tr.queryRecords)(e,"appmodule",{select:["appmoduleid","name","appmoduleidunique"],filter:`uniquename eq '${(0,Ye.odataLiteral)((n=r.uniqueName)!==null&&n!==void 0?n:"")}'`,top:1}),w=b&&b[0];return w?[{id:String(w.appmoduleid),name:String(w.name),appModuleIdUnique:String(w.appmoduleidunique)}]:[]}case"dashboard":return(await(0,tr.queryRecords)(e,"systemform",{select:["formid","name"],filter:`name eq '${(0,Ye.odataLiteral)((i=r.name)!==null&&i!==void 0?i:"")}' and type eq 0`,top:10})||[]).map(w=>({id:String(w.formid),name:String(w.name)}));case"command":{let b=await(0,tr.queryRecords)(e,"appaction",{select:["appactionid","buttonlabeltext"],filter:`contextvalue eq '${(0,Ye.odataLiteral)((a=r.entity)!==null&&a!==void 0?a:"")}'`,top:1});return b&&b.length?[{id:String(r.entity),entity:String(r.entity)}]:[]}case"form":return(await(0,tr.queryRecords)(e,"systemform",{select:["formid","name"],filter:`name eq '${(0,Ye.odataLiteral)((o=r.name)!==null&&o!==void 0?o:"")}' and objecttypecode eq '${(0,Ye.odataLiteral)((s=r.entity)!==null&&s!==void 0?s:"")}'`,top:10})||[]).map(w=>({id:String(w.formid),name:String(w.name)}));case"chart":return(await(0,tr.queryRecords)(e,"savedqueryvisualization",{select:["savedqueryvisualizationid","name"],filter:`name eq '${(0,Ye.odataLiteral)((l=r.name)!==null&&l!==void 0?l:"")}' and primaryentitytypecode eq '${(0,Ye.odataLiteral)((u=r.entity)!==null&&u!==void 0?u:"")}'`,top:10})||[]).map(w=>({id:String(w.savedqueryvisualizationid),name:String(w.name)}));case"view":return(await(0,tr.queryRecords)(e,"savedquery",{select:["savedqueryid","name"],filter:`name eq '${(0,Ye.odataLiteral)((c=r.name)!==null&&c!==void 0?c:"")}' and returnedtypecode eq '${(0,Ye.odataLiteral)((d=r.entity)!==null&&d!==void 0?d:"")}'`,top:10})||[]).map(w=>({id:String(w.savedqueryid),name:String(w.name)}));case"webResource":return(await(0,tr.queryRecords)(e,"webresource",{select:["webresourceid","name"],filter:`name eq '${(0,Ye.odataLiteral)((f=r.name)!==null&&f!==void 0?f:"")}'`,top:1})||[]).map(w=>({id:String(w.webresourceid),name:String(w.name)}));case"solution":return(await(0,tr.queryRecords)(e,"solution",{select:["solutionid","uniquename"],filter:`uniquename eq '${(0,Ye.odataLiteral)((g=r.uniqueName)!==null&&g!==void 0?g:"")}'`,top:1})||[]).map(w=>({id:String(w.solutionid),name:String(w.uniquename)}));default:return[]}}Ei.resolveArtifact=m5;async function h5(e,t,r){var n,i,a,o,s;let l=(0,Ye.odataLiteral)((n=r.name)!==null&&n!==void 0?n:""),u=(0,Ye.odataLiteral)((i=r.entity)!==null&&i!==void 0?i:"");if(t==="command"){let b=await(0,tr.queryRecords)(e,"appaction",{select:["appactionid"],filter:`contextvalue eq '${(0,Ye.odataLiteral)((a=r.entity)!==null&&a!==void 0?a:"")}'`,top:1});return b&&b.length?String(r.entity):null}let c=g5(t,l,u,r),d=t!=="app",f=await(0,tr.queryRecords)(e,c.set,{select:[c.idField],filter:c.filter,top:d?2:1});if(d&&f&&f.length>1)throw new f5.AmbiguousArtifactError(t,(s=(o=r.name)!==null&&o!==void 0?o:r.uniqueName)!==null&&s!==void 0?s:"",f.length);let g=f&&f[0]&&f[0][c.idField];return g!=null?String(g):null}Ei.findArtifact=h5;function g5(e,t,r,n){var i;switch(e){case"view":return{set:"savedquery",idField:"savedqueryid",filter:`returnedtypecode eq '${r}' and name eq '${t}'`};case"chart":return{set:"savedqueryvisualization",idField:"savedqueryvisualizationid",filter:`primaryentitytypecode eq '${r}' and name eq '${t}'`};case"form":return{set:"systemform",idField:"formid",filter:`objecttypecode eq '${r}' and name eq '${t}'`};case"app":return{set:"appmodule",idField:"appmoduleid",filter:`uniquename eq '${(0,Ye.odataLiteral)((i=n.uniqueName)!==null&&i!==void 0?i:"")}'`};case"dashboard":return{set:"systemform",idField:"formid",filter:`name eq '${t}' and type eq 0`};default:throw new Error(`Unsupported findable kind: ${e}`)}}});var OS=m(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.seedRecordGraph=void 0;var PS=Bi(),v5=Co(),Cl=ue(),b5=be();async function y5(e,t,r={}){var n,i,a,o,s;let l=(n=r.createdIds)!==null&&n!==void 0?n:{},u=(i=r.entitySetFor)!==null&&i!==void 0?i:(f=>(0,v5.resolveEntitySetName)(e,f)),c={},d=f=>{var g;return(g=c[f])!==null&&g!==void 0?g:l[f]};for(let f of t){let g=f.entityLogical.toLowerCase(),b=(a=f.matchOn)===null||a===void 0?void 0:a.toLowerCase(),w=[];for(let B of f.records){let j={...B.body};for(let k of(o=B.binds)!==null&&o!==void 0?o:[]){let $=k.parentEntity.toLowerCase(),re=(s=d($))===null||s===void 0?void 0:s[k.parentIndex];if(!re)throw new b5.InvalidArgumentError(`Cannot resolve bind '${k.navProperty}' on a '${g}' record: parent '${k.parentEntity}'[${k.parentIndex}] has no created id. Seed the parent group before the child, or supply it via options.createdIds.`);let H=(0,Cl.assertODataName)(await u($),`entity set for parent '${k.parentEntity}'`),nr=(0,Cl.normalizeGuid)(re,`parent id for bind '${k.navProperty}'`);j[`${k.navProperty}@odata.bind`]=`/${H}(${nr})`}w.push(j)}let N=b?w.map(B=>{let j=B[b];return j!=null&&j!==""?String(j):null}):w.map(()=>null),_=new Map;if(b){let B=(0,Cl.assertODataName)(b,"RecordGraph matchOn key"),j=[...new Set(N.filter(k=>k!==null))];if(j.length){let k=j.map(re=>`${B} eq '${(0,Cl.odataLiteral)(re)}'`).join(" or "),$=await(0,PS.queryRecords)(e,g,{select:[B,`${g}id`],filter:k,top:5e3});for(let re of $??[]){let H=re[B];H!=null&&_.set(String(H).toLowerCase(),String(re[`${g}id`]))}}}let T=[],R=new Map,M=w.map((B,j)=>{let k=N[j];if(k&&_.has(k.toLowerCase()))return null;if(k){let $=k.toLowerCase(),re=R.get($);if(re!==void 0)return re;let H=T.push(B)-1;return R.set($,H),H}return T.push(B)-1}),W=T.length?await(0,PS.createRecordsBulk)(e,g,T):[];c[g]=w.map((B,j)=>{let k=N[j];return k&&_.has(k.toLowerCase())?_.get(k.toLowerCase()):W[M[j]]})}return{createdIds:c}}Al.seedRecordGraph=y5});var kS=m(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.deleteSecurityRole=Pt.createPersonaRole=Pt.createSecurityRole=Pt.SDK_ROLE_MARKER=void 0;var rr=$e(),ke=ue(),_t=be(),FS={read:"Read",create:"Create",write:"Write",delete:"Delete",append:"Append",appendTo:"AppendTo",assign:"Assign",share:"Share"},US={user:"Basic",businessUnit:"Local",parentChild:"Deep",organization:"Global"},TS={user:1,businessUnit:2,parentChild:3,organization:4},C5={user:"CanBeBasic",businessUnit:"CanBeLocal",parentChild:"CanBeDeep",organization:"CanBeGlobal"};Pt.SDK_ROLE_MARKER="Authored by @maker-studio/cds-maker-sdk (persona/security role).";function A5(e){return Object.prototype.hasOwnProperty.call(FS,e)?FS[e]:void 0}function w5(e){return Object.prototype.hasOwnProperty.call(US,e)}var RS=new WeakMap,xS=new WeakMap;async function N5(e,t){var r,n;(0,ke.assertODataName)(t,"entity logical name");let i=RS.get(e);i||(i=new Map,RS.set(e,i));let a=i.get(t);if(a)return a;let o=`/EntityDefinitions(LogicalName='${(0,ke.odataPathLiteral)(t)}')${(0,ke.odataQuery)([["$select","LogicalName,Privileges"]])}`,l=(n=(r=(0,rr.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||r===void 0?void 0:r.Privileges)!==null&&n!==void 0?n:[];if(l.length===0)throw new _t.InvalidArgumentError(`Entity '${t}' exposes no privileges (unknown or non-securable entity).`);return i.set(t,l),l}async function S5(e){var t,r,n;let i=xS.get(e);if(i)return i;let a=`/businessunits${(0,ke.odataQuery)([["$select","businessunitid"],["$filter","_parentbusinessunitid_value eq null"],["$top",1]])}`,l=(n=((r=(t=(0,rr.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||t===void 0?void 0:t.value)!==null&&r!==void 0?r:[])[0])===null||n===void 0?void 0:n.businessunitid;if(!l)throw new _t.InvalidArgumentError("Could not resolve the root business unit.");let u=(0,ke.normalizeGuid)(l,"businessUnitId");return xS.set(e,u),u}async function D5(e,t){var r;let n=new Map;for(let i of t){if(!i.access||i.access.length===0)throw new _t.InvalidArgumentError(`Entity '${i.entity}' privilege request has no access levels.`);let a=(r=i.scope)!==null&&r!==void 0?r:"user";if(!w5(a))throw new _t.InvalidArgumentError(`Unknown privilege scope '${a}' for entity '${i.entity}'.`);let o=await N5(e,i.entity);for(let s of i.access){let l=A5(s);if(!l)throw new _t.InvalidArgumentError(`Unknown access level '${s}' for entity '${i.entity}'.`);let u=o.find(b=>b.PrivilegeType===l);if(!u)throw new _t.InvalidArgumentError(`Entity '${i.entity}' does not support '${s}' access.`);let c=C5[a];if(u[c]===!1)throw new _t.InvalidArgumentError(`Privilege '${u.Name}' on '${i.entity}' does not support the '${a}' scope.`);let d=(0,ke.normalizeGuid)(u.PrivilegeId,"PrivilegeId"),f=n.get(d);if(!f){n.set(d,{privilegeName:u.Name,privilegeType:l,scope:a,entities:new Set([i.entity])});continue}if(f.scope===a){f.entities.add(i.entity);continue}if(!(f.entities.size===1&&f.entities.has(i.entity))){let b=[...f.entities].sort().join(", ");throw new _t.InvalidArgumentError(`Entities '${b}' and '${i.entity}' share the Dataverse privilege '${u.Name}' but request different scopes; a role holds one depth per privilege. Use the same scope for all entities that share this privilege, or split them.`)}f.scope=TS[a]>TS[f.scope]?a:f.scope}}return[...n.entries()].map(([i,a])=>({entity:[...a.entities].sort().join(", "),privilegeId:i,privilegeName:a.privilegeName,privilegeType:a.privilegeType,scope:a.scope}))}async function E5(e,t,r,n){if(r.length===0&&!n)return;let i={Privileges:r.map(o=>({Depth:US[o.scope],PrivilegeId:o.privilegeId}))},a=`/roles(${t})/Microsoft.Dynamics.CRM.ReplacePrivilegesRole`;(0,rr.ensureSuccess)(await e.post(a,i),e.apiUrl(a))}async function LS(e,t,r,n,i){var a,o;let s=`/${t}(${r})/${n}${(0,ke.odataQuery)([["$select","roleid"],["$filter",`roleid eq ${i}`]])}`;return((o=(a=(0,rr.ensureSuccess)(await e.get(s),e.apiUrl(s)).body)===null||a===void 0?void 0:a.value)!==null&&o!==void 0?o:[]).length>0}async function I5(e,t,r){var n,i;let a=[],o=[],s={"@odata.id":e.apiUrl(`/roles(${t})`)};for(let l of(n=r?.teams)!==null&&n!==void 0?n:[]){let u=(0,ke.normalizeGuid)(l,"teamId");if(!await LS(e,"teams",u,"teamroles_association",t)){let c=`/teams(${u})/teamroles_association/$ref`;(0,rr.ensureSuccess)(await e.post(c,s),e.apiUrl(c))}a.push(u)}for(let l of(i=r?.users)!==null&&i!==void 0?i:[]){let u=(0,ke.normalizeGuid)(l,"userId");if(!await LS(e,"systemusers",u,"systemuserroles_association",t)){let c=`/systemusers(${u})/systemuserroles_association/$ref`;(0,rr.ensureSuccess)(await e.post(c,s),e.apiUrl(c))}o.push(u)}return{teams:a,users:o}}async function MS(e,t,r){var n,i;let a=`/roles${(0,ke.odataQuery)([["$select","roleid,description,ismanaged"],["$filter",`name eq '${(0,ke.odataLiteral)(t)}' and _businessunitid_value eq ${r}`]])}`,l=((i=(n=(0,rr.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[]).filter(d=>!!d.roleid);if(l.length===0)return;let u=d=>{var f;return d.ismanaged!==!0&&((f=d.description)!==null&&f!==void 0?f:"")===Pt.SDK_ROLE_MARKER};if(l.some(d=>!u(d)))throw new _t.InvalidArgumentError(`A role named '${t}' already exists in this business unit and was not created by the SDK; refusing to modify or assign it. Choose a different persona/role name.`);if(l.length>1)throw new _t.InvalidArgumentError(`Multiple (${l.length}) SDK-owned roles named '${t}' exist in this business unit; refusing to reuse one arbitrarily. Remove the duplicate role(s) and retry.`);let c=l[0].roleid;return c?(0,ke.normalizeGuid)(c,"roleId"):void 0}function _5(e){var t,r;return{teams:((t=e?.teams)!==null&&t!==void 0?t:[]).map(n=>(0,ke.normalizeGuid)(n,"teamId")),users:((r=e?.users)!==null&&r!==void 0?r:[]).map(n=>(0,ke.normalizeGuid)(n,"userId"))}}function P5(e){return e.map(t=>({entity:t.entity,privilegeName:t.privilegeName,privilegeType:t.privilegeType,scope:t.scope}))}async function BS(e,t){var r,n;let i=(r=t.name)===null||r===void 0?void 0:r.trim();if(!i)throw new _t.InvalidArgumentError("createSecurityRole: a non-empty role name is required.");let a=t.businessUnitId?(0,ke.normalizeGuid)(t.businessUnitId,"businessUnitId"):await S5(e),o=await D5(e,(n=t.privileges)!==null&&n!==void 0?n:[]),s=_5(t.assignTo),l=await MS(e,i,a),u=l!==void 0;if(!l){let d="/roles",f={name:i,description:Pt.SDK_ROLE_MARKER,"[email protected]":`/businessunits(${a})`};try{let g=(0,rr.ensureSuccess)(await e.post(d,f),e.apiUrl(d));l=(0,ke.normalizeGuid)((0,rr.requireCreatedId)(g,"roleid","role"),"roleId")}catch(g){let b;try{b=await MS(e,i,a)}catch{b=void 0}if(!b)throw g;l=b}}await E5(e,l,o,u);let c=await I5(e,l,s);return{roleId:l,name:i,reused:u,appliedPrivileges:P5(o),assignedTeams:c.teams,assignedUsers:c.users}}Pt.createSecurityRole=BS;async function O5(e,t){var r,n;let i=(r=t.persona)===null||r===void 0?void 0:r.trim();if(!i)throw new _t.InvalidArgumentError("createPersonaRole: a non-empty persona name is required.");let a=[...t.jobs.flatMap(o=>{var s;return(s=o.privileges)!==null&&s!==void 0?s:[]}),...(n=t.additionalPrivileges)!==null&&n!==void 0?n:[]];return BS(e,{name:i,businessUnitId:t.businessUnitId,privileges:a,assignTo:t.assignTo})}Pt.createPersonaRole=O5;async function F5(e,t){let n=`/roles(${(0,ke.normalizeGuid)(t,"roleId")})`;(0,rr.ensureSuccess)(await e.delete(n),e.apiUrl(n))}Pt.deleteSecurityRole=F5});var VS=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.createMakerSdk=Pi.MakerSdk=void 0;var qe=be(),Dr=lo(),T5=qp(),R5=Gp(),x5=Xp(),L5=gf(),Mp=Af(),Ze=Co(),Er=Bi(),wl=_f(),et=Pf(),M5=nh(),U5=bS(),B5=fn(),k5=Ft(),An=yS(),Wr=$e(),Ii=ue(),_i=IS(),qS=_S(),q5=OS(),$5=Wd(),Up=kS(),Nl=class{constructor(t){(0,B5.installDomShim)(),this.workspace=new R5.WorkspaceManager(t.workspacePath,t.instanceUrl),this.versions=new x5.VersionManager(this.workspace),this.dataverse=new L5.DataverseClient(t.instanceUrl,t.httpClient,t.solutionUniqueName),this.registrations=(0,U5.buildRegistrations)()}initWorkspace(){this.workspace.init()}getManifest(){return this.workspace.getManifest()}cleanWorkspace(){this.workspace.clean()}async fetchArtifact(t,r){let n=this.requireRegistration(t,"fetchArtifact"),{raw:i,etag:a}=await n.api.get(this.dataverse,r),o=n.adapter.fromApiResponse(i);return this.workspace.writeArtifact(t,r,o),this.versions.storeMeta(t,r,{etag:a,fetchedAt:(0,Wr.nowIso)(),snapshot:(0,An.cloneJson)(o)}),(0,An.cloneJson)(o)}async fetchArtifactList(t,r){return this.requireRegistration(t,"fetchArtifactList").api.list(this.dataverse,r)}async fetchSolution(t){var r;let n=await(0,et.fetchSolutionComponents)(this.dataverse,t),i=[],a=[];for(let o of n)try{let s=await this.resolveComponentType(o);if(!s){a.push({componentId:o.objectId,componentType:o.componentType,workflowCategory:o.workflowCategory,reason:"unsupported"});continue}let l=await this.fetchArtifact(s,o.objectId);i.push({type:s,id:o.objectId,name:typeof l.name=="string"?l.name:(r=o.displayName)!==null&&r!==void 0?r:o.objectId,entityLogicalName:typeof l.entityLogicalName=="string"?l.entityLogicalName:void 0,lastFetched:(0,Wr.nowIso)(),isDirty:!1})}catch(s){a.push({componentId:o.objectId,componentType:o.componentType,workflowCategory:o.workflowCategory,reason:"failed",error:$S(s)})}return this.workspace.updateManifest({lastSyncAt:(0,Wr.nowIso)()}),{summaries:i,skipped:a}}async fetchEntityMetadata(t){let r=await(0,Mp.fetchEntityMetadataFromApi)(this.dataverse,t);return this.workspace.writeEntityMetadata(t,r),r}findTables(t,r){return(0,Mp.findTables)(this.dataverse,t,r)}findColumns(t,r,n){return(0,Mp.findColumns)(this.dataverse,t,r,n)}createTable(t){return(0,Ze.createTable)(this.dataverse,t)}createColumn(t,r){return(0,Ze.createColumn)(this.dataverse,t,r)}updateColumn(t,r,n){return(0,Ze.updateColumn)(this.dataverse,t,r,n)}deleteColumn(t,r){return(0,Ze.deleteColumn)(this.dataverse,t,r)}createCustomerColumn(t,r){return(0,Ze.createCustomerColumn)(this.dataverse,t,r)}insertStatusValue(t,r){return(0,Ze.insertStatusValue)(this.dataverse,t,r)}updateTable(t,r){return(0,Ze.updateTable)(this.dataverse,t,r)}async setEntityIcon(t,r){if(await(0,Ze.updateTable)(this.dataverse,t,{iconVectorName:r.vector,iconSmallName:r.small,iconMediumName:r.medium,iconLargeName:r.large}),r.publish!==!1){let n=`<importexportxml><entities><entity>${(0,Ii.xmlText)(t)}</entity></entities></importexportxml>`;(0,Wr.ensureSuccess)(await this.dataverse.post("/PublishXml",{ParameterXml:n}),this.dataverse.apiUrl("/PublishXml"))}}createAlternateKey(t,r){return(0,Ze.createAlternateKey)(this.dataverse,t,r)}deleteAlternateKey(t,r){return(0,Ze.deleteAlternateKey)(this.dataverse,t,r)}createRelationship(t){return(0,Ze.createRelationship)(this.dataverse,t)}deleteRelationship(t){return(0,Ze.deleteRelationship)(this.dataverse,t)}createGlobalOptionSet(t){return(0,Ze.createGlobalOptionSet)(this.dataverse,t)}deleteGlobalOptionSet(t){return(0,Ze.deleteGlobalOptionSet)(this.dataverse,t)}deleteTable(t){return(0,Ze.deleteTable)(this.dataverse,t)}createSecurityRole(t){return(0,Up.createSecurityRole)(this.dataverse,t)}createPersonaRole(t){return(0,Up.createPersonaRole)(this.dataverse,t)}deleteSecurityRole(t){return(0,Up.deleteSecurityRole)(this.dataverse,t)}createRecord(t,r){return(0,Er.createRecord)(this.dataverse,t,r)}createRecordsBulk(t,r){return(0,Er.createRecordsBulk)(this.dataverse,t,r)}updateRecord(t,r,n){return(0,Er.updateRecord)(this.dataverse,t,r,n)}upsertRecord(t,r,n){return(0,Er.upsertRecord)(this.dataverse,t,r,n)}deleteRecord(t,r){return(0,Er.deleteRecord)(this.dataverse,t,r)}getRecord(t,r,n){return(0,Er.getRecord)(this.dataverse,t,r,n)}queryRecords(t,r){return(0,Er.queryRecords)(this.dataverse,t,r)}seedRecordGraph(t,r){return(0,q5.seedRecordGraph)(this.dataverse,t,r)}resolveArtifact(t,r){return(0,qS.resolveArtifact)(this.dataverse,t,r)}findArtifact(t,r){return(0,qS.findArtifact)(this.dataverse,t,r)}async deleteAppCascade(t,r){let n=await(0,M5.deleteAppCascade)(this.dataverse,t,r),i=(0,Ii.normalizeGuid)(t,"appModuleId");return this.workspace.readArtifact("app",i)&&this.workspace.deleteArtifact("app",i),n}associateRecords(t,r,n){return(0,Er.associateRecords)(this.dataverse,t,r,n)}disassociateRecords(t,r,n,i){return(0,Er.disassociateRecords)(this.dataverse,t,r,n,i)}createWebResource(t){return(0,wl.createWebResource)(this.dataverse,t)}updateWebResource(t,r){return(0,wl.updateWebResource)(this.dataverse,t,r)}getWebResource(t){return(0,wl.getWebResource)(this.dataverse,t)}deleteWebResource(t){return(0,wl.deleteWebResource)(this.dataverse,t)}getSolution(t){return(0,et.getSolution)(this.dataverse,t)}createPublisher(t){return(0,et.createPublisher)(this.dataverse,t)}createSolution(t){return(0,et.createSolution)(this.dataverse,t)}setSolutionVersion(t,r){return(0,et.setSolutionVersion)(this.dataverse,t,r)}addSolutionComponent(t){return(0,et.addSolutionComponent)(this.dataverse,t)}removeSolutionComponent(t,r,n){return(0,et.removeSolutionComponent)(this.dataverse,t,r,n)}exportSolution(t){return(0,et.exportSolution)(this.dataverse,t)}importSolution(t){return(0,et.importSolution)(this.dataverse,t)}deleteSolution(t){return(0,et.deleteSolution)(this.dataverse,t)}getArtifact(t,r){return(0,An.cloneJson)(this.readRaw(t,r))}readRaw(t,r){let n=this.workspace.readArtifact(t,r);if(!n)throw new qe.ArtifactNotFoundError(t,r);return n}queryTree(t,r,n){let i=this.getArtifact(t,r),a=Dr.JsonPointer.resolve(i,n);if(a===void 0)throw new qe.PathNotFoundError(t,r,n);return a}findElements(t,r,n){let i=this.getArtifact(t,r);return(0,T5.findElements)(i,n)}listArtifacts(t,r){return this.workspace.listArtifacts(t,r).map(n=>({...n,isDirty:this.versions.isDirty(n.type,n.id)}))}getEntityMetadata(t){let r=this.workspace.readEntityMetadata(t);if(!r)throw new qe.ArtifactNotFoundError("entityMetadata",t);return r}getFieldMetadata(t,r){let i=this.getEntityMetadata(t).attributes.find(a=>a.logicalName===r);if(!i)throw new qe.PathNotFoundError("entityMetadata",t,r);return i}updateElement(t,r,n,i){let a=this.readRaw(t,r),o=Dr.JsonPointer.resolve(a,n);if(o===void 0)throw new qe.PathNotFoundError(t,r,n);let s=Sl(o)&&Sl(i)?{...o,...i}:i;return Dr.JsonPointer.set(a,n,(0,An.cloneJson)(s)),this.assertStructurallyValid(t,r,a,n),this.workspace.writeArtifact(t,r,a),this.getArtifact(t,r)}addElement(t,r,n,i,a){let o=this.readRaw(t,r),s=Dr.JsonPointer.resolve(o,n);if(s===void 0)throw new qe.PathNotFoundError(t,r,n);if(!Array.isArray(s))throw new qe.ValidationError(t,r,n,"parent must be an array");let l=this.assignMissingIds(t,(0,An.cloneJson)(i)),u=z5(s,a?.position);return s.splice(u,0,l),this.assertStructurallyValid(t,r,o,n),this.workspace.writeArtifact(t,r,o),this.getArtifact(t,r)}moveElement(t,r,n,i,a){var o;let s=this.readRaw(t,r),l=Dr.JsonPointer.resolve(s,n);if(l===void 0)throw new qe.PathNotFoundError(t,r,n);let u=Dr.JsonPointer.resolve(s,i);if(u===void 0)throw new qe.PathNotFoundError(t,r,i);if(!Array.isArray(u))throw new qe.ValidationError(t,r,i,"move target must be an array");if(i===n||i.startsWith(`${n}/`))throw new qe.ValidationError(t,r,i,"cannot move an element into its own subtree");Dr.JsonPointer.remove(s,n);let c=(o=a?.index)!==null&&o!==void 0?o:u.length;return u.splice(Math.max(0,Math.min(c,u.length)),0,l),this.assertStructurallyValid(t,r,s,i),this.workspace.writeArtifact(t,r,s),this.getArtifact(t,r)}removeElement(t,r,n){let i=this.readRaw(t,r);if(Dr.JsonPointer.resolve(i,n)===void 0)throw new qe.PathNotFoundError(t,r,n);return Dr.JsonPointer.remove(i,n),this.assertStructurallyValid(t,r,i,G5(n)),this.workspace.writeArtifact(t,r,i),this.getArtifact(t,r)}assertStructurallyValid(t,r,n,i){var a,o,s;let l=this.registrations.get(t),u=(s=(o=l==null?void 0:(a=l.adapter).validate)===null||o===void 0?void 0:o.call(a,n,i))!==null&&s!==void 0?s:[];if(u.length>0)throw new qe.ValidationError(t,r,u)}retrieveSetting(t,r){return(0,_i.retrieveSetting)(this.dataverse,t,r)}saveSettingValue(t,r,n){return(0,_i.saveSettingValue)(this.dataverse,t,r,n)}getAiReadiness(t){return(0,_i.getAiReadiness)(this.dataverse,t)}setAppAiFeatures(t,r,n){return(0,_i.setAppAiFeatures)(this.dataverse,t,r,n)}configureRowSummary(t,r){return(0,_i.configureRowSummary)(this.dataverse,t,r)}removeRowSummary(t){return(0,_i.removeRowSummary)(this.dataverse,t)}async enrichDefaultViews(t,r,n={}){let i=await(0,$5.findDefaultViews)(this.dataverse,t,n);for(let a of i)await this.fetchArtifact("view",a.id),this.updateElement("view",a.id,"/columns",r),await this.pushArtifact("view",a.id);return i.length&&await this.publishArtifact("view",i[0].id),{updated:i.map(a=>a.id)}}createArtifact(t,r){let n=this.requireRegistration(t,"createArtifact"),i=n.adapter.assignMissingIds(n.adapter.createDefault(r)),a=i.id;if(!a)throw new qe.ValidationError(t,"(new)","/id","created artifact must have an id");return this.workspace.writeArtifact(t,a,i),(0,An.cloneJson)(i)}deleteArtifact(t,r){this.workspace.deleteArtifact(t,r)}async deleteRemoteArtifact(t,r){await this.requireRegistration(t,"deleteRemoteArtifact").api.delete(this.dataverse,r),this.workspace.readArtifact(t,r)&&this.workspace.deleteArtifact(t,r)}async publishArtifact(t,r){let n=this.readRaw(t,r),i;if(t==="app")i=`<importexportxml><appmodules><appmodule>${(0,Ii.xmlText)(r)}</appmodule></appmodules></importexportxml>`;else{let a=n.entityLogicalName;a&&(i=`<importexportxml><entities><entity>${(0,Ii.xmlText)(a)}</entity></entities></importexportxml>`)}i&&(0,Wr.ensureSuccess)(await this.dataverse.post("/PublishXml",{ParameterXml:i}),this.dataverse.apiUrl("/PublishXml"))}async pushArtifact(t,r){var n;let i=this.requireRegistration(t,"pushArtifact"),a=this.readRaw(t,r),o=this.versions.getMeta(t,r),s=await this.buildMetadataContext(i.adapter,a),l=i.adapter.toApiPayload(a,o?.snapshot,s);try{let u=o?await i.api.update(this.dataverse,r,l,o.etag):await i.api.create(this.dataverse,l),c=r;return o||(u.serverIdentity&&i.adapter.applyServerIdentity&&i.adapter.applyServerIdentity(a,u.serverIdentity),u.id&&u.id!==r&&(a.id=u.id,this.workspace.deleteArtifact(t,r),c=u.id),this.workspace.writeArtifact(t,c,a)),this.versions.storeMeta(t,c,{etag:u.etag,fetchedAt:(0,Wr.nowIso)(),snapshot:(0,An.cloneJson)(a)}),{type:t,id:c,success:!0,...u.warnings&&u.warnings.length>0?{warnings:u.warnings}:{}}}catch(u){if(u instanceof qe.SdkError&&u.code===Wr.VERSION_CONFLICT_CODE)return{type:t,id:r,success:!1,error:new qe.VersionConflictError(t,r,(n=o?.etag)!==null&&n!==void 0?n:null,null)};throw u}}async buildMetadataContext(t,r){var n,i;let a=(i=(n=t.metadataNeeds)===null||n===void 0?void 0:n.call(t,r))!==null&&i!==void 0?i:[];if(a.length===0)return;let o=new Set(a.map(s=>s.entityLogicalName).filter(s=>!!s));for(let s of o)if(!this.workspace.readEntityMetadata(s))try{await this.fetchEntityMetadata(s)}catch{}return{resolveField:(s,l)=>{let u=this.workspace.readEntityMetadata(s),c=u?.attributes.find(d=>d.logicalName===l);return c?{displayName:c.displayName,attributeType:c.attributeType}:void 0}}}async pushAll(){let t=this.getDirtyArtifacts(),r=[];for(let n of t)try{r.push(await this.pushArtifact(n.type,n.id))}catch(i){r.push({type:n.type,id:n.id,success:!1,error:$S(i)})}return r}getDirtyArtifacts(){return this.workspace.listArtifacts().filter(t=>this.versions.isDirty(t.type,t.id)).map(t=>({...t,isDirty:!0}))}diffArtifact(t,r){return this.versions.diff(t,r)}assignMissingIds(t,r){let n=this.registrations.get(t);return n?n.adapter.assignMissingIds(r):(0,k5.assignMissingIds)(r)}async resolveComponentType(t){switch(t.componentType){case et.SolutionComponentType.SavedQuery:return"view";case et.SolutionComponentType.SavedQueryVisualization:return"chart";case et.SolutionComponentType.AppModule:return"app";case et.SolutionComponentType.Workflow:return t.workflowCategory===2?"businessRule":void 0;case et.SolutionComponentType.SystemForm:return await this.isDashboardForm(t.objectId)?"dashboard":"form";default:return}}async isDashboardForm(t){let n=`/systemforms(${(0,Ii.normalizeGuid)(t,"formId")})${(0,Ii.odataQuery)([["$select","type"]])}`,i=(0,Wr.ensureSuccess)(await this.dataverse.get(n),this.dataverse.apiUrl(n)),a=Number(i.body.type);return a===0||a===10}requireRegistration(t,r){let n=this.registrations.get(t);if(!n)throw new qe.NotImplementedError(r,`no adapter registered for artifact type '${t}'`);return n}};Pi.MakerSdk=Nl;function V5(e){return new Nl(e)}Pi.createMakerSdk=V5;function $S(e){return e instanceof Error?e:new Error(String(e))}function Sl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function G5(e){let t=e.lastIndexOf("/");return t<=0?"":e.slice(0,t)}function z5(e,t){if(t===void 0||t==="end")return e.length;if(t==="start")return 0;if("index"in t)return Math.max(0,Math.min(t.index,e.length));if("before"in t){let n=e.findIndex(i=>Sl(i)&&i.id===t.before);return n<0?e.length:n}let r=e.findIndex(n=>Sl(n)&&n.id===t.after);return r<0?e.length:r+1}});var GS=m(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.ARTIFACT_TYPES=void 0;Dl.ARTIFACT_TYPES=["form","view","businessRule","app","command","chart","dashboard"]});var WS=m(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0})});var HS=m(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0})});var QS=m(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0})});var KS=m(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0})});var ZS=m(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0})});var tD=m(eD=>{"use strict";Object.defineProperty(eD,"__esModule",{value:!0})});var nD=m(rD=>{"use strict";Object.defineProperty(rD,"__esModule",{value:!0})});var aD=m(iD=>{"use strict";Object.defineProperty(iD,"__esModule",{value:!0})});var sD=m(oD=>{"use strict";Object.defineProperty(oD,"__esModule",{value:!0})});var uD=m(lD=>{"use strict";Object.defineProperty(lD,"__esModule",{value:!0})});var dD=m(cD=>{"use strict";Object.defineProperty(cD,"__esModule",{value:!0})});var fD=m(pD=>{"use strict";Object.defineProperty(pD,"__esModule",{value:!0})});var hD=m(mD=>{"use strict";Object.defineProperty(mD,"__esModule",{value:!0})});var vD=m(gD=>{"use strict";Object.defineProperty(gD,"__esModule",{value:!0})});var yD=m(bD=>{"use strict";Object.defineProperty(bD,"__esModule",{value:!0})});var AD=m(CD=>{"use strict";Object.defineProperty(CD,"__esModule",{value:!0})});var ND=m(wD=>{"use strict";Object.defineProperty(wD,"__esModule",{value:!0})});var DD=m(SD=>{"use strict";Object.defineProperty(SD,"__esModule",{value:!0})});var W5=exports&&exports.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),we=exports&&exports.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&W5(t,e,r)};Object.defineProperty(exports,"__esModule",{value:!0});exports.createMakerSdk=void 0;var j5=VS();Object.defineProperty(exports,"createMakerSdk",{enumerable:!0,get:function(){return j5.createMakerSdk}});we(GS(),exports);we(WS(),exports);we(HS(),exports);we(QS(),exports);we(KS(),exports);we(ZS(),exports);we(tD(),exports);we(nD(),exports);we(aD(),exports);we(sD(),exports);we(uD(),exports);we(dD(),exports);we(fD(),exports);we(hD(),exports);we(vD(),exports);we(yD(),exports);we(AD(),exports);we(ND(),exports);we(DD(),exports);we(be(),exports);
+`)}function th(e){this.options=e||{locator:{}}}th.prototype.parseFromString=function(e,t){var r=this.options,n=new XP,i=r.domBuilder||new aa,a=r.errorHandler,o=r.locator,s=r.xmlns||{},l=/\/x?html?$/.test(t),u=l?Xm.HTML_ENTITIES:Xm.XML_ENTITIES;o&&i.setDocumentLocator(o),n.errorHandler=KP(a,i,o),n.domBuilder=r.domBuilder||i,l&&(s[""]=Km.HTML),s.xml=s.xml||Km.XML;var c=r.normalizeLineEndings||eh;return e&&typeof e=="string"?n.parse(c(e),s,u):n.errorHandler.error("invalid doc source"),i.doc};function KP(e,t,r){if(!e){if(t instanceof aa)return t;e=t}var n={},i=e instanceof Function;r=r||{};function a(o){var s=e[o];!s&&i&&(s=e.length==2?function(l){e(o,l)}:e),n[o]=s&&function(l){s("[xmldom "+o+"] "+l+zu(r))}||function(){}}return a("warning"),a("error"),a("fatalError"),n}function aa(){this.cdata=!1}function Un(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}aa.prototype={startDocument:function(){this.doc=new JP().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var i=this.doc,a=i.createElementNS(e,r||t),o=n.length;Mo(this,a),this.currentElement=a,this.locator&&Un(this.locator,a);for(var s=0;s<o;s++){var e=n.getURI(s),l=n.getValue(s),r=n.getQName(s),u=i.createAttributeNS(e,r);this.locator&&Un(n.getLocator(s),u),u.value=u.nodeValue=l,a.setAttributeNode(u)}},endElement:function(e,t,r){var n=this.currentElement,i=n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&Un(this.locator,r),Mo(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=Ym.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else var n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Un(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,r){e=Ym.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Un(this.locator,n),Mo(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(e,t,r);this.locator&&Un(this.locator,i),Mo(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning] "+e,zu(this.locator))},error:function(e){console.error("[xmldom error] "+e,zu(this.locator))},fatalError:function(e){throw new QP(e,this.locator)}};function zu(e){if(e)return`
+@`+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Ym(e,t,r){return typeof e=="string"?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){aa.prototype[e]=function(){return null}});function Mo(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Uo.__DOMHandler=aa;Uo.normalizeLineEndings=eh;Uo.DOMParser=th});var Wu=m(Bo=>{var nh=$u();Bo.DOMImplementation=nh.DOMImplementation;Bo.XMLSerializer=nh.XMLSerializer;Bo.DOMParser=rh().DOMParser});var ih=m(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.deleteAppCascade=void 0;var YP=_u(),ju=Bi(),ZP=be(),ko=ce(),eO=Wu();function Hu(e){return e instanceof Error?e:new Error(String(e))}function tO(e){let t=[],r=s=>l=>t.push(`${s}: ${l}`),i=new eO.DOMParser({errorHandler:{warning:r("warning"),error:r("error"),fatalError:r("fatalError")}}).parseFromString(e,"text/xml").documentElement;if(!i||t.length>0)throw new ZP.InvalidArgumentError(`The app sitemap xml could not be parsed cleanly, so its generative-page children cannot be determined${t.length>0?` (${t[0]})`:""}`);let a=[],o=s=>{if(s.nodeName==="SubArea"){let u=s.getAttribute("GenPageId");u&&a.push((0,ko.normalizeGuid)(u,"GenPageId"))}let l=s.childNodes;for(let u=0;u<l.length;u+=1){let c=l[u];c.nodeType===1&&o(c)}};return o(i),a}async function rO(e,t,r){let n=(0,ko.normalizeGuid)(t,"appModuleId");(0,ko.normalizeGuid)(r,"appModuleIdUnique");let i=[],a=[],o=[];await(0,YP.deleteAppResolvingOnce)(e,n,s=>{s!==void 0&&o.push(...tO(s))}),i.push({type:"app",id:n});for(let s of new Set(o)){let l;try{l=await(0,ju.queryAllRecords)(e,"uxagentprojectfile",{select:["uxagentprojectfileid"],filter:`_uxagentprojectid_value eq ${s}`})}catch(u){a.push({operation:"resolve",type:"genPageFile",id:s,error:Hu(u)});continue}for(let u of l??[]){let c="";try{c=(0,ko.normalizeGuid)(String(u.uxagentprojectfileid),"uxagentprojectfileid"),await(0,ju.deleteRecord)(e,"uxagentprojectfile",c),i.push({type:"genPageFile",id:c})}catch(d){a.push({operation:"delete",type:"genPageFile",id:c,error:Hu(d)})}}try{await(0,ju.deleteRecord)(e,"uxagentproject",s),i.push({type:"genPage",id:s})}catch(u){a.push({operation:"delete",type:"genPage",id:s,error:Hu(u)})}}return{success:a.length===0,deleted:i,failures:a}}qo.deleteAppCascade=rO});var ah={};Bt(ah,{Guid:()=>_});var _,De=D(()=>{"use strict";_=class e{guidString;guid;static get EmptyGuid(){return new e("00000000-0000-0000-0000-000000000000")}static NewGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=Math.random()*16|0,n=t=="x"?r:r&3|8;return n.toString(16)})}constructor(t,r=!1){this.guidString=t;let n=new RegExp("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");(r||n.test(t))&&(this.guid=t)}ToString(){return this.guid}}});var P,We=D(()=>{"use strict";Ce();P=class e{static get EmptyString(){return""}static IsTrue(t){let r=!1;return r=t&&(this.IsStrictTrue(t)||this.IsYes(t)),r}static IsStrictTrue(t){let r=!1;return t&&(r=t.toLowerCase()==="true"),r}static IsYes(t){return t.toLowerCase()==="yes"||t.toLowerCase()==="y"}static get WhiteSpace(){return/ /g}static get EnglishAndNumericCharacters(){return/([a-z0-9A-Z]+)/g}static get ValidIdExpression(){return/([a-z0-9A-Z_]+)/g}static IsNullOrEmpty(t){return t==null||t==null||t==""}static Format(t,r){return e.IsNullOrEmpty(t)?t:t.replace(/\{\{|\}\}|\{(\d+)\}/g,function(n,i){return n=="{{"?"{":n=="}}"?"}":r[i]})}static EndsWithString(t,r){return t.indexOf(r,t.length-r.length)!==-1}static IsBlankString(t){return t.replace(/\s/g,"").length==0}static EscapeXml(t,r){let n=t;return this.IsNullOrEmpty(n)||(n=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r&&(n=n.replace(/"/g,"&quot;").replace(/'/g,"&apos;"))),n}static EscapeDomId(t){return t.replace(".","\\.")}static ToSnakeCase(t){let r=e.EmptyString;for(let n=0;n<t.length;n++)n!==0&&t[n]==t[n].toUpperCase()&&(r+="-"),r+=t[n].toLowerCase();return r}static GetSnakeCaseMarkup(t,r){let n="<"+this.ToSnakeCase(t);if(!S.IsNullOrUndefined(r))for(let i of r.getKeys())n+=" "+this.ToSnakeCase(i)+'="'+r.getValue(i)+'"';return n+">"}static StripBraces(t){return t&&t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?t.substr(1,t.length-2):t}static AddBraces(t){return S.IsNullOrUndefined(t)||t.charAt(0)==="{"||t.charAt(t.length-1)==="}"?t:`{${t}}`}static GuidStringEquals(t,r){return t===r?!0:!t||!r?!1:e.StripBraces(t).toUpperCase()===e.StripBraces(r).toUpperCase()}static AddBracesToArrayValues(t){return t.length>0?t.map(n=>(n.charAt(0)!=="{"&&(n="{"+n),n.charAt(n.length-1)!=="}"&&(n=n+"}"),n)):t}static StripBracesOnArrayValues(t){return t.length>0?t.map(n=>{let i;return n.charAt(0)==="{"&&(i=n.substr(1,n.length-1)),n.charAt(n.length-1)==="}"&&(i=i.substr(0,n.length-2)),i}):t}}});var oh={};Bt(oh,{ScriptUtilities:()=>S});var S,Ce=D(()=>{"use strict";De();We();S=class e{static IsNullOrUndefined(t){return t==null||t===void 0}static IsMacMachine(){return navigator.platform.indexOf("Mac")!==-1}static IsNullOrEmptyGuid(t){return P.IsNullOrEmpty(t.ToString())?!0:_.EmptyGuid.ToString()===t.ToString()}static IsNullOrUndefinedNested(t,r){return r.split(".").every(i=>typeof t!="object"||t==null||!(i in t)||t[i]==null?!1:(t=t[i],!0))}static ParseXml(t){return new DOMParser().parseFromString(t,"text/xml")}static IsWellFormedXml(t){return!e.ParseXml(t).querySelector("parsererror")}static getNamedItemValue(t,r){let n=t.getNamedItem(r);return e.IsNullOrUndefined(n)?null:n.value}static getBooleanValue(t,r){let n=e.getNamedItemValue(t,r);return e.IsNullOrUndefined(n)?null:P.IsTrue(n)}static getNumericValue(t){return e.IsNullOrUndefined(t)?null:parseInt(t)}static getAllUniqueTagNames(t){let r=new Set;return e.getAllUniqueTagNamesHelper(t,r),r}static getAllUniqueTagNamesHelper(t,r){if(t.nodeType===Node.ELEMENT_NODE&&(r.add(t.tagName),t.hasChildNodes()))for(let n=0;n<t.children.length;n++)this.getAllUniqueTagNamesHelper(t.children.item(n),r)}}});var $o,Vo,Yr,Go,Ju,zo,Qu=D(()=>{"use strict";(function(e){e[e.FormElementNodeChange=0]="FormElementNodeChange",e[e.FormElementAttributeChange=1]="FormElementAttributeChange"})($o||($o={}));Vo=class{type;targetNode;constructor(t,r){this.type=t,this.targetNode=r}},Yr=class extends Vo{key;oldValue;newValue;constructor(t,r,n,i){super($o.FormElementNodeChange,t),this.key=r,this.oldValue=n,this.newValue=i}apply(){this.targetNode.replaceObjectPropertyValue(this.key,this.newValue)}revert(){this.targetNode.replaceObjectPropertyValue(this.key,this.oldValue)}},Go=class extends Vo{property;oldValue;newValue;constructor(t,r,n,i){super($o.FormElementAttributeChange,t),this.property=r,this.oldValue=n,this.newValue=i}apply(){this.targetNode.replaceAttributeValue(this.property,this.newValue)}revert(){this.targetNode.replaceAttributeValue(this.property,this.oldValue)}},Ju=class{changeSet;reversedChangeSet;constructor(t){this.changeSet=t,this.changeSet&&(this.reversedChangeSet=this.changeSet.slice().reverse())}length(){return this.changeSet?this.changeSet.length:0}apply(){this.changeSet&&this.changeSet.length>0&&this.changeSet.forEach(t=>{t.apply()})}revert(){this.reversedChangeSet&&this.reversedChangeSet.length>0&&this.reversedChangeSet.forEach(t=>{t.revert()})}},zo=class{isTracking;_trackedChanges;_trackedChangeSets;constructor(t=!1){this.isTracking=t,this._trackedChanges=[],this._trackedChangeSets=[]}addChange(t){this.isTracking&&this._trackedChanges.push(t)}collectChanges(){let t=new Ju(this._trackedChanges.slice());return this._trackedChanges=[],t}pushChangeSet(t){this._trackedChangeSets.push(t)}popChangeSet(){if(this._trackedChangeSets?.length>0)return this._trackedChangeSets.pop()}getChangeSets(){return this._trackedChangeSets}}});var sh={};Bt(sh,{ChartGridMode:()=>yt,ColumnLayoutWidths:()=>sO,ComponentCategory:()=>jo,ComponentType:()=>Xu,ControlLayoutTypes:()=>nc,DisplayConditionsInfo:()=>aO,ElementNames:()=>g,ElementProperties:()=>p,ElementType:()=>Yu,EntityAttributeProperty:()=>Zu,EventType:()=>oa,FormActivationState:()=>rc,FormCanvasServiceScope:()=>yO,FormDesignerSideBarTab:()=>Ku,FormPresentation:()=>ec,FormState:()=>Wo,FormType:()=>Ee,HeaderDensityType:()=>Tr,LookUpTable:()=>Wt,MORE_TAB_PREFIX:()=>uO,NavBarChildElementType:()=>tc,PREVIEW_ID_HEADER_FLYOUT:()=>fO,PREVIEW_ID_HEADER_OVERFLOW_BUTTON:()=>hO,PREVIEW_ID_NAVIGATION_AREA:()=>dO,PREVIEW_ID_QUICKCREATE_ROOT:()=>vO,PREVIEW_ID_TAB:()=>gO,PREVIEW_ID_TAB_LIST:()=>mO,PREVIEW_ID_TAB_PANEL:()=>pO,PropertyModelKeys:()=>oc,PropertyModelSectionKeys:()=>lO,RELATED_TAB_ID:()=>sc,RELATED_TAB_PREFIX:()=>cO,SectionDefaultProperties:()=>oO,SectionLayoutTypes:()=>pe,TabContentType:()=>ic,TabDefaultProperties:()=>Rr,TabLayoutTypes:()=>de,TelemetryPropertyNames:()=>bO,UnboundControlPropertyKeys:()=>ac,compositeAddressFields:()=>iO,compositeFieldNames:()=>ht,compositeFields:()=>nO});var Ee,Xu,Ku,g,p,Yu,ht,nO,iO,Zu,Wt,Wo,Tr,ec,aO,tc,rc,de,oO,Rr,pe,nc,ic,sO,ac,oc,lO,oa,yt,sc,uO,cO,dO,pO,fO,mO,hO,gO,vO,bO,jo,yO,G=D(()=>{"use strict";(function(e){e[e.Dashboard=0]="Dashboard",e[e.AppointmentBook=1]="AppointmentBook",e[e.Main=2]="Main",e[e.MiniCampaignBO=3]="MiniCampaignBO",e[e.Preview=4]="Preview",e[e.MobileExpress=5]="MobileExpress",e[e.QuickViewForm=6]="QuickViewForm",e[e.QuickCreate=7]="QuickCreate",e[e.Dialog=8]="Dialog",e[e.TaskFlowForm=9]="TaskFlowForm",e[e.InteractionCentricDashboard=10]="InteractionCentricDashboard",e[e.Card=11]="Card",e[e.MainInteractiveExperience=12]="MainInteractiveExperience",e[e.Other=100]="Other",e[e.MainBackup=101]="MainBackup",e[e.AppointmentBookBackup=102]="AppointmentBookBackup",e[e.PowerBIDashboard=103]="PowerBIDashboard"})(Ee||(Ee={}));(function(e){e[e.Form=0]="Form",e[e.Dialog=1]="Dialog"})(Xu||(Xu={}));(function(e){e[e.Components=0]="Components",e[e.Properties=1]="Properties",e[e.Relationship=2]="Relationship",e[e.BusinessRules=3]="BusinessRules"})(Ku||(Ku={}));(function(e){e.form="form",e.formTab="tab",e.formColumn="column",e.formSection="section",e.formRow="row",e.formCell="cell",e.formLabel="label",e.formControl="control",e.formEvent="event",e.dependency="dependency",e.queryStringParameter="querystringparameter",e.controlDescriptions="controlDescriptions",e.controlDescription="controlDescription",e.customControl="customControl",e.dataset="data-set",e.formFooter="footer",e.formHeader="header",e.formNavigation="Navigation",e.formTabs="tabs",e.formColumns="columns",e.formSections="sections",e.formRows="rows",e.formEvents="events",e.quickFormDependencies="externaldependencies",e.controlParameters="parameters",e.formDependencies="dependencies",e.formNavBarAreas="NavBarAreas",e.formNavBarArea="NavBarArea",e.formNavBar="NavBar",e.spacerControl="SpacerControl",e.formField="Field",e.formNavBarByRelationshipItem="NavBarByRelationshipItem",e.formNavBarItem="NavBarItem",e.Title="Title",e.Titles="Titles",e.NavigationLink="Navigation Link",e.Relationship="Relationship",e.NavigationLinkIconClass="mscrm-glyph-NavLinkIcon",e.formDisplayConditions="DisplayConditions",e.formLibraries="formLibraries",e.internalLibraries="internaljscriptfile",e.eventHandlers="Handlers",e.handler="Handler",e.library="Library",e.formRoles="Role",e.formEveryOne="Everyone",e.Handler="Handler",e.EventHandlers="Handlers",e.InternalEventHandlers="InternalHandlers",e.HiddenControl="hiddencontrols",e.EventDependencies="dependencies",e.EventDependency="dependency",e.isvisibleinmocaonly="msinternal.isvisibleinmocaonly"})(g||(g={}));p={ShowImage:"showImage",ShowNavigationbar:"shownavigationbar",MaxWidth:"maxWidth",HeaderDensityType:"headerdensity",OnLoadEvent:"onload",EventActive:"active",EventAttribute:"attribute",Relationship:"relationship",Control:"control",HandlerUniqueId:"handlerUniqueId",functionName:"functionName",libraryNameEventHandler:"libraryName",enabledForField:"enabled",passExecutionContext:"passExecutionContext",parameters:"parameters",eventFunctionName:"eventFunctionName",eventEnabled:"eventEnabled",indicationOfSubgrid:"indicationOfSubgrid",Name:"name",Type:"type",TitleResourceId:"TitleResourceId",Show:"Show",RelationshipName:"RelationshipName",Sequence:"Sequence",Area:"Area",headerPrefix:"header_",application:"application",labelId:"labelid",showbar:"showbar",layout:"layout",classid:"classid",uniqueid:"uniqueid",isUnbound:"isunbound",isRequired:"isrequired",rowspan:"rowspan",rowheight:"rowheight",colspan:"colspan",width:"width",IsUserDefined:"IsUserDefined",expanded:"expanded",related:"related",showlabel:"showlabel",locklevel:"locklevel",datafieldname:"datafieldname",formFactor:"formFactor",static:"static",disabled:"disabled",description:"description",languagecode:"languagecode",LCID:"LCID",groupName:"group",contentType:"contenttype",showCommandBar:"showcommandbar",showBody:"showbody",showTabNavigator:"showtabnavigator",userspacer:"userspacer",columnName:"columns",LabelWidth:"labelwidth",Fieldlabelalignment:"celllabelalignment",Fieldlabelposition:"celllabelposition",availableforphone:"availableforphone",Locked:"bLocked",ReadOnly:"bDisabled",visible:"visible",ForControl:"forControl",text:"Text",url:"Url",passParameters:"PassParameters",autoExpand:"AutoExpand",auto:"auto",Auto:"Auto",Fixed:"Fixed",icon:"Icon",id:"id",Id:"Id",showOnMobileClient:"ShowOnMobileClient",webResourceId:"WebResourceId",viewName:"ViewName",failureTimeField:"FailureTimeField",successCondition:"SuccessConditionName",successConditionValue:"SuccessConditionValue",failureCondition:"FailureConditionName",failureConditionValue:"FailureConditionValue",warningCondition:"WarningConditionName",warningConditionValue:"WarningConditionValue",cancelCondition:"CancelConditionName",cancelConditionValue:"CancelConditionValue",pauseCondition:"PauseConditionName",pauseConditionValue:"PauseConditionValue",filterResults:"FilterResults",autoSuggestionSource:"AutoSuggestionSource",numberOfResults:"NumberOfResults",addressField:"AddressField",displayAsCustomer360Tile:"DisplayAsCustomer360Tile",hideQuickFormBorder:"HideQuickFormBorder",quickForms:"QuickForms",entityName:"EntityName",controlMode:"ControlMode",headerColorCode:"HeaderColorCode",targetEntityType:"TargetEntityType",enableQuickFind:"EnableQuickFind",enableViewPicker:"EnableViewPicker",enableChartPicker:"EnableChartPicker",recordsPerPage:"RecordsPerPage",chartGridMode:"ChartGridMode",referencePanelSubgridIconUrl:"ReferencePanelSubgridIconUrl",referencePanelQuickFormCollectionIconUrl:"ReferencePanelQuickFormCollectionIconUrl",referencePanelSearchWidgetIconUrl:"ReferencePanelSearchWidgetIconUrl",viewId:"ViewId",isUserView:"IsUserView",enableJumpBar:"EnableJumpBar",isUserChart:"IsUserChart",viewIds:"ViewIds",filteredViewIds:"FilteredViewIds",visualizationId:"VisualizationId",teamTemplateId:"TeamTemplateId",selectDefaultLanguage:"SelectDefaultLanguage",allowChangingFiltersOnUI:"AllowChangingFiltersOnUI",enableAutoSuggestions:"EnableAutoSuggestions",enableRating:"EnableRating",searchForAutoSuggestionsUsing:"SearchForAutoSuggestionsUsing",showContextualActions:"ShowContextualActions",showDepartmentFilter:"ShowDepartmentFilter",showLanguageFilter:"ShowLanguageFilter",showRatingUsing:"ShowRatingUsing",actionList:"ActionList",Order:"Order",FallbackForm:"FallbackForm",allowSearchFilter:"allowSearchFilter",socialInstanceParameters:"<Parameters>k__BackingField",signalUrl:"SignalUrl",border:"Border",scrolling:"Scrolling",security:"Security",BingMapsAddress1Composite:"address1_composite",BingMapsAddress2Composite:"address2_composite",UrlHttpsProtocolPrefix:"https://",UrlHttpProtocolPrefix:"http://",showAll:"ShowAll",ShowFilterPane:"UClientShowFilterPane",ExpandFilterPane:"UClientExpandFilterPane",SortOption:"UClientOrderBy",DefaultModuleCreateExperience:"UClientDefaultModuleForCreateExperience",RecordPerPages:"UClientRecordPerPage",moduleList:"UClientModules",showAllModule:"Show All",showSelectedModule:"Show Selected",Ascending:"Ascending",Descending:"Descending",Activities:"Activities",Posts:"Posts",Notes:"Notes",CardForm:"CardForm",SelectActivity:"SelectActivity",DisplayActivity:"UClientDisplayActivityUsing",CreateActivity:"UClientCreateActivityUsing",DisplayActivityHeader:"UClientDisplayActivityHeaderUsing",SortTimeLine:"UClientSortActivitiesByValue",activityList:"UClientActivities",CardActivityMap:"UClientActivityCardMap",DefaultTabId:"DefaultTabId",EmailConversationView:"EmailConversationView",OrderByActivityWall:"OrderByActivityWall",ShowArticleTab:"ShowArticleTab",SortActivityWall:"SortActivityWall",TimelineUniqueName:"UClientUniqueName",SortTimeLineBy:"modifiedon",SelectActivityListDefault:"appointment",SelectCardDefault:"Select Card Form",AscendingValue:"ascending",DescendingValue:"descending",DefaultTabIdValue:"ActivitiesTab",EmailConversationViewDefault:"true",ShowArticleTabDefault:"false",SelectDefaultLanguage:"SelectDefaultLanguage",SelectDefaultLanguageValue:"00000000-0000-0000-0000-000000000000",SortActivityWallDefault:"modifiedon",RecordPerPagesDefault:"10",TimelineNameLabel:"Timeline",showSelectedActions:"Show Selected",defaultFormat:"defaultformat",fieldLabels:"fieldlabels",QuickCreateForm:"quickcreateform",QuickFormNameToIdXMLTempate:"<QuickFormId e,yname={0}>{1}</QuickFormId>",QuickFormIdListXMLTempate:"<QuickFormId,}</QuickFormIds>",AllowFilterOff:"AllowFilterOff",AutoResolve:"AutoResolve",DefaultViewId:"DefaultViewId",DependentAttributeName:"DependentAttributeName",DependentAttributeType:"DependentAttributeType",DisableMru:"DisableMru",UseMFDForCreate:"useMainFormDialogForCreate",UseMFDForEdit:"useMainFormDialogForEdit",DisableQuickFind:"DisableQuickFind",DisableViewPicker:"DisableViewPicker",FilterRelationshipName:"FilterRelationshipName",AvailableViewIds:"AvailableViewIds",MainForm:"mainform",DefaultsFields:"defaultfields",TimeLineCardForm:"cardform",libraryUniqueId:"libraryUniqueId",libraryName:"name",displayName:"displayName",OnChangeEvent:"onchange",ViewIdRAControlDefault:"{92AFD454-0F2E-4397-A1C8-05E37C6AD699}",TargetEntityTypeRAControlDefault:"actioncard",ChartGridModeRAControlDefault:"All",RecordsPerPageRAControlDefault:"4",RAControlDefaultValue:"false",RAcontrolDefaultHeaderColorCode:"#000000",DropdownSelectedDefaultValue:"1",selectPrimaryCustomer:"SelectPrimaryCustomer",bindAttribute:"BindAttribute"};(function(e){e[e.TAB=0]="TAB",e[e.SECTION=1]="SECTION",e[e.BASIC_CONTROL=2]="BASIC_CONTROL",e[e.HEADER=3]="HEADER",e[e.FOOTER=4]="FOOTER",e[e.UB_CONTROL=5]="UB_CONTROL",e[e.RELATIONSHIPITEM=6]="RELATIONSHIPITEM",e[e.RELATIONSHIPGROUP=7]="RELATIONSHIPGROUP",e[e.NAVIGATIONLINK=8]="NAVIGATIONLINK",e[e.FORMMODEL=9]="FORMMODEL",e[e.UNDEFINED=10]="UNDEFINED"})(Yu||(Yu={}));ht={fullname:"fullname",yomifullname:"yomifullname",address1_composite:"address1_composite",address2_composite:"address2_composite",address3_composite:"address3_composite",billto:"billto_composite",shipto:"shipto_composite"},nO=[ht.fullname,ht.yomifullname,ht.address1_composite,ht.address2_composite,ht.address3_composite,ht.billto,ht.shipto],iO=[ht.address1_composite,ht.address2_composite,ht.address3_composite,ht.billto,ht.shipto];(function(e){e[e.IsValidForForm=0]="IsValidForForm",e[e.IsValidForCreate=1]="IsValidForCreate"})(Zu||(Zu={}));(function(e){e[e.DependencyFieldTable=0]="DependencyFieldTable",e[e.LockedFieldTable=1]="LockedFieldTable"})(Wt||(Wt={}));(function(e){e[e.Published=0]="Published",e[e.Draft=1]="Draft",e[e.New=2]="New",e[e.SaveAs=3]="SaveAs"})(Wo||(Wo={}));(function(e){e.Low="Low",e.HighReadOnlyValues="HighReadOnlyValues",e.HighWithControls="HighWithControls"})(Tr||(Tr={}));(function(e){e[e.ClassicForm=0]="ClassicForm",e[e.AirForm=1]="AirForm",e[e.ConvertedICForm=2]="ConvertedICForm"})(ec||(ec={}));aO={TopOrderFormId:"topOrderFormId",NextDisplayOrder:"nextDisplayOrder"};(function(e){e[e.NavBarRelationShipItem=0]="NavBarRelationShipItem",e[e.NavBarItem=1]="NavBarItem"})(tc||(tc={}));(function(e){e[e.InActive=0]="InActive",e[e.Active=1]="Active"})(rc||(rc={}));(function(e){e[e.ONE_COLUMN=0]="ONE_COLUMN",e[e.TWO_COLUMN_EQUAL=1]="TWO_COLUMN_EQUAL",e[e.TWO_COLUMN_WIDER_LEFT=2]="TWO_COLUMN_WIDER_LEFT",e[e.TWO_COLUMN_WIDER_RIGHT=3]="TWO_COLUMN_WIDER_RIGHT",e[e.TWO_COLUMN_CUSTOM_LAYOUT=4]="TWO_COLUMN_CUSTOM_LAYOUT",e[e.THREE_COLUMN_EQUAL=5]="THREE_COLUMN_EQUAL",e[e.THREE_COLUMN_WIDER_MID=6]="THREE_COLUMN_WIDER_MID",e[e.THREE_COLUMN_CUSTOM_LAYOUT=7]="THREE_COLUMN_CUSTOM_LAYOUT"})(de||(de={}));oO={ShowLabel:"false",LockLevel:"0",IsUserDefined:"0",LabelWidth:"115",columns:"1",ShowBar:"false",Layout:"varwidth",namePrefix:"_section_"},Rr={namePrefix:"tab_",ShowLabel:"true",LockLevel:"0",IsUserDefined:"0"};(function(e){e[e.ONE_COLUMN=0]="ONE_COLUMN",e[e.TWO_COLUMN=1]="TWO_COLUMN",e[e.THREE_COLUMN=2]="THREE_COLUMN",e[e.FOUR_COLUMN=3]="FOUR_COLUMN",e[e.REFERENCE_PANEL=4]="REFERENCE_PANEL"})(pe||(pe={}));(function(e){e[e.SUBGRID=0]="SUBGRID",e[e.SPACER=1]="SPACER",e[e.QUICK_VIEW=2]="QUICK_VIEW",e[e.WEB_RESOURCE=3]="WEB_RESOURCE",e[e.IFRAME=4]="IFRAME",e[e.BING_MAPS=5]="BING_MAPS",e[e.TIMER=6]="TIMER",e[e.TIMELINE=7]="TIMELINE",e[e.NOTES=8]="NOTES",e[e.SOCIAL_INSIGHTS=9]="SOCIAL_INSIGHTS",e[e.KB_SEARCH=10]="KB_SEARCH",e[e.INTERACTION_WALL=11]="INTERACTION_WALL",e[e.ACI_CONTROL=12]="ACI_CONTROL",e[e.RELATIONSHIP_ASSISTANT=13]="RELATIONSHIP_ASSISTANT",e[e.REFERENCE_PANEL=14]="REFERENCE_PANEL",e[e.REF_PANEL_QUICKVIEW=15]="REF_PANEL_QUICKVIEW",e[e.REF_PANEL_SUBGRID=16]="REF_PANEL_SUBGRID",e[e.REF_PANEL_KBSEARCH=17]="REF_PANEL_KBSEARCH",e[e.WEB_RESOURCE_HTML=18]="WEB_RESOURCE_HTML",e[e.PRED_LEAD_SCORING=19]="PRED_LEAD_SCORING"})(nc||(nc={}));(function(e){e.cardSections="cardSections",e.singleComponent="singleComponent",e.default="default",e.expandAvailableSpace="expandAvailableSpace"})(ic||(ic={}));sO={ONE_COLUMN:"100",TWO_COLUMN:"50",THREE_COLUMN:"33.33",FOUR_COLUMN:"25"};(function(e){e.minValue="MinValue",e.maxValue="MaxValue",e.precision="Precision",e.maxLength="MaxLength",e.entityLogicalName="EntityLogicalName",e.defaultViewId="DefaultViewId",e.optionSetDefaultValue="DefaultValue",e.optionSetId="OptionSetId"})(ac||(ac={}));(function(e){e.entityName="entityName",e.formName="formName",e.formDisplayName="formDisplayName",e.description="description",e.maxWidth="maxWidth",e.showNavigation="showNavigation",e.showImageCheck="showImageCheck",e.downloadFormXml="downloadFormXml",e.downloadRawFormXml="downloadRawFormXml",e.expandTab="expandTab",e.singleComponent="singleComponent",e.label="label",e.name="name",e.hiddenByDefault="hiddenByDefault",e.hideForPhone="hideForPhone",e.tabLayout="tabLayout",e.column1Width="column1Width",e.column2Width="column2Width",e.column3Width="column3Width",e.hideLabel="hideLabel",e.lockElement="lockElement",e.sectionLayout="sectionLayout",e.labelWidth="labelWidth",e.fieldLabelAlignment="fieldLabelAlignment",e.fieldLabelPosition="fieldLabelPosition",e.cellWidth="cellWidth",e.fieldHeight="fieldHeight",e.cellHeight="cellHeight",e.showLine="showLine",e.readonly="readonly",e.required="required",e.maxLength="maxLength",e.isTitle="isTitle",e.minValue="minValue",e.maxValue="maxValue",e.precision="precision",e.autoExpand="autoExpand",e.highDensityEnabled="highDensityEnabled",e.hideExtendedHeader="hideExtendedHeader",e.defaultViewProperty="defaultViewProperty",e.defaultChartProperty="defaultChartProperty",e.teamTemplateProperty="teamTemplateProperty",e.datasourceProperty="datasourceProperty",e.eventType="eventType",e.addEvent="addEvent",e.cellOnChange="cellOnChange",e.cellOnChangeEventDependencies="cellOnChangeEventDependencies",e.cellOnChangeHandlers="cellOnChangeHandlers",e.gridOnChange="gridOnChange",e.gridOnChangeEventDependencies="gridOnChangeEventDependencies",e.gridOnChangeHandlers="gridOnChangeHandlers",e.gridOnChangeTargetField="gridOnChangeTargetField",e.gridOnRecordSelect="gridOnRecordSelect",e.gridOnRecordSelectEventDependencies="gridOnRecordSelectEventDependencies",e.gridOnRecordSelectHandlers="gridOnRecordSelectHandlers",e.cellOnReadyStateEventDependencies="cellOnReadyStateEventDependencies",e.cellOnReadyStateHandlers="cellOnReadyStateEventHandlers",e.tabOnChange="tabOnChange",e.tabOnChangeEventDependencies="tabOnChangeEventDependencies",e.tabOnChangeHandlers="tabOnChangeHandlers",e.formOnLoad="formOnLoad",e.formOnLoadEventDependencies="formOnLoadEventDependencies",e.formOnLoadHandlers="formOnLoadHandlers",e.formOnSave="formOnSave",e.formOnSaveDependencies="formOnSaveDependencies",e.formOnSaveHandlers="formOnSaveHandlers",e.gridOnSave="gridOnSave",e.gridOnSaveDependencies="gridOnSaveDependencies",e.gridOnSaveHandlers="gridOnSaveHandlers",e.formHasNoLibraries="formHasNoLibraries",e.hideHeaderCommandBar="hideHeaderCommandBar",e.hideHeaderBody="hideHeaderBody",e.hideHeaderTabNavigator="hideHeaderTabNavigator",e.hideFooter="hideFooter",e.scrollingDropdown="scrollingDropdown",e.displayBorder="displayBorder",e.crossScripting="crossScripting",e.passParams="passParams",e.webResourceCustomParamData="webResourceCustomParameterData",e.webResourceAltText="webResourceAltText",e.verticalAlignment="verticalAlignment",e.horizontalAlignment="horizontalAlignment",e.specificSize="specificSize",e.urlProperty="urlProperty",e.enableViewPicker="enableViewPicker",e.enableChartPicker="enableChartPicker",e.chartGridMode="chartGridMode",e.relatedRecords="relatedRecords",e.hideSearchBox="hideSearchBox",e.showAllViews="showAllViews",e.availableViewsProperty="availableViewsProperty",e.recordsPerPage="recordsPerPage",e.businessRulePill="business-rule-pill-",e.addBusinessRule="addBusinessRule",e.rowHeight="rowHeight",e.refPanelSectionTabs="refPanelSectionTabs",e.editCanvasAppProperty="editCanvasAppProperty"})(oc||(oc={}));lO={display:"DisplayOptions",format:"Formatting",control:"Controls",data:"DataOptions",form:"FormProperties",events:"EventProperties",activeBusinessRules:"activeBusinessRules",addBusinessRule:"addBusinessRule",inactiveBusinessRules:"inactiveBusinessRules"};(function(e){e.onChange="onchange",e.onTabStateChange="tabstatechange",e.onLoad="onload",e.onSave="onsave",e.onReadyStateComplete="onreadystatecomplete",e.onRecordSelect="onrecordselect"})(oa||(oa={}));(function(e){e.All="All",e.Chart="Chart",e.Grid="Grid"})(yt||(yt={}));sc="tab_related3b554255-7717-4d17-bb7f-9936fb1e75ca",uO="more_tab_",cO="related_tab_",dO="preview_id_navigation_area",pO="tab-section",fO="headerFieldsFlyout",mO="tablist",hO="header_overflowButton",gO="tab",vO="quickCreateRoot",bO={defaultVisibility:"Default visibility"};(function(e){e.input="input",e.layout="layout",e.grid="grid",e.relatedData="relatedData",e.display="display",e.powerbi="powerbi",e.artificialIntelligence="artificialIntelligence",e.media="media",e.collaboration="collaboration",e.more="more",e.test="test",e.popular="popular"})(jo||(jo={}));yO="CellCanvasServiceScope"});var lh={};Bt(lh,{Attribute:()=>Ho,FormElementNode:()=>q});var Ho,q,Le=D(()=>{"use strict";Ce();We();Qu();G();De();Ho=class{key;value;constructor(t,r){this.key=t,this.value=r}},q=class e{nodeName;properties;childrenNodes;parentNode;nodeId;isTransient;constructor(t,r){this.nodeName=t,this.properties=[],this.childrenNodes=[],this.parentNode=r,this.isTransient=!1,this.nodeId=`nodeId-${_.NewGuid()}`}getProperty(t){for(let r of this.properties)if(r.key===t)return r.value;return null}getNodeId(){return this.nodeId}getNodeName(){return this.nodeName}setNodeName(t){this.trackObjectPropertyChange("nodeName",t)}get NodeName(){return this.getNodeName()}getAllProperties(){return this.properties}replaceAttributeValue(t,r){this.properties.find(n=>n===t)&&(t.value=r)}replaceObjectPropertyValue(t,r){this[t]=r}getAllChildren(){return this.childrenNodes}getParentNode(){return this.parentNode}visit(t){let r=!1;if(t){r=!!t(this);let n=this.childrenNodes;if(!r&&n)for(let i=0;!r&&i<n.length;i++)r=n[i].visit(t)}return r}findAll(t){let r=[];return t&&this.visit(n=>{t(n)&&r.push(n)}),r}findFirst(t){let r=null;return t&&this.visit(n=>{if(t(n))return r=n,!0}),r}raiseMetadataChange(t){let r=this.getAncestor(g.form);r&&r.raiseMetadataChange(t)}trackPropertyAddition(t,r){this.trackPropertyCollectionChange(()=>{this.properties.push(new Ho(t,r))})}trackPropertyDeletion(t){this.trackPropertyCollectionChange(()=>{let r=this.properties.findIndex(n=>n.key===t);r>-1&&this.properties.splice(r,1)})}trackPropertyCollectionChange(t){let r=this.changeTracker();if(r&&r.isTracking){let n=this.properties.slice();t(),r.addChange(new Yr(this,"properties",n,this.properties.slice()))}else t()}trackChildrenCollectionChange(t){let r=this.changeTracker();if(r&&r.isTracking){let n=this.childrenNodes.slice();t(),r.addChange(new Yr(this,"childrenNodes",n,this.childrenNodes.slice()))}else t()}trackParentNodeChange(t){let r=this.changeTracker();if(r&&r.isTracking){let n=this.parentNode;if(t(),n===this.parentNode)return;r.addChange(new Yr(this,"parentNode",n,this.parentNode))}else t()}trackAttributeValueChange(t,r){let n=this.changeTracker();if(n&&n.isTracking){let i=t.value;if(i===r)return;t.value=r,n.addChange(new Go(this,t,i,r))}else t.value=r}trackObjectPropertyChange(t,r){let n=this.changeTracker();if(n&&n.isTracking){let i=this[t];if(i===r)return;this[t]=r,n.addChange(new Yr(this,t,i,r))}else this[t]=r}setProperty(t,r){if(!t)throw new Error("Invalid property key");let n=this.properties.find(i=>i.key===t);n?this.trackAttributeValueChange(n,r):this.addProperty(t,r)}addProperty(t,r){if(!t)throw new Error("Invalid property key");this.trackPropertyAddition(t,r)}removeProperty(t){this.trackPropertyDeletion(t)}addChild(t){t.trackParentNodeChange(()=>{t.parentNode=this}),this.trackChildrenCollectionChange(()=>{this.childrenNodes.push(t)})}insertChildAtIndex(t,r){S.IsNullOrUndefined(t)||(t.trackParentNodeChange(()=>{t.parentNode=this}),this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(r,0,t)}))}moveChild(t,r){let n=this.childrenNodes.indexOf(t);if(n<0)return!1;let i=Math.min(Math.max(0,n+r),this.childrenNodes.length-1);return n!==i&&this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(i,0,this.childrenNodes.splice(n,1)[0])}),!0}getChildren(t){let r=[];for(let n of this.childrenNodes)n.nodeName===t&&r.push(n);return r}getFirstChild(t){for(let r of this.childrenNodes)if(r.nodeName===t)return r;return null}getAllGrandChildren(t){let r=this.getChildren(t),n=null;return r.length===0?new Array:(n=r[0],n.childrenNodes)}deleteChild(t){if(S.IsNullOrUndefined(t))return-1;for(let r=0;r<this.childrenNodes.length;r++)if(this.childrenNodes[r]===t)return this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(r,1)}),r;return-1}deleteAllChildren(){this.trackChildrenCollectionChange(()=>{this.childrenNodes=[]})}getParent(){return this.parentNode}getParentType(){return this.parentNode?this.parentNode.nodeName:P.EmptyString}updateChild(t,r){let n=this.childrenNodes.indexOf(t);return n>-1?(r.trackParentNodeChange(()=>{r.parentNode=this}),this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(n,1,r)}),!0):!1}getAncestor(t){let r=this.getParent(),n=this.getParentType();for(;r;){if(n===t)return r;n=r.getParentType(),r=r.getParent()}return null}deleteFirstGrandChildOfName(t,r){return this.getChildren(t)[0].deleteChild(r)}deleteChildren(t,r){r=S.IsNullOrUndefined(r)?this.childrenNodes.length:r,this.trackChildrenCollectionChange(()=>{this.childrenNodes.splice(t,r)})}deleteGrandChildren(t,r,n){this.getChildren(t)[0].deleteChildren(r,n)}addGrandChild(t,r){let n=this.getChildren(t),i=null;n.length===0?(i=new e(t,this),this.addChild(i)):i=n[0],i.addChild(r)}addGrandChildAtIndex(t,r,n){let i=this.getChildren(t),a=null;i.length===0?(a=new e(t,this),this.addChild(a)):a=i[0],a.insertChildAtIndex(r,n)}GetPropertyByParameter(t){return this.getProperty(t)}getSemanticParent(){switch(this.getNodeName()){case g.formCell:let t=this.getAncestor(g.formSection);return t||(t=this.getAncestor(g.formHeader),t)||(t=this.getAncestor(g.formFooter),t)?t:null;case g.formSection:return this.getAncestor(g.formTab);case g.formTab:return this.getAncestor(g.form);default:return null}}isDirty(){return this.visit(t=>t.isInChangeSet())}isInChangeSet(){return this.changeTracker().getChangeSets().some(r=>r.changeSet.some(n=>n.targetNode.getNodeId()===this.getNodeId()))}changeTracker(){let t=this.getAncestor(g.form);return t?t.changeTracker():null}}});var uh={};Bt(uh,{ControlClassId:()=>A,ControlNamePrefixes:()=>Jo,getControlDisplayNames:()=>CO});function CO(e){return{[A.AccessPrivilegeControl]:e("controls.controlNames.accessPrivilege"),[A.AccessTeamTablePickerControl]:e("controls.controlNames.accessTeamTablePicker"),[A.ACIControl]:e("controls.controlNames.aci"),[A.ActivitiesContainerControl]:e("controls.controlNames.activitiesContainer"),[A.ActivitiesWallControl]:e("controls.controlNames.activitiesWall"),[A.AppliedFiltersControl]:e("controls.controlNames.appliedFilters"),[A.ArticleContentControl]:e("controls.controlNames.articleContent"),[A.BooleanControl]:e("controls.controlNames.twoOption"),[A.ButtonControl]:e("controls.controlNames.button"),[A.CheckboxControl]:e("controls.controlNames.checkbox"),[A.CompositionLinkControl]:e("controls.controlNames.compositionLink"),[A.ConnectionControl]:e("controls.controlNames.connection"),[A.ConnectionRoleObjectTypeListControl]:e("controls.controlNames.connectionRoleObjectTypeList"),[A.CoverageChoiceControl]:e("controls.controlNames.coverageChoice"),[A.DashboardControl]:e("controls.controlNames.dashboard"),[A.DynamicPropertyListControl]:e("controls.controlNames.dynamicPropertyList"),[A.EditFilterControl]:e("controls.controlNames.editFilter"),[A.ErrorStatusControl]:e("controls.controlNames.errorStatus"),[A.GlobalFilterControl]:e("controls.controlNames.globalFilter"),[A.HiddenInputControl]:e("controls.controlNames.hiddenInput"),[A.KBViewerControl]:e("controls.controlNames.kbViewer"),[A.LabelControl]:e("controls.controlNames.label"),[A.MailMergeLanguagePickerControl]:e("controls.controlNames.mailMergeLanguagePicker"),[A.MapLinkControl]:e("controls.controlNames.mapLink"),[A.OrgInsightsControl]:e("controls.controlNames.orgInsights"),[A.ChoiceLookupControl]:e("controls.controlNames.choiceLookup"),[A.PowerBIControl]:e("controls.controlNames.powerBI"),[A.ProcessControl]:e("controls.controlNames.process"),[A.RelatedInformationControl]:e("controls.controlNames.relatedInformation"),[A.RelationshipRoleChoiceControl]:e("controls.controlNames.relationshipRoleChoice"),[A.ReportControl]:e("controls.controlNames.report"),[A.StreamsControl]:e("controls.controlNames.streams"),[A.WebResourceSilverlightControl]:e("controls.controlNames.webResourceSilverlight"),[A.CurrencyControl]:e("controls.controlNames.currency"),[A.DateTimeControl]:e("controls.controlNames.dateAndTime"),[A.DecimalControl]:e("controls.controlNames.decimal"),[A.DurationControl]:e("controls.controlNames.duration"),[A.EmailAddressControl]:e("controls.controlNames.email"),[A.FileControl]:e("controls.controlNames.file"),[A.FloatingNumberControl]:e("controls.controlNames.floatingNumber"),[A.IframeControl]:e("controls.controlNames.iframe"),[A.ImageControl]:e("controls.controlNames.image"),[A.LookupControl]:e("controls.controlNames.lookup"),[A.MapsControl]:e("controls.controlNames.maps"),[A.PhoneNumberControl]:e("controls.controlNames.phoneNumber"),[A.ChoiceControl]:e("controls.controlNames.choice"),[A.QuickViewControl]:e("controls.controlNames.quickView"),[A.QuickFormControl]:e("controls.controlNames.quickForm"),[A.CustomControl]:e("controls.controlNames.customControl"),[A.SearchWidgetControl]:e("controls.controlNames.searchWidget"),[A.SocialInsightsControl]:e("controls.controlNames.socialInsights"),[A.SubgridControl]:e("controls.controlNames.subgrid"),[A.TextAreaControl]:e("controls.controlNames.textArea"),[A.TextboxControl]:e("controls.controlNames.textBox"),[A.TickerControl]:e("controls.controlNames.ticker"),[A.UrlControl]:e("controls.controlNames.url"),[A.WebResourceHTMLControl]:e("controls.controlNames.webResourceHTML"),[A.WebResourceImageControl]:e("controls.controlNames.webResourceImage"),[A.IntegerControl]:e("controls.controlNames.integer"),[A.TimerControl]:e("controls.controlNames.timer"),[A.TimelineControl]:e("controls.controlNames.timeline"),[A.EmailBodyControl]:e("controls.controlNames.emailBody"),[A.PartyListControl]:e("controls.controlNames.partyList"),[A.TimezoneControl]:e("controls.controlNames.timezone"),[A.LanguageControl]:e("controls.controlNames.language"),[A.ChoiceStatusControl]:e("controls.controlNames.choiceStatus"),[A.ChoicesControl]:e("controls.controlNames.choices"),[A.RegardingControl]:e("controls.controlNames.regarding"),[A.EmailEngagementActionsControl]:e("controls.controlNames.emailEngagementActions"),[A.EmailRecipientActivityControl]:e("controls.controlNames.emailRecipientActivity"),[A.ReferencePanelSearchWidgetControl]:e("controls.controlNames.referencePanelSearchWidget"),[A.ReferencePanelQuickViewControl]:e("controls.controlNames.referencePanelQuickView"),[A.ReferencePanelSubgridControl]:e("controls.controlNames.referencePanelSubgrid"),[A.KBEditorControl]:e("controls.controlNames.KBEditor"),[A.LinkControl]:e("controls.controlNames.link")}}var A,Jo,Zr=D(()=>{"use strict";(function(e){e.AccessPrivilegeControl="F93A31B2-99AC-4084-8EC2-D4027C31369A",e.AccessTeamTablePickerControl="3f4e2a56-f102-4b4d-ab9c-f1574ca5bfda",e.ACIControl="C8BFBBEF-6851-4401-A0CC-7450062FE085",e.ActivitiesContainerControl="C72511AB-84E5-4FB7-A543-25B4FC01E83E",e.ActivitiesWallControl="6636847D-B74D-4994-B55A-A6FAF97ECEA2",e.AppliedFiltersControl="9C310A73-A360-42C5-8943-47A06F1B51EA",e.ArticleContentControl="F02EF977-2564-4B9A-B2F0-DF083D8A019B",e.BooleanControl="67FAC785-CD58-4F9F-ABB3-4B7DDC6ED5ED",e.ButtonControl="00AD73DA-BD4D-49C6-88A8-2F4F4CAD4A20",e.CheckboxControl="B0C6723A-8503-4FD7-BB28-C8A06AC933C2",e.CompositionLinkControl="DB1284EF-9FFC-4E99-B382-0CC082FE2364",e.ConnectionControl="3246F906-1F71-45F7-B11F-D7BE0F9D04C9",e.ConnectionRoleObjectTypeListControl="821ACF1A-7E46-4A0C-965D-FE14A57D78C7",e.CoverageChoiceControl="4168A05C-D857-46AF-8457-5BB47EB04EA1",e.DashboardControl="D2561F53-B292-42D9-B222-478E40FFE29F",e.DynamicPropertyListControl="6896F004-B17A-4202-861E-8B7EA2080E0B",e.EditFilterControl="1479835F-F852-4679-B864-C6892A2844C9",e.ErrorStatusControl="F4C16ECA-CA81-4E39-9448-834B8378721E",e.GlobalFilterControl="FFF0E632-9D7B-4F21-BBC1-05D1567AD144",e.HiddenInputControl="5546E6CD-394C-4BEE-94A8-4425E17EF6C6",e.KBViewerControl="A62B6FA9-169E-406C-B1AA-EAB828CB6026",e.LabelControl="39354E4A-5015-4D74-8031-EA9EB73A1322",e.MailMergeLanguagePickerControl="B634828E-C390-444A-AFE6-E07315D9D970",e.MapLinkControl="91DC0675-C8B9-4421-B1E0-261CEBF02BAC",e.OrgInsightsControl="76b9e25e-695e-4fef-ac69-f05cfa96739c",e.ChoiceLookupControl="2305e33a-bad3-4022-9e15-1856cf218333",e.PowerBIControl="8C54228C-1B25-4909-A12A-F2B968BB0D62",e.ProcessControl="06E9F7AF-1F54-4681-8EEC-1E21A1CEB465",e.RelatedInformationControl="163B90A6-EB64-49D2-9DF8-3C84A4F0A0F8",e.RelationshipRoleChoiceControl="5F986642-5961-4D9F-AB5E-643D71E231E9",e.ReportControl="A28F441B-916C-4865-87FD-0C5D53BD59C9",e.StreamsControl="EE9078C8-6946-4E2C-B8F8-35E65F4BE6A8",e.WebResourceSilverlightControl="080677DB-86EC-4544-AC42-F927E74B491F",e.CurrencyControl="533B9E00-756B-4312-95A0-DC888637AC78",e.CustomControl="F9A8A302-114E-466A-B582-6771B2AE0D92",e.DateTimeControl="5B773807-9FB2-42DB-97C3-7A91EFF8ADFF",e.DecimalControl="C3EFE0C3-0EC6-42BE-8349-CBD9079DFD8E",e.DurationControl="AA987274-CE4E-4271-A803-66164311A958",e.EmailAddressControl="ADA2203E-B4CD-49BE-9DDF-234642B43B52",e.EmailBodyControl="6F3FB987-393B-4D2D-859F-9D0F0349B6AD",e.EmailEngagementActionsControl="F454228D-1D25-4319-E12F-D27968BC0234",e.EmailRecipientActivityControl="26E9760F-7454-40DE-BB07-F6DCCCB82040",e.FileControl="0A7FF475-B016-4687-9CE5-042BFDBD6519",e.FloatingNumberControl="0D2C745A-E5A8-4C8F-BA63-C6D3BB604660",e.IframeControl="FD2A7985-3187-444E-908D-6624B21F69C0",e.ImageControl="7E548B0D-209C-477B-9DCD-F0F44472381D",e.LanguageControl="671A9387-CA5A-4D1E-8AB7-06E39DDCF6B5",e.LookupControl="270BD3DB-D9AF-4782-9025-509E298DEC0A",e.MapsControl="62B0DF79-0464-470F-8AF7-4483CFEA0C7D",e.ChoicesControl="4AA28AB7-9C13-4F57-A73D-AD894D048B5F",e.IntegerControl="C6D124CA-7EDA-4A60-AEA9-7FB8D318B68F",e.PartyListControl="CBFB742C-14E7-4A17-96BB-1A13F7F64AA2",e.PhoneNumberControl="8C10015A-B339-4982-9474-A95FE05631A5",e.ChoiceControl="3EF39988-22BB-4F0B-BBBE-64B5A3748AEE",e.ChoiceStatusControl="5D68B988-0661-4DB2-BC3E-17598AD3BE6C",e.QuickViewControl="5C5600E0-1D6E-4205-A272-BE80DA87FD42",e.QuickFormControl="69AF7DCA-2E3B-4EE7-9201-0DA731DD2413",e.RegardingControl="F3015350-44A2-4AA0-97B5-00166532B5E9",e.SearchWidgetControl="E616A57F-20E0-4534-8662-A101B5DDF4E0",e.SocialInsightsControl="86B9E25E-695E-4FEF-AC69-F05CFA96739C",e.SubgridControl="E7A81278-8635-4D9E-8D4D-59480B391C5B",e.TextAreaControl="E0DECE4B-6FC8-4A8F-A065-082708572369",e.TextboxControl="4273EDBD-AC1D-40D3-9FB2-095C621B552D",e.TickerControl="1E1FC551-F7A8-43AF-AC34-A8DC35C7B6D4",e.TimerControl="9C5CA0A1-AB4D-4781-BE7E-8DFBE867B87E",e.TimelineControl="06375649-C143-495E-A496-C962E5B4488E",e.TimezoneControl="7C624A0B-F59E-493D-9583-638D34759266",e.UrlControl="71716B6C-711E-476C-8AB8-5D11542BFB47",e.WebResourceHTMLControl="9FDF5F91-88B1-47F4-AD53-C11EFC01A01D",e.WebResourceImageControl="587CDF98-C1D5-4BDE-8473-14A0BC7644A7",e.ReferencePanelSearchWidgetControl="7CCD1494-1F7A-4E3A-8BDE-F32069DAEB9F",e.ReferencePanelSubgridControl="02D4264B-47E2-4B4C-AA95-F439F3F4D458",e.ReferencePanelQuickViewControl="B68B05F0-A46D-43F8-843B-917920AF806A",e.KBEditorControl="F94DB24F-263D-44A7-B38E-A35E9854812B",e.LinkControl="DFDF1CDE-837B-4AC9-98CF-AC74361FD89D"})(A||(A={}));Jo={[A.WebResourceHTMLControl]:"WebResource",[A.WebResourceImageControl]:"WebResource",[A.IframeControl]:"IFRAME",[A.SearchWidgetControl]:"Search widget",[A.SubgridControl]:"Subgrid",[A.TimelineControl]:"Timeline",[A.QuickViewControl]:"QuickviewControl"}});var en=m((u8,dh)=>{var sa=new Proxy(function(){return sa},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:sa},apply:function(){return sa},construct:function(){return{}}}),ch=function(){return sa};Object.setPrototypeOf(ch,sa);dh.exports=ch});var Xe,fr,ph,fh,Bn=D(()=>{"use strict";Xe="cds-designer-models",fr="FormCustomControl",ph="FormCell",fh="Form"});var kn,Ke,la=D(()=>{"use strict";kn=class{keys;values;constructor(){this.keys=[],this.values=[]}add(t,r){return this.containsKey(t)?!1:(this.keys.push(t),this.values.push(r),!0)}upsert(t,r){this.update(t,r)||this.add(t,r)}sortedUpsert(t,r){if(!this.update(t,r)){let n=0;for(;n<this.keys.length&&this.keys[n]<t;)n++;this.keys.splice(n,0,t),this.values.splice(n,0,r)}}clear(){this.keys=[],this.values=[]}containsKey(t){return this.keys.indexOf(t)!==-1}containsValue(t){return this.values.indexOf(t)!==-1}count(){return this.keys.length}getValue(t){let r=this.keys.indexOf(t);return r!==-1?this.values[r]:!1}getKeys(){return this.keys.slice()}getValues(){return this.values.slice()}remove(t){let r=this.keys.indexOf(t);return r!==-1?(this.keys.splice(r,1),this.values.splice(r,1),!0):!1}update(t,r){let n=this.keys.indexOf(t);return n!==-1?(this.values[n]=r,!0):!1}},Ke=class{data={};add(t,r){return this.containsKey(t)?!1:(this.data[t]=r,!0)}upsert(t,r){this.data[t]=r}clear(){this.data={}}containsKey(t){return this.data.hasOwnProperty(t)}containsValue(t){for(let r in this.data)if(this.data[r]===t)return!0;return!1}count(){return Object.keys(this.data).length}getValue(t){return this.containsKey(t)?this.data[t]:!1}getKeys(){return Object.keys(this.data)}getValues(){let t=[];for(let r in this.data)t.push(this.data[r]);return t}remove(t){return this.containsKey(t)?delete this.data[t]:!1}update(t,r){return this.containsKey(t)?(this.data[t]=r,!0):!1}getInternalObject(){return this.data}}});var tn,lc=D(()=>{"use strict";la();G();tn=class e{static lockedFieldCount=new Ke;static dependencyFieldCount=new Ke;static getNecessaryLookUpTable(t){switch(t){case Wt.DependencyFieldTable:return e.dependencyFieldCount;case Wt.LockedFieldTable:return e.lockedFieldCount}}static initCanvasLockedFieldLookUp(t){switch(t){case Wt.DependencyFieldTable:e.dependencyFieldCount=new Ke;case Wt.LockedFieldTable:e.lockedFieldCount=new Ke}}}});var Qo,mh=D(()=>{"use strict";De();Ce();G();Le();Qo=class extends q{constructor(t){super(g.controlDescription,t)}get forControl(){let t=this.getProperty(p.ForControl);return S.IsNullOrUndefined(t)?null:(t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),new _(t))}set forControl(t){this.setProperty(p.ForControl,`{${t.ToString()}}`)}get customControls(){return this.getChildren(g.customControl)}set customControls(t){this.deleteAllChildren();for(let r of t)this.addChild(r)}get DefaultControlClassId(){for(let t of this.customControls)if(!S.IsNullOrUndefined(t.id))return t.id;return null}get DefaultCustomControl(){for(let t of this.customControls)if(!S.IsNullOrUndefined(t.id))return t;return null}get DefaultCustomControls(){let t=[];for(let r of this.customControls)S.IsNullOrUndefined(r.id)||t.push(r);return t}async toJSON(t){let r=await this.getCustomControlsJSON(t);return r?{UniqueId:this.forControl.guidString,CustomControls:r,VersionNumber:0,OverallVersionNumber:0}:null}async getCustomControlsJSON(t){if(this.customControls){let r=[];for(let n of this.customControls){let i=await n.toJSON(t);i&&r.push(i)}return r}return null}}});var gh,vh,Ye,E,hh,Fr,rn,qn,uc,cc,$n=D(()=>{"use strict";gh={Name:"Name",Value:"Value",Type:"Type",TypeGroup:"TypeGroup",Usage:"Usage",Static:"Static",Primary:"Primary",Columns:"Columns",EnableViewPicker:"EnableViewPicker",EntityName:"EntityName",FilteredViewIds:"FilteredViewIds",ReferencingName:"ReferencingName",RelationshipName:"RelationshipName",RelationshipType:"RelationshipType",TargetEntityType:"TargetEntityType",ViewId:"ViewId",DependentAttributeName:"DependentAttributeName",DependentAttributeType:"DependentAttributeType",DefaultViewId:"DefaultViewId",BindAttribute:"BindAttribute",FilterRelationshipName:"FilterRelationshipName",AvailableViewIds:"AvailableViewIds",QuickForms:"QuickForms",EntityNameKey:"EntityNameKey",CardFormType:"Form.Card",CardFormId:"CardFormId",Hidden:"Hidden",Required:"Required",DefaultValue:"DefaultValue"},vh={GroupDefinition:"GroupDefinition"},Ye={Control:"control",Resources:"resources",DisplayNameKey:"display-name-key",descriptionKey:"description-key",value:"value",name:"name",defaultKey:"default",groups:"groups",group:"group",property:"property",hidden:"hidden",required:"required",typeGroup:"type-group",type:"type",usage:"usage",ofType:"of-type",ofTypeGroup:"of-type-group",ImageURL:"preview-image",DefaultValue:"default-value",static:"static",dataset:"data-set",propertySet:"property-set",initialDatasetFetch:"initial-data-set-fetch",editable:"editable",cdsDatasetOptions:"cds-data-set-options",allowDefaultSelectedItems:"allow-default-selected-items",resettable:"resettable",isGroup:"isGroup",entityName:"entityname"};(function(e){e.Boolean="Boolean",e.Currency="Currency",e.DateAndTimeDateAndTime="DateAndTime.DateAndTime",e.DateAndTimeDateOnly="DateAndTime.DateOnly",e.Decimal="Decimal",e.Enum="Enum",e.FP="FP",e.File="File",e.Guid="Guid",e.Image="Image",e.LookupCustomer="Lookup.Customer",e.LookupOwner="Lookup.Owner",e.LookupPartyList="Lookup.PartyList",e.LookupRegarding="Lookup.Regarding",e.LookupSimple="Lookup.Simple",e.Multiple="Multiple",e.MultiSelectOptionSet="MultiSelectOptionSet",e.OptionSet="OptionSet",e.SingleLineEmail="SingleLine.Email",e.SingleLinePhone="SingleLine.Phone",e.SingleLineText="SingleLine.Text",e.SingleLineTextArea="SingleLine.TextArea",e.SingleLineTickerSymbol="SingleLine.Ticker",e.SingleLineURL="SingleLine.URL",e.TwoOptions="TwoOptions",e.WholeDuration="Whole.Duration",e.WholeLanguage="Whole.Language",e.WholeNone="Whole.None",e.WholeTimeZone="Whole.TimeZone",e.BusinessProcessFlow="BusinessProcessFlow",e.CardForm="Form.Card",e.Dashboard="Dashboard",e.FormMain="Form.Main",e.Grid="Grid",e.PowerBIReport="PowerBI.Report",e.QuickForm="Form.QuickForm",e.Search="Search",e.SearchWidget="SearchWidget",e.TimelineWall="TimelineWall",e.UnboundCustomControl="Unbound",e.WebResourceHtmlControl="WebResource.HTML"})(E||(E={}));(function(e){e.BooleanType="CC_FlipLabel_Name",e.DateTimeType="CC_TextBox_Name",e.DecimalType="CC_TextBox_Name",e.DoubleType="CC_TextBox_Name",e.IntegerType="CC_TextBox_Name",e.LookupType="CC_TextBox_Name",e.MemoType="CC_TextArea_Name",e.MoneyType="CC_TextBox_Name",e.OptionSetType="CC_OptionSet_Name",e.StringType="CC_TextBox_Name",e.GridType="CC_ReadOnlyGrid_Name",e.UnboundCustomControlType="CC_UnboundCustomControl_Name"})(hh||(hh={}));(function(e){e.ArcKnobControl="MscrmControls.Knob.ArcKnobControl",e.CardFeedNameControl="MscrmControls.CardFeedContainer.CardFeedContainer",e.CheckboxControl="MscrmControls.FieldControls.CheckboxControl",e.DateTimeControl="MscrmControls.FieldControls.DateTimeControl",e.DurationControl="MscrmControls.FieldControls.DurationControl",e.EditableGridControl="MscrmControls.Grid.GridControl",e.EmailEngagementActionsControl="MscrmControls.EmailEngagement.EmailEngagementActionsControl",e.FormComponent="MscrmControls.ModelForm.ModelFormControl",e.LanguageCodeControl="MscrmControls.FieldControls.LanguagePickerControl",e.LinearSliderControl="MscrmControls.Slider.LinearSliderControl",e.MultiSelectOptionSetControl="MscrmControls.MultiSelectPicklist.UpdMSPicklistControl",e.OptionSetControl="MscrmControls.OptionSet.OptionSetControl",e.PowerBIPCFControl="MscrmControls.PowerBIPCFControl",e.PredictiveScoringWidget="MscrmControls.Sales.PredictiveScoringWidget.PredictiveScoringWidget",e.ReadonlyGrid="MscrmControls.Grid.ReadOnlyGrid",e.SimilarCasesGrid="MscrmControls.Containers.SimilarCasesGridControl",e.StarRatingControl="MscrmControls.Rating.StarRatingControl",e.TimeZoneControl="MscrmControls.FieldControls.TimeZonePickListControl",e.ModelFormControl="MscrmControls.ModelForm.ModelFormControl",e.AutoCompleteControl="MscrmControls.AutoComplete.AutoCompleteControl",e.CanvasAppControl="MscrmControls.Canvas.CanvasControl",e.PowerAppsOneGrid="Microsoft.PowerApps.PowerAppsOneGrid"})(Fr||(Fr={}));(function(e){e[e.Read=0]="Read",e[e.Edit=1]="Edit",e[e.Both=2]="Both",e[e.Container=3]="Container",e[e.Unknown=4]="Unknown"})(rn||(rn={}));(function(e){e[e.Bound=0]="Bound",e[e.Input=1]="Input",e[e.Output=2]="Output"})(qn||(qn={}));uc=[E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding,E.LookupSimple],cc=[E.WholeNone,E.WholeDuration,E.WholeLanguage,E.WholeTimeZone,E.FP,E.Decimal]});function mr(){return jt||(jt=window._makerConfig,jt&&window?.location?.search?.indexOf("useProductionConfig")>-1&&(jt={...jt,region:"prod",graphQLEndpoint:"https://graph.make.powerapps.com/"}),jt?.region==="prod"&&(jt={endpoints:{eu:{ch:{graphql:"https://graph-make.ch-cm001.gateway.prod.cm.powerapps.com/"},de:{graphql:"https://graph-make.de-cm001.gateway.prod.cm.powerapps.com/"},fr:{graphql:"https://graph-make.fr-cm001.gateway.prod.cm.powerapps.com/"},no:{graphql:"https://graph-make.no-cm001.gateway.prod.cm.powerapps.com/"},default:{graphql:"https://graph-make.eu-cm001.gateway.prod.cm.powerapps.com/"}}},...jt}),jt||{aadClientId:"a8f7a65c-f5ba-4859-b2d6-df772c264e9d",location:"cus",region:"test",publicPath:"/",graphQLEndpoint:"https://graph.make.test.powerapps.com/"})}var jt,Xo=D(()=>{"use strict";});function bh(e,t,r){if(!e)return Ko.has(e)||(window._ppux?.log?.("PPUX/Geo/NonExistent",{eventType:"Trace",team:"Shell",severity:"Error",errorCode:"GeoIsEmpty"}),Ko.add("")),!1;if(e){if(e=e.toLowerCase(),Ko.has(e))return!1;if(!(e in t))return window._ppux?.log?.("PPUX/Geo/NonExistent",{eventType:"Trace",team:"Shell",severity:"Error",errorCode:"GeoNonExistent",eventInfo:{missinggeo:e,parent:r}}),Ko.add(e),!1}return!0}function AO(e){return bh(e,dc,"Location dictionary")?dc[e.toLowerCase()]:"us"}function wO(){let e=mr().location.toLowerCase();return bh(e,dc,"Current location dictionary")?e:"us"}var Ko,dc,S8,yh=D(()=>{"use strict";Xo();Ko=new Set,dc={cae:"ae",nae:"ae",eas:"as",seas:"as",eau:"au",seau:"au",sbr:"br",cca:"ca",eca:"ca",nch:"ch",wch:"ch",nde:"de",wcde:"de",neu:"eu",weu:"eu",cfr:"fr",sfr:"fr",cin:"in",sin:"in",ejp:"jp",wjp:"jp",suk:"uk",wuk:"uk",eus:"us",wus:"us",cus:"us",ude:"us",udc:"us",ugtx:"us",ugva:"us",eus2:"us",wus2:"us",nza:"za",wza:"za",cne2:"cn",cnn2:"cn",skr:"kr",ckr:"kr",eno:"no",wno:"no",wrx:"us",erx:"us",wex:"us",eex:"us",unitedstates:"us",europe:"eu",asia:"as",australia:"au",japan:"jp",canada:"ca",india:"in",italy:"it",unitedstatesfirstrelease:"us",unitedkingdom:"uk",southamerica:"br",france:"fr",unitedarabemirates:"ae",germany:"de",sweden:"se",switzerland:"ch",korea:"kr",norway:"no",usgov:"us",usgovhigh:"us",usdod:"us",china:"cn",usnat:"us",ussec:"us",southafrica:"za",singapore:"sg",newzealand:"nz",poland:"pl",qatar:"qa",as:"as",au:"au",ca:"ca",in:"in",jp:"jp",kr:"kr",nz:"nz",ae:"ae",qa:"qa",us:"us",uk:"uk",eu:"eu",de:"de",ch:"ch",no:"no",fr:"fr",se:"se",it:"it",pl:"pl",be:"eu",bel:"eu",gr:"eu",grc:"eu",lt:"eu",ltu:"eu",pt:"eu",prt:"eu",bg:"eu",bgr:"eu",es:"eu",esp:"eu",lu:"eu",lux:"eu",ro:"eu",rou:"eu",cz:"eu",cze:"eu",hu:"eu",hun:"eu",si:"eu",svn:"eu",dk:"eu",dnk:"eu",hr:"eu",hrv:"eu",mt:"eu",mlt:"eu",sk:"eu",svk:"eu",nit:"it",nl:"eu",nld:"eu",fi:"eu",fin:"eu",ee:"eu",est:"eu",cy:"eu",cyp:"eu",at:"eu",aut:"eu",swe:"se",cse:"se",ie:"eu",irl:"eu",lv:"eu",lva:"eu",cpl:"pl",nnz:"nz",cqa:"qa",sg:"sg",br:"br",za:"za",sa:"za"};S8=AO(wO())});var x,E8,Ch=D(()=>{"use strict";x={USWest:"westus",USWest2:"westus2",USCentral:"centralus",USEast:"eastus",USEast2:"eastus2",USNorthCentral:"northcentralus",USSouthCentral:"southcentralus",USWestCentral:"westcentralus",CanadaCentral:"canadacentral",CanadaEast:"canadaeast",BrazilSouth:"brazilsouth",EuropeNorth:"northeurope",EuropeWest:"westeurope",UKSouth:"uksouth",UKWest:"ukwest",FranceCentral:"francecentral",FranceSouth:"francesouth",SwitzerlandNorth:"switzerlandnorth",SwitzerlandWest:"switzerlandwest",GermanyNorth:"germanynorth",GermanyWestCentral:"germanywestcentral",NorwayWest:"norwaywest",NorwayEast:"norwayeast",SwedenCentral:"swedencentral",ItalyNorth:"italynorth",PolandCentral:"polandcentral",AsiaEast:"eastasia",AsiaSouthEast:"southeastasia",JapanEast:"japaneast",JapanWest:"japanwest",AustraliaEast:"australiaeast",AustraliaSouthEast:"australiasoutheast",AustraliaCentral:"australiacentral",AustraliaCentral2:"australiacentral2",IndiaCentral:"centralindia",IndiaSouth:"southindia",IndiaWest:"westindia",KoreaSouth:"koreasouth",KoreaCentral:"koreacentral",NewZealandNorth:"newzealandnorth",UAECentral:"uaecentral",UAENorth:"uaenorth",SouthAfricaNorth:"southafricanorth",SouthAfricaWest:"southafricawest",QatarCentral:"qatarcentral",GermanyCentral:"germanycentral",GermanyNorthEast:"germanynortheast",SingaporeSouthEast:"southeastasia",GovernmentUSVirginia:"usgovvirginia",GovernmentUSIowa:"usgoviowa",GovernmentUSArizona:"usgovarizona",GovernmentUSTexas:"usgovtexas",GovernmentUSDodEast:"usdodeast",GovernmentUSDodCentral:"usdodcentral",ChinaNorth:"chinanorth",ChinaNorth2:"chinanorth2",ChinaNorth3:"chinanorth3",ChinaEast:"chinaeast",ChinaEast2:"chinaeast2",ChinaEast3:"chinaeast3",UssecEast:"usseceast",UssecWest:"ussecwest",UsnatEast:"usnateast",UsnatWest:"usnatwest"},E8={[x.USWest]:{geoName:"us",regionShortName:"wus"},[x.USCentral]:{geoName:"us",regionShortName:"cus"},[x.USEast]:{geoName:"us",regionShortName:"eus"},[x.USEast2]:{geoName:"us",regionShortName:"eus2"},[x.USWestCentral]:{geoName:"us",regionShortName:"wcus"},[x.USWest2]:{geoName:"us",regionShortName:"wus2"},[x.USSouthCentral]:{geoName:"br",regionShortName:"scus"},[x.BrazilSouth]:{geoName:"br",regionShortName:"sbr"},[x.UKSouth]:{geoName:"uk",regionShortName:"suk"},[x.UKWest]:{geoName:"uk",regionShortName:"wuk"},[x.JapanEast]:{geoName:"jp",regionShortName:"ejp"},[x.JapanWest]:{geoName:"jp",regionShortName:"wjp"},[x.IndiaCentral]:{geoName:"in",regionShortName:"cin"},[x.IndiaSouth]:{geoName:"in",regionShortName:"sin"},[x.ItalyNorth]:{geoName:"it",regionShortName:"nit"},[x.GermanyWestCentral]:{geoName:"de",regionShortName:"wcde"},[x.GermanyNorth]:{geoName:"de",regionShortName:"nde"},[x.EuropeNorth]:{geoName:"eu",regionShortName:"neu"},[x.EuropeWest]:{geoName:"eu",regionShortName:"weu"},[x.AustraliaEast]:{geoName:"au",regionShortName:"eau"},[x.AustraliaSouthEast]:{geoName:"au",regionShortName:"seau"},[x.AsiaSouthEast]:{geoName:"as",regionShortName:"seas"},[x.AsiaEast]:{geoName:"as",regionShortName:"eas"},[x.CanadaCentral]:{geoName:"ca",regionShortName:"cca"},[x.CanadaEast]:{geoName:"ca",regionShortName:"eca"},[x.SouthAfricaNorth]:{geoName:"za",regionShortName:"nza"},[x.SouthAfricaWest]:{geoName:"za",regionShortName:"wza"},[x.FranceCentral]:{geoName:"fr",regionShortName:"cfr"},[x.FranceSouth]:{geoName:"fr",regionShortName:"sfr"},[x.UAENorth]:{geoName:"ae",regionShortName:"nae"},[x.UAECentral]:{geoName:"ae",regionShortName:"cae"},[x.SwedenCentral]:{geoName:"se",regionShortName:"cse"},[x.SwitzerlandNorth]:{geoName:"ch",regionShortName:"nch"},[x.SwitzerlandWest]:{geoName:"ch",regionShortName:"wch"},[x.NorwayEast]:{geoName:"no",regionShortName:"eno"},[x.NorwayWest]:{geoName:"no",regionShortName:"wno"},[x.KoreaCentral]:{geoName:"kr",regionShortName:"ckr"},[x.KoreaSouth]:{geoName:"kr",regionShortName:"skr"},[x.SingaporeSouthEast]:{geoName:"sg",regionShortName:"seas"},[x.PolandCentral]:{geoName:"pl",regionShortName:"cpl"},[x.QatarCentral]:{geoName:"qa",regionShortName:"cqa"},[x.NewZealandNorth]:{geoName:"nz",regionShortName:"nnz"},[x.GovernmentUSTexas]:{geoName:"us",regionShortName:"ugtx"},[x.GovernmentUSVirginia]:{geoName:"us",regionShortName:"ugva"},[x.GovernmentUSDodCentral]:{regionShortName:"udc"},[x.GovernmentUSDodEast]:{regionShortName:"ude"},[x.ChinaEast]:{regionShortName:"cne"},[x.ChinaEast2]:{regionShortName:"cne2"},[x.ChinaEast3]:{regionShortName:"cne3"},[x.ChinaNorth]:{regionShortName:"cnn"},[x.ChinaNorth2]:{regionShortName:"cnn2"},[x.ChinaNorth3]:{regionShortName:"cnn3"},[x.UssecEast]:{geoName:"us",regionShortName:"erx"},[x.UssecWest]:{geoName:"us",regionShortName:"wrx"},[x.UsnatEast]:{geoName:"us",regionShortName:"eex"},[x.UsnatWest]:{geoName:"us",regionShortName:"wex"}}});var Ah=D(()=>{"use strict";Xo();});var ua=D(()=>{"use strict";Xo();yh();Ch();Ah();});function ca(e,t){return wh?wh.isOverridden(e,t):{overridden:!1}}var wh,da=D(()=>{"use strict";});var pc=D(()=>{"use strict";ua();da();});function NO(e,t){let{region:r}=mr();return()=>{let n=e.settings[t];if(n.allowOverrides){let s=ca(e.packageName,t);if(s.overridden)return typeof s.value=="string"?SO(s.value):s.value}let a=n.values,o=process.env.SETTINGS_FALLBACK_REGION?.[r];return a[r]!==void 0?a[r]:o&&a[o]!==void 0?a[o]:a.default}}function SO(e){return isNaN(Number(e))?e==="true"?!0:e==="false"?!1:e:Number(e)}function DO(e){let t=e.packageName;if(Yo.has(t)){let r=`settings has already been created for this package ${t}`;throw console.error(r),new Error(r)}if(Object.keys(e.settings).some(r=>mc(t,r))){let r=`error parsing settings config for package ${t}, a feature gate with the same name exists`;throw console.error(r),new Error(r)}Object.keys(e.settings).forEach(r=>{if(Object.keys(e.settings[r].values).filter(i=>i!=="default").some(i=>!es(i))){let i=`error parsing settings config for package ${t}, setting ${r} has invalid region`;throw console.error(i),new Error(i)}})}function pa(e){DO(e);let t={};return Object.keys(e.settings).forEach(r=>{t[r]={enumerable:!0,get:NO(e,r)}}),Yo.set(e.packageName,e),Object.defineProperties({},t)}function fc(e,t){return Yo.has(e)?!!Yo.get(e).settings[t]:!1}var Yo,Zo=D(()=>{"use strict";ua();da();hc();fa();Yo=new Map});function Nh(e,t){let{region:r}=mr();return()=>{let n=ca(e.packageName,t);if(n.overridden)return n.value.toString()==="true";let i=e.features[t].enabledFor,a=process.env.SETTINGS_FALLBACK_REGION?.[r];return i[r]!==void 0?!!i[r]:a&&i[a]!==void 0?!!i[a]:!1}}function EO(e){let t=e.packageName;if(ts.has(t)){let r="feature gates has already been created for this package";throw console.error(r),new Error(r)}if(Object.keys(e.features).some(r=>fc(t,r))){let r=`error parsing feature gates config for package ${t}, a setting with the same name exists`;throw console.error(r),new Error(r)}Object.keys(e.features).forEach(r=>{if(Object.keys(e.features[r].enabledFor).some(i=>!es(i))){let i=`error parsing feature gates config for package ${t}, feature ${r} has invalid region`;throw console.error(i),new Error(i)}})}function gc(e){EO(e);let t={};Object.keys(e.features).forEach(i=>{t[i]={enumerable:!0,configurable:!0,get:Nh(e,i)}});let r={},n=new Set;return t.dangerouslySet={enumerable:!1,value:(i,a)=>{n.add(i),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,value:a})}},t.dangerouslyReset={enumerable:!1,value:()=>{let i={};n.forEach(a=>{i[a.toString()]={enumerable:!0,configurable:!0,get:Nh(e,a.toString())}}),Object.defineProperties(r,i),n.clear()}},ts.set(e.packageName,e),Object.defineProperties(r,t)}function mc(e,t){return ts.has(e)?!!ts.get(e).features[t]:!1}var ts,hc=D(()=>{"use strict";ua();fa();da();Zo();ts=new Map});var Dh=m((K8,Sh)=>{"use strict";Sh.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}});var _h=m(vc=>{"use strict";var IO=Object.prototype.hasOwnProperty,_O;function Eh(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Ih(e){try{return encodeURIComponent(e)}catch{return null}}function PO(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var i=Eh(n[1]),a=Eh(n[2]);i===null||a===null||i in r||(r[i]=a)}return r}function OO(e,t){t=t||"";var r=[],n,i;typeof t!="string"&&(t="?");for(i in e)if(IO.call(e,i)){if(n=e[i],!n&&(n===null||n===_O||isNaN(n))&&(n=""),i=Ih(i),n=Ih(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?t+r.join("&"):""}vc.stringify=OO;vc.parse=PO});var Cc=m((Z8,xh)=>{"use strict";var Oh=Dh(),rs=_h(),Th=/[\n\r\t]/g,TO=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,RO=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,FO=/^[a-zA-Z]:/,xO=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function yc(e){return(e||"").toString().replace(xO,"")}var bc=[["#","hash"],["?","query"],function(t,r){return Ht(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Ph={hash:1,query:1};function Rh(e){var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},i=typeof e,a;if(e.protocol==="blob:")n=new Jt(unescape(e.pathname),{});else if(i==="string"){n=new Jt(e,{});for(a in Ph)delete n[a]}else if(i==="object"){for(a in e)a in Ph||(n[a]=e[a]);n.slashes===void 0&&(n.slashes=TO.test(e.href))}return n}function Ht(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Fh(e,t){e=yc(e),e=e.replace(Th,""),t=t||{};var r=RO.exec(e),n=r[1]?r[1].toLowerCase():"",i=!!r[2],a=!!r[3],o=0,s;return i?a?(s=r[2]+r[3]+r[4],o=r[2].length+r[3].length):(s=r[2]+r[4],o=r[2].length):a?(s=r[3]+r[4],o=r[3].length):s=r[4],n==="file:"?o>=2&&(s=s.slice(2)):Ht(n)?s=r[4]:n?i&&(s=s.slice(2)):o>=2&&Ht(t.protocol)&&(s=r[4]),{protocol:n,slashes:i||Ht(n),slashesCount:o,rest:s}}function LO(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,i=r[n-1],a=!1,o=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),o++):o&&(n===0&&(a=!0),r.splice(n,1),o--);return a&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Jt(e,t,r){if(e=yc(e),e=e.replace(Th,""),!(this instanceof Jt))return new Jt(e,t,r);var n,i,a,o,s,l,u=bc.slice(),c=typeof t,d=this,f=0;for(c!=="object"&&c!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=rs.parse),t=Rh(t),i=Fh(e||"",t),n=!i.protocol&&!i.slashes,d.slashes=i.slashes||n&&t.slashes,d.protocol=i.protocol||t.protocol||"",e=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||FO.test(e))||!i.slashes&&(i.protocol||i.slashesCount<2||!Ht(d.protocol)))&&(u[3]=[/(.*)/,"pathname"]);f<u.length;f++){if(o=u[f],typeof o=="function"){e=o(e,d);continue}a=o[0],l=o[1],a!==a?d[l]=e:typeof a=="string"?(s=a==="@"?e.lastIndexOf(a):e.indexOf(a),~s&&(typeof o[2]=="number"?(d[l]=e.slice(0,s),e=e.slice(s+o[2])):(d[l]=e.slice(s),e=e.slice(0,s)))):(s=a.exec(e))&&(d[l]=s[1],e=e.slice(0,s.index)),d[l]=d[l]||n&&o[3]&&t[l]||"",o[4]&&(d[l]=d[l].toLowerCase())}r&&(d.query=r(d.query)),n&&t.slashes&&d.pathname.charAt(0)!=="/"&&(d.pathname!==""||t.pathname!=="")&&(d.pathname=LO(d.pathname,t.pathname)),d.pathname.charAt(0)!=="/"&&Ht(d.protocol)&&(d.pathname="/"+d.pathname),Oh(d.port,d.protocol)||(d.host=d.hostname,d.port=""),d.username=d.password="",d.auth&&(s=d.auth.indexOf(":"),~s?(d.username=d.auth.slice(0,s),d.username=encodeURIComponent(decodeURIComponent(d.username)),d.password=d.auth.slice(s+1),d.password=encodeURIComponent(decodeURIComponent(d.password))):d.username=encodeURIComponent(decodeURIComponent(d.auth)),d.auth=d.password?d.username+":"+d.password:d.username),d.origin=d.protocol!=="file:"&&Ht(d.protocol)&&d.host?d.protocol+"//"+d.host:"null",d.href=d.toString()}function MO(e,t,r){var n=this;switch(e){case"query":typeof t=="string"&&t.length&&(t=(r||rs.parse)(t)),n[e]=t;break;case"port":n[e]=t,Oh(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var i=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==i?i+t:t}else n[e]=t;break;case"username":case"password":n[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(n.username=t.slice(0,a),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(a+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t))}for(var o=0;o<bc.length;o++){var s=bc[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Ht(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function UO(e){(!e||typeof e!="function")&&(e=rs.stringify);var t,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var a=i+(r.protocol&&r.slashes||Ht(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):r.protocol!=="file:"&&Ht(r.protocol)&&!n&&r.pathname!=="/"&&(a+="@"),n[n.length-1]===":"&&(n+=":"),a+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(a+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(a+=r.hash),a}Jt.prototype={set:MO,toString:UO};Jt.extractProtocol=Fh;Jt.location=Rh;Jt.trimLeft=yc;Jt.qs=rs;xh.exports=Jt});var BO,Lh=D(()=>{"use strict";BO=ne(Cc());});function Ac(e,t,r){let n=Object.keys(r).sort();if(n.length===0)throw new Error(`ECS feature has no properties: ${e}.${t}`);let i=`ecs.${e}.${t}`;return n.length===1?`${i}.${n[0]}`:`${i}.{${n.join(";")}}`}var ns=D(()=>{"use strict";});var wc,Nc,Sc=D(()=>{"use strict";ns();wc=class{features=new Map;register(t,r){let n=Ac(r,t.teamName,t.fallback),i={clientName:r,teamName:t.teamName,fullName:n,description:t.description,owners:t.owners,ecsURL:t.ecsURL,createdOn:t.createdOn,fallbackConfig:t.fallback,feature:t,displayTeam:t.displayTeam,tags:t.tags,category:t.category};this.features.set(n,i)}getAll(){return Array.from(this.features.values())}get(t){return this.features.get(t)}has(t){return this.features.has(t)}getByClient(t){return this.getAll().filter(r=>r.clientName===t)}getByTeam(t){return this.getAll().filter(r=>r.teamName===t)}search(t){let r=t.toLowerCase();return this.getAll().filter(n=>n.fullName.toLowerCase().includes(r)||n.description?.toLowerCase().includes(r)||n.teamName.toLowerCase().includes(r)||n.clientName.toLowerCase().includes(r))}getClientNames(){let t=new Set;return this.features.forEach(r=>t.add(r.clientName)),Array.from(t)}getTeamNames(){let t=new Set;return this.features.forEach(r=>t.add(r.teamName)),Array.from(t)}clear(){this.features.clear()}},Nc=new wc});var Dc=D(()=>{"use strict";});function es(e){return kO.has(e)}var kO,fa=D(()=>{"use strict";pc();hc();Zo();da();pc();Lh();Sc();ns();Dc();kO=new Set(["tie","test","prod","preview","preprod","gov","high","dod","mooncake","ex","rx"])});var qO,Mh=D(()=>{"use strict";fa();qO=pa({packageName:"cds-designer-models",settings:{testCustomControls:{description:"Test Custom Controls to show up in the component picker.",allowOverrides:!0,values:{default:"",test:"",preprod:"",preview:"",gov:""}}}})});var is,O,L,nn,Vn,as,Uh,Bh,Ec,ma=D(()=>{"use strict";la();is=class{name;constructor(t){this.name=t}toString(){return this.name}getName(){return this.name}getDisplayNameResourceKey(){return Ec.getDisplayNameResourceKey(this.name)}};(function(e){e.BigInt="BigIntType",e.CalendarRulesType="CalendarRulesType",e.Currency="MoneyType",e.Customer="Customer",e.CustomerType="CustomerType",e.DateTime="DateTimeType",e.DecimalNumber="DecimalType",e.EntityNameType="EntityNameType",e.FloatingPointNumber="DoubleType",e.Image="ImageType",e.File="FileType",e.Lookup="Lookup",e.LookupType="LookupType",e.ManagedPropertyType="ManagedPropertyType",e.MultipleLineofText="MemoType",e.MultiSelectOptionSet="MultiSelectPicklistType",e.OptionSet="PicklistType",e.Owner="Owner",e.OwnerType="OwnerType",e.PartyList="PartyList",e.PartyListType="PartyListType",e.PrimaryNameAttributeType="String",e.SingleLineofText="StringType",e.State="StateType",e.Status="StatusType",e.Subject="Subject",e.TimeStamp="TimeStampType",e.TwoOptions="BooleanType",e.UniqueIdentifier="Uniqueidentifier",e.UniqueIdentifierType="UniqueidentifierType",e.VirtualType="VirtualType",e.WholeNumber="IntegerType"})(O||(O={}));(function(e){e.Email="Email",e.Text="Text",e.TextArea="TextArea",e.Url="Url",e.TickerSymbol="TickerSymbol",e.PhoneticGuide="PhoneticGuide",e.VersionNumber="VersionNumber",e.Phone="Phone",e.None="None",e.Duration="Duration",e.TimeZone="TimeZone",e.Language="Language",e.Locale="Locale",e.DateOnly="DateOnly",e.DateAndTime="DateAndTime",e.Picklist="Picklist",e.State="State",e.Status="Status",e.Boolean="Boolean",e.Regarding="Regarding"})(L||(L={}));nn=class extends is{constructor(t){super(t)}static get None(){return"None"}static get SystemRequired(){return"SystemRequired"}static get ApplicationRequired(){return"ApplicationRequired"}static get Recommended(){return"Recommended"}},Vn=class e extends is{constructor(t){super(t),t||(this.name=e.None)}static get None(){return"None"}static get Persistent(){return"Persistent"}static get Calculated(){return"Calculated"}static get Rollup(){return"Rollup"}GetValue(){return this.name===e.None?as.Persistent:parseInt(as[this.name])}};(function(e){e[e.Persistent=0]="Persistent",e[e.Calculated=1]="Calculated",e[e.Rollup=2]="Rollup"})(as||(as={}));(function(e){e[e.Undefined=0]="Undefined",e[e.Simple=1]="Simple",e[e.Related=2]="Related",e[e.Logical=4]="Logical",e[e.Calculated=8]="Calculated",e[e.Rollup=16]="Rollup",e[e.Invalid=32]="Invalid"})(Uh||(Uh={}));(function(e){e[e.Attribute=0]="Attribute",e[e.Organization=1]="Organization",e[e.Currency=2]="Currency"})(Bh||(Bh={}));Ec=class e{static resourceKeyMap=e.initResourceKeyMap();static initResourceKeyMap(){let t=new kn;return t.add(O.TwoOptions,"SystemCustomization.type.bit.label"),t.add(O.Customer,"SystemCustomization.type.customer.label"),t.add(O.CustomerType,"SystemCustomization.type.customer.label"),t.add(O.DateTime,"SystemCustomization.type.datetime.label"),t.add(O.DecimalNumber,"SystemCustomization.type.decimal.label"),t.add(O.FloatingPointNumber,"SystemCustomization.type.float.label"),t.add(O.WholeNumber,"SystemCustomization.type.int.label"),t.add(O.LookupType,"SystemCustomization.type.lookup.label"),t.add(O.Lookup,"SystemCustomization.type.lookup.label"),t.add(O.MultipleLineofText,"SystemCustomization.type.ntext.label"),t.add(O.Currency,"SystemCustomization.type.money.label"),t.add(O.Owner,"SystemCustomization.type.owner.label"),t.add(O.OwnerType,"SystemCustomization.type.owner.label"),t.add(O.PartyList,"SystemCustomization.type.partylist.label"),t.add(O.PartyListType,"SystemCustomization.type.partylist.label"),t.add(O.OptionSet,"SystemCustomization.type.picklist.label"),t.add(O.State,"SystemCustomization.type.state.label"),t.add(O.Status,"SystemCustomization.type.status.label"),t.add(O.SingleLineofText,"SystemCustomization.type.nvarchar.label"),t.add(O.UniqueIdentifier,"SystemCustomization.type.uniqueidentifier.label"),t.add(O.UniqueIdentifierType,"SystemCustomization.type.uniqueidentifiertype.label"),t.add(O.CalendarRulesType,"SystemCustomization.type.calendarrules.label"),t.add(O.VirtualType,"SystemCustomization.type.virtual.label"),t.add(O.BigInt,"SystemCustomization.type.bigint.label"),t.add(O.ManagedPropertyType,"SystemCustomization.type.managedproperty.label"),t.add(O.EntityNameType,"SystemCustomization.type.entityname.label"),t.add(O.Image,"SystemCustomization.type.image.label"),t.add(O.MultiSelectOptionSet,"SystemCustomization.type.multiselectpicklist.label"),t.add(O.PrimaryNameAttributeType,"SystemCustomization.type.primaryname.label"),t.add(O.LookupType,"SystemCustomization.type.lookuptype.label"),t.add(O.Subject,"SystemCustomization.type.subject.label"),t.add(L.Email,"SystemCustomization.String.Format.email"),t.add(L.Text,"SystemCustomization.String.Format.text"),t.add(L.TextArea,"SystemCustomization.String.Format.textarea"),t.add(L.Url,"SystemCustomization.String.Format.url"),t.add(L.TickerSymbol,"SystemCustomization.String.Format.tickersymbol"),t.add(L.PhoneticGuide,"SystemCustomization.String.Format.phoneticguide"),t.add(L.VersionNumber,"SystemCustomization.String.Format.versionnumber"),t.add(L.Phone,"SystemCustomization.String.Format.phone"),t.add(L.None,"SystemCustomization.Integer.Format."),t.add(L.Duration,"SystemCustomization.Integer.Format.duration"),t.add(L.TimeZone,"SystemCustomization.Integer.Format.timezone"),t.add(L.Language,"SystemCustomization.Integer.Format.language"),t.add(L.Locale,"SystemCustomization.Integer.Format.language"),t.add(L.DateOnly,"SystemCustomization.DateTime.Format.date"),t.add(L.DateAndTime,"SystemCustomization.DateTime.Format.datetime"),t.add(L.Regarding,"SystemCustomization.Lookup.Format.regarding"),t.add(Vn.Persistent,"SystemCustomization.String.Source.persistent"),t.add(Vn.Calculated,"SystemCustomization.String.Source.calculated"),t.add(Vn.Rollup,"SystemCustomization.String.Source.rollup"),t.add(Vn.None,"SystemCustomization.String.Source.none"),t}static getDisplayNameResourceKey(t){return e.resourceKeyMap.getValue(t)}}});var Vh,_c,Gn,an,Ic,os,zn,hr,le,kh,qh,$h,Rt=D(()=>{"use strict";Vh={ThreeEqColumn_FirstColumn:34,ThreeEqColumn_SecondColumn:33,ThreeEqColumn_ThirdColumn:33,FiveEqColumn:20},_c={ONE_COLUMN:"1",TWO_COLUMN:"2",THREE_COLUMN:"3",FOUR_COLUMN:"4"};(function(e){e[e.SUBGRID=0]="SUBGRID",e[e.SPACER=1]="SPACER",e[e.QUICK_VIEW=2]="QUICK_VIEW",e[e.WEB_RESOURCE=3]="WEB_RESOURCE",e[e.IFRAME=4]="IFRAME",e[e.BING_MAPS=5]="BING_MAPS",e[e.TIMER=6]="TIMER",e[e.TIMELINE=7]="TIMELINE",e[e.SOCIAL_INSIGHTS=8]="SOCIAL_INSIGHTS",e[e.KB_SEARCH=9]="KB_SEARCH",e[e.ACI_CONTROL=10]="ACI_CONTROL",e[e.RELATIONSHIP_ASSISTANT=11]="RELATIONSHIP_ASSISTANT",e[e.REFERENCE_PANEL=12]="REFERENCE_PANEL",e[e.REF_PANEL_QUICKVIEW=13]="REF_PANEL_QUICKVIEW",e[e.REF_PANEL_SUBGRID=14]="REF_PANEL_SUBGRID",e[e.REF_PANEL_KBSEARCH=15]="REF_PANEL_KBSEARCH",e[e.WEB_RESOURCE_HTML=16]="WEB_RESOURCE_HTML",e[e.PRED_LEAD_SCORING=17]="PRED_LEAD_SCORING"})(Gn||(Gn={}));(function(e){e.Left="Left",e.Right="Right",e.Center="Center"})(an||(an={}));(function(e){e[e.Mobile=0]="Mobile",e[e.Tablet=1]="Tablet",e[e.Web=2]="Web"})(Ic||(Ic={}));os=class{static ONE_COLUMN=1;static TWO_COLUMN=2;static THREE_COLUMN=3;static FIVE_COLUMN=5};(function(e){e.Left="Left",e.Top="Top"})(zn||(zn={}));hr=class{static StartTag="<"},le={ShowLabel:"true",LockLevel:"0",IsUserDefined:"0",LabelWidth:"115",columns:"1",ShowBar:"false",Layout:"varwidth",namePrefix:"_section_",labelAlignment:an.Left,labelPosition:zn.Left,MarginalControlColumns:"111",referencePanelNamePrefix:"ref_pan_"};(function(e){e.AddFormBodyFieldToReadOnlyHeader="AddFormBodyFieldToReadOnlyHeader",e.AddFieldPaneFieldToReadOnlyHeader="AddFieldPaneFieldToReadOnlyHeader",e.AddFieldExceedsReadOnlyHeaderLimit="AddFieldExceedsReadOnlyHeaderLimit",e.AddCustomComponentToReadOnlyHeader="AddCustomComponentToReadOnlyHeader",e.AddNonDisplayableComponentToReadOnlyHeader="AddNonDisplayableComponentToReadOnlyHeader",e.AddFieldToFlyoutOnly="AddFieldToFlyoutOnly",e.DisplayedFieldToFlyout="DisplayedFieldToFlyout",e.FlyoutFieldToDisplayed="FlyoutFieldToDisplayed",e.AddControlBeforeDefaultLabel="AddControlBeforeDefaultLabel"})(kh||(kh={}));(function(e){e.TabWithLockedFieldRemoval="TabWithLockedFieldRemoval",e.SectionWithLockedFieldRemoval="SectionWithLockedFieldRemoval",e.LockedSectionRemoval="LockedSectionRemoval",e.LockedFieldRemoval="LockedFieldRemoval",e.RequiredFieldRemoval="RequiredFieldRemoval",e.LastRemainingTab="LastRemainingTab",e.UnknownRemoval="UnknownRemoval"})(qh||(qh={}));(function(e){e.IsHeader="IsHeader",e.IsFooter="IsFooter",e.ContainedInHeader="ContainedInHeader",e.ContainedInFooter="ContainedInFooter",e.NoElementFound="NoElementFound",e.NoTarget="NoTarget",e.CannotAddControlToHeader="CannotAddControlToHeader",e.CannotAddControlToFooter="CannotAddControlToFooter"})($h||($h={}))});var ha=m(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.DateTimeBehavior=C.PrecisionSource=C.StringFormatName=C.SourceType=C.ImeMode=C.SolutionEntityTypeCodeExtToComponentTypeCode=C.SolutionComponentTypeCodeToEntityTypeCodeExt=C.SolutionComponentVirtualAttributeSubtype=C.EntityTypeCode=C.SolutionComponentTypeCodeExt=C.RootComponentBehavior=C.SolutionComponentTypeCode=C.EntityKeyIndexStatus=C.ViewStateCode=C.ViewStatusCode=C.RelationshipSecurityTypes=C.CascadeType=C.RelationshipTypeExt=C.RelationshipType=C.AppSubType=C.BusinessProcessType=C.WorkflowCategory=C.WorkflowScope=C.WorkflowTypeCode=C.StatusCodeEnabledDisabled=C.StateCodeEnabledDisabled=C.StatusCode=C.StateCode=C.OptionSetType=C.AttributeTypeCodeNum=C.AttributeFormatName=C.AttributeFormatCode=C.AttributeTypeName=C.AttributeTypeCode=C.PluginSourceType=C.AuthType=C.PluginIsolationMode=C.ComponentState=C.ChartType=C.ChartsType=C.ViewType=C.AttributeType=C.ActivationState=C.FormPresentation=C.FormType=C.TableTypeCode=C.TableTypes=C.ActivityTypeMask=C.PrincipalType=C.OwnershipTypes=void 0;C.QueryType=C.KnownCustomSolutionComponentEntitySetName=C.TeamTypeEnum=C.EnvironmentVariableDefinitionTypeEnum=C.ConnectorTypeEnum=C.RoleInheritance=C.DefaultRoleTemplates=C.DeleteDependencyErrorCode=C.ServiceEndpointConnectionMode=C.ServiceEndpointContract=C.ServiceNamespaceFormat=C.ConnectionRoleCategory=C.ReportTypeCode=C.SdkMessageProcessingMode=C.SupportedDeployment=C.SdkMessageProcessingStage=C.WebResourceTypeCode=C.IntegerFormat=C.DateTimeFormat=void 0;var Gh;(function(e){e.None="None",e.UserOwned="UserOwned",e.TeamOwned="TeamOwned",e.BusinessOwned="BusinessOwned",e.OrganizationOwned="OrganizationOwned",e.BusinessParented="BusinessParented",e.Filtered="Filtered"})(Gh||(C.OwnershipTypes=Gh={}));var zh;(function(e){e.User="Microsoft.Dynamics.CRM.systemuser",e.Team="Microsoft.Dynamics.CRM.team"})(zh||(C.PrincipalType=zh={}));var Wh;(function(e){e[e.DoNotDisplayInActivityMenus=0]="DoNotDisplayInActivityMenus",e[e.DisplayInActivityMenus=1]="DisplayInActivityMenus"})(Wh||(C.ActivityTypeMask=Wh={}));var jh;(function(e){e.Activity="Activity",e.Virtual="Virtual",e.Standard="Standard",e.Elastic="Elastic"})(jh||(C.TableTypes=jh={}));var Hh;(function(e){e.Standard="Standard",e.Virtual="Virtual",e.Elastic="Elastic"})(Hh||(C.TableTypeCode=Hh={}));var Jh;(function(e){e[e.Dashboard=0]="Dashboard",e[e.AppointmentBook=1]="AppointmentBook",e[e.Main=2]="Main",e[e.MiniCampaignBO=3]="MiniCampaignBO",e[e.Preview=4]="Preview",e[e.MobileExpress=5]="MobileExpress",e[e.QuickViewForm=6]="QuickViewForm",e[e.QuickCreate=7]="QuickCreate",e[e.Dialog=8]="Dialog",e[e.TaskFlowForm=9]="TaskFlowForm",e[e.InteractionCentricDashboard=10]="InteractionCentricDashboard",e[e.Card=11]="Card",e[e.MainInteractiveExperience=12]="MainInteractiveExperience",e[e.Other=100]="Other",e[e.MainBackup=101]="MainBackup",e[e.AppointmentBookBackup=102]="AppointmentBookBackup",e[e.PowerBIDashboard=103]="PowerBIDashboard"})(Jh||(C.FormType=Jh={}));var Qh;(function(e){e[e.ClassicForm=0]="ClassicForm",e[e.AirForm=1]="AirForm",e[e.ConvertedICForm=2]="ConvertedICForm"})(Qh||(C.FormPresentation=Qh={}));var Xh;(function(e){e[e.Inactive=0]="Inactive",e[e.Active=1]="Active"})(Xh||(C.ActivationState=Xh={}));var Kh;(function(e){e[e.String=0]="String",e[e.Number=1]="Number",e[e.Picklist=2]="Picklist"})(Kh||(C.AttributeType=Kh={}));var Yh;(function(e){e[e.Public=0]="Public",e[e.AdvancedFind=1]="AdvancedFind",e[e.Associated=2]="Associated",e[e.QuickFind=4]="QuickFind",e[e.Lookup=64]="Lookup"})(Yh||(C.ViewType=Yh={}));var Zh;(function(e){e[e.ASPChart=0]="ASPChart",e[e.PowerBI=1]="PowerBI"})(Zh||(C.ChartsType=Zh={}));var eg;(function(e){e[e.DataAndInteractionCentric=0]="DataAndInteractionCentric",e[e.InteractionCentric=1]="InteractionCentric"})(eg||(C.ChartType=eg={}));var tg;(function(e){e[e.Published=0]="Published",e[e.Unpublished=1]="Unpublished",e[e.Deleted=2]="Deleted",e[e.DeletedUnpublished=3]="DeletedUnpublished"})(tg||(C.ComponentState=tg={}));var rg;(function(e){e[e.None=1]="None",e[e.Sandbox=2]="Sandbox",e[e.External=3]="External"})(rg||(C.PluginIsolationMode=rg={}));var ng;(function(e){e[e.BasicAuth=0]="BasicAuth"})(ng||(C.AuthType=ng={}));var ig;(function(e){e[e.Database=0]="Database",e[e.Disk=1]="Disk",e[e.Normal=2]="Normal",e[e.AzureWebApp=3]="AzureWebApp"})(ig||(C.PluginSourceType=ig={}));var ag;(function(e){e.Boolean="Boolean",e.Customer="Customer",e.Date="Date",e.DateTime="DateTime",e.DateTimeNoTimeZone="DateTimeNoTimeZone",e.Decimal="Decimal",e.Double="Double",e.Integer="Integer",e.Lookup="Lookup",e.Memo="Memo",e.Money="Money",e.Owner="Owner",e.PartyList="PartyList",e.Picklist="Picklist",e.State="State",e.Status="Status",e.String="String",e.Uniqueidentifier="Uniqueidentifier",e.CalendarRules="CalendarRules",e.Virtual="Virtual",e.BigInt="BigInt",e.ManagedProperty="ManagedProperty",e.EntityName="EntityName"})(ag||(C.AttributeTypeCode=ag={}));var og;(function(e){e.DateTimeType="DateTimeType",e.ImageType="ImageType",e.IntegerType="IntegerType",e.FileType="FileType",e.BooleanType="BooleanType",e.CustomerType="CustomerType",e.MemoType="MemoType",e.MultiSelectPicklistType="MultiSelectPicklistType",e.MoneyType="MoneyType",e.DecimalType="DecimalType",e.DoubleType="DoubleType",e.LookupType="LookupType",e.BigIntType="BigIntType",e.UniqueidentifierType="UniqueidentifierType",e.StringType="StringType",e.OwnerType="OwnerType",e.PicklistType="PicklistType",e.StateType="StateType",e.StatusType="StatusType",e.EntityNameType="EntityNameType"})(og||(C.AttributeTypeName=og={}));var sg;(function(e){e.Email="Email",e.Text="Text",e.TextArea="TextArea",e.Url="Url",e.TickerSymbol="TickerSymbol",e.PhoneticGuide="PhoneticGuide",e.VersionNumber="VersionNumber",e.Phone="Phone",e.Json="Json",e.RichText="RichText",e.DateOnly="DateOnly",e.DateAndTime="DateAndTime",e.None="None",e.Duration="Duration",e.TimeZone="TimeZone",e.Language="Language",e.Locale="Locale"})(sg||(C.AttributeFormatCode=sg={}));var lg;(function(e){e.Text="Text",e.TextArea="TextArea",e.Email="Email",e.Url="Url",e.Phone="Phone",e.Json="Json",e.RichText="RichText",e.TickerSymbol="TickerSymbol",e.PhoneticGuide="PhoneticGuide",e.VersionNumber="VersionNumber",e.DateOnly="DateOnly",e.DateAndTime="DateAndTime"})(lg||(C.AttributeFormatName=lg={}));var ug;(function(e){e[e.Boolean=0]="Boolean",e[e.Customer=1]="Customer",e[e.DateTime=2]="DateTime",e[e.Decimal=3]="Decimal",e[e.Double=4]="Double",e[e.Integer=5]="Integer",e[e.Lookup=6]="Lookup",e[e.Memo=7]="Memo",e[e.Money=8]="Money",e[e.Owner=9]="Owner",e[e.PartyList=10]="PartyList",e[e.Picklist=11]="Picklist",e[e.State=12]="State",e[e.Status=13]="Status",e[e.String=14]="String",e[e.Uniqueidentifier=15]="Uniqueidentifier",e[e.CalendarRules=16]="CalendarRules",e[e.Virtual=17]="Virtual",e[e.BigInt=18]="BigInt",e[e.ManagedProperty=19]="ManagedProperty",e[e.EntityName=20]="EntityName"})(ug||(C.AttributeTypeCodeNum=ug={}));var cg;(function(e){e.Picklist="Picklist",e.State="State",e.Status="Status",e.Boolean="Boolean"})(cg||(C.OptionSetType=cg={}));var dg;(function(e){e[e.Draft=0]="Draft",e[e.Activated=1]="Activated"})(dg||(C.StateCode=dg={}));var pg;(function(e){e[e.Draft=1]="Draft",e[e.Activated=2]="Activated"})(pg||(C.StatusCode=pg={}));var fg;(function(e){e[e.Enabled=0]="Enabled",e[e.Disabled=1]="Disabled"})(fg||(C.StateCodeEnabledDisabled=fg={}));var mg;(function(e){e[e.Enabled=1]="Enabled",e[e.Disabled=2]="Disabled"})(mg||(C.StatusCodeEnabledDisabled=mg={}));var hg;(function(e){e[e.Definition=1]="Definition",e[e.Activation=2]="Activation",e[e.Template=3]="Template"})(hg||(C.WorkflowTypeCode=hg={}));var gg;(function(e){e[e.User=1]="User",e[e.BusinessUnit=2]="BusinessUnit",e[e.ParentChildBusinessUnit=3]="ParentChildBusinessUnit",e[e.Organization=4]="Organization"})(gg||(C.WorkflowScope=gg={}));var vg;(function(e){e[e.Workflow=0]="Workflow",e[e.Dialog=1]="Dialog",e[e.BusinessRule=2]="BusinessRule",e[e.Action=3]="Action",e[e.BusinessProcessFlow=4]="BusinessProcessFlow",e[e.Flow=5]="Flow",e[e.UIFlow=6]="UIFlow"})(vg||(C.WorkflowCategory=vg={}));var bg;(function(e){e[e.None=-1]="None",e[e.BusinessFlow=0]="BusinessFlow",e[e.TaskFlow=1]="TaskFlow"})(bg||(C.BusinessProcessType=bg={}));var yg;(function(e){e[e.CanvasApp=0]="CanvasApp",e[e.ComponentLibrary=1]="ComponentLibrary",e[e.CustomCanvasPage=2]="CustomCanvasPage",e[e.UnifiedApp=3]="UnifiedApp",e[e.CodeApp=4]="CodeApp",e[e.MobileApp=5]="MobileApp"})(yg||(C.AppSubType=yg={}));var Cg;(function(e){e.OneToManyRelationship="OneToManyRelationship",e.ManyToManyRelationship="ManyToManyRelationship"})(Cg||(C.RelationshipType=Cg={}));var Ag;(function(e){e.ManyToOneRelationship="ManyToOneRelationship",e.OneToManyRelationship="OneToManyRelationship",e.ManyToManyRelationship="ManyToManyRelationship"})(Ag||(C.RelationshipTypeExt=Ag={}));var wg;(function(e){e.NoCascade="NoCascade",e.Cascade="Cascade",e.Active="Active",e.UserOwned="UserOwned",e.RemoveLink="RemoveLink",e.Restrict="Restrict"})(wg||(C.CascadeType=wg={}));var Ng;(function(e){e.None="None",e.Append="Append",e.ParentChild="ParentChild",e.Pointer="Pointer",e.Inheritance="Inheritance"})(Ng||(C.RelationshipSecurityTypes=Ng={}));var Sg;(function(e){e[e.Active=1]="Active",e[e.Inactive=2]="Inactive"})(Sg||(C.ViewStatusCode=Sg={}));var Dg;(function(e){e[e.Active=0]="Active",e[e.Inactive=1]="Inactive"})(Dg||(C.ViewStateCode=Dg={}));var Eg;(function(e){e.Active="Active",e.Failed="Failed",e.InProgress="InProgress",e.Pending="Pending"})(Eg||(C.EntityKeyIndexStatus=Eg={}));var Ig;(function(e){e[e.Entity=1]="Entity",e[e.Attribute=2]="Attribute",e[e.OptionSet=9]="OptionSet",e[e.EntityRelationship=10]="EntityRelationship",e[e.EntityKey=14]="EntityKey",e[e.Role=20]="Role",e[e.DisplayString=22]="DisplayString",e[e.SavedQuery=26]="SavedQuery",e[e.Workflow=29]="Workflow",e[e.Report=31]="Report",e[e.Template=36]="Template",e[e.ContractTemplate=37]="ContractTemplate",e[e.KbArticleTemplate=38]="KbArticleTemplate",e[e.MailMergeTemplate=39]="MailMergeTemplate",e[e.RibbonCustomization=50]="RibbonCustomization",e[e.SavedQueryVisualization=59]="SavedQueryVisualization",e[e.SystemForm=60]="SystemForm",e[e.WebResource=61]="WebResource",e[e.SiteMap=62]="SiteMap",e[e.ConnectionRole=63]="ConnectionRole",e[e.HierarchyRule=65]="HierarchyRule",e[e.CustomControl=66]="CustomControl",e[e.FieldSecurityProfile=70]="FieldSecurityProfile",e[e.AppModule=80]="AppModule",e[e.PluginAssembly=91]="PluginAssembly",e[e.SdkMessageProcessingStep=92]="SdkMessageProcessingStep",e[e.ServiceEndpoint=95]="ServiceEndpoint",e[e.RoutingRule=150]="RoutingRule",e[e.SLA=152]="SLA",e[e.ConvertRule=154]="ConvertRule",e[e.MobileOfflineProfile=161]="MobileOfflineProfile",e[e.EntityDataProvider=181]="EntityDataProvider",e[e.EntityDataSource=183]="EntityDataSource",e[e.SdkMessage=201]="SdkMessage",e[e.CanvasApp=300]="CanvasApp",e[e.Connector=372]="Connector",e[e.EnvironmentVariableDefinition=380]="EnvironmentVariableDefinition",e[e.EnvironmentVariableValue=381]="EnvironmentVariableValue",e[e.AIModel=401]="AIModel",e[e.Dataflow=418]="Dataflow",e[e.DataflowEntities=419]="DataflowEntities",e[e.DualWriteEntityMap=500]="DualWriteEntityMap",e[e.DataIntegrationConnection=501]="DataIntegrationConnection",e[e.ExportToDataLakeConfig=510]="ExportToDataLakeConfig",e[e.Tour=10061]="Tour"})(Ig||(C.SolutionComponentTypeCode=Ig={}));var _g;(function(e){e[e.IncludeSubcomponents=0]="IncludeSubcomponents",e[e.DoNotIncludeSubcomponents=1]="DoNotIncludeSubcomponents",e[e.IncludeAsShellOnly=2]="IncludeAsShellOnly"})(_g||(C.RootComponentBehavior=_g={}));var ss;(function(e){e[e.Entity=1]="Entity",e[e.Attribute=2]="Attribute",e[e.OptionSet=9]="OptionSet",e[e.EntityRelationship=10]="EntityRelationship",e[e.EntityKey=14]="EntityKey",e[e.Role=20]="Role",e[e.DisplayString=22]="DisplayString",e[e.SavedQuery=26]="SavedQuery",e[e.Workflow=29]="Workflow",e[e.Report=31]="Report",e[e.Template=36]="Template",e[e.ContractTemplate=37]="ContractTemplate",e[e.KbArticleTemplate=38]="KbArticleTemplate",e[e.MailMergeTemplate=39]="MailMergeTemplate",e[e.RibbonCustomization=50]="RibbonCustomization",e[e.SavedQueryVisualization=59]="SavedQueryVisualization",e[e.SystemForm=60]="SystemForm",e[e.WebResource=61]="WebResource",e[e.SiteMap=62]="SiteMap",e[e.ConnectionRole=63]="ConnectionRole",e[e.HierarchyRule=65]="HierarchyRule",e[e.CustomControl=66]="CustomControl",e[e.FieldSecurityProfile=70]="FieldSecurityProfile",e[e.AppModule=80]="AppModule",e[e.PluginAssembly=91]="PluginAssembly",e[e.SdkMessageProcessingStep=92]="SdkMessageProcessingStep",e[e.ServiceEndpoint=95]="ServiceEndpoint",e[e.RoutingRule=150]="RoutingRule",e[e.SLA=152]="SLA",e[e.ConvertRule=154]="ConvertRule",e[e.MobileOfflineProfile=161]="MobileOfflineProfile",e[e.EntityDataProvider=181]="EntityDataProvider",e[e.EntityDataSource=183]="EntityDataSource",e[e.SdkMessage=201]="SdkMessage",e[e.CanvasApp=300]="CanvasApp",e[e.Connector=372]="Connector",e[e.EnvironmentVariableDefinition=380]="EnvironmentVariableDefinition",e[e.EnvironmentVariableValue=381]="EnvironmentVariableValue",e[e.AIModel=401]="AIModel",e[e.Dataflow=418]="Dataflow",e[e.DataflowEntities=419]="DataflowEntities",e[e.DualWriteEntityMap=500]="DualWriteEntityMap",e[e.DataIntegrationConnection=501]="DataIntegrationConnection",e[e.ExportToDataLakeConfig=510]="ExportToDataLakeConfig",e[e.DataWorkspace=10282]="DataWorkspace",e[e.Dashboard=100001]="Dashboard",e[e.InteractionCentricDashboard=100002]="InteractionCentricDashboard",e[e.Dialog=100003]="Dialog",e[e.PowerBIDashboard=100004]="PowerBIDashboard",e[e.BusinessRule=100021]="BusinessRule",e[e.ProcessFlow=100024]="ProcessFlow",e[e.Flow=100025]="Flow",e[e.UIFlow=100026]="UIFlow",e[e.ProcessNoFlow=100031]="ProcessNoFlow",e[e.AllDashboards=100032]="AllDashboards",e[e.FormsOnly=100033]="FormsOnly",e[e.ComponentLibrary=100034]="ComponentLibrary",e[e.CanvasAppsOnly=100035]="CanvasAppsOnly",e[e.CustomCanvasPage=100038]="CustomCanvasPage",e[e.CodeApp=100039]="CodeApp",e[e.MobileApp=100046]="MobileApp",e[e.ProcessNoFlowNoUIFlowNoBusinessRule=100036]="ProcessNoFlowNoUIFlowNoBusinessRule",e[e.ActionDefinition=100040]="ActionDefinition",e[e.ActionTemplate=100041]="ActionTemplate",e[e.DialogDefinition=100042]="DialogDefinition",e[e.DialogTemplate=100043]="DialogTemplate",e[e.WorkflowDefinition=100044]="WorkflowDefinition",e[e.WorkflowTemplate=100045]="WorkflowTemplate"})(ss||(C.SolutionComponentTypeCodeExt=ss={}));var ls;(function(e){e[e.Entity=9801]="Entity",e[e.Attribute=9802]="Attribute",e[e.OptionSet=9804]="OptionSet",e[e.EntityRelationship=9805]="EntityRelationship",e[e.EntityKey=9812]="EntityKey",e[e.Role=1036]="Role",e[e.DisplayString=4102]="DisplayString",e[e.SavedQuery=1039]="SavedQuery",e[e.Workflow=4703]="Workflow",e[e.Report=9100]="Report",e[e.Template=2010]="Template",e[e.ContractTemplate=2011]="ContractTemplate",e[e.KbArticleTemplate=1016]="KbArticleTemplate",e[e.MailMergeTemplate=9106]="MailMergeTemplate",e[e.SavedQueryVisualization=1111]="SavedQueryVisualization",e[e.SystemForm=1030]="SystemForm",e[e.WebResource=9333]="WebResource",e[e.SiteMap=4709]="SiteMap",e[e.ConnectionRole=3231]="ConnectionRole",e[e.HierarchyRule=8840]="HierarchyRule",e[e.CustomControl=9753]="CustomControl",e[e.FieldSecurityProfile=1200]="FieldSecurityProfile",e[e.AppModule=9006]="AppModule",e[e.PluginAssembly=4605]="PluginAssembly",e[e.SdkMessageProcessingStep=4608]="SdkMessageProcessingStep",e[e.ServiceEndpoint=4618]="ServiceEndpoint",e[e.RoutingRule=8181]="RoutingRule",e[e.SLA=9750]="SLA",e[e.ConvertRule=9300]="ConvertRule",e[e.MobileOfflineProfile=9866]="MobileOfflineProfile",e[e.EntityDataSource=85]="EntityDataSource",e[e.SdkMessage=4606]="SdkMessage",e[e.RibbonCustomization=1120]="RibbonCustomization",e[e.EntityDataProvider=181]="EntityDataProvider",e[e.CanvasApp=300]="CanvasApp",e[e.Connector=372]="Connector",e[e.MaskingRule=373]="MaskingRule",e[e.AttributeMaskingRule=374]="AttributeMaskingRule",e[e.EnvironmentVariableDefinition=380]="EnvironmentVariableDefinition",e[e.EnvironmentVariableValue=381]="EnvironmentVariableValue",e[e.AIModel=401]="AIModel",e[e.Plan=10283]="Plan",e[e.Dataflow=418]="Dataflow",e[e.DataflowEntities=419]="DataflowEntities",e[e.DualWriteEntityMap=500]="DualWriteEntityMap",e[e.DataIntegrationConnection=501]="DataIntegrationConnection",e[e.ExportToDataLakeConfig=510]="ExportToDataLakeConfig",e[e.TeamTemplate=511]="TeamTemplate",e[e.DataWorkspace=10282]="DataWorkspace",e[e.Dashboard=1030]="Dashboard",e[e.InteractionCentricDashboard=1032]="InteractionCentricDashboard",e[e.PowerBIDashboard=1034]="PowerBIDashboard",e[e.Dialog=1030]="Dialog",e[e.WebResourceImage=9333]="WebResourceImage",e[e.WebResourceSilverlight=9333]="WebResourceSilverlight",e[e.WebResourceCode=9333]="WebResourceCode",e[e.WebResourceData=9333]="WebResourceData",e[e.BusinessRule=4703]="BusinessRule",e[e.ActionDefinition=4703]="ActionDefinition",e[e.ActionTemplate=4703]="ActionTemplate",e[e.DialogDefinition=4703]="DialogDefinition",e[e.DialogTemplate=4703]="DialogTemplate",e[e.WorkflowDefinition=4703]="WorkflowDefinition",e[e.WorkflowTemplate=4703]="WorkflowTemplate",e[e.ProcessFlow=4703]="ProcessFlow",e[e.Flow=4703]="Flow",e[e.UIFlow=4703]="UIFlow",e[e.ProcessNoFlow=4703]="ProcessNoFlow",e[e.ProcessNoFlowNoUIFlowNoBusinessRule=4703]="ProcessNoFlowNoUIFlowNoBusinessRule",e[e.AllDashboards=1030]="AllDashboards",e[e.FormsOnly=1030]="FormsOnly",e[e.ComponentLibrary=300]="ComponentLibrary",e[e.CanvasAppsOnly=300]="CanvasAppsOnly",e[e.CustomCanvasPage=300]="CustomCanvasPage",e[e.CodeApp=300]="CodeApp",e[e.MobileApp=300]="MobileApp",e[e.Chatbot=10030]="Chatbot",e[e.Card=10276]="Card"})(ls||(C.EntityTypeCode=ls={}));var Pg;(function(e){e.MultiSelectPicklist="MultiSelectPicklist",e.File="File",e.Image="Image"})(Pg||(C.SolutionComponentVirtualAttributeSubtype=Pg={}));function $O(e){let t=ss[e];return ls[t]}C.SolutionComponentTypeCodeToEntityTypeCodeExt=$O;function VO(e){let t=ls[e];return ss[t]}C.SolutionEntityTypeCodeExtToComponentTypeCode=VO;var Og;(function(e){e.Active="Active",e.Auto="Auto",e.Disabled="Disabled",e.Inactive="Inactive"})(Og||(C.ImeMode=Og={}));var Tg;(function(e){e[e.Simple=0]="Simple",e[e.Calculated=1]="Calculated",e[e.Rollup=2]="Rollup",e[e.Formula=3]="Formula",e[e.Prompt=4]="Prompt"})(Tg||(C.SourceType=Tg={}));var Rg;(function(e){e.Email="Email",e.Phone="Phone",e.PhoneticGuide="PhoneticGuide",e.Text="Text",e.TextArea="TextArea",e.TickerSymbol="TickerSymbol",e.Url="Url",e.VersionNumber="VersionNumber"})(Rg||(C.StringFormatName=Rg={}));var Fg;(function(e){e[e.PrecisionProperty=0]="PrecisionProperty",e[e.Organization=1]="Organization",e[e.TransactionCurrency=2]="TransactionCurrency"})(Fg||(C.PrecisionSource=Fg={}));var xg;(function(e){e.UserLocal="UserLocal",e.DateOnly="DateOnly",e.TimeZoneIndependent="TimeZoneIndependent"})(xg||(C.DateTimeBehavior=xg={}));var Lg;(function(e){e.DateOnly="DateOnly",e.DateAndTime="DateAndTime"})(Lg||(C.DateTimeFormat=Lg={}));var Mg;(function(e){e.None="None",e.Duration="Duration",e.TimeZone="TimeZone",e.Language="Language",e.Locale="Locale"})(Mg||(C.IntegerFormat=Mg={}));var Ug;(function(e){e[e.HTML=1]="HTML",e[e.CSS=2]="CSS",e[e.JScript=3]="JScript",e[e.XML=4]="XML",e[e.PNG=5]="PNG",e[e.JPG=6]="JPG",e[e.GIF=7]="GIF",e[e.Silverlight=8]="Silverlight",e[e.XSL=9]="XSL",e[e.ICO=10]="ICO",e[e.SVG=11]="SVG",e[e.RESX=12]="RESX"})(Ug||(C.WebResourceTypeCode=Ug={}));var Bg;(function(e){e[e.Initial=5]="Initial",e[e.PreValidation=10]="PreValidation",e[e.InternalPreOperationBeforeExternal=15]="InternalPreOperationBeforeExternal",e[e.PreOperation=20]="PreOperation",e[e.InternalPreOperationAfterExternal=25]="InternalPreOperationAfterExternal",e[e.MainOperation=30]="MainOperation",e[e.InternalPostOperationBeforeExternal=35]="InternalPostOperationBeforeExternal",e[e.PostOperation=40]="PostOperation",e[e.InternalPostOperationAfterExternal=45]="InternalPostOperationAfterExternal",e[e.PostOperationDeprecated=50]="PostOperationDeprecated",e[e.FinalPostOperation=55]="FinalPostOperation"})(Bg||(C.SdkMessageProcessingStage=Bg={}));var kg;(function(e){e[e.ServerOnly=0]="ServerOnly",e[e.OutlookClientOnly=1]="OutlookClientOnly",e[e.Both=2]="Both"})(kg||(C.SupportedDeployment=kg={}));var qg;(function(e){e[e.Synchronous=0]="Synchronous",e[e.Asynchronous=1]="Asynchronous"})(qg||(C.SdkMessageProcessingMode=qg={}));var $g;(function(e){e[e.ReportingServicesReport=1]="ReportingServicesReport",e[e.OtherReport=2]="OtherReport",e[e.LinkedReport=3]="LinkedReport"})($g||(C.ReportTypeCode=$g={}));var Vg;(function(e){e[e.Business=1]="Business",e[e.Family=2]="Family",e[e.Social=3]="Social",e[e.Sales=4]="Sales",e[e.Other=5]="Other",e[e.Stakeholder=1e3]="Stakeholder",e[e.SalesTeam=1001]="SalesTeam",e[e.Service=1002]="Service"})(Vg||(C.ConnectionRoleCategory=Vg={}));var Gg;(function(e){e[e.Name=1]="Name",e[e.Address=2]="Address"})(Gg||(C.ServiceNamespaceFormat=Gg={}));var zg;(function(e){e[e.OneWay=1]="OneWay",e[e.Queue=2]="Queue",e[e.Rest=3]="Rest",e[e.TwoWay=4]="TwoWay",e[e.Topic=5]="Topic",e[e.PersistentQueue=6]="PersistentQueue",e[e.EventHub=7]="EventHub",e[e.WebHook=8]="WebHook"})(zg||(C.ServiceEndpointContract=zg={}));var Wg;(function(e){e[e.Normal=1]="Normal",e[e.Federated=2]="Federated"})(Wg||(C.ServiceEndpointConnectionMode=Wg={}));var jg;(function(e){e.CannotDeleteInUseComponent="0x8004f01f",e.CannotDeleteInUseAttribute="0x80048418",e.CannotDeleteInUseOptionSet="0x80048417",e.CannotDeleteInUseEntity="0x80048420",e.CannotUninstallWithDependencies="0x8004F01D"})(jg||(C.DeleteDependencyErrorCode=jg={}));var Hg;(function(e){e.SystemAdministrator="627090FF-40A3-4053-8790-584EDC5BE201",e.SystemCustomizer="119F245C-3CC8-4B62-B31C-D1A046CED15D"})(Hg||(C.DefaultRoleTemplates=Hg={}));var Jg;(function(e){e[e.DefaultTeamPrivilege=0]="DefaultTeamPrivilege",e[e.DirectUserAndTeamPrivilege=1]="DirectUserAndTeamPrivilege"})(Jg||(C.RoleInheritance=Jg={}));var Qg;(function(e){e[e.NotSpecified=0]="NotSpecified",e[e.CustomConnector=1]="CustomConnector"})(Qg||(C.ConnectorTypeEnum=Qg={}));var Xg;(function(e){e[e.String=1e8]="String",e[e.Number=100000001]="Number",e[e.Boolean=100000002]="Boolean",e[e.JSON=100000003]="JSON",e[e.ConnectionReference=100000004]="ConnectionReference",e[e.Secret=100000005]="Secret"})(Xg||(C.EnvironmentVariableDefinitionTypeEnum=Xg={}));var Kg;(function(e){e[e.Owner=0]="Owner",e[e.Access=1]="Access",e[e.AADSecurityGroup=2]="AADSecurityGroup",e[e.AADOfficeGroup=3]="AADOfficeGroup"})(Kg||(C.TeamTypeEnum=Kg={}));var Yg;(function(e){e.Bots="bots"})(Yg||(C.KnownCustomSolutionComponentEntitySetName=Yg={}));var Zg;(function(e){e[e.MainApplicationView=0]="MainApplicationView",e[e.AdvancedSearch=1]="AdvancedSearch",e[e.SubGrid=2]="SubGrid",e[e.QuickFindSearch=4]="QuickFindSearch",e[e.Reporting=8]="Reporting",e[e.OfflineFilters=16]="OfflineFilters",e[e.MASearch=32]="MASearch",e[e.LookupView=64]="LookupView",e[e.SMAppointmentBookView=128]="SMAppointmentBookView",e[e.OutlookFilters=256]="OutlookFilters",e[e.AddressBookFilters=512]="AddressBookFilters",e[e.SavedQueryTypeOther=2048]="SavedQueryTypeOther",e[e.InteractiveWorkflowView=4096]="InteractiveWorkflowView",e[e.OfflineTemplate=8192]="OfflineTemplate",e[e.OutlookTemplate=131072]="OutlookTemplate",e[e.CustomDefinedView=16384]="CustomDefinedView"})(Zg||(C.QueryType=Zg={}))});var Pc,e0=D(()=>{"use strict";(function(e){e.DefaultValue="defaultValue",e.Loaded="loaded"})(Pc||(Pc={}))});var n0,GO,t0,Y6,Z6,ga,r0,e7,t7,i0=D(()=>{"use strict";n0=ne(en());Ce();Bn();Mh();ma();Rt();$n();G();GO=ne(ha());e0();(function(e){e.Model="Model",e.Canvas="Canvas",e.CustomPages="CustomPages"})(t0||(t0={}));Y6={Read:rn.Read,Edit:rn.Edit,Both:rn.Both,Container:rn.Container},Z6={input:qn.Input,bound:qn.Bound,output:qn.Output};(function(e){e[e.dataset=0]="dataset",e[e.property=1]="property",e[e.groups=2]="groups",e[e.group=3]="group"})(ga||(ga={}));(function(e){e[e.None=0]="None",e[e.HiddenControl=1]="HiddenControl",e[e.CompatibleDataTypesIsMissing=2]="CompatibleDataTypesIsMissing",e[e.TagNameIsUnsupported=3]="TagNameIsUnsupported",e[e.PropertyTypeIsUnsupported=4]="PropertyTypeIsUnsupported",e[e.PropertyTypeGroupIsUnsupported=5]="PropertyTypeGroupIsUnsupported"})(r0||(r0={}));e7=new Set([E.Currency,E.Decimal,E.FP,E.Multiple,E.SingleLineEmail,E.SingleLinePhone,E.SingleLineText,E.SingleLineTextArea,E.SingleLineURL,E.SingleLineTickerSymbol,E.WholeNone,E.WholeDuration,E.WholeLanguage,E.WholeTimeZone,E.Enum,E.LookupSimple,E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding,E.TwoOptions,E.Boolean,E.PowerBIReport,E.DateAndTimeDateAndTime,E.DateAndTimeDateOnly,E.OptionSet,E.MultiSelectOptionSet,E.CardForm]),t7={numbers:[E.WholeNone,E.FP,E.Decimal,E.Currency],text:[E.SingleLineText,E.SingleLineTextArea,E.Multiple],lookup:[E.LookupSimple,E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding],dates:[E.DateAndTimeDateOnly,E.DateAndTimeDateAndTime],allFields:[E.TwoOptions,E.DateAndTimeDateOnly,E.DateAndTimeDateAndTime,E.FP,E.Decimal,E.WholeNone,E.WholeDuration,E.WholeTimeZone,E.WholeLanguage,E.LookupSimple,E.LookupCustomer,E.LookupOwner,E.LookupPartyList,E.LookupRegarding,E.Multiple,E.OptionSet,E.SingleLineText,E.SingleLineTextArea,E.SingleLineEmail,E.SingleLineURL,E.SingleLineTickerSymbol,E.SingleLinePhone]}});var Ft,us,a0=D(()=>{"use strict";Ft=ne(en());De();Ce();We();Bn();$n();i0();ma();G();Le();Rt();us=class extends q{constructor(t){super(g.customControl,t)}customControlId;get id(){let t=this.getProperty(p.id);return S.IsNullOrUndefined(t)?null:t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?new _(t.substr(1,t.length-2)):new _(t)}getParameters(){let t=new Map,r=this.getAllChildren();if(r&&r.length!==0&&r[0]){let n=r[0].getAllChildren();if(n!=null){for(let i of n)if(i&&i.getAllChildren().length>0){let a=i.getNodeName();t.get(a)?t.get(a).push(i):t.set(a,[i])}}}return t}getFormComponentValueByParameterName(t){let r=this.getParameters()?.get(Ye.value);if(r?.length>0){let n=r[0],i=n?.getAllChildren()?.length>0?n.getAllChildren().find(o=>o.getNodeName()===t):null,a=i?.getAllChildren()?.length>0?i.getAllChildren()[0].getNodeName():"";return this.normalizePropertyValue(a)}}getParameterValue(t){let r=this.getParameterNodeChild(t);return r&&this.normalizePropertyValue(r.getNodeName())}getParameterNodeChild(t){let r=this.getParameters().get(t);return r?.length>0&&r[0].getAllChildren()?.length>0?r[0].getAllChildren()[0]:null}getDatasetName(t){return t.getAllProperties().find(r=>r.key===Ye.name)?.value}getParameterChildrenValues(t,r,n){if(this.isDataSet(t)){let i=r.find(u=>u.key===Ye.name)?.value,a={Name:i,Type:E.Grid,Columns:[]},l=this.getParameters().get(Ye.dataset).find(u=>this.getDatasetName(u)===i).getAllChildren();for(let u of l){let c=u.getNodeName();if(u&&u.getAllChildren().length>0){let d=this.normalizePropertyValue(u.getAllChildren()[0].getNodeName());a[c]=d}}return a}}getParameterIsStatic(t){let r=!1,n=this.getParameters().get(t)[0],i=n&&n.getAllProperties();if(i){for(let a of i)if(a.key===p.static&&a.value==="true"){r=!0;break}}return r}get name(){return this.getProperty(p.Name)}get formFactor(){return this.getProperty(p.formFactor)}set formFactor(t){this.setProperty(p.formFactor,t)}async toJSON(t){if(this.id)return null;let r=await this.parametersToJSON(t),n=parseInt(this.formFactor,10);return{CustomControlId:this.customControlId,FormFactor:isNaN(n)?-1:n,Name:this.name,Version:null,Parameters:r,ShouldOverrideControlVisible:!1}}normalizePropertyValue(t){return t.startsWith(hr.StartTag)&&(t=t.substring(1)),t}async parametersToJSON(t){let r=[];if(!this.name)return r;try{let n=await t.formModelService.customControlDiscoveryService.getCustomControlMetadata(this.name);if(n)if(n.configurations){let i=n.configurations,a=this.getParameters();for(let[o,s]of a)if(this.isDataSet(o))for(let l of a.get(o)){let u=l.getAllProperties(),c=this.getDatasetName(l),d=i.get(c),f=await this.parameterJSON(o,u,d,t);r.push({Name:c,Value:f})}else if(this.isGroups(s))r.push({Name:o,Value:{Type:vh.GroupDefinition,Value:this.normalizePropertyValue(this.getParameterNodeChild(s[0].NodeName).NodeName)}}),i.get(o).groupSet?.forEach(u=>{u.groupConfigurableProperties.forEach(async c=>{let d=c.name;c.propertyType===ga.dataset?a.get(Ye.dataset)?.some(h=>this.getDatasetName(h)===d)||r.push({Name:d,Value:{Name:d,Columns:[],Type:E.Grid}}):c.propertyType===ga.property&&(a.has(d)||r.push({Name:d,Value:{Usage:c.usage}}))})});else{let l=s[0].getAllProperties(),u=i.get(o),c=await this.parameterJSON(o,l,u,t);if(c)r.push({Name:o,Value:c});else{(0,Ft.trackInfoTrace)(Xe,{eventName:`${fr}/parametersToJSON`,eventData:{message:`Configuration metadata for custom control parameter ${o} is not available for custom control : ${this.name}.`}}),r=[];break}}}else(0,Ft.trackErrorTrace)(Xe,{eventName:`${fr}/parametersToJSON`,eventData:{message:"Custom Control Manifest Property Info not available"}},new Error(`Custom Control Manifest Property Info not available for custom control : ${this.name}.`));else(0,Ft.trackErrorTrace)(Xe,{eventName:`${fr}/parametersToJSON`,eventData:{message:"Custom Control Manifest not found"}},new Error(`No custom control manifest found for ${this.name}`))}catch(n){(0,Ft.trackErrorTrace)(Xe,{eventName:`${fr}/parametersToJSON`,eventData:{message:"parameters to json failed"}},n)}return r}async parameterJSON(t,r,n,i){if(this.isDataSet(t)){let a=n,o=r.find(s=>s.key===Ye.name)?.value;if(a)return this.getParameterChildrenValues(t,r);{let s=new Error(`No dataset manifest info for ${o}`);(0,Ft.trackErrorTrace)(Xe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing custom control manifest dataset info"}},s)}}else{let a=n,o=r&&r.find(l=>l.key===p.Type),s=a&&!a.ofTypeGroup.every(l=>!uc.includes(l));if(this.isLookupType(o?.value)||this.isLookupType(a?.ofType)||s)if(a){let l=a.usage,u=this.getParameterIsStatic(t),c=a.isPrimary;if(this.name===Fr.FormComponent){let d=this.getFormComponentValueByParameterName(p.bindAttribute),f=await i.formModelService.loadLookupModel(d),h=f.lookupColumn,b=this.getLookupDataTypeFromAttributeMetadata(h);return{Name:t,Type:b,Usage:l,Static:u,Primary:c,EntityName:f.primaryTableName,Value:d,ViewId:this.getFormComponentValueByParameterName(gh.DefaultViewId),TargetEntityType:h.targets[0],FilterRelationshipName:this.getFormComponentValueByParameterName(p.FilterRelationshipName),AvailableViewIds:this.getFormComponentValueByParameterName(p.AvailableViewIds),DependentAttributeName:this.getFormComponentValueByParameterName(p.DependentAttributeName),DependentAttributeType:this.getFormComponentValueByParameterName(p.DependentAttributeType),AllowFilterOff:P.IsStrictTrue(this.getFormComponentValueByParameterName(p.AllowFilterOff)),DisableQuickFind:P.IsStrictTrue(this.getFormComponentValueByParameterName(p.DisableQuickFind)),EnableViewPicker:!P.IsStrictTrue(this.getFormComponentValueByParameterName(p.DisableViewPicker))}}return{Name:t,Usage:l,Static:u,Primary:c,Value:this.getParameterValue(t)}}else{let l=new Error(`No lookup manifest info for ${t}`);(0,Ft.trackErrorTrace)(Xe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing custom control manifest lookup property info"}},l)}if(a){let l=a.usage,u=this.getParameterIsStatic(t),c=this.getParameterValue(t),d=a.isPrimary;if(o){let h=o.value;return{Type:h,Static:u,Usage:l,Value:this.isNumberTypeProperty(a,h)&&Number(c)?Number(c):c,Primary:d}}if(a.ofType)return{Type:a.ofType,Static:u,Usage:l,Value:c,Primary:!0};if(a.ofTypeGroup)return{Static:u,Usage:l,Value:c,Primary:!0};let f=new Error(`No property type info for ${t}`);(0,Ft.trackErrorTrace)(Xe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing property type info"}},f)}else{let l=new Error(`No property manifest info for ${t}`);(0,Ft.trackWarningTrace)(Xe,{eventName:`${fr}/parameterJSON`,eventData:{message:"Missing custom control manifest property info"}},l)}}return null}getLookupDataTypeFromAttributeMetadata(t){let{attributeType:r,format:n}=t;switch(r){case O.Customer:return E.LookupCustomer;case O.Owner:return E.LookupOwner;case O.PartyList:return E.LookupPartyList;default:return n===L.Regarding?E.LookupRegarding:E.LookupSimple}}isLookupType(t){return uc.includes(t)}isNumberTypeProperty(t,r){return cc.includes(r)||t.ofTypeGroup.some(n=>cc.includes(n))}isDataSet(t){return Ye.dataset===t}isGroups(t){return!!t[0].getAllProperties().find(n=>n.key==="isGroup"&&n.value==="true")}}});var U,Oc=D(()=>{"use strict";U=class{static get CustomControl(){return"CustomControl"}static get ACIControl(){return"ACIControl"}static get ReferencePanelSearchWidget(){return"ReferencePanelSearchWidget"}static get SearchWidgetControl(){return"SearchWidgetControl"}static get SocialInsightControl(){return"SocialInsightControl"}static get NotesControl(){return"notescontrol"}static get TimerControl(){return"TimerControl"}static get MapsControl(){return"MapsControl"}static get IframeControl(){return"IframeControl"}static get WebResourceHtmlControl(){return"WebResourceHtmlControl"}static get QuickFormCollectionControl(){return"QuickFormCollectionControl"}static get QuickFormControl(){return"QuickFormControl"}static get GridControl(){return"GridControl"}static get SubGridControl(){return"SubGridControl"}static get WebResourceImageControl(){return"WebResourceImageControl"}static get TimeLineControl(){return"TimeLineControl"}static get LeadScoringControl(){return"LeadScoringControl"}}});var T,Wn,Ie,cs=D(()=>{"use strict";De();la();Ce();We();ma();Zr();Oc();Rt();T=class{static get TextBoxControl(){return"4273EDBD-AC1D-40d3-9FB2-095C621B552D"}static get TickerControl(){return"1E1FC551-F7A8-43af-AC34-A8DC35C7B6D4"}static get UrlControl(){return"71716B6C-711E-476c-8AB8-5D11542BFB47"}static get PhoneNumberControl(){return"8C10015A-B339-4982-9474-A95FE05631A5"}static get EmailAddressControl(){return"ADA2203E-B4CD-49be-9DDF-234642B43B52"}static get RadioControl(){return"67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED"}static get LookupControl(){return"270BD3DB-D9AF-4782-9025-509E298DEC0A"}static get DateTimeControl(){return"5B773807-9FB2-42db-97C3-7A91EFF8ADFF"}static get IntegerControl(){return"C6D124CA-7EDA-4a60-AEA9-7FB8D318B68F"}static get MoneyControl(){return"533B9E00-756B-4312-95A0-DC888637AC78"}static get FloatControl(){return"0D2C745A-E5A8-4c8f-BA63-C6D3BB604660"}static get DecimalControl(){return"C3EFE0C3-0EC6-42be-8349-CBD9079DFD8E"}static get TextAreaControl(){return"E0DECE4B-6FC8-4a8f-A065-082708572369"}static get PicklistControl(){return"3EF39988-22BB-4f0b-BBBE-64B5A3748AEE"}static get HiddenInputControl(){return"5546E6CD-394C-4BEE-94A8-4425E17EF6C6"}static get GridControl(){return"E7A81278-8635-4D9E-8D4D-59480B391C5B"}static get CheckBoxControl(){return"B0C6723A-8503-4fd7-BB28-C8A06AC933C2"}static get IframeControl(){return"FD2A7985-3187-444e-908D-6624B21F69C0"}static get SocialInsightControl(){return"86B9E25E-695E-4FEF-AC69-F05CFA96739C"}static get OrgInsightsControl(){return"76B9E25E-695E-4FEF-AC69-F05CFA96739C"}static get DurationControl(){return"AA987274-CE4E-4271-A803-66164311A958"}static get RegardingControl(){return"F3015350-44A2-4aa0-97B5-00166532B5E9"}static get PartyListControl(){return"CBFB742C-14E7-4a17-96BB-1A13F7F64AA2"}static get TimeLineControl(){return"06375649-c143-495e-a496-c962e5b4488e"}static get TimeLineControlUC(){return"06375649-C143-495E-A496-C962E5B4488E"}static get TimeZonePicklistControl(){return"7C624A0B-F59E-493d-9583-638D34759266"}static get LanguagePickerControl(){return"671A9387-CA5A-4d1e-8AB7-06E39DDCF6B5"}static get AccessTeamTablePickerControl(){return"3F4E2A56-F102-4B4D-AB9C-F1574CA5BFDA"}static get KBViewerControl(){return"A62B6FA9-169E-406C-B1AA-EAB828CB6026"}static get PicklistStatusControl(){return"5D68B988-0661-4db2-BC3E-17598AD3BE6C"}static get EmailBodyControl(){return"6F3FB987-393B-4d2d-859F-9D0F0349B6AD"}static get PicklistLookupControl(){return"2305E33A-BAD3-4022-9E15-1856CF218333"}static get RelationshipRolePicklistControl(){return"5F986642-5961-4D9F-AB5E-643D71E231E9"}static get RelatedInformationControl(){return"163B90A6-EB64-49D2-9DF8-3C84A4F0A0F8"}static get CoverPagePicklistControl(){return"4168A05C-D857-46AF-8457-5BB47EB04EA1"}static get MailMergeLanguagePickerControl(){return"B634828E-C390-444A-AFE6-E07315D9D970"}static get ConnectionControl(){return"3246F906-1F71-45F7-B11F-D7BE0F9D04C9"}static get ConnectionRoleObjectTypeListControl(){return"821ACF1A-7E46-4A0C-965D-FE14A57D78C7"}static get MapsControl(){return"62B0DF79-0464-470F-8AF7-4483CFEA0C7D"}static get MapLinkControl(){return"91DC0675-C8B9-4421-B1E0-261CEBF02BAC"}static get WebResourceHtmlControl(){return"9FDF5F91-88B1-47F4-AD53-C11EFC01A01D"}static get WebResourceImageControl(){return"587CDF98-C1D5-4BDE-8473-14A0BC7644A7"}static get WebResourceSilverlightControl(){return"080677DB-86EC-4544-AC42-F927E74B491F"}static get ReportControl(){return"A28F441B-916C-4865-87FD-0C5D53BD59C9"}static get ArticleContentControl(){return"F02EF977-2564-4B9A-B2F0-DF083D8A019B"}static get ProcessControl(){return"06E9F7AF-1F54-4681-8EEC-1E21A1CEB465"}static get ActivitiesWallControl(){return"6636847D-B74D-4994-B55A-A6FAF97ECEA2"}static get QuickFormControl(){return"69AF7DCA-2E3B-4EE7-9201-0DA731DD2413"}static get QuickFormCollectionControl(){return"5C5600E0-1D6E-4205-A272-BE80DA87FD42"}static get LinkControl(){return"DFDF1CDE-837B-4AC9-98CF-AC74361FD89D"}static get CompositionLinkControl(){return"DB1284EF-9FFC-4E99-B382-0CC082FE2364"}static get ErrorStatusControl(){return"F4C16ECA-CA81-4E39-9448-834B8378721E"}static get ActivitiesContainerControl(){return"C72511AB-84E5-4FB7-A543-25B4FC01E83E"}static get AccessPrivilegeControl(){return"F93A31B2-99AC-4084-8EC2-D4027C31369A"}static get TimerControl(){return"9C5CA0A1-AB4D-4781-BE7E-8DFBE867B87E"}static get DynamicPropertyListControl(){return"6896F004-B17A-4202-861E-8B7EA2080E0B"}static get ButtonControl(){return"00AD73DA-BD4D-49C6-88A8-2F4F4CAD4A20"}static get SearchWidgetControl(){return"E616A57F-20E0-4534-8662-A101B5DDF4E0"}static get EmailRecipientActivityControl(){return"26E9760F-7454-40DE-BB07-F6DCCCB82040"}static get LabelControl(){return"39354E4A-5015-4D74-8031-EA9EB73A1322"}static get CustomControl(){return"F9A8A302-114E-466A-B582-6771B2AE0D92"}static get EditFilterControl(){return"1479835F-F852-4679-B864-C6892A2844C9"}static get RichEditorControl(){return"F94DB24F-263D-44A7-B38E-A35E9854812B"}static get PowerBIControl(){return"8C54228C-1B25-4909-A12A-F2B968BB0D62"}static get EmailEngagementActionsControl(){return"F454228D-1D25-4319-E12F-D27968BC0234"}static get ACIControl(){return"C8BFBBEF-6851-4401-A0CC-7450062FE085"}static get ChoicesControl(){return"4AA28AB7-9C13-4F57-A73D-AD894D048B5F"}static get ReferencePanelSubgridControl(){return"02D4264B-47E2-4B4C-AA95-F439F3F4D458"}static get ReferencePanelSearchWidget(){return"7CCD1494-1F7A-4E3A-8BDE-F32069DAEB9F"}static get ReferencePanelQuickFormCollectionControl(){return"B68B05F0-A46D-43F8-843B-917920AF806A"}static get SpacerControl(){return"E4BAB03A-A9A5-4C23-CC3B-54AA680150E2"}},Wn=class{static get RelationshipAssistant(){return"3ff9a528-dd50-4aca-8f10-2e5ed73513ad"}static get PredictiveLeadScoring(){return"6f503f2a-d033-4106-b62c-f8f2e5f01a57"}},Ie=class e{static FieldControlIds=e.initializeFieldControls();static UnboundControlIds=e.initializeUnboundControls();static ControlsAllowedForReferencePanel=e.initializeReferencePanelControls();static ControlsAllowedForFooter=e.initializeFooterControls();static CustomControlIdMap=new Ke;static initializeFieldControls(){let t=new Ke,r=e.getControlName(O.SingleLineofText,L.Phone);t.add(r,new _(T.PhoneNumberControl));let n=e.getControlName(O.SingleLineofText,L.TextArea);t.add(n,new _(T.TextAreaControl));let i=e.getControlName(O.SingleLineofText,L.Text);t.add(i,new _(T.TextBoxControl));let a=e.getControlName(O.SingleLineofText,L.Email);t.add(a,new _(T.EmailAddressControl));let o=e.getControlName(O.SingleLineofText,L.Url);t.add(o,new _(T.UrlControl));let s=e.getControlName(O.SingleLineofText,L.TickerSymbol);t.add(s,new _(T.TickerControl));let l=e.getControlName(O.SingleLineofText,L.PhoneticGuide);t.add(l,new _(T.TextBoxControl));let u=e.getControlName(O.WholeNumber,L.Duration);t.add(u,new _(T.DurationControl));let c=e.getControlName(O.WholeNumber,L.Language);t.add(c,new _(T.LanguagePickerControl));let d=e.getControlName(O.WholeNumber,L.TimeZone);t.add(d,new _(T.TimeZonePicklistControl));let f=e.getControlName(O.WholeNumber,L.None);t.add(f,new _(T.IntegerControl));let h=e.getControlName(O.DateTime,L.DateOnly);t.add(h,new _(T.DateTimeControl));let b=e.getControlName(O.DateTime,L.DateAndTime);t.add(b,new _(T.DateTimeControl));let w=e.getControlName(O.LookupType,L.None);t.add(w,new _(T.LookupControl));let N=e.getControlName(O.CustomerType,L.None);t.add(N,new _(T.LookupControl));let I=e.getControlName(O.FloatingPointNumber,L.None);t.add(I,new _(T.FloatControl));let R=e.getControlName(O.DecimalNumber,L.None);t.add(R,new _(T.DecimalControl));let F=e.getControlName(O.Currency,L.None);t.add(F,new _(T.MoneyControl));let M=e.getControlName(O.MultipleLineofText,L.None);t.add(M,new _(T.TextAreaControl));let W=e.getControlName(O.MultipleLineofText,L.Text);t.add(W,new _(T.TextAreaControl));let B=e.getControlName(O.MultipleLineofText,L.TextArea);t.add(B,new _(T.TextAreaControl));let j=e.getControlName(O.MultipleLineofText,L.Email);t.add(j,new _(T.EmailBodyControl));let k=e.getControlName(O.OptionSet,L.None);t.add(k,new _(T.PicklistControl));let $=e.getControlName(O.TwoOptions,L.None);t.add($,new _(T.RadioControl));let re=e.getControlName(O.Image,L.None);t.add(re,new _(T.WebResourceImageControl));let H=e.getControlName(O.Image,L.None);t.add(H,new _(T.WebResourceHtmlControl));let nr=e.getControlName(O.TwoOptions,"Radio");t.add(nr,new _(T.RadioControl));let Il=e.getControlName(O.TwoOptions,"CheckBox");t.add(Il,new _(T.CheckBoxControl));let Oi=e.getControlName(O.TwoOptions,"List");t.add(Oi,new _(T.PicklistControl));let io=e.getControlName(O.State,L.None);t.add(io,new _(T.PicklistControl));let ue=e.getControlName(O.Status,L.None);t.add(ue,new _(T.PicklistStatusControl));let rt=e.getControlName(O.OwnerType,L.None);t.add(rt,new _(T.LookupControl));let _l=e.getControlName(O.PartyListType,L.None);t.add(_l,new _(T.PartyListControl));let ID=e.getControlName(O.LookupType,L.Regarding);t.add(ID,new _(T.RegardingControl));let _D=e.getControlName(O.MultiSelectOptionSet,L.None);return t.add(_D,new _(T.ChoicesControl)),t}static getControlName(t,r){return t+"_"+r}static getControlIdByTypeAndFormat(t,r){let n=e.getControlName(t.toString(),r.toString());return e.FieldControlIds.containsKey(n)?e.FieldControlIds.getValue(n):null}static getTypeAndFormatByControlOrUniqueId(t){for(let r in e.FieldControlIds.getKeys())if(e.FieldControlIds.getValue(e.FieldControlIds.getKeys()[r]).guidString.toLowerCase()===t)return e.FieldControlIds.getKeys()[r]}static getControlDataTypeByControlOrUniqueId(t){if(!S.IsNullOrEmptyGuid(t)){let r=e.getTypeAndFormatByControlOrUniqueId(t.guidString.toLowerCase());return r=S.IsNullOrUndefined(r)?e.getUnboundControlNameFromIdentifier(t):r.substring(0,r.indexOf("_")),r}return null}static isCustomControl(t){return S.IsNullOrUndefined(t.control)||S.IsNullOrUndefined(t.control.ClassId)||t.control.ClassId.guidString===T.CustomControl}static initializeUnboundControls(){let t=new Ke;return t.add(T.ACIControl,U.ACIControl),t.add(T.IframeControl,U.IframeControl),t.add(T.SearchWidgetControl,U.SearchWidgetControl),t.add(T.MapsControl,U.MapsControl),t.add(T.QuickFormCollectionControl,U.QuickFormCollectionControl),t.add(T.GridControl,U.SubGridControl),t.add(T.WebResourceImageControl,U.WebResourceImageControl),t.add(T.WebResourceHtmlControl,U.WebResourceHtmlControl),t.add(T.ReferencePanelSearchWidget,U.SearchWidgetControl),t.add(T.ReferencePanelQuickFormCollectionControl,U.QuickFormCollectionControl),t.add(T.ReferencePanelSubgridControl,U.SubGridControl),t.add(T.TimerControl,U.TimerControl),t.add(T.TimeLineControl,U.NotesControl),t.add(T.TimeLineControlUC,U.NotesControl),t.add(T.SocialInsightControl,U.SocialInsightControl),t.add(Wn.RelationshipAssistant,U.CustomControl),t}static initializeReferencePanelControls(){let t=new Ke;return t.add(T.IframeControl,U.IframeControl),t.add(T.ReferencePanelSearchWidget,U.SearchWidgetControl),t.add(T.ReferencePanelQuickFormCollectionControl,U.QuickFormCollectionControl),t.add(T.ReferencePanelSubgridControl,U.SubGridControl),t.add(T.WebResourceHtmlControl,U.WebResourceHtmlControl),t.add(T.WebResourceImageControl,U.WebResourceHtmlControl),t}static initializeFooterControls(){let t=new kn;return t.add(Gn.IFRAME,!0),t.add(Gn.SPACER,!0),t.add(Gn.WEB_RESOURCE_HTML,!0),t}static isUnboundFormControl(t){if(S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.control)||S.IsNullOrUndefined(t.control.ClassId))return!1;let r=e.getUniqueIdentifierForControl(t.control);return e.UnboundControlIds.containsKey(r.guidString)}static isReferencePanelSection(t){return!S.IsNullOrUndefined(t)&&!S.IsNullOrUndefined(t.Name)&&t.Name.indexOf(le.referencePanelNamePrefix)===0}static isUnboundFormControlByIdentifier(t){return S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.guidString)?!1:e.UnboundControlIds.containsKey(t.guidString)}static getUnboundFormControlName(t){let r=P.EmptyString;if(S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.control)||S.IsNullOrUndefined(t.control.ClassId))return r;let n=e.getUniqueIdentifierForControl(t.control);return e.UnboundControlIds.getValue(n.guidString).toString()}static getUnboundControlNameFromIdentifier(t){return S.IsNullOrUndefined(t)||S.IsNullOrUndefined(t.guidString)?P.EmptyString:e.UnboundControlIds.getValue(t.guidString).toString()}static isSpacerControl(t){return t===T.SpacerControl}static GetRowSpan(t){let r=t.ClassId;if(e.isRelationshipAssistantControl(t))r=t.UniqueId;else if(r.guidString===T.CustomControl&&!S.IsNullOrUndefined(t.UniqueId)){let n=t.UniqueId.ToString();e.CustomControlIdMap.containsKey(n)&&(r=e.CustomControlIdMap.getValue(n))}switch(e.UnboundControlIds.getValue(r.guidString)){case U.IframeControl:case U.ACIControl:case U.SocialInsightControl:return 6;case U.SubGridControl:case U.CustomControl:return 4;case U.WebResourceImageControl:return 15;case U.WebResourceHtmlControl:return 15;case U.MapsControl:return 8;case U.SearchWidgetControl:return 10;case U.NotesControl:case U.TimeLineControl:return 15;case U.TimerControl:return 2;default:}}static isLookUpControl(t){return!S.IsNullOrUndefined(t)&&t.ClassId.guidString===T.LookupControl}static isRelationshipAssistantOrLeadScoringControl(t){return!S.IsNullOrUndefined(t)&&e.isRelationshipAssistantOrLeadScoring(t.UniqueId)}static isRelationshipAssistantOrLeadScoring(t){return!S.IsNullOrUndefined(t)&&(t.guidString===Wn.RelationshipAssistant||t.guidString===Wn.PredictiveLeadScoring)}static isRelationshipAssistantControl(t){return!S.IsNullOrUndefined(t)&&e.isRelationshipAssistant(t.UniqueId)}static isRelationshipAssistant(t){return!S.IsNullOrUndefined(t)&&t.guidString===Wn.RelationshipAssistant}static getUniqueIdentifierForControl(t){if(S.IsNullOrUndefined(t))return null;let r=t.ClassId;if(e.isRelationshipAssistantControl(t))r=t.UniqueId;else if(r.guidString===T.CustomControl&&!S.IsNullOrUndefined(t.UniqueId)){let n=t.UniqueId.ToString();e.CustomControlIdMap.containsKey(n)&&(r=e.CustomControlIdMap.getValue(n))}return r}}});var ds,o0=D(()=>{"use strict";ds=class{listeners=[];listenersOncer=[];on(t){return this.listeners.push(t),{dispose:()=>this.off(t)}}once(t){this.listenersOncer.push(t)}off(t){let r=this.listeners.indexOf(t);r>-1&&this.listeners.splice(r,1)}emit(t){this.listeners.forEach(r=>r(t)),this.listenersOncer.forEach(r=>r(t)),this.listenersOncer=[]}pipe(t){return this.on(r=>t.emit(r))}}});var on,jn,s0,l0,xr,u0,c0,Tc=D(()=>{"use strict";(function(e){e[e.Center=0]="Center",e[e.Left=1]="Left",e[e.Right=2]="Right"})(on||(on={}));(function(e){e[e.Left=0]="Left",e[e.Top=1]="Top"})(jn||(jn={}));(function(e){e[e.Top=0]="Top",e[e.Middle=1]="Middle"})(s0||(s0={}));(function(e){e[e.None=0]="None",e[e.Create=1]="Create",e[e.Existing=2]="Existing",e[e.ReadOnly=3]="ReadOnly",e[e.Disabled=4]="Disabled",e[e.BulkEdit=6]="BulkEdit",e[e.Merge=7]="Merge",e[e.Print=8]="Print",e[e.FollowUp=9]="FollowUp"})(l0||(l0={}));(function(e){e[e.None=-1]="None",e[e.AppointmentBook=0]="AppointmentBook",e[e.Hardcoded=1]="Hardcoded",e[e.Main=2]="Main",e[e.MiniCampaignBO=3]="MiniCampaignBO",e[e.Preview=4]="Preview",e[e.Dashboard=5]="Dashboard",e[e.Quick=6]="Quick",e[e.Mobile=7]="Mobile",e[e.Read=8]="Read",e[e.QuickCreate=9]="QuickCreate",e[e.Dialog=10]="Dialog",e[e.Card=11]="Card",e[e.TaskBasedForm=12]="TaskBasedForm",e[e.InteractionCentricDashboard=13]="InteractionCentricDashboard"})(xr||(xr={}));(function(e){e[e.None=0]="None",e[e.SystemRequired=1]="SystemRequired",e[e.ApplicationRequired=2]="ApplicationRequired",e[e.Recommended=3]="Recommended"})(u0||(u0={}));(function(e){e[e.Boolean=0]="Boolean",e[e.Customer=1]="Customer",e[e.DateTime=2]="DateTime",e[e.Decimal=3]="Decimal",e[e.Double=4]="Double",e[e.Integer=5]="Integer",e[e.Lookup=6]="Lookup",e[e.Memo=7]="Memo",e[e.Money=8]="Money",e[e.Owner=9]="Owner",e[e.PartyList=10]="PartyList",e[e.Picklist=11]="Picklist",e[e.State=12]="State",e[e.Status=13]="Status",e[e.String=14]="String",e[e.Uniqueidentifier=15]="Uniqueidentifier",e[e.CalendarRules=16]="CalendarRules",e[e.Virtual=17]="Virtual",e[e.BigInt=18]="BigInt",e[e.ManagedProperty=19]="ManagedProperty",e[e.EntityName=20]="EntityName"})(c0||(c0={}))});var Hn,d0=D(()=>{"use strict";fa();Hn=gc({packageName:"cds-designer-models",features:{showAllPCFControls:{owner:"anchoudh",description:"Do not only show the controls that exist on the whitelist",enabledFor:{test:!1,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1}},showTestControls:{owner:"lucorre",description:"Show advanced custom controls for testing (designated in Authoring Manifest with isTestOnly=true)",enabledFor:{test:!0,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1}},enablePrefetchGetMoreComponentsLocalization:{owner:"vajagarl",description:"Enables prefetching the localization files for controls displayed in custom control picker",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0}},showMapControl:{owner:"vayilavarapu",createdDate:"07/19/2022",description:"Show map control",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}},enableFallbackFormTemplate:{owner:"vajagarl",createdDate:"01/03/2023",description:"Enable default form template as fallback if unable to retrieve a form template from Dataverse",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}},enableAutoInsertionOfCellInRow:{owner:"debeshd",createdDate:"09/01/2023",description:"Enable the auto insertion of cell in a row when a section is initialized",enabledFor:{test:!1,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1,ex:!1,rx:!1}},enableOneGridEvents:{owner:"aansu",createdDate:"08/21/2024",description:"Enable OneGrid events in form designer",enabledFor:{test:!0,preprod:!0,prod:!0,preview:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}},disablePBIComponents:{owner:"adekulkarni",createdDate:"02/13/2025",description:"Disables PBI components and cleans them up from the form",enabledFor:{test:!0,preprod:!1,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1,ex:!1,rx:!1}},enableAgentResponse:{owner:"jennietu",createdDate:"04/24/2025",description:"Enables agent response in form designer",enabledFor:{test:!0,preprod:!0,preview:!1,prod:!1,gov:!1,high:!1,dod:!1,mooncake:!1,ex:!1,rx:!1}},enableDelayedLocalizationForCustomControls:{owner:"aansu",createdDate:"06/08/2025",description:"Enables delayed localization of custom control",enabledFor:{test:!0,preprod:!0,preview:!0,prod:!0,gov:!0,high:!0,dod:!0,mooncake:!0,ex:!0,rx:!0}}}})});function p0(e){return{...e,extractConfig:t=>zO(t,Object.keys(e.fallback))}}function zO(e,t){let r={};for(let n of t)typeof e[n]<"u"&&(r[n]=e[n]);return r}var Rc=D(()=>{"use strict";});var Fc=m((P7,m0)=>{var va=new Proxy(function(){return va},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:va},apply:function(){return va},construct:function(){return{}}}),f0=function(){return va};Object.setPrototypeOf(f0,va);m0.exports=f0});var v0=m((O7,g0)=>{var ba=new Proxy(function(){return ba},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:ba},apply:function(){return ba},construct:function(){return{}}}),h0=function(){return ba};Object.setPrototypeOf(h0,ba);g0.exports=h0});var xc=m((T7,y0)=>{var ya=new Proxy(function(){return ya},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:ya},apply:function(){return ya},construct:function(){return{}}}),b0=function(){return ya};Object.setPrototypeOf(b0,ya);y0.exports=b0});var A0=m((R7,C0)=>{function WO(){this.__data__=[],this.size=0}C0.exports=WO});var Jn=m((F7,w0)=>{function jO(e,t){return e===t||e!==e&&t!==t}w0.exports=jO});var Ca=m((x7,N0)=>{var HO=Jn();function JO(e,t){for(var r=e.length;r--;)if(HO(e[r][0],t))return r;return-1}N0.exports=JO});var D0=m((L7,S0)=>{var QO=Ca(),XO=Array.prototype,KO=XO.splice;function YO(e){var t=this.__data__,r=QO(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():KO.call(t,r,1),--this.size,!0}S0.exports=YO});var I0=m((M7,E0)=>{var ZO=Ca();function eT(e){var t=this.__data__,r=ZO(t,e);return r<0?void 0:t[r][1]}E0.exports=eT});var P0=m((U7,_0)=>{var tT=Ca();function rT(e){return tT(this.__data__,e)>-1}_0.exports=rT});var T0=m((B7,O0)=>{var nT=Ca();function iT(e,t){var r=this.__data__,n=nT(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}O0.exports=iT});var Aa=m((k7,R0)=>{var aT=A0(),oT=D0(),sT=I0(),lT=P0(),uT=T0();function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=aT;Qn.prototype.delete=oT;Qn.prototype.get=sT;Qn.prototype.has=lT;Qn.prototype.set=uT;R0.exports=Qn});var x0=m((q7,F0)=>{var cT=Aa();function dT(){this.__data__=new cT,this.size=0}F0.exports=dT});var M0=m(($7,L0)=>{function pT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}L0.exports=pT});var B0=m((V7,U0)=>{function fT(e){return this.__data__.get(e)}U0.exports=fT});var q0=m((G7,k0)=>{function mT(e){return this.__data__.has(e)}k0.exports=mT});var Lc=m((z7,$0)=>{var hT=typeof global=="object"&&global&&global.Object===Object&&global;$0.exports=hT});var xt=m((W7,V0)=>{var gT=Lc(),vT=typeof self=="object"&&self&&self.Object===Object&&self,bT=gT||vT||Function("return this")();V0.exports=bT});var wa=m((j7,G0)=>{var yT=xt(),CT=yT.Symbol;G0.exports=CT});var H0=m((H7,j0)=>{var z0=wa(),W0=Object.prototype,AT=W0.hasOwnProperty,wT=W0.toString,Na=z0?z0.toStringTag:void 0;function NT(e){var t=AT.call(e,Na),r=e[Na];try{e[Na]=void 0;var n=!0}catch{}var i=wT.call(e);return n&&(t?e[Na]=r:delete e[Na]),i}j0.exports=NT});var Q0=m((J7,J0)=>{var ST=Object.prototype,DT=ST.toString;function ET(e){return DT.call(e)}J0.exports=ET});var sn=m((Q7,Y0)=>{var X0=wa(),IT=H0(),_T=Q0(),PT="[object Null]",OT="[object Undefined]",K0=X0?X0.toStringTag:void 0;function TT(e){return e==null?e===void 0?OT:PT:K0&&K0 in Object(e)?IT(e):_T(e)}Y0.exports=TT});var gr=m((X7,Z0)=>{function RT(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}Z0.exports=RT});var ps=m((K7,ev)=>{var FT=sn(),xT=gr(),LT="[object AsyncFunction]",MT="[object Function]",UT="[object GeneratorFunction]",BT="[object Proxy]";function kT(e){if(!xT(e))return!1;var t=FT(e);return t==MT||t==UT||t==LT||t==BT}ev.exports=kT});var rv=m((Y7,tv)=>{var qT=xt(),$T=qT["__core-js_shared__"];tv.exports=$T});var av=m((Z7,iv)=>{var Mc=rv(),nv=(function(){var e=/[^.]+$/.exec(Mc&&Mc.keys&&Mc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function VT(e){return!!nv&&nv in e}iv.exports=VT});var Uc=m((eV,ov)=>{var GT=Function.prototype,zT=GT.toString;function WT(e){if(e!=null){try{return zT.call(e)}catch{}try{return e+""}catch{}}return""}ov.exports=WT});var lv=m((tV,sv)=>{var jT=ps(),HT=av(),JT=gr(),QT=Uc(),XT=/[\\^$.*+?()[\]{}|]/g,KT=/^\[object .+?Constructor\]$/,YT=Function.prototype,ZT=Object.prototype,eR=YT.toString,tR=ZT.hasOwnProperty,rR=RegExp("^"+eR.call(tR).replace(XT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nR(e){if(!JT(e)||HT(e))return!1;var t=jT(e)?rR:KT;return t.test(QT(e))}sv.exports=nR});var cv=m((rV,uv)=>{function iR(e,t){return e?.[t]}uv.exports=iR});var Lr=m((nV,dv)=>{var aR=lv(),oR=cv();function sR(e,t){var r=oR(e,t);return aR(r)?r:void 0}dv.exports=sR});var fs=m((iV,pv)=>{var lR=Lr(),uR=xt(),cR=lR(uR,"Map");pv.exports=cR});var Sa=m((aV,fv)=>{var dR=Lr(),pR=dR(Object,"create");fv.exports=pR});var gv=m((oV,hv)=>{var mv=Sa();function fR(){this.__data__=mv?mv(null):{},this.size=0}hv.exports=fR});var bv=m((sV,vv)=>{function mR(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}vv.exports=mR});var Cv=m((lV,yv)=>{var hR=Sa(),gR="__lodash_hash_undefined__",vR=Object.prototype,bR=vR.hasOwnProperty;function yR(e){var t=this.__data__;if(hR){var r=t[e];return r===gR?void 0:r}return bR.call(t,e)?t[e]:void 0}yv.exports=yR});var wv=m((uV,Av)=>{var CR=Sa(),AR=Object.prototype,wR=AR.hasOwnProperty;function NR(e){var t=this.__data__;return CR?t[e]!==void 0:wR.call(t,e)}Av.exports=NR});var Sv=m((cV,Nv)=>{var SR=Sa(),DR="__lodash_hash_undefined__";function ER(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=SR&&t===void 0?DR:t,this}Nv.exports=ER});var Ev=m((dV,Dv)=>{var IR=gv(),_R=bv(),PR=Cv(),OR=wv(),TR=Sv();function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=IR;Xn.prototype.delete=_R;Xn.prototype.get=PR;Xn.prototype.has=OR;Xn.prototype.set=TR;Dv.exports=Xn});var Pv=m((pV,_v)=>{var Iv=Ev(),RR=Aa(),FR=fs();function xR(){this.size=0,this.__data__={hash:new Iv,map:new(FR||RR),string:new Iv}}_v.exports=xR});var Tv=m((fV,Ov)=>{function LR(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}Ov.exports=LR});var Da=m((mV,Rv)=>{var MR=Tv();function UR(e,t){var r=e.__data__;return MR(t)?r[typeof t=="string"?"string":"hash"]:r.map}Rv.exports=UR});var xv=m((hV,Fv)=>{var BR=Da();function kR(e){var t=BR(this,e).delete(e);return this.size-=t?1:0,t}Fv.exports=kR});var Mv=m((gV,Lv)=>{var qR=Da();function $R(e){return qR(this,e).get(e)}Lv.exports=$R});var Bv=m((vV,Uv)=>{var VR=Da();function GR(e){return VR(this,e).has(e)}Uv.exports=GR});var qv=m((bV,kv)=>{var zR=Da();function WR(e,t){var r=zR(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}kv.exports=WR});var ms=m((yV,$v)=>{var jR=Pv(),HR=xv(),JR=Mv(),QR=Bv(),XR=qv();function Kn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Kn.prototype.clear=jR;Kn.prototype.delete=HR;Kn.prototype.get=JR;Kn.prototype.has=QR;Kn.prototype.set=XR;$v.exports=Kn});var Gv=m((CV,Vv)=>{var KR=Aa(),YR=fs(),ZR=ms(),eF=200;function tF(e,t){var r=this.__data__;if(r instanceof KR){var n=r.__data__;if(!YR||n.length<eF-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ZR(n)}return r.set(e,t),this.size=r.size,this}Vv.exports=tF});var Bc=m((AV,zv)=>{var rF=Aa(),nF=x0(),iF=M0(),aF=B0(),oF=q0(),sF=Gv();function Yn(e){var t=this.__data__=new rF(e);this.size=t.size}Yn.prototype.clear=nF;Yn.prototype.delete=iF;Yn.prototype.get=aF;Yn.prototype.has=oF;Yn.prototype.set=sF;zv.exports=Yn});var jv=m((wV,Wv)=>{var lF="__lodash_hash_undefined__";function uF(e){return this.__data__.set(e,lF),this}Wv.exports=uF});var Jv=m((NV,Hv)=>{function cF(e){return this.__data__.has(e)}Hv.exports=cF});var Xv=m((SV,Qv)=>{var dF=ms(),pF=jv(),fF=Jv();function hs(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new dF;++t<r;)this.add(e[t])}hs.prototype.add=hs.prototype.push=pF;hs.prototype.has=fF;Qv.exports=hs});var Yv=m((DV,Kv)=>{function mF(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}Kv.exports=mF});var eb=m((EV,Zv)=>{function hF(e,t){return e.has(t)}Zv.exports=hF});var kc=m((IV,tb)=>{var gF=Xv(),vF=Yv(),bF=eb(),yF=1,CF=2;function AF(e,t,r,n,i,a){var o=r&yF,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=r&CF?new gF:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var b=e[d],w=t[d];if(n)var N=o?n(w,b,d,t,e,a):n(b,w,d,e,t,a);if(N!==void 0){if(N)continue;f=!1;break}if(h){if(!vF(t,function(I,R){if(!bF(h,R)&&(b===I||i(b,I,r,n,a)))return h.push(R)})){f=!1;break}}else if(!(b===w||i(b,w,r,n,a))){f=!1;break}}return a.delete(e),a.delete(t),f}tb.exports=AF});var qc=m((_V,rb)=>{var wF=xt(),NF=wF.Uint8Array;rb.exports=NF});var ib=m((PV,nb)=>{function SF(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}nb.exports=SF});var ob=m((OV,ab)=>{function DF(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}ab.exports=DF});var db=m((TV,cb)=>{var sb=wa(),lb=qc(),EF=Jn(),IF=kc(),_F=ib(),PF=ob(),OF=1,TF=2,RF="[object Boolean]",FF="[object Date]",xF="[object Error]",LF="[object Map]",MF="[object Number]",UF="[object RegExp]",BF="[object Set]",kF="[object String]",qF="[object Symbol]",$F="[object ArrayBuffer]",VF="[object DataView]",ub=sb?sb.prototype:void 0,$c=ub?ub.valueOf:void 0;function GF(e,t,r,n,i,a,o){switch(r){case VF:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $F:return!(e.byteLength!=t.byteLength||!a(new lb(e),new lb(t)));case RF:case FF:case MF:return EF(+e,+t);case xF:return e.name==t.name&&e.message==t.message;case UF:case kF:return e==t+"";case LF:var s=_F;case BF:var l=n&OF;if(s||(s=PF),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;n|=TF,o.set(e,t);var c=IF(s(e),s(t),n,i,a,o);return o.delete(e),c;case qF:if($c)return $c.call(e)==$c.call(t)}return!1}cb.exports=GF});var fb=m((RV,pb)=>{function zF(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}pb.exports=zF});var Mr=m((FV,mb)=>{var WF=Array.isArray;mb.exports=WF});var gb=m((xV,hb)=>{var jF=fb(),HF=Mr();function JF(e,t,r){var n=t(e);return HF(e)?n:jF(n,r(e))}hb.exports=JF});var bb=m((LV,vb)=>{function QF(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}vb.exports=QF});var Cb=m((MV,yb)=>{function XF(){return[]}yb.exports=XF});var Nb=m((UV,wb)=>{var KF=bb(),YF=Cb(),ZF=Object.prototype,ex=ZF.propertyIsEnumerable,Ab=Object.getOwnPropertySymbols,tx=Ab?function(e){return e==null?[]:(e=Object(e),KF(Ab(e),function(t){return ex.call(e,t)}))}:YF;wb.exports=tx});var Db=m((BV,Sb)=>{function rx(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}Sb.exports=rx});var Ur=m((kV,Eb)=>{function nx(e){return e!=null&&typeof e=="object"}Eb.exports=nx});var _b=m((qV,Ib)=>{var ix=sn(),ax=Ur(),ox="[object Arguments]";function sx(e){return ax(e)&&ix(e)==ox}Ib.exports=sx});var Vc=m(($V,Tb)=>{var Pb=_b(),lx=Ur(),Ob=Object.prototype,ux=Ob.hasOwnProperty,cx=Ob.propertyIsEnumerable,dx=Pb((function(){return arguments})())?Pb:function(e){return lx(e)&&ux.call(e,"callee")&&!cx.call(e,"callee")};Tb.exports=dx});var Fb=m((VV,Rb)=>{function px(){return!1}Rb.exports=px});var gs=m((Ea,Zn)=>{var fx=xt(),mx=Fb(),Mb=typeof Ea=="object"&&Ea&&!Ea.nodeType&&Ea,xb=Mb&&typeof Zn=="object"&&Zn&&!Zn.nodeType&&Zn,hx=xb&&xb.exports===Mb,Lb=hx?fx.Buffer:void 0,gx=Lb?Lb.isBuffer:void 0,vx=gx||mx;Zn.exports=vx});var vs=m((GV,Ub)=>{var bx=9007199254740991,yx=/^(?:0|[1-9]\d*)$/;function Cx(e,t){var r=typeof e;return t=t??bx,!!t&&(r=="number"||r!="symbol"&&yx.test(e))&&e>-1&&e%1==0&&e<t}Ub.exports=Cx});var Gc=m((zV,Bb)=>{var Ax=9007199254740991;function wx(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ax}Bb.exports=wx});var qb=m((WV,kb)=>{var Nx=sn(),Sx=Gc(),Dx=Ur(),Ex="[object Arguments]",Ix="[object Array]",_x="[object Boolean]",Px="[object Date]",Ox="[object Error]",Tx="[object Function]",Rx="[object Map]",Fx="[object Number]",xx="[object Object]",Lx="[object RegExp]",Mx="[object Set]",Ux="[object String]",Bx="[object WeakMap]",kx="[object ArrayBuffer]",qx="[object DataView]",$x="[object Float32Array]",Vx="[object Float64Array]",Gx="[object Int8Array]",zx="[object Int16Array]",Wx="[object Int32Array]",jx="[object Uint8Array]",Hx="[object Uint8ClampedArray]",Jx="[object Uint16Array]",Qx="[object Uint32Array]",ae={};ae[$x]=ae[Vx]=ae[Gx]=ae[zx]=ae[Wx]=ae[jx]=ae[Hx]=ae[Jx]=ae[Qx]=!0;ae[Ex]=ae[Ix]=ae[kx]=ae[_x]=ae[qx]=ae[Px]=ae[Ox]=ae[Tx]=ae[Rx]=ae[Fx]=ae[xx]=ae[Lx]=ae[Mx]=ae[Ux]=ae[Bx]=!1;function Xx(e){return Dx(e)&&Sx(e.length)&&!!ae[Nx(e)]}kb.exports=Xx});var Vb=m((jV,$b)=>{function Kx(e){return function(t){return e(t)}}$b.exports=Kx});var zb=m((Ia,ei)=>{var Yx=Lc(),Gb=typeof Ia=="object"&&Ia&&!Ia.nodeType&&Ia,_a=Gb&&typeof ei=="object"&&ei&&!ei.nodeType&&ei,Zx=_a&&_a.exports===Gb,zc=Zx&&Yx.process,eL=(function(){try{var e=_a&&_a.require&&_a.require("util").types;return e||zc&&zc.binding&&zc.binding("util")}catch{}})();ei.exports=eL});var bs=m((HV,Hb)=>{var tL=qb(),rL=Vb(),Wb=zb(),jb=Wb&&Wb.isTypedArray,nL=jb?rL(jb):tL;Hb.exports=nL});var Wc=m((JV,Jb)=>{var iL=Db(),aL=Vc(),oL=Mr(),sL=gs(),lL=vs(),uL=bs(),cL=Object.prototype,dL=cL.hasOwnProperty;function pL(e,t){var r=oL(e),n=!r&&aL(e),i=!r&&!n&&sL(e),a=!r&&!n&&!i&&uL(e),o=r||n||i||a,s=o?iL(e.length,String):[],l=s.length;for(var u in e)(t||dL.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lL(u,l)))&&s.push(u);return s}Jb.exports=pL});var ys=m((QV,Qb)=>{var fL=Object.prototype;function mL(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fL;return e===r}Qb.exports=mL});var jc=m((XV,Xb)=>{function hL(e,t){return function(r){return e(t(r))}}Xb.exports=hL});var Yb=m((KV,Kb)=>{var gL=jc(),vL=gL(Object.keys,Object);Kb.exports=vL});var ey=m((YV,Zb)=>{var bL=ys(),yL=Yb(),CL=Object.prototype,AL=CL.hasOwnProperty;function wL(e){if(!bL(e))return yL(e);var t=[];for(var r in Object(e))AL.call(e,r)&&r!="constructor"&&t.push(r);return t}Zb.exports=wL});var Pa=m((ZV,ty)=>{var NL=ps(),SL=Gc();function DL(e){return e!=null&&SL(e.length)&&!NL(e)}ty.exports=DL});var ny=m((eG,ry)=>{var EL=Wc(),IL=ey(),_L=Pa();function PL(e){return _L(e)?EL(e):IL(e)}ry.exports=PL});var ay=m((tG,iy)=>{var OL=gb(),TL=Nb(),RL=ny();function FL(e){return OL(e,RL,TL)}iy.exports=FL});var ly=m((rG,sy)=>{var oy=ay(),xL=1,LL=Object.prototype,ML=LL.hasOwnProperty;function UL(e,t,r,n,i,a){var o=r&xL,s=oy(e),l=s.length,u=oy(t),c=u.length;if(l!=c&&!o)return!1;for(var d=l;d--;){var f=s[d];if(!(o?f in t:ML.call(t,f)))return!1}var h=a.get(e),b=a.get(t);if(h&&b)return h==t&&b==e;var w=!0;a.set(e,t),a.set(t,e);for(var N=o;++d<l;){f=s[d];var I=e[f],R=t[f];if(n)var F=o?n(R,I,f,t,e,a):n(I,R,f,e,t,a);if(!(F===void 0?I===R||i(I,R,r,n,a):F)){w=!1;break}N||(N=f=="constructor")}if(w&&!N){var M=e.constructor,W=t.constructor;M!=W&&"constructor"in e&&"constructor"in t&&!(typeof M=="function"&&M instanceof M&&typeof W=="function"&&W instanceof W)&&(w=!1)}return a.delete(e),a.delete(t),w}sy.exports=UL});var cy=m((nG,uy)=>{var BL=Lr(),kL=xt(),qL=BL(kL,"DataView");uy.exports=qL});var py=m((iG,dy)=>{var $L=Lr(),VL=xt(),GL=$L(VL,"Promise");dy.exports=GL});var my=m((aG,fy)=>{var zL=Lr(),WL=xt(),jL=zL(WL,"Set");fy.exports=jL});var gy=m((oG,hy)=>{var HL=Lr(),JL=xt(),QL=HL(JL,"WeakMap");hy.exports=QL});var Sy=m((sG,Ny)=>{var Hc=cy(),Jc=fs(),Qc=py(),Xc=my(),Kc=gy(),wy=sn(),ti=Uc(),vy="[object Map]",XL="[object Object]",by="[object Promise]",yy="[object Set]",Cy="[object WeakMap]",Ay="[object DataView]",KL=ti(Hc),YL=ti(Jc),ZL=ti(Qc),eM=ti(Xc),tM=ti(Kc),ln=wy;(Hc&&ln(new Hc(new ArrayBuffer(1)))!=Ay||Jc&&ln(new Jc)!=vy||Qc&&ln(Qc.resolve())!=by||Xc&&ln(new Xc)!=yy||Kc&&ln(new Kc)!=Cy)&&(ln=function(e){var t=wy(e),r=t==XL?e.constructor:void 0,n=r?ti(r):"";if(n)switch(n){case KL:return Ay;case YL:return vy;case ZL:return by;case eM:return yy;case tM:return Cy}return t});Ny.exports=ln});var Ry=m((lG,Ty)=>{var Yc=Bc(),rM=kc(),nM=db(),iM=ly(),Dy=Sy(),Ey=Mr(),Iy=gs(),aM=bs(),oM=1,_y="[object Arguments]",Py="[object Array]",Cs="[object Object]",sM=Object.prototype,Oy=sM.hasOwnProperty;function lM(e,t,r,n,i,a){var o=Ey(e),s=Ey(t),l=o?Py:Dy(e),u=s?Py:Dy(t);l=l==_y?Cs:l,u=u==_y?Cs:u;var c=l==Cs,d=u==Cs,f=l==u;if(f&&Iy(e)){if(!Iy(t))return!1;o=!0,c=!1}if(f&&!c)return a||(a=new Yc),o||aM(e)?rM(e,t,r,n,i,a):nM(e,t,l,r,n,i,a);if(!(r&oM)){var h=c&&Oy.call(e,"__wrapped__"),b=d&&Oy.call(t,"__wrapped__");if(h||b){var w=h?e.value():e,N=b?t.value():t;return a||(a=new Yc),i(w,N,r,n,a)}}return f?(a||(a=new Yc),iM(e,t,r,n,i,a)):!1}Ty.exports=lM});var My=m((uG,Ly)=>{var uM=Ry(),Fy=Ur();function xy(e,t,r,n,i){return e===t?!0:e==null||t==null||!Fy(e)&&!Fy(t)?e!==e&&t!==t:uM(e,t,r,n,xy,i)}Ly.exports=xy});var By=m((cG,Uy)=>{var cM=My();function dM(e,t){return cM(e,t)}Uy.exports=dM});var Zc=m((dG,ky)=>{var pM=Lr(),fM=(function(){try{var e=pM(Object,"defineProperty");return e({},"",{}),e}catch{}})();ky.exports=fM});var As=m((pG,$y)=>{var qy=Zc();function mM(e,t,r){t=="__proto__"&&qy?qy(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}$y.exports=mM});var ed=m((fG,Vy)=>{var hM=As(),gM=Jn();function vM(e,t,r){(r!==void 0&&!gM(e[t],r)||r===void 0&&!(t in e))&&hM(e,t,r)}Vy.exports=vM});var zy=m((mG,Gy)=>{function bM(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}Gy.exports=bM});var jy=m((hG,Wy)=>{var yM=zy(),CM=yM();Wy.exports=CM});var Ky=m((Oa,ri)=>{var AM=xt(),Xy=typeof Oa=="object"&&Oa&&!Oa.nodeType&&Oa,Hy=Xy&&typeof ri=="object"&&ri&&!ri.nodeType&&ri,wM=Hy&&Hy.exports===Xy,Jy=wM?AM.Buffer:void 0,Qy=Jy?Jy.allocUnsafe:void 0;function NM(e,t){if(t)return e.slice();var r=e.length,n=Qy?Qy(r):new e.constructor(r);return e.copy(n),n}ri.exports=NM});var eC=m((gG,Zy)=>{var Yy=qc();function SM(e){var t=new e.constructor(e.byteLength);return new Yy(t).set(new Yy(e)),t}Zy.exports=SM});var rC=m((vG,tC)=>{var DM=eC();function EM(e,t){var r=t?DM(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}tC.exports=EM});var iC=m((bG,nC)=>{function IM(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}nC.exports=IM});var sC=m((yG,oC)=>{var _M=gr(),aC=Object.create,PM=(function(){function e(){}return function(t){if(!_M(t))return{};if(aC)return aC(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();oC.exports=PM});var td=m((CG,lC)=>{var OM=jc(),TM=OM(Object.getPrototypeOf,Object);lC.exports=TM});var cC=m((AG,uC)=>{var RM=sC(),FM=td(),xM=ys();function LM(e){return typeof e.constructor=="function"&&!xM(e)?RM(FM(e)):{}}uC.exports=LM});var pC=m((wG,dC)=>{var MM=Pa(),UM=Ur();function BM(e){return UM(e)&&MM(e)}dC.exports=BM});var hC=m((NG,mC)=>{var kM=sn(),qM=td(),$M=Ur(),VM="[object Object]",GM=Function.prototype,zM=Object.prototype,fC=GM.toString,WM=zM.hasOwnProperty,jM=fC.call(Object);function HM(e){if(!$M(e)||kM(e)!=VM)return!1;var t=qM(e);if(t===null)return!0;var r=WM.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&fC.call(r)==jM}mC.exports=HM});var rd=m((SG,gC)=>{function JM(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}gC.exports=JM});var nd=m((DG,vC)=>{var QM=As(),XM=Jn(),KM=Object.prototype,YM=KM.hasOwnProperty;function ZM(e,t,r){var n=e[t];(!(YM.call(e,t)&&XM(n,r))||r===void 0&&!(t in e))&&QM(e,t,r)}vC.exports=ZM});var yC=m((EG,bC)=>{var eU=nd(),tU=As();function rU(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],l=n?n(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),i?tU(r,s,l):eU(r,s,l)}return r}bC.exports=rU});var AC=m((IG,CC)=>{function nU(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}CC.exports=nU});var NC=m((_G,wC)=>{var iU=gr(),aU=ys(),oU=AC(),sU=Object.prototype,lU=sU.hasOwnProperty;function uU(e){if(!iU(e))return oU(e);var t=aU(e),r=[];for(var n in e)n=="constructor"&&(t||!lU.call(e,n))||r.push(n);return r}wC.exports=uU});var id=m((PG,SC)=>{var cU=Wc(),dU=NC(),pU=Pa();function fU(e){return pU(e)?cU(e,!0):dU(e)}SC.exports=fU});var EC=m((OG,DC)=>{var mU=yC(),hU=id();function gU(e){return mU(e,hU(e))}DC.exports=gU});var RC=m((TG,TC)=>{var IC=ed(),vU=Ky(),bU=rC(),yU=iC(),CU=cC(),_C=Vc(),PC=Mr(),AU=pC(),wU=gs(),NU=ps(),SU=gr(),DU=hC(),EU=bs(),OC=rd(),IU=EC();function _U(e,t,r,n,i,a,o){var s=OC(e,r),l=OC(t,r),u=o.get(l);if(u){IC(e,r,u);return}var c=a?a(s,l,r+"",e,t,o):void 0,d=c===void 0;if(d){var f=PC(l),h=!f&&wU(l),b=!f&&!h&&EU(l);c=l,f||h||b?PC(s)?c=s:AU(s)?c=yU(s):h?(d=!1,c=vU(l,!0)):b?(d=!1,c=bU(l,!0)):c=[]:DU(l)||_C(l)?(c=s,_C(s)?c=IU(s):(!SU(s)||NU(s))&&(c=CU(l))):d=!1}d&&(o.set(l,c),i(c,l,n,a,o),o.delete(l)),IC(e,r,c)}TC.exports=_U});var ad=m((RG,xC)=>{var PU=Bc(),OU=ed(),TU=jy(),RU=RC(),FU=gr(),xU=id(),LU=rd();function FC(e,t,r,n,i){e!==t&&TU(t,function(a,o){if(i||(i=new PU),FU(a))RU(e,t,o,r,FC,n,i);else{var s=n?n(LU(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),OU(e,o,s)}},xU)}xC.exports=FC});var od=m((FG,LC)=>{function MU(e){return e}LC.exports=MU});var UC=m((xG,MC)=>{function UU(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}MC.exports=UU});var qC=m((LG,kC)=>{var BU=UC(),BC=Math.max;function kU(e,t,r){return t=BC(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=BC(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),BU(e,this,s)}}kC.exports=kU});var VC=m((MG,$C)=>{function qU(e){return function(){return e}}$C.exports=qU});var WC=m((UG,zC)=>{var $U=VC(),GC=Zc(),VU=od(),GU=GC?function(e,t){return GC(e,"toString",{configurable:!0,enumerable:!1,value:$U(t),writable:!0})}:VU;zC.exports=GU});var HC=m((BG,jC)=>{var zU=800,WU=16,jU=Date.now;function HU(e){var t=0,r=0;return function(){var n=jU(),i=WU-(n-r);if(r=n,i>0){if(++t>=zU)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}jC.exports=HU});var QC=m((kG,JC)=>{var JU=WC(),QU=HC(),XU=QU(JU);JC.exports=XU});var KC=m((qG,XC)=>{var KU=od(),YU=qC(),ZU=QC();function eB(e,t){return ZU(YU(e,t,KU),e+"")}XC.exports=eB});var ZC=m(($G,YC)=>{var tB=Jn(),rB=Pa(),nB=vs(),iB=gr();function aB(e,t,r){if(!iB(r))return!1;var n=typeof t;return(n=="number"?rB(r)&&nB(t,r.length):n=="string"&&t in r)?tB(r[t],e):!1}YC.exports=aB});var sd=m((VG,eA)=>{var oB=KC(),sB=ZC();function lB(e){return oB(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&sB(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t})}eA.exports=lB});var rA=m((GG,tA)=>{var uB=ad(),cB=sd(),dB=cB(function(e,t,r,n){uB(e,t,r,n)});tA.exports=dB});var Ct,Ta=D(()=>{"use strict";(function(e){e[e.NotLoaded=0]="NotLoaded",e[e.Initialized=1]="Initialized",e[e.ConfigsLoaded=2]="ConfigsLoaded",e[e.Error=3]="Error"})(Ct||(Ct={}))});function iA(e,t,r="PROD"){let n=i=>`ShellSettings_ECS_ClientCache_${e}_${nA.EcsConfigType[i]}_${r}`;return{getData:i=>{let a=t.getItem(n(i));return Promise.resolve(a?JSON.parse(a):void 0)},putData:(i,a)=>(t.setItem(n(i),JSON.stringify(a)),Promise.resolve())}}var nA,pB,aA=D(()=>{"use strict";nA=ne(xc()),pB=ne(Fc());});var ld,oA=D(()=>{"use strict";Zo();ld=pa({packageName:"shell-settings",settings:{prodEcsEndpoint:{description:"The url for the PROD ECS endpoint",values:{default:"https://ecs.office.com",dod:"https://config.ecs.dod.teams.microsoft.us",high:"https://config.ecs.gov.teams.microsoft.us",ex:"https://config.ecs.teams.eaglex.ic.gov",rx:"https://config.ecs.teams.microsoft.scloud"}},integrationEcsEndpoint:{description:"The url for the INT ECS endpoint",values:{default:"https://config.edge.skype.net"}}}})});var lA,uA,cA,dA,ud,fB,ws,sA,cd=D(()=>{"use strict";lA=ne(Fc()),uA=ne(v0()),cA=ne(xc()),dA=ne(By()),ud=ne(rA());Ta();aA();oA();fB=60*1e3,ws=class{clientName;logger;ecsEndpoint;resolveLoadingPromise;loadingPromise=new Promise(t=>this.resolveLoadingPromise=t);_status=Ct.NotLoaded;endpointType;clientConfigOverride;get status(){return this._status}constructor(t,r,n="PROD"){this.clientName=t,this.logger=r,this.endpointType=n,this.ecsEndpoint=n==="PROD"?ld.prodEcsEndpoint:ld.integrationEcsEndpoint}client=new uA.default;init=async({clientVersion:t,getFilters:r,cacheStorage:n=lA.StorageHelper.transientWithGlobalFallback,updateIntervalInMinutes:i,overrideEcsInitParams:a})=>{this.client.telemetryEventAdded.subscribe(this.logger.logEvent),this.client.configUpdated.subscribe(this.handleConfigUpdated);let o=(async()=>{let s=await r();return this.logEvent("FeaturesClient/configRequested",{ecsClientName:this.clientName,filters:s}),s});try{await this.client.initialize({clientName:this.clientName,clientVersion:t??"1.0.0.0",configsToFetch:[cA.EcsConfigType.Default],hosts:[this.ecsEndpoint],initialAppActiveState:!0,getEcsParameters:o,databaseInterface:iA(this.clientName,n,this.endpointType),...a}),this.client.requestUpdate(),this._status===Ct.NotLoaded&&(this._status=Ct.Initialized)}catch(s){this._status=Ct.Error,this.resolveLoadingPromise(),this.logEvent("FeaturesClient/initializationFailed",{ecsClientName:this.clientName,error:s},"Error")}i&&window.setInterval(()=>this.client.requestUpdate(),i*fB)};getConfig=t=>{let r=this.getMergedClientConfigByTeamName(t.teamName),n=r?t.extractConfig(r):{};return(0,ud.default)({},t.fallback,n,t.override,sA)};getAllConfigs=()=>this.getMergedClientConfig();getAllConfigsByTeamName=t=>this.getMergedClientConfigByTeamName(t);requestConfigUpdate=()=>{this.client.requestUpdate()};subscribe=(t,r)=>{let n=this.getConfig(t),i=this.client.configUpdated.subscribe(()=>{let a=this.getConfig(t);(0,dA.default)(a,n)||(n={...a},r(a))});return{unsubscribe:()=>i.unsubscribe()}};waitUntilLoaded=async t=>{if(t!==void 0){let r,n=new Promise((i,a)=>{r=window.setTimeout(()=>{a(new Error("Timed out waiting for configuration to load"))},t)});await Promise.race([this.loadingPromise,n]),clearTimeout(r)}else await this.loadingPromise};overrideClientConfig(t){this.logger.logEvent("FeaturesClient/overrideClientConfig",{clientConfigOverride:t}),this.clientConfigOverride=t}undoClientConfigOverride(){this.clientConfigOverride=void 0,this.logger.logEvent("FeaturesClient/undoClientConfigOverride")}getMergedClientConfig=()=>(0,ud.default)({},this.client.getConfig()?.config,this.clientConfigOverride,sA);getMergedClientConfigByTeamName=t=>this.getMergedClientConfig()?.[t];handleConfigUpdated=()=>{let t=this.client.getConfig();if(t===void 0)return;this.resolveLoadingPromise(),this._status=Ct.ConfigsLoaded;let{ConfigIDs:r,Headers:n}=t.config;this.logEvent("FeaturesClient/configUpdated",{ecsClientName:this.clientName,configIDs:r,ETag:n?.ETag})};logEvent=(t,r)=>{this.logger.logEvent(t,{ecsClientName:this.clientName,ecsEndpointType:this.endpointType,...r})}},sA=(e,t)=>{if(Array.isArray(t))return t}});var fA=m((YG,pA)=>{"use strict";var mB=()=>{let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e};pA.exports=mB});var dd=m((ZG,hA)=>{var Ra=new Proxy(function(){return Ra},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:Ra},apply:function(){return Ra},construct:function(){return{}}}),mA=function(){return Ra};Object.setPrototypeOf(mA,Ra);hA.exports=mA});var bA=m((ez,vA)=>{var Fa=new Proxy(function(){return Fa},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:Fa},apply:function(){return Fa},construct:function(){return{}}}),gA=function(){return Fa};Object.setPrototypeOf(gA,Fa);vA.exports=gA});var DA=m((tz,SA)=>{"use strict";var pd=bA(),hB={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gB={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},vB={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},wA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fd={};fd[pd.ForwardRef]=vB;fd[pd.Memo]=wA;function yA(e){return pd.isMemo(e)?wA:fd[e.$$typeof]||hB}var bB=Object.defineProperty,yB=Object.getOwnPropertyNames,CA=Object.getOwnPropertySymbols,CB=Object.getOwnPropertyDescriptor,AB=Object.getPrototypeOf,AA=Object.prototype;function NA(e,t,r){if(typeof t!="string"){if(AA){var n=AB(t);n&&n!==AA&&NA(e,n,r)}var i=yB(t);CA&&(i=i.concat(CA(t)));for(var a=yA(e),o=yA(t),s=0;s<i.length;++s){var l=i[s];if(!gB[l]&&!(r&&r[l])&&!(o&&o[l])&&!(a&&a[l])){var u=CB(t,l);try{bB(e,l,u)}catch{}}}}return e}SA.exports=NA});function IA(e,t,r){let[n,i]=(0,ni.useState)(e.getConfig(t));return(0,ni.useEffect)(()=>{if(!r?.subscribe&&e.status===Ct.ConfigsLoaded)return;let a=e.subscribe(t,o=>{i(o),r?.subscribe||a.unsubscribe()});return a?.unsubscribe},[]),n}function _A(e){return function(t,r){return IA(e,t,r)}}function PA(e,t,r,n){let i=a=>{let o=IA(e,t,n),s={...a,...o};return ni.default.createElement(r,{...s})};return(0,EA.default)(i,r),i.displayName=`WithFeature(${r.name})`,i}function OA(e,t,r,n){return t.reduce((i,a)=>PA(e,a,i,n),r)}function TA(e){return function(t,r,n){return PA(e,t,r,n)}}var EA,ni,md=D(()=>{"use strict";EA=ne(DA()),ni=ne(dd());Ta();});var FA=m((iz,RA)=>{var wB=ad(),NB=sd(),SB=NB(function(e,t,r){wB(e,t,r)});RA.exports=SB});var Ns=m((az,xA)=>{var DB=sn(),EB=Ur(),IB="[object Symbol]";function _B(e){return typeof e=="symbol"||EB(e)&&DB(e)==IB}xA.exports=_B});var MA=m((oz,LA)=>{var PB=Mr(),OB=Ns(),TB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RB=/^\w*$/;function FB(e,t){if(PB(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||OB(e)?!0:RB.test(e)||!TB.test(e)||t!=null&&e in Object(t)}LA.exports=FB});var kA=m((sz,BA)=>{var UA=ms(),xB="Expected a function";function hd(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(xB);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(hd.Cache||UA),r}hd.Cache=UA;BA.exports=hd});var $A=m((lz,qA)=>{var LB=kA(),MB=500;function UB(e){var t=LB(e,function(n){return r.size===MB&&r.clear(),n}),r=t.cache;return t}qA.exports=UB});var GA=m((uz,VA)=>{var BB=$A(),kB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qB=/\\(\\)?/g,$B=BB(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kB,function(r,n,i,a){t.push(i?a.replace(qB,"$1"):n||r)}),t});VA.exports=$B});var WA=m((cz,zA)=>{function VB(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}zA.exports=VB});var KA=m((dz,XA)=>{var jA=wa(),GB=WA(),zB=Mr(),WB=Ns(),jB=1/0,HA=jA?jA.prototype:void 0,JA=HA?HA.toString:void 0;function QA(e){if(typeof e=="string")return e;if(zB(e))return GB(e,QA)+"";if(WB(e))return JA?JA.call(e):"";var t=e+"";return t=="0"&&1/e==-jB?"-0":t}XA.exports=QA});var ZA=m((pz,YA)=>{var HB=KA();function JB(e){return e==null?"":HB(e)}YA.exports=JB});var tw=m((fz,ew)=>{var QB=Mr(),XB=MA(),KB=GA(),YB=ZA();function ZB(e,t){return QB(e)?e:XB(e,t)?[e]:KB(YB(e))}ew.exports=ZB});var nw=m((mz,rw)=>{var ek=Ns(),tk=1/0;function rk(e){if(typeof e=="string"||ek(e))return e;var t=e+"";return t=="0"&&1/e==-tk?"-0":t}rw.exports=rk});var ow=m((hz,aw)=>{var nk=nd(),ik=tw(),ak=vs(),iw=gr(),ok=nw();function sk(e,t,r,n){if(!iw(e))return e;t=ik(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var l=ok(t[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=o){var c=s[l];u=n?n(c,l,s):void 0,u===void 0&&(u=iw(c)?c:ak(t[i+1])?[]:{})}nk(s,l,u),s=s[l]}return e}aw.exports=sk});var lw=m((gz,sw)=>{var lk=ow();function uk(e,t,r){return e==null?e:lk(e,t,r)}sw.exports=uk});function pw(e){let{query:t}=(0,dw.default)(window.location.href,!0);return dk(e,t),e}function dk(e,t){let r=ck+e.clientName,n=Object.keys(t).filter(a=>a.startsWith(r));if(!n)return;let i={};n.forEach(a=>{let o=t[a];if(o)try{let s=JSON.parse(o),l=r+fw,u={};if(a===r)u=s;else if(a.startsWith(l)){let c=a.substring(l.length);(0,cw.default)(u,c,s)}(0,uw.default)(i,u)}catch{}}),Object.keys(i).length>0&&e.overrideClientConfig(i)}var uw,cw,dw,fw,ck,mw=D(()=>{"use strict";uw=ne(FA()),cw=ne(lw()),dw=ne(Cc());fw=".",ck="ecs"+fw});function Ds(e,t,r){let n=pw(new ws(e,t,r));function i(a){(0,Ss.useEffect)(()=>{n.init(a)},[])}return{featuresClient:n,createFeature:fk(n),useFeaturesClientInitParams:i,withFeatures:(a,o,s)=>OA(n,a,o,s)}}function fk(e){let t=_A(e),r=TA(e);return function(i){let a=p0(i);return a.getConfig=()=>e.getConfig(a),a.isLoaded=()=>e.status===Ct.ConfigsLoaded,Nc.register(a,e.clientName),{useFeature:o=>t(a,o),withFeature:(o,s)=>r(a,o,s),feature:a}}}var pk,Ss,gd=D(()=>{"use strict";pk=ne(fA()),Ss=ne(dd());Rc();cd();Ta();md();mw();Sc();});var hw=D(()=>{"use strict";Rc();cd();gd();Ta();md();ns();Dc();});function Es(e){return{logEvent:(t,r,n)=>{switch(n){case"Error":(0,ii.trackErrorTrace)(e,{eventName:t,eventData:r});break;case"Warning":(0,ii.trackWarningTrace)(e,{eventName:t,eventData:r});break;default:(0,ii.trackInfoTrace)(e,{eventName:t,eventData:r});break}}}}var ii,vd=D(()=>{"use strict";ii=ne(en());});var Mz,Uz,Bz,gw=D(()=>{"use strict";hw();vd();({featuresClient:Mz,createFeature:Uz,useFeaturesClientInitParams:Bz}=Ds("PowerApps-Shell-Test",Es("shell-features")))});var yw=m((qz,bw)=>{var xa=new Proxy(function(){return xa},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:xa},apply:function(){return xa},construct:function(){return{}}}),vw=function(){return xa};Object.setPrototypeOf(vw,xa);bw.exports=vw});var mk,hk,Cw=D(()=>{"use strict";ua();mk=ne(yw()),hk=ne(en());});var Aw=D(()=>{"use strict";gw();vd();Cw();});var Qz,ai,Xz,ww=D(()=>{"use strict";Aw();gd();({featuresClient:Qz,createFeature:ai,useFeaturesClientInitParams:Xz}=Ds("PowerApps-MakerPortal",Es("powerapps-features")))});var Nw,Sw,eW,tW,rW,nW,bd=D(()=>{"use strict";d0();ww();({feature:Nw}=ai({teamName:"MakerPortal",owners:["debeshd"],description:"Enable the auto insertion of cell in a row when a section is initialized",createdOn:"09/01/2023",fallback:{enableAutoInsertionOfCellInRow:Hn.enableAutoInsertionOfCellInRow}})),{feature:Sw}=ai({teamName:"MakerPortal",owners:["aansu"],description:"Enable the one grid events for form designer",createdOn:"08/21/2024",fallback:{enableOneGridEventsForFormDesigner:Hn.enableOneGridEvents}}),{feature:eW}=ai({teamName:"MakerPortal",owners:["adekulkarni"],description:"Disables PBI components and cleans them up from the form",createdOn:"01/03/2023",fallback:{enableFallbackFormTemplate:Hn.disablePBIComponents}}),{feature:tW}=ai({teamName:"MakerPortal",owners:["jennietu"],description:"Enables agent response in form designer. This feature is used to enable the agent response in form designer",createdOn:"04/24/2025",fallback:{enableAgentResponse:Hn.enableAgentResponse}}),{feature:rW,useFeature:nW}=ai({teamName:"MakerPortal",owners:["aansu"],description:"Enables delayed localization of custom control",createdOn:"06/08/2025",fallback:{enableDelayedLocalizationForCustomControls:Hn.enableDelayedLocalizationForCustomControls}})});var Iw=m((aW,Ew)=>{var La=new Proxy(function(){return La},{get:function(e,t){return t==="__esModule"?!1:t===Symbol.toPrimitive?function(){return""}:La},apply:function(){return La},construct:function(){return{}}}),Dw=function(){return La};Object.setPrototypeOf(Dw,La);Ew.exports=Dw});var je,Br=D(()=>{"use strict";De();Ce();We();cs();G();Le();je=class extends q{static HighestUsedIndexByClass=new Map;get colspan(){let t=this.getProperty(p.colspan);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}set colspan(t){S.IsNullOrUndefined(t)||this.setProperty(p.colspan,String(t))}constructor(t,r){super(t,r)}get id(){let t=this.getProperty(p.id);return t==null?null:t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?new _(t.substr(1,t.length-2)):new _(t)}set id(t){this.setProperty(p.id,`{${t.ToString()}}`)}set labelId(t){this.setProperty(p.labelId,`{${t.ToString()}}`)}get labelId(){let t=this.getProperty(p.labelId);return t&&t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"?new _(t.substr(1,t.length-2)):new _(t)}get Name(){return this.getProperty(p.Name)}set Name(t){this.setProperty(p.Name,t)}setDisplayName(t,r){for(let i of this.getAllLabels())if(+i.getProperty(p.languagecode)===r){i.setProperty(p.description,t);return}let n=new q(g.formLabel,null);n.setProperty(p.description,t),n.setProperty(p.languagecode,String(r)),this.addGrandChild("labels",n)}getDisplayName(t){for(let r of this.getAllLabels())if(+r.getProperty(p.languagecode)===t)return r.getProperty(p.description)}getAllLabels(){let t=this.getChildren("labels");return t.length!==1?[]:t[0].getChildren("label")}get isLocked(){return+this.getProperty(p.locklevel)==1}set isLocked(t){!this.IsUnboundControl&&this.setProperty(p.locklevel,t?"1":"0")}get availableforphone(){return this.getProcessedValue(p.availableforphone)}set availableforphone(t){S.IsNullOrUndefined(t)||!this.IsAllowedUBCForAvailableOnPhone()||this.setProperty(p.availableforphone,String(t))}get visible(){return this.getProcessedValue(p.visible)}set visible(t){S.IsNullOrUndefined(t)||!this.IsAllowedUBCForVisibleByDefault()||this.setProperty(p.visible,String(t))}isLockLevelSettable(){return!this.IsUnboundControl}get showlabel(){return this.getProcessedValue(p.showlabel)}set showlabel(t){S.IsNullOrUndefined(t)||this.setProperty(p.showlabel,String(t))}isAvailableForPhoneSettable(){return this.IsAllowedUBCForAvailableOnPhone()}isVisibleSettable(){return this.IsAllowedUBCForVisibleByDefault()}getProcessedValue(t){let r=this.getProperty(t);return S.IsNullOrUndefined(r)||this.getProperty(t)==="true"}get readonly(){let t=this.getFirstChild(g.formControl);return t?t.disabled:!1}set readonly(t){let r=this.getFirstChild(g.formControl);r&&(r.disabled=t)}get allowfilteroff(){let t=this.getFirstChild(g.formControl);if(t)return t.getParam(p.AllowFilterOff)==="true"}set allowfilteroff(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.AllowFilterOff,t)}get autoresolve(){let t=this.getFirstChild(g.formControl);if(t)return t.getParam(p.AutoResolve)==="true"}set autoresolve(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.AutoResolve,t)}get defaultviewid(){let t=this.getFirstChild(g.formControl);return t?t.getParam(p.DefaultViewId):P.EmptyString}set defaultviewid(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DefaultViewId,t)}get dependentattributename(){let t=this.getFirstChild(g.formControl);return t?t.getParam(p.DependentAttributeName):P.EmptyString}set dependentattributename(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DependentAttributeName,t)}get dependentattributetype(){let t=this.getFirstChild(g.formControl);return t?t.getParam(p.DependentAttributeType):P.EmptyString}set dependentattributetype(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DependentAttributeType,t)}get disablequickfind(){let t=this.getFirstChild(g.formControl);if(t)return t.getParam(p.DisableQuickFind)==="true"}set disablequickfind(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DisableQuickFind,t)}get disableviewpicker(){let t=this.getFirstChild(g.formControl);if(t)return t.getParam(p.DisableViewPicker)==="true"}set disableviewpicker(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.DisableViewPicker,t)}get filterrelationshipname(){let t=this.getFirstChild(g.formControl);return t?t.getParam(p.FilterRelationshipName):P.EmptyString}set filterrelationshipname(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.FilterRelationshipName,t)}get availableviewids(){let t=this.getFirstChild(g.formControl);return t?t.getParam(p.AvailableViewIds):P.EmptyString}set availableviewids(t){let r=this.getFirstChild(g.formControl);r&&!this.IsUnboundControl&&r.setParameter(p.AvailableViewIds,t)}get IsUnboundControl(){let t=this.getFirstChild(g.formControl);if(t&&t.ClassId){let r=Ie.getUniqueIdentifierForControl(t);return!S.IsNullOrUndefined(r)&&Ie.isUnboundFormControlByIdentifier(r)}else return!1}IsAllowedUBCForAvailableOnPhone(){let t=this.getFirstChild(g.formControl);if(t){let n=Ie.getUniqueIdentifierForControl(t).guidString,i=n===T.GridControl||n===T.TimeLineControl||n===T.TimeLineControlUC;return this.IsUnboundControl?i:!0}return this.NodeName===g.formSection||this.NodeName===g.formTab}IsAllowedUBCForVisibleByDefault(){let t=this.getFirstChild(g.formControl);if(t){let n=Ie.getUniqueIdentifierForControl(t).guidString,i=n===T.MapsControl||n===T.WebResourceHtmlControl||n===T.WebResourceImageControl||n===T.IframeControl||n===T.SocialInsightControl;return this.IsUnboundControl?i:!0}else return!0}get events(){let t=this.getChildren(g.formEvents);return t.length===1?t[0].getAllChildren():[]}addEvent(t){this.addGrandChild(g.formEvents,t)}getUsedNodeNameSet(t){return null}getHighestIndexById(t,r){return null}}});var oi,yd=D(()=>{"use strict";We();G();Le();oi=class extends q{constructor(t,r){super(g.dependency,t),P.IsNullOrEmpty(r)||this.setDefaultProperties(r)}set id(t){this.setProperty(p.id,t)}get id(){return this.getProperty(p.id)}setDefaultProperties(t){this.id=t}}});var _w,si,Cd=D(()=>{"use strict";Ce();yd();G();Le();Br();(function(e){e[e.Form=0]="Form",e[e.Cell=1]="Cell",e[e.Tab=2]="Tab",e[e.Control=3]="Control"})(_w||(_w={}));si=class extends je{constructor(t,r){super(g.formEvent,t),r&&(this.eventName=r,this.application="false",this.active="false")}set eventName(t){this.setProperty(p.Name,t)}get eventName(){return this.getProperty(p.Name)}set application(t){this.setProperty(p.application,t)}get application(){return this.getProperty(p.application)}set attribute(t){this.setProperty(p.EventAttribute,t)}get attribute(){return this.getProperty(p.EventAttribute)}set relationship(t){this.setProperty(p.Relationship,t)}get relationship(){return this.getProperty(p.Relationship)}set control(t){this.setProperty(p.Control,t)}get control(){return this.getProperty(p.Control)}set active(t){this.setProperty(p.EventActive,t)}get active(){return this.getProperty(p.EventActive)}getAllHandlers(){let t=this.getChildren(g.EventHandlers);return t&&t.length?t[0].getChildren(g.handler):[]}getAllDependencies(){let t=this.getChildren(g.formDependencies);return t.length===0?[]:t[0].getAllChildren()}setDependencies(t){let r=this.getFirstChild(g.formDependencies);if(S.IsNullOrUndefined(r)){if(t.length===0)return;this.addChild(new q(g.formDependencies,this)),r=this.getFirstChild(g.formDependencies)}if(t.length===0)r.getParentNode().deleteChild(r);else{r.deleteAllChildren();for(let n of t)r.addChild(new oi(r,n.toString()))}}}});var Lt,Ma=D(()=>{"use strict";De();la();Ce();Zr();G();Le();Rt();Lt=class extends q{previewVersion;constructor(t){super(g.formControl,t)}updatePreview(){this.previewVersion=Date.now()}get ClassId(){let t=this.getProperty(p.classid);return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),new _(t)}set ClassId(t){this.setProperty(p.classid,`{${t.ToString()}}`)}get dataFieldName(){return this.getProperty(p.datafieldname)}set dataFieldName(t){this.setProperty(p.datafieldname,t)}set id(t){this.setProperty(p.id,t)}get id(){return this.getProperty(p.id)}get UniqueId(){let t=this.getProperty(p.uniqueid);return S.IsNullOrUndefined(t)?null:(t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),new _(t))}set UniqueId(t){this.setProperty(p.uniqueid,`{${t.ToString()}}`)}get isRequired(){return this.getProperty(p.isRequired)==="true"}set isRequired(t){S.IsNullOrUndefined(t)||this.setProperty(p.isRequired,String(t))}get disableMru(){return this.getParam(p.DisableMru)==="true"}set disableMru(t){S.IsNullOrUndefined(t)||this.setParameter(p.DisableMru,t)}get useMFDForCreate(){return this.getParam(p.UseMFDForCreate)==="true"}set useMFDForCreate(t){S.IsNullOrUndefined(t)||this.setParameter(p.UseMFDForCreate,t)}get useMFDForEdit(){return this.getParam(p.UseMFDForEdit)==="true"}set useMFDForEdit(t){S.IsNullOrUndefined(t)||this.setParameter(p.UseMFDForEdit,t)}get disabled(){return this.getProperty(p.disabled)==="true"}set disabled(t){S.IsNullOrUndefined(t)||this.setProperty(p.disabled,String(t))}get indicationOfSubgrid(){return this.getProperty(p.indicationOfSubgrid)==="true"}set indicationOfSubgrid(t){this.setProperty(p.indicationOfSubgrid,String(t))}getAllParameters(){let t=new Ke,r=this.getFirstChild(p.parameters);return r&&r.getAllChildren().forEach(n=>{if(n){let i=n.getAllChildren(),a=i&&i.length>0&&i[0];a&&t.add(n.getNodeName(),a.getNodeName())}}),t}setParameter(t,r){let n=!1;r===null&&(n=!0);let i=(hr.StartTag+r).toString(),a=this.parametersNode;if(a){let o=a.findFirst(s=>s&&s.getNodeName()===t);if(o)if(n){this.deleteFirstGrandChildOfName(g.controlParameters,o);return}else{let s=o.getAllChildren();s&&s.length>0&&s[0]?s[0].setNodeName(i):o.addChild(new q(i,o))}else n||(o=new q(t,a),o.addChild(new q(i,o)),a.addChild(o))}else if(!n){a=new q("parameters",this);let o=new q(t,a);o.addChild(new q(i,o)),a.addChild(o),this.addChild(a)}}getParam(t){if(this.parametersNode){let r=this.parametersNode.findFirst(n=>n&&n.getNodeName()===t);if(r){let n=r.getAllChildren(),i=n&&n.length>0&&n[0];if(i){let a=i.getNodeName();return a.charAt(0)===hr.StartTag?a.substring(1):a}}}return null}get parametersNode(){let t=this.getChildren(p.parameters);return t.length===0?null:t[0]}async serializeParameters(t,r){let n=new Ke;switch(this.ClassId.guidString.toUpperCase()){case A.LookupControl:if(t&&t.getKeys())if(t.getKeys().forEach(o=>{n.add(o,this.getParam(o))}),t&&t.containsKey("DefaultViewId")){let o=this.getParam("DefaultViewId").replace("{","").replace("}","");n.upsert("DefaultViewId",o)}else{let o=this.getParent(),s=await r.formModelService.lookupControlService.populateDefaultView(this,o.getParentForm().entityName);s&&s.id&&n.upsert("DefaultViewId",s.id.replace("{","").replace("}",""))}break;default:t&&t.getKeys()&&t.getKeys().forEach(o=>{n.add(o,this.getParam(o))});break}let i=n.getInternalObject(),a=[];for(let o in i)i.hasOwnProperty(o)&&a.push({Name:o,Value:i[o]});return a}getIsUnbound(){return this.getProperty(p.isUnbound)==="true"}getAttributeTypeFromClassId(t){if(t)switch(t.toUpperCase()){case A.BooleanControl:case A.CheckboxControl:return 0;case A.DateTimeControl:return 2;case A.DecimalControl:return 3;case A.FloatingNumberControl:return 4;case A.IntegerControl:case A.DurationControl:case A.LanguageControl:case A.TimezoneControl:return 5;case A.LookupControl:return 6;case A.CurrencyControl:return 8;case A.PartyListControl:return 10;case A.ChoiceControl:case A.RelationshipRoleChoiceControl:return 11;case A.ChoiceStatusControl:return 13;case A.TextAreaControl:case A.TextboxControl:case A.LabelControl:case A.EmailAddressControl:case A.UrlControl:case A.TickerControl:case A.ButtonControl:case A.PhoneNumberControl:return 14;case A.ChoicesControl:return 24;default:return}return 14}async toJSON(t){let r=this.getParent(),n=t&&t.formModelService&&t.formModelService.getFormType()===Ee.QuickViewForm?!0:this.disabled,i=await this.serializeParameters(this.getAllParameters(),t);return{ClassId:this.ClassId&&this.ClassId.guidString,Parameters:i,Disabled:n,ControlLayout:0,RequiredLevel:0,Type:this.getAttributeTypeFromClassId(this.ClassId.guidString),IsUnbound:this.getIsUnbound(),IsRequired:this.isRequired,DataFieldName:this.dataFieldName,UniqueId:this.UniqueId&&this.UniqueId.guidString,Id:this.previewVersion?this.id+this.previewVersion:this.id,Label:r.getDisplayName(t.langCode),LabelId:r.labelId&&r.labelId.guidString,Name:null,ShowLabel:r.showlabel,PreviewId:r&&r.id.guidString,Visible:r.visible||t.formModelService.showHiddenElements}}}});var li,Ad=D(()=>{"use strict";We();$n();Ma();G();Le();li=class extends Lt{constructor(t){super(t)}get targetEntityType(){return this.getParam(p.targetEntityType)||P.EmptyString}set targetEntityType(t){this.setParameter(p.targetEntityType,t)}get viewId(){return P.StripBraces(this.getParam(p.viewId))||P.EmptyString}set viewId(t){this.setParameter(p.viewId,P.AddBraces(t))}get viewIds(){return this.getParam(p.viewIds)||P.EmptyString}set viewIds(t){this.setParameter(p.viewIds,t)}get relationshipName(){return this.getParam(p.RelationshipName)||P.EmptyString}set relationshipName(t){this.setParameter(p.RelationshipName,t)}get isUserView(){return P.IsStrictTrue(this.getParam(p.isUserView))}set isUserView(t){this.setParameter(p.isUserView,t.toString())}get enableViewPicker(){return P.IsStrictTrue(this.getParam(p.enableViewPicker))}set enableViewPicker(t){this.setParameter(p.enableViewPicker,t)}get autoExpand(){return this.getParent().autoexpand&&this.getParam(p.autoExpand)===p.Auto}set autoExpand(t){let r=this.getParent();this.setParameter(p.autoExpand,t?p.Auto:p.Fixed),r.autoexpand=t}get recordsPerPage(){return this.getParam(p.recordsPerPage)?Number(this.getParam(p.recordsPerPage)):Number(p.RecordsPerPageRAControlDefault)}set recordsPerPage(t){this.setParameter(p.recordsPerPage,String(t))}get enableQuickFind(){return P.IsStrictTrue(this.getParam(p.enableQuickFind))}set enableQuickFind(t){this.setParameter(p.enableQuickFind,t)}get teamTemplateId(){return P.StripBraces(this.getParam(p.teamTemplateId))||P.EmptyString}set teamTemplateId(t){this.setParameter(p.teamTemplateId,P.AddBraces(t))}get chartId(){return this.getParam(p.visualizationId)||P.EmptyString}set chartId(t){this.setParameter(p.visualizationId,t)}get enableChartPicker(){return P.IsStrictTrue(this.getParam(p.enableChartPicker))}set enableChartPicker(t){this.setParameter(p.enableChartPicker,t)}get chartGridMode(){switch(this.getParam(p.chartGridMode)){case yt.Chart:return yt.Chart;case yt.Grid:return yt.Grid;default:return yt.All}}set chartGridMode(t){this.setParameter(p.chartGridMode,t)}updateChartGridMode(t){t?this.chartGridMode=yt.Chart:this.chartGridMode=this.enableChartPicker?yt.All:yt.Grid}updateDefaultProperties(t,r){for(let n of t)switch(n.getNodeName()){case p.targetEntityType:n.getAllChildren()[0].setNodeName("<"+r.targetEntityType);break;case p.viewId:n.getAllChildren()[0].setNodeName("<"+P.AddBraces(r.viewId));break;case p.isUserView:n.getAllChildren()[0].setNodeName("<"+r.isUserView);break;case p.enableViewPicker:n.getAllChildren()[0].setNodeName("<"+r.enableViewPicker);break;case p.RelationshipName:let i=n.getAllChildren(),a="<"+r.relationshipName;i.length?n.getAllChildren()[0].setNodeName(a):n.addChild(new q(a,n));break;default:break}}updateControlDescription(t){let r=t.getControlDescriptionByForControl(this.UniqueId);if(r){let n=r.customControls;for(let i=0;i<n.length;i++){let a=n[i].getParameters().get(Ye.dataset)?n[i].getParameters().get(Ye.dataset)[0]:null;if(a){let o=a.getAllChildren();this.updateDefaultProperties(o,this)}else{let o=n[i].getAllChildren()[0].getAllChildren();this.updateDefaultProperties(o,this)}}}}}});var ui,wd=D(()=>{"use strict";We();$n();Ma();G();ui=class extends Lt{constructor(t){super(t)}get defaultViewId(){return P.StripBraces(this.getParam(p.DefaultViewId))||P.EmptyString}set defaultViewId(t){this.setParameter(p.DefaultViewId,P.AddBraces(t))}get autoResolve(){return P.IsStrictTrue(this.getParam(p.AutoResolve))}set autoResolve(t){this.setParameter(p.AutoResolve,t)}get disableQuickFind(){return P.IsStrictTrue(this.getParam(p.DisableQuickFind))}set disableQuickFind(t){this.setParameter(p.DisableQuickFind,t)}get disableViewPicker(){return P.IsStrictTrue(this.getParam(p.DisableViewPicker))}set disableViewPicker(t){this.setParameter(p.DisableViewPicker,t)}get allowFilterOff(){return P.IsStrictTrue(this.getParam(p.AllowFilterOff))}set allowFilterOff(t){this.setParameter(p.AllowFilterOff,t)}get disableMru(){return P.IsStrictTrue(this.getParam(p.DisableMru))}set disableMru(t){this.setParameter(p.DisableMru,t)}get dependentAttributeName(){return this.getParam(p.DependentAttributeName)||P.EmptyString}set dependentAttributeName(t){this.setParameter(p.DependentAttributeName,t)}get dependentAttributeType(){return this.getParam(p.DependentAttributeType)||P.EmptyString}set dependentAttributeType(t){this.setParameter(p.DependentAttributeType,t)}get filterRelationshipName(){return this.getParam(p.FilterRelationshipName)||P.EmptyString}set filterRelationshipName(t){this.setParameter(p.FilterRelationshipName,t)}get availableViewIds(){return this.getParam(p.AvailableViewIds)||P.EmptyString}set availableViewIds(t){this.setParameter(p.AvailableViewIds,t)}updateDefaultProperties(t,r){for(let n of t)switch(n.getNodeName()){case p.datafieldname:case p.bindAttribute:n.getAllChildren()[0].setNodeName("<"+r.dataFieldName);break;case p.DefaultViewId:n.getAllChildren()[0].setNodeName("<"+P.AddBraces(r.defaultViewId));break;case p.AllowFilterOff:n.getAllChildren()[0].setNodeName("<"+r.allowFilterOff);break;case p.DisableQuickFind:n.getAllChildren()[0].setNodeName("<"+r.disableQuickFind);break;case p.DisableViewPicker:n.getAllChildren()[0].setNodeName("<"+r.disableViewPicker);break;case p.FilterRelationshipName:n.getAllChildren()[0].setNodeName("<"+r.filterRelationshipName);break;case p.DependentAttributeName:n.getAllChildren()[0].setNodeName("<"+r.dependentAttributeName);break;case p.DependentAttributeType:n.getAllChildren()[0].setNodeName("<"+r.dependentAttributeType);break;case p.AvailableViewIds:n.getAllChildren()[0].setNodeName("<"+r.availableViewIds);break;case p.DisableMru:n.getAllChildren()[0].setNodeName("<"+r.disableMru);break;case p.AutoResolve:n.getAllChildren()[0].setNodeName("<"+r.autoResolve);break;default:break}}updateControlDescription(t){let r=t.getControlDescriptionByForControl(this.UniqueId);if(r){let n=r.customControls;for(let i=0;i<n.length;i++){let a=n[i].getParameters().get(Ye.value)?n[i].getParameters().get(Ye.value)[0]:null;if(a){let o=a.getAllChildren();this.updateDefaultProperties(o,this)}else{let o=n[i].getAllChildren()[0].getAllChildren();this.updateDefaultProperties(o,this)}}}}}});var Pw,Nd,ot,Ua=D(()=>{"use strict";Pw=ne(Iw());Br();G();Ce();De();Cd();Ma();cs();Oc();lc();Rt();Zr();Bn();Ad();wd();Sd();ma();Nd="_",ot=class e extends je{fieldPlaceholder;fieldRequiredLevel;isNewField;cellColType;dependentFields=[];constructor(t){super(g.formCell,t),this.isNewField=!1}get cellType(){return this.cellColType}set cellType(t){this.cellColType=t}setDefaultProperties(t){this.showlabel=t,this.isLocked=!1,S.IsNullOrUndefined(this.getProperty(p.id))&&(this.id=new _(_.NewGuid()))}addControl(t,r,n,i,a,o,s){n instanceof Lt?this.addChild(n):n instanceof _&&this.addChild(this.getControlWithControlSpecificProperties(t,r,n,i,a,o,s))}removeControl(){return this.deleteChild(this.control)>=0}get isIndependent(){if(!S.IsNullOrUndefined(this.control))return S.IsNullOrUndefined(this.control.dataFieldName)?S.IsNullOrUndefined(this.control.id)?!0:!tn.dependencyFieldCount.containsKey(this.control.id):!tn.dependencyFieldCount.containsKey(this.control.dataFieldName)}createOnLoadEvent(){this.addEvent(new si(this,oa.onLoad))}get dependencies(){let t=this.getChildren(g.formEvents);for(let r of t){let n=r.getChildren(g.formEvent);for(let i of n)this.buildDependencyList(i,this.dependentFields)}return this.dependentFields}getNextAvailableControlName(t,r,n,i){let a;if(i&&Jo[i])a=Jo[i].replace(/ /g,Nd)+Nd;else{a="Control_";let u=new Error("Control class id does not exist or is undefined");(0,Pw.trackErrorTrace)(Xe,{eventName:`${ph}/getNextAvailableControlName`},u)}let o="new_",s=this.getHighestIndexById(t,i)+1,l=`${a}${o}${s}`;for(;n.has(l);)s++,l=`${a}${o}${s}`;return l}getUnboundControlProperties(t){e.prototype.setProperty.call(t,p.isUnbound,"true"),e.prototype.setProperty.call(t,p.isRequired,"false")}getControlWithControlSpecificProperties(t,r,n,i,a,o,s){let l;a===At.Grid?(l=new li(this),l.indicationOfSubgrid=!0):a===At.Lookup?l=new ui(this):l=new Lt(this);let u=n.guidString,c=o||this.getNextAvailableControlName(t,i,this.getUsedNodeNameSet(t),u);if(e.prototype.setProperty.call(l,p.id,c),l.ClassId=n,!S.IsNullOrUndefined(s)&&(l.UniqueId=s),!o&&r)this.getUnboundControlProperties(l);else{let d=Ie.getUniqueIdentifierForControl(l);S.IsNullOrUndefined(d)||(Ie.getControlDataTypeByControlOrUniqueId(d)===U.QuickFormCollectionControl||!Ie.isUnboundFormControlByIdentifier(d)?a!==At.Grid&&o&&u!==A.IframeControl&&u!==A.SubgridControl&&u!==A.ReferencePanelSubgridControl&&(l.dataFieldName=o,e.prototype.setProperty.call(l,p.disabled,"false")):(this.rowspan=Ie.GetRowSpan(l),(Ie.getControlDataTypeByControlOrUniqueId(d)===U.NotesControl||Ie.getControlDataTypeByControlOrUniqueId(d)===U.TimeLineControl)&&(e.prototype.setProperty.call(l,p.disabled,"false"),l.id=U.NotesControl)),(Ie.getUnboundControlNameFromIdentifier(n)===U.SubGridControl||Ie.getUnboundControlNameFromIdentifier(n)===U.NotesControl||Ie.getUnboundControlNameFromIdentifier(n)===U.TimeLineControl)&&(this.availableforphone=!0))}return l}buildDependencyList(t,r){if(S.IsNullOrUndefined(t))return;let n=t.getAllChildren();for(let i of n){let a=i.getAllChildren();for(let o of a){let s=o.GetPropertyByParameter(p.id);o.getNodeName()===g.dependency&&s?r.push(s):this.buildDependencyList(o,r)}}}get control(){return this.getFirstChild(g.formControl)}set rowspan(t){this.setProperty(p.rowspan,String(t))}get rowspan(){let t=this.getProperty(p.rowspan);return S.IsNullOrUndefined(t)?1:parseInt(t,10)}set autoexpand(t){this.setProperty(p.auto,String(t))}get autoexpand(){return this.getProperty(p.auto)==="true"}set colspan(t){let r=Number(_c.ONE_COLUMN),n=Number(_c.FOUR_COLUMN);S.IsNullOrUndefined(t)||t>n||t<r||this.setProperty(p.colspan,String(t))}get colspan(){let t=this.getProperty(p.colspan);return S.IsNullOrUndefined(t)?1:parseInt(t,10)}getParentRow(){return this.getAncestor(g.formRow)}getParentSection(){return this.getAncestor(g.formSection)}getParentTab(){return this.getAncestor(g.formTab)}getParentForm(){return this.getAncestor(g.form)}isInHeader(){let t=this.getAncestor(g.formHeader);return!S.IsNullOrUndefined(t)}isInFooter(){let t=this.getAncestor(g.formFooter);return!S.IsNullOrUndefined(t)}isEmpty(){return S.IsNullOrUndefined(this.control)&&!this.IsUserSpacer}getHeaderFooter(){return this.isInHeader()?this.getAncestor(g.formHeader):this.isInFooter()?this.getAncestor(g.formFooter):null}get FieldRequiredLevel(){return this.fieldRequiredLevel}set FieldRequiredLevel(t){this.fieldRequiredLevel=t}get FieldPlaceholder(){return this.fieldPlaceholder}set FieldPlaceholder(t){this.fieldPlaceholder=t}get IsNewField(){return this.isNewField}set IsNewField(t){this.isNewField=t}get IsUserSpacer(){let t=this.getProperty(p.userspacer);return S.IsNullOrUndefined(t)?!1:t==="true"}SetUserSpacer(){this.setProperty(p.userspacer,"true")}ClearUserSpacer(){this.setProperty(p.userspacer,"false")}get columns(){let t=this.getProperty(p.columnName);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}getColumnLayoutValue(t){let r;switch(t){case pe.TWO_COLUMN:r="11";break;case pe.THREE_COLUMN:r="111";break;case pe.FOUR_COLUMN:r="1111";break;default:r="1"}return r}findRowIndexByCellId(t){let r=this.getParentRow().cells.indexOf(this);for(let n=0;n<t.rows.length;n++)if(!S.IsNullOrUndefined(t.rows[n].cells[r])&&this.id.ToString()===t.rows[n].cells[r].id.ToString())return n;return-1}setAutoExpandDetailsForTab(){let t=this.getParentTab();S.IsNullOrUndefined(t)||(t.autoExpandCell=this,t.tabContainsAutoExpandControl=!0)}isCellRequiredOrLocked(t,r,n){let i=this.getParentForm();if(this?.control){if(this.IsUserSpacer)return!1;{if(this.isLocked||r().has(this.control.dataFieldName))return!0;let a=i.isDuplicateCell(this,n),o=this.getRequiredLevel(t);if((o===nn.ApplicationRequired||o===nn.SystemRequired)&&!a||this.isCellLockedByExternal(t)&&!a)return!0}}return!1}getRequiredLevel(t){return!this.control?.dataFieldName||!this.control?.id||this.IsNewField||!this.control?.ClassId?nn.None:t.getEntityAttributeByName(this.control.dataFieldName)?.requiredLevel?.toString()??nn.None}isCellLockedByExternal(t){return this.control||this.IsUnboundControl?!1:t.getEntityAttributeByName(this.control.dataFieldName).isRequiredForForm||!this.isIndependent}async toJSON(t){return{Id:this.id&&this.id.guidString,Name:this.Name,Label:this.getDisplayName(t.langCode),ShowLabel:this.showlabel,Visible:this.visible||t.formModelService.showHiddenElements,LabelId:this.labelId.guidString,PreviewId:this.id&&this.id.guidString,ColSpan:this.colspan,RowSpan:this.rowspan,AutoExpand:this.autoexpand,IsInFirstColumnOfSection:!1,IsInLastColumnOfSection:!1,AvailableForPhone:this.availableforphone,UserSpacer:this.IsUserSpacer,IsPreviewCell:!1,IsStreamCell:!1,IsChartCell:!1,IsTileCell:!1,Control:this.control&&await this.control.toJSON(t)}}getUsedNodeNameSet(t){let r=new Set;return t&&t.visit(n=>{if(n.getNodeName()===g.formCell){let i=n;i.control&&i!==this&&r.add(n.control.id)}return!1}),r}getHighestIndexById(t,r){let n=t.findAll(a=>a.getNodeName()===g.formCell&&a.control&&a.control.ClassId.guidString===r),i=0;return n.forEach(a=>{i=Math.max(this.parseControlNameIndex(a.control.id),i)}),i}parseControlNameIndex(t){let r=t.length-1,n=0;for(;r>0&&parseInt(t.charAt(r),10);)r--;return r>0&&r!==t.length-1&&t.charAt(r)===Nd&&(r++,n=parseInt(t.substr(r,t.length-r),10)),n}}});var ci,Dd=D(()=>{"use strict";We();G();Le();ci=class extends q{isInternal;constructor(t,r,n,i){super(g.library,t),this.isInternal=!!i,P.IsNullOrEmpty(n)||(this.name=r,this.libraryUniqueId=n)}get libraryUniqueId(){let t=this.getProperty(p.libraryUniqueId);return t&&t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"&&(t=t.substr(1,t.length-2)),t?.toUpperCase()}set libraryUniqueId(t){this.setProperty(p.libraryUniqueId,t)}get name(){return this.getProperty(p.libraryName)}set name(t){this.setProperty(p.libraryName,t)}get displayName(){return this.getProperty(p.displayName)}set displayName(t){this.setProperty(p.displayName,t)}get description(){return this.getProperty(p.description)}set description(t){this.setProperty(p.description,t)}}});var un,Ed=D(()=>{"use strict";Ce();Ua();G();Le();un=class extends q{isRowAddedOnDragOver;constructor(t){super(g.formRow,t)}addCell(t){this.addChild(t)}appendCells(t){for(let r of t)this.addChild(r)}updateCell(t,r){return this.updateChild(t,r)}removeCell(t){return S.IsNullOrUndefined(t)?!1:this.deleteChild(t)>=0}insertCellAtIndex(t,r){return S.IsNullOrUndefined(t)?!1:(this.insertChildAtIndex(t,r),!0)}isEmpty(){return!this.cells||this.cells.every(t=>t.isEmpty())}getParentSection(){return this.getAncestor(g.formSection)}insertPaddingCellAtIndex(t){let r=new ot(this);r.setDefaultProperties(),this.insertCellAtIndex(r,t)}get firstCell(){let t=this.cells;return t.length>0?t[0]:null}get cells(){return this.getChildren(g.formCell)}get rowColspan(){return this.cells.reduce((t,r)=>t+r.colspan,0)}set IsRowAddedOnDragOver(t){this.isRowAddedOnDragOver=t}get IsRowAddedOnDragOver(){return this.isRowAddedOnDragOver}async getCellsJSON(t){let r=[],n=[];if(this.cells){for(let i of this.cells)n.push(i.toJSON(t));for(let i of n)r.push(await i)}return r}async toJSON(t){return{Cells:await this.getCellsJSON(t),Visible:!0,Height:"0"}}}});function gk(e){switch(e){case an.Left:return on.Left;case an.Right:return on.Right;case an.Center:return on.Center;default:return on.Left}}function vk(e){switch(e){case zn.Left:return jn.Left;case zn.Top:return jn.Top;default:return jn.Left}}function Ow(e){switch(e){case 1:return 1;case 2:return 11;case 3:return 111;case 4:return 1111;default:return 1}}var bk,Qt,Ba=D(()=>{"use strict";Tc();De();Ce();We();bd();Ua();G();Rt();Br();Ed();bk=115,Qt=class e extends je{colSpan=1;constructor(t,r){super(t,r)}getSectionType(){let t;switch(this.columns){case 1:t=pe.ONE_COLUMN;break;case 11:t=pe.TWO_COLUMN;break;case 111:t=pe.THREE_COLUMN;break;case 1111:t=pe.FOUR_COLUMN;break;default:t=this.colSpan-1}return t}setUniqueName(){let t=this.getParentTab(),r=le.namePrefix;if(t){let n=t.Name,i=t.TotalSectionsCount+1;r=n+le.namePrefix+i.toString()}else r+=Math.floor(Math.random()*1e3);this.setProperty(p.Name,r)}initializeDefaultProperties(t,r,n){if(n===pe.REFERENCE_PANEL){this.addProperty(p.rowheight,"25");let i=`${le.referencePanelNamePrefix}${_.NewGuid()}${le.namePrefix}`;this.addProperty(p.Name,i)}else this.setUniqueName();if(this.addProperty(p.id,new _(_.NewGuid()).guidString),this.addProperty(p.IsUserDefined,le.IsUserDefined),this.addProperty(p.locklevel,le.LockLevel),this.addProperty(p.showlabel,le.ShowLabel),this.addProperty(p.showbar,le.ShowBar),this.addProperty(p.layout,le.Layout),this.addProperty(p.Fieldlabelalignment,le.labelAlignment),this.addProperty(p.Fieldlabelposition,le.labelPosition),S.IsNullOrUndefined(n))this.addProperty(p.columnName,le.columns);else{let i=this.getColumnLayoutValue(n);this.addProperty(p.columnName,i)}this.addProperty(p.LabelWidth,le.LabelWidth),this.setDisplayName(r,t)}getColumnLayoutValue(t){let r;switch(t){case pe.TWO_COLUMN:r="11";break;case pe.THREE_COLUMN:r="111";break;case pe.FOUR_COLUMN:r="1111";break;default:r="1"}return r}getNumberOfColumns(){return e.getNumericColumnLayoutValue(this.columns)}static getNumericColumnLayoutValue(t){switch(t){case 1:return 1;case 11:return 2;case 111:return 3;case 1111:return 4;default:throw new Error("Unexpected Section Layout Value.")}}getColumnCountValue(){let t=0;return S.IsNullOrUndefined(this.columns)?t=this.ColSpan:this.columns.toString().split(P.EmptyString).forEach(r=>{t+=parseInt(r,10)}),t}get ColSpan(){return this.colSpan}initializeRow(t){if(t>0&&t<5){let r=new un(null);if(this.addGrandChild(g.formRows,r),Nw.getConfig().enableAutoInsertionOfCellInRow)for(let n=0;n<t;n++){let i=new ot(r);i.setDefaultProperties(!1),r.addCell(i)}}}initialize(t,r,n){this.initializeDefaultProperties(t,r,n),n===pe.REFERENCE_PANEL&&(n=pe.ONE_COLUMN),this.initializeRow(n+1)}setColSpan(t){this.colSpan=t}appendRow(t){this.addGrandChild(g.formRows,t)}insertRowAtIndex(t,r){this.addGrandChildAtIndex(g.formRows,t,r)}insertRowsAtIndex(t,r){if(t&&t.length>0)for(let n=0;n<t.length;n++)this.addGrandChildAtIndex(g.formRows,t[n],r+n)}indexOfRow(t){return this.rows.indexOf(t)}deleteRow(t){return this.deleteFirstGrandChildOfName(g.formRows,t)}deleteRows(t,r){this.deleteGrandChildren(g.formRows,t,r)}get rows(){return this.getRows()}getRows(){let t=this.getChildren(g.formRows);return t.length===0?[]:t[0].getChildren(g.formRow)}get columns(){let t=this.getProperty(p.columnName),r=S.IsNullOrUndefined(t)?NaN:parseInt(t,10);if(isNaN(r)){let n=1;for(let i of this.rows)n=Math.max(n,i.cells.length);return Ow(n)}return r}set columns(t){S.IsNullOrUndefined(t)||this.setProperty(p.columnName,String(t))}get rowHeight(){let t=this.getProperty(p.rowheight);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}set rowHeight(t){this.setProperty(p.rowheight,String(t))}set autoexpand(t){this.setProperty(p.autoExpand.toLowerCase(),String(t))}get autoexpand(){return this.getProperty(p.autoExpand.toLowerCase())==="true"}get isUserDefined(){return+this.getProperty(p.IsUserDefined)!=0}set isUserDefined(t){t?this.setProperty(p.IsUserDefined,"1"):this.setProperty(p.IsUserDefined,"0")}getParentColumn(){return this.getAncestor(g.formColumn)}getParentTab(){return this.getAncestor(g.formTab)}get hasMultiColumnRow(){return this.getColumnCountValue()>1}get showlabel(){return this.getProperty(p.showlabel)==="true"}set showlabel(t){S.IsNullOrUndefined(t)||this.setProperty(p.showlabel,String(t))}get fieldLabelAlignment(){let t=le.labelAlignment,r=this.getProperty(p.Fieldlabelalignment);return S.IsNullOrUndefined(r)?t:r}set fieldLabelAlignment(t){S.IsNullOrUndefined(t)||this.setProperty(p.Fieldlabelalignment,t)}get fieldLabelPosition(){let t=this.getProperty(p.Fieldlabelposition);return S.IsNullOrUndefined(t)?le.labelPosition:t}set fieldLabelPosition(t){S.IsNullOrUndefined(t)||this.setProperty(p.Fieldlabelposition,String(t))}get showbar(){return this.getProperty(p.showbar)==="true"}set showbar(t){S.IsNullOrUndefined(t)||this.setProperty(p.showbar,String(t))}get labelwidth(){let t=+this.getProperty(p.LabelWidth);return t===0?bk:t}set labelwidth(t){S.IsNullOrUndefined(t)||t>283&&t<57||this.setProperty(p.LabelWidth,t.toString())}async getRowsJSON(t){let r=[],n=[];if(this.rows){for(let i of this.rows)n.push(i.toJSON(t));for(let i of n)r.push(await i)}return r}async toJSON(t){return{Name:this.Name,Id:this.id&&this.id.guidString,Label:this.getDisplayName(t.langCode),ShowLabel:this.showlabel,Visible:this.visible||t.formModelService.showHiddenElements,LabelId:this.labelId&&this.labelId.guidString,PreviewId:this.id&&this.id.guidString,Rows:await this.getRowsJSON(t),CellLabel:{Width:this.labelwidth,Alignment:gk(this.fieldLabelAlignment),Position:vk(this.fieldLabelPosition)},Columns:Ow(this.getColumnCountValue()),AvailableForPhone:this.availableforphone,Height:this.rowHeight&&this.rowHeight.toString()}}getUsedNodeNameSet(t){let r=new Set;return t&&t.visit(n=>{if(n.getNodeName()===g.formSection){let i=n;i.Name&&!P.GuidStringEquals(i.id.guidString,this.id.guidString)&&r.add(n.Name)}return!1}),r}isReferencePanelSection(){return!S.IsNullOrUndefined(this)&&!S.IsNullOrUndefined(this.Name)&&this.Name.indexOf(le.referencePanelNamePrefix)===0}getAllMultiRowCells(){return this.findAll(t=>{if(t.getNodeName()===g.formCell){let r=t;return!r.isEmpty()&&r.rowspan>1}return!1})}isHeaderOrFooterSection(){return this.NodeName===g.formFooter||this.NodeName===g.formHeader}}});var kr,Is=D(()=>{"use strict";G();Le();Ba();kr=class e extends q{constructor(t){super(g.formColumn,t)}initializeDefaultProperties(t){this.addProperty(p.width,t.toString()+"%")}insertSectionAtIndex(t,r){this.addGrandChildAtIndex(g.formSections,t,r)}static createAndInitNewSection(t,r,n){let i=new Qt(g.formSection,null);return i.initialize(t,r,n),i}addSectionAtIndex(t,r){this.addGrandChildAtIndex(g.formSections,t,r)}initialize(t,r,n,i=pe.ONE_COLUMN){this.initializeDefaultProperties(t);let a=e.createAndInitNewSection(r,n,i);this.addSectionAtIndex(a,this.sections.length),a.setUniqueName()}get parentTab(){return this.getAncestor(g.formTab)}get sections(){let t=this.getChildren("sections");return t.length!==1?[]:t[0].getChildren(g.formSection)}get width(){return this.getProperty(p.width)}set width(t){this.setProperty(p.width,t)}deleteSection(t){return this.deleteFirstGrandChildOfName(g.formSections,t)}async getSectionsJSON(t){let r=[];if(this.sections)for(let n of this.sections)r.push(await n.toJSON(t));return r}async toJSON(t){return{Name:this.getProperty(p.Name),Id:this.getProperty(p.id),Label:null,ShowLabel:!1,Visible:!0,LabelId:null,PreviewId:this.getProperty(p.id),Sections:await this.getSectionsJSON(t),Width:this.width}}}});var _s,Tw=D(()=>{"use strict";De();G();Rt();Ba();_s=class extends Qt{initializeNavArea(t,r,n){this.initializeNavAreaProps(t,r,n)}get AreaName(){return this.Name}initializeNavAreaProps(t,r,n){this.addProperty(p.Name,n),this.addProperty(p.id,new _(_.NewGuid()).guidString),this.addProperty(p.columnName,le.columns),this.setDisplayName(r,t)}}});var Ps,Rw=D(()=>{"use strict";Is();G();Tw();Ps=class extends kr{addAndIntializeNavBarSection(t,r,n,i){let a=new _s(g.formSection,null);return a.initializeNavArea(t,r,i),this.addGrandChildAtIndex(g.formSections,a,n),a}}});var vr,Os=D(()=>{"use strict";De();Ce();We();Is();G();Le();Br();vr=class extends je{tabContainsAutoExpandControl;autoExpandCell;constructor(t,r){super(g.formTab,t),this.tabContainsAutoExpandControl=!1}getParentForm(){return this.getAncestor(g.form)}getTabLayoutType(){let t;switch(this.columns.length){case 1:t=de.ONE_COLUMN;break;case 2:if(parseInt(this.columns[0].width,10)===50&&parseInt(this.columns[1].width,10)===50){t=de.TWO_COLUMN_EQUAL;break}if(parseInt(this.columns[0].width,10)===67&&parseInt(this.columns[1].width,10)===33){t=de.TWO_COLUMN_WIDER_LEFT;break}if(parseInt(this.columns[0].width,10)===34&&parseInt(this.columns[1].width,10)===66){t=de.TWO_COLUMN_WIDER_RIGHT;break}t=de.TWO_COLUMN_CUSTOM_LAYOUT;break;case 3:if(parseInt(this.columns[0].width,10)===34&&parseInt(this.columns[1].width,10)===33&&parseInt(this.columns[2].width,10)===33){t=de.THREE_COLUMN_EQUAL;break}if(parseInt(this.columns[0].width,10)===28&&parseInt(this.columns[1].width,10)===44&&parseInt(this.columns[2].width,10)===28){t=de.THREE_COLUMN_WIDER_MID;break}t=de.THREE_COLUMN_CUSTOM_LAYOUT;break;default:}return t}initializeProperties(t,r,n){this.addProperty(p.Name,Rr.namePrefix+t.toString()),this.addProperty(p.id,new _(_.NewGuid()).guidString),this.addProperty(p.IsUserDefined,Rr.IsUserDefined),this.addProperty(p.locklevel,Rr.LockLevel),this.addProperty(p.showlabel,Rr.ShowLabel),this.setDisplayName(n,r)}get TotalSectionsCount(){let t=0;for(let r of this.columns)t+=r.sections.length;return t}initializeColumns(t,r,n,i=pe.ONE_COLUMN,a=!0,o){let s=this.getChildren(g.formColumns)[0],l=[];switch(t){case de.ONE_COLUMN:l.push(100);break;case de.TWO_COLUMN_EQUAL:l.push(50),l.push(50);break;case de.TWO_COLUMN_WIDER_LEFT:l.push(67),l.push(33);break;case de.TWO_COLUMN_WIDER_RIGHT:l.push(34),l.push(66);break;case de.THREE_COLUMN_EQUAL:l.push(34),l.push(33),l.push(33);break;case de.THREE_COLUMN_WIDER_MID:l.push(28),l.push(44),l.push(28);break;default:}for(let u of l){let c=new kr(s);c.initialize(u,r,n,i),this.addGrandChild(g.formColumns,c)}}initialize(t,r,n,i,a,o=pe.ONE_COLUMN,s=!0,l){this.addChild(new q(g.formColumns,this)),this.initializeProperties(r,n,i),this.initializeColumns(t,n,a,o,s,l)}get columns(){let t=this.getChildren(g.formColumns);return t.length!==1?[]:t[0].getChildren(g.formColumn)}get expanded(){return this.getProcessedValue(p.expanded)}set expanded(t){S.IsNullOrUndefined(t)||this.setProperty(p.expanded,String(t))}get groupName(){return this.getProperty(p.groupName)}get contentType(){return this.getProperty(p.contentType)}set contentType(t){this.setProperty(p.contentType,t)}insertNewColumnAtIndex(t,r,n,i,a){t.initialize(n,i,a),this.addGrandChildAtIndex(g.formColumns,t,r)}insertColumnAtIndex(t,r){this.addGrandChildAtIndex(g.formColumns,t,r)}deleteColumn(t){return this.deleteFirstGrandChildOfName(g.formColumns,t)}async getColumnsJSON(t){let r=[],n=[];if(this.columns){for(let i of this.columns)n.push(i.toJSON(t));for(let i of n)r.push(await i)}return r}async toJSON(t){return{Name:this.Name,Id:this.id&&this.id.guidString,Label:this.getDisplayName(t.langCode)+(!this.visible&&t.formModelService.showHiddenElements?"\u3000\u3000":""),ShowLabel:this.showlabel,Visible:this.visible||t.formModelService.showHiddenElements,LabelId:this.labelId&&this.labelId.guidString,UniqueId:this.id&&this.id.guidString,PreviewId:this.id&&this.id.guidString,Columns:await this.getColumnsJSON(t),EventHandlers:[],Expanded:this.expanded,ContentType:this.contentType,AvailableForPhone:this.availableforphone,Header:void 0,Footer:void 0}}getUsedNodeNameSet(t){let r=new Set;return t&&t.visit(n=>{if(n.getNodeName()===g.formTab){let i=n;i.Name&&!P.GuidStringEquals(i.id.guidString,this.id.guidString)&&r.add(n.Name)}return!1}),r}}});var cn,Id=D(()=>{"use strict";De();G();Le();Rt();Rw();Os();cn=class extends vr{constructor(t,r,n){super(t,de.THREE_COLUMN_EQUAL),this.setDisplayName(r,n),this.id=new _(_.NewGuid())}initializeDefaultProps(){this.addChild(new q(g.formColumns,this)),this.initializeFiveColumns()}get columns(){let t=this.getChildren("columns");return t.length!==1?[]:t[0].getChildren(g.formColumn)}getNavSectionForArea(t){for(let r of this.columns)for(let n of r.sections)if(n.AreaName===t)return n;return null}getNavCellFromNavId(t){for(let r of this.columns)for(let n of r.sections)for(let i of n.rows)for(let a of i.cells)if(a.NavId===t)return a;return null}initializeFiveColumns(){for(let t=0;t<os.FIVE_COLUMN;t++){let r=new Ps(this.getChildren(g.formColumns)[0]);r.initializeDefaultProperties(Vh.FiveEqColumn),this.addGrandChild(g.formColumns,r)}}}});function Ck(e){switch(e){case Ee.Main:return xr.Main;case Ee.QuickCreate:return xr.QuickCreate;case Ee.QuickViewForm:return xr.Quick;case Ee.Dialog:return xr.Dialog;default:return xr.None}}function Ak(e,t){if(t===Ee.Main){if(e)switch(e.toLowerCase()){case"low":return Tr.Low;case"highreadonlyvalues":return Tr.HighReadOnlyValues;default:return Tr.HighWithControls}return Tr.Low}}var Rs,yk,Ts,Fw=D(()=>{"use strict";o0();Rs=ne(en());Tc();Ce();We();Bn();bd();G();$n();Qu();Zr();Ua();G();Br();Dd();Id();Os();yk="1920";Ts=class e extends je{_formUniqueName;isHeaderDefaulted;consistencyStrong=!1;_formId;_rawFormXml;_entityName;_entityDisplayName;_status;_formName;_langCode;_description;_formType;_formPresentation;parameters=[];_formactivationstate;_changeTracker;_metadataChangeEvent;_etag;constructor(t,r,n,i,a,o,s,l,u){super(g.form,null),this._formUniqueName=a,this._formId=t,this._entityName=r,this._status=n,this._formName=i,this._description=l,this._formType=o,this._formPresentation=s,this._formactivationstate=u,this._changeTracker=new zo,this._metadataChangeEvent=new ds}get FormLibraries(){let t=this.getFirstChild(g.formLibraries),r=t?t.getAllChildren():[],n=this._getInternalLibraries();return r.concat(n)}getAllEvents(){let t=[],r=this.events;r&&(t=t.concat(r));for(let n of this.tabs){let i=n.events;i&&(t=t.concat(i)),n.findAll(a=>a instanceof ot).forEach(a=>{let o=a.events;o&&(t=t.concat(o))})}return t}getEventsForNode(t){if(t instanceof e){let r=t.events;return r?r.filter(n=>!n.control&&!n.attribute):null}else if(t instanceof ot){if(t.control?.dataFieldName){let r=this.events;return r?r.filter(n=>n.attribute&&t.control.dataFieldName===n.attribute):null}else if(this.isCellEditableGridControl(t)){let r=this.events;return r?r.filter(n=>n.control&&t.control.id===n.control):null}}return t?.events}_getInternalLibraries(){let t=this.findAll(i=>i.getNodeName()===g.internalLibraries),r=[],n="src";return t.length>0&&(r=t.map(i=>{let a=i.GetPropertyByParameter(n).replace("$webresource:",""),o=new ci(void 0,void 0,"",!0);return o.name=a,o.displayName=a,o})),r}getDependentFields(){let t=this.getAllEvents(),r=new Set;return t.forEach(n=>{try{n.getAllDependencies().forEach(a=>{r.add(a.id)})}catch(i){throw(0,Rs.trackErrorTrace)(fh,{eventName:"GetDependentFields_MissingDependencies",eventData:{Message:`Failed get dependencies for form event in form ${this.formId.guidString}.`,Attribute:n.attribute,EventName:n.eventName}}),i}}),r}get Parameters(){return this.parameters}set Parameters(t){this.parameters=t}get ShowImagecheck(){return P.IsNullOrEmpty(this.getProperty(p.ShowImage))?!0:this.getProperty(p.ShowImage)!=="false"}set ShowImagecheck(t){t?this.setProperty(p.ShowImage,String(t)):this.setProperty(p.ShowImage,"false")}get ShowNavigation(){return P.IsNullOrEmpty(this.getProperty(p.ShowNavigationbar))?!0:this.getProperty(p.ShowNavigationbar)!=="false"}set ShowNavigation(t){t?this.setProperty(p.ShowNavigationbar,String(t)):this.setProperty(p.ShowNavigationbar,"false")}get MaxWidth(){return P.IsNullOrEmpty(this.getProperty(p.MaxWidth))?yk:this.getProperty(p.MaxWidth)}set MaxWidth(t){this.setProperty(p.MaxWidth,t)}get headerDensityType(){return this.getProperty(p.HeaderDensityType)}set headerDensityType(t){t&&this.formType===Ee.Main?this.setProperty(p.HeaderDensityType,t):this.formType!==Ee.Main&&this.headerDensityType&&this.removeProperty(p.HeaderDensityType)}IsMainOrQuickCreateForm(){return this.formType===Ee.Main||this.formType===Ee.QuickCreate}get FormPresentation(){return this._formPresentation}get LanguageCode(){return this._langCode}set LanguageCode(t){this._langCode=t}get header(){let t=this.getChildren(g.formHeader);return t.length!==1?null:t[0]}set header(t){S.IsNullOrUndefined(t)||(this.deleteChild(this.header),this.addChild(t))}getAllDependencies(){return this.getChildren(g.quickFormDependencies).length===0?[]:this.ConvertModelToArray(this.getChildren(g.quickFormDependencies)[0].getAllChildren())}ConvertModelToArray(t){let r=[];return S.IsNullOrUndefined(t)||t.forEach(n=>{r.push(n.id)}),r}get footer(){let t=this.getChildren(g.formFooter);return t.length!==1?null:t[0]}set footer(t){S.IsNullOrUndefined(t)||(this.deleteChild(this.footer),this.addChild(t))}createAndInitNewTab(t,r,n){let i=new vr(null,t),a=this.getNextTabCounter(this.tabs.length+1);return i.initialize(t,a,this.LanguageCode,r,n),i}addTabAtIndex(t,r){this.addGrandChildAtIndex(g.formTabs,t,r)}createAndInitNewTabWithMarginalControl(t,r,n,i,a){let o=new vr(null,de.ONE_COLUMN),s=this.getNextTabCounter(this.tabs.length+1);o.initialize(de.ONE_COLUMN,s,this.LanguageCode,r,n,a,!1),this.addGrandChildAtIndex(g.formTabs,o,i);let l=o.columns[0].sections[0];for(let u=0;u<t.rows.length;u++)l.appendRow(t.rows[u])}getNextTabCounter(t){for(let r=0;r<this.tabs.length;r++)if(this.tabs[r].Name===Rr.namePrefix+t.toString())return this.getNextTabCounter(t+1);return t}get allTabs(){let t=this.getChildren(g.formTabs);return t.length!==1?[]:t[0].getChildren(g.formTab)}get CanvasNavigationTab(){if(this.tabs.length>0){let t=this.tabs[this.tabs.length-1];if(t instanceof cn)return t}return null}get NavigationNode(){let t=this.getChildren(g.formNavigation);return t.length!==1?null:t[0]}set NavigationNode(t){let n=this.getAllChildren().indexOf(this.NavigationNode);n>=0&&(this.deleteChild(this.NavigationNode),this.insertChildAtIndex(t,n))}addNavigatioNode(t){this.addChild(t)}get tabs(){return this.allTabs}deleteTab(t){return this.deleteFirstGrandChildOfName(g.formTabs,t)}insertTabAtIndex(t,r){this.addGrandChildAtIndex(g.formTabs,t,r)}insertRelatedTab(t){let r=this.getAllGrandChildren(g.formTabs);if(!S.IsNullOrUndefined(r)){let n=r.length;this.insertTabAtIndex(t,n)}}get isfooterPresent(){return this.getChildren(g.formFooter).length>0}get displayCondition(){let t=this.getChildren(g.formDisplayConditions);return t.length>0?t[0]:null}set displayCondition(t){this.deleteChild(this.displayCondition),this.addChild(t)}get entityName(){return this._entityName}get formId(){return this._formId}set formId(t){this._formId=t}get rawFormXml(){return this._rawFormXml}set rawFormXml(t){this._rawFormXml=t}get status(){return this._status}set status(t){this._status=t}get formName(){return this._formName}set formName(t){this.trackObjectPropertyChange("_formName",t)}get formUniqueName(){return this._formUniqueName}set formUniqueName(t){this.trackObjectPropertyChange("_formUniqueName",t)}get formType(){return this._formType}get tabCount(){return this.allTabs.length}get description(){return this._description}set description(t){this.trackObjectPropertyChange("_description",t)}get formactivationstate(){return this._formactivationstate}set formactivationstate(t){this.trackObjectPropertyChange("_formactivationstate",t)}get entityDisplayName(){return this._entityDisplayName}set entityDisplayName(t){this._entityDisplayName=t}get etag(){return this._etag}set etag(t){this._etag=t}indexOfTab(t){return this.getAllGrandChildren(g.formTabs).indexOf(t)}get ControlDescriptions(){return this.getAllGrandChildren(g.controlDescriptions)}addControlDescriptionNode(t){this.addGrandChild(g.controlDescriptions,t)}deleteControlDescByForControlId(t){let r=this.getControlDescriptionByForControl(t);S.IsNullOrUndefined(r)||this.deleteFirstGrandChildOfName(g.controlDescriptions,r)}getControlDescriptionByForControl(t){if(!t)return null;for(let r of this.ControlDescriptions)if(r.forControl.guidString===t.guidString)return r;return null}cellHasCustomControlWithName(t,r){if(!t?.control||!r)return!1;let n=this.getControlDescriptionByForControl(t.control.UniqueId);return n?!!n.customControls.find(i=>i.name===r):!1}isDuplicateCell(t,r){return!!this.findFirst(i=>{if(!(i instanceof ot))return!1;let a=!0;return r==="Tab"?a=i.getParentTab()!==t.getParentTab():r==="Section"?a=i.getParentSection()!==t.getParentSection():a=i!==t,i instanceof ot&&i.control&&t.control&&a&&i.control.dataFieldName===t.control.dataFieldName})}isCellEditableGridControl(t){return!t?.control?.indicationOfSubgrid||t.control.ClassId.guidString.toUpperCase()!==A.CustomControl?!1:this.cellHasCustomControlWithName(t,Fr.EditableGridControl)||Sw.getConfig()?.enableOneGridEventsForFormDesigner&&this.cellHasCustomControlWithName(t,Fr.PowerAppsOneGrid)}isCellCanvasAppControl(t){return t?.control?.ClassId.guidString.toUpperCase()===A.CustomControl&&this.cellHasCustomControlWithName(t,Fr.CanvasAppControl)}findFormNodeById(t,r=this){return r===null?null:r.findFirst(n=>{if(n===this&&t===this.formId.ToString()||n.id?.ToString?.()===t)return!0})}findFormCellByClassId(t,r=this){return r?r.findFirst(n=>{if(n.getNodeName()===g.formCell){let i=n;return i&&i.control&&i.control.ClassId.guidString===t}return!1}):null}async getTabsJSON(t){let r=this.tabs,n=[],i=[];if(r){for(let a of r)if(!(a instanceof cn)){let o=a.toJSON(t);n.push(o)}for(let a of n)i.push(await a)}return i}async getControlDescriptionsToJSON(t){let r=[];for(let n of this.ControlDescriptions){let i=await n.toJSON(t);i&&r.push(i)}return r}async toJSON(t){let r=[];r=await this.getControlDescriptionsToJSON(t);let n=this.NavigationNode&&await this.NavigationNode.toJSON(t);return{Id:this._formId.guidString,Name:this.formName,Label:this.getDisplayName(t.langCode),ShowLabel:this.showlabel,Visible:this.visible,LabelId:this.labelId&&this.labelId.guidString,PreviewId:this._formId.guidString,PreviewSessionId:(0,Rs.getSessionId)(),EntityLogicalName:this._entityName,FormId:this._formId.guidString,TabAttributes:{},Tabs:await this.getTabsJSON(t),HiddenFields:[],Header:this.header&&await this.header.toJSON(t),Footer:this.footer&&await this.footer.toJSON(t),...this.formType===Ee.Main?{HeaderDensity:Ak(this.headerDensityType,this.formType)}:{},InlineEditGridRow:[],InlineQuickForms:[],QuickFormEntities:[],EventHandlers:[],LinkControlSections:[],FormType:Ck(this.formType),SubGrids:[],Views:void 0,Charts:void 0,CustomControlConfigurations:r,BusinessLogic:void 0,FormLibraries:[],Navigation:n,ShowNavigationBar:this.ShowNavigation||t.formModelService.showHiddenElements,ClientResources:[]}}changeTracker(){return this._changeTracker}onMetadataChange=t=>this._metadataChangeEvent.on(t);raiseMetadataChange(t){this._metadataChangeEvent.emit(t)}}});var Fs,_d,xw=D(()=>{"use strict";De();Ce();G();Le();Br();Fs=class extends je{constructor(t){super(g.formDisplayConditions,t)}get Order(){let t=this.getProperty(p.Order);return S.IsNullOrUndefined(t)?null:parseInt(t,10)}set Order(t){this.setProperty(p.Order,t.toString())}get FallbackForm(){return this.getProperty(p.FallbackForm)==="true"}set FallbackForm(t){this.setProperty(p.FallbackForm,t.toString())}addRoles(t){this.deleteAllChildren();for(let r=0;r<t.length;r++)this.addChild(t[r])}isRoleEveryone(){return!!(this.getChildren(g.formEveryOne)&&this.getChildren(g.formEveryOne)[0])}setRoleEveryone(){this.deleteAllChildren(),this.addChild(new _d(this))}},_d=class extends q{constructor(t){super(g.formEveryOne,t)}}});var xs,Lw=D(()=>{"use strict";G();Le();xs=class extends q{constructor(t,r){super(g.Handler,r),t.length>0&&this.setDefaultProperties(t)}setDefaultProperties(t){this.FunctionName=t[0],this.LibraryName=t[1],this.HandlerUniqueID=t[2],this.Enabled=t[3],this.Parameters=t[4],this.PassExecutionContext=t[5]}get HandlerUniqueID(){return this.getProperty(p.HandlerUniqueId)}set HandlerUniqueID(t){this.setProperty(p.HandlerUniqueId,t)}get FunctionName(){return this.getProperty(p.functionName)}set FunctionName(t){this.setProperty(p.functionName,t)}get LibraryName(){return this.getProperty(p.libraryNameEventHandler)}set LibraryName(t){this.setProperty(p.libraryNameEventHandler,t)}get Enabled(){return this.getProperty(p.enabledForField)}set Enabled(t){this.setProperty(p.enabledForField,t)}get PassExecutionContext(){return this.getProperty(p.passExecutionContext)}set PassExecutionContext(t){this.setProperty(p.passExecutionContext,t)}get Parameters(){return this.getProperty(p.parameters)}set Parameters(t){this.setProperty(p.parameters,t)}}});var di,Pd=D(()=>{"use strict";G();Ba();di=class extends Qt{constructor(t,r){super(t,r)}get cells(){let t=this.getRows(),r=[];if(this.rows&&t.length){for(let n of this.rows)if(n.cells){let i=n.getChildren(g.formCell);for(let a of i)r.push(a)}}return r}get occupiedCells(){return this.cells.filter(t=>!t.isEmpty())}get maxColumns(){return super.getColumnCountValue()}}});var ka,Mw=D(()=>{"use strict";G();Pd();ka=class extends di{_customFooter;constructor(t,r){super(g.formFooter,t),this._customFooter=r}get customFooter(){return this._customFooter}set customFooter(t){this._customFooter=t}async getControls(t){let r=[];if(this.rows){for(let n of this.rows)if(n.cells)for(let i of n.cells)i.control&&r.push(await i.control.toJSON(t))}return r}async toJSON(t){return{AvailableForPhone:this.availableforphone,Controls:await this.getControls(t),UniqueId:this.id&&this.id.guidString,PreviewId:this.id&&this.id.guidString}}isEmpty(){return!this.cells.find(t=>!!t.control)}}});var qa,Uw=D(()=>{"use strict";G();Pd();qa=class extends di{_customHeader;constructor(t,r){super(g.formHeader,t),this._customHeader=r}get customHeader(){return this._customHeader}set customHeader(t){this._customHeader=t}get showCommandBar(){return this.getProcessedValue(p.showCommandBar)}set showCommandBar(t){t!=null&&this.setProperty(p.showCommandBar,String(t))}get showBody(){return this.getProcessedValue(p.showBody)}set showBody(t){t!=null&&this.setProperty(p.showBody,String(t))}get showTabNavigator(){return this.getProcessedValue(p.showTabNavigator)}set showTabNavigator(t){t!=null&&this.setProperty(p.showTabNavigator,String(t))}async getControls(t){let r=[];if(this.rows){for(let n of this.rows)if(n.cells)for(let i of n.cells)i.control&&r.push(await i.control.toJSON(t))}return r}async toJSON(t){return{AvailableForPhone:this.availableforphone,Controls:await this.getControls(t),UniqueId:this.id&&this.id.guidString,PreviewId:this.id&&this.id.guidString}}}});var st,dn=D(()=>{"use strict";De();We();G();Br();st=class e extends je{constructor(t,r){super(t,r)}getTitle(t){for(let r of this.getAllTitles())if(+r.getProperty(p.LCID)===t)return r.getProperty(p.text);return null}getAllTitles(){let t=this.getChildren(g.Titles);return t.length===0?[]:t[0].getChildren(g.Title)}setTitle(t,r){for(let i of this.getAllTitles())if(+i.getProperty(p.LCID)===r){i.setProperty(p.text,t);return}let n=new e(g.Title,null);n.setProperty(p.text,t),n.setProperty(p.LCID,String(r)),this.addGrandChild(g.Titles,n)}get Sequence(){return+this.getProperty(p.Sequence)}set Sequence(t){this.setProperty(p.Sequence,t.toString())}get Area(){return this.getProperty(p.Area)}set Area(t){this.setProperty(p.Area,t)}set Id(t){this.setProperty(p.Id,t)}get Id(){return this.getProperty(p.Id)}get id(){return new _(this.Id??"",!0)}set id(t){this.Id=t.guidString}get Show(){return!0}get Icon(){return this.getProperty(p.icon)}set Icon(t){t=t||P.EmptyString,this.setProperty(p.icon,t)}updateCommonProperties(t,r){this.Area=t.Area,this.Sequence=t.Sequence,this.setTitle(t.getDisplayName(r),r)}}});var $a,Bw=D(()=>{"use strict";(function(e){e[e.NavLinkNotAvailable=-1]="NavLinkNotAvailable",e[e.NavLinkIdConflict=-2]="NavLinkIdConflict",e[e.NavBarNotAvailable=-3]="NavBarNotAvailable"})($a||($a={}))});var Ls,kw=D(()=>{"use strict";Ce();G();dn();Bw();Ls=class extends st{constructor(t){super(g.formNavBar,t)}addChildElement(t){this.addChild(t)}getAllActiveNavBarChildren(){return this.getAllChildren().filter(n=>n.Show)}getAllInActiveActiveNavBarChildren(){return this.getAllChildren().filter(n=>!n.Show)}get AllRelationShipItems(){return this.getChildren("NavBarByRelationshipItem")}get AllNavLinkItems(){return this.getChildren("NavBarItem")}removeNavLink(t){let r=this.getNavBarLinkItemById(t);return S.IsNullOrUndefined(r)?$a.NavLinkNotAvailable:r.length===1?this.deleteChild(r[0]):$a.NavLinkIdConflict}getRelationShipItemsByArea(t){let r=this.AllRelationShipItems,n=[];for(let i of r)i.Area===t&&i.Show===!0&&n.push(i);return n}getNavBarRelationShipItemsByNavId(t){return this.AllRelationShipItems.filter(n=>n.Id===t)}getNavBarLinkItemById(t){let r=this.AllNavLinkItems.filter(n=>n.Id===t);return r.length>0?r:null}getAllActiveChildrenForGivenArea(t){let r=this.getAllChildren(),n=[];for(let i of r)i.Area===t&&i.Show&&n.push(i);return n}}});var oe,wk,qw,JH,pi,Od=D(()=>{"use strict";De();G();dn();(function(e){e.Info="_NA_Info",e.Sales="_NA_SFA",e.Service="_NA_CS",e.Marketing="_NA_MA",e.InternetMarketing="_NA_IMA",e.ProcessCenter="_NA_PROC",e.Async="_NA_AO"})(oe||(oe={}));wk=new Map([[oe.Info,"Info"],[oe.Sales,"Sales"],[oe.Service,"Service"],[oe.Marketing,"Marketing"],[oe.ProcessCenter,"ProcessCenter"]]),qw=new Map([["Info",oe.Info],["Sales",oe.Sales],["Service",oe.Service],["Marketing",oe.Marketing],["ProcessCenter",oe.ProcessCenter]]),JH=new Map([[oe.Info,9e3],[oe.Sales,9200],[oe.Service,9400],[oe.Marketing,9600],[oe.ProcessCenter,9800],[oe.InternetMarketing,1e4],[oe.Async,10200]]),pi=class extends st{constructor(t,r){super(g.formNavBarArea,r)}setDefaultPropertiesByType(t,r,n){this.AreaId=wk.get(t);let i=n?.(`navBarArea.title.${this.AreaId}`)??this.AreaId;this.setTitle(i,r)}get ParentNavigation(){return this.getAncestor(g.formNavigation)}get AreaId(){return this.getProperty(p.Id)}set AreaId(t){this.setProperty(p.Id,t)}get id(){return new _(this.AreaId??"",!0)}set id(t){this.AreaId=t.guidString}async toJSON(t){return{Id:this.AreaId,Titles:[{LCID:t.langCode,Text:this.getTitle(t.langCode)}],PreviewId:this.AreaId}}}});var fi,Td=D(()=>{"use strict";G();dn();fi=class extends st{constructor(t,r){super(g.formNavBarAreas,r)}get AllNavBarAreaItems(){return this.getChildren(g.formNavBarArea)}get ParentNavigation(){return this.getAncestor(g.formNavigation)}addNavBarArea(t){this.addChild(t)}}});var Ms,$w=D(()=>{"use strict";Ce();G();dn();Ms=class extends st{RelationshipNameUCIRuntime;constructor(t){super(g.formNavBarByRelationshipItem,t)}get RelationshipName(){return this.getProperty(p.RelationshipName)}set RelationshipName(t){this.setProperty(p.RelationshipName,t)}set Show(t){this.setProperty(p.Show,String(t))}get Show(){let t=this.getProperty(p.Show);return S.IsNullOrUndefined(t)||t==="true"}get TitleResourceId(){return this.getProperty(p.TitleResourceId)}async toJSON(t){return{Area:this.Area,Show:this.Show||t.formModelService.showHiddenElements,Id:this.Id,Titles:[{Name:t.langCode.toString(),Value:this.getTitle(t.langCode)}],Sequence:this.Sequence.toString(),Privileges:[],TooltipTitles:[],AvailableOffline:!0,PreviewId:this.Id,RelationshipName:this.RelationshipNameUCIRuntime??this.RelationshipName,Icon:null,ViewId:null,Client:null,TitleResourceId:null}}}});var Us,Vw=D(()=>{"use strict";G();dn();Us=class extends st{constructor(t){super(g.formNavBarItem,t)}get Url(){return this.getProperty(p.url)}set Url(t){this.setProperty(p.url,t)}}});var Bs,Gw=D(()=>{"use strict";De();G();Od();Td();dn();Bs=class extends st{constructor(t,r){super(t,r)}getNavBarAreaByAreaName(t){let r=this.navBarAreas.AllNavBarAreaItems.filter(n=>n.AreaId===t);return r.length===0?null:r[0]}get navBarAreas(){return this.getFirstChild(g.formNavBarAreas)}setDefaultNavBarAreas(t,r){let n=[oe.Info,oe.Sales,oe.Service,oe.Marketing,oe.ProcessCenter];if(this.navBarAreas){let i=this.navBarAreas?.AllNavBarAreaItems;if(i&&i.length>0){let a=new Set(i.map(o=>qw.get(o.AreaId)));n=n.filter(o=>!a.has(o))}}else{let i=new fi(g.formNavBarAreas,this);i.isTransient=!0,this.addChild(i)}return n.length>0?(n.forEach(i=>{let a=new pi(g.formNavBarArea,this.navBarAreas);a.setDefaultPropertiesByType(i,t,r),this.navBarAreas.addNavBarArea(a)}),!0):!1}get navBar(){return this.getFirstChild(g.formNavBar)}get id(){return new _(sc,!0)}replaceNavAreaToGivenIndex(t,r){this.navBarAreas?.AllNavBarAreaItems.indexOf(r)!==-1&&(this.deleteFirstGrandChildOfName(g.formNavBarAreas,r),this.addGrandChildAtIndex(g.formNavBarAreas,r,t))}async getNavBarAreasJSON(t){let r=[],n=[];if(this.navBarAreas?.AllNavBarAreaItems){for(let a of this.navBarAreas.AllNavBarAreaItems)n.push(a.toJSON(t));r=await Promise.all(n)}return r}async getNavBarRelationshipItemsJSON(t){let r=[],n=[];if(this.navBar?.AllRelationShipItems){for(let i of this.navBar.AllRelationShipItems)n.push(i.toJSON(t));r=await Promise.all(n)}return r}async toJSON(t){let r=await this.getNavBarAreasJSON(t),n=await this.getNavBarRelationshipItemsJSON(t);return{NavBarAreas:{NavBarAreas:r},NavBarByRelationshipItems:n,NavBarItems:[],NavPaneIsvItems:{NavBarIsvItems:[]},ShowEmptyNavBarAreas:t.formModelService.showHiddenElements}}}});var zw={};Bt(zw,{ControlType:()=>At,DeserializationService:()=>xd,DeserializationServiceScope:()=>Fd,DeserializedFormElementNode:()=>lt});var Rd,lt,Fd,At,xd,Sd=D(()=>{"use strict";Rd=ne(en());De();Ce();We();Bn();lc();Zr();mh();a0();cs();Fw();Ua();Is();Ma();yd();G();G();xw();Le();Rt();Cd();Lw();Mw();Ad();wd();Uw();Dd();Ed();Ba();Os();kw();Od();Td();$w();Vw();Gw();lt=class extends q{constructor(t,r){super(t,r)}insertProperty(t,r){this.addProperty(t,r)}insertChild(t){this.addChild(t)}},Fd="DeserializationService";(function(e){e.Grid="Grid",e.Lookup="Lookup",e.Base="Base"})(At||(At={}));xd=class{lcid;constructor(t){this.lcid=t}deSerializeFormXml(t,r,n,i,a,o,s,l,u,c){if(!t)throw new Error("Formxml could not be parsed.");let d=t.getElementsByTagName("form");if(d.length!==1){let h="";throw d.length===0?h="FormXml has no form node.":h="FormXml has multiple form nodes.",(0,Rd.trackErrorTrace)(Xe,{eventName:Fd,eventData:{error:h}}),new Error(h)}let f=this.createFormModel(d.item(0),r,n,i,a,o,s,l,u,c);return S.IsNullOrUndefined(f.displayCondition)&&s!==Ee.Dialog&&this.appendDefaultDisplayCondition(f),f}upsertFieldCount(t,r){let n=tn.getNecessaryLookUpTable(r),i=1;n.containsKey(t)&&(i+=n.getValue(t)),n.upsert(t,i)}appendDefaultDisplayCondition(t){let r='<DisplayConditions Order="0" FallbackForm="true"><Everyone/></DisplayConditions>';if(!S.IsNullOrUndefined(t)){let n=S.ParseXml(r);n!==null&&this.populateElementChildren(t,n.childNodes)}}createFormModel(t,r,n,i,a,o,s,l,u,c){let d=new Ts(r,n,i,a,o,s,l,u,c);return this.populateElementProperties(d,t.attributes),this.populateElementChildren(d,t.childNodes),s===Ee.Main&&(this.insertHeaderFooterElementProperties(g.formHeader,d,d.header),this.insertHeaderFooterElementProperties(g.formFooter,d,d.footer)),d}insertHeaderFooterElementProperties(t,r,n){if(S.IsNullOrUndefined(n)){let i=t===g.formHeader?new qa(r,!0):new ka(r,!0);lt.prototype.insertProperty.call(i,p.id,"{"+_.NewGuid()+"}"),lt.prototype.insertProperty.call(i,p.Fieldlabelposition,"Top"),lt.prototype.insertProperty.call(i,p.columnName,le.MarginalControlColumns),lt.prototype.insertProperty.call(i,p.LabelWidth,le.LabelWidth),lt.prototype.insertProperty.call(i,p.Fieldlabelalignment,"Left");let a=null,o=new un(a);for(let s=0;s<i.maxColumns;s++){let l=new ot(o);lt.prototype.insertProperty.call(l,p.id,"{"+_.NewGuid()+"}"),l.setDisplayName(P.EmptyString,this.lcid),lt.prototype.insertProperty.call(l,p.showlabel,"false"),o.addCell(l)}i.appendRow(o),t===g.formHeader?r.header=i:r.footer=i}}deSerializeFormXmlNode(t,r){if(t&&t.nodeValue&&(t.nodeType===Node.TEXT_NODE||t.nodeType===Node.CDATA_SECTION_NODE))return new lt(`<${t.nodeValue}`,r);if(t.nodeType===Node.COMMENT_NODE)return;let n=this.createModelNode(t,r);return this.populateElementProperties(n,t.attributes),this.populateElementChildren(n,t.childNodes),n}populateElementProperties(t,r){if(!r){let n="attributes is undefined for element: "+t.getNodeName();throw(0,Rd.trackErrorTrace)(Xe,{eventName:Fd,eventData:{error:n}}),new Error(n)}for(let n=0;n<r.length;n++){let i=r.item(n);i&&(lt.prototype.insertProperty.call(t,i.name,i.value),t.getNodeName()===g.formCell&&i.name===p.auto&&i.value==="true"&&t.setAutoExpandDetailsForTab())}}populateElementChildren(t,r){for(let n=0;n<r.length;n++){let i=r.item(n),a=this.deSerializeFormXmlNode(i,t);a&&lt.prototype.insertChild.call(t,a)}}createModelNode(t,r){switch(t.nodeName){case g.form:throw new Error("Form node shouldn't be created using this method");case g.formTab:return new vr(r);case g.formColumn:return new kr(r);case g.formHeader:return new qa(r,!1);case g.formFooter:return new ka(r,!1);case g.formSection:return new Qt(g.formSection,r);case g.formRow:return new un(r);case g.formCell:return new ot(r);case g.formControl:let n=t.attributes,i=t.childNodes.length>0?t.childNodes[0].childNodes:null,a;for(let s=0;s<n.length;s++){let l=n.item(s);if(l.name===p.indicationOfSubgrid&&l.value==="true"||l.name===p.classid&&(l.value?.toLocaleUpperCase()===`{${A.SubgridControl}}`||l.value?.toLocaleUpperCase()===`{${A.ReferencePanelSubgridControl}}`))a=At.Grid;else if(l.name===p.classid&&l.value?.toLocaleUpperCase()===`{${A.LookupControl}}`)a=At.Lookup;else if(l.name===p.classid&&l.value?.toLocaleUpperCase()===`{${A.CustomControl}}`)for(let u=0;u<i?.length;u++)i[u].nodeName===p.DefaultViewId&&(a=At.Lookup)}return a===At.Grid?new li(r):a===At.Lookup?new ui(r):new Lt(r);case g.formEvent:return new si(r,P.EmptyString);case g.dependency:return this.populateDependencyTable(t),new oi(r,P.EmptyString);case g.Handler:let o=[];return new xs(o,r);case g.formNavigation:return new Bs(t.nodeName,r);case g.formNavBarArea:return new pi(t.nodeName,r);case g.formNavBarAreas:return new fi(t.nodeName,r);case g.formNavBar:return new Ls(r);case g.formNavBarByRelationshipItem:return new Ms(r);case g.formNavBarItem:return new Us(r);case g.formDisplayConditions:return new Fs(r);case g.library:return new ci(r,P.EmptyString,P.EmptyString);case g.controlDescription:return new Qo(r);case g.customControl:return this.populateCustomControlConfigurationId(t),new us(r);default:return new lt(t.nodeName,r)}}populateDependencyTable(t){let r=t.attributes;for(let n=0;n<r.length;n++){let i=r.item(n);i.name===p.id&&this.upsertFieldCount(i.value,Wt.DependencyFieldTable)}}populateCustomControlConfigurationId(t){let r=t.attributes;for(let n=0;n<r.length;n++){let i=r.item(n);if(i.name===p.id){let a=new _(i.value.substr(1,i.value.length-2));for(let o=0;o<t.parentNode.attributes.length;o++){let s=t.parentNode.attributes.item(o);if(s.name===p.ForControl){let l=s.value.substr(1,i.value.length-2);Ie.CustomControlIdMap.upsert(l,a);break}}break}}}}});var Ww={};Bt(Ww,{SerializationService:()=>Ld,SerializationServiceScope:()=>Nk,SerializedFormElementNode:()=>mi});var Nk,mi,Ld,jw=D(()=>{"use strict";We();Le();Rt();Id();Nk="SerializationService",mi=class extends q{fetchNodeName(){return this.getNodeName()}enumerateProperties(){return this.getAllProperties()}enumerateChildren(){return this.getAllChildren()}},Ld=class{langCode;constructor(t){this.langCode=t}serializeFormXmlNode(t){let r=mi.prototype.fetchNodeName.call(t);if(r.charAt(0)===hr.StartTag)return P.EscapeXml(r.substr(1),!1);if(t.isTransient&&!t.isDirty())return P.EmptyString;let n=mi.prototype.enumerateProperties.call(t),i=mi.prototype.enumerateChildren.call(t);if(!(t instanceof cn)){let a=`<${r}`;if(n.length!==0&&(a+=` ${this.getPropertiesString(n)}`),i.length===0)a+=" />";else{let o=P.EmptyString;for(let s of i)o+=this.serializeFormXmlNode(s);a+=`>${o}</${r}>`}return a}return P.EmptyString}getPropertiesString(t){let r=P.EmptyString;return t.forEach((n,i)=>{i!==0&&(r+=" "),r+=`${n.key}="${P.EscapeXml(n.value,!0)}"`}),r}}});var pn=m(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.rebuildRaw=ut.assembleChildren=ut.spliceChildren=ut.mergeAttrs=ut.rawFromNode=ut.emptyBag=void 0;var qr=be(),Hw=1e6,qs=512;function Sk(){return{a:[],c:[]}}ut.emptyBag=Sk;function Jw(e,t=0){if(t>qs)throw new qr.InvalidArgumentError(`Artifact node tree exceeds the maximum depth of ${qs}`);return{n:e.getNodeName(),a:e.getAllProperties().map(r=>[r.key,r.value]),c:e.getAllChildren().map(r=>Jw(r,t+1))}}ut.rawFromNode=Jw;function Dk(e,t){let r=new Map;for(let[a,o]of t)r.set(a,o);let n=new Set,i=[];for(let[a,o]of e)r.has(a)?i.push([a,r.get(a)]):i.push([a,o]),n.add(a);for(let[a,o]of t)n.has(a)||(i.push([a,o]),n.add(a));return i}ut.mergeAttrs=Dk;function ks(e,t){let r=new Set;for(let s of e){let l=s.i;if(!Number.isInteger(l)||l<0||l>Hw)throw new qr.InvalidArgumentError(`Bag child index must be an integer in [0, ${Hw}] (got ${String(l)})`);if(r.has(l))throw new qr.InvalidArgumentError(`Duplicate bag child index ${l}`);r.add(l)}let n=[...e].sort((s,l)=>s.i-l.i),i=[],a=0,o=0;for(let s of n){for(;o<s.i&&a<t.length;)i.push(t[a]),a+=1,o+=1;o<s.i&&(o=s.i),i.push(s.node),o+=1}for(;a<t.length;)i.push(t[a]),a+=1;return i}ut.spliceChildren=ks;function Ek(e,t){if(e.w){let r={n:e.w.n,a:e.w.a.map(n=>[n[0],n[1]]),c:ks(e.w.c,t)};return ks(e.c,[r])}return ks(e.c,t)}ut.assembleChildren=Ek;function Qw(e,t,r,n=0){if(n>qs)throw new qr.InvalidArgumentError(`Artifact node tree exceeds the maximum depth of ${qs}`);Ik(e,n);let i=t.make(e.n,r);for(let[a,o]of e.a)t.setProp(i,a,o);for(let a of e.c)t.addChild(i,Qw(a,t,i,n+1));return i}ut.rebuildRaw=Qw;function Ik(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new qr.InvalidArgumentError(`Malformed hybrid node at depth ${t}: expected a JSON object`);let r=e;if(typeof r.n!="string")throw new qr.InvalidArgumentError(`Malformed hybrid node at depth ${t}: 'n' (tag name) must be a string`);if(!Array.isArray(r.a)||!Array.isArray(r.c))throw new qr.InvalidArgumentError(`Malformed hybrid node '${r.n}': 'a' and 'c' must be arrays`);for(let n of r.a)if(!Array.isArray(n)||n.length!==2||typeof n[0]!="string"||typeof n[1]!="string")throw new qr.InvalidArgumentError(`Malformed hybrid node '${r.n}': each attribute must be a [string, string] pair`)}});var $r=m(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.childObjects=ct.optionalGuidId=ct.optionalEnum=ct.eachObject=ct.issue=ct.isJsonObject=void 0;function Xw(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}ct.isJsonObject=Xw;function Va(e,t,r,n){return n?{pointer:e,rule:t,message:r,fatal:n}:{pointer:e,rule:t,message:r}}ct.issue=Va;function Kw(e,t,r,n){if(!Array.isArray(e))return[];let i=[];return e.forEach((a,o)=>{Xw(a)?i.push({node:a,index:o}):n.push(Va(`${t}/${o}`,`${r}-must-be-object`,`a ${r} must be a JSON object, got ${a===null?"null":typeof a}`))}),i}ct.eachObject=Kw;function _k(e,t,r,n,i,a){let o=e[t];o!==void 0&&(typeof o!="string"||!r.includes(o))&&a.push(Va(`${n}/${t}`,i,`${t} must be one of ${r.map(s=>`'${s}'`).join(", ")}, got ${JSON.stringify(o)}`))}ct.optionalEnum=_k;var Pk=/^(?:\{[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}\}|[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})$/;function Ok(e,t,r,n,i){let a=e[t];typeof a=="string"&&a!==""&&!Pk.test(a)&&i.push(Va(`${r}/${t}`,n,`${t} must be a GUID or empty, got '${a}'`))}ct.optionalGuidId=Ok;function Tk(e,t,r,n,i){let a=e[t],o=`${r}/${t}`;return a===void 0?[]:Array.isArray(a)?Kw(a,o,n,i):(i.push(Va(o,`${n}-list-must-be-array`,`${t} must be an array when present, got ${typeof a}`)),[])}ct.childObjects=Tk});var Yw=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.formApi=void 0;var br=Ve(),Ga=ce(),Rk="formid,formxml,name,type,objecttypecode,formpresentation,formactivationstate,uniquename,description,versionnumber",Fk="formid,name,type,objecttypecode",xk=2;$s.formApi={async get(e,t){let n=`/systemforms(${(0,Ga.normalizeGuid)(t,"id")})${(0,Ga.odataQuery)([["$select",Rk]])}`,i=(0,br.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,br.readEtag)(i)}},async list(e,t){var r;let n=[`type eq ${xk}`];t?.entityLogicalName&&n.push(`objecttypecode eq '${(0,Ga.odataLiteral)(t.entityLogicalName)}'`);let i=`/systemforms${(0,Ga.odataQuery)([["$select",Fk],["$filter",n.join(" and ")]])}`,o=(0,br.ensureSuccess)(await e.get(i),e.apiUrl(i)).body;return((r=o?.value)!==null&&r!==void 0?r:[]).map(l=>{var u,c;return{type:"form",id:(u=l.formid)!==null&&u!==void 0?u:"",name:(c=l.name)!==null&&c!==void 0?c:"",entityLogicalName:l.objecttypecode,isDirty:!1}})},async create(e,t){let r="/systemforms",n=(0,br.ensureSuccess)(await e.post(r,t),e.apiUrl(r));return{id:(0,br.requireCreatedId)(n,"formid","form"),etag:(0,br.readEtag)(n)}},async update(e,t,r,n){let i=(0,Ga.normalizeGuid)(t,"id"),a=`/systemforms(${i})`,o=n?{"If-Match":n}:void 0,s=(0,br.ensureSuccess)(await e.patch(a,r,o?{headers:o}:void 0),e.apiUrl(a));return{id:i,etag:(0,br.readEtag)(s)}},delete(e,t){return(0,br.deleteRecord)(e,"systemforms",t)}}});var fn=m(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.installDomShim=void 0;var Zw=Wu(),eN=!1,Lk={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};function Mk(){if(eN)return;let e=globalThis;typeof e.DOMParser>"u"&&(e.DOMParser=Zw.DOMParser),typeof e.XMLSerializer>"u"&&(e.XMLSerializer=Zw.XMLSerializer),typeof e.Node>"u"&&(e.Node=Lk),eN=!0}Vs.installDomShim=Mk});var mN=m(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.classIdForAttributeType=dt.QUICK_VIEW_CLASS_ID=dt.NOTES_CLASS_ID=dt.SUBGRID_CLASS_ID=dt.formRegistration=dt.FormAdapter=void 0;var wt=(De(),kt(ah)),Uk=(Ce(),kt(oh)),Bk=(Le(),kt(lh)),He=(G(),kt(sh)),_e=(Zr(),kt(uh)),kk=(Sd(),kt(zw)),qk=(jw(),kt(Ww)),Pe=pn(),mn=$r(),$k=Yw(),Vk=Tt(),kd=ce(),aN=fn(),Xt=1033,Gk={[He.FormType.Main]:"Main",[He.FormType.QuickCreate]:"QuickCreate",[He.FormType.QuickViewForm]:"QuickView",[He.FormType.Card]:"Card"},Md={Main:He.FormType.Main,QuickCreate:He.FormType.QuickCreate,QuickView:He.FormType.QuickViewForm,Card:He.FormType.Card},zk=new Map(Object.entries(_e.ControlClassId).map(([e,t])=>[String(t).toUpperCase(),e]));function oN(e){var t;return e&&(t=zk.get(e.toUpperCase()))!==null&&t!==void 0?t:"Unknown"}function za(e){return e.getAllProperties().map(t=>[t.key,t.value])}function hn(e){let t=new Map;for(let r of e.getAllProperties())t.has(r.key)||t.set(r.key,r.value);return t}function sN(e,t){return e.getAllChildren().find(r=>r.getNodeName()===t)}function qd(e){var t,r;let n=sN(e,"labels");if(!n)return"";let i=n.getAllChildren().filter(o=>o.getNodeName()==="label"),a=(t=i.find(o=>hn(o).get("languagecode")===String(Xt)))!==null&&t!==void 0?t:i[0];return a&&(r=hn(a).get("description"))!==null&&r!==void 0?r:""}function Wk(e){let t=sN(e,"parameters"),r={};if(!t)return r;for(let n of t.getAllChildren()){let i=n.getNodeName();if(i.charAt(0)==="<"||i.charAt(0)==="#")continue;let a=n.getAllChildren()[0],o=a?a.getNodeName():"";o.charAt(0)==="<"&&(o=o.substring(1)),r[i]=o}return r}function lN(e){return/^1+$/.test(e)&&e.length>=1&&e.length<=4?e.length:1}function Ud(e){let t=Math.min(Math.max(Math.trunc(e),1),4);return"1".repeat(t)}function gn(e){return e.replace(/[{}]/g,"")}function Bd(e){return`{${gn(e)}}`}function tN(e,t){if(e===void 0||e==="")return t;let r=Number(e);return Number.isNaN(r)?t:r}function zs(e,t,r){let n=e.getAllChildren(),i=n.findIndex(u=>u.getNodeName()===t),a=[];if(n.forEach((u,c)=>{c!==i&&a.push({i:c,node:(0,Pe.rawFromNode)(u)})}),i<0)return{modeled:[],bag:{a:za(e),c:a}};let o=n[i],s=[],l=[];return o.getAllChildren().forEach((u,c)=>{u.getNodeName()===r?s.push(u):l.push({i:c,node:(0,Pe.rawFromNode)(u)})}),{modeled:s,bag:{a:za(e),c:a,w:{n:o.getNodeName(),a:za(o),c:l}}}}function uN(e,t,r){let n=[],i=[];return e.getAllChildren().forEach((a,o)=>{a.getNodeName()===t&&(!r||n.length===0)?n.push(a):i.push({i:o,node:(0,Pe.rawFromNode)(a)})}),{modeled:n,bag:{a:za(e),c:i}}}function jk(e){let{modeled:t,bag:r}=zs(e,"tabs","tab");return{tabs:t.map(Hk),bag:r}}function Hk(e){var t,r;let n=hn(e),{modeled:i,bag:a}=zs(e,"columns","column");return{id:(t=n.get("id"))!==null&&t!==void 0?t:"",name:(r=n.get("name"))!==null&&r!==void 0?r:"",label:qd(e),expanded:n.get("expanded")==="true",visible:n.has("visible")?n.get("visible")==="true":!0,columns:i.map(Jk),bag:a}}function Jk(e){let t=hn(e),{modeled:r,bag:n}=zs(e,"sections","section");return{width:t.get("width"),sections:r.map(Qk),bag:n}}function Qk(e){var t,r,n;let i=hn(e),{modeled:a,bag:o}=zs(e,"rows","row");return{id:(t=i.get("id"))!==null&&t!==void 0?t:"",name:(r=i.get("name"))!==null&&r!==void 0?r:"",label:qd(e),visible:i.has("visible")?i.get("visible")==="true":!0,showLabel:i.get("showlabel")==="true",columns:lN((n=i.get("columns"))!==null&&n!==void 0?n:"1"),rows:a.map(Xk),bag:o}}function Xk(e){let{modeled:t,bag:r}=uN(e,"cell",!1);return{cells:t.map(Kk),bag:r}}function Kk(e){var t;let r=hn(e),{modeled:n,bag:i}=uN(e,"control",!0),a=qd(e),o=r.get("showlabel")==="true",s=n[0]?Yk(n[0],a,o):null;return{id:(t=r.get("id"))!==null&&t!==void 0?t:"",visible:r.has("visible")?r.get("visible")==="true":!0,colspan:tN(r.get("colspan"),1),rowspan:tN(r.get("rowspan"),1),control:s,bag:i}}function Yk(e,t,r){var n,i;let a=hn(e),o=gn((n=a.get("classid"))!==null&&n!==void 0?n:""),s=a.get("datafieldname");return{id:(i=a.get("id"))!==null&&i!==void 0?i:"",classId:o,fieldName:s||null,type:oN(o),isRequired:a.get("isrequired")==="true",isReadOnly:a.get("disabled")==="true",label:t,showLabel:r,parameters:Wk(e),bag:{a:za(e),c:e.getAllChildren().map((l,u)=>({i:u,node:(0,Pe.rawFromNode)(l)}))}}}function hi(e){return e.a.length===0&&e.c.length===0&&!e.w}function cN(e,t){let r=e.a.find(n=>n[0]===t);return r?r[1]:void 0}function vn(e,t){var r;let n=new Set(e.a.map(o=>o[0])),i=hi(e),a=[];for(let o of t)if(n.has(o.key)){let s=(r=cN(e,o.key))!==null&&r!==void 0?r:"";o.matches(s)||a.push([o.key,o.render()])}else i?a.push([o.key,o.render()]):o.matches(o.absentDefault)||a.push([o.key,o.render()]);return(0,Pe.mergeAttrs)(e.a,a)}var Vr=(e,t)=>({key:e,matches:r=>r===t,render:()=>t,absentDefault:""}),Gr=(e,t,r=!1)=>({key:e,matches:n=>n==="true"===t,render:()=>String(t),absentDefault:String(r)}),rN=(e,t,r=1)=>({key:e,matches:n=>Number(n)===t,render:()=>String(t),absentDefault:String(r)});function $d(e){return{n:"labels",a:[],c:[{n:"label",a:[["description",e],["languagecode",String(Xt)]],c:[]}]}}function dN(e){return{n:"parameters",a:[],c:Object.keys(e).map(t=>({n:(0,kd.assertXmlName)(t,"Form control parameter name"),a:[],c:[{n:`<${e[t]}`,a:[],c:[]}]}))}}function Zk(e){var t,r;let n=e.c.find(a=>a.n==="label"&&a.a.some(o=>o[0]==="languagecode"&&o[1]===String(Xt))),i=n??e.c.find(a=>a.n==="label");return(r=(t=i?.a.find(a=>a[0]==="description"))===null||t===void 0?void 0:t[1])!==null&&r!==void 0?r:""}function eq(e,t){let r=!1,n=e.c.map(i=>i.n!=="label"||!i.a.some(o=>o[0]==="languagecode"&&o[1]===String(Xt))?i:(r=!0,{...i,a:i.a.map(o=>o[0]==="description"?["description",t]:o)}));return r||n.push({n:"label",a:[["description",t],["languagecode",String(Xt)]],c:[]}),{...e,c:n}}function Vd(e,t){let r=e.c.findIndex(i=>i.node.n==="labels");if(r<0||Zk(e.c[r].node)===t)return e;let n=eq(e.c[r].node,t);return{...e,c:e.c.map((i,a)=>a===r?{...i,node:n}:i)}}function tq(e){let t={};for(let r of e.c){let n=r.n;if(n.charAt(0)==="<"||n.charAt(0)==="#")continue;let i=r.c[0],a=i?i.n:"";a.charAt(0)==="<"&&(a=a.substring(1)),t[n]=a}return t}function rq(e,t){let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(i=>e[i]===t[i])}function nq(e,t){return e.a.some(r=>r[0]===t)?{...e,a:e.a.filter(r=>r[0]!==t)}:e}function iq(e,t){let r=e.c.findIndex(i=>i.node.n==="parameters");if(r<0||rq(tq(e.c[r].node),t))return e;let n=dN(t);return{...e,c:e.c.map((i,a)=>a===r?{...i,node:n}:i)}}function Ws(e,t,r,n){if(e.w){let o={n:e.w.n,a:e.w.a.map(s=>[s[0],s[1]]),c:(0,Pe.spliceChildren)(e.w.c,r)};return(0,Pe.spliceChildren)(e.c,[o])}let i=n(),a={n:t,a:[],c:r};return e.c.length===0?[...i,a]:(0,Pe.spliceChildren)(e.c,[...i,a])}function aq(e){let t=e.tabs.map(oq);return{n:"form",a:vn(e.bag,[]),c:e.tabs.length===0&&hi(e.bag)?[]:Ws(e.bag,"tabs",t,()=>[])}}function oq(e){let t=[Vr("id",e.id),Vr("name",e.name),Gr("expanded",e.expanded),Gr("visible",e.visible,!0)],r=e.columns.map(sq),n=Vd(e.bag,e.label);return{n:"tab",a:vn(n,t),c:Ws(n,"columns",r,()=>e.label?[$d(e.label)]:[])}}function sq(e){let t=e.width!==void 0?[Vr("width",e.width)]:[],r=e.sections.map(lq);return{n:"column",a:vn(e.bag,t),c:Ws(e.bag,"sections",r,()=>[])}}function lq(e){let t=[Vr("id",e.id),Vr("name",e.name),Gr("showlabel",e.showLabel),Gr("visible",e.visible,!0),{key:"columns",matches:i=>lN(i)===e.columns,render:()=>Ud(e.columns),absentDefault:Ud(1)}],r=e.rows.map(uq),n=Vd(e.bag,e.label);return{n:"section",a:vn(n,t),c:Ws(n,"rows",r,()=>e.label?[$d(e.label)]:[])}}function uq(e){let t=e.cells.map(cq);return{n:"row",a:vn(e.bag,[]),c:hi(e.bag)?t:(0,Pe.assembleChildren)(e.bag,t)}}function cq(e){let t=e.control?e.control.showLabel:cN(e.bag,"showlabel")==="true",r=[Vr("id",e.id),Gr("showlabel",t),Gr("visible",e.visible,!0),rN("colspan",e.colspan),rN("rowspan",e.rowspan)],n=e.control?[dq(e.control)]:[],i;if(hi(e.bag))i=[...e.control&&e.control.label?[$d(e.control.label)]:[],...n];else{let a=e.control?Vd(e.bag,e.control.label):e.bag;i=(0,Pe.assembleChildren)(a,n)}return{n:"cell",a:vn(e.bag,r),c:i}}function dq(e){let t=[Vr("id",e.id),{key:"classid",matches:i=>gn(i)===e.classId,render:()=>Bd(e.classId),absentDefault:""}];e.fieldName!==null&&t.push(Vr("datafieldname",e.fieldName)),t.push(Gr("disabled",e.isReadOnly)),t.push(Gr("isrequired",e.isRequired));let r=e.fieldName===null?nq(e.bag,"datafieldname"):e.bag,n;return hi(r)?n=Object.keys(e.parameters).length>0?[dN(e.parameters)]:[]:n=(0,Pe.assembleChildren)(iq(r,e.parameters),[]),{n:"control",a:vn(r,t),c:n}}var pq={make:(e,t)=>new Bk.FormElementNode(e,t),setProp:(e,t,r)=>e.setProperty(t,r),addChild:(e,t)=>e.addChild(t)};function nN(e,t){(0,aN.installDomShim)();let r=mq(e,t),n=(0,Pe.rebuildRaw)(aq(r),pq,null);return new qk.SerializationService(Xt).serializeFormXmlNode(n)}function fq(e){return JSON.parse(JSON.stringify(e))}function mq(e,t){var r;let n=fq(e);n.bag||(n.bag=(0,Pe.emptyBag)()),wq(n.bag),t&&hq(n,t);for(let i of(r=n.tabs)!==null&&r!==void 0?r:[])gq(i);return n}function hq(e,t){var r;let n=(r=e.entityLogicalName)!==null&&r!==void 0?r:"";pN(e,i=>{let a=i.fieldName,o=i;if(!a||o.label!==void 0&&o.classId!==void 0)return;let s=t.resolveField(n,a);s&&(o.label===void 0&&s.displayName&&(o.label=s.displayName),o.classId===void 0&&s.attributeType&&(o.classId=fN(s.attributeType)))})}function pN(e,t){var r,n,i,a,o;for(let s of(r=e.tabs)!==null&&r!==void 0?r:[])for(let l of(n=s.columns)!==null&&n!==void 0?n:[])for(let u of(i=l.sections)!==null&&i!==void 0?i:[])for(let c of(a=u.rows)!==null&&a!==void 0?a:[])for(let d of(o=c.cells)!==null&&o!==void 0?o:[])d.control&&t(d.control)}function gq(e){e.id||(e.id=wt.Guid.NewGuid()),e.name===void 0&&(e.name=""),e.label===void 0&&(e.label=""),e.expanded===void 0&&(e.expanded=!0),e.visible===void 0&&(e.visible=!0),e.columns||(e.columns=[]);for(let t of e.columns)vq(t);e.bag||(e.bag=(0,Pe.emptyBag)())}function vq(e){e.sections||(e.sections=[]);for(let t of e.sections)bq(t);e.bag||(e.bag=(0,Pe.emptyBag)()),e.width===void 0&&hi(e.bag)&&(e.width="100%")}function bq(e){e.id||(e.id=wt.Guid.NewGuid()),e.name===void 0&&(e.name=""),e.label===void 0&&(e.label=""),e.showLabel===void 0&&(e.showLabel=!1),e.visible===void 0&&(e.visible=!0),e.columns===void 0&&(e.columns=1),e.rows||(e.rows=[]);for(let t of e.rows)yq(t);e.bag||(e.bag=(0,Pe.emptyBag)())}function yq(e){e.cells||(e.cells=[]);for(let t of e.cells)Cq(t);e.bag||(e.bag=(0,Pe.emptyBag)())}function Cq(e){e.id||(e.id=wt.Guid.NewGuid()),e.visible===void 0&&(e.visible=!0),e.colspan===void 0&&(e.colspan=1),e.rowspan===void 0&&(e.rowspan=1),e.control===void 0&&(e.control=null),e.control&&Aq(e.control),e.bag||(e.bag=(0,Pe.emptyBag)())}function Aq(e){var t;e.id||(e.id=wt.Guid.NewGuid()),e.classId===void 0&&(e.classId=String(_e.ControlClassId.TextboxControl)),e.fieldName===void 0&&(e.fieldName=null),e.type===void 0&&(e.type=e.fieldName?"Field":oN(String(e.classId))),e.isRequired===void 0&&(e.isRequired=!1),e.isReadOnly===void 0&&(e.isReadOnly=!1),e.label===void 0&&(e.label=(t=e.fieldName)!==null&&t!==void 0?t:""),e.showLabel===void 0&&(e.showLabel=!0),(e.parameters===void 0||e.parameters===null)&&(e.parameters={});for(let r of Object.keys(e.parameters))(0,kd.assertXmlName)(r,"Form control parameter name");e.bag||(e.bag=(0,Pe.emptyBag)())}function wq(e){for(let t of e.c){let r=t.node;if(r.n==="events"){for(let n of r.c)if(n.n==="event"){for(let i of n.c)if(i.n==="Handlers")for(let a of i.c)a.n==="Handler"&&!iN(a,"handlerUniqueId")&&a.a.push(["handlerUniqueId",Bd(wt.Guid.NewGuid())])}}else if(r.n==="formLibraries")for(let n of r.c)n.n==="Library"&&!iN(n,"libraryUniqueId")&&n.a.push(["libraryUniqueId",Bd(wt.Guid.NewGuid())])}}var Gs=class{toArtifact(t){var r,n,i;let{tabs:a,bag:o}=jk(t);return{id:t.formId?t.formId.guidString:"",name:(r=t.formName)!==null&&r!==void 0?r:"",entityLogicalName:(n=t.entityName)!==null&&n!==void 0?n:"",formType:(i=Gk[t.formType])!==null&&i!==void 0?i:"Main",status:this.readActivationStatus(t),tabs:a,bag:o}}fromArtifact(t){return this.deserialize({formxml:nN(t),formid:t.id||wt.Guid.NewGuid(),objecttypecode:t.entityLogicalName,type:Md[t.formType],name:t.name,uniquename:t.name,description:"",formpresentation:He.FormPresentation.AirForm,formactivationstate:t.status==="Active"?He.FormActivationState.Active:He.FormActivationState.InActive})}fromApiResponse(t){var r,n,i,a,o,s;let l=t,u=this.deserialize({formxml:(r=l.formxml)!==null&&r!==void 0?r:"",formid:(n=l.formid)!==null&&n!==void 0?n:wt.Guid.NewGuid(),objecttypecode:(i=l.objecttypecode)!==null&&i!==void 0?i:"",type:l.type,name:(a=l.name)!==null&&a!==void 0?a:"",uniquename:(o=l.uniquename)!==null&&o!==void 0?o:"",description:(s=l.description)!==null&&s!==void 0?s:"",formpresentation:l.formpresentation,formactivationstate:l.formactivationstate});return this.toArtifact(u)}toApiPayload(t,r,n){return{formxml:nN(t,n),name:t.name,type:Md[t.formType],objecttypecode:t.entityLogicalName}}metadataNeeds(t){let r=t.entityLogicalName;if(!r)return[];let n=new Set,i=[];return pN(t,a=>{let o=a.fieldName,s=a;!o||s.label!==void 0&&s.classId!==void 0||n.has(o)||(n.add(o),i.push({entityLogicalName:r,fieldName:o}))}),i}createDefault(t){var r,n,i,a,o,s,l,u,c,d;let f=t.tabs&&t.tabs.length>0?void 0:Tq,h=f!==void 0?f:t.tabs.map(N=>Nq(N)).join(""),b=this.deserialize({formxml:`<form><tabs>${h}</tabs></form>`,formid:t.id||wt.Guid.NewGuid(),objecttypecode:(r=t.entityLogicalName)!==null&&r!==void 0?r:"",type:Md[(n=t.formType)!==null&&n!==void 0?n:"Main"],name:(i=t.name)!==null&&i!==void 0?i:"New Form",uniquename:(a=t.name)!==null&&a!==void 0?a:"New Form",description:"",formpresentation:He.FormPresentation.AirForm,formactivationstate:((o=t.status)!==null&&o!==void 0?o:"Active")==="Active"?He.FormActivationState.Active:He.FormActivationState.InActive}),w=this.toArtifact(b);return{id:(s=t.id)!==null&&s!==void 0?s:w.id,name:(l=t.name)!==null&&l!==void 0?l:"New Form",entityLogicalName:(u=t.entityLogicalName)!==null&&u!==void 0?u:"",formType:(c=t.formType)!==null&&c!==void 0?c:"Main",status:(d=t.status)!==null&&d!==void 0?d:"Active",tabs:w.tabs,bag:w.bag}}assignMissingIds(t){return(0,Vk.assignMissingIds)(t)}validate(t){return Fq(t)}deserialize(t){(0,aN.installDomShim)();let r=Uk.ScriptUtilities.ParseXml(t.formxml),n=new kk.DeserializationService(Xt).deSerializeFormXml(r,new wt.Guid(t.formid),t.objecttypecode,He.FormState.Draft,t.name,t.uniquename,t.type,t.formpresentation,t.description,t.formactivationstate);if(!n)throw new Error("FormXml could not be deserialized into a Form model.");return n}readActivationStatus(t){return t.formactivationstate===He.FormActivationState.InActive?"Inactive":"Active"}};dt.FormAdapter=Gs;function Mt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Gd(e){return e?`<labels><label description="${Mt(e)}" languagecode="${Xt}" /></labels>`:""}function Nq(e){let t=(e.columns.length>0?e.columns:[Oq()]).map(r=>Sq(r)).join("");return`<tab id="{${Mt(gn(e.id))}}" name="${Mt(e.name)}" expanded="${e.expanded}" visible="${e.visible}">${Gd(e.label)}<columns>${t}</columns></tab>`}function Sq(e){var t;let r=e.sections.map(n=>Dq(n)).join("");return`<column width="${Mt((t=e.width)!==null&&t!==void 0?t:"100%")}"><sections>${r}</sections></column>`}function Dq(e){let t=e.rows.map(r=>Eq(r)).join("");return`<section id="{${Mt(gn(e.id))}}" name="${Mt(e.name)}" showlabel="${e.showLabel}" visible="${e.visible}" columns="${Ud(e.columns)}">${Gd(e.label)}<rows>${t}</rows></section>`}function Eq(e){return`<row>${e.cells.map(t=>Iq(t)).join("")}</row>`}function Iq(e){let t=e.control,r=t?Gd(t.label):"",n=t?_q(t):"";return`<cell id="{${Mt(gn(e.id))}}" showlabel="${t?t.showLabel:!1}" visible="${e.visible}" colspan="${e.colspan}" rowspan="${e.rowspan}">${r}${n}</cell>`}function _q(e){let t=e.fieldName?` datafieldname="${Mt(e.fieldName)}"`:"",r=Pq(e.parameters);return`<control id="${Mt(e.id)}" classid="{${Mt(gn(e.classId))}}"${t} disabled="${e.isReadOnly}" isrequired="${e.isRequired}">${r}</control>`}function Pq(e){let t=Object.keys(e);return t.length===0?"":(t.forEach(n=>(0,kd.assertXmlName)(n,"Form control parameter name")),`<parameters>${t.map(n=>`<${n}>${Mt(e[n])}</${n}>`).join("")}</parameters>`)}function Oq(){return{width:"100%",sections:[],bag:{a:[],c:[]}}}var Tq=`<tab id="{${wt.Guid.NewGuid()}}" name="tab_general" expanded="true" visible="true"><labels><label description="General" languagecode="${Xt}" /></labels><columns><column width="100%"><sections><section id="{${wt.Guid.NewGuid()}}" name="section_general" showlabel="false" visible="true" columns="1"><labels><label description="General" languagecode="${Xt}" /></labels><rows></rows></section></sections></column></columns></tab>`;function Rq(){return{adapter:new Gs,api:$k.formApi}}dt.formRegistration=Rq;function Fq(e){let t=[];return(0,mn.childObjects)(e,"tabs","","tab",t).forEach(({node:n,index:i})=>{(0,mn.childObjects)(n,"columns",`/tabs/${i}`,"column",t).forEach(({node:o,index:s})=>{let l=`/tabs/${i}/columns/${s}`;(0,mn.childObjects)(o,"sections",l,"section",t).forEach(({node:c,index:d})=>{let f=`${l}/sections/${d}`;(0,mn.childObjects)(c,"rows",f,"row",t).forEach(({node:b,index:w})=>{let N=`${f}/rows/${w}`;(0,mn.childObjects)(b,"cells",N,"cell",t).forEach(({node:R,index:F})=>{let M=R.control;M!=null&&!(0,mn.isJsonObject)(M)&&t.push((0,mn.issue)(`${N}/cells/${F}/control`,"control-must-be-object-or-null",`a cell control must be a JSON object or null, got ${typeof M}`))})})})})}),t}dt.SUBGRID_CLASS_ID=_e.ControlClassId.SubgridControl;dt.NOTES_CLASS_ID=_e.ControlClassId.TimelineControl;dt.QUICK_VIEW_CLASS_ID=_e.ControlClassId.QuickViewControl;var xq={Lookup:String(_e.ControlClassId.LookupControl),Customer:String(_e.ControlClassId.LookupControl),Owner:String(_e.ControlClassId.LookupControl),PartyList:String(_e.ControlClassId.PartyListControl),Boolean:String(_e.ControlClassId.BooleanControl),DateTime:String(_e.ControlClassId.DateTimeControl),Decimal:String(_e.ControlClassId.DecimalControl),Double:String(_e.ControlClassId.FloatingNumberControl),Money:String(_e.ControlClassId.CurrencyControl),Integer:String(_e.ControlClassId.IntegerControl),BigInt:String(_e.ControlClassId.IntegerControl),Memo:String(_e.ControlClassId.TextAreaControl),String:String(_e.ControlClassId.TextboxControl)},Lq="3EF39988-22BB-4F0B-BBBE-64B5A3748AEE";function fN(e){return e==="Picklist"||e==="State"||e==="Status"?Lq:e&&xq[e]||String(_e.ControlClassId.TextboxControl)}dt.classIdForAttributeType=fN;function iN(e,t){let r=e.a.find(n=>n[0]===t);return r?r[1]:void 0}});var ja=m(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.projectElementBag=ve.serializeNode=ve.domEngine=ve.nodeLikeFromDom=ve.parseXmlRoot=ve.EMPTY_FORM_SENTINEL=ve.TEXT_SENTINEL=void 0;var Mq=pn(),Wa=be();ve.TEXT_SENTINEL="#text";ve.EMPTY_FORM_SENTINEL="#empty";var Hs=new WeakSet;function Uq(e,t){let r=e&&e.trim()!==""?e:t,i=new DOMParser().parseFromString(r,"text/xml").documentElement;if(!i)throw new Wa.InvalidArgumentError("XML source has no root element (empty or malformed input)");return kq(i),qq(i),Gq(i,r),i}ve.parseXmlRoot=Uq;var Bq=new Set([1,3]);function kq(e){let t=[e];for(;t.length>0;){let n=t.pop().childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];if(!Bq.has(a.nodeType))throw new Wa.InvalidArgumentError(`Unsupported XML node type ${a.nodeType} (CDATA / comment / processing-instruction) is outside the hybrid projection's lossless grammar and cannot be round-tripped`);t.push(a)}}}function qq(e){var t,r;let n=(t=e.ownerDocument)!==null&&t!==void 0?t:e.parentNode;if(!n)return;let i=n.childNodes;for(let a=0;a<i.length;a+=1){let o=i[a];if(o!==e&&!(o.nodeType===3&&((r=o.nodeValue)!==null&&r!==void 0?r:"").trim()===""))throw new Wa.InvalidArgumentError(`Unsupported document-level XML node (type ${o.nodeType}: declaration / comment / processing-instruction outside the root element) cannot be round-tripped`)}}function $q(e){let t=[],r=/<([^>]*)>/g;for(let n=r.exec(e);n!==null;n=r.exec(e)){let i=n[1];i.startsWith("/")||i.startsWith("?")||i.startsWith("!")||t.push(i.endsWith("/"))}return t}function Vq(e){let t=[],r=[e];for(;r.length>0;){let n=r.pop();t.push(n);let i=n.childNodes;for(let a=i.length-1;a>=0;a-=1){let o=i[a];o.nodeType===1&&r.push(o)}}return t}function gN(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r].nodeType;if(n===1||n===3)return!0}return!1}function Gq(e,t){let r=$q(t),n=Vq(e),i=Math.min(r.length,n.length);for(let a=0;a<i;a+=1){if(r[a])continue;let o=n[a];gN(o)||Hs.add(o)}}function zd(e){let t=e.nodeType===3;return{getNodeName:()=>t?ve.TEXT_SENTINEL:e.tagName,getAllProperties:()=>{var r;if(t)return[{key:ve.TEXT_SENTINEL,value:(r=e.nodeValue)!==null&&r!==void 0?r:""}];let n=e.attributes,i=[];for(let a=0;a<n.length;a+=1)i.push({key:n[a].name,value:n[a].value});return Hs.has(e)&&!gN(e)&&i.push({key:ve.EMPTY_FORM_SENTINEL,value:"1"}),i},getAllChildren:()=>{if(t)return[];let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];(a.nodeType===1||a.nodeType===3)&&r.push(zd(a))}return r}}}ve.nodeLikeFromDom=zd;function zq(e){return{make:t=>t===ve.TEXT_SENTINEL?e.createTextNode(""):e.createElement(t),setProp:(t,r,n)=>{t.nodeType===3?t.nodeValue=n:r===ve.EMPTY_FORM_SENTINEL?Hs.add(t):t.setAttribute(r,n)},addChild:(t,r)=>{t.appendChild(r)}}}ve.domEngine=zq;function vN(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r<=31&&r!==9&&r!==10&&r!==13||r===65534||r===65535)throw js(r);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))throw js(r);t+=1;continue}if(r>=56320&&r<=57343)throw js(r)}}function js(e){let t=e.toString(16).toUpperCase().padStart(4,"0");return new Wa.InvalidArgumentError(`Value contains U+${t}, a character not permitted in XML 1.0 (control char / lone surrogate / non-character); it cannot be serialized losslessly`)}function Wq(e){return vN(e),String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\r/g,"&#xD;").replace(/\n/g,"&#xA;").replace(/\t/g,"&#x9;")}function jq(e){return vN(e),String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Hq(e){return bN(e,0)}ve.serializeNode=Hq;var hN=512;function bN(e,t){var r;if(t>hN)throw new Wa.InvalidArgumentError(`XML nesting exceeds the maximum supported depth of ${hN}`);if(e.nodeType===3)return jq((r=e.nodeValue)!==null&&r!==void 0?r:"");let n=e,i="<"+n.tagName,a=n.attributes;for(let l=0;l<a.length;l+=1)i+=" "+a[l].name+'="'+Wq(a[l].value)+'"';let o=[],s=n.childNodes;for(let l=0;l<s.length;l+=1){let u=s[l];(u.nodeType===1||u.nodeType===3)&&o.push(u)}if(o.length===0)return Hs.has(n)?i+"></"+n.tagName+">":i+" />";i+=">";for(let l of o)i+=bN(l,t+1);return i+"</"+n.tagName+">"}function Jq(e){let t=zd(e);return{a:t.getAllProperties().map(r=>[r.key,r.value]),c:t.getAllChildren().map((r,n)=>({i:n,node:(0,Mq.rawFromNode)(r)}))}}ve.projectElementBag=Jq});var Wd=m(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.viewApi=gi.findDefaultViews=void 0;var Kt=Ve(),yr=ce(),Qq="savedqueryid,name,description,fetchxml,layoutxml,querytype,returnedtypecode,isdefault",Xq="savedqueryid,name,returnedtypecode,querytype,isdefault";async function Kq(e,t,r={}){var n,i,a;let o=new Set(((n=r.excludeViewIds)!==null&&n!==void 0?n:[]).filter(Boolean)),s=`returnedtypecode eq '${(0,yr.odataLiteral)(t)}' and querytype eq 0`,l=`/savedqueries${(0,yr.odataQuery)([["$select","savedqueryid,name,isdefault"],["$filter",s],["$top",50]])}`;return((a=(i=(0,Kt.ensureSuccess)(await e.get(l),e.apiUrl(l)).body)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:[]).filter(d=>{var f;return d.savedqueryid&&!o.has(d.savedqueryid)&&(d.isdefault||/^(Active|Inactive)\b/i.test((f=d.name)!==null&&f!==void 0?f:""))}).map(d=>{var f;return{id:String(d.savedqueryid),name:String((f=d.name)!==null&&f!==void 0?f:"")}})}gi.findDefaultViews=Kq;async function Yq(e,t){var r;let n=`/EntityDefinitions(LogicalName='${(0,yr.odataLiteral)(t)}')${(0,yr.odataQuery)([["$select","ObjectTypeCode"]])}`,i=await e.get(n);if(i.status>=200&&i.status<300){let a=(r=i.body)===null||r===void 0?void 0:r.ObjectTypeCode;return typeof a=="number"?a:void 0}}async function yN(e,t,r){if(!r||!/<grid\b/.test(t)||/<grid[^>]*\bobject=/.test(t))return t;let n=await Yq(e,r);return n===void 0?t:t.replace(/<grid\b/,`<grid object="${n}"`)}gi.viewApi={async get(e,t){let n=`/savedqueries(${(0,yr.normalizeGuid)(t,"id")})${(0,yr.odataQuery)([["$select",Qq]])}`,i=(0,Kt.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,Kt.readEtag)(i)}},async list(e,t){var r;let n=`/savedqueries${(0,yr.odataQuery)([["$select",Xq],["$filter",t?.entityLogicalName?`returnedtypecode eq '${(0,yr.odataLiteral)(t.entityLogicalName)}'`:void 0]])}`,a=(0,Kt.ensureSuccess)(await e.get(n),e.apiUrl(n)).body;return((r=a?.value)!==null&&r!==void 0?r:[]).map(s=>{var l,u;return{type:"view",id:(l=s.savedqueryid)!==null&&l!==void 0?l:"",name:(u=s.name)!==null&&u!==void 0?u:"",entityLogicalName:s.returnedtypecode,isDirty:!1}})},async create(e,t){let r=t,n="/savedqueries",i=await yN(e,r.layoutxml,r.returnedtypecode),a=(0,Kt.ensureSuccess)(await e.post(n,{name:r.name,description:r.description,fetchxml:r.fetchxml,layoutxml:i,returnedtypecode:r.returnedtypecode,querytype:r.querytype,isdefault:r.isdefault}),e.apiUrl(n));return{id:(0,Kt.requireCreatedId)(a,"savedqueryid","view"),etag:(0,Kt.readEtag)(a)}},async update(e,t,r,n){let i=r,a=(0,yr.normalizeGuid)(t,"id"),o=`/savedqueries(${a})`,s=n?{"If-Match":n}:void 0,l=await yN(e,i.layoutxml,i.returnedtypecode),u=(0,Kt.ensureSuccess)(await e.patch(o,{name:i.name,description:i.description,fetchxml:i.fetchxml,layoutxml:l},s?{headers:s}:void 0),e.apiUrl(o));return{id:a,etag:(0,Kt.readEtag)(u)}},delete(e,t){return(0,Kt.deleteRecord)(e,"savedqueries",t)}}});var TN=m(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.viewRegistration=bi.ViewAdapter=void 0;var vi=$r(),jd=pn(),bn=ja(),Zq=Wd(),Hd=fn(),e3=Tt(),NN=100,Js=class{toArtifact(t){var r,n,i,a,o,s,l,u;(0,Hd.installDomShim)();let c=(r=t.fetchxml)!==null&&r!==void 0?r:"",d=(n=t.layoutxml)!==null&&n!==void 0?n:"",f=(0,bn.parseXmlRoot)(c,"<fetch/>"),h=(0,bn.parseXmlRoot)(d,"<grid/>");return{id:(i=t.savedqueryid)!==null&&i!==void 0?i:"",name:(a=t.name)!==null&&a!==void 0?a:"",description:(o=t.description)!==null&&o!==void 0?o:"",entityLogicalName:(s=t.returnedtypecode)!==null&&s!==void 0?s:t3(f),queryType:(l=t.querytype)!==null&&l!==void 0?l:0,isDefault:(u=t.isdefault)!==null&&u!==void 0?u:!1,columns:DN(h,f),filters:_N(f),sort:IN(f),fetchBag:c?(0,bn.projectElementBag)(f):void 0,layoutBag:d?(0,bn.projectElementBag)(h):void 0}}fromArtifact(t){(0,Hd.installDomShim)();let{fetchxml:r,layoutxml:n}=CN(t);return{savedqueryid:t.id,name:t.name,description:t.description,returnedtypecode:t.entityLogicalName,querytype:t.queryType,isdefault:t.isDefault,fetchxml:r,layoutxml:n}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t){var r,n,i,a,o;(0,Hd.installDomShim)();let{fetchxml:s,layoutxml:l}=CN(t);return{name:(r=t.name)!==null&&r!==void 0?r:"",description:(n=t.description)!==null&&n!==void 0?n:"",fetchxml:s,layoutxml:l,returnedtypecode:(i=t.entityLogicalName)!==null&&i!==void 0?i:"",querytype:(a=t.queryType)!==null&&a!==void 0?a:0,isdefault:(o=t.isDefault)!==null&&o!==void 0?o:!1}}createDefault(t){var r,n,i,a,o,s,l,u;let c=(r=t.entityLogicalName)!==null&&r!==void 0?r:"";return{id:(n=t.id)!==null&&n!==void 0?n:(0,e3.newId)(),name:(i=t.name)!==null&&i!==void 0?i:"New View",description:(a=t.description)!==null&&a!==void 0?a:"",entityLogicalName:c,queryType:(o=t.queryType)!==null&&o!==void 0?o:0,isDefault:(s=t.isDefault)!==null&&s!==void 0?s:!1,columns:t.columns&&t.columns.length>0?t.columns:[{name:`${c}id`,width:300,order:0}],filters:(l=t.filters)!==null&&l!==void 0?l:{type:"and",conditions:[],groups:[]},sort:(u=t.sort)!==null&&u!==void 0?u:[]}}assignMissingIds(t){return t}validate(t){let r=[],n=t;(0,vi.childObjects)(n,"columns","","column",r),(0,vi.childObjects)(n,"sort","","sort",r);let i=n.filters;return i!=null&&((0,vi.isJsonObject)(i)?SN(i,"/filters",r):r.push((0,vi.issue)("/filters","filters-must-be-object",`filters must be a JSON object, got ${typeof i}`))),r}};bi.ViewAdapter=Js;function SN(e,t,r){(0,vi.childObjects)(e,"conditions",t,"condition",r),(0,vi.childObjects)(e,"groups",t,"filterGroup",r).forEach(({node:i,index:a})=>SN(i,`${t}/groups/${a}`,r))}function t3(e){var t;let r=e.getElementsByTagName("entity")[0];return(t=r?.getAttribute("name"))!==null&&t!==void 0?t:""}function DN(e,t){var r;let n=EN(t),i=e.getElementsByTagName("cell"),a=[],o=0;for(let s=0;s<i.length;s+=1){let l=i[s];if(l.getAttribute("ishidden")==="1")continue;let u=l.getAttribute("name");if(!u)continue;let c=parseInt((r=l.getAttribute("width"))!==null&&r!==void 0?r:"",10),d={name:u,width:Number.isNaN(c)?NN:c,order:o},f=n.get(u);f&&(d.relatedEntity=f),o+=1,a.push(d)}return a}function EN(e){var t;let r=new Map,n=e.getElementsByTagName("link-entity");for(let i=0;i<n.length;i+=1){let a=n[i],o=a.getAttribute("name");if(!o)continue;let s=a.getElementsByTagName("attribute");for(let l=0;l<s.length;l+=1){let u=s[l],c=(t=u.getAttribute("alias"))!==null&&t!==void 0?t:u.getAttribute("name");c&&r.set(c,o)}}return r}function IN(e){var t;let r=e.getElementsByTagName("entity")[0];if(!r)return[];let n=[],i=r.childNodes;for(let a=0;a<i.length;a+=1){let o=i[a];if(o.nodeType===1&&o.tagName==="order"){let s=o.getAttribute("attribute");s&&n.push({attribute:s,descending:((t=o.getAttribute("descending"))!==null&&t!==void 0?t:"").toLowerCase()==="true"})}}return n}function _N(e){let t=e.getElementsByTagName("entity")[0],r={type:"and",conditions:[],groups:[]};if(!t)return r;let n=Nt(t,"filter").filter(i=>!PN(i)).map(ON);return n.length===0?r:n.length===1?n[0]:{type:"and",conditions:[],groups:n}}function PN(e){if(Nt(e,"filter").length>0)return!1;let t=Nt(e,"condition");return t.length===0?!1:t.some(r=>r.getAttribute("isquickfindfields")==="1"||Nt(r,"value").length>0)}function ON(e){var t,r;let n=((t=e.getAttribute("type"))!==null&&t!==void 0?t:"and").toLowerCase()==="or"?"or":"and",i=[],a=[],o=e.childNodes;for(let s=0;s<o.length;s+=1){let l=o[s];if(l.nodeType===1)if(l.tagName==="condition"){if(l.getAttribute("isquickfindfields")==="1")continue;let u=l.getAttribute("attribute");if(!u)continue;let c={attribute:u,operator:(r=l.getAttribute("operator"))!==null&&r!==void 0?r:""},d=l.getAttribute("value");d!==null&&(c.value=d),i.push(c)}else l.tagName==="filter"&&a.push(ON(l))}return{type:n,conditions:i,groups:a}}function Nt(e,t){let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];a.nodeType===1&&a.tagName===t&&r.push(a)}return r}function CN(e){let t=r3(e.columns);if(!AN(e.fetchBag)||!AN(e.layoutBag))return{fetchxml:p3({...e,columns:t}),layoutxml:f3({...e,columns:t},`${e.entityLogicalName}id`)};let r=new DOMParser().parseFromString("<root/>","text/xml"),n=wN(e.fetchBag,"fetch",r),i=wN(e.layoutBag,"grid",r),a=DN(i,n),o=!Jd(t,a),s=!Jd(e.sort,IN(n)),l=!Jd(e.filters,_N(n));return o&&(n3(r,n,t,a),s3(r,i,t)),s&&c3(r,n,e.sort),l&&d3(r,n,e.filters),{fetchxml:(0,bn.serializeNode)(n),layoutxml:(0,bn.serializeNode)(i)}}function r3(e){return(e??[]).map((t,r)=>{var n,i;return{name:String(t.name).toLowerCase(),width:(n=t.width)!==null&&n!==void 0?n:NN,order:(i=t.order)!==null&&i!==void 0?i:r,...t.relatedEntity?{relatedEntity:t.relatedEntity}:{}}})}function AN(e){return!!e&&(e.c.length>0||e.a.length>0)}function wN(e,t,r){let n={n:t,a:(0,jd.mergeAttrs)(e.a,[]),c:(0,jd.spliceChildren)(e.c,[])};return(0,jd.rebuildRaw)(n,(0,bn.domEngine)(r),null)}function n3(e,t,r,n){var i;let a=t.getElementsByTagName("entity")[0];if(!a)return;let o=new Set(r.map(u=>{var c;return`${(c=u.relatedEntity)!==null&&c!==void 0?c:""}:${u.name}`}));for(let u of n)o.has(`${(i=u.relatedEntity)!==null&&i!==void 0?i:""}:${u.name}`)||i3(a,u);let s=EN(t),l=new Set(Nt(a,"attribute").map(u=>u.getAttribute("name")).filter(u=>!!u));for(let u of[...r].sort((c,d)=>c.order-d.order))if(u.relatedEntity){if(s.get(u.name)===u.relatedEntity)continue;let c=a3(e,a,u.relatedEntity),d=e.createElement("attribute");d.setAttribute("name",u.name),c.appendChild(d),s.set(u.name,u.relatedEntity)}else{if(l.has(u.name))continue;let c=e.createElement("attribute");c.setAttribute("name",u.name),o3(a,c),l.add(u.name)}}function i3(e,t){var r;if(t.relatedEntity){for(let n of Nt(e,"link-entity"))if(n.getAttribute("name")===t.relatedEntity){for(let i of Nt(n,"attribute"))if(((r=i.getAttribute("alias"))!==null&&r!==void 0?r:i.getAttribute("name"))===t.name){n.removeChild(i);return}}return}for(let n of Nt(e,"attribute"))if(n.getAttribute("name")===t.name){e.removeChild(n);return}}function a3(e,t,r){for(let i of Nt(t,"link-entity"))if(i.getAttribute("name")===r)return i;let n=e.createElement("link-entity");return n.setAttribute("name",r),t.appendChild(n),n}function o3(e,t){let r=e.childNodes;for(let n=0;n<r.length;n+=1){let i=r[n];if(i.nodeType===1&&i.tagName!=="attribute"){e.insertBefore(t,i);return}}e.appendChild(t)}function s3(e,t,r){let n=t.getElementsByTagName("row")[0];if(!n)return;let i=[...r].sort((s,l)=>s.order-l.order),a=l3(n);if(u3(a,i)){for(let s=0;s<i.length;s+=1){let l=String(i[s].width);a[s].getAttribute("width")!==l&&a[s].setAttribute("width",l)}return}let o=new Map;for(let s of a){let l=s.getAttribute("name");l&&o.set(l,s),n.removeChild(s)}for(let s of i){let l=o.get(s.name);l||(l=e.createElement("cell"),l.setAttribute("name",s.name)),l.setAttribute("width",String(s.width)),n.appendChild(l)}}function l3(e){return Nt(e,"cell").filter(t=>!!t.getAttribute("name")&&t.getAttribute("ishidden")!=="1")}function u3(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r].getAttribute("name")!==t[r].name)return!1;return!0}function c3(e,t,r){let n=t.getElementsByTagName("entity")[0];if(n){for(let i of Nt(n,"order"))n.removeChild(i);for(let i of r){let a=e.createElement("order");a.setAttribute("attribute",i.attribute),a.setAttribute("descending",String(i.descending)),n.appendChild(a)}}}function d3(e,t,r){let n=t.getElementsByTagName("entity")[0];if(n){for(let i of Nt(n,"filter"))PN(i)||n.removeChild(i);(r.conditions.length>0||r.groups.length>0)&&n.appendChild(Qd(e,r))}}function Jd(e,t){return JSON.stringify(e)===JSON.stringify(t)}function p3(e){let t=new DOMParser().parseFromString("<fetch/>","text/xml"),r=t.documentElement;r.setAttribute("version","1.0"),r.setAttribute("mapping","logical");let n=t.createElement("entity");n.setAttribute("name",e.entityLogicalName),r.appendChild(n);let i=new Map;for(let a of[...e.columns].sort((o,s)=>o.order-s.order)){let o=t.createElement("attribute");if(o.setAttribute("name",a.name),a.relatedEntity){let s=i.get(a.relatedEntity);s||(s=t.createElement("link-entity"),s.setAttribute("name",a.relatedEntity),n.appendChild(s),i.set(a.relatedEntity,s)),s.appendChild(o)}else n.appendChild(o)}for(let a of e.sort){let o=t.createElement("order");o.setAttribute("attribute",a.attribute),o.setAttribute("descending",String(a.descending)),n.appendChild(o)}return(e.filters.conditions.length>0||e.filters.groups.length>0)&&n.appendChild(Qd(t,e.filters)),new XMLSerializer().serializeToString(t)}function Qd(e,t){let r=e.createElement("filter");r.setAttribute("type",t.type);for(let n of t.conditions){let i=e.createElement("condition");i.setAttribute("attribute",n.attribute),i.setAttribute("operator",n.operator),n.value!==void 0&&i.setAttribute("value",n.value),r.appendChild(i)}for(let n of t.groups)r.appendChild(Qd(e,n));return r}function f3(e,t){var r;let n=new DOMParser().parseFromString("<grid/>","text/xml"),i=n.documentElement,a=[...e.columns].sort((s,l)=>s.order-l.order);i.setAttribute("name","resultset"),i.setAttribute("jump",((r=a[0])===null||r===void 0?void 0:r.name)||t||`${e.entityLogicalName}id`),i.setAttribute("select","1"),i.setAttribute("icon","1"),i.setAttribute("preview","1");let o=n.createElement("row");o.setAttribute("name","result"),o.setAttribute("id",t||`${e.entityLogicalName}id`),i.appendChild(o);for(let s of a){let l=n.createElement("cell");l.setAttribute("name",s.name),l.setAttribute("width",String(s.width)),o.appendChild(l)}return new XMLSerializer().serializeToString(n)}function m3(){return{adapter:new Js,api:Zq.viewApi}}bi.viewRegistration=m3});function RN(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}var ke,FN=D(()=>{ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1))});function Xd(){return Qs>Xs.length-16&&((0,xN.randomFillSync)(Xs),Qs=0),Xs.slice(Qs,Qs+=16)}var xN,Xs,Qs,LN=D(()=>{xN=require("crypto"),Xs=new Uint8Array(256),Qs=Xs.length});var MN,Kd,UN=D(()=>{MN=require("crypto"),Kd={randomUUID:MN.randomUUID}});function h3(e,t,r){if(Kd.randomUUID&&!t&&!e)return Kd.randomUUID();e=e||{};let n=e.random??e.rng?.()??Xd();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return RN(n)}var gt,BN=D(()=>{UN();LN();FN();gt=h3});var Yd=D(()=>{BN()});var kN=m(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.WorkflowConditionOperator=St.WorkflowAttributeType=St.SystemStep=St.FieldRequiredLevelTypes=St.AttributeDateTimeBehavior=void 0;St.AttributeDateTimeBehavior={None:0,Dynamic:1,DateOnly:2,StaticTimeZoneInvariant:3,UserLocal:4};St.FieldRequiredLevelTypes={None:"0",Required:"1",Recommended:"2"};St.SystemStep={IdentifyContact:"IdentifyContact",IdentifyAccount:"IdentifyAccount",IdentifyCustomer:"IdentifyCustomer",IdentifyCase:"IdentifyCase",Solution:"Solution",Resolve:"Resolve"};St.WorkflowAttributeType={Boolean:"0",Customer:"1",DateTime:"2",Decimal:"3",Float:"4",Integer:"5",Lookup:"6",Money:"7",Owner:"8",PartyList:"9",Picklist:"10",Key:"11",State:"12",Status:"13",String:"14",UniqueIdentifier:"15",EntityNameReference:"16",Entity:"17",EntityCollection:"18",BpfProcess:"19",BpfStageCategory:"20",BpfStage:"21",EntityReferenceCollection:"22",MultiSelectPicklist:"23",BigType:"24"};St.WorkflowConditionOperator={IsNull:"0",NotNull:"1",LogicalAnd:"2",LogicalOr:"3",IN:"4",NotIn:"5",NotInNull:"51",Equal:"6",NotEqual:"7",Contains:"8",DoesNotContain:"9",BeginsWith:"10",DoesNotBeginWith:"11",EndsWith:"12",DoesNotEndWith:"13",GreaterThan:"14",GreaterThanOrEqual:"15",LessThan:"16",LessThanOrEqual:"17",EqualUserId:"18",NotEqualUserId:"19",On:"20",NotOn:"21",OnOrAfter:"22",OnOrBefore:"23",Yesterday:"24",Today:"25",Tomorrow:"26",NextSevenDays:"27",LastSevenDays:"28",NextWeek:"29",LastWeek:"30",ThisWeek:"31",NextMonth:"32",LastMonth:"33",ThisMonth:"34",NextYear:"35",LastYear:"36",ThisYear:"37",Anytime:"38",LastXHours:"39",NextXHours:"40",LastXDays:"41",NextXDays:"42",LastXWeeks:"43",NextXWeeks:"44",LastXMonths:"45",NextXMonths:"46",LastXYears:"47",NextXYears:"48",Under:"49",NotUnder:"50"}});var ZN={};Bt(ZN,{deserializeWorkflowJson:()=>I3,serializeToWorkflowJson:()=>_3});function qN(e){return e.__class==="BinaryExpression:#Microsoft.Crm.Workflow.Expressions"}function g3(e){return e.__class==="ConditionBranchStep:#Microsoft.Crm.Workflow.ObjectModel"}function Ha(){return{list:[]}}function jN(e){return{__class:"PrimaryEntity:#Microsoft.Crm.Workflow.Expressions",parameterName:"primaryEntity",entityName:e}}function tp(e,t,r){return{__class:"EntityAttributeExpression:#Microsoft.Crm.Workflow.Expressions",type:r,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,entity:jN(t),attributeName:e}}function np(e,t){return{__class:"PrimitiveExpression:#Microsoft.Crm.Workflow.Expressions",type:t,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,primitiveValue:e}}function v3(){return np("true",z.WorkflowAttributeType.Boolean)}function $N(e,t){let r=z.WorkflowAttributeType.String,n=ep[e.operator]??z.WorkflowConditionOperator.Equal,i=tp(e.field,t,r),a;return e.operator==="ContainsData"||e.operator==="DoesNotContainData"?a=[]:e.valueType==="Field"&&e.valueField?a=[tp(e.valueField,t,r)]:a=[np(e.value??"",r)],{__class:"BinaryExpression:#Microsoft.Crm.Workflow.Expressions",type:r,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,conditionOperatoroperator:n,left:i,right:a}}function b3(e,t,r){if(e.length===0)return null;if(e.length===1)return $N(e[0],r);let n=t==="AND"?z.WorkflowConditionOperator.LogicalAnd:z.WorkflowConditionOperator.LogicalOr,[i,...a]=e.map(o=>$N(o,r));return{__class:"BinaryExpression:#Microsoft.Crm.Workflow.Expressions",type:z.WorkflowAttributeType.String,behavior:z.AttributeDateTimeBehavior.None,typeSet:!1,conditionOperatoroperator:n,left:i,right:a}}function rp(e){return e?e.__class==="EntityAttributeExpression:#Microsoft.Crm.Workflow.Expressions"?{valueType:"Field",valueField:e.attributeName}:e.__class==="PrimitiveExpression:#Microsoft.Crm.Workflow.Expressions"?{valueType:"Value",value:e.primitiveValue!=null?String(e.primitiveValue):""}:{valueType:"Value",value:""}:{valueType:"Value",value:""}}function Zd(e){let t=WN[e.conditionOperatoroperator]??"Equals",r=e.left.__class==="EntityAttributeExpression:#Microsoft.Crm.Workflow.Expressions"?e.left.attributeName:"",i=t==="ContainsData"||t==="DoesNotContainData"?{valueType:"Value"}:rp(e.right[0]);return{id:gt(),field:r,fieldDisplayName:r,operator:t,...i}}function HN(e){if(!e||e.__class!=="BinaryExpression:#Microsoft.Crm.Workflow.Expressions")return{clauses:[],logic:"AND"};let t=e.conditionOperatoroperator;if(t===z.WorkflowConditionOperator.LogicalAnd||t===z.WorkflowConditionOperator.LogicalOr){let r=t===z.WorkflowConditionOperator.LogicalAnd?"AND":"OR";return{clauses:[...qN(e.left)?[Zd(e.left)]:[],...e.right.filter(qN).map(Zd)],logic:r}}return{clauses:[Zd(e)],logic:"AND"}}function VN(e,t,r,n){return e==="Field"&&r?tp(r,n,z.WorkflowAttributeType.String):np(t??"",z.WorkflowAttributeType.String)}function GN(e,t){return{propertyName:e,propertyValueExpr:t}}function yi(e){return`Step_${e.value++}`}function Dt(e,t){let r=(t.counts[e]??0)+1,n=`${e}${r}`;for(;t.used.has(n);)r+=1,n=`${e}${r}`;return t.counts[e]=r,t.used.add(n),n}function y3(e,t,r){return e&&!r.used.has(e)?(r.used.add(e),e):Dt(t,r)}function C3(e,t,r){return{__class:"ActionStep:#Microsoft.Crm.Workflow.ObjectModel",id:Dt("ActionStep",r),name:yi(t),description:"Action step",stepLabels:{list:[{labelId:gt(),languageCode:1033,description:e}]},steps:{list:[]},actionId:null,actionType:"4",processId:gt(),uniqueName:`id_${gt().replace(/-/g,"")}ActionStep`}}function A3(e,t,r,n){let i=jN(t),a=e.stepName??yi(r),o=e.stepLabels??Ha(),s={name:a,stepLabels:o,description:e.displayName},l=e.type;switch(l){case"SetFieldValue":return{...s,id:Dt("SetAttributeValueStep",n),__class:"SetAttributeValueStep:#Microsoft.Crm.Workflow.ObjectModel",entity:i,specification:GN(e.field,VN(e.valueType,e.value,e.valueField,t))};case"SetDefaultValue":return{...s,id:Dt("SetDefaultValueStep",n),__class:"SetDefaultValueStep:#Microsoft.Crm.Workflow.ObjectModel",entity:i,specification:GN(e.field,VN(e.valueType,e.value,e.valueField,t))};case"LockUnlock":return{...s,id:Dt("SetDisplayModeStep",n),__class:"SetDisplayModeStep:#Microsoft.Crm.Workflow.ObjectModel",controlId:e.field,controlType:"attribute",isReadOnly:e.lock,entity:i};case"SetBusinessRequired":return{...s,id:Dt("SetFieldRequiredLevelStep",n),__class:"SetFieldRequiredLevelStep:#Microsoft.Crm.Workflow.ObjectModel",controlId:e.field,controlType:"attribute",requiredLevel:e.required?z.FieldRequiredLevelTypes.Required:z.FieldRequiredLevelTypes.None,entity:i};case"SetVisibility":return{...s,id:Dt("SetVisibilityStep",n),__class:"SetVisibilityStep:#Microsoft.Crm.Workflow.ObjectModel",controlId:e.field,controlType:"attribute",isVisible:e.visible,entity:i};case"ShowErrorMessage":return{...s,id:Dt("SetMessageStep",n),__class:"SetMessageStep:#Microsoft.Crm.Workflow.ObjectModel",name:e.errorMessage||e.displayName,controlId:e.field,entity:i,level:e.messageLevel??"error",actionSteps:e.messageActionSteps??{list:[]}};case"Recommendation":{let u=e.messageText||e.recommendationTitle||e.displayName,c=e.stepLabels&&e.stepLabels.list.length>0?e.stepLabels:{list:[{labelId:gt(),languageCode:1033,description:u}]},d=e.recommendationActionSteps,f=d&&d.list.length>0?d:{list:[C3(u,r,n)]};return{...s,id:Dt("SetMessageStep",n),__class:"SetMessageStep:#Microsoft.Crm.Workflow.ObjectModel",stepLabels:c,description:e.recommendationTitle||e.displayName,controlId:e.field,entity:i,level:"RECOMMENDATION",actionSteps:f}}default:throw new Error(`Unsupported action type: ${l}`)}}function w3(e){switch(e.__class){case"SetAttributeValueStep:#Microsoft.Crm.Workflow.ObjectModel":{let t=rp(e.specification.propertyValueExpr);return{kind:"action",id:e.id,type:"SetFieldValue",displayName:e.description||e.name||"Set Field Value",stepName:e.name,stepLabels:e.stepLabels,field:e.specification.propertyName,...t}}case"SetDefaultValueStep:#Microsoft.Crm.Workflow.ObjectModel":{let t=rp(e.specification.propertyValueExpr);return{kind:"action",id:e.id,type:"SetDefaultValue",displayName:e.description||e.name||"Set Default Value",stepName:e.name,stepLabels:e.stepLabels,field:e.specification.propertyName,...t}}case"SetDisplayModeStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"LockUnlock",displayName:e.description||e.name||"Lock/Unlock",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,lock:e.isReadOnly};case"SetFieldRequiredLevelStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"SetBusinessRequired",displayName:e.description||e.name||"Set Business Required",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,required:e.requiredLevel!==z.FieldRequiredLevelTypes.None};case"SetVisibilityStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"SetVisibility",displayName:e.description||e.name||"Set Visibility",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,visible:e.isVisible};case"SetMessageStep:#Microsoft.Crm.Workflow.ObjectModel":{let t=e.stepLabels?.list,r=t&&t.length>0?t[0].description??"":"";return(e.level??"").toUpperCase()==="RECOMMENDATION"?{kind:"action",id:e.id,type:"Recommendation",displayName:e.description||"Recommendation",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,recommendationTitle:e.description||"",messageText:r,recommendationActionSteps:e.actionSteps}:{kind:"action",id:e.id,type:"ShowErrorMessage",displayName:e.description||"Show Error Message",stepName:e.name,stepLabels:e.stepLabels,field:e.controlId,errorMessage:r||e.name||"",messageLevel:e.level??void 0,messageActionSteps:e.actionSteps}}case"ActionStep:#Microsoft.Crm.Workflow.ObjectModel":return{kind:"action",id:e.id,type:"Recommendation",displayName:e.name||"Recommendation",stepName:e.name,stepLabels:e.stepLabels,field:e.actionControl?.controlId??"",recommendationTitle:e.name||"",messageText:e.description||""};default:return null}}function JN(e,t,r,n){let i=e.stepName??yi(r),a=Dt("ConditionStep",n),o=[],s=e,l=!0;for(;s;){let u=b3(s.clauses,s.logic,t),c=l?s.branchName??yi(r):yi(r),f={__class:"ConditionBranchStep:#Microsoft.Crm.Workflow.ObjectModel",id:l?y3(s.branchId,"ConditionBranchStep",n):Dt("ConditionBranchStep",n),name:c,description:s.displayName,stepLabels:Ha(),conditionExpression:u??void 0,steps:{list:s.trueBranch.map(b=>QN(b,t,r,n))}};o.push(f);let h=s.falseBranch;if(h.length===1&&h[0].kind==="condition"){s=h[0],l=!1;continue}h.length>0&&o.push(N3(h,t,r,n)),s=void 0}return{__class:"ConditionStep:#Microsoft.Crm.Workflow.ObjectModel",id:a,name:i,description:"",stepLabels:Ha(),containsElsebranch:o.length>1,steps:{list:o}}}function N3(e,t,r,n){return{__class:"ConditionBranchStep:#Microsoft.Crm.Workflow.ObjectModel",id:Dt("ConditionBranchStep",n),name:yi(r),description:null,stepLabels:Ha(),conditionExpression:v3(),steps:{list:e.map(i=>QN(i,t,r,n))}}}function QN(e,t,r,n){return e.kind==="condition"?JN(e,t,r,n):A3(e,t,r,n)}function XN(e){let t=(e.steps?.list??[]).filter(g3);return KN(t,e,!0)}function KN(e,t,r){let[n,...i]=e,{clauses:a,logic:o}=HN(n?.conditionExpression),s=YN(n?.steps?.list??[]),l=S3(i,t),u=n?.description||n?.name||t.description||t.name||"Condition";return{kind:"condition",id:(r?t.id:n?.id)??gt(),displayName:u,clauses:a,logic:o,trueBranch:s,falseBranch:l,isCollapsed:!1,stepName:r?t.name:void 0,branchId:r?n?.id:void 0,branchName:r?n?.name:void 0}}function S3(e,t){if(e.length===0)return[];let[r]=e,{clauses:n}=HN(r.conditionExpression);return n.length===0?YN(r.steps?.list??[]):[KN(e,t,!1)]}function YN(e){return e.map(t=>t.__class==="ConditionStep:#Microsoft.Crm.Workflow.ObjectModel"?XN(t):w3(t)).filter(t=>t!==null)}function D3(e){return e===zN.StateCode.Activated?"Active":"Draft"}function E3(e,t){let r=e.processtriggerscope,n=e.processtriggerformid;return r===1&&n?n:r===2?"Entity":t??"Entity"}function I3(e){let t=e,r=null,n;if(e.wfomJson)try{let i=JSON.parse(e.wfomJson);n={id:i.id==="WorkflowStep0"||!i.id?e.workflowid??gt():i.id,name:i.name,description:i.description,nextStepIndex:i.nextStepIndex,category:i.category==="0"||i.category===0?"2":i.category,businessProcessType:i.businessProcessType,mode:i.mode,title:i.title||e.name||"",primaryEntityName:i.primaryEntityName==="1"||!i.primaryEntityName?e.primaryentity??"":i.primaryEntityName,workflowEntityId:i.workflowEntityId==="00000000-0000-0000-0000-000000000000"||!i.workflowEntityId?e.workflowid??"":i.workflowEntityId,formId:i.formId,variables:i.variables,inputs:i.inputs};let o=(i.steps?.list??[]).find(s=>s.__class==="ConditionStep:#Microsoft.Crm.Workflow.ObjectModel");o&&(r=XN(o))}catch{}return{ruleId:e.workflowid??null,name:e.name??"",description:e.description??"",entityLogicalName:e.primaryentity??"",scope:E3(t,n?.formId),status:D3(e.statecode),rootCondition:r,wfomRoot:n}}function _3(e){let t=e.entityLogicalName,r=e.wfomRoot,n={value:r?Number(r.nextStepIndex):1},i={counts:{},used:new Set},a=e.scope!=="Entity"&&e.scope!=="AllForms"?e.scope:null,o=e.rootCondition?[JN(e.rootCondition,t,n,i)]:[],s={__class:"WorkflowStep:#Microsoft.Crm.Workflow.ObjectModel",id:r?.id??e.ruleId??gt(),name:r?.name??"Step_0",description:r!==void 0?r.description:e.description||null,stepLabels:Ha(),argumentsArray:[],primaryEntityName:r?.primaryEntityName??t,nextStepIndex:String(n.value),isCrmUIWorkflow:!0,category:r?.category??"2",businessProcessType:r?.businessProcessType??"0",mode:r?.mode??"0",title:r?.title??e.name,formId:a,workflowEntityId:r?.workflowEntityId??e.ruleId??"",variables:r?.variables??[],inputs:r?.inputs??[],steps:{list:o}};return JSON.stringify(s)}var zN,z,ep,WN,e2=D(()=>{"use strict";Yd();zN=ne(ha()),z=ne(kN());ep={Equals:z.WorkflowConditionOperator.Equal,DoesNotEqual:z.WorkflowConditionOperator.NotEqual,IsGreaterThan:z.WorkflowConditionOperator.GreaterThan,IsLessThan:z.WorkflowConditionOperator.LessThan,IsGreaterThanEqualTo:z.WorkflowConditionOperator.GreaterThanOrEqual,IsLessThanEqualTo:z.WorkflowConditionOperator.LessThanOrEqual,Contains:z.WorkflowConditionOperator.Contains,DoesNotContain:z.WorkflowConditionOperator.DoesNotContain,BeginsWith:z.WorkflowConditionOperator.BeginsWith,DoesNotBeginWith:z.WorkflowConditionOperator.DoesNotBeginWith,EndsWith:z.WorkflowConditionOperator.EndsWith,DoesNotEndWith:z.WorkflowConditionOperator.DoesNotEndWith,On:z.WorkflowConditionOperator.On,NotOn:z.WorkflowConditionOperator.NotOn,ContainsData:z.WorkflowConditionOperator.NotNull,DoesNotContainData:z.WorkflowConditionOperator.IsNull},WN={};for(let e of Object.keys(ep))WN[ep[e]]=e});function ip(e){return!P3.has(e)}function t2(e){return O3.has(e)?"string":e==="Money"?"money":e==="Integer"||e==="BigInt"?"integer":e==="Decimal"||e==="Double"?"decimal":T3.has(e)?"date":R3.has(e)?"boolean":"other"}function r2(e,t){let r=t2(e),n=t2(t);return r==="other"||n==="other"?e===t:r===n}var P3,O3,T3,R3,n2=D(()=>{"use strict";P3=new Set(["ContainsData","DoesNotContainData"]);O3=new Set(["String","Memo","EntityName"]),T3=new Set(["DateTime"]),R3=new Set(["Boolean"])});var p2={};Bt(p2,{addElseIfInTree:()=>M3,appendToBranch:()=>x3,buildBreadcrumb:()=>G3,collectUsedFields:()=>$3,createEmptyAction:()=>q3,createEmptyCondition:()=>u2,findNode:()=>o2,findParent:()=>Ci,getBranchPosition:()=>k3,hasAnyTriggerGeneratingAction:()=>sp,isTriggerGeneratingAction:()=>a2,moveBranchItemInTree:()=>B3,removeElseIfInTree:()=>U3,removeNodeFromTree:()=>s2,updateActionInTree:()=>ap,updateConditionInTree:()=>yn,validateTree:()=>V3});function a2(e){return F3.has(e.type)}function sp(e){if(!e)return!1;for(let t of[...e.trueBranch,...e.falseBranch])if(t.kind==="action"){if(a2(t))return!0}else if(sp(t))return!0;return!1}function o2(e,t){if(e.id===t)return e;for(let r of[...e.trueBranch,...e.falseBranch]){if(r.id===t)return r;if(r.kind==="condition"){let n=o2(r,t);if(n)return n}}return null}function Ci(e,t){for(let r=0;r<e.trueBranch.length;r++){let n=e.trueBranch[r];if(n.id===t)return{node:e,branch:"true",index:r};if(n.kind==="condition"){let i=Ci(n,t);if(i)return i}}for(let r=0;r<e.falseBranch.length;r++){let n=e.falseBranch[r];if(n.id===t)return{node:e,branch:"false",index:r};if(n.kind==="condition"){let i=Ci(n,t);if(i)return i}}return null}function s2(e,t){return{...e,trueBranch:i2(e.trueBranch,t),falseBranch:i2(e.falseBranch,t)}}function i2(e,t){return e.filter(r=>r.id!==t).map(r=>r.kind==="condition"?s2(r,t):r)}function yn(e,t,r){return e.id===t?r(e):{...e,trueBranch:e.trueBranch.map(n=>n.kind==="condition"?yn(n,t,r):n),falseBranch:e.falseBranch.map(n=>n.kind==="condition"?yn(n,t,r):n)}}function ap(e,t,r){return{...e,trueBranch:e.trueBranch.map(n=>n.kind==="action"&&n.id===t?r(n):n.kind==="condition"?ap(n,t,r):n),falseBranch:e.falseBranch.map(n=>n.kind==="action"&&n.id===t?r(n):n.kind==="condition"?ap(n,t,r):n)}}function x3(e,t,r,n){return yn(e,t,i=>({...i,trueBranch:r==="true"?[...i.trueBranch,n]:i.trueBranch,falseBranch:r==="false"?[...i.falseBranch,n]:i.falseBranch}))}function L3(e){return e.length===1&&e[0].kind==="condition"}function M3(e,t){return yn(e,t,r=>l2(r))}function l2(e){if(L3(e.falseBranch))return{...e,falseBranch:[l2(e.falseBranch[0])]};let t=u2();return t.falseBranch=e.falseBranch,{...e,falseBranch:[t]}}function U3(e,t){let r=Ci(e,t);if(!r||r.branch!=="false")return e;let n=r.node.falseBranch[r.index];if(!n||n.kind!=="condition")return e;let i=n.falseBranch;return yn(e,r.node.id,a=>({...a,falseBranch:i}))}function B3(e,t,r){let n=Ci(e,t);if(!n)return e;let i=a=>{let o=[...a],s=o[n.index+r];return s?(o[n.index+r]=o[n.index],o[n.index]=s,o):a};return yn(e,n.node.id,a=>({...a,trueBranch:n.branch==="true"?i(a.trueBranch):a.trueBranch,falseBranch:n.branch==="false"?i(a.falseBranch):a.falseBranch}))}function k3(e,t){let r=Ci(e,t);if(!r)return null;let n=r.branch==="true"?r.node.trueBranch:r.node.falseBranch;return{isFirst:r.index===0,isLast:r.index===n.length-1}}function u2(){return{kind:"condition",id:gt(),displayName:"New Condition",clauses:[],logic:"AND",trueBranch:[],falseBranch:[],isCollapsed:!1}}function q3(e){let t={kind:"action",id:gt(),type:e,displayName:`New ${e}`};switch(e){case"Recommendation":return{...t,type:"Recommendation",field:"",recommendationTitle:"",messageText:""};case"LockUnlock":return{...t,type:"LockUnlock",field:"",lock:!0};case"ShowErrorMessage":return{...t,type:"ShowErrorMessage",field:"",errorMessage:""};case"SetFieldValue":return{...t,type:"SetFieldValue",field:"",valueType:"Value",value:""};case"SetDefaultValue":return{...t,type:"SetDefaultValue",field:"",valueType:"Value",value:""};case"SetBusinessRequired":return{...t,type:"SetBusinessRequired",field:"",required:!0};case"SetVisibility":return{...t,type:"SetVisibility",field:"",visible:!0};default:return{...t,type:"SetFieldValue",field:"",valueType:"Value",value:""}}}function $3(e){if(!e)return[];let t=[];return c2(e,t),[...new Set(t)]}function c2(e,t){e.clauses.forEach(r=>{r.field&&t.push(r.field)}),[...e.trueBranch,...e.falseBranch].forEach(r=>{r.kind==="condition"?c2(r,t):"field"in r&&r.field&&t.push(r.field)})}function V3(e,t=[]){if(!e)return[{nodeId:"root",kind:"NO_CONDITION",message:"A business rule must include at least one condition."}];let r=[],n=new Map(t.map(i=>[i.logicalName,i]));return d2(e,r,n),sp(e)||r.push({nodeId:"root",kind:"NO_ACTION",message:"A business rule must include at least one action step."}),r}function d2(e,t,r){e.clauses.length===0&&t.push({nodeId:e.id,kind:"EMPTY_CLAUSE_FIELD",message:"Add at least one clause to this condition."}),e.clauses.forEach(n=>{if(!n.field)t.push({nodeId:e.id,kind:"EMPTY_CLAUSE_FIELD",message:"Please select a field for this clause."});else if(ip(n.operator)&&n.valueType==="Value"&&!n.value)t.push({nodeId:e.id,kind:"EMPTY_CLAUSE_VALUE",message:"Please enter a value for this clause."});else if(ip(n.operator)&&n.valueType==="Value"&&n.value){let i=r.get(n.field);i?.maxLength&&n.value.length>i.maxLength&&t.push({nodeId:e.id,kind:"CLAUSE_VALUE_TOO_LONG",message:`Value exceeds the field's maximum length of ${i.maxLength} characters.`})}}),[...e.trueBranch,...e.falseBranch].forEach(n=>{if(n.kind==="condition")d2(n,t,r);else if(!("field"in n)||!n.field)t.push({nodeId:n.id,kind:"EMPTY_ACTION_FIELD",message:`${n.type}: a target field is required.`});else if((n.type==="SetFieldValue"||n.type==="SetDefaultValue")&&n.valueType==="Value"&&n.value){let i=r.get(n.field);i?.maxLength&&n.value.length>i.maxLength&&t.push({nodeId:n.id,kind:"ACTION_VALUE_TOO_LONG",message:`${n.type}: value exceeds the field's maximum length of ${i.maxLength} characters.`})}else if((n.type==="SetFieldValue"||n.type==="SetDefaultValue")&&n.valueType==="Field"){if(!n.valueField)t.push({nodeId:n.id,kind:"EMPTY_ACTION_VALUE",message:`${n.type}: please select a field to copy from.`});else if(r.size>0){let i=r.get(n.field),a=r.get(n.valueField);i&&a&&!r2(i.attributeType,a.attributeType)&&t.push({nodeId:n.id,kind:"EMPTY_ACTION_VALUE",message:`${n.type}: the source field's type is not compatible with the target field.`})}}})}function G3(e,t){let r=[];return op(e,t,r),r}function op(e,t,r){if(e.id===t)return r.push({conditionId:e.id,label:e.displayName}),!0;for(let n of e.trueBranch)if(n.kind==="condition"){if(r.push({conditionId:e.id,label:e.displayName}),op(n,t,r))return!0;r.pop()}for(let n of e.falseBranch)if(n.kind==="condition"){if(r.push({conditionId:e.id,label:e.displayName}),op(n,t,r))return!0;r.pop()}return!1}var F3,f2=D(()=>{"use strict";Yd();n2();F3=new Set(["LockUnlock","ShowErrorMessage","SetFieldValue","SetDefaultValue","SetBusinessRequired","SetVisibility"])});var g2=m(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.businessRuleApi=void 0;var Ks=ha(),Yt=Ve(),Ai=ce(),m2="00000000-0000-0000-0000-000000000000",Ys={"Content-Type":"application/json",Accept:"application/json"},z3="workflowid,name,description,primaryentity,statecode,category,type",W3="category eq 2 and type eq 1";async function h2(e,t,r){if(r==="Draft")return;let n=(0,Ai.normalizeGuid)(t,"workflowid"),i=r==="Active",a={statecode:i?Ks.StateCode.Activated:Ks.StateCode.Draft,statuscode:i?Ks.StatusCode.Activated:Ks.StatusCode.Draft},o=`/workflows(${n})`;(0,Yt.ensureSuccess)(await e.patch(o,a,{headers:Ys}),e.apiUrl(o))}Zs.businessRuleApi={async get(e,t){let n=`/workflows(${(0,Ai.normalizeGuid)(t,"id")})/Microsoft.Dynamics.CRM.RetrieveProcessWithWfomJson`,i=(0,Yt.ensureSuccess)(await e.post(n,{},{headers:Ys}),e.apiUrl(n));return{raw:i.body,etag:(0,Yt.readEtag)(i)}},async list(e,t){var r;let n=[W3];t?.entityLogicalName&&n.push(`primaryentity eq '${(0,Ai.odataLiteral)(t.entityLogicalName)}'`);let i=`/workflows${(0,Ai.odataQuery)([["$select",z3],["$filter",n.join(" and ")]])}`,o=(0,Yt.ensureSuccess)(await e.get(i),e.apiUrl(i)).body;return((r=o?.value)!==null&&r!==void 0?r:[]).map(l=>{var u,c;return{type:"businessRule",id:(u=l.workflowid)!==null&&u!==void 0?u:"",name:(c=l.name)!==null&&c!==void 0?c:"",entityLogicalName:l.primaryentity,isDirty:!1}})},async create(e,t){let r=t,n=`/workflows(${m2})/Microsoft.Dynamics.CRM.CreateProcessWithWfomJson`,i=(0,Yt.ensureSuccess)(await e.post(n,r,{headers:Ys}),e.apiUrl(n)),a=(0,Ai.normalizeGuid)(r.Entity.workflowid,"workflowid");try{await h2(e,a,r.status)}catch(o){try{await(0,Yt.deleteRecord)(e,"workflows",a)}catch{}throw o}return{id:a,etag:(0,Yt.readEtag)(i)}},async update(e,t,r,n){let i=r,a=(0,Ai.normalizeGuid)(t,"id"),o=`/workflows(${m2})/Microsoft.Dynamics.CRM.UpdateProcessWithWfomJson`,s={...Ys};n&&(s["If-Match"]=n);let l=(0,Yt.ensureSuccess)(await e.post(o,i,{headers:s}),e.apiUrl(o));return await h2(e,a,i.status),{id:a,etag:(0,Yt.readEtag)(l)}},delete(e,t){return(0,Yt.deleteRecord)(e,"workflows",t)}}});var C2=m(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.BUSINESS_RULE_NULL_GUID=zr.businessRuleRegistration=zr.BusinessRuleAdapter=void 0;var v2=Nu(),lp=ha(),b2=(e2(),kt(ZN)),j3=(f2(),kt(p2)),Ja=$r(),H3=g2(),J3=Tt(),Q3="00000000-0000-0000-0000-000000000000";zr.BUSINESS_RULE_NULL_GUID=Q3;var X3=new Set(["Recommendation","LockUnlock","ShowErrorMessage","SetFieldValue","SetDefaultValue","SetBusinessRequired","SetVisibility"]),K3=["ruleId","name","description","entityLogicalName","scope","status","rootCondition"],Y3=["kind","id","displayName","logic","clauses","trueBranch","falseBranch"],el=class{toArtifact(t){let r=this.residualBag(t,K3),n={id:t.ruleId,name:t.name,description:t.description,entityLogicalName:t.entityLogicalName,scope:t.scope,status:t.status,rootCondition:t.rootCondition?this.conditionToJson(t.rootCondition):null};return r&&(n.bag=r),n}fromArtifact(t){var r;let n=t.rootCondition?this.conditionFromJson(t.rootCondition):null;return{...(r=t.bag)!==null&&r!==void 0?r:{},ruleId:t.id,name:t.name,description:t.description,entityLogicalName:t.entityLogicalName,scope:t.scope,status:t.status,rootCondition:n}}fromApiResponse(t){var r;let n=t??{},i={...(r=n.Entity)!==null&&r!==void 0?r:{},wfomJson:n.WfomJson},a=(0,b2.deserializeWorkflowJson)(i);return this.toArtifact(a)}toApiPayload(t){var r;let n=this.fromArtifact(t);n.wfomRoot&&(n.wfomRoot={...n.wfomRoot,name:t.name,title:t.name,primaryEntityName:t.entityLogicalName||n.wfomRoot.primaryEntityName});let i=(0,b2.serializeToWorkflowJson)(n),a=(r=n.ruleId)!==null&&r!==void 0?r:(0,v2.v4)();return{Entity:this.buildWorkflowEntity(n,a),WfomJson:i,status:t.status}}createDefault(t){var r,n,i,a,o,s;let l={ruleId:(r=t.id)!==null&&r!==void 0?r:null,name:(n=t.name)!==null&&n!==void 0?n:"New business rule",description:(i=t.description)!==null&&i!==void 0?i:"",entityLogicalName:(a=t.entityLogicalName)!==null&&a!==void 0?a:"",scope:(o=t.scope)!==null&&o!==void 0?o:"Entity",status:(s=t.status)!==null&&s!==void 0?s:"Draft",rootCondition:(0,j3.createEmptyCondition)()},u=this.toArtifact(l);return u.id||(u.id=(0,v2.v4)()),u}assignMissingIds(t){return(0,J3.assignMissingIds)(t)}validate(t){let r=[],n=t.rootCondition;return n==null?r:(0,Ja.isJsonObject)(n)?(y2(n,"/rootCondition",r),r):(r.push((0,Ja.issue)("/rootCondition","condition-must-be-object",`rootCondition must be a JSON object or null, got ${typeof n}`)),r)}residualBag(t,r){let n=new Set(r),i={};for(let a of Object.keys(t)){if(n.has(a))continue;let o=t[a];o!==void 0&&(i[a]=o)}return Object.keys(i).length>0?i:void 0}buildWorkflowEntity(t,r){let n=t.scope!=="Entity"&&t.scope!=="AllForms";return{"@odata.type":"#Microsoft.Dynamics.CRM.workflow",name:t.name,description:t.description,workflowid:r,ondemand:!1,subprocess:!1,triggeroncreate:!1,triggerondelete:!1,category:lp.WorkflowCategory.BusinessRule,type:lp.WorkflowTypeCode.Definition,mode:1,scope:lp.WorkflowScope.Organization,primaryentity:t.entityLogicalName,iscrmuiworkflow:!0,processtriggerscope:n?1:2,...n?{processtriggerformid:t.scope}:{}}}conditionToJson(t){let r=this.residualBag(t,Y3),n={id:t.id,displayName:t.displayName,logic:t.logic,clauses:t.clauses.map(i=>this.clauseToJson(i)),trueBranch:t.trueBranch.map(i=>this.branchItemToJson(i)),falseBranch:t.falseBranch.map(i=>this.branchItemToJson(i))};return r&&(n.bag=r),n}clauseToJson(t){return{id:t.id,field:t.field,fieldDisplayName:t.fieldDisplayName,operator:t.operator,valueType:t.valueType,...t.value!==void 0?{value:t.value}:{},...t.valueField!==void 0?{valueField:t.valueField}:{}}}branchItemToJson(t){return t.kind==="condition"?this.conditionToJson(t):this.actionToJson(t)}actionToJson(t){return{...t}}conditionFromJson(t){var r;return{kind:"condition",isCollapsed:!1,...(r=t.bag)!==null&&r!==void 0?r:{},id:t.id,displayName:t.displayName,logic:t.logic,clauses:t.clauses.map(i=>this.clauseFromJson(i)),trueBranch:t.trueBranch.map(i=>this.branchItemFromJson(i)),falseBranch:t.falseBranch.map(i=>this.branchItemFromJson(i))}}clauseFromJson(t){var r;return{id:t.id,field:t.field,fieldDisplayName:(r=t.fieldDisplayName)!==null&&r!==void 0?r:t.field,operator:t.operator,valueType:t.valueType,...t.value!==void 0?{value:t.value}:{},...t.valueField!==void 0?{valueField:t.valueField}:{}}}branchItemFromJson(t){return this.isConditionJson(t)?this.conditionFromJson(t):this.actionFromJson(t)}actionFromJson(t){if(!X3.has(t.type))throw new Error(`Unsupported business-rule action type: ${t.type}`);return{...t,kind:"action",type:t.type}}isConditionJson(t){return Object.prototype.hasOwnProperty.call(t,"clauses")&&Object.prototype.hasOwnProperty.call(t,"logic")&&!Object.prototype.hasOwnProperty.call(t,"type")}};zr.BusinessRuleAdapter=el;function y2(e,t,r){(0,Ja.optionalEnum)(e,"logic",["AND","OR"],t,"condition-logic-invalid",r),(0,Ja.childObjects)(e,"clauses",t,"clause",r);for(let n of["trueBranch","falseBranch"])(0,Ja.childObjects)(e,n,t,"branchItem",r).forEach(({node:a,index:o})=>{("clauses"in a||"trueBranch"in a||"falseBranch"in a)&&y2(a,`${t}/${n}/${o}`,r)})}function Z3(){return{adapter:new el,api:H3.businessRuleApi}}zr.businessRuleRegistration=Z3});var I2=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.appRegistration=Ni.AppAdapter=void 0;var wi=$r(),Me=pn(),Xa=ja(),e$=_u(),up=fn(),t$=Tt(),fp="1033",nl="7.0.0.0",A2=`<SiteMap IntroducedVersion="${nl}"></SiteMap>`,r$="/_imgs/imagestrips/transparent_spacer.gif",n$="/_imgs/TableIconsFluentV9/document_one_page_sparkle.svg",i$=["Entity","Url","DefaultDashboard","Page","GenPageId"],Qa="sitemapId",w2="sitemapName",a$="sitemapNameUnique",il=class{toArtifact(t){let{bag:r,modeledEls:n}=tl(t,"Area");return{id:"",name:"",uniqueName:"",description:"",siteMap:{areas:n.map(i=>this.areaToJson(i)),bag:r},bag:(0,Me.emptyBag)()}}fromArtifact(t){(0,up.installDomShim)();let r=this.assignMissingIds(JSON.parse(JSON.stringify(t))),n=new DOMParser().parseFromString("<root/>","text/xml"),i=this.rootToRaw(r);return(0,Me.rebuildRaw)(i,(0,Xa.domEngine)(n),null)}fromApiResponse(t){var r,n,i,a,o,s,l,u,c,d;(0,up.installDomShim)();let f=t??{},h=(r=f.$sitemap)!==null&&r!==void 0?r:f,b=(0,Xa.parseXmlRoot)((n=h.sitemapxml)!==null&&n!==void 0?n:A2,A2),w=this.toArtifact(b);return w.id=(i=f.appmoduleid)!==null&&i!==void 0?i:"",w.name=(a=f.name)!==null&&a!==void 0?a:"",w.uniqueName=(o=f.uniquename)!==null&&o!==void 0?o:"",w.description=(s=f.description)!==null&&s!==void 0?s:"",w.bag={a:[[Qa,(u=(l=h.sitemapid)!==null&&l!==void 0?l:f._sitemapid_value)!==null&&u!==void 0?u:""],[w2,(c=h.sitemapname)!==null&&c!==void 0?c:""],[a$,(d=h.sitemapnameunique)!==null&&d!==void 0?d:""]],c:[]},w}toApiPayload(t){var r,n,i,a,o,s,l,u,c,d,f,h,b,w;(0,up.installDomShim)();let N=(0,Xa.serializeNode)(this.fromArtifact(t)),I=[],R=[];for(let M of(n=(r=t.siteMap)===null||r===void 0?void 0:r.areas)!==null&&n!==void 0?n:[])for(let W of(i=M.groups)!==null&&i!==void 0?i:[])for(let B of(a=W.subAreas)!==null&&a!==void 0?a:[])B.type==="Entity"&&B.entity?I.push(B.entity):B.type==="DashBoard"&&B.dashboardId&&R.push(B.dashboardId);let F=(o=t.bag)!==null&&o!==void 0?o:(0,Me.emptyBag)();return{sitemapId:(s=S2(F,Qa))!==null&&s!==void 0?s:"",sitemapxml:N,sitemapname:S2(F,w2)||t.name,appModuleId:t.id,appModuleName:t.name,appModuleDescription:t.description,appModuleUniqueName:t.uniqueName,...t.iconWebResourceId?{iconWebResourceId:t.iconWebResourceId}:{},entities:I,components:{forms:(u=(l=t.components)===null||l===void 0?void 0:l.forms)!==null&&u!==void 0?u:[],views:(d=(c=t.components)===null||c===void 0?void 0:c.views)!==null&&d!==void 0?d:[],charts:(h=(f=t.components)===null||f===void 0?void 0:f.charts)!==null&&h!==void 0?h:[],dashboards:[...(w=(b=t.components)===null||b===void 0?void 0:b.dashboards)!==null&&w!==void 0?w:[],...R]}}}createDefault(t){var r,n,i,a;let o=t.siteMap&&t.siteMap.areas.length>0?t.siteMap.areas:[{id:"",title:"Area",groups:[{id:"",title:"Group",subAreas:[]}]}];return{id:(r=t.id)!==null&&r!==void 0?r:(0,t$.newId)(),name:(n=t.name)!==null&&n!==void 0?n:"New App",uniqueName:(i=t.uniqueName)!==null&&i!==void 0?i:"",description:(a=t.description)!==null&&a!==void 0?a:"",siteMap:{areas:o},...t.iconWebResourceId?{iconWebResourceId:t.iconWebResourceId}:{},...t.components?{components:t.components}:{}}}assignMissingIds(t){let r=t;if(!r||typeof r!="object")return t;let n=r.siteMap;return n&&Array.isArray(n.areas)?n.areas.forEach(pp):Array.isArray(r.areas)?r.areas.forEach(pp):Array.isArray(r.groups)?pp(r):Array.isArray(r.subAreas)?E2(r):"type"in r&&al(r,"subarea"),t}validate(t){let r=[],n=t.siteMap;return n==null?r:(0,wi.isJsonObject)(n)?((0,wi.childObjects)(n,"areas","/siteMap","area",r).forEach(({node:a,index:o})=>{let s=`/siteMap/areas/${o}`;(0,wi.childObjects)(a,"groups",s,"group",r).forEach(({node:u,index:c})=>{let d=`${s}/groups/${c}`;(0,wi.childObjects)(u,"subAreas",d,"subArea",r).forEach(({node:h,index:b})=>{(0,wi.optionalEnum)(h,"type",["Entity","URL","DashBoard","CustomPage","GenPage"],`${d}/subAreas/${b}`,"subarea-type-invalid",r)})})}),r):(r.push((0,wi.issue)("/siteMap","sitemap-must-be-object",`siteMap must be a JSON object, got ${typeof n}`)),r)}applyServerIdentity(t,r){let n=r[Qa];if(!n)return;t.bag||(t.bag=(0,Me.emptyBag)());let i=t.bag.a.find(a=>a[0]===Qa);i?i[1]=n:t.bag.a.push([Qa,n])}areaToJson(t){var r;let{bag:n,modeledEls:i}=tl(t,"Group"),a={id:(r=t.getAttribute("Id"))!==null&&r!==void 0?r:"",title:cp(t),groups:i.map(l=>this.groupToJson(l)),bag:n},o=t.getAttribute("Icon");o&&(a.icon=o);let s=t.getAttribute("VectorIcon");return s&&(a.vectorIcon=s),a}groupToJson(t){var r;let{bag:n,modeledEls:i}=tl(t,"SubArea");return{id:(r=t.getAttribute("Id"))!==null&&r!==void 0?r:"",title:cp(t),subAreas:i.map(a=>this.subAreaToJson(a)),bag:n}}subAreaToJson(t){var r;let{bag:n}=tl(t,null),i=o$(t),a={id:(r=t.getAttribute("Id"))!==null&&r!==void 0?r:"",type:i,title:cp(t),bag:n};if(i==="Entity"){let l=t.getAttribute("Entity");l&&(a.entity=l)}else if(i==="DashBoard"){let l=t.getAttribute("DefaultDashboard");l&&(a.dashboardId=l);let u=t.getAttribute("Url");u&&(a.dashboardUrl=u)}else if(i==="CustomPage"){let l=t.getAttribute("Page");l&&(a.page=l)}else if(i==="GenPage"){let l=t.getAttribute("GenPageId");l&&(a.genPageId=l)}else{let l=t.getAttribute("Url");l&&(a.url=l)}let o=t.getAttribute("Icon");o&&o!==r$&&(a.icon=o);let s=t.getAttribute("VectorIcon");return s&&(a.vectorIcon=s),a}rootToRaw(t){var r,n,i,a;let o=(n=(r=t.siteMap)===null||r===void 0?void 0:r.bag)!==null&&n!==void 0?n:(0,Me.emptyBag)(),l=rl(o)?[["IntroducedVersion",nl]]:[],u=((a=(i=t.siteMap)===null||i===void 0?void 0:i.areas)!==null&&a!==void 0?a:[]).map(c=>this.areaToRaw(c));return{n:"SiteMap",a:(0,Me.mergeAttrs)(o.a,l),c:(0,Me.spliceChildren)(o.c,u)}}areaToRaw(t){var r;let n=(r=t.bag)!==null&&r!==void 0?r:(0,Me.emptyBag)(),i=rl(n),a=[];t.id&&a.push(["Id",t.id]),i&&a.push(["ShowGroups","true"],["ResourceId","SitemapDesigner.NewTitle"],["DescriptionResourceId","SitemapDesigner.NewTitle"],["IntroducedVersion",nl]),t.icon!==void 0&&a.push(["Icon",t.icon]),t.vectorIcon!==void 0&&a.push(["VectorIcon",t.vectorIcon]);let o=t.groups.map(l=>this.groupToRaw(l)),s=dp((0,Me.spliceChildren)(n.c,o),t.title,i);return{n:"Area",a:(0,Me.mergeAttrs)(n.a,a),c:s}}groupToRaw(t){var r;let n=(r=t.bag)!==null&&r!==void 0?r:(0,Me.emptyBag)(),i=rl(n),a=[];t.id&&a.push(["Id",t.id]),i&&a.push(["ResourceId","SitemapDesigner.NewGroup"],["DescriptionResourceId","SitemapDesigner.NewGroup"],["ToolTipResourseId","SitemapDesigner.Unknown"],["IntroducedVersion",nl],["IsProfile","false"]);let o=t.subAreas.map(l=>this.subAreaToRaw(l)),s=dp((0,Me.spliceChildren)(n.c,o),t.title,i);return{n:"Group",a:(0,Me.mergeAttrs)(n.a,a),c:s}}subAreaToRaw(t){var r;let n=(r=t.bag)!==null&&r!==void 0?r:(0,Me.emptyBag)(),i=rl(n),a=l$(n.a,t.type),o=[];t.id&&o.push(["Id",t.id]),c$(o,t),i?(o.push(["ResourceId","SitemapDesigner.NewSubArea"],["Client","All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web"],["Sku","All,OnPremise,Live,SPLA"],["AvailableOffline","true"],["PassParams","false"]),t.icon&&o.push(["Icon",t.icon])):t.icon!==void 0&&o.push(["Icon",t.icon]),t.vectorIcon!==void 0?o.push(["VectorIcon",t.vectorIcon]):t.type==="GenPage"&&!s$(a,"VectorIcon")&&o.push(["VectorIcon",n$]);let s=dp((0,Me.spliceChildren)(n.c,[]),t.title,i);return{n:"SubArea",a:(0,Me.mergeAttrs)(a,o),c:s}}};Ni.AppAdapter=il;function tl(e,t){let r=(0,Xa.nodeLikeFromDom)(e).getAllProperties().map(s=>[s.key,s.value]),n=[],i=[],a=e.childNodes,o=0;for(let s=0;s<a.length;s+=1){let l=a[s];l.nodeType!==1&&l.nodeType!==3||(l.nodeType===1&&t!==null&&l.tagName===t?i.push(l):n.push({i:o,node:(0,Me.rawFromNode)((0,Xa.nodeLikeFromDom)(l))}),o+=1)}return{bag:{a:r,c:n},modeledEls:i}}function N2(e,t){let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];a.nodeType===1&&a.tagName===t&&r.push(a)}return r}function cp(e){var t;let r=N2(e,"Titles")[0];if(!r)return"";let i=N2(r,"Title").find(a=>a.getAttribute("LCID")===fp);return i&&(t=i.getAttribute("Title"))!==null&&t!==void 0?t:""}function o$(e){return e.getAttribute("GenPageId")?"GenPage":e.getAttribute("Entity")?"Entity":e.getAttribute("Page")?"CustomPage":e.getAttribute("DefaultDashboard")?"DashBoard":"URL"}function rl(e){return e.a.length===0&&e.c.length===0}function s$(e,t){return e.some(([r])=>r===t)}function S2(e,t){let r=e.a.find(([n])=>n===t);return r?r[1]:void 0}function l$(e,t){let r=u$(t);return e.filter(([n])=>!i$.includes(n)||r.has(n)).map(n=>[n[0],n[1]])}function u$(e){switch(e){case"Entity":return new Set(["Entity"]);case"URL":return new Set(["Url"]);case"DashBoard":return new Set(["DefaultDashboard","Url"]);case"CustomPage":return new Set(["Page"]);case"GenPage":return new Set(["GenPageId"]);default:return new Set}}function c$(e,t){var r,n,i,a,o;switch(t.type){case"Entity":e.push(["Entity",(r=t.entity)!==null&&r!==void 0?r:""]);break;case"URL":e.push(["Url",(n=t.url)!==null&&n!==void 0?n:""]);break;case"DashBoard":e.push(["DefaultDashboard",(i=t.dashboardId)!==null&&i!==void 0?i:""]),t.dashboardUrl!==void 0&&e.push(["Url",t.dashboardUrl]);break;case"CustomPage":e.push(["Page",(a=t.page)!==null&&a!==void 0?a:""]);break;case"GenPage":e.push(["GenPageId",(o=t.genPageId)!==null&&o!==void 0?o:""]);break;default:break}}function dp(e,t,r){if(!t)return e;let n=e.findIndex(i=>i.n==="Titles");if(n>=0){let i=e.slice();return i[n]=d$(e[n],t),i}return r?[p$(t),...e]:e}function d$(e,t){let r=!1,n=e.c.map(i=>!r&&i.n==="Title"&&f$(i,"LCID")===fp?(r=!0,{n:i.n,a:(0,Me.mergeAttrs)(i.a,[["Title",t]]),c:i.c}):i);return r||n.unshift(D2(t)),{n:e.n,a:e.a.map(i=>[i[0],i[1]]),c:n}}function p$(e){return{n:"Titles",a:[],c:[D2(e)]}}function D2(e){return{n:"Title",a:[["LCID",fp],["Title",e]],c:[]}}function f$(e,t){let r=e.a.find(([n])=>n===t);return r?r[1]:void 0}function m$(e){let t="0123456789abcdef",r="";for(let n=0;n<e;n+=1)r+=t[Math.floor(Math.random()*t.length)];return r}function al(e,t){e&&(typeof e.id!="string"||e.id.length===0)&&(e.id=`${t}_${m$(8)}`)}function pp(e){var t;al(e,"area");for(let r of(t=e.groups)!==null&&t!==void 0?t:[])E2(r)}function E2(e){var t;al(e,"group");for(let r of(t=e.subAreas)!==null&&t!==void 0?t:[])al(r,"subarea")}function h$(){return{adapter:new il,api:e$.appApi}}Ni.appRegistration=h$});var _2={};Bt(_2,{ActionType:()=>hp,AppActionOrigin:()=>Np,AppActionVisibilityType:()=>wp,ButtonType:()=>vp,CannotUpdateAppActionColumns:()=>g$,Context:()=>yp,IconType:()=>gp,Location:()=>bp,OnClickEventType:()=>Ap,Scope:()=>Cp,VisibilityType:()=>mp});var mp,hp,gp,vp,bp,yp,Cp,Ap,wp,Np,g$,P2=D(()=>{"use strict";(function(e){e[e.NotSupported=0]="NotSupported",e[e.Show=1]="Show",e[e.ClassicRules=2]="ClassicRules",e[e.Expression=3]="Expression"})(mp||(mp={}));(function(e){e[e.NotSupported=0]="NotSupported",e[e.None=1]="None",e[e.JavaScript=2]="JavaScript",e[e.Expression=3]="Expression"})(hp||(hp={}));(function(e){e[e.NoIcon=0]="NoIcon",e[e.UseIcon=1]="UseIcon",e[e.UseWebResource=2]="UseWebResource"})(gp||(gp={}));(function(e){e[e.Standard=0]="Standard",e[e.Dropdown=1]="Dropdown",e[e.Split=2]="Split",e[e.Group=3]="Group"})(vp||(vp={}));(function(e){e[e.Form=0]="Form",e[e.HomePageGrid=1]="HomePageGrid",e[e.SubGridStandard=2]="SubGridStandard",e[e.SubGridAssociated=3]="SubGridAssociated",e[e.QuickForm=4]="QuickForm",e[e.Global=5]="Global",e[e.Dashboard=6]="Dashboard"})(bp||(bp={}));(function(e){e[e.All=0]="All",e[e.Entity=1]="Entity"})(yp||(yp={}));(function(e){e[e.App=0]="App",e[e.Entity=1]="Entity",e[e.Global=2]="Global"})(Cp||(Cp={}));(function(e){e[e.None=0]="None",e[e.Formula=1]="Formula",e[e.JavaScript=2]="JavaScript"})(Ap||(Ap={}));(function(e){e[e.None=0]="None",e[e.Formula=1]="Formula",e[e.ClassicRules=2]="ClassicRules"})(wp||(wp={}));(function(e){e[e.Default=0]="Default",e[e.Migrated=1]="Migrated",e[e.MigratedClone=2]="MigratedClone"})(Np||(Np={}));g$=["appactionid","appmoduleid","context","contextvalue","location","name","type","uniquename","isdisabled","origin"]});var T2=m(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.commandApi=void 0;var Cr=Ve(),Zt=ce(),v$="OnClickEventJavaScriptWebResourceId($select=name,webresourceid),IconWebResourceId($select=name,webresourceid)";async function Sp(e,t){let r=`/EntityDefinitions(LogicalName='${(0,Zt.odataLiteral)(t)}')${(0,Zt.odataQuery)([["$select","MetadataId"]])}`,i=(0,Cr.ensureSuccess)(await e.get(r),e.apiUrl(r)).body,a=i?.MetadataId;return a?(0,Zt.normalizeGuid)(a,"entityMetadataId"):""}ol.commandApi={async get(e,t){var r;let n=t,i=await Sp(e,n),a=i?`_contextentity_value eq ${i}`:`contextvalue eq '${(0,Zt.odataLiteral)(n)}'`,o=`/appactions${(0,Zt.odataQuery)([["$expand",v$],["$filter",a]])}`,s=(0,Cr.ensureSuccess)(await e.get(o),e.apiUrl(o)),l=s.body;return{raw:{entityLogicalName:n,entityMetadataId:i,appActions:(r=l?.value)!==null&&r!==void 0?r:[]},etag:(0,Cr.readEtag)(s)}},async list(e,t){let r=t?.entityLogicalName;return r?[{type:"command",id:r,name:`${r} commands`,entityLogicalName:r,isDirty:!1}]:[]},async create(e,t){let r=t,n=r.entityMetadataId||await Sp(e,r.entityLogicalName);return O2(e,{...r,entityMetadataId:n},!1)},async update(e,t,r,n){return O2(e,r,!0)},async delete(e,t){var r,n;let i=await Sp(e,t),a=i?`_contextentity_value eq ${i}`:`contextvalue eq '${(0,Zt.odataLiteral)(t)}'`,o=`/appactions${(0,Zt.odataQuery)([["$select","appactionid"],["$filter",a]])}`,l=(n=(r=(0,Cr.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[];for(let u of l)u.appactionid&&await(0,Cr.deleteRecord)(e,"appactions",u.appactionid)}};async function O2(e,t,r){var n;let i=t.entityMetadataId?(0,Zt.normalizeGuid)(t.entityMetadataId,"entityMetadataId"):"",a=b$(t.rows);for(let o of a)if(r&&o.exists){let l=`/appactions(${(0,Zt.normalizeGuid)(o.appactionid,"id")})`,u=o.etag?{"If-Match":o.etag}:void 0;(0,Cr.ensureSuccess)(await e.patch(l,o.body,u?{headers:u}:void 0),e.apiUrl(l))}else{let s="/appactions",l={...o.body};i&&l["[email protected]"]===void 0&&(l["[email protected]"]=`/entities(${i})`);let u=(0,Cr.ensureSuccess)(await e.post(s,l),e.apiUrl(s));(0,Cr.readCreatedId)(u,"appactionid")}for(let o of[...(n=t.deletedRowIds)!==null&&n!==void 0?n:[]].reverse())await(0,Cr.deleteRecord)(e,"appactions",(0,Zt.normalizeGuid)(o,"id"));return{id:t.entityLogicalName,etag:null}}function b$(e){let t=new Map(e.map(a=>[a.appactionid,a])),r=new Set,n=[],i=a=>{if(r.has(a.appactionid))return;let o=a.body["[email protected]"];if(typeof o=="string"){let s=/\(([^)]+)\)/.exec(o),l=s?t.get(s[1]):void 0;l&&i(l)}r.add(a.appactionid),n.push(a)};return e.forEach(i),n}});var z2=m(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.commandRegistration=Si.CommandAdapter=void 0;var Oe=(P2(),kt(_2)),Et=$r(),y$=T2(),F2=Tt(),Ka=ce(),Ep="$ClientSvg:",Ip=".svg",C$=2,x2="entityMetadataId",A$=new Set(["@odata.etag","IconWebResourceId","OnClickEventJavaScriptWebResourceId","VisibilityFormulaComponentLibraryId","OnClickEventFormulaComponentLibraryId","ContextEntity","_appmoduleid_value","_contextentity_value","_createdby_value","_createdonbehalfby_value","_iconwebresourceid_value","_modifiedby_value","_modifiedonbehalfby_value","_onclickeventformulacomponentlibraryid_value","_onclickeventjavascriptwebresourceid_value","_organizationid_value","_parentappactionid_value","_visibilityformulacomponentlibraryid_value","createdon","modifiedon","overriddencreatedon","overwritetime","componentstate","componentidunique","solutionid","ismanaged","iscustomizable","versionnumber","importsequencenumber","timezoneruleversionnumber","utcconversiontimezonecode","statecode","statuscode","scope"]),sl=class{toArtifact(t){var r,n,i,a,o,s;let l=(r=t.appActions)!==null&&r!==void 0?r:[],u=(n=t.entityLogicalName)!==null&&n!==void 0?n:"",c=new Map;for(let h of l){let b=typeof h._parentappactionid_value=="string"&&h._parentappactionid_value?h._parentappactionid_value:"",w=(i=c.get(b))!==null&&i!==void 0?i:[];w.push(h),c.set(b,w)}let d=new Map;for(let h of(a=c.get(""))!==null&&a!==void 0?a:[]){let b=E$(h.location),w=(o=d.get(b))!==null&&o!==void 0?o:[];w.push(h),d.set(b,w)}let f=[];for(let[h,b]of d)f.push({location:h,groups:N$(b,c,k2(h),u)});return{id:u,entityLogicalName:u,commandBars:D$(f),bag:{a:[[x2,(s=t.entityMetadataId)!==null&&s!==void 0?s:""]]}}}fromArtifact(t){return{entityLogicalName:t.entityLogicalName,entityMetadataId:Pp(t),appActions:Dp(t).map(r=>r.row)}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t,r){let n=new Set(r?Dp(r).map(l=>l.appactionid):[]),i=Dp(t),a=new Set(i.map(l=>l.appactionid)),o=i.map(l=>{let u=l.exists||n.has(l.appactionid);return{appactionid:l.appactionid,exists:u,etag:l.etag,body:u?U$(l.row):G2(l.row)}}),s=[...n].filter(l=>!a.has(l));return{entityLogicalName:t.entityLogicalName,entityMetadataId:Pp(t),rows:o,...s.length>0?{deletedRowIds:s}:{}}}createDefault(t){var r,n,i,a;let o=(n=(r=t.entityLogicalName)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"";return{id:(i=t.id)!==null&&i!==void 0?i:o,entityLogicalName:o,commandBars:(a=t.commandBars)!==null&&a!==void 0?a:[]}}assignMissingIds(t){return(0,F2.assignMissingIds)(t)}validate(t){let r=[];return(0,Et.childObjects)(t,"commandBars","","commandBar",r).forEach(({node:i,index:a})=>{let o=`/commandBars/${a}`;(0,Et.optionalEnum)(i,"location",["MainTab","ContextualTab","HomeTab"],o,"bar-location-invalid",r),(0,Et.childObjects)(i,"groups",o,"group",r).forEach(({node:l,index:u})=>{let c=`${o}/groups/${u}`;(0,Et.optionalGuidId)(l,"id",c,"group-id-invalid",r),L2((0,Et.childObjects)(l,"controls",c,"control",r),`${c}/controls`,r)})}),r}};Si.CommandAdapter=sl;function L2(e,t,r){e.forEach(({node:n,index:i})=>{let a=`${t}/${i}`;(0,Et.optionalGuidId)(n,"id",a,"control-id-invalid",r),(0,Et.optionalEnum)(n,"type",["Button","FlyoutAnchor","SplitButton"],a,"control-type-invalid",r);let o=n.location;o!==void 0&&(typeof o!="number"||!Number.isInteger(o)||o<0||o>6)&&r.push((0,Et.issue)(`${a}/location`,"control-location-invalid",`location must be an integer 0-6 when present, got ${JSON.stringify(o)}`)),n.action!==void 0&&n.action!==null&&((0,Et.isJsonObject)(n.action)?(0,Et.optionalEnum)(n.action,"type",["javascript"],`${a}/action`,"action-type-invalid",r):r.push((0,Et.issue)(`${a}/action`,"control-action-must-be-object",`a control action must be a JSON object when present, got ${typeof n.action}`)));let s=(0,Et.childObjects)(n,"children",a,"control",r);s.length>0&&L2(s,`${a}/children`,r)})}function M2(e){return{a:Object.entries(e)}}function w$(e){return Object.fromEntries(e.a)}function _p(e,t){if(e){for(let[r,n]of e.a)if(r===t)return n}}function Pp(e){let t=_p(e.bag,x2);return typeof t=="string"?t:""}function N$(e,t,r,n){var i,a;let o=[],s=[];for(let l of ul(e))l.type===Oe.ButtonType.Group?o.push({id:B2(l.name,n),title:typeof l.grouptitle=="string"?l.grouptitle:"",controls:ul((a=t.get((i=l.appactionid)!==null&&i!==void 0?i:""))!==null&&a!==void 0?a:[]).map(u=>ll(u,t,r,n)),bag:M2(l)}):s.push(ll(l,t,r,n));return s.length>0&&o.unshift({id:(0,F2.newId)(),title:"",controls:s}),o}function ll(e,t,r,n){var i,a,o,s;let l=B2(e.name,n),u={id:l,type:I$(e.type),label:typeof e.buttonlabeltext=="string"?e.buttonlabeltext:"",command:typeof e.appactionid=="string"?e.appactionid:l,bag:M2(e)},c=U2(e);c&&(u.icon=c);let d=S$(e);d&&(u.action=d),typeof e.hidden=="boolean"&&(u.hidden=e.hidden),typeof e.isdisabled=="boolean"&&(u.disabled=e.isdisabled),typeof e.location=="number"&&e.location!==r&&(u.location=e.location);let f=t.get((i=e.appactionid)!==null&&i!==void 0?i:"");if(f&&f.length>0){let h=[];for(let b of ul(f))if(b.type===Oe.ButtonType.Group){u.flyoutGroupId=(a=b.appactionid)!==null&&a!==void 0?a:void 0;for(let w of ul((s=t.get((o=b.appactionid)!==null&&o!==void 0?o:""))!==null&&s!==void 0?s:[]))h.push(ll(w,t,r,n))}else h.push(ll(b,t,r,n));u.children=h}return u}function U2(e){var t;if(!((t=e.IconWebResourceId)===null||t===void 0)&&t.name)return e.IconWebResourceId.name;if(e.fonticon)return e.fonticon.startsWith(Ep)?e.fonticon.slice(Ep.length)+Ip:e.fonticon}function S$(e){var t;let r=e.onclickeventjavascriptfunctionname;if(typeof r!="string"||!r)return;let n=e.OnClickEventJavaScriptWebResourceId,i=e._onclickeventjavascriptwebresourceid_value,a={type:"javascript",webResourceId:(t=typeof i=="string"?i:n?.webresourceid)!==null&&t!==void 0?t:"",functionName:r};n?.name&&(a.libraryName=n.name);let o=e.onclickeventjavascriptparameters;return typeof o=="string"&&o&&(a.parameters=o),a}function R2(e){return typeof e.sequence=="number"?e.sequence:typeof e.buttonsequencepriority=="number"?e.buttonsequencepriority:0}function ul(e){return[...e].sort((t,r)=>R2(t)-R2(r))}function D$(e){let t={MainTab:0,ContextualTab:1,HomeTab:2};return[...e].sort((r,n)=>{var i,a;return((i=t[r.location])!==null&&i!==void 0?i:9)-((a=t[n.location])!==null&&a!==void 0?a:9)})}function B2(e,t){if(!e)return"";if(e.indexOf("{!EntityLogicalName}")>=0)return e.replace("{!EntityLogicalName}",t);let r=e.split("!");return r.length===2?r[1]:e}function E$(e){switch(e){case Oe.Location.Form:case Oe.Location.QuickForm:return"MainTab";case Oe.Location.HomePageGrid:case Oe.Location.Dashboard:return"HomeTab";default:return"ContextualTab"}}function k2(e){switch(e){case"MainTab":return Oe.Location.Form;case"HomeTab":return Oe.Location.HomePageGrid;default:return Oe.Location.SubGridStandard}}function I$(e){switch(e){case Oe.ButtonType.Dropdown:return"FlyoutAnchor";case Oe.ButtonType.Split:return"SplitButton";default:return"Button"}}function _$(e){switch(e){case"FlyoutAnchor":return Oe.ButtonType.Dropdown;case"SplitButton":return Oe.ButtonType.Split;default:return Oe.ButtonType.Standard}}function P$(e){var t;return e.bag&&e.bag.a.length>0?!0:((t=e.title)!==null&&t!==void 0?t:"").length>0}function Dp(e){var t,r,n;let i=[],a=Pp(e);for(let o of(t=e.commandBars)!==null&&t!==void 0?t:[]){let s=k2(o.location);for(let l of(r=o.groups)!==null&&r!==void 0?r:[]){let u;if(P$(l)){let c=T$(l,s,void 0,e,a);i.push(c),u=c.appactionid}for(let c of(n=l.controls)!==null&&n!==void 0?n:[])q2(c,s,u,e,a,i)}}return i}function q2(e,t,r,n,i,a){var o;let s=O$(e,t,r,n,i);a.push(s);let l=(o=e.children)!==null&&o!==void 0?o:[];if(l.length===0)return;let u=e.flyoutGroupId||M$(s.appactionid);a.push(R$(u,t,s.appactionid,n,i));for(let c of l)q2(c,t,u,n,i,a)}function O$(e,t,r,n,i){let a=$2(e,t,r,n,i),o=a.row,s=U2(o);return e.location!==void 0&&(o.location=e.location),o.type=_$(e.type),o.buttonlabeltext=e.label,F$(o,e.icon,s),x$(o,e.action),e.hidden!==void 0&&(o.hidden=e.hidden),e.disabled!==void 0&&(o.isdisabled=e.disabled),{...a,row:o}}function T$(e,t,r,n,i){let a=$2(e,t,r,n,i);return a.row.type=Oe.ButtonType.Group,a.row.grouptitle=e.title,a}function R$(e,t,r,n,i){let a=V2(e,t,n,i);return a["[email protected]"]=`/appactions(${(0,Ka.normalizeGuid)(r,"Command flyout group id")})`,a.type=Oe.ButtonType.Group,a.grouptitle===void 0&&(a.grouptitle=""),a.isgrouptitlehidden=!0,{appactionid:e,exists:!1,etag:null,row:a}}function $2(e,t,r,n,i){let a,o,s,l;if(e.bag&&e.bag.a.length>0){a=w$(e.bag),o=!0;let u=_p(e.bag,"@odata.etag");s=typeof u=="string"?u:null;let c=_p(e.bag,"appactionid");l=typeof c=="string"&&c?c:e.id}else l=e.id,a=V2(l,t,n,i),o=!1,s=null;return r&&(a["[email protected]"]=`/appactions(${(0,Ka.normalizeGuid)(r,"Command parent appaction id")})`),{appactionid:l,exists:o,etag:s,row:a}}function V2(e,t,r,n){let i={appactionid:e,name:`${e}!${e.replace(/-/g,"").slice(0,32)}`,uniquename:"",location:t,context:Oe.Context.Entity,contextvalue:r.entityLogicalName,scope:Oe.Scope.Entity};return n&&(i["[email protected]"]=`/entities(${(0,Ka.normalizeGuid)(n,"Command context entity metadata id")})`),i}function F$(e,t,r){if(t===r){let n=e._iconwebresourceid_value;typeof n=="string"&&n&&!e.fonticon&&(e["[email protected]"]=`/webresourceset(${(0,Ka.normalizeGuid)(n,"Command icon web resource id")})`);return}if(t===void 0){e.fonticon="",e.IconWebResourceId=null;return}e.fonticon=t.toLowerCase().endsWith(Ip)?Ep+t.slice(0,t.length-Ip.length):t,e.IconWebResourceId=null}function x$(e,t){if(!(!t||t.type!=="javascript")){if(e.onclickeventtype=C$,t.webResourceId){let r=(0,Ka.normalizeGuid)(t.webResourceId,"Command action web resource id");e["[email protected]"]=`/webresourceset(${r})`}e.onclickeventjavascriptfunctionname=t.functionName,t.parameters!==void 0&&(e.onclickeventjavascriptparameters=t.parameters)}}function L$(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}function M$(e){let t="";for(let r=0;r<4;r+=1)t+=L$(`${r}:flyout-group:${e}`).toString(16).padStart(8,"0");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function G2(e){let t={...e};for(let r of A$)delete t[r];return t}function U$(e){let t=G2(e);for(let r of Oe.CannotUpdateAppActionColumns)delete t[r];return t}function B$(){return{adapter:new sl,api:y$.commandApi}}Si.commandRegistration=B$});var W2=m(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.chartApi=void 0;var Ar=Ve(),Ya=ce(),k$="savedqueryvisualizationid,name,description,primaryentitytypecode,datadescription,presentationdescription,charttype,type,isdefault",q$="savedqueryvisualizationid,name,primaryentitytypecode,charttype,isdefault";cl.chartApi={async get(e,t){let n=`/savedqueryvisualizations(${(0,Ya.normalizeGuid)(t,"id")})/Microsoft.Dynamics.CRM.RetrieveUnpublished()`+(0,Ya.odataQuery)([["$select",k$]]),i=(0,Ar.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,Ar.readEtag)(i)}},async list(e,t){var r;let n=`/savedqueryvisualizations${(0,Ya.odataQuery)([["$select",q$],["$filter",t?.entityLogicalName?`primaryentitytypecode eq '${(0,Ya.odataLiteral)(t.entityLogicalName)}'`:void 0]])}`,a=(0,Ar.ensureSuccess)(await e.get(n),e.apiUrl(n)).body;return((r=a?.value)!==null&&r!==void 0?r:[]).map(s=>{var l,u;return{type:"chart",id:(l=s.savedqueryvisualizationid)!==null&&l!==void 0?l:"",name:(u=s.name)!==null&&u!==void 0?u:"",entityLogicalName:s.primaryentitytypecode,isDirty:!1}})},async create(e,t){let r=t,n="/savedqueryvisualizations",i=(0,Ar.ensureSuccess)(await e.post(n,{name:r.name,description:r.description,datadescription:r.datadescription,presentationdescription:r.presentationdescription,primaryentitytypecode:r.primaryentitytypecode,charttype:r.charttype,isdefault:r.isdefault}),e.apiUrl(n));return{id:(0,Ar.requireCreatedId)(i,"savedqueryvisualizationid","chart"),etag:(0,Ar.readEtag)(i)}},async update(e,t,r,n){let i=r,a=(0,Ya.normalizeGuid)(t,"id"),o=`/savedqueryvisualizations(${a})`,s=n?{"If-Match":n}:void 0,l=(0,Ar.ensureSuccess)(await e.patch(o,{name:i.name,description:i.description,datadescription:i.datadescription,presentationdescription:i.presentationdescription},s?{headers:s}:void 0),e.apiUrl(o));return{id:a,etag:(0,Ar.readEtag)(l)}},delete(e,t){return(0,Ar.deleteRecord)(e,"savedqueryvisualizations",t)}}});var oS=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.chartRegistration=Di.ChartAdapter=void 0;var Op=pn(),j2=$r(),wr=ja(),$$=W2(),Tp=fn(),V$=Tt(),G$=["Column","StackedColumn","StackedColumn100","Bar","StackedBar","StackedBar100","Area","StackedArea","StackedArea100","Line","Pie","Doughnut","Funnel","Tag"],z$=new Map(G$.map(e=>[e.toLowerCase(),e]));function X2(e){var t;return e&&(t=z$.get(e.toLowerCase()))!==null&&t!==void 0?t:"Column"}function W$(){return'<Chart Palette="BrightPastel"><Series><Series ChartType="Column" ChartArea="Default" /></Series><ChartAreas><ChartArea Name="Default" /></ChartAreas><Legends><Legend Name="Default" /></Legends></Chart>'}function j$(e){var t,r;let n=e.entityLogicalName,i=e.series.map((u,c)=>({alias:`agg_${c}`,series:u})),a=e.categories.map((u,c)=>({alias:`grp_${c}`,category:u})),o=i.map(u=>`<attribute alias="${u.alias}" name="${Za(u.series.attribute)}" aggregate="${Za(u.series.aggregate)}" />`).join("")+a.map(u=>`<attribute alias="${u.alias}" name="${Za(u.category.attribute)}" groupby="true"${u.category.dateGrouping?` dategrouping="${Za(u.category.dateGrouping)}"`:""} />`).join(""),s=i.map(u=>`<measure alias="${u.alias}" />`).join(""),l=(r=(t=a[0])===null||t===void 0?void 0:t.alias)!==null&&r!==void 0?r:"";return`<datadefinition><fetchcollection><fetch mapping="logical" aggregate="true"><entity name="${Za(n)}">${o}</entity></fetch></fetchcollection><categorycollection><category alias="${l}"><measurecollection>${s}</measurecollection></category></categorycollection></datadefinition>`}var dl=class{toArtifact(t){var r,n,i,a,o,s,l;(0,Tp.installDomShim)();let u=(r=t.datadescription)!==null&&r!==void 0?r:"",c=(n=t.presentationdescription)!==null&&n!==void 0?n:"",d=(0,wr.parseXmlRoot)(u,"<datadefinition/>"),f=(0,wr.parseXmlRoot)(c,"<Chart/>");return{id:(i=t.savedqueryvisualizationid)!==null&&i!==void 0?i:"",name:(a=t.name)!==null&&a!==void 0?a:"",description:(o=t.description)!==null&&o!==void 0?o:"",entityLogicalName:(s=t.primaryentitytypecode)!==null&&s!==void 0?s:"",chartType:K2(f),isDefault:(l=t.isdefault)!==null&&l!==void 0?l:!1,series:eS(d),categories:tS(d),presentation:Y2(f),dataBag:u?(0,wr.projectElementBag)(d):void 0,presentationBag:c?(0,wr.projectElementBag)(f):void 0,rowBag:H$(t.charttype,t.type)}}fromArtifact(t){(0,Tp.installDomShim)();let{datadescription:r,presentationdescription:n}=J$(t);return{savedqueryvisualizationid:t.id,name:t.name,description:t.description,primaryentitytypecode:t.entityLogicalName,datadescription:r,presentationdescription:n,charttype:H2(t.rowBag,"charttype"),type:H2(t.rowBag,"type"),isdefault:t.isDefault}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t){var r,n,i,a,o,s,l;let u=this.fromArtifact(t);return{name:(r=u.name)!==null&&r!==void 0?r:"",description:(n=u.description)!==null&&n!==void 0?n:"",datadescription:(i=u.datadescription)!==null&&i!==void 0?i:"",presentationdescription:(a=u.presentationdescription)!==null&&a!==void 0?a:"",primaryentitytypecode:(o=u.primaryentitytypecode)!==null&&o!==void 0?o:"",charttype:(s=u.charttype)!==null&&s!==void 0?s:0,isdefault:(l=u.isdefault)!==null&&l!==void 0?l:!1}}createDefault(t){var r,n,i,a,o,s,l;(0,Tp.installDomShim)();let u=(r=t.entityLogicalName)!==null&&r!==void 0?r:"";return{id:(n=t.id)!==null&&n!==void 0?n:(0,V$.newId)(),name:(i=t.name)!==null&&i!==void 0?i:"New Chart",description:(a=t.description)!==null&&a!==void 0?a:"",entityLogicalName:u,chartType:(o=t.chartType)!==null&&o!==void 0?o:"Column",isDefault:(s=t.isDefault)!==null&&s!==void 0?s:!1,series:t.series&&t.series.length>0?t.series:[{attribute:"createdon",aggregate:"count"}],categories:t.categories&&t.categories.length>0?t.categories:[{attribute:"createdon",dateGrouping:"month"}],presentation:(l=t.presentation)!==null&&l!==void 0?l:{palette:"BrightPastel",showLegend:!0}}}assignMissingIds(t){return t}validate(t){let r=[],n=t;return(0,j2.childObjects)(n,"series","","series",r),(0,j2.childObjects)(n,"categories","","category",r),r}};Di.ChartAdapter=dl;function H$(e,t){let r=[];return e!==void 0&&r.push(["charttype",String(e)]),t!==void 0&&r.push(["type",String(t)]),r.length>0?{a:r,c:[]}:void 0}function H2(e,t){if(!e)return;let r=e.a.find(([i])=>i===t);if(!r)return;let n=parseInt(r[1],10);return Number.isNaN(n)?void 0:n}function K2(e){let t=e.getElementsByTagName("Series");for(let r=0;r<t.length;r+=1)if(t[r].getAttribute("ChartType"))return X2(t[r].getAttribute("ChartType"));return"Column"}function Y2(e){var t;let r={showLegend:e.getElementsByTagName("Legend").length>0},n=e.getAttribute("Palette");n&&(r.palette=n);let i=e.getElementsByTagName("Title")[0],a=((t=i?.textContent)!==null&&t!==void 0?t:"").trim();return a&&(r.title=a),r}function pl(e){return e.getElementsByTagName("fetch")[0]}function Z2(e){var t;let r=new Map;if(!e)return r;let n=e.getElementsByTagName("link-entity");for(let i=0;i<n.length;i+=1){let a=n[i],o=a.getAttribute("name");if(!o)continue;let s=a.getElementsByTagName("attribute");for(let l=0;l<s.length;l+=1){let u=s[l],c=(t=u.getAttribute("alias"))!==null&&t!==void 0?t:u.getAttribute("name");c&&r.set(c,o)}}return r}function eS(e){let t=pl(e);if(!t)return[];let r=Z2(t),n=t.getElementsByTagName("attribute"),i=[];for(let a=0;a<n.length;a+=1){let o=n[a],s=o.getAttribute("aggregate");if(!s)continue;let l=o.getAttribute("name");if(!l)continue;let u={attribute:l,aggregate:s},c=o.getAttribute("charttype");c&&(u.seriesType=X2(c));let d=o.getAttribute("alias");d&&(u.alias=d);let f=d??l,h=r.get(f);h&&(u.relatedEntity=h),i.push(u)}return i}function tS(e){var t;let r=pl(e);if(!r)return[];let n=Z2(r),i=r.getElementsByTagName("attribute"),a=[];for(let o=0;o<i.length;o+=1){let s=i[o];if(((t=s.getAttribute("groupby"))!==null&&t!==void 0?t:"").toLowerCase()!=="true")continue;let l=s.getAttribute("name");if(!l)continue;let u={attribute:l},c=s.getAttribute("dategrouping");c&&(u.dateGrouping=c);let d=s.getAttribute("alias");d&&(u.alias=d);let f=d??l,h=n.get(f);h&&(u.relatedEntity=h),a.push(u)}return a}function J$(e){if(!J2(e.dataBag)||!J2(e.presentationBag))return{datadescription:j$(e),presentationdescription:m4(e)};let t=new DOMParser().parseFromString("<root/>","text/xml"),r=Q2(e.dataBag,"datadefinition",t),n=Q2(e.presentationBag,"Chart",t);return Rp(e.series,eS(r))||(X$(t,r,e.series),Q$(t,n,e.series.length,e.chartType)),Rp(e.categories,tS(r))||K$(t,r,e.categories),e.chartType!==K2(n)&&iS(n,e.chartType),Rp(e.presentation,Y2(n))||aS(n,e.presentation),{datadescription:(0,wr.serializeNode)(r),presentationdescription:(0,wr.serializeNode)(n)}}function J2(e){return!!e&&(e.c.length>0||e.a.length>0)}function Q$(e,t,r,n){let i,a=t.childNodes;for(let l=0;l<a.length;l+=1)if(a[l].nodeType===1&&a[l].tagName==="Series"){i=a[l];break}i||(i=e.createElement("Series"),t.insertBefore(i,t.firstChild));let o=[],s=i.childNodes;for(let l=0;l<s.length;l+=1)s[l].nodeType===1&&s[l].tagName==="Series"&&o.push(s[l]);for(let l=o.length;l<r;l+=1){let u=e.createElement("Series");u.setAttribute("ChartType",n),i.appendChild(u)}for(let l=r;l<o.length;l+=1)i.removeChild(o[l])}function Q2(e,t,r){let n={n:t,a:(0,Op.mergeAttrs)(e.a,[]),c:(0,Op.spliceChildren)(e.c,[])};return(0,Op.rebuildRaw)(n,(0,wr.domEngine)(r),null)}function X$(e,t,r){let n=pl(t),i=n?.getElementsByTagName("entity")[0];!n||!i||rS(e,t,i,i4(n),r,o4,{aliasPrefix:"aggregate_column",addRef:e4,removeRef:n4})}function K$(e,t,r){let n=pl(t),i=n?.getElementsByTagName("entity")[0];!n||!i||rS(e,t,i,a4(n),r,s4,{aliasPrefix:"groupby_column",addRef:t4,removeRef:r4})}function rS(e,t,r,n,i,a,o){let s=new Map;for(let f of n){let h=f.getAttribute("alias");h&&s.set(h,f)}let l=new Set,u=[];for(let f of i){let h=f.alias?s.get(f.alias):void 0;h&&!l.has(h)?(a(h,f),l.add(h)):u.push(f)}let c=n.filter(f=>!l.has(f)),d=0;for(let f of u)if(d<c.length){let h=c[d];a(h,f),l.add(h),d+=1}else{let h=e.createElement("attribute"),b=f.alias||Z$(t,o.aliasPrefix);h.setAttribute("alias",b),a(h,f),l4(e,r,h,f.relatedEntity),o.addRef(e,t,b)}for(let f of n)if(!l.has(f)){let h=f.getAttribute("alias");h&&o.removeRef(t,h),c4(f)}}function Y$(e){let t=new Set;for(let r of["attribute","measure","category"]){let n=e.getElementsByTagName(r);for(let i=0;i<n.length;i+=1){let a=n[i].getAttribute("alias");a&&t.add(a)}}return t}function Z$(e,t){let r=Y$(e);if(!r.has(t))return t;for(let n=2;;n+=1){let i=`${t}_${n}`;if(!r.has(i))return i}}function nS(e,t){let r=t.getElementsByTagName("categorycollection")[0];if(r)return r;let n=e.createElement("categorycollection");return t.appendChild(n),n}function e4(e,t,r){let n=nS(e,t),i=n.getElementsByTagName("category")[0];i||(i=e.createElement("category"),n.appendChild(i));let a=e.createElement("measurecollection"),o=e.createElement("measure");o.setAttribute("alias",r),a.appendChild(o),i.appendChild(a)}function t4(e,t,r){let n=nS(e,t),i=e.createElement("category");i.setAttribute("alias",r),n.appendChild(i)}function r4(e,t){let r=e.getElementsByTagName("category");for(let n=0;n<r.length;n+=1)r[n].getAttribute("alias")===t&&r[n].removeAttribute("alias")}function n4(e,t){var r;let n=e.getElementsByTagName("measure"),i=[];for(let a=0;a<n.length;a+=1)n[a].getAttribute("alias")===t&&i.push(n[a]);for(let a of i){let o=a.parentNode;o?.removeChild(a),o&&o.tagName==="measurecollection"&&!p4(o)&&((r=o.parentNode)===null||r===void 0||r.removeChild(o))}}function i4(e){let t=[],r=e.getElementsByTagName("attribute");for(let n=0;n<r.length;n+=1)r[n].getAttribute("aggregate")&&t.push(r[n]);return t}function a4(e){var t;let r=[],n=e.getElementsByTagName("attribute");for(let i=0;i<n.length;i+=1)((t=n[i].getAttribute("groupby"))!==null&&t!==void 0?t:"").toLowerCase()==="true"&&r.push(n[i]);return r}function o4(e,t){e.setAttribute("name",t.attribute),e.setAttribute("aggregate",t.aggregate),t.seriesType&&e.setAttribute("charttype",t.seriesType)}function s4(e,t){e.setAttribute("name",t.attribute),e.setAttribute("groupby","true"),t.dateGrouping?e.setAttribute("dategrouping",t.dateGrouping):e.getAttribute("dategrouping")!==null&&e.removeAttribute("dategrouping")}function l4(e,t,r,n){n?u4(e,t,n).appendChild(r):t.appendChild(r)}function u4(e,t,r){let n=t.getElementsByTagName("link-entity");for(let a=0;a<n.length;a+=1)if(n[a].getAttribute("name")===r)return n[a];let i=e.createElement("link-entity");return i.setAttribute("name",r),t.appendChild(i),i}function c4(e){let t=e.parentNode;if(t&&(t.removeChild(e),t.tagName==="link-entity"&&!d4(t))){let r=t.parentNode;r&&r.removeChild(t)}}function d4(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r];if(n.nodeType===1){let i=n.tagName;if(i==="attribute"||i==="link-entity")return!0}}return!1}function p4(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1)if(t[r].nodeType===1)return!0;return!1}function iS(e,t){let r=e.getElementsByTagName("Series"),n=!1;for(let i=0;i<r.length;i+=1)r[i].getAttribute("ChartType")&&(r[i].setAttribute("ChartType",t),n=!0);if(!n){for(let i=0;i<r.length;i+=1)if(!f4(r[i])){r[i].setAttribute("ChartType",t);return}}}function f4(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r];if(n.nodeType===1&&n.tagName==="Series")return!0}return!1}function aS(e,t){var r;let n=e.ownerDocument;if(t.palette!==void 0&&e.setAttribute("Palette",t.palette),t.showLegend!==void 0){let i=[],a=e.getElementsByTagName("Legends");for(let o=0;o<a.length;o+=1)i.push(a[o]);if(t.showLegend&&i.length===0){let o=n.createElement("Legends"),s=n.createElement("Legend");s.setAttribute("Name","Default"),o.appendChild(s),e.appendChild(o)}else if(!t.showLegend)for(let o of i)(r=o.parentNode)===null||r===void 0||r.removeChild(o)}if(t.title!==void 0){let i=e.getElementsByTagName("Title")[0];i&&(i.textContent=t.title)}}function m4(e){let t=(0,wr.parseXmlRoot)(W$(),"<Chart/>");return iS(t,e.chartType),aS(t,e.presentation),(0,wr.serializeNode)(t)}function Rp(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Za(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function h4(){return{adapter:new dl,api:$$.chartApi}}Di.chartRegistration=h4});var sS=m(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.dashboardApi=void 0;var Nr=Ve(),eo=ce(),g4="formid,name,description,formxml,type,objecttypecode,istabletenabled,iscustomizable,componentstate,versionnumber",v4="formid,name,type,objecttypecode",b4=0,y4=10;fl.dashboardApi={async get(e,t){let n=`/systemforms(${(0,eo.normalizeGuid)(t,"id")})${(0,eo.odataQuery)([["$select",g4]])}`,i=(0,Nr.ensureSuccess)(await e.get(n),e.apiUrl(n));return{raw:i.body,etag:(0,Nr.readEtag)(i)}},async list(e,t){var r;let n=[`(type eq ${b4} or type eq ${y4})`];t?.entityLogicalName&&n.push(`objecttypecode eq '${(0,eo.odataLiteral)(t.entityLogicalName)}'`);let i=`/systemforms${(0,eo.odataQuery)([["$select",v4],["$filter",n.join(" and ")]])}`,o=(0,Nr.ensureSuccess)(await e.get(i),e.apiUrl(i)).body;return((r=o?.value)!==null&&r!==void 0?r:[]).map(l=>{var u,c;return{type:"dashboard",id:(u=l.formid)!==null&&u!==void 0?u:"",name:(c=l.name)!==null&&c!==void 0?c:"",entityLogicalName:l.objecttypecode,isDirty:!1}})},async create(e,t){let r=t,n="/systemforms",i={name:r.name,description:r.description,formxml:r.formxml,istabletenabled:r.istabletenabled,type:r.type};r.objecttypecode&&(i.objecttypecode=r.objecttypecode);let a=(0,Nr.ensureSuccess)(await e.post(n,i),e.apiUrl(n));return{id:(0,Nr.requireCreatedId)(a,"formid","dashboard"),etag:(0,Nr.readEtag)(a)}},async update(e,t,r,n){let i=r,a=(0,eo.normalizeGuid)(t,"id"),o=`/systemforms(${a})`,s=n?{"If-Match":n}:void 0,l=(0,Nr.ensureSuccess)(await e.patch(o,{name:i.name,description:i.description,formxml:i.formxml,istabletenabled:i.istabletenabled},s?{headers:s}:void 0),e.apiUrl(o));return{id:a,etag:(0,Nr.readEtag)(l)}},delete(e,t){return(0,Nr.deleteRecord)(e,"systemforms",t)}}});var bS=m(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.dashboardRegistration=er.TILE_CLASS_ID=er.DashboardAdapter=void 0;var ro=pn(),It=ja(),to=$r(),C4=sS(),Fp=fn(),Cn=Tt(),fS=ce(),hl=1033,lS="0",xp="10",A4=new Map([["{E7A81278-8635-4D9E-8D4D-59480B391C5B}","chart"],["{FD2A7985-3187-444E-908D-6624B21F69C0}","iframe"],["{9FDF5F91-88B1-47F4-AD53-C11EFC01A01D}","webresource"],["{EE9078C8-6946-4E2C-B8F8-35E65F4BE6A8}","stream"],["{06375649-C143-495E-A496-C962E5B4488E}","timeline"],["{8C54228C-1B25-4909-A12A-F2B968BB0D62}","powerbi"],["{F9A8A302-114E-466A-B582-6771B2AE0D92}","assistant"]]),w4="{3FF9A528-DD50-4ACA-8F10-2E5ED73513AD}",gl=class{toArtifact(t){var r,n,i,a;(0,Fp.installDomShim)();let o=(r=t.formxml)!==null&&r!==void 0?r:"",s=(0,It.parseXmlRoot)(o,"<form/>");return{id:(n=t.formid)!==null&&n!==void 0?n:"",name:(i=t.name)!==null&&i!==void 0?i:"",description:(a=t.description)!==null&&a!==void 0?a:"",dashboardType:N4(t.type),entityLogicalName:t.objecttypecode?t.objecttypecode:null,enabledForMobile:!!t.istabletenabled,layoutType:S4(s),components:uS(s),bag:(0,It.projectElementBag)(s)}}fromArtifact(t){var r;return(0,Fp.installDomShim)(),{formid:t.id,name:t.name,description:t.description,type:t.dashboardType==="Interactive"?xp:lS,objecttypecode:(r=t.entityLogicalName)!==null&&r!==void 0?r:"",istabletenabled:t.enabledForMobile,formxml:cS(t)}}fromApiResponse(t){return this.toArtifact(t??{})}toApiPayload(t){return{name:t.name,description:t.description,formxml:cS(t),istabletenabled:t.enabledForMobile,type:t.dashboardType==="Interactive"?xp:lS,objecttypecode:t.entityLogicalName}}createDefault(t){var r,n,i,a,o,s,l,u;(0,Fp.installDomShim)();let c=(0,It.parseXmlRoot)(U4(),"<form/>");return{id:(r=t.id)!==null&&r!==void 0?r:(0,Cn.newId)(),name:(n=t.name)!==null&&n!==void 0?n:"New Dashboard",description:(i=t.description)!==null&&i!==void 0?i:"",dashboardType:(a=t.dashboardType)!==null&&a!==void 0?a:"Standard",entityLogicalName:(o=t.entityLogicalName)!==null&&o!==void 0?o:null,enabledForMobile:(s=t.enabledForMobile)!==null&&s!==void 0?s:!1,layoutType:(l=t.layoutType)!==null&&l!==void 0?l:0,components:(u=t.components)!==null&&u!==void 0?u:uS(c),bag:(0,It.projectElementBag)(c)}}assignMissingIds(t){if(t&&typeof t=="object"&&!Array.isArray(t)&&"position"in t&&!("components"in t)){let r=t;(typeof r.id!="string"||r.id.length===0)&&(r.id=(0,Cn.newId)())}return t}validate(t){let r=[],n=(0,to.childObjects)(t,"components","","component",r),i=new Set;return n.forEach(({node:a,index:o})=>{let s=`/components/${o}`;for(let l of["position","parameters"]){let u=a[l];u!==void 0&&!(0,to.isJsonObject)(u)&&r.push((0,to.issue)(`${s}/${l}`,`component-${l}-must-be-object`,`a component ${l} must be a JSON object when present, got ${u===null?"null":typeof u}`))}if((0,to.isJsonObject)(a.position)){let l=no(a.position);i.has(l)?r.push((0,to.issue)(`${s}/position`,"component-position-collision",`two components occupy the same dashboard position (${l}); move one to a free cell`)):i.add(l)}}),r}};er.DashboardAdapter=gl;function N4(e){return String(e??"")===xp?"Interactive":"Standard"}function S4(e){var t;let r=(t=e?.getAttribute("formLayout"))!==null&&t!==void 0?t:e?.getAttribute("layoutType"),n=parseInt(r??"",10);return Number.isNaN(n)?0:n}function V(e,t){let r=[],n=e.childNodes;for(let i=0;i<n.length;i+=1){let a=n[i];a.nodeType===1&&a.tagName.toLowerCase()===t&&r.push(a)}return r}function uS(e){let t=[];return V(e,"tabs").flatMap(n=>V(n,"tab")).forEach((n,i)=>{V(n,"columns").flatMap(o=>V(o,"column")).forEach((o,s)=>{V(o,"sections").flatMap(u=>V(u,"section")).forEach((u,c)=>{D4(u,{tabIndex:i,columnIndex:s,sectionIndex:c},t)})})}),t}function D4(e,t,r){V(e,"rows").flatMap(i=>V(i,"row")).forEach((i,a)=>{V(i,"cell").forEach((o,s)=>{let l=E4(o,{...t,rowIndex:a,cellIndex:s});l&&r.push(l)})})}function E4(e,t){var r,n,i;let a=gS((r=e.getAttribute("id"))!==null&&r!==void 0?r:"");if(a.toLowerCase().startsWith("spacer"))return null;let o=V(e,"control")[0];if(!o)return null;let s=(n=o.getAttribute("classid"))!==null&&n!==void 0?n:"",l=P4(o),u=O4(s,l,o),c=I4(o);return{id:(i=o.getAttribute("id"))!==null&&i!==void 0?i:a,type:u,name:hS(e),classId:s,position:t,colspan:Lp(e,"colspan",1),rowspan:Lp(e,"rowspan",1),parameters:l,bag:(0,It.projectElementBag)(e),...c?{icProperties:c}:{}}}function mS(e){let t=e.childNodes;for(let r=0;r<t.length;r+=1){let n=t[r];if(n.nodeType===1&&n.tagName.toLowerCase()==="icproperties")return n}}function I4(e){let t=mS(e);return t?(0,It.serializeNode)(t):void 0}function _4(e,t,r){let n=mS(t);if(!r){n&&t.removeChild(n);return}let i=new DOMParser().parseFromString(r,"text/xml").documentElement,a=(0,ro.rebuildRaw)((0,ro.rawFromNode)((0,It.nodeLikeFromDom)(i)),(0,It.domEngine)(e),null);n&&(0,It.serializeNode)(n)===(0,It.serializeNode)(a)||(n?t.replaceChild(a,n):t.appendChild(a))}function hS(e){var t,r;let n=V(e,"labels")[0];if(!n)return"";let i=V(n,"label"),a=(t=i.find(o=>o.getAttribute("languagecode")===String(hl)))!==null&&t!==void 0?t:i[0];return(r=a?.getAttribute("description"))!==null&&r!==void 0?r:""}function P4(e){var t;let r={},n=V(e,"parameters")[0];if(!n)return r;let i=n.childNodes;for(let a=0;a<i.length;a+=1){let o=i[a];o.nodeType===1&&(r[o.tagName]=((t=o.textContent)!==null&&t!==void 0?t:"").trim())}return r}function O4(e,t,r){var n;let i=A4.get(e.toUpperCase());return i?i==="chart"?t.ChartGridMode==="Chart"?"chart":"list":i==="assistant"&&((n=r.getAttribute("uniqueid"))!==null&&n!==void 0?n:"").toUpperCase()===w4?"assistant":i:"unknown"}function Lp(e,t,r){var n;let i=parseInt((n=e.getAttribute(t))!==null&&n!==void 0?n:"",10);return Number.isNaN(i)?r:i}function gS(e){return e.replace(/^\{/,"").replace(/\}$/,"")}function T4(e,t){let r={n:"form",a:(0,ro.mergeAttrs)(e.bag.a,[]),c:(0,ro.spliceChildren)(e.bag.c,[])};return(0,ro.rebuildRaw)(r,(0,It.domEngine)(t),null)}function cS(e){let t=new DOMParser().parseFromString("<root/>","text/xml"),r=T4(e,t);return x4(t,r,e.components),R4(t,r,e.components),(0,It.serializeNode)(r)}function R4(e,t,r){let n=vS(t);for(let i of r)n.has(no(i.position))||F4(e,t,i)}function F4(e,t,r){var n,i,a,o;let s=(i=(n=r.position)===null||n===void 0?void 0:n.sectionIndex)!==null&&i!==void 0?i:0,l=B4(t,e,s);for(let $ of V(l,"row"))V($,"cell").some(re=>V(re,"control").length>0)||l.removeChild($);let u=r.classId||er.TILE_CLASS_ID[r.type]||er.TILE_CLASS_ID.iframe,c=r.rowspan&&r.rowspan>0?r.rowspan:4,d=r.bag&&dS(r.bag,"id")?String(dS(r.bag,"id")):ml((0,Cn.newId)()),f=r.id?ml(r.id):ml((0,Cn.newId)()),h=l.parentNode,b=Math.max(1,parseInt(h&&h.getAttribute&&h.getAttribute("columns")||"1",10)||1),w=Math.min(Math.max(1,r.colspan&&r.colspan>0?r.colspan:1),b),N=V(l,"row"),I=N[N.length-1],R=I?V(I,"cell").reduce(($,re)=>$+Lp(re,"colspan",1),0):0;(!I||R+w>b)&&(I=e.createElement("row"),l.appendChild(I));let F=e.createElement("cell");F.setAttribute("id",d),F.setAttribute("colspan",String(w)),F.setAttribute("rowspan",String(c)),F.setAttribute("showlabel","true");let M=e.createElement("labels"),W=e.createElement("label");W.setAttribute("description",(a=r.name)!==null&&a!==void 0?a:""),W.setAttribute("languagecode",String(hl)),M.appendChild(W),F.appendChild(M);let B=e.createElement("control");B.setAttribute("id",f),B.setAttribute("classid",ml(u));let j=e.createElement("parameters"),k=(o=r.parameters)!==null&&o!==void 0?o:{};for(let $ of Object.keys(k)){let re=(0,fS.createSafeXmlElement)(e,$,"dashboard tile parameter");re.textContent=k[$],j.appendChild(re)}B.appendChild(j),F.appendChild(B),I.appendChild(F)}function dS(e,t){if(!e)return;let r=e.a.find(n=>n[0]===t);return r?r[1]:void 0}function x4(e,t,r){var n;let i=vS(t),a=new Set(r.map(o=>no(o.position)));for(let o of r){let s=i.get(no(o.position));if(!s)continue;let l=V(s,"control")[0];l&&(L4(e,s,o.name),M4(e,l,o.parameters),pS(s,"colspan",o.colspan),pS(s,"rowspan",o.rowspan),o.icProperties!==void 0&&_4(e,l,o.icProperties))}for(let[o,s]of i)a.has(o)||(n=s.parentNode)===null||n===void 0||n.removeChild(s)}function vS(e){let t=new Map;return V(e,"tabs").flatMap(n=>V(n,"tab")).forEach((n,i)=>{V(n,"columns").flatMap(o=>V(o,"column")).forEach((o,s)=>{V(o,"sections").flatMap(u=>V(u,"section")).forEach((u,c)=>{V(u,"rows").flatMap(f=>V(f,"row")).forEach((f,h)=>{V(f,"cell").forEach((b,w)=>{var N;gS((N=b.getAttribute("id"))!==null&&N!==void 0?N:"").toLowerCase().startsWith("spacer")||V(b,"control")[0]&&t.set(no({tabIndex:i,columnIndex:s,sectionIndex:c,rowIndex:h,cellIndex:w}),b)})})})})}),t}function no(e){let t=e??{};return`${t.tabIndex}.${t.columnIndex}.${t.sectionIndex}.${t.rowIndex}.${t.cellIndex}`}function L4(e,t,r){if(r===hS(t))return;let n=V(t,"labels")[0];n||(n=e.createElement("labels"),t.appendChild(n));let i=V(n,"label").find(a=>a.getAttribute("languagecode")===String(hl));i||(i=V(n,"label")[0]),i||(i=e.createElement("label"),i.setAttribute("languagecode",String(hl)),n.appendChild(i)),i.setAttribute("description",r)}function M4(e,t,r){var n;if(!r)return;let i=Object.keys(r);if(i.length===0)return;let a=V(t,"parameters")[0];a||(a=e.createElement("parameters"),t.appendChild(a));let o=new Map,s=a.childNodes;for(let l=0;l<s.length;l+=1){let u=s[l];u.nodeType===1&&o.set(u.tagName,u)}for(let l of i){let u=r[l],c=o.get(l);if(c)((n=c.textContent)!==null&&n!==void 0?n:"")!==u&&(c.textContent=u);else{let d=(0,fS.createSafeXmlElement)(e,l,"dashboard component parameter");d.textContent=u,a.appendChild(d)}}}function pS(e,t,r){var n;((n=e.getAttribute(t))!==null&&n!==void 0?n:"")!==String(r)&&e.setAttribute(t,String(r))}function U4(e=2){let t=`{${(0,Cn.newId)()}}`,r=`{${(0,Cn.newId)()}}`,n=`{${(0,Cn.newId)()}}`,i=Math.max(1,Math.floor(e));return`<form><tabs><tab id="${t}" name="General" showlabel="true" expanded="true" verticallayout="true"><columns><column width="100%"><sections><section id="${r}" name="Section 1" showlabel="false" columns="${i}"><rows><row><cell id="${n}" rowspan="12" colspan="${i}" showlabel="true" /></row></rows></section></sections></column></columns></tab></tabs></form>`}er.TILE_CLASS_ID={chart:"E7A81278-8635-4D9E-8D4D-59480B391C5B",list:"E7A81278-8635-4D9E-8D4D-59480B391C5B",iframe:"FD2A7985-3187-444E-908D-6624B21F69C0",webresource:"9FDF5F91-88B1-47F4-AD53-C11EFC01A01D"};function ml(e){return`{${e.replace(/[{}]/g,"")}}`}function B4(e,t,r){var n;let i=V(e,"tabs").flatMap(u=>V(u,"tab"))[0];if(!i)throw new Error("addDashboardTile: dashboard formxml has no <tab>");let a=V(i,"columns").flatMap(u=>V(u,"column"))[0];if(!a)throw new Error("addDashboardTile: dashboard formxml has no <column>");let o=V(a,"sections").flatMap(u=>V(u,"section")),s=(n=o[r])!==null&&n!==void 0?n:o[0];if(!s)throw new Error("addDashboardTile: dashboard formxml has no <section>");let l=V(s,"rows")[0];return l||(l=t.createElement("rows"),s.appendChild(l)),l}function k4(){return{adapter:new gl,api:C4.dashboardApi}}er.dashboardRegistration=k4});var yS=m(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.buildRegistrations=void 0;var q4=mN(),$4=TN(),V4=C2(),G4=I2(),z4=z2(),W4=oS(),j4=bS();function H4(){let e=new Map;return e.set("form",(0,q4.formRegistration)()),e.set("view",(0,$4.viewRegistration)()),e.set("businessRule",(0,V4.businessRuleRegistration)()),e.set("app",(0,G4.appRegistration)()),e.set("command",(0,z4.commandRegistration)()),e.set("chart",(0,W4.chartRegistration)()),e.set("dashboard",(0,j4.dashboardRegistration)()),e}vl.buildRegistrations=H4});var CS=m(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.cloneJson=void 0;function J4(e){return JSON.parse(JSON.stringify(e))}bl.cloneJson=J4});var _S=m(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.removeRowSummary=Ae.configureRowSummary=Ae.buildGptDynamicPrompt=Ae.setAppAiFeatures=Ae.getAiReadiness=Ae.saveSettingValue=Ae.retrieveSetting=Ae.AI_GATE=void 0;var Ut=Ve(),Ue=ce(),AS=Tt(),Sr=be();Ae.AI_GATE={formFill:"FormFillBarUXEnabled",nlSearch:"EnableNLGridSearch",nlChart:"NLChartVisualizationSetting",summaries:"EnableFormInsights",m365:"m365copilotmodelappenabled"};var Q4={formFill:"FormFillBarUXEnabled",nlSearch:"NLGridSearchSetting",nlChart:"NLChartDataVisualizationSetting",m365:"m365copilotmodelappenabled"},yl=1e6;function X4(e,t){let r=()=>{throw new Sr.InvalidArgumentError(`setAppAiFeatures: '${t}' must be a boolean or an integer between 0 and ${yl} (e.g. 0, 1, 2); got '${String(e)}'.`)};if(typeof e=="boolean")return e?"1":"0";if(typeof e=="number")return!Number.isSafeInteger(e)||e<0||e>yl?r():String(e);if(typeof e=="string"){let n=e.trim(),i=n.toLowerCase();if(i==="true")return"1";if(i==="false")return"0";if(/^[0-9]+$/.test(n)){let a=n.replace(/^0+(?=[0-9])/,"");return a.length>String(yl).length||Number(a)>yl?r():a}}return r()}function K4(e){return e!=="0"}async function Y4(e,t){var r,n,i;let a=`/appmodules${(0,Ue.odataQuery)([["$select","appmoduleid"],["$filter",`uniquename eq '${(0,Ue.odataLiteral)(t)}'`]])}`,o=await e.get(a);return o.status>=200&&o.status<300?(i=((n=(r=o.body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0])===null||i===void 0?void 0:i.appmoduleid:void 0}async function Z4(e,t){var r,n;let i=`/appmodules${(0,Ue.odataQuery)([["$select","appmoduleid"],["$filter",`uniquename eq '${(0,Ue.odataLiteral)(t)}'`]])}`,a;try{a=await e.get(i)}catch(l){throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup failed (${l.message}). Retry, or omit appModuleId to verify by name.`)}if(a.status<200||a.status>=300)throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup returned HTTP ${a.status}. Retry, or omit appModuleId to verify by name.`);let o=(r=a.body)===null||r===void 0?void 0:r.value;if(!Array.isArray(o))throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup returned a malformed body.`);if(o.length===0)return;let s=(n=o[0])===null||n===void 0?void 0:n.appmoduleid;if(!s)throw new Sr.InvalidArgumentError(`setAppAiFeatures: cannot confirm that the supplied appModuleId belongs to app '${t}' \u2014 the lookup returned a row with no appmoduleid.`);return s}var wS=new WeakMap;async function e5(e,t){var r,n,i;let a=wS.get(e);if(a||(a=new Map,wS.set(e,a)),a.has(t))return a.get(t);let o=`/settingdefinitions${(0,Ue.odataQuery)([["$select","settingdefinitionid"],["$filter",`uniquename eq '${(0,Ue.odataLiteral)(t)}'`]])}`,s=await e.get(o),l=s.status>=200&&s.status<300?(i=((n=(r=s.body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0])===null||i===void 0?void 0:i.settingdefinitionid:void 0;return l&&a.set(t,l),l}async function t5(e,t,r){var n,i;let a=await e5(e,r);if(!t||!a)return;let o=`/appsettings${(0,Ue.odataQuery)([["$select","value"],["$filter",`_parentappmoduleid_value eq ${t} and _settingdefinitionid_value eq ${a}`]])}`,s=await e.get(o);if(s.status<200||s.status>=300)return;let l=(i=(n=s.body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[];return l.length>0?{exists:!0,value:l[0].value}:{exists:!1}}var r5=4,n5=500,NS=20,SS=3e4;function i5(e){if(e===void 0)return r5;if(!Number.isFinite(e))throw new Sr.InvalidArgumentError(`setAppAiFeatures: verifyAttempts must be a finite integer between 1 and ${NS}; got ${e}.`);return Math.min(NS,Math.max(1,Math.floor(e)))}function a5(e){if(e===void 0)return n5;if(!Number.isFinite(e))throw new Sr.InvalidArgumentError(`setAppAiFeatures: verifyDelayMs must be a finite number between 0 and ${SS}; got ${e}.`);return Math.min(SS,Math.max(0,Math.floor(e)))}function o5(e){return e>0?new Promise(t=>setTimeout(t,e)):Promise.resolve()}async function s5(e,t,r,n,i,a,o){let s,l,u,c=!1;for(let d=0;d<a;d+=1){d>0&&await o5(o*d);let f;try{let h=await t();h?(f=await t5(e,h,n),f===void 0&&(u="the app-scope override row could not be read (insufficient access or unresolvable ids)")):u=`the app '${r}' could not be resolved to an appmoduleid \u2014 a newly created app is not readable until it is published, so either publish it first or pass \`appModuleId\` in the options to verify without the lookup`}catch(h){f=void 0,u=h.message}c=f!==void 0,l=f?.exists;try{s=(await Cl(e,n,{appUniqueName:r})).value}catch{}if(f?.exists&&f.value===i)return{result:"proven",effectiveValue:f.value,appOverrideExists:!0}}return c?{result:"absent",effectiveValue:s,appOverrideExists:l}:{result:"unverifiable",effectiveValue:s,appOverrideExists:void 0,reason:u}}function DS(e,t){return t===2?String(e).toLowerCase()==="true":e!=null&&e!=="0"&&e!==""}async function Cl(e,t,r={}){var n,i;let a=[`SettingName='${(0,Ue.odataPathLiteral)(t)}'`];r.appUniqueName&&a.push(`AppUniqueName='${(0,Ue.odataPathLiteral)(r.appUniqueName)}'`);let o=`/RetrieveSetting(${a.join(",")})`,l=(i=(n=(0,Ut.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||n===void 0?void 0:n.SettingDetail)!==null&&i!==void 0?i:{};return{value:l.Value,dataType:l.DataType}}Ae.retrieveSetting=Cl;async function ES(e,t,r,n={}){let i={SettingName:t,Value:r};n.appUniqueName&&(i.AppUniqueName=n.appUniqueName),n.solutionUniqueName&&(i.SolutionUniqueName=n.solutionUniqueName),(0,Ut.ensureSuccess)(await e.post("/SaveSettingValue",i),e.apiUrl("/SaveSettingValue"))}Ae.saveSettingValue=ES;async function l5(e,t={}){let r={};for(let[n,i]of Object.entries(Ae.AI_GATE)){let{value:a,dataType:o}=await Cl(e,i,t);r[n]={enabled:DS(a,o),setting:i,value:a}}return r}Ae.getAiReadiness=l5;async function u5(e,t,r,n={}){var i,a,o;if(!t||!t.trim())throw new Sr.InvalidArgumentError("setAppAiFeatures: a non-empty appUniqueName is required (an empty value would write the setting at organization scope, affecting every app).");let s=i5(n.verifyAttempts),l=a5(n.verifyDelayMs),u=[];for(let[N,I]of Object.entries(r)){if(I===void 0)continue;let R=Q4[N];R&&u.push({feature:N,setting:R,requestedValue:X4(I,N)})}let c=[],d=n.appModuleId?(0,Ue.normalizeGuid)(n.appModuleId,"appModuleId"):void 0;if(d){let N=await Z4(e,t);if(N&&(0,Ue.normalizeGuid)(N,"appModuleId")!==d)throw new Sr.InvalidArgumentError(`setAppAiFeatures: appModuleId '${d}' does not belong to app '${t}' (which resolves to '${N}'). Settings are written by unique name, so verifying against a different app would report success for a write that never landed.`)}let f,h=async()=>d||(f||(f=await Y4(e,t)),f),b=new Map,w=async N=>{let I=Ae.AI_GATE[N];if(I){if(!b.has(I)){let{value:R,dataType:F}=await Cl(e,I);b.set(I,{enabled:DS(R,F),setting:I,value:R})}return b.get(I)}};for(let{feature:N,setting:I,requestedValue:R}of u)try{if(K4(R)){let W=await w(N);if(!W?.enabled){c.push({feature:N,setting:I,requestedValue:R,status:"skipped",reason:`the org readiness gate '${(i=W?.setting)!==null&&i!==void 0?i:N}' is off, so the feature cannot be enabled for this app`});continue}}await ES(e,I,R,{appUniqueName:t,solutionUniqueName:n.solutionUniqueName});let F=await s5(e,h,t,I,R,s,l),M={feature:N,setting:I,requestedValue:R,effectiveValue:F.effectiveValue,appOverrideExists:F.appOverrideExists};F.result==="proven"?c.push({...M,status:"applied"}):F.result==="absent"?c.push({...M,status:"notPersisted",reason:`the write reported success but no app-scope override holding '${R}' was observed for '${I}' after ${s} attempt(s) \u2014 it reads '${(a=F.effectiveValue)!==null&&a!==void 0?a:""}' for this app (Dataverse can accept an app-scope write without storing it)`}):c.push({...M,status:"unverified",reason:`the write was issued but could not be confirmed: ${(o=F.reason)!==null&&o!==void 0?o:"the app-scope override row could not be read"}. The value may or may not be in force \u2014 verify manually before relying on it.`})}catch(F){c.push({feature:N,setting:I,requestedValue:R,status:"failed",reason:F.message})}return{applied:c.filter(N=>N.status==="applied").map(N=>N.feature),skipped:c.filter(N=>N.status==="skipped").map(N=>N.feature),notPersisted:c.filter(N=>N.status==="notPersisted").map(N=>N.feature),unverified:c.filter(N=>N.status==="unverified").map(N=>N.feature),failed:c.filter(N=>N.status==="failed").map(N=>N.feature),outcomes:c}}Ae.setAppAiFeatures=u5;var c5="GptPowerPrompt",d5='{ "consumptionSource": "Api", "partnerSource": "AIBuilder", "consumptionSourceVersion": "GptApiClient"}';function IS(e){var t,r,n,i;let a=e.entityLogicalName,o=[{type:"literal",text:e.instruction.replace(/\s*$/,"")+" "}];return e.columns.forEach((s,l)=>{o.push({type:"data",id:`${a}.${s.logical}`,text:s.display}),l<e.columns.length-1&&o.push({type:"literal",text:", "})}),{version:"GptDynamicPrompt-2",prompt:o,definitions:{inputs:[{id:"RecordId",text:"RecordId",type:"text"},{id:"LanguageCode",text:"LanguageCode",type:"text"}],formulas:[],data:[{id:a,displayName:a,type:"dataverseTable",filters:[{filterType:"equal",attribute:e.primaryKey,valueType:"inputVariable",value:"RecordId"}]}],output:{formats:[(t=e.outputFormat)!==null&&t!==void 0?t:"text"]}},modelParameters:{modelType:"default",gptParameters:{temperature:(r=e.temperature)!==null&&r!==void 0?r:0}},settings:{recordRetrievalLimit:(n=e.recordRetrievalLimit)!==null&&n!==void 0?n:30,shouldPreserveRecordLinks:null,runtime:null,enableReasoning:(i=e.enableReasoning)!==null&&i!==void 0?i:!0},code:"",signature:""}}Ae.buildGptDynamicPrompt=IS;async function p5(e,t){var r,n;let i=`/EntityDefinitions(LogicalName='${(0,Ue.odataPathLiteral)(t)}')${(0,Ue.odataQuery)([["$select","MetadataId"]])}`;return(n=(r=(0,Ut.ensureSuccess)(await e.get(i),e.apiUrl(i)).body)===null||r===void 0?void 0:r.MetadataId)!==null&&n!==void 0?n:""}async function f5(e,t,r={}){var n,i,a,o,s;let l=`ais_RowSummary_${t.entityLogicalName}`,u=`/aiskillconfigs${(0,Ue.odataQuery)([["$select","aiskillconfigid,_aimodel_value"],["$filter",`uniquename eq '${(0,Ue.odataLiteral)(l)}'`],["$top",1]])}`,c=((i=(n=(0,Ut.ensureSuccess)(await e.get(u),e.apiUrl(u)).body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[])[0];if(c)return{modelId:c._aimodel_value,aiSkillConfigId:c.aiskillconfigid};let d=`/msdyn_aitemplates${(0,Ue.odataQuery)([["$select","msdyn_aitemplateid"],["$filter",`msdyn_uniquename eq '${c5}'`],["$top",1]])}`,f=((s=(o=(a=(0,Ut.ensureSuccess)(await e.get(d),e.apiUrl(d)).body)===null||a===void 0?void 0:a.value)===null||o===void 0?void 0:o[0])!==null&&s!==void 0?s:{}).msdyn_aitemplateid,h=(0,AS.newId)(),b=(0,AS.newId)(),w=JSON.stringify(IS(t)),N={ModelId:h,RunConfigurationId:b,ModelName:`${t.entityLogicalName} row summary`,TemplateId:f,CustomConfiguration:w,Source:d5,RunConfiguration:""};(0,Ut.ensureSuccess)(await e.post("/AIModelPublish",N),e.apiUrl("/AIModelPublish"));try{let I=await p5(e,t.entityLogicalName),R={uniquename:l,description:`${t.entityLogicalName} row summary`,"[email protected]":`/entities(${I})`,"[email protected]":`/msdyn_aimodels(${h})`,aiskill:"RowSummary"},F=(0,Ut.ensureSuccess)(await e.post("/aiskillconfigs",R),e.apiUrl("/aiskillconfigs")),M=(0,Ut.requireCreatedId)(F,"aiskillconfigid","row-summary skill");return{modelId:h,aiSkillConfigId:M}}catch(I){try{await e.delete(`/msdyn_aimodels(${h})`)}catch{}throw I}}Ae.configureRowSummary=f5;async function m5(e,t){var r,n;let i=`ais_RowSummary_${t.entityLogicalName}`,a=`/aiskillconfigs${(0,Ue.odataQuery)([["$select","aiskillconfigid,_aimodel_value"],["$filter",`uniquename eq '${(0,Ue.odataLiteral)(i)}'`],["$top",1]])}`,o=((n=(r=(0,Ut.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:[])[0];if(!o)return;let s=`/aiskillconfigs(${o.aiskillconfigid})`;if((0,Ut.ensureSuccess)(await e.delete(s),e.apiUrl(s)),o._aimodel_value){let l=`/msdyn_aimodels(${o._aimodel_value})`;(0,Ut.ensureSuccess)(await e.delete(l),e.apiUrl(l))}}Ae.removeRowSummary=m5});var PS=m(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.findArtifact=Ei.resolveArtifact=void 0;var Ze=ce(),tr=Bi(),h5=be();async function g5(e,t,r){var n,i,a,o,s,l,u,c,d,f,h;switch(t){case"app":{let b=await(0,tr.queryRecords)(e,"appmodule",{select:["appmoduleid","name","appmoduleidunique"],filter:`uniquename eq '${(0,Ze.odataLiteral)((n=r.uniqueName)!==null&&n!==void 0?n:"")}'`,top:1}),w=b&&b[0];return w?[{id:String(w.appmoduleid),name:String(w.name),appModuleIdUnique:String(w.appmoduleidunique)}]:[]}case"dashboard":return(await(0,tr.queryRecords)(e,"systemform",{select:["formid","name"],filter:`name eq '${(0,Ze.odataLiteral)((i=r.name)!==null&&i!==void 0?i:"")}' and type eq 0`,top:10})||[]).map(w=>({id:String(w.formid),name:String(w.name)}));case"command":{let b=await(0,tr.queryRecords)(e,"appaction",{select:["appactionid","buttonlabeltext"],filter:`contextvalue eq '${(0,Ze.odataLiteral)((a=r.entity)!==null&&a!==void 0?a:"")}'`,top:1});return b&&b.length?[{id:String(r.entity),entity:String(r.entity)}]:[]}case"form":return(await(0,tr.queryRecords)(e,"systemform",{select:["formid","name"],filter:`name eq '${(0,Ze.odataLiteral)((o=r.name)!==null&&o!==void 0?o:"")}' and objecttypecode eq '${(0,Ze.odataLiteral)((s=r.entity)!==null&&s!==void 0?s:"")}'`,top:10})||[]).map(w=>({id:String(w.formid),name:String(w.name)}));case"chart":return(await(0,tr.queryRecords)(e,"savedqueryvisualization",{select:["savedqueryvisualizationid","name"],filter:`name eq '${(0,Ze.odataLiteral)((l=r.name)!==null&&l!==void 0?l:"")}' and primaryentitytypecode eq '${(0,Ze.odataLiteral)((u=r.entity)!==null&&u!==void 0?u:"")}'`,top:10})||[]).map(w=>({id:String(w.savedqueryvisualizationid),name:String(w.name)}));case"view":return(await(0,tr.queryRecords)(e,"savedquery",{select:["savedqueryid","name"],filter:`name eq '${(0,Ze.odataLiteral)((c=r.name)!==null&&c!==void 0?c:"")}' and returnedtypecode eq '${(0,Ze.odataLiteral)((d=r.entity)!==null&&d!==void 0?d:"")}'`,top:10})||[]).map(w=>({id:String(w.savedqueryid),name:String(w.name)}));case"webResource":return(await(0,tr.queryRecords)(e,"webresource",{select:["webresourceid","name"],filter:`name eq '${(0,Ze.odataLiteral)((f=r.name)!==null&&f!==void 0?f:"")}'`,top:1})||[]).map(w=>({id:String(w.webresourceid),name:String(w.name)}));case"solution":return(await(0,tr.queryRecords)(e,"solution",{select:["solutionid","uniquename"],filter:`uniquename eq '${(0,Ze.odataLiteral)((h=r.uniqueName)!==null&&h!==void 0?h:"")}'`,top:1})||[]).map(w=>({id:String(w.solutionid),name:String(w.uniquename)}));default:return[]}}Ei.resolveArtifact=g5;async function v5(e,t,r){var n,i,a,o,s;let l=(0,Ze.odataLiteral)((n=r.name)!==null&&n!==void 0?n:""),u=(0,Ze.odataLiteral)((i=r.entity)!==null&&i!==void 0?i:"");if(t==="command"){let b=await(0,tr.queryRecords)(e,"appaction",{select:["appactionid"],filter:`contextvalue eq '${(0,Ze.odataLiteral)((a=r.entity)!==null&&a!==void 0?a:"")}'`,top:1});return b&&b.length?String(r.entity):null}let c=b5(t,l,u,r),d=t!=="app",f=await(0,tr.queryRecords)(e,c.set,{select:[c.idField],filter:c.filter,top:d?2:1});if(d&&f&&f.length>1)throw new h5.AmbiguousArtifactError(t,(s=(o=r.name)!==null&&o!==void 0?o:r.uniqueName)!==null&&s!==void 0?s:"",f.length);let h=f&&f[0]&&f[0][c.idField];return h!=null?String(h):null}Ei.findArtifact=v5;function b5(e,t,r,n){var i;switch(e){case"view":return{set:"savedquery",idField:"savedqueryid",filter:`returnedtypecode eq '${r}' and name eq '${t}'`};case"chart":return{set:"savedqueryvisualization",idField:"savedqueryvisualizationid",filter:`primaryentitytypecode eq '${r}' and name eq '${t}'`};case"form":return{set:"systemform",idField:"formid",filter:`objecttypecode eq '${r}' and name eq '${t}'`};case"app":return{set:"appmodule",idField:"appmoduleid",filter:`uniquename eq '${(0,Ze.odataLiteral)((i=n.uniqueName)!==null&&i!==void 0?i:"")}'`};case"dashboard":return{set:"systemform",idField:"formid",filter:`name eq '${t}' and type eq 0`};default:throw new Error(`Unsupported findable kind: ${e}`)}}});var TS=m(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.seedRecordGraph=void 0;var OS=Bi(),y5=Co(),Al=ce(),C5=be();async function A5(e,t,r={}){var n,i,a,o,s;let l=(n=r.createdIds)!==null&&n!==void 0?n:{},u=(i=r.entitySetFor)!==null&&i!==void 0?i:(f=>(0,y5.resolveEntitySetName)(e,f)),c={},d=f=>{var h;return(h=c[f])!==null&&h!==void 0?h:l[f]};for(let f of t){let h=f.entityLogical.toLowerCase(),b=(a=f.matchOn)===null||a===void 0?void 0:a.toLowerCase(),w=[];for(let B of f.records){let j={...B.body};for(let k of(o=B.binds)!==null&&o!==void 0?o:[]){let $=k.parentEntity.toLowerCase(),re=(s=d($))===null||s===void 0?void 0:s[k.parentIndex];if(!re)throw new C5.InvalidArgumentError(`Cannot resolve bind '${k.navProperty}' on a '${h}' record: parent '${k.parentEntity}'[${k.parentIndex}] has no created id. Seed the parent group before the child, or supply it via options.createdIds.`);let H=(0,Al.assertODataName)(await u($),`entity set for parent '${k.parentEntity}'`),nr=(0,Al.normalizeGuid)(re,`parent id for bind '${k.navProperty}'`);j[`${k.navProperty}@odata.bind`]=`/${H}(${nr})`}w.push(j)}let N=b?w.map(B=>{let j=B[b];return j!=null&&j!==""?String(j):null}):w.map(()=>null),I=new Map;if(b){let B=(0,Al.assertODataName)(b,"RecordGraph matchOn key"),j=[...new Set(N.filter(k=>k!==null))];if(j.length){let k=j.map(re=>`${B} eq '${(0,Al.odataLiteral)(re)}'`).join(" or "),$=await(0,OS.queryRecords)(e,h,{select:[B,`${h}id`],filter:k,top:5e3});for(let re of $??[]){let H=re[B];H!=null&&I.set(String(H).toLowerCase(),String(re[`${h}id`]))}}}let R=[],F=new Map,M=w.map((B,j)=>{let k=N[j];if(k&&I.has(k.toLowerCase()))return null;if(k){let $=k.toLowerCase(),re=F.get($);if(re!==void 0)return re;let H=R.push(B)-1;return F.set($,H),H}return R.push(B)-1}),W=R.length?await(0,OS.createRecordsBulk)(e,h,R):[];c[h]=w.map((B,j)=>{let k=N[j];return k&&I.has(k.toLowerCase())?I.get(k.toLowerCase()):W[M[j]]})}return{createdIds:c}}wl.seedRecordGraph=A5});var qS=m(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.deleteSecurityRole=Pt.createPersonaRole=Pt.createSecurityRole=Pt.SDK_ROLE_MARKER=void 0;var rr=Ve(),qe=ce(),_t=be(),RS={read:"Read",create:"Create",write:"Write",delete:"Delete",append:"Append",appendTo:"AppendTo",assign:"Assign",share:"Share"},BS={user:"Basic",businessUnit:"Local",parentChild:"Deep",organization:"Global"},FS={user:1,businessUnit:2,parentChild:3,organization:4},w5={user:"CanBeBasic",businessUnit:"CanBeLocal",parentChild:"CanBeDeep",organization:"CanBeGlobal"};Pt.SDK_ROLE_MARKER="Authored by @maker-studio/cds-maker-sdk (persona/security role).";function N5(e){return Object.prototype.hasOwnProperty.call(RS,e)?RS[e]:void 0}function S5(e){return Object.prototype.hasOwnProperty.call(BS,e)}var xS=new WeakMap,LS=new WeakMap;async function D5(e,t){var r,n;(0,qe.assertODataName)(t,"entity logical name");let i=xS.get(e);i||(i=new Map,xS.set(e,i));let a=i.get(t);if(a)return a;let o=`/EntityDefinitions(LogicalName='${(0,qe.odataPathLiteral)(t)}')${(0,qe.odataQuery)([["$select","LogicalName,Privileges"]])}`,l=(n=(r=(0,rr.ensureSuccess)(await e.get(o),e.apiUrl(o)).body)===null||r===void 0?void 0:r.Privileges)!==null&&n!==void 0?n:[];if(l.length===0)throw new _t.InvalidArgumentError(`Entity '${t}' exposes no privileges (unknown or non-securable entity).`);return i.set(t,l),l}async function E5(e){var t,r,n;let i=LS.get(e);if(i)return i;let a=`/businessunits${(0,qe.odataQuery)([["$select","businessunitid"],["$filter","_parentbusinessunitid_value eq null"],["$top",1]])}`,l=(n=((r=(t=(0,rr.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||t===void 0?void 0:t.value)!==null&&r!==void 0?r:[])[0])===null||n===void 0?void 0:n.businessunitid;if(!l)throw new _t.InvalidArgumentError("Could not resolve the root business unit.");let u=(0,qe.normalizeGuid)(l,"businessUnitId");return LS.set(e,u),u}async function I5(e,t){var r;let n=new Map;for(let i of t){if(!i.access||i.access.length===0)throw new _t.InvalidArgumentError(`Entity '${i.entity}' privilege request has no access levels.`);let a=(r=i.scope)!==null&&r!==void 0?r:"user";if(!S5(a))throw new _t.InvalidArgumentError(`Unknown privilege scope '${a}' for entity '${i.entity}'.`);let o=await D5(e,i.entity);for(let s of i.access){let l=N5(s);if(!l)throw new _t.InvalidArgumentError(`Unknown access level '${s}' for entity '${i.entity}'.`);let u=o.find(b=>b.PrivilegeType===l);if(!u)throw new _t.InvalidArgumentError(`Entity '${i.entity}' does not support '${s}' access.`);let c=w5[a];if(u[c]===!1)throw new _t.InvalidArgumentError(`Privilege '${u.Name}' on '${i.entity}' does not support the '${a}' scope.`);let d=(0,qe.normalizeGuid)(u.PrivilegeId,"PrivilegeId"),f=n.get(d);if(!f){n.set(d,{privilegeName:u.Name,privilegeType:l,scope:a,entities:new Set([i.entity])});continue}if(f.scope===a){f.entities.add(i.entity);continue}if(!(f.entities.size===1&&f.entities.has(i.entity))){let b=[...f.entities].sort().join(", ");throw new _t.InvalidArgumentError(`Entities '${b}' and '${i.entity}' share the Dataverse privilege '${u.Name}' but request different scopes; a role holds one depth per privilege. Use the same scope for all entities that share this privilege, or split them.`)}f.scope=FS[a]>FS[f.scope]?a:f.scope}}return[...n.entries()].map(([i,a])=>({entity:[...a.entities].sort().join(", "),privilegeId:i,privilegeName:a.privilegeName,privilegeType:a.privilegeType,scope:a.scope}))}async function _5(e,t,r,n){if(r.length===0&&!n)return;let i={Privileges:r.map(o=>({Depth:BS[o.scope],PrivilegeId:o.privilegeId}))},a=`/roles(${t})/Microsoft.Dynamics.CRM.ReplacePrivilegesRole`;(0,rr.ensureSuccess)(await e.post(a,i),e.apiUrl(a))}async function MS(e,t,r,n,i){var a,o;let s=`/${t}(${r})/${n}${(0,qe.odataQuery)([["$select","roleid"],["$filter",`roleid eq ${i}`]])}`;return((o=(a=(0,rr.ensureSuccess)(await e.get(s),e.apiUrl(s)).body)===null||a===void 0?void 0:a.value)!==null&&o!==void 0?o:[]).length>0}async function P5(e,t,r){var n,i;let a=[],o=[],s={"@odata.id":e.apiUrl(`/roles(${t})`)};for(let l of(n=r?.teams)!==null&&n!==void 0?n:[]){let u=(0,qe.normalizeGuid)(l,"teamId");if(!await MS(e,"teams",u,"teamroles_association",t)){let c=`/teams(${u})/teamroles_association/$ref`;(0,rr.ensureSuccess)(await e.post(c,s),e.apiUrl(c))}a.push(u)}for(let l of(i=r?.users)!==null&&i!==void 0?i:[]){let u=(0,qe.normalizeGuid)(l,"userId");if(!await MS(e,"systemusers",u,"systemuserroles_association",t)){let c=`/systemusers(${u})/systemuserroles_association/$ref`;(0,rr.ensureSuccess)(await e.post(c,s),e.apiUrl(c))}o.push(u)}return{teams:a,users:o}}async function US(e,t,r){var n,i;let a=`/roles${(0,qe.odataQuery)([["$select","roleid,description,ismanaged"],["$filter",`name eq '${(0,qe.odataLiteral)(t)}' and _businessunitid_value eq ${r}`]])}`,l=((i=(n=(0,rr.ensureSuccess)(await e.get(a),e.apiUrl(a)).body)===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:[]).filter(d=>!!d.roleid);if(l.length===0)return;let u=d=>{var f;return d.ismanaged!==!0&&((f=d.description)!==null&&f!==void 0?f:"")===Pt.SDK_ROLE_MARKER};if(l.some(d=>!u(d)))throw new _t.InvalidArgumentError(`A role named '${t}' already exists in this business unit and was not created by the SDK; refusing to modify or assign it. Choose a different persona/role name.`);if(l.length>1)throw new _t.InvalidArgumentError(`Multiple (${l.length}) SDK-owned roles named '${t}' exist in this business unit; refusing to reuse one arbitrarily. Remove the duplicate role(s) and retry.`);let c=l[0].roleid;return c?(0,qe.normalizeGuid)(c,"roleId"):void 0}function O5(e){var t,r;return{teams:((t=e?.teams)!==null&&t!==void 0?t:[]).map(n=>(0,qe.normalizeGuid)(n,"teamId")),users:((r=e?.users)!==null&&r!==void 0?r:[]).map(n=>(0,qe.normalizeGuid)(n,"userId"))}}function T5(e){return e.map(t=>({entity:t.entity,privilegeName:t.privilegeName,privilegeType:t.privilegeType,scope:t.scope}))}async function kS(e,t){var r,n;let i=(r=t.name)===null||r===void 0?void 0:r.trim();if(!i)throw new _t.InvalidArgumentError("createSecurityRole: a non-empty role name is required.");let a=t.businessUnitId?(0,qe.normalizeGuid)(t.businessUnitId,"businessUnitId"):await E5(e),o=await I5(e,(n=t.privileges)!==null&&n!==void 0?n:[]),s=O5(t.assignTo),l=await US(e,i,a),u=l!==void 0;if(!l){let d="/roles",f={name:i,description:Pt.SDK_ROLE_MARKER,"[email protected]":`/businessunits(${a})`};try{let h=(0,rr.ensureSuccess)(await e.post(d,f),e.apiUrl(d));l=(0,qe.normalizeGuid)((0,rr.requireCreatedId)(h,"roleid","role"),"roleId")}catch(h){let b;try{b=await US(e,i,a)}catch{b=void 0}if(!b)throw h;l=b}}await _5(e,l,o,u);let c=await P5(e,l,s);return{roleId:l,name:i,reused:u,appliedPrivileges:T5(o),assignedTeams:c.teams,assignedUsers:c.users}}Pt.createSecurityRole=kS;async function R5(e,t){var r,n;let i=(r=t.persona)===null||r===void 0?void 0:r.trim();if(!i)throw new _t.InvalidArgumentError("createPersonaRole: a non-empty persona name is required.");let a=[...t.jobs.flatMap(o=>{var s;return(s=o.privileges)!==null&&s!==void 0?s:[]}),...(n=t.additionalPrivileges)!==null&&n!==void 0?n:[]];return kS(e,{name:i,businessUnitId:t.businessUnitId,privileges:a,assignTo:t.assignTo})}Pt.createPersonaRole=R5;async function F5(e,t){let n=`/roles(${(0,qe.normalizeGuid)(t,"roleId")})`;(0,rr.ensureSuccess)(await e.delete(n),e.apiUrl(n))}Pt.deleteSecurityRole=F5});var GS=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.createMakerSdk=Pi.MakerSdk=void 0;var $e=be(),Dr=lo(),x5=qp(),L5=Gp(),M5=Xp(),U5=gf(),Mp=Af(),et=Co(),Er=Bi(),Nl=_f(),tt=Pf(),B5=ih(),k5=yS(),q5=fn(),$5=Tt(),An=CS(),Wr=Ve(),Ii=ce(),_i=_S(),$S=PS(),V5=TS(),G5=Wd(),Up=qS(),Sl=class{constructor(t){(0,q5.installDomShim)(),this.workspace=new L5.WorkspaceManager(t.workspacePath,t.instanceUrl),this.versions=new M5.VersionManager(this.workspace),this.dataverse=new U5.DataverseClient(t.instanceUrl,t.httpClient,t.solutionUniqueName),this.registrations=(0,k5.buildRegistrations)()}initWorkspace(){this.workspace.init()}getManifest(){return this.workspace.getManifest()}cleanWorkspace(){this.workspace.clean()}async fetchArtifact(t,r){let n=this.requireRegistration(t,"fetchArtifact"),{raw:i,etag:a}=await n.api.get(this.dataverse,r),o=n.adapter.fromApiResponse(i);return this.workspace.writeArtifact(t,r,o),this.versions.storeMeta(t,r,{etag:a,fetchedAt:(0,Wr.nowIso)(),snapshot:(0,An.cloneJson)(o)}),(0,An.cloneJson)(o)}async fetchArtifactList(t,r){return this.requireRegistration(t,"fetchArtifactList").api.list(this.dataverse,r)}async fetchSolution(t){var r;let n=await(0,tt.fetchSolutionComponents)(this.dataverse,t),i=[],a=[];for(let o of n)try{let s=await this.resolveComponentType(o);if(!s){a.push({componentId:o.objectId,componentType:o.componentType,workflowCategory:o.workflowCategory,reason:"unsupported"});continue}let l=await this.fetchArtifact(s,o.objectId);i.push({type:s,id:o.objectId,name:typeof l.name=="string"?l.name:(r=o.displayName)!==null&&r!==void 0?r:o.objectId,entityLogicalName:typeof l.entityLogicalName=="string"?l.entityLogicalName:void 0,lastFetched:(0,Wr.nowIso)(),isDirty:!1})}catch(s){a.push({componentId:o.objectId,componentType:o.componentType,workflowCategory:o.workflowCategory,reason:"failed",error:VS(s)})}return this.workspace.updateManifest({lastSyncAt:(0,Wr.nowIso)()}),{summaries:i,skipped:a}}async fetchEntityMetadata(t){let r=await(0,Mp.fetchEntityMetadataFromApi)(this.dataverse,t);return this.workspace.writeEntityMetadata(t,r),r}findTables(t,r){return(0,Mp.findTables)(this.dataverse,t,r)}findColumns(t,r,n){return(0,Mp.findColumns)(this.dataverse,t,r,n)}createTable(t){return(0,et.createTable)(this.dataverse,t)}createColumn(t,r){return(0,et.createColumn)(this.dataverse,t,r)}updateColumn(t,r,n){return(0,et.updateColumn)(this.dataverse,t,r,n)}deleteColumn(t,r){return(0,et.deleteColumn)(this.dataverse,t,r)}createCustomerColumn(t,r){return(0,et.createCustomerColumn)(this.dataverse,t,r)}insertStatusValue(t,r){return(0,et.insertStatusValue)(this.dataverse,t,r)}updateTable(t,r){return(0,et.updateTable)(this.dataverse,t,r)}async setEntityIcon(t,r){if(await(0,et.updateTable)(this.dataverse,t,{iconVectorName:r.vector,iconSmallName:r.small,iconMediumName:r.medium,iconLargeName:r.large}),r.publish!==!1){let n=`<importexportxml><entities><entity>${(0,Ii.xmlText)(t)}</entity></entities></importexportxml>`;(0,Wr.ensureSuccess)(await this.dataverse.post("/PublishXml",{ParameterXml:n}),this.dataverse.apiUrl("/PublishXml"))}}createAlternateKey(t,r){return(0,et.createAlternateKey)(this.dataverse,t,r)}deleteAlternateKey(t,r){return(0,et.deleteAlternateKey)(this.dataverse,t,r)}createRelationship(t){return(0,et.createRelationship)(this.dataverse,t)}deleteRelationship(t){return(0,et.deleteRelationship)(this.dataverse,t)}createGlobalOptionSet(t){return(0,et.createGlobalOptionSet)(this.dataverse,t)}deleteGlobalOptionSet(t){return(0,et.deleteGlobalOptionSet)(this.dataverse,t)}deleteTable(t){return(0,et.deleteTable)(this.dataverse,t)}createSecurityRole(t){return(0,Up.createSecurityRole)(this.dataverse,t)}createPersonaRole(t){return(0,Up.createPersonaRole)(this.dataverse,t)}deleteSecurityRole(t){return(0,Up.deleteSecurityRole)(this.dataverse,t)}createRecord(t,r){return(0,Er.createRecord)(this.dataverse,t,r)}createRecordsBulk(t,r){return(0,Er.createRecordsBulk)(this.dataverse,t,r)}updateRecord(t,r,n){return(0,Er.updateRecord)(this.dataverse,t,r,n)}upsertRecord(t,r,n){return(0,Er.upsertRecord)(this.dataverse,t,r,n)}deleteRecord(t,r){return(0,Er.deleteRecord)(this.dataverse,t,r)}getRecord(t,r,n){return(0,Er.getRecord)(this.dataverse,t,r,n)}queryRecords(t,r){return(0,Er.queryRecords)(this.dataverse,t,r)}seedRecordGraph(t,r){return(0,V5.seedRecordGraph)(this.dataverse,t,r)}resolveArtifact(t,r){return(0,$S.resolveArtifact)(this.dataverse,t,r)}findArtifact(t,r){return(0,$S.findArtifact)(this.dataverse,t,r)}async deleteAppCascade(t,r){let n=await(0,B5.deleteAppCascade)(this.dataverse,t,r),i=(0,Ii.normalizeGuid)(t,"appModuleId");return this.workspace.readArtifact("app",i)&&this.workspace.deleteArtifact("app",i),n}associateRecords(t,r,n){return(0,Er.associateRecords)(this.dataverse,t,r,n)}disassociateRecords(t,r,n,i){return(0,Er.disassociateRecords)(this.dataverse,t,r,n,i)}createWebResource(t){return(0,Nl.createWebResource)(this.dataverse,t)}updateWebResource(t,r){return(0,Nl.updateWebResource)(this.dataverse,t,r)}getWebResource(t){return(0,Nl.getWebResource)(this.dataverse,t)}deleteWebResource(t){return(0,Nl.deleteWebResource)(this.dataverse,t)}getSolution(t){return(0,tt.getSolution)(this.dataverse,t)}createPublisher(t){return(0,tt.createPublisher)(this.dataverse,t)}createSolution(t){return(0,tt.createSolution)(this.dataverse,t)}setSolutionVersion(t,r){return(0,tt.setSolutionVersion)(this.dataverse,t,r)}addSolutionComponent(t){return(0,tt.addSolutionComponent)(this.dataverse,t)}removeSolutionComponent(t,r,n){return(0,tt.removeSolutionComponent)(this.dataverse,t,r,n)}exportSolution(t){return(0,tt.exportSolution)(this.dataverse,t)}importSolution(t){return(0,tt.importSolution)(this.dataverse,t)}deleteSolution(t){return(0,tt.deleteSolution)(this.dataverse,t)}getArtifact(t,r){return(0,An.cloneJson)(this.readRaw(t,r))}readRaw(t,r){let n=this.workspace.readArtifact(t,r);if(!n)throw new $e.ArtifactNotFoundError(t,r);return n}queryTree(t,r,n){let i=this.getArtifact(t,r),a=Dr.JsonPointer.resolve(i,n);if(a===void 0)throw new $e.PathNotFoundError(t,r,n);return a}findElements(t,r,n){let i=this.getArtifact(t,r);return(0,x5.findElements)(i,n)}listArtifacts(t,r){return this.workspace.listArtifacts(t,r).map(n=>({...n,isDirty:this.versions.isDirty(n.type,n.id)}))}getEntityMetadata(t){let r=this.workspace.readEntityMetadata(t);if(!r)throw new $e.ArtifactNotFoundError("entityMetadata",t);return r}getFieldMetadata(t,r){let i=this.getEntityMetadata(t).attributes.find(a=>a.logicalName===r);if(!i)throw new $e.PathNotFoundError("entityMetadata",t,r);return i}updateElement(t,r,n,i){let a=this.readRaw(t,r),o=Dr.JsonPointer.resolve(a,n);if(o===void 0)throw new $e.PathNotFoundError(t,r,n);let s=Dl(o)&&Dl(i)?{...o,...i}:i;return Dr.JsonPointer.set(a,n,(0,An.cloneJson)(s)),this.assertStructurallyValid(t,r,a,n),this.workspace.writeArtifact(t,r,a),this.getArtifact(t,r)}addElement(t,r,n,i,a){let o=this.readRaw(t,r),s=Dr.JsonPointer.resolve(o,n);if(s===void 0)throw new $e.PathNotFoundError(t,r,n);if(!Array.isArray(s))throw new $e.ValidationError(t,r,n,"parent must be an array");let l=this.assignMissingIds(t,(0,An.cloneJson)(i)),u=j5(s,a?.position);return s.splice(u,0,l),this.assertStructurallyValid(t,r,o,n),this.workspace.writeArtifact(t,r,o),this.getArtifact(t,r)}moveElement(t,r,n,i,a){var o;let s=this.readRaw(t,r),l=Dr.JsonPointer.resolve(s,n);if(l===void 0)throw new $e.PathNotFoundError(t,r,n);let u=Dr.JsonPointer.resolve(s,i);if(u===void 0)throw new $e.PathNotFoundError(t,r,i);if(!Array.isArray(u))throw new $e.ValidationError(t,r,i,"move target must be an array");if(i===n||i.startsWith(`${n}/`))throw new $e.ValidationError(t,r,i,"cannot move an element into its own subtree");Dr.JsonPointer.remove(s,n);let c=(o=a?.index)!==null&&o!==void 0?o:u.length;return u.splice(Math.max(0,Math.min(c,u.length)),0,l),this.assertStructurallyValid(t,r,s,i),this.workspace.writeArtifact(t,r,s),this.getArtifact(t,r)}removeElement(t,r,n){let i=this.readRaw(t,r);if(Dr.JsonPointer.resolve(i,n)===void 0)throw new $e.PathNotFoundError(t,r,n);return Dr.JsonPointer.remove(i,n),this.assertStructurallyValid(t,r,i,W5(n)),this.workspace.writeArtifact(t,r,i),this.getArtifact(t,r)}assertStructurallyValid(t,r,n,i){var a,o,s;let l=this.registrations.get(t),u=(s=(o=l==null?void 0:(a=l.adapter).validate)===null||o===void 0?void 0:o.call(a,n,i))!==null&&s!==void 0?s:[];if(u.length>0)throw new $e.ValidationError(t,r,u)}retrieveSetting(t,r){return(0,_i.retrieveSetting)(this.dataverse,t,r)}saveSettingValue(t,r,n){return(0,_i.saveSettingValue)(this.dataverse,t,r,n)}getAiReadiness(t){return(0,_i.getAiReadiness)(this.dataverse,t)}setAppAiFeatures(t,r,n){return(0,_i.setAppAiFeatures)(this.dataverse,t,r,n)}configureRowSummary(t,r){return(0,_i.configureRowSummary)(this.dataverse,t,r)}removeRowSummary(t){return(0,_i.removeRowSummary)(this.dataverse,t)}async enrichDefaultViews(t,r,n={}){let i=await(0,G5.findDefaultViews)(this.dataverse,t,n);for(let a of i)await this.fetchArtifact("view",a.id),this.updateElement("view",a.id,"/columns",r),await this.pushArtifact("view",a.id);return i.length&&await this.publishArtifact("view",i[0].id),{updated:i.map(a=>a.id)}}createArtifact(t,r){let n=this.requireRegistration(t,"createArtifact"),i=n.adapter.assignMissingIds(n.adapter.createDefault(r)),a=i.id;if(!a)throw new $e.ValidationError(t,"(new)","/id","created artifact must have an id");return this.workspace.writeArtifact(t,a,i),(0,An.cloneJson)(i)}deleteArtifact(t,r){this.workspace.deleteArtifact(t,r)}async deleteRemoteArtifact(t,r){await this.requireRegistration(t,"deleteRemoteArtifact").api.delete(this.dataverse,r),this.workspace.readArtifact(t,r)&&this.workspace.deleteArtifact(t,r)}async publishArtifact(t,r){let n=this.readRaw(t,r),i;if(t==="app")i=`<importexportxml><appmodules><appmodule>${(0,Ii.xmlText)(r)}</appmodule></appmodules></importexportxml>`;else{let a=n.entityLogicalName;a&&(i=`<importexportxml><entities><entity>${(0,Ii.xmlText)(a)}</entity></entities></importexportxml>`)}i&&(0,Wr.ensureSuccess)(await this.dataverse.post("/PublishXml",{ParameterXml:i}),this.dataverse.apiUrl("/PublishXml"))}async pushArtifact(t,r){var n;let i=this.requireRegistration(t,"pushArtifact"),a=this.readRaw(t,r),o=this.versions.getMeta(t,r),s=await this.buildMetadataContext(i.adapter,a),l=i.adapter.toApiPayload(a,o?.snapshot,s);try{let u=o?await i.api.update(this.dataverse,r,l,o.etag):await i.api.create(this.dataverse,l),c=r;return o||(u.serverIdentity&&i.adapter.applyServerIdentity&&i.adapter.applyServerIdentity(a,u.serverIdentity),u.id&&u.id!==r&&(a.id=u.id,this.workspace.deleteArtifact(t,r),c=u.id),this.workspace.writeArtifact(t,c,a)),this.versions.storeMeta(t,c,{etag:u.etag,fetchedAt:(0,Wr.nowIso)(),snapshot:(0,An.cloneJson)(a)}),{type:t,id:c,success:!0,...u.warnings&&u.warnings.length>0?{warnings:u.warnings}:{}}}catch(u){if(u instanceof $e.SdkError&&u.code===Wr.VERSION_CONFLICT_CODE)return{type:t,id:r,success:!1,error:new $e.VersionConflictError(t,r,(n=o?.etag)!==null&&n!==void 0?n:null,null)};throw u}}async buildMetadataContext(t,r){var n,i;let a=(i=(n=t.metadataNeeds)===null||n===void 0?void 0:n.call(t,r))!==null&&i!==void 0?i:[];if(a.length===0)return;let o=new Set(a.map(s=>s.entityLogicalName).filter(s=>!!s));for(let s of o)if(!this.workspace.readEntityMetadata(s))try{await this.fetchEntityMetadata(s)}catch{}return{resolveField:(s,l)=>{let u=this.workspace.readEntityMetadata(s),c=u?.attributes.find(d=>d.logicalName===l);return c?{displayName:c.displayName,attributeType:c.attributeType}:void 0}}}async pushAll(){let t=this.getDirtyArtifacts(),r=[];for(let n of t)try{r.push(await this.pushArtifact(n.type,n.id))}catch(i){r.push({type:n.type,id:n.id,success:!1,error:VS(i)})}return r}getDirtyArtifacts(){return this.workspace.listArtifacts().filter(t=>this.versions.isDirty(t.type,t.id)).map(t=>({...t,isDirty:!0}))}diffArtifact(t,r){return this.versions.diff(t,r)}assignMissingIds(t,r){let n=this.registrations.get(t);return n?n.adapter.assignMissingIds(r):(0,$5.assignMissingIds)(r)}async resolveComponentType(t){switch(t.componentType){case tt.SolutionComponentType.SavedQuery:return"view";case tt.SolutionComponentType.SavedQueryVisualization:return"chart";case tt.SolutionComponentType.AppModule:return"app";case tt.SolutionComponentType.Workflow:return t.workflowCategory===2?"businessRule":void 0;case tt.SolutionComponentType.SystemForm:return await this.isDashboardForm(t.objectId)?"dashboard":"form";default:return}}async isDashboardForm(t){let n=`/systemforms(${(0,Ii.normalizeGuid)(t,"formId")})${(0,Ii.odataQuery)([["$select","type"]])}`,i=(0,Wr.ensureSuccess)(await this.dataverse.get(n),this.dataverse.apiUrl(n)),a=Number(i.body.type);return a===0||a===10}requireRegistration(t,r){let n=this.registrations.get(t);if(!n)throw new $e.NotImplementedError(r,`no adapter registered for artifact type '${t}'`);return n}};Pi.MakerSdk=Sl;function z5(e){return new Sl(e)}Pi.createMakerSdk=z5;function VS(e){return e instanceof Error?e:new Error(String(e))}function Dl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function W5(e){let t=e.lastIndexOf("/");return t<=0?"":e.slice(0,t)}function j5(e,t){if(t===void 0||t==="end")return e.length;if(t==="start")return 0;if("index"in t)return Math.max(0,Math.min(t.index,e.length));if("before"in t){let n=e.findIndex(i=>Dl(i)&&i.id===t.before);return n<0?e.length:n}let r=e.findIndex(n=>Dl(n)&&n.id===t.after);return r<0?e.length:r+1}});var zS=m(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.ARTIFACT_TYPES=void 0;El.ARTIFACT_TYPES=["form","view","businessRule","app","command","chart","dashboard"]});var jS=m(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0})});var JS=m(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0})});var XS=m(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0})});var YS=m(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0})});var eD=m(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0})});var rD=m(tD=>{"use strict";Object.defineProperty(tD,"__esModule",{value:!0})});var iD=m(nD=>{"use strict";Object.defineProperty(nD,"__esModule",{value:!0})});var oD=m(aD=>{"use strict";Object.defineProperty(aD,"__esModule",{value:!0})});var lD=m(sD=>{"use strict";Object.defineProperty(sD,"__esModule",{value:!0})});var cD=m(uD=>{"use strict";Object.defineProperty(uD,"__esModule",{value:!0})});var pD=m(dD=>{"use strict";Object.defineProperty(dD,"__esModule",{value:!0})});var mD=m(fD=>{"use strict";Object.defineProperty(fD,"__esModule",{value:!0})});var gD=m(hD=>{"use strict";Object.defineProperty(hD,"__esModule",{value:!0})});var bD=m(vD=>{"use strict";Object.defineProperty(vD,"__esModule",{value:!0})});var CD=m(yD=>{"use strict";Object.defineProperty(yD,"__esModule",{value:!0})});var wD=m(AD=>{"use strict";Object.defineProperty(AD,"__esModule",{value:!0})});var SD=m(ND=>{"use strict";Object.defineProperty(ND,"__esModule",{value:!0})});var ED=m(DD=>{"use strict";Object.defineProperty(DD,"__esModule",{value:!0})});var H5=exports&&exports.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),we=exports&&exports.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&H5(t,e,r)};Object.defineProperty(exports,"__esModule",{value:!0});exports.createMakerSdk=void 0;var J5=GS();Object.defineProperty(exports,"createMakerSdk",{enumerable:!0,get:function(){return J5.createMakerSdk}});we(zS(),exports);we(jS(),exports);we(JS(),exports);we(XS(),exports);we(YS(),exports);we(eD(),exports);we(rD(),exports);we(iD(),exports);we(oD(),exports);we(lD(),exports);we(cD(),exports);we(pD(),exports);we(mD(),exports);we(gD(),exports);we(bD(),exports);we(CD(),exports);we(wD(),exports);we(SD(),exports);we(ED(),exports);we(be(),exports);
diff --git a/plugins/model-apps/skills/app-builder/SKILL.md b/plugins/model-apps/skills/app-builder/SKILL.md
index 921c8d2ac..9cc1423ba 100644
--- a/plugins/model-apps/skills/app-builder/SKILL.md
+++ b/plugins/model-apps/skills/app-builder/SKILL.md
@@ -104,7 +104,9 @@ Rules:
### Phase 0 — Working directory
1. Derive a short kebab-case slug from `$ARGUMENTS` (e.g. "Project Tracker" → `project-tracker`).
-2. `mkdir -p <slug>`; resolve its absolute path. It holds `app-spec.json`, `model-app-plan.md`, and `workflow-log.md`.
+2. Create the directory (`mkdir -p <slug>` on bash/PowerShell; `mkdir <slug>` on cmd, which has no
+ `-p` and errors if it exists) and resolve its absolute path. It holds `app-spec.json`,
+ `model-app-plan.md`, and `workflow-log.md`.
### Phase 1 — Author the App Spec (interactive, main loop)
diff --git a/plugins/model-apps/skills/genpage/SKILL.md b/plugins/model-apps/skills/genpage/SKILL.md
index 5b3b66439..5eafc3f11 100644
--- a/plugins/model-apps/skills/genpage/SKILL.md
+++ b/plugins/model-apps/skills/genpage/SKILL.md
@@ -73,7 +73,8 @@ Derive a short folder name from the user's requirements:
1. Extract the page name or a 2-4 word summary from `$ARGUMENTS`
2. Convert to kebab-case (e.g., "Candidate Tracker" → `candidate-tracker`)
-3. Create the folder: `mkdir -p <folder-name>`
+3. Create the folder: `mkdir -p <folder-name>` (bash/PowerShell; on cmd use `mkdir <folder-name>`,
+ which has no `-p` and errors if the folder exists)
4. Resolve its absolute path — this is the **working directory** for all subsequent phases
### Phase 0.5: Initialize Local-Dev Manifest