@aglyn/aglyn 1.26.5 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/aglyn",
3
- "version": "1.26.5",
3
+ "version": "1.27.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -37,16 +37,16 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "dependencies": {
40
- "@aglyn/shared-data-enums": "1.26.5",
41
- "@aglyn/shared-data-mdi": "1.26.5",
42
- "@aglyn/shared-data-types": "1.26.5",
43
- "@aglyn/shared-util-email": "1.26.5",
44
- "@aglyn/shared-util-first-touch": "1.26.5",
45
- "@aglyn/shared-util-http": "1.26.5",
46
- "@aglyn/shared-util-logger": "1.26.5",
47
- "@aglyn/shared-util-timestamp": "1.26.5",
48
- "@aglyn/shared-util-tools": "1.26.5",
49
- "@aglyn/shared-util-vendor": "1.26.5",
40
+ "@aglyn/shared-data-enums": "1.27.0",
41
+ "@aglyn/shared-data-mdi": "1.27.0",
42
+ "@aglyn/shared-data-types": "1.27.0",
43
+ "@aglyn/shared-util-email": "1.27.0",
44
+ "@aglyn/shared-util-first-touch": "1.27.0",
45
+ "@aglyn/shared-util-http": "1.27.0",
46
+ "@aglyn/shared-util-logger": "1.27.0",
47
+ "@aglyn/shared-util-timestamp": "1.27.0",
48
+ "@aglyn/shared-util-tools": "1.27.0",
49
+ "@aglyn/shared-util-vendor": "1.27.0",
50
50
  "@data-driven-forms/react-form-renderer": "^4.2.3",
51
51
  "@msgpack/msgpack": "^3.1.3",
52
52
  "@types/unist": "^3.0.3",
@@ -41,6 +41,16 @@ import type { HostSeoEntity } from './content-authors';
41
41
  export declare const SITE_SLOGAN_MAX_LENGTH = 120;
42
42
  /** The most social links a site keeps, as the editor allows them. */
43
43
  export declare const BUSINESS_SOCIAL_LINKS_MAX = 8;
44
+ /** The longest business name the Business details card accepts (AGL-4235). */
45
+ export declare const BUSINESS_NAME_MAX_LENGTH = 200;
46
+ /** The longest phone number the Business details card accepts (AGL-4235). */
47
+ export declare const BUSINESS_PHONE_MAX_LENGTH = 64;
48
+ /**
49
+ * What the Business details card accepts as an email address, as a pattern
50
+ * source (AGL-4235): something, an `@`, something, a dot, something. Leading
51
+ * and trailing spaces pass, because the save trims them.
52
+ */
53
+ export declare const BUSINESS_EMAIL_PATTERN = "^\\s*[^\\s@]+@[^\\s@]+\\.[^\\s@]+\\s*$";
44
54
  /**
45
55
  * The paths a Setup → Business profile save may take back to EMPTY.
46
56
  *
@@ -39,6 +39,13 @@ import { siteContactEmail } from "./host-tokens.js";
39
39
  * showing what the console shows until they follow.
40
40
  */ /** The longest slogan a site may set, as the field and the structured data hold it. */ export const SITE_SLOGAN_MAX_LENGTH = 120;
41
41
  /** The most social links a site keeps, as the editor allows them. */ export const BUSINESS_SOCIAL_LINKS_MAX = 8;
42
+ /** The longest business name the Business details card accepts (AGL-4235). */ export const BUSINESS_NAME_MAX_LENGTH = 200;
43
+ /** The longest phone number the Business details card accepts (AGL-4235). */ export const BUSINESS_PHONE_MAX_LENGTH = 64;
44
+ /**
45
+ * What the Business details card accepts as an email address, as a pattern
46
+ * source (AGL-4235): something, an `@`, something, a dot, something. Leading
47
+ * and trailing spaces pass, because the save trims them.
48
+ */ export const BUSINESS_EMAIL_PATTERN = '^\\s*[^\\s@]+@[^\\s@]+\\.[^\\s@]+\\s*$';
42
49
  /**
43
50
  * The paths a Setup → Business profile save may take back to EMPTY.
44
51
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/business-details.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { structuredAddressLine } from './business-profile'\nimport type { HostSeoEntity } from './content-authors'\nimport { siteContactEmail } from './host-tokens'\n\n/**\n * A site's BUSINESS DETAILS, entered in one place (AGL-4136).\n *\n * The business name, slogan, phone, email, postal address and social links\n * are entered on Setup → Business profile and nowhere else, and everything that uses\n * them reads that one place. The storage did not move, so no site's data had\n * to: each fact has one canonical path, and the older path that used to hold\n * it is kept as a read fallback.\n *\n * | fact | canonical | kept in step |\n * | ------------ | ----------------------------- | -------------------------- |\n * | name | `seo.entity.name` | falls back to `displayName` |\n * | slogan | `seo.entity.slogan` | |\n * | phone | `seo.entity.telephone` | |\n * | email | `seo.entity.email` | mirrored to `business.supportEmail` |\n * | address | `seo.entity.address.*` | mirrored, formatted, to `business.address` |\n * | social links | `business.socialLinks` | `seo.entity.sameAs` joins it when read |\n *\n * The two mirrors exist for the readers that have not moved yet: the native\n * apps read and write the `business` copies, so a save here keeps them\n * showing what the console shows until they follow.\n */\n\n/** The longest slogan a site may set, as the field and the structured data hold it. */\nexport const SITE_SLOGAN_MAX_LENGTH = 120\n\n/** The most social links a site keeps, as the editor allows them. */\nexport const BUSINESS_SOCIAL_LINKS_MAX = 8\n\n/**\n * The paths a Setup → Business profile save may take back to EMPTY.\n *\n * The form drops a cleared input from what it submits, and the write merges,\n * so without this a cleared phone would save nothing and report \"Saved!\".\n * Both mirrors are here as well: an email or address cleared on the card has\n * to leave its copy too, or the fallback would bring it straight back.\n */\nexport const BUSINESS_DETAILS_CLEARABLE_PATHS = [\n 'seo.entity.name',\n 'seo.entity.slogan',\n 'seo.entity.telephone',\n 'seo.entity.email',\n 'seo.entity.address.streetAddress',\n 'seo.entity.address.addressLocality',\n 'seo.entity.address.addressRegion',\n 'seo.entity.address.postalCode',\n 'seo.entity.address.addressCountry',\n 'business.supportEmail',\n 'business.address',\n] as const\n\n/**\n * {@link BUSINESS_DETAILS_CLEARABLE_PATHS} as a plain list: the native apps' Business details\n * cards read it from the contracts, and so clear what the console clears.\n */\nexport const BUSINESS_DETAILS_CLEARABLE_PATH_LIST: readonly string[] =\n BUSINESS_DETAILS_CLEARABLE_PATHS\n\n/** The host fields the business details read and write. */\nexport interface BusinessDetailsHost {\n displayName?: string\n seo?: {\n entity?: Pick<\n HostSeoEntity,\n 'name' | 'slogan' | 'telephone' | 'email' | 'address'\n > | null\n } | null\n business?: {\n supportEmail?: unknown\n address?: unknown\n socialLinks?: Array<{ label?: unknown; url?: unknown } | null> | null\n } | null\n}\n\nconst trimmed = (value: unknown): string =>\n typeof value === 'string' ? value.trim() : ''\n\n/**\n * The host document as the Business details card is seeded with it: the\n * site's one email in the Email field, so a site whose email so far lived\n * only in the one-block copy shows it, and clearing the field clears it.\n * Everything else is the document as stored. A new object; `host` is not\n * changed.\n */\nexport function businessDetailsSeed<T extends BusinessDetailsHost>(\n host: T | null | undefined,\n): T | null | undefined {\n if (!host) return host\n const email = siteContactEmail(host)\n if (!email || trimmed(host.seo?.entity?.email)) return host\n return {\n ...host,\n seo: { ...(host.seo ?? {}), entity: { ...(host.seo?.entity ?? {}), email } },\n }\n}\n\n/**\n * What a Setup → Business profile save writes, from what the card submitted and what\n * the document stores now (AGL-4136):\n *\n * - every text value trimmed;\n * - the email mirrored into `business.supportEmail`, `''` when it was cleared\n * (a clearable path, so the save deletes it);\n * - the structured address mirrored, as the one line every reader prints,\n * into `business.address` — but ONLY when the structured address changed.\n * A site whose address so far lives only in the one block keeps that block\n * through a save that never touched the address, rather than losing it to\n * an empty structured one;\n * - social links without an address dropped, each label and address trimmed,\n * up to {@link BUSINESS_SOCIAL_LINKS_MAX}.\n *\n * A new object: the form's values are not this function's to edit.\n */\nexport function businessDetailsWrite<T extends Record<string, unknown>>(\n fields: T,\n stored: BusinessDetailsHost | null | undefined,\n): T {\n const seo = { ...((fields?.['seo'] as Record<string, unknown>) ?? {}) }\n const entity = { ...((seo['entity'] as Record<string, unknown>) ?? {}) }\n for (const key of ['name', 'slogan', 'telephone', 'email'] as const) {\n if (typeof entity[key] === 'string') entity[key] = trimmed(entity[key])\n }\n if (entity['address'] && typeof entity['address'] === 'object') {\n const address = { ...(entity['address'] as Record<string, unknown>) }\n for (const [key, value] of Object.entries(address)) {\n if (typeof value === 'string') address[key] = trimmed(value)\n }\n entity['address'] = address\n }\n seo['entity'] = entity\n\n const business = { ...((fields?.['business'] as Record<string, unknown>) ?? {}) }\n const email = trimmed(entity['email'])\n if (email) business['supportEmail'] = email\n else if (trimmed(stored?.business?.supportEmail)) business['supportEmail'] = ''\n else delete business['supportEmail']\n\n const before = structuredAddressLine(stored?.seo?.entity?.address)\n const after = structuredAddressLine(\n entity['address'] as HostSeoEntity['address'] | undefined,\n )\n if (after !== before) {\n if (after) business['address'] = after\n else if (trimmed(stored?.business?.address)) business['address'] = ''\n else delete business['address']\n }\n\n if (Array.isArray(business['socialLinks'])) {\n business['socialLinks'] = (business['socialLinks'] as unknown[])\n .map((link) => link as { label?: unknown; url?: unknown } | null)\n .filter((link) => trimmed(link?.url))\n .slice(0, BUSINESS_SOCIAL_LINKS_MAX)\n .map((link) => ({ label: trimmed(link?.label), url: trimmed(link?.url) }))\n }\n\n return { ...fields, seo, business }\n}\n"],"names":["structuredAddressLine","siteContactEmail","SITE_SLOGAN_MAX_LENGTH","BUSINESS_SOCIAL_LINKS_MAX","BUSINESS_DETAILS_CLEARABLE_PATHS","BUSINESS_DETAILS_CLEARABLE_PATH_LIST","trimmed","value","trim","businessDetailsSeed","host","email","seo","entity","businessDetailsWrite","fields","stored","key","address","Object","entries","business","supportEmail","before","after","Array","isArray","map","link","filter","url","slice","label"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,qBAAqB,QAAQ,wBAAoB;AAE1D,SAASC,gBAAgB,QAAQ,mBAAe;AAEhD;;;;;;;;;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C,KAAK,CAAC,GAAG5B,2BACTwB,GAAG,CAAC,CAACC,OAAU,CAAA;gBAAEI,OAAO1B,QAAQsB,wBAAAA,KAAMI,KAAK;gBAAGF,KAAKxB,QAAQsB,wBAAAA,KAAME,GAAG;YAAE,CAAA;IAC3E;IAEA,OAAO,aAAKf;QAAQH;QAAKS;;AAC3B"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/business-details.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { structuredAddressLine } from './business-profile'\nimport type { HostSeoEntity } from './content-authors'\nimport { siteContactEmail } from './host-tokens'\n\n/**\n * A site's BUSINESS DETAILS, entered in one place (AGL-4136).\n *\n * The business name, slogan, phone, email, postal address and social links\n * are entered on Setup → Business profile and nowhere else, and everything that uses\n * them reads that one place. The storage did not move, so no site's data had\n * to: each fact has one canonical path, and the older path that used to hold\n * it is kept as a read fallback.\n *\n * | fact | canonical | kept in step |\n * | ------------ | ----------------------------- | -------------------------- |\n * | name | `seo.entity.name` | falls back to `displayName` |\n * | slogan | `seo.entity.slogan` | |\n * | phone | `seo.entity.telephone` | |\n * | email | `seo.entity.email` | mirrored to `business.supportEmail` |\n * | address | `seo.entity.address.*` | mirrored, formatted, to `business.address` |\n * | social links | `business.socialLinks` | `seo.entity.sameAs` joins it when read |\n *\n * The two mirrors exist for the readers that have not moved yet: the native\n * apps read and write the `business` copies, so a save here keeps them\n * showing what the console shows until they follow.\n */\n\n/** The longest slogan a site may set, as the field and the structured data hold it. */\nexport const SITE_SLOGAN_MAX_LENGTH = 120\n\n/** The most social links a site keeps, as the editor allows them. */\nexport const BUSINESS_SOCIAL_LINKS_MAX = 8\n\n/** The longest business name the Business details card accepts (AGL-4235). */\nexport const BUSINESS_NAME_MAX_LENGTH = 200\n\n/** The longest phone number the Business details card accepts (AGL-4235). */\nexport const BUSINESS_PHONE_MAX_LENGTH = 64\n\n/**\n * What the Business details card accepts as an email address, as a pattern\n * source (AGL-4235): something, an `@`, something, a dot, something. Leading\n * and trailing spaces pass, because the save trims them.\n */\nexport const BUSINESS_EMAIL_PATTERN = '^\\\\s*[^\\\\s@]+@[^\\\\s@]+\\\\.[^\\\\s@]+\\\\s*$'\n\n/**\n * The paths a Setup → Business profile save may take back to EMPTY.\n *\n * The form drops a cleared input from what it submits, and the write merges,\n * so without this a cleared phone would save nothing and report \"Saved!\".\n * Both mirrors are here as well: an email or address cleared on the card has\n * to leave its copy too, or the fallback would bring it straight back.\n */\nexport const BUSINESS_DETAILS_CLEARABLE_PATHS = [\n 'seo.entity.name',\n 'seo.entity.slogan',\n 'seo.entity.telephone',\n 'seo.entity.email',\n 'seo.entity.address.streetAddress',\n 'seo.entity.address.addressLocality',\n 'seo.entity.address.addressRegion',\n 'seo.entity.address.postalCode',\n 'seo.entity.address.addressCountry',\n 'business.supportEmail',\n 'business.address',\n] as const\n\n/**\n * {@link BUSINESS_DETAILS_CLEARABLE_PATHS} as a plain list: the native apps' Business details\n * cards read it from the contracts, and so clear what the console clears.\n */\nexport const BUSINESS_DETAILS_CLEARABLE_PATH_LIST: readonly string[] =\n BUSINESS_DETAILS_CLEARABLE_PATHS\n\n/** The host fields the business details read and write. */\nexport interface BusinessDetailsHost {\n displayName?: string\n seo?: {\n entity?: Pick<\n HostSeoEntity,\n 'name' | 'slogan' | 'telephone' | 'email' | 'address'\n > | null\n } | null\n business?: {\n supportEmail?: unknown\n address?: unknown\n socialLinks?: Array<{ label?: unknown; url?: unknown } | null> | null\n } | null\n}\n\nconst trimmed = (value: unknown): string =>\n typeof value === 'string' ? value.trim() : ''\n\n/**\n * The host document as the Business details card is seeded with it: the\n * site's one email in the Email field, so a site whose email so far lived\n * only in the one-block copy shows it, and clearing the field clears it.\n * Everything else is the document as stored. A new object; `host` is not\n * changed.\n */\nexport function businessDetailsSeed<T extends BusinessDetailsHost>(\n host: T | null | undefined,\n): T | null | undefined {\n if (!host) return host\n const email = siteContactEmail(host)\n if (!email || trimmed(host.seo?.entity?.email)) return host\n return {\n ...host,\n seo: { ...(host.seo ?? {}), entity: { ...(host.seo?.entity ?? {}), email } },\n }\n}\n\n/**\n * What a Setup → Business profile save writes, from what the card submitted and what\n * the document stores now (AGL-4136):\n *\n * - every text value trimmed;\n * - the email mirrored into `business.supportEmail`, `''` when it was cleared\n * (a clearable path, so the save deletes it);\n * - the structured address mirrored, as the one line every reader prints,\n * into `business.address` — but ONLY when the structured address changed.\n * A site whose address so far lives only in the one block keeps that block\n * through a save that never touched the address, rather than losing it to\n * an empty structured one;\n * - social links without an address dropped, each label and address trimmed,\n * up to {@link BUSINESS_SOCIAL_LINKS_MAX}.\n *\n * A new object: the form's values are not this function's to edit.\n */\nexport function businessDetailsWrite<T extends Record<string, unknown>>(\n fields: T,\n stored: BusinessDetailsHost | null | undefined,\n): T {\n const seo = { ...((fields?.['seo'] as Record<string, unknown>) ?? {}) }\n const entity = { ...((seo['entity'] as Record<string, unknown>) ?? {}) }\n for (const key of ['name', 'slogan', 'telephone', 'email'] as const) {\n if (typeof entity[key] === 'string') entity[key] = trimmed(entity[key])\n }\n if (entity['address'] && typeof entity['address'] === 'object') {\n const address = { ...(entity['address'] as Record<string, unknown>) }\n for (const [key, value] of Object.entries(address)) {\n if (typeof value === 'string') address[key] = trimmed(value)\n }\n entity['address'] = address\n }\n seo['entity'] = entity\n\n const business = { ...((fields?.['business'] as Record<string, unknown>) ?? {}) }\n const email = trimmed(entity['email'])\n if (email) business['supportEmail'] = email\n else if (trimmed(stored?.business?.supportEmail)) business['supportEmail'] = ''\n else delete business['supportEmail']\n\n const before = structuredAddressLine(stored?.seo?.entity?.address)\n const after = structuredAddressLine(\n entity['address'] as HostSeoEntity['address'] | undefined,\n )\n if (after !== before) {\n if (after) business['address'] = after\n else if (trimmed(stored?.business?.address)) business['address'] = ''\n else delete business['address']\n }\n\n if (Array.isArray(business['socialLinks'])) {\n business['socialLinks'] = (business['socialLinks'] as unknown[])\n .map((link) => link as { label?: unknown; url?: unknown } | null)\n .filter((link) => trimmed(link?.url))\n .slice(0, BUSINESS_SOCIAL_LINKS_MAX)\n .map((link) => ({ label: trimmed(link?.label), url: trimmed(link?.url) }))\n }\n\n return { ...fields, seo, business }\n}\n"],"names":["structuredAddressLine","siteContactEmail","SITE_SLOGAN_MAX_LENGTH","BUSINESS_SOCIAL_LINKS_MAX","BUSINESS_NAME_MAX_LENGTH","BUSINESS_PHONE_MAX_LENGTH","BUSINESS_EMAIL_PATTERN","BUSINESS_DETAILS_CLEARABLE_PATHS","BUSINESS_DETAILS_CLEARABLE_PATH_LIST","trimmed","value","trim","businessDetailsSeed","host","email","seo","entity","businessDetailsWrite","fields","stored","key","address","Object","entries","business","supportEmail","before","after","Array","isArray","map","link","filter","url","slice","label"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,qBAAqB,QAAQ,wBAAoB;AAE1D,SAASC,gBAAgB,QAAQ,mBAAe;AAEhD;;;;;;;;;;;;;;;;;;;;;CAqBC,GAED,qFAAqF,GACrF,OAAO,MAAMC,yBAAyB,IAAG;AAEzC,mEAAmE,GACnE,OAAO,MAAMC,4BAA4B,EAAC;AAE1C,4EAA4E,GAC5E,OAAO,MAAMC,2BAA2B,IAAG;AAE3C,2EAA2E,GAC3E,OAAO,MAAMC,4BAA4B,GAAE;AAE3C;;;;CAIC,GACD,OAAO,MAAMC,yBAAyB,yCAAwC;AAE9E;;;;;;;CAOC,GACD,OAAO,MAAMC,mCAAmC;IAC9C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAEV;;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@ export declare const PLUGIN_DOCS_ANCHORS: {
624
624
  readonly commerceEndToEnd: readonly ["#1-connect-payments", "#2-create-products", "#3-design-the-storefront", "#catalog-search-filters-and-sort", "#category-pages", "#the-product-page-template", "#4-what-checkout-does", "#paying-without-leaving-your-site", "#5-run-orders-from-the-console", "#6-subscriptions--the-stripe-portal", "#member-updates", "#related"];
625
625
  readonly companies: readonly ["#the-companies-list", "#create-a-company", "#the-lists-behind-the-choices", "#a-companys-page", "#contact-roles", "#contacts-at-a-company", "#linked-on-capture", "#import", "#export", "#deleting-a-company", "#who-can-see-a-company", "#files", "#related"];
626
626
  readonly connectOtherAccounting: readonly ["#before-you-start", "#connect", "#choose-your-books", "#choose-your-accounts", "#what-is-posted", "#sales-before-you-connected", "#when-something-does-not-post", "#disconnect", "#related"];
627
- readonly connectQuickbooksOnline: readonly ["#before-you-start", "#connect", "#choose-your-accounts", "#what-is-posted", "#how-each-payment-is-posted", "#sales-tax-collected-by-aglyn", "#one-summary-a-day-instead", "#currency", "#sales-before-you-connected", "#when-something-does-not-post", "#disconnect"];
628
- readonly connectXero: readonly ["#before-you-start", "#connect", "#choose-an-organization", "#choose-your-accounts", "#what-is-posted", "#how-each-payment-is-posted", "#sales-tax-collected-by-aglyn", "#one-summary-a-day-instead", "#currency", "#sales-before-you-connected", "#when-something-does-not-post", "#disconnect"];
627
+ readonly connectQuickbooksOnline: readonly ["#before-you-start", "#connect", "#choose-your-accounts", "#what-is-posted", "#how-each-payment-is-posted", "#automatic-sales-tax", "#one-summary-a-day-instead", "#currency", "#sales-before-you-connected", "#when-something-does-not-post", "#disconnect"];
628
+ readonly connectXero: readonly ["#before-you-start", "#connect", "#choose-an-organization", "#choose-your-accounts", "#what-is-posted", "#how-each-payment-is-posted", "#automatic-sales-tax", "#one-summary-a-day-instead", "#currency", "#sales-before-you-connected", "#when-something-does-not-post", "#disconnect"];
629
629
  readonly consoleTour: readonly ["#the-app-bar", "#choose-a-workspace", "#in-context-help", "#filter-and-search", "#primary-navigation", "#editing-vs-managing", "#the-sites-list", "#a-site-card", "#the-status-pill", "#how-the-pill-is-decided", "#your-site-allowance", "#a-sites-dashboard", "#recent-activity", "#next", "#workspace-settings--notifications", "#organization-settings", "#organization-general", "#the-notifications-feed", "#all-notifications", "#notification-levels", "#notification-settings", "#one-kind-at-a-time", "#workspace-and-site-overrides", "#daily-digests", "#notification-sound", "#alerts-on-this-device"];
630
630
  readonly contactActivities: readonly ["#four-kinds-of-history", "#reading-the-timeline", "#campaign-email", "#logging-an-activity", "#who-what-and-which-company", "#meeting-from-a-booking", "#click-to-call", "#sending-an-email", "#delivery-states", "#captured-email", "#where-an-activity-is-visible", "#the-recent-activity-feed", "#related"];
631
631
  readonly contactFields: readonly ["#define-a-field", "#fields-per-record", "#where-values-show", "#currency-fields", "#save-a-form-field", "#picklist-values", "#task-picklists", "#over-the-api", "#retire-restore-delete", "#export-fields", "#recompute-next-activity", "#related"];
@@ -1206,7 +1206,7 @@ export const PLUGIN_DOCS_ANCHORS = {
1206
1206
  '#choose-your-accounts',
1207
1207
  '#what-is-posted',
1208
1208
  '#how-each-payment-is-posted',
1209
- '#sales-tax-collected-by-aglyn',
1209
+ '#automatic-sales-tax',
1210
1210
  '#one-summary-a-day-instead',
1211
1211
  '#currency',
1212
1212
  '#sales-before-you-connected',
@@ -1220,7 +1220,7 @@ export const PLUGIN_DOCS_ANCHORS = {
1220
1220
  '#choose-your-accounts',
1221
1221
  '#what-is-posted',
1222
1222
  '#how-each-payment-is-posted',
1223
- '#sales-tax-collected-by-aglyn',
1223
+ '#automatic-sales-tax',
1224
1224
  '#one-summary-a-day-instead',
1225
1225
  '#currency',
1226
1226
  '#sales-before-you-connected',