diff --git a/brutal.css b/brutal.css
index 4436257..240845b 100644
--- a/brutal.css
+++ b/brutal.css
@@ -123,7 +123,7 @@ h3 {
font-size: var(--header-font-size);
}
-p, section > ul, section > ol, section > bsky-comments {
+p, section > ul, section > ol {
margin: 0 1rem 1rem 1rem;
max-width: 70ch;
line-height: 1.4;
diff --git a/bsky-comments.js b/bsky-comments.js
deleted file mode 100644
index 80f153e..0000000
--- a/bsky-comments.js
+++ /dev/null
@@ -1,186 +0,0 @@
-
-import { LitElement, html, css, nothing } from "lit";
-import { RichText } from '@atproto/api';
-
-class BskyComments extends LitElement {
- static properties = {
- url: {},
- data: { attribute: false },
- error: { attribute: false },
- };
- static styles = css`
- :host {
- display: block;
- }
- `;
- async connectedCallback () {
- super.connectedCallback();
- console.warn(`URL:`, this.url, atURL(this.url));
- const res = await fetch(
- `https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?${new URLSearchParams({ uri: atURL(this.url) }).toString()}`,
- {
- method: 'GET',
- headers: { "Accept": "application/json" },
- cache: "no-store",
- },
- );
- if (!res.ok) {
- this.error = `Failed to fetch post thread: ${await res.text()}`;
- return;
- }
- this.data = await res.json();
- }
- render() {
- let content = html`
loading…
`;
- if (this.error) content = html`${this.error}
`
- else if (this.data?.thread) {
- content = html``;
- console.log(this.data.thread);
- }
- return html`
- ${content}
-
`;
- }
-}
-customElements.define("bsky-comments", BskyComments);
-
-// XXX
-// - reply link
-// - counts
-class BskyPost extends LitElement {
- static properties = {
- post: { attribute: false },
- };
- static styles = css`
- :host {
- display: block;
- }
- .content {
- display: flex;
- gap: 1rem;
- }
- .avatar {
- max-width: 42px;
- }
- .avatar img {
- border-radius: 21px;
- }
- .rich-text {
- white-space: pre-wrap;
- overflow-wrap: break-word;
- }
- .replies {
- margin-top: 1rem;
- padding-left: 0.5rem;
- border-left: 1px solid #ccc;
- }
- .meta {
- color: rgb(66, 87, 108);
- }
- .meta strong {
- color: #000;
- }
- .meta a {
- color: inherit;
- text-decoration: none;
- }
- .images, .external {
- max-width: 500px;
- border-radius: 10px;
- margin: 1rem;
- border: 1px solid #ccc;
- overflow: hidden;
- }
- .images img, .external img {
- max-width: 100%;
- }
- .images a, .external a {
- text-decoration: none;
- color: inherit;
- }
- .title {
- font-weight: bold;
- margin: 0 1rem;
- }
- .description {
- margin: 0 1rem 1rem 1rem;
- }
- a {
- text-decoration: none;
- }
- `;
- render () {
- if (!this.post) return html`loading post…
`;
- const { post: { uri, author, record, embed, replyCount, repostCount, likeCount, quoteCount }, replies = [] } = this.post;
- const rid = uri.replace(/.+\//, '');
- const rt = new RichText(record);
- const textContent = [];
- let embeds = nothing;
- if (embed) {
- if (embed.images) {
- embeds = html`${embed.images.map(({ thumb, alt, fullsize }) => html`

`)}
`;
- }
- else if (embed.external) {
- const { title, description, thumb, uri } = embed.external;
- embeds = html``;
- }
- }
- for (const seg of rt.segments()) {
- if (seg.isLink()) textContent.push(html`${sane(seg.text)}`);
- else if (seg.isMention()) textContent.push(html`${sane(seg.text)}`);
- else if (seg.isTag()) textContent.push(html`${sane(seg.text)}`);
- else textContent.push(sane(seg.text));
- }
- const link = `https://bsky.app/profile/${author.handle}/post/${rid}`;
- return html`
-
-
-
-
-
${textContent}
- ${ embeds || nothing }
-
-
-
- ${replies.map(r => html``)}
-
-
`
- }
-}
-customElements.define("bsky-post", BskyPost);
-
-
-// --- Helpers
-function atURL (url) {
- if (!url.startsWith('at://') && url.includes('bsky.app/profile/')) {
- const match = url.match(/profile\/([\w.]+)\/post\/([\w]+)/);
- if (match) {
- const [, did, postId] = match;
- return `at://${did}/app.bsky.feed.post/${postId}`;
- }
- }
- return url;
-}
-
-function formatDate (str) {
- let [day, time] = str.split('T');
- time = time.replace(/\:\d\d\..+/, '');
- return `${day} ${time}`;
-}
-
-function sane (str) {
- return str.replace(/&/g, '&').replace(/ function __init() {
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
-};
-var __commonJS = (cb, mod) => function __require() {
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
-};
-var __export = (target, all) => {
- for (var name2 in all)
- __defProp(target, name2, { get: all[name2], enumerable: true });
-};
-var __copyProps = (to, from3, except, desc) => {
- if (from3 && typeof from3 === "object" || typeof from3 === "function") {
- for (let key of __getOwnPropNames(from3))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable });
- }
- return to;
-};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
- mod
-));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// node_modules/zod/lib/helpers/util.js
-var require_util = __commonJS({
- "node_modules/zod/lib/helpers/util.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0;
- var util;
- (function(util2) {
- util2.assertEqual = (val) => val;
- function assertIs(_arg) {
- }
- util2.assertIs = assertIs;
- function assertNever(_x) {
- throw new Error();
- }
- util2.assertNever = assertNever;
- util2.arrayToEnum = (items) => {
- const obj = {};
- for (const item of items) {
- obj[item] = item;
- }
- return obj;
- };
- util2.getValidEnumValues = (obj) => {
- const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
- const filtered = {};
- for (const k2 of validKeys) {
- filtered[k2] = obj[k2];
- }
- return util2.objectValues(filtered);
- };
- util2.objectValues = (obj) => {
- return util2.objectKeys(obj).map(function(e4) {
- return obj[e4];
- });
- };
- util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
- const keys = [];
- for (const key in object) {
- if (Object.prototype.hasOwnProperty.call(object, key)) {
- keys.push(key);
- }
- }
- return keys;
- };
- util2.find = (arr, checker) => {
- for (const item of arr) {
- if (checker(item))
- return item;
- }
- return void 0;
- };
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
- function joinValues(array, separator = " | ") {
- return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
- }
- util2.joinValues = joinValues;
- util2.jsonStringifyReplacer = (_2, value) => {
- if (typeof value === "bigint") {
- return value.toString();
- }
- return value;
- };
- })(util = exports.util || (exports.util = {}));
- var objectUtil;
- (function(objectUtil2) {
- objectUtil2.mergeShapes = (first, second) => {
- return {
- ...first,
- ...second
- // second overwrites first
- };
- };
- })(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
- exports.ZodParsedType = util.arrayToEnum([
- "string",
- "nan",
- "number",
- "integer",
- "float",
- "boolean",
- "date",
- "bigint",
- "symbol",
- "function",
- "undefined",
- "null",
- "array",
- "object",
- "unknown",
- "promise",
- "void",
- "never",
- "map",
- "set"
- ]);
- var getParsedType = (data) => {
- const t3 = typeof data;
- switch (t3) {
- case "undefined":
- return exports.ZodParsedType.undefined;
- case "string":
- return exports.ZodParsedType.string;
- case "number":
- return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number;
- case "boolean":
- return exports.ZodParsedType.boolean;
- case "function":
- return exports.ZodParsedType.function;
- case "bigint":
- return exports.ZodParsedType.bigint;
- case "symbol":
- return exports.ZodParsedType.symbol;
- case "object":
- if (Array.isArray(data)) {
- return exports.ZodParsedType.array;
- }
- if (data === null) {
- return exports.ZodParsedType.null;
- }
- if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
- return exports.ZodParsedType.promise;
- }
- if (typeof Map !== "undefined" && data instanceof Map) {
- return exports.ZodParsedType.map;
- }
- if (typeof Set !== "undefined" && data instanceof Set) {
- return exports.ZodParsedType.set;
- }
- if (typeof Date !== "undefined" && data instanceof Date) {
- return exports.ZodParsedType.date;
- }
- return exports.ZodParsedType.object;
- default:
- return exports.ZodParsedType.unknown;
- }
- };
- exports.getParsedType = getParsedType;
- }
-});
-
-// node_modules/zod/lib/ZodError.js
-var require_ZodError = __commonJS({
- "node_modules/zod/lib/ZodError.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
- var util_1 = require_util();
- exports.ZodIssueCode = util_1.util.arrayToEnum([
- "invalid_type",
- "invalid_literal",
- "custom",
- "invalid_union",
- "invalid_union_discriminator",
- "invalid_enum_value",
- "unrecognized_keys",
- "invalid_arguments",
- "invalid_return_type",
- "invalid_date",
- "invalid_string",
- "too_small",
- "too_big",
- "invalid_intersection_types",
- "not_multiple_of",
- "not_finite"
- ]);
- var quotelessJson = (obj) => {
- const json = JSON.stringify(obj, null, 2);
- return json.replace(/"([^"]+)":/g, "$1:");
- };
- exports.quotelessJson = quotelessJson;
- var ZodError = class _ZodError extends Error {
- constructor(issues) {
- super();
- this.issues = [];
- this.addIssue = (sub) => {
- this.issues = [...this.issues, sub];
- };
- this.addIssues = (subs = []) => {
- this.issues = [...this.issues, ...subs];
- };
- const actualProto = new.target.prototype;
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(this, actualProto);
- } else {
- this.__proto__ = actualProto;
- }
- this.name = "ZodError";
- this.issues = issues;
- }
- get errors() {
- return this.issues;
- }
- format(_mapper) {
- const mapper = _mapper || function(issue) {
- return issue.message;
- };
- const fieldErrors = { _errors: [] };
- const processError = (error) => {
- for (const issue of error.issues) {
- if (issue.code === "invalid_union") {
- issue.unionErrors.map(processError);
- } else if (issue.code === "invalid_return_type") {
- processError(issue.returnTypeError);
- } else if (issue.code === "invalid_arguments") {
- processError(issue.argumentsError);
- } else if (issue.path.length === 0) {
- fieldErrors._errors.push(mapper(issue));
- } else {
- let curr = fieldErrors;
- let i5 = 0;
- while (i5 < issue.path.length) {
- const el = issue.path[i5];
- const terminal = i5 === issue.path.length - 1;
- if (!terminal) {
- curr[el] = curr[el] || { _errors: [] };
- } else {
- curr[el] = curr[el] || { _errors: [] };
- curr[el]._errors.push(mapper(issue));
- }
- curr = curr[el];
- i5++;
- }
- }
- }
- };
- processError(this);
- return fieldErrors;
- }
- static assert(value) {
- if (!(value instanceof _ZodError)) {
- throw new Error(`Not a ZodError: ${value}`);
- }
- }
- toString() {
- return this.message;
- }
- get message() {
- return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
- }
- get isEmpty() {
- return this.issues.length === 0;
- }
- flatten(mapper = (issue) => issue.message) {
- const fieldErrors = {};
- const formErrors = [];
- for (const sub of this.issues) {
- if (sub.path.length > 0) {
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
- fieldErrors[sub.path[0]].push(mapper(sub));
- } else {
- formErrors.push(mapper(sub));
- }
- }
- return { formErrors, fieldErrors };
- }
- get formErrors() {
- return this.flatten();
- }
- };
- exports.ZodError = ZodError;
- ZodError.create = (issues) => {
- const error = new ZodError(issues);
- return error;
- };
- }
-});
-
-// node_modules/zod/lib/locales/en.js
-var require_en = __commonJS({
- "node_modules/zod/lib/locales/en.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = require_util();
- var ZodError_1 = require_ZodError();
- var errorMap = (issue, _ctx) => {
- let message;
- switch (issue.code) {
- case ZodError_1.ZodIssueCode.invalid_type:
- if (issue.received === util_1.ZodParsedType.undefined) {
- message = "Required";
- } else {
- message = `Expected ${issue.expected}, received ${issue.received}`;
- }
- break;
- case ZodError_1.ZodIssueCode.invalid_literal:
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;
- break;
- case ZodError_1.ZodIssueCode.unrecognized_keys:
- message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
- break;
- case ZodError_1.ZodIssueCode.invalid_union:
- message = `Invalid input`;
- break;
- case ZodError_1.ZodIssueCode.invalid_union_discriminator:
- message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
- break;
- case ZodError_1.ZodIssueCode.invalid_enum_value:
- message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
- break;
- case ZodError_1.ZodIssueCode.invalid_arguments:
- message = `Invalid function arguments`;
- break;
- case ZodError_1.ZodIssueCode.invalid_return_type:
- message = `Invalid function return type`;
- break;
- case ZodError_1.ZodIssueCode.invalid_date:
- message = `Invalid date`;
- break;
- case ZodError_1.ZodIssueCode.invalid_string:
- if (typeof issue.validation === "object") {
- if ("includes" in issue.validation) {
- message = `Invalid input: must include "${issue.validation.includes}"`;
- if (typeof issue.validation.position === "number") {
- message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
- }
- } else if ("startsWith" in issue.validation) {
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
- } else if ("endsWith" in issue.validation) {
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
- } else {
- util_1.util.assertNever(issue.validation);
- }
- } else if (issue.validation !== "regex") {
- message = `Invalid ${issue.validation}`;
- } else {
- message = "Invalid";
- }
- break;
- case ZodError_1.ZodIssueCode.too_small:
- if (issue.type === "array")
- message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
- else if (issue.type === "string")
- message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
- else if (issue.type === "number")
- message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
- else if (issue.type === "date")
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
- else
- message = "Invalid input";
- break;
- case ZodError_1.ZodIssueCode.too_big:
- if (issue.type === "array")
- message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
- else if (issue.type === "string")
- message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
- else if (issue.type === "number")
- message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
- else if (issue.type === "bigint")
- message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
- else if (issue.type === "date")
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
- else
- message = "Invalid input";
- break;
- case ZodError_1.ZodIssueCode.custom:
- message = `Invalid input`;
- break;
- case ZodError_1.ZodIssueCode.invalid_intersection_types:
- message = `Intersection results could not be merged`;
- break;
- case ZodError_1.ZodIssueCode.not_multiple_of:
- message = `Number must be a multiple of ${issue.multipleOf}`;
- break;
- case ZodError_1.ZodIssueCode.not_finite:
- message = "Number must be finite";
- break;
- default:
- message = _ctx.defaultError;
- util_1.util.assertNever(issue);
- }
- return { message };
- };
- exports.default = errorMap;
- }
-});
-
-// node_modules/zod/lib/errors.js
-var require_errors = __commonJS({
- "node_modules/zod/lib/errors.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
- var en_1 = __importDefault(require_en());
- exports.defaultErrorMap = en_1.default;
- var overrideErrorMap = en_1.default;
- function setErrorMap(map) {
- overrideErrorMap = map;
- }
- exports.setErrorMap = setErrorMap;
- function getErrorMap() {
- return overrideErrorMap;
- }
- exports.getErrorMap = getErrorMap;
- }
-});
-
-// node_modules/zod/lib/helpers/parseUtil.js
-var require_parseUtil = __commonJS({
- "node_modules/zod/lib/helpers/parseUtil.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
- var errors_1 = require_errors();
- var en_1 = __importDefault(require_en());
- var makeIssue = (params) => {
- const { data, path, errorMaps, issueData } = params;
- const fullPath = [...path, ...issueData.path || []];
- const fullIssue = {
- ...issueData,
- path: fullPath
- };
- if (issueData.message !== void 0) {
- return {
- ...issueData,
- path: fullPath,
- message: issueData.message
- };
- }
- let errorMessage = "";
- const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
- for (const map of maps) {
- errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
- }
- return {
- ...issueData,
- path: fullPath,
- message: errorMessage
- };
- };
- exports.makeIssue = makeIssue;
- exports.EMPTY_PATH = [];
- function addIssueToContext(ctx, issueData) {
- const overrideMap = (0, errors_1.getErrorMap)();
- const issue = (0, exports.makeIssue)({
- issueData,
- data: ctx.data,
- path: ctx.path,
- errorMaps: [
- ctx.common.contextualErrorMap,
- ctx.schemaErrorMap,
- overrideMap,
- overrideMap === en_1.default ? void 0 : en_1.default
- // then global default map
- ].filter((x2) => !!x2)
- });
- ctx.common.issues.push(issue);
- }
- exports.addIssueToContext = addIssueToContext;
- var ParseStatus = class _ParseStatus {
- constructor() {
- this.value = "valid";
- }
- dirty() {
- if (this.value === "valid")
- this.value = "dirty";
- }
- abort() {
- if (this.value !== "aborted")
- this.value = "aborted";
- }
- static mergeArray(status, results) {
- const arrayValue = [];
- for (const s3 of results) {
- if (s3.status === "aborted")
- return exports.INVALID;
- if (s3.status === "dirty")
- status.dirty();
- arrayValue.push(s3.value);
- }
- return { status: status.value, value: arrayValue };
- }
- static async mergeObjectAsync(status, pairs) {
- const syncPairs = [];
- for (const pair of pairs) {
- const key = await pair.key;
- const value = await pair.value;
- syncPairs.push({
- key,
- value
- });
- }
- return _ParseStatus.mergeObjectSync(status, syncPairs);
- }
- static mergeObjectSync(status, pairs) {
- const finalObject = {};
- for (const pair of pairs) {
- const { key, value } = pair;
- if (key.status === "aborted")
- return exports.INVALID;
- if (value.status === "aborted")
- return exports.INVALID;
- if (key.status === "dirty")
- status.dirty();
- if (value.status === "dirty")
- status.dirty();
- if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
- finalObject[key.value] = value.value;
- }
- }
- return { status: status.value, value: finalObject };
- }
- };
- exports.ParseStatus = ParseStatus;
- exports.INVALID = Object.freeze({
- status: "aborted"
- });
- var DIRTY = (value) => ({ status: "dirty", value });
- exports.DIRTY = DIRTY;
- var OK = (value) => ({ status: "valid", value });
- exports.OK = OK;
- var isAborted = (x2) => x2.status === "aborted";
- exports.isAborted = isAborted;
- var isDirty = (x2) => x2.status === "dirty";
- exports.isDirty = isDirty;
- var isValid = (x2) => x2.status === "valid";
- exports.isValid = isValid;
- var isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
- exports.isAsync = isAsync;
- }
-});
-
-// node_modules/zod/lib/helpers/typeAliases.js
-var require_typeAliases = __commonJS({
- "node_modules/zod/lib/helpers/typeAliases.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- }
-});
-
-// node_modules/zod/lib/helpers/errorUtil.js
-var require_errorUtil = __commonJS({
- "node_modules/zod/lib/helpers/errorUtil.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.errorUtil = void 0;
- var errorUtil;
- (function(errorUtil2) {
- errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
- })(errorUtil = exports.errorUtil || (exports.errorUtil = {}));
- }
-});
-
-// node_modules/zod/lib/types.js
-var require_types = __commonJS({
- "node_modules/zod/lib/types.js"(exports) {
- "use strict";
- var __classPrivateFieldGet = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f3) {
- if (kind === "a" && !f3) throw new TypeError("Private accessor was defined without a getter");
- if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
- return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver);
- };
- var __classPrivateFieldSet = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f3) {
- if (kind === "m") throw new TypeError("Private method is not writable");
- if (kind === "a" && !f3) throw new TypeError("Private accessor was defined without a setter");
- if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
- return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value;
- };
- var _ZodEnum_cache;
- var _ZodNativeEnum_cache;
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.datetimeRegex = exports.ZodType = void 0;
- exports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = exports.date = void 0;
- var errors_1 = require_errors();
- var errorUtil_1 = require_errorUtil();
- var parseUtil_1 = require_parseUtil();
- var util_1 = require_util();
- var ZodError_1 = require_ZodError();
- var ParseInputLazyPath = class {
- constructor(parent, value, path, key) {
- this._cachedPath = [];
- this.parent = parent;
- this.data = value;
- this._path = path;
- this._key = key;
- }
- get path() {
- if (!this._cachedPath.length) {
- if (this._key instanceof Array) {
- this._cachedPath.push(...this._path, ...this._key);
- } else {
- this._cachedPath.push(...this._path, this._key);
- }
- }
- return this._cachedPath;
- }
- };
- var handleResult = (ctx, result) => {
- if ((0, parseUtil_1.isValid)(result)) {
- return { success: true, data: result.value };
- } else {
- if (!ctx.common.issues.length) {
- throw new Error("Validation failed but no issues detected.");
- }
- return {
- success: false,
- get error() {
- if (this._error)
- return this._error;
- const error = new ZodError_1.ZodError(ctx.common.issues);
- this._error = error;
- return this._error;
- }
- };
- }
- };
- function processCreateParams(params) {
- if (!params)
- return {};
- const { errorMap, invalid_type_error, required_error, description } = params;
- if (errorMap && (invalid_type_error || required_error)) {
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
- }
- if (errorMap)
- return { errorMap, description };
- const customMap = (iss, ctx) => {
- var _a, _b;
- const { message } = params;
- if (iss.code === "invalid_enum_value") {
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
- }
- if (typeof ctx.data === "undefined") {
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
- }
- if (iss.code !== "invalid_type")
- return { message: ctx.defaultError };
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
- };
- return { errorMap: customMap, description };
- }
- var ZodType = class {
- constructor(def) {
- this.spa = this.safeParseAsync;
- this._def = def;
- this.parse = this.parse.bind(this);
- this.safeParse = this.safeParse.bind(this);
- this.parseAsync = this.parseAsync.bind(this);
- this.safeParseAsync = this.safeParseAsync.bind(this);
- this.spa = this.spa.bind(this);
- this.refine = this.refine.bind(this);
- this.refinement = this.refinement.bind(this);
- this.superRefine = this.superRefine.bind(this);
- this.optional = this.optional.bind(this);
- this.nullable = this.nullable.bind(this);
- this.nullish = this.nullish.bind(this);
- this.array = this.array.bind(this);
- this.promise = this.promise.bind(this);
- this.or = this.or.bind(this);
- this.and = this.and.bind(this);
- this.transform = this.transform.bind(this);
- this.brand = this.brand.bind(this);
- this.default = this.default.bind(this);
- this.catch = this.catch.bind(this);
- this.describe = this.describe.bind(this);
- this.pipe = this.pipe.bind(this);
- this.readonly = this.readonly.bind(this);
- this.isNullable = this.isNullable.bind(this);
- this.isOptional = this.isOptional.bind(this);
- }
- get description() {
- return this._def.description;
- }
- _getType(input) {
- return (0, util_1.getParsedType)(input.data);
- }
- _getOrReturnCtx(input, ctx) {
- return ctx || {
- common: input.parent.common,
- data: input.data,
- parsedType: (0, util_1.getParsedType)(input.data),
- schemaErrorMap: this._def.errorMap,
- path: input.path,
- parent: input.parent
- };
- }
- _processInputParams(input) {
- return {
- status: new parseUtil_1.ParseStatus(),
- ctx: {
- common: input.parent.common,
- data: input.data,
- parsedType: (0, util_1.getParsedType)(input.data),
- schemaErrorMap: this._def.errorMap,
- path: input.path,
- parent: input.parent
- }
- };
- }
- _parseSync(input) {
- const result = this._parse(input);
- if ((0, parseUtil_1.isAsync)(result)) {
- throw new Error("Synchronous parse encountered promise.");
- }
- return result;
- }
- _parseAsync(input) {
- const result = this._parse(input);
- return Promise.resolve(result);
- }
- parse(data, params) {
- const result = this.safeParse(data, params);
- if (result.success)
- return result.data;
- throw result.error;
- }
- safeParse(data, params) {
- var _a;
- const ctx = {
- common: {
- issues: [],
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
- },
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
- schemaErrorMap: this._def.errorMap,
- parent: null,
- data,
- parsedType: (0, util_1.getParsedType)(data)
- };
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
- return handleResult(ctx, result);
- }
- async parseAsync(data, params) {
- const result = await this.safeParseAsync(data, params);
- if (result.success)
- return result.data;
- throw result.error;
- }
- async safeParseAsync(data, params) {
- const ctx = {
- common: {
- issues: [],
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
- async: true
- },
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
- schemaErrorMap: this._def.errorMap,
- parent: null,
- data,
- parsedType: (0, util_1.getParsedType)(data)
- };
- const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
- const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
- return handleResult(ctx, result);
- }
- refine(check, message) {
- const getIssueProperties = (val) => {
- if (typeof message === "string" || typeof message === "undefined") {
- return { message };
- } else if (typeof message === "function") {
- return message(val);
- } else {
- return message;
- }
- };
- return this._refinement((val, ctx) => {
- const result = check(val);
- const setError = () => ctx.addIssue({
- code: ZodError_1.ZodIssueCode.custom,
- ...getIssueProperties(val)
- });
- if (typeof Promise !== "undefined" && result instanceof Promise) {
- return result.then((data) => {
- if (!data) {
- setError();
- return false;
- } else {
- return true;
- }
- });
- }
- if (!result) {
- setError();
- return false;
- } else {
- return true;
- }
- });
- }
- refinement(check, refinementData) {
- return this._refinement((val, ctx) => {
- if (!check(val)) {
- ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
- return false;
- } else {
- return true;
- }
- });
- }
- _refinement(refinement) {
- return new ZodEffects({
- schema: this,
- typeName: ZodFirstPartyTypeKind.ZodEffects,
- effect: { type: "refinement", refinement }
- });
- }
- superRefine(refinement) {
- return this._refinement(refinement);
- }
- optional() {
- return ZodOptional.create(this, this._def);
- }
- nullable() {
- return ZodNullable.create(this, this._def);
- }
- nullish() {
- return this.nullable().optional();
- }
- array() {
- return ZodArray.create(this, this._def);
- }
- promise() {
- return ZodPromise.create(this, this._def);
- }
- or(option) {
- return ZodUnion.create([this, option], this._def);
- }
- and(incoming) {
- return ZodIntersection.create(this, incoming, this._def);
- }
- transform(transform) {
- return new ZodEffects({
- ...processCreateParams(this._def),
- schema: this,
- typeName: ZodFirstPartyTypeKind.ZodEffects,
- effect: { type: "transform", transform }
- });
- }
- default(def) {
- const defaultValueFunc = typeof def === "function" ? def : () => def;
- return new ZodDefault({
- ...processCreateParams(this._def),
- innerType: this,
- defaultValue: defaultValueFunc,
- typeName: ZodFirstPartyTypeKind.ZodDefault
- });
- }
- brand() {
- return new ZodBranded({
- typeName: ZodFirstPartyTypeKind.ZodBranded,
- type: this,
- ...processCreateParams(this._def)
- });
- }
- catch(def) {
- const catchValueFunc = typeof def === "function" ? def : () => def;
- return new ZodCatch({
- ...processCreateParams(this._def),
- innerType: this,
- catchValue: catchValueFunc,
- typeName: ZodFirstPartyTypeKind.ZodCatch
- });
- }
- describe(description) {
- const This = this.constructor;
- return new This({
- ...this._def,
- description
- });
- }
- pipe(target) {
- return ZodPipeline.create(this, target);
- }
- readonly() {
- return ZodReadonly.create(this);
- }
- isOptional() {
- return this.safeParse(void 0).success;
- }
- isNullable() {
- return this.safeParse(null).success;
- }
- };
- exports.ZodType = ZodType;
- exports.Schema = ZodType;
- exports.ZodSchema = ZodType;
- var cuidRegex = /^c[^\s-]{8,}$/i;
- var cuid2Regex = /^[0-9a-z]+$/;
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
- var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
- var nanoidRegex = /^[a-z0-9_-]{21}$/i;
- var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
- var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
- var emojiRegex;
- var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
- var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
- var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
- var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
- var dateRegex = new RegExp(`^${dateRegexSource}$`);
- function timeRegexSource(args) {
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
- if (args.precision) {
- regex = `${regex}\\.\\d{${args.precision}}`;
- } else if (args.precision == null) {
- regex = `${regex}(\\.\\d+)?`;
- }
- return regex;
- }
- function timeRegex(args) {
- return new RegExp(`^${timeRegexSource(args)}$`);
- }
- function datetimeRegex(args) {
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
- const opts = [];
- opts.push(args.local ? `Z?` : `Z`);
- if (args.offset)
- opts.push(`([+-]\\d{2}:?\\d{2})`);
- regex = `${regex}(${opts.join("|")})`;
- return new RegExp(`^${regex}$`);
- }
- exports.datetimeRegex = datetimeRegex;
- function isValidIP(ip, version2) {
- if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
- return true;
- }
- if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
- return true;
- }
- return false;
- }
- var ZodString = class _ZodString extends ZodType {
- _parse(input) {
- if (this._def.coerce) {
- input.data = String(input.data);
- }
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.string) {
- const ctx2 = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx2, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.string,
- received: ctx2.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const status = new parseUtil_1.ParseStatus();
- let ctx = void 0;
- for (const check of this._def.checks) {
- if (check.kind === "min") {
- if (input.data.length < check.value) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- minimum: check.value,
- type: "string",
- inclusive: true,
- exact: false,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "max") {
- if (input.data.length > check.value) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- maximum: check.value,
- type: "string",
- inclusive: true,
- exact: false,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "length") {
- const tooBig = input.data.length > check.value;
- const tooSmall = input.data.length < check.value;
- if (tooBig || tooSmall) {
- ctx = this._getOrReturnCtx(input, ctx);
- if (tooBig) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- maximum: check.value,
- type: "string",
- inclusive: true,
- exact: true,
- message: check.message
- });
- } else if (tooSmall) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- minimum: check.value,
- type: "string",
- inclusive: true,
- exact: true,
- message: check.message
- });
- }
- status.dirty();
- }
- } else if (check.kind === "email") {
- if (!emailRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "email",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "emoji") {
- if (!emojiRegex) {
- emojiRegex = new RegExp(_emojiRegex, "u");
- }
- if (!emojiRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "emoji",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "uuid") {
- if (!uuidRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "uuid",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "nanoid") {
- if (!nanoidRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "nanoid",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "cuid") {
- if (!cuidRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "cuid",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "cuid2") {
- if (!cuid2Regex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "cuid2",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "ulid") {
- if (!ulidRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "ulid",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "url") {
- try {
- new URL(input.data);
- } catch (_a) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "url",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "regex") {
- check.regex.lastIndex = 0;
- const testResult = check.regex.test(input.data);
- if (!testResult) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "regex",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "trim") {
- input.data = input.data.trim();
- } else if (check.kind === "includes") {
- if (!input.data.includes(check.value, check.position)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_string,
- validation: { includes: check.value, position: check.position },
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "toLowerCase") {
- input.data = input.data.toLowerCase();
- } else if (check.kind === "toUpperCase") {
- input.data = input.data.toUpperCase();
- } else if (check.kind === "startsWith") {
- if (!input.data.startsWith(check.value)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_string,
- validation: { startsWith: check.value },
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "endsWith") {
- if (!input.data.endsWith(check.value)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_string,
- validation: { endsWith: check.value },
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "datetime") {
- const regex = datetimeRegex(check);
- if (!regex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_string,
- validation: "datetime",
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "date") {
- const regex = dateRegex;
- if (!regex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_string,
- validation: "date",
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "time") {
- const regex = timeRegex(check);
- if (!regex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_string,
- validation: "time",
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "duration") {
- if (!durationRegex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "duration",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "ip") {
- if (!isValidIP(input.data, check.version)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "ip",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "base64") {
- if (!base64Regex.test(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- validation: "base64",
- code: ZodError_1.ZodIssueCode.invalid_string,
- message: check.message
- });
- status.dirty();
- }
- } else {
- util_1.util.assertNever(check);
- }
- }
- return { status: status.value, value: input.data };
- }
- _regex(regex, validation, message) {
- return this.refinement((data) => regex.test(data), {
- validation,
- code: ZodError_1.ZodIssueCode.invalid_string,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- _addCheck(check) {
- return new _ZodString({
- ...this._def,
- checks: [...this._def.checks, check]
- });
- }
- email(message) {
- return this._addCheck({ kind: "email", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- url(message) {
- return this._addCheck({ kind: "url", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- emoji(message) {
- return this._addCheck({ kind: "emoji", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- uuid(message) {
- return this._addCheck({ kind: "uuid", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- nanoid(message) {
- return this._addCheck({ kind: "nanoid", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- cuid(message) {
- return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- cuid2(message) {
- return this._addCheck({ kind: "cuid2", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- ulid(message) {
- return this._addCheck({ kind: "ulid", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- base64(message) {
- return this._addCheck({ kind: "base64", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- ip(options) {
- return this._addCheck({ kind: "ip", ...errorUtil_1.errorUtil.errToObj(options) });
- }
- datetime(options) {
- var _a, _b;
- if (typeof options === "string") {
- return this._addCheck({
- kind: "datetime",
- precision: null,
- offset: false,
- local: false,
- message: options
- });
- }
- return this._addCheck({
- kind: "datetime",
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
- ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
- });
- }
- date(message) {
- return this._addCheck({ kind: "date", message });
- }
- time(options) {
- if (typeof options === "string") {
- return this._addCheck({
- kind: "time",
- precision: null,
- message: options
- });
- }
- return this._addCheck({
- kind: "time",
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
- ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
- });
- }
- duration(message) {
- return this._addCheck({ kind: "duration", ...errorUtil_1.errorUtil.errToObj(message) });
- }
- regex(regex, message) {
- return this._addCheck({
- kind: "regex",
- regex,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- includes(value, options) {
- return this._addCheck({
- kind: "includes",
- value,
- position: options === null || options === void 0 ? void 0 : options.position,
- ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
- });
- }
- startsWith(value, message) {
- return this._addCheck({
- kind: "startsWith",
- value,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- endsWith(value, message) {
- return this._addCheck({
- kind: "endsWith",
- value,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- min(minLength, message) {
- return this._addCheck({
- kind: "min",
- value: minLength,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- max(maxLength, message) {
- return this._addCheck({
- kind: "max",
- value: maxLength,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- length(len, message) {
- return this._addCheck({
- kind: "length",
- value: len,
- ...errorUtil_1.errorUtil.errToObj(message)
- });
- }
- /**
- * @deprecated Use z.string().min(1) instead.
- * @see {@link ZodString.min}
- */
- nonempty(message) {
- return this.min(1, errorUtil_1.errorUtil.errToObj(message));
- }
- trim() {
- return new _ZodString({
- ...this._def,
- checks: [...this._def.checks, { kind: "trim" }]
- });
- }
- toLowerCase() {
- return new _ZodString({
- ...this._def,
- checks: [...this._def.checks, { kind: "toLowerCase" }]
- });
- }
- toUpperCase() {
- return new _ZodString({
- ...this._def,
- checks: [...this._def.checks, { kind: "toUpperCase" }]
- });
- }
- get isDatetime() {
- return !!this._def.checks.find((ch) => ch.kind === "datetime");
- }
- get isDate() {
- return !!this._def.checks.find((ch) => ch.kind === "date");
- }
- get isTime() {
- return !!this._def.checks.find((ch) => ch.kind === "time");
- }
- get isDuration() {
- return !!this._def.checks.find((ch) => ch.kind === "duration");
- }
- get isEmail() {
- return !!this._def.checks.find((ch) => ch.kind === "email");
- }
- get isURL() {
- return !!this._def.checks.find((ch) => ch.kind === "url");
- }
- get isEmoji() {
- return !!this._def.checks.find((ch) => ch.kind === "emoji");
- }
- get isUUID() {
- return !!this._def.checks.find((ch) => ch.kind === "uuid");
- }
- get isNANOID() {
- return !!this._def.checks.find((ch) => ch.kind === "nanoid");
- }
- get isCUID() {
- return !!this._def.checks.find((ch) => ch.kind === "cuid");
- }
- get isCUID2() {
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
- }
- get isULID() {
- return !!this._def.checks.find((ch) => ch.kind === "ulid");
- }
- get isIP() {
- return !!this._def.checks.find((ch) => ch.kind === "ip");
- }
- get isBase64() {
- return !!this._def.checks.find((ch) => ch.kind === "base64");
- }
- get minLength() {
- let min = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "min") {
- if (min === null || ch.value > min)
- min = ch.value;
- }
- }
- return min;
- }
- get maxLength() {
- let max = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "max") {
- if (max === null || ch.value < max)
- max = ch.value;
- }
- }
- return max;
- }
- };
- exports.ZodString = ZodString;
- ZodString.create = (params) => {
- var _a;
- return new ZodString({
- checks: [],
- typeName: ZodFirstPartyTypeKind.ZodString,
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
- ...processCreateParams(params)
- });
- };
- function floatSafeRemainder(val, step) {
- const valDecCount = (val.toString().split(".")[1] || "").length;
- const stepDecCount = (step.toString().split(".")[1] || "").length;
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
- return valInt % stepInt / Math.pow(10, decCount);
- }
- var ZodNumber = class _ZodNumber extends ZodType {
- constructor() {
- super(...arguments);
- this.min = this.gte;
- this.max = this.lte;
- this.step = this.multipleOf;
- }
- _parse(input) {
- if (this._def.coerce) {
- input.data = Number(input.data);
- }
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.number) {
- const ctx2 = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx2, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.number,
- received: ctx2.parsedType
- });
- return parseUtil_1.INVALID;
- }
- let ctx = void 0;
- const status = new parseUtil_1.ParseStatus();
- for (const check of this._def.checks) {
- if (check.kind === "int") {
- if (!util_1.util.isInteger(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: "integer",
- received: "float",
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "min") {
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
- if (tooSmall) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- minimum: check.value,
- type: "number",
- inclusive: check.inclusive,
- exact: false,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "max") {
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
- if (tooBig) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- maximum: check.value,
- type: "number",
- inclusive: check.inclusive,
- exact: false,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "multipleOf") {
- if (floatSafeRemainder(input.data, check.value) !== 0) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.not_multiple_of,
- multipleOf: check.value,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "finite") {
- if (!Number.isFinite(input.data)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.not_finite,
- message: check.message
- });
- status.dirty();
- }
- } else {
- util_1.util.assertNever(check);
- }
- }
- return { status: status.value, value: input.data };
- }
- gte(value, message) {
- return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message));
- }
- gt(value, message) {
- return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message));
- }
- lte(value, message) {
- return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message));
- }
- lt(value, message) {
- return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message));
- }
- setLimit(kind, value, inclusive, message) {
- return new _ZodNumber({
- ...this._def,
- checks: [
- ...this._def.checks,
- {
- kind,
- value,
- inclusive,
- message: errorUtil_1.errorUtil.toString(message)
- }
- ]
- });
- }
- _addCheck(check) {
- return new _ZodNumber({
- ...this._def,
- checks: [...this._def.checks, check]
- });
- }
- int(message) {
- return this._addCheck({
- kind: "int",
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- positive(message) {
- return this._addCheck({
- kind: "min",
- value: 0,
- inclusive: false,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- negative(message) {
- return this._addCheck({
- kind: "max",
- value: 0,
- inclusive: false,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- nonpositive(message) {
- return this._addCheck({
- kind: "max",
- value: 0,
- inclusive: true,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- nonnegative(message) {
- return this._addCheck({
- kind: "min",
- value: 0,
- inclusive: true,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- multipleOf(value, message) {
- return this._addCheck({
- kind: "multipleOf",
- value,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- finite(message) {
- return this._addCheck({
- kind: "finite",
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- safe(message) {
- return this._addCheck({
- kind: "min",
- inclusive: true,
- value: Number.MIN_SAFE_INTEGER,
- message: errorUtil_1.errorUtil.toString(message)
- })._addCheck({
- kind: "max",
- inclusive: true,
- value: Number.MAX_SAFE_INTEGER,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- get minValue() {
- let min = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "min") {
- if (min === null || ch.value > min)
- min = ch.value;
- }
- }
- return min;
- }
- get maxValue() {
- let max = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "max") {
- if (max === null || ch.value < max)
- max = ch.value;
- }
- }
- return max;
- }
- get isInt() {
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util_1.util.isInteger(ch.value));
- }
- get isFinite() {
- let max = null, min = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
- return true;
- } else if (ch.kind === "min") {
- if (min === null || ch.value > min)
- min = ch.value;
- } else if (ch.kind === "max") {
- if (max === null || ch.value < max)
- max = ch.value;
- }
- }
- return Number.isFinite(min) && Number.isFinite(max);
- }
- };
- exports.ZodNumber = ZodNumber;
- ZodNumber.create = (params) => {
- return new ZodNumber({
- checks: [],
- typeName: ZodFirstPartyTypeKind.ZodNumber,
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
- ...processCreateParams(params)
- });
- };
- var ZodBigInt = class _ZodBigInt extends ZodType {
- constructor() {
- super(...arguments);
- this.min = this.gte;
- this.max = this.lte;
- }
- _parse(input) {
- if (this._def.coerce) {
- input.data = BigInt(input.data);
- }
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.bigint) {
- const ctx2 = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx2, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.bigint,
- received: ctx2.parsedType
- });
- return parseUtil_1.INVALID;
- }
- let ctx = void 0;
- const status = new parseUtil_1.ParseStatus();
- for (const check of this._def.checks) {
- if (check.kind === "min") {
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
- if (tooSmall) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- type: "bigint",
- minimum: check.value,
- inclusive: check.inclusive,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "max") {
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
- if (tooBig) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- type: "bigint",
- maximum: check.value,
- inclusive: check.inclusive,
- message: check.message
- });
- status.dirty();
- }
- } else if (check.kind === "multipleOf") {
- if (input.data % check.value !== BigInt(0)) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.not_multiple_of,
- multipleOf: check.value,
- message: check.message
- });
- status.dirty();
- }
- } else {
- util_1.util.assertNever(check);
- }
- }
- return { status: status.value, value: input.data };
- }
- gte(value, message) {
- return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message));
- }
- gt(value, message) {
- return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message));
- }
- lte(value, message) {
- return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message));
- }
- lt(value, message) {
- return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message));
- }
- setLimit(kind, value, inclusive, message) {
- return new _ZodBigInt({
- ...this._def,
- checks: [
- ...this._def.checks,
- {
- kind,
- value,
- inclusive,
- message: errorUtil_1.errorUtil.toString(message)
- }
- ]
- });
- }
- _addCheck(check) {
- return new _ZodBigInt({
- ...this._def,
- checks: [...this._def.checks, check]
- });
- }
- positive(message) {
- return this._addCheck({
- kind: "min",
- value: BigInt(0),
- inclusive: false,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- negative(message) {
- return this._addCheck({
- kind: "max",
- value: BigInt(0),
- inclusive: false,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- nonpositive(message) {
- return this._addCheck({
- kind: "max",
- value: BigInt(0),
- inclusive: true,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- nonnegative(message) {
- return this._addCheck({
- kind: "min",
- value: BigInt(0),
- inclusive: true,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- multipleOf(value, message) {
- return this._addCheck({
- kind: "multipleOf",
- value,
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- get minValue() {
- let min = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "min") {
- if (min === null || ch.value > min)
- min = ch.value;
- }
- }
- return min;
- }
- get maxValue() {
- let max = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "max") {
- if (max === null || ch.value < max)
- max = ch.value;
- }
- }
- return max;
- }
- };
- exports.ZodBigInt = ZodBigInt;
- ZodBigInt.create = (params) => {
- var _a;
- return new ZodBigInt({
- checks: [],
- typeName: ZodFirstPartyTypeKind.ZodBigInt,
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
- ...processCreateParams(params)
- });
- };
- var ZodBoolean = class extends ZodType {
- _parse(input) {
- if (this._def.coerce) {
- input.data = Boolean(input.data);
- }
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.boolean) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.boolean,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodBoolean = ZodBoolean;
- ZodBoolean.create = (params) => {
- return new ZodBoolean({
- typeName: ZodFirstPartyTypeKind.ZodBoolean,
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
- ...processCreateParams(params)
- });
- };
- var ZodDate = class _ZodDate extends ZodType {
- _parse(input) {
- if (this._def.coerce) {
- input.data = new Date(input.data);
- }
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.date) {
- const ctx2 = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx2, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.date,
- received: ctx2.parsedType
- });
- return parseUtil_1.INVALID;
- }
- if (isNaN(input.data.getTime())) {
- const ctx2 = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx2, {
- code: ZodError_1.ZodIssueCode.invalid_date
- });
- return parseUtil_1.INVALID;
- }
- const status = new parseUtil_1.ParseStatus();
- let ctx = void 0;
- for (const check of this._def.checks) {
- if (check.kind === "min") {
- if (input.data.getTime() < check.value) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- message: check.message,
- inclusive: true,
- exact: false,
- minimum: check.value,
- type: "date"
- });
- status.dirty();
- }
- } else if (check.kind === "max") {
- if (input.data.getTime() > check.value) {
- ctx = this._getOrReturnCtx(input, ctx);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- message: check.message,
- inclusive: true,
- exact: false,
- maximum: check.value,
- type: "date"
- });
- status.dirty();
- }
- } else {
- util_1.util.assertNever(check);
- }
- }
- return {
- status: status.value,
- value: new Date(input.data.getTime())
- };
- }
- _addCheck(check) {
- return new _ZodDate({
- ...this._def,
- checks: [...this._def.checks, check]
- });
- }
- min(minDate, message) {
- return this._addCheck({
- kind: "min",
- value: minDate.getTime(),
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- max(maxDate, message) {
- return this._addCheck({
- kind: "max",
- value: maxDate.getTime(),
- message: errorUtil_1.errorUtil.toString(message)
- });
- }
- get minDate() {
- let min = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "min") {
- if (min === null || ch.value > min)
- min = ch.value;
- }
- }
- return min != null ? new Date(min) : null;
- }
- get maxDate() {
- let max = null;
- for (const ch of this._def.checks) {
- if (ch.kind === "max") {
- if (max === null || ch.value < max)
- max = ch.value;
- }
- }
- return max != null ? new Date(max) : null;
- }
- };
- exports.ZodDate = ZodDate;
- ZodDate.create = (params) => {
- return new ZodDate({
- checks: [],
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
- typeName: ZodFirstPartyTypeKind.ZodDate,
- ...processCreateParams(params)
- });
- };
- var ZodSymbol = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.symbol) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.symbol,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodSymbol = ZodSymbol;
- ZodSymbol.create = (params) => {
- return new ZodSymbol({
- typeName: ZodFirstPartyTypeKind.ZodSymbol,
- ...processCreateParams(params)
- });
- };
- var ZodUndefined = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.undefined) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.undefined,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodUndefined = ZodUndefined;
- ZodUndefined.create = (params) => {
- return new ZodUndefined({
- typeName: ZodFirstPartyTypeKind.ZodUndefined,
- ...processCreateParams(params)
- });
- };
- var ZodNull = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.null) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.null,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodNull = ZodNull;
- ZodNull.create = (params) => {
- return new ZodNull({
- typeName: ZodFirstPartyTypeKind.ZodNull,
- ...processCreateParams(params)
- });
- };
- var ZodAny = class extends ZodType {
- constructor() {
- super(...arguments);
- this._any = true;
- }
- _parse(input) {
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodAny = ZodAny;
- ZodAny.create = (params) => {
- return new ZodAny({
- typeName: ZodFirstPartyTypeKind.ZodAny,
- ...processCreateParams(params)
- });
- };
- var ZodUnknown = class extends ZodType {
- constructor() {
- super(...arguments);
- this._unknown = true;
- }
- _parse(input) {
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodUnknown = ZodUnknown;
- ZodUnknown.create = (params) => {
- return new ZodUnknown({
- typeName: ZodFirstPartyTypeKind.ZodUnknown,
- ...processCreateParams(params)
- });
- };
- var ZodNever = class extends ZodType {
- _parse(input) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.never,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- };
- exports.ZodNever = ZodNever;
- ZodNever.create = (params) => {
- return new ZodNever({
- typeName: ZodFirstPartyTypeKind.ZodNever,
- ...processCreateParams(params)
- });
- };
- var ZodVoid = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.undefined) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.void,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- };
- exports.ZodVoid = ZodVoid;
- ZodVoid.create = (params) => {
- return new ZodVoid({
- typeName: ZodFirstPartyTypeKind.ZodVoid,
- ...processCreateParams(params)
- });
- };
- var ZodArray = class _ZodArray extends ZodType {
- _parse(input) {
- const { ctx, status } = this._processInputParams(input);
- const def = this._def;
- if (ctx.parsedType !== util_1.ZodParsedType.array) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.array,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- if (def.exactLength !== null) {
- const tooBig = ctx.data.length > def.exactLength.value;
- const tooSmall = ctx.data.length < def.exactLength.value;
- if (tooBig || tooSmall) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
- minimum: tooSmall ? def.exactLength.value : void 0,
- maximum: tooBig ? def.exactLength.value : void 0,
- type: "array",
- inclusive: true,
- exact: true,
- message: def.exactLength.message
- });
- status.dirty();
- }
- }
- if (def.minLength !== null) {
- if (ctx.data.length < def.minLength.value) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- minimum: def.minLength.value,
- type: "array",
- inclusive: true,
- exact: false,
- message: def.minLength.message
- });
- status.dirty();
- }
- }
- if (def.maxLength !== null) {
- if (ctx.data.length > def.maxLength.value) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- maximum: def.maxLength.value,
- type: "array",
- inclusive: true,
- exact: false,
- message: def.maxLength.message
- });
- status.dirty();
- }
- }
- if (ctx.common.async) {
- return Promise.all([...ctx.data].map((item, i5) => {
- return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i5));
- })).then((result2) => {
- return parseUtil_1.ParseStatus.mergeArray(status, result2);
- });
- }
- const result = [...ctx.data].map((item, i5) => {
- return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i5));
- });
- return parseUtil_1.ParseStatus.mergeArray(status, result);
- }
- get element() {
- return this._def.type;
- }
- min(minLength, message) {
- return new _ZodArray({
- ...this._def,
- minLength: { value: minLength, message: errorUtil_1.errorUtil.toString(message) }
- });
- }
- max(maxLength, message) {
- return new _ZodArray({
- ...this._def,
- maxLength: { value: maxLength, message: errorUtil_1.errorUtil.toString(message) }
- });
- }
- length(len, message) {
- return new _ZodArray({
- ...this._def,
- exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) }
- });
- }
- nonempty(message) {
- return this.min(1, message);
- }
- };
- exports.ZodArray = ZodArray;
- ZodArray.create = (schema, params) => {
- return new ZodArray({
- type: schema,
- minLength: null,
- maxLength: null,
- exactLength: null,
- typeName: ZodFirstPartyTypeKind.ZodArray,
- ...processCreateParams(params)
- });
- };
- function deepPartialify(schema) {
- if (schema instanceof ZodObject) {
- const newShape = {};
- for (const key in schema.shape) {
- const fieldSchema = schema.shape[key];
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
- }
- return new ZodObject({
- ...schema._def,
- shape: () => newShape
- });
- } else if (schema instanceof ZodArray) {
- return new ZodArray({
- ...schema._def,
- type: deepPartialify(schema.element)
- });
- } else if (schema instanceof ZodOptional) {
- return ZodOptional.create(deepPartialify(schema.unwrap()));
- } else if (schema instanceof ZodNullable) {
- return ZodNullable.create(deepPartialify(schema.unwrap()));
- } else if (schema instanceof ZodTuple) {
- return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
- } else {
- return schema;
- }
- }
- var ZodObject = class _ZodObject extends ZodType {
- constructor() {
- super(...arguments);
- this._cached = null;
- this.nonstrict = this.passthrough;
- this.augment = this.extend;
- }
- _getCached() {
- if (this._cached !== null)
- return this._cached;
- const shape = this._def.shape();
- const keys = util_1.util.objectKeys(shape);
- return this._cached = { shape, keys };
- }
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.object) {
- const ctx2 = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx2, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.object,
- received: ctx2.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const { status, ctx } = this._processInputParams(input);
- const { shape, keys: shapeKeys } = this._getCached();
- const extraKeys = [];
- if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
- for (const key in ctx.data) {
- if (!shapeKeys.includes(key)) {
- extraKeys.push(key);
- }
- }
- }
- const pairs = [];
- for (const key of shapeKeys) {
- const keyValidator = shape[key];
- const value = ctx.data[key];
- pairs.push({
- key: { status: "valid", value: key },
- value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
- alwaysSet: key in ctx.data
- });
- }
- if (this._def.catchall instanceof ZodNever) {
- const unknownKeys = this._def.unknownKeys;
- if (unknownKeys === "passthrough") {
- for (const key of extraKeys) {
- pairs.push({
- key: { status: "valid", value: key },
- value: { status: "valid", value: ctx.data[key] }
- });
- }
- } else if (unknownKeys === "strict") {
- if (extraKeys.length > 0) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.unrecognized_keys,
- keys: extraKeys
- });
- status.dirty();
- }
- } else if (unknownKeys === "strip") {
- } else {
- throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
- }
- } else {
- const catchall = this._def.catchall;
- for (const key of extraKeys) {
- const value = ctx.data[key];
- pairs.push({
- key: { status: "valid", value: key },
- value: catchall._parse(
- new ParseInputLazyPath(ctx, value, ctx.path, key)
- //, ctx.child(key), value, getParsedType(value)
- ),
- alwaysSet: key in ctx.data
- });
- }
- }
- if (ctx.common.async) {
- return Promise.resolve().then(async () => {
- const syncPairs = [];
- for (const pair of pairs) {
- const key = await pair.key;
- const value = await pair.value;
- syncPairs.push({
- key,
- value,
- alwaysSet: pair.alwaysSet
- });
- }
- return syncPairs;
- }).then((syncPairs) => {
- return parseUtil_1.ParseStatus.mergeObjectSync(status, syncPairs);
- });
- } else {
- return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs);
- }
- }
- get shape() {
- return this._def.shape();
- }
- strict(message) {
- errorUtil_1.errorUtil.errToObj;
- return new _ZodObject({
- ...this._def,
- unknownKeys: "strict",
- ...message !== void 0 ? {
- errorMap: (issue, ctx) => {
- var _a, _b, _c, _d;
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
- if (issue.code === "unrecognized_keys")
- return {
- message: (_d = errorUtil_1.errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
- };
- return {
- message: defaultError
- };
- }
- } : {}
- });
- }
- strip() {
- return new _ZodObject({
- ...this._def,
- unknownKeys: "strip"
- });
- }
- passthrough() {
- return new _ZodObject({
- ...this._def,
- unknownKeys: "passthrough"
- });
- }
- // const AugmentFactory =
- // (def: Def) =>
- // (
- // augmentation: Augmentation
- // ): ZodObject<
- // extendShape, Augmentation>,
- // Def["unknownKeys"],
- // Def["catchall"]
- // > => {
- // return new ZodObject({
- // ...def,
- // shape: () => ({
- // ...def.shape(),
- // ...augmentation,
- // }),
- // }) as any;
- // };
- extend(augmentation) {
- return new _ZodObject({
- ...this._def,
- shape: () => ({
- ...this._def.shape(),
- ...augmentation
- })
- });
- }
- /**
- * Prior to zod@1.0.12 there was a bug in the
- * inferred type of merged objects. Please
- * upgrade if you are experiencing issues.
- */
- merge(merging) {
- const merged = new _ZodObject({
- unknownKeys: merging._def.unknownKeys,
- catchall: merging._def.catchall,
- shape: () => ({
- ...this._def.shape(),
- ...merging._def.shape()
- }),
- typeName: ZodFirstPartyTypeKind.ZodObject
- });
- return merged;
- }
- // merge<
- // Incoming extends AnyZodObject,
- // Augmentation extends Incoming["shape"],
- // NewOutput extends {
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
- // ? Augmentation[k]["_output"]
- // : k extends keyof Output
- // ? Output[k]
- // : never;
- // },
- // NewInput extends {
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
- // ? Augmentation[k]["_input"]
- // : k extends keyof Input
- // ? Input[k]
- // : never;
- // }
- // >(
- // merging: Incoming
- // ): ZodObject<
- // extendShape>,
- // Incoming["_def"]["unknownKeys"],
- // Incoming["_def"]["catchall"],
- // NewOutput,
- // NewInput
- // > {
- // const merged: any = new ZodObject({
- // unknownKeys: merging._def.unknownKeys,
- // catchall: merging._def.catchall,
- // shape: () =>
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
- // typeName: ZodFirstPartyTypeKind.ZodObject,
- // }) as any;
- // return merged;
- // }
- setKey(key, schema) {
- return this.augment({ [key]: schema });
- }
- // merge(
- // merging: Incoming
- // ): //ZodObject = (merging) => {
- // ZodObject<
- // extendShape>,
- // Incoming["_def"]["unknownKeys"],
- // Incoming["_def"]["catchall"]
- // > {
- // // const mergedShape = objectUtil.mergeShapes(
- // // this._def.shape(),
- // // merging._def.shape()
- // // );
- // const merged: any = new ZodObject({
- // unknownKeys: merging._def.unknownKeys,
- // catchall: merging._def.catchall,
- // shape: () =>
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
- // typeName: ZodFirstPartyTypeKind.ZodObject,
- // }) as any;
- // return merged;
- // }
- catchall(index) {
- return new _ZodObject({
- ...this._def,
- catchall: index
- });
- }
- pick(mask) {
- const shape = {};
- util_1.util.objectKeys(mask).forEach((key) => {
- if (mask[key] && this.shape[key]) {
- shape[key] = this.shape[key];
- }
- });
- return new _ZodObject({
- ...this._def,
- shape: () => shape
- });
- }
- omit(mask) {
- const shape = {};
- util_1.util.objectKeys(this.shape).forEach((key) => {
- if (!mask[key]) {
- shape[key] = this.shape[key];
- }
- });
- return new _ZodObject({
- ...this._def,
- shape: () => shape
- });
- }
- /**
- * @deprecated
- */
- deepPartial() {
- return deepPartialify(this);
- }
- partial(mask) {
- const newShape = {};
- util_1.util.objectKeys(this.shape).forEach((key) => {
- const fieldSchema = this.shape[key];
- if (mask && !mask[key]) {
- newShape[key] = fieldSchema;
- } else {
- newShape[key] = fieldSchema.optional();
- }
- });
- return new _ZodObject({
- ...this._def,
- shape: () => newShape
- });
- }
- required(mask) {
- const newShape = {};
- util_1.util.objectKeys(this.shape).forEach((key) => {
- if (mask && !mask[key]) {
- newShape[key] = this.shape[key];
- } else {
- const fieldSchema = this.shape[key];
- let newField = fieldSchema;
- while (newField instanceof ZodOptional) {
- newField = newField._def.innerType;
- }
- newShape[key] = newField;
- }
- });
- return new _ZodObject({
- ...this._def,
- shape: () => newShape
- });
- }
- keyof() {
- return createZodEnum(util_1.util.objectKeys(this.shape));
- }
- };
- exports.ZodObject = ZodObject;
- ZodObject.create = (shape, params) => {
- return new ZodObject({
- shape: () => shape,
- unknownKeys: "strip",
- catchall: ZodNever.create(),
- typeName: ZodFirstPartyTypeKind.ZodObject,
- ...processCreateParams(params)
- });
- };
- ZodObject.strictCreate = (shape, params) => {
- return new ZodObject({
- shape: () => shape,
- unknownKeys: "strict",
- catchall: ZodNever.create(),
- typeName: ZodFirstPartyTypeKind.ZodObject,
- ...processCreateParams(params)
- });
- };
- ZodObject.lazycreate = (shape, params) => {
- return new ZodObject({
- shape,
- unknownKeys: "strip",
- catchall: ZodNever.create(),
- typeName: ZodFirstPartyTypeKind.ZodObject,
- ...processCreateParams(params)
- });
- };
- var ZodUnion = class extends ZodType {
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- const options = this._def.options;
- function handleResults(results) {
- for (const result of results) {
- if (result.result.status === "valid") {
- return result.result;
- }
- }
- for (const result of results) {
- if (result.result.status === "dirty") {
- ctx.common.issues.push(...result.ctx.common.issues);
- return result.result;
- }
- }
- const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_union,
- unionErrors
- });
- return parseUtil_1.INVALID;
- }
- if (ctx.common.async) {
- return Promise.all(options.map(async (option) => {
- const childCtx = {
- ...ctx,
- common: {
- ...ctx.common,
- issues: []
- },
- parent: null
- };
- return {
- result: await option._parseAsync({
- data: ctx.data,
- path: ctx.path,
- parent: childCtx
- }),
- ctx: childCtx
- };
- })).then(handleResults);
- } else {
- let dirty = void 0;
- const issues = [];
- for (const option of options) {
- const childCtx = {
- ...ctx,
- common: {
- ...ctx.common,
- issues: []
- },
- parent: null
- };
- const result = option._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: childCtx
- });
- if (result.status === "valid") {
- return result;
- } else if (result.status === "dirty" && !dirty) {
- dirty = { result, ctx: childCtx };
- }
- if (childCtx.common.issues.length) {
- issues.push(childCtx.common.issues);
- }
- }
- if (dirty) {
- ctx.common.issues.push(...dirty.ctx.common.issues);
- return dirty.result;
- }
- const unionErrors = issues.map((issues2) => new ZodError_1.ZodError(issues2));
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_union,
- unionErrors
- });
- return parseUtil_1.INVALID;
- }
- }
- get options() {
- return this._def.options;
- }
- };
- exports.ZodUnion = ZodUnion;
- ZodUnion.create = (types, params) => {
- return new ZodUnion({
- options: types,
- typeName: ZodFirstPartyTypeKind.ZodUnion,
- ...processCreateParams(params)
- });
- };
- var getDiscriminator = (type) => {
- if (type instanceof ZodLazy) {
- return getDiscriminator(type.schema);
- } else if (type instanceof ZodEffects) {
- return getDiscriminator(type.innerType());
- } else if (type instanceof ZodLiteral) {
- return [type.value];
- } else if (type instanceof ZodEnum) {
- return type.options;
- } else if (type instanceof ZodNativeEnum) {
- return util_1.util.objectValues(type.enum);
- } else if (type instanceof ZodDefault) {
- return getDiscriminator(type._def.innerType);
- } else if (type instanceof ZodUndefined) {
- return [void 0];
- } else if (type instanceof ZodNull) {
- return [null];
- } else if (type instanceof ZodOptional) {
- return [void 0, ...getDiscriminator(type.unwrap())];
- } else if (type instanceof ZodNullable) {
- return [null, ...getDiscriminator(type.unwrap())];
- } else if (type instanceof ZodBranded) {
- return getDiscriminator(type.unwrap());
- } else if (type instanceof ZodReadonly) {
- return getDiscriminator(type.unwrap());
- } else if (type instanceof ZodCatch) {
- return getDiscriminator(type._def.innerType);
- } else {
- return [];
- }
- };
- var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.object) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.object,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const discriminator = this.discriminator;
- const discriminatorValue = ctx.data[discriminator];
- const option = this.optionsMap.get(discriminatorValue);
- if (!option) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
- options: Array.from(this.optionsMap.keys()),
- path: [discriminator]
- });
- return parseUtil_1.INVALID;
- }
- if (ctx.common.async) {
- return option._parseAsync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- });
- } else {
- return option._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- });
- }
- }
- get discriminator() {
- return this._def.discriminator;
- }
- get options() {
- return this._def.options;
- }
- get optionsMap() {
- return this._def.optionsMap;
- }
- /**
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
- * have a different value for each object in the union.
- * @param discriminator the name of the discriminator property
- * @param types an array of object schemas
- * @param params
- */
- static create(discriminator, options, params) {
- const optionsMap = /* @__PURE__ */ new Map();
- for (const type of options) {
- const discriminatorValues = getDiscriminator(type.shape[discriminator]);
- if (!discriminatorValues.length) {
- throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
- }
- for (const value of discriminatorValues) {
- if (optionsMap.has(value)) {
- throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
- }
- optionsMap.set(value, type);
- }
- }
- return new _ZodDiscriminatedUnion({
- typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
- discriminator,
- options,
- optionsMap,
- ...processCreateParams(params)
- });
- }
- };
- exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
- function mergeValues(a3, b3) {
- const aType = (0, util_1.getParsedType)(a3);
- const bType = (0, util_1.getParsedType)(b3);
- if (a3 === b3) {
- return { valid: true, data: a3 };
- } else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) {
- const bKeys = util_1.util.objectKeys(b3);
- const sharedKeys = util_1.util.objectKeys(a3).filter((key) => bKeys.indexOf(key) !== -1);
- const newObj = { ...a3, ...b3 };
- for (const key of sharedKeys) {
- const sharedValue = mergeValues(a3[key], b3[key]);
- if (!sharedValue.valid) {
- return { valid: false };
- }
- newObj[key] = sharedValue.data;
- }
- return { valid: true, data: newObj };
- } else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) {
- if (a3.length !== b3.length) {
- return { valid: false };
- }
- const newArray = [];
- for (let index = 0; index < a3.length; index++) {
- const itemA = a3[index];
- const itemB = b3[index];
- const sharedValue = mergeValues(itemA, itemB);
- if (!sharedValue.valid) {
- return { valid: false };
- }
- newArray.push(sharedValue.data);
- }
- return { valid: true, data: newArray };
- } else if (aType === util_1.ZodParsedType.date && bType === util_1.ZodParsedType.date && +a3 === +b3) {
- return { valid: true, data: a3 };
- } else {
- return { valid: false };
- }
- }
- var ZodIntersection = class extends ZodType {
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- const handleParsed = (parsedLeft, parsedRight) => {
- if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
- return parseUtil_1.INVALID;
- }
- const merged = mergeValues(parsedLeft.value, parsedRight.value);
- if (!merged.valid) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_intersection_types
- });
- return parseUtil_1.INVALID;
- }
- if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
- status.dirty();
- }
- return { status: status.value, value: merged.data };
- };
- if (ctx.common.async) {
- return Promise.all([
- this._def.left._parseAsync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- }),
- this._def.right._parseAsync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- })
- ]).then(([left, right]) => handleParsed(left, right));
- } else {
- return handleParsed(this._def.left._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- }), this._def.right._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- }));
- }
- }
- };
- exports.ZodIntersection = ZodIntersection;
- ZodIntersection.create = (left, right, params) => {
- return new ZodIntersection({
- left,
- right,
- typeName: ZodFirstPartyTypeKind.ZodIntersection,
- ...processCreateParams(params)
- });
- };
- var ZodTuple = class _ZodTuple extends ZodType {
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.array) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.array,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- if (ctx.data.length < this._def.items.length) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- minimum: this._def.items.length,
- inclusive: true,
- exact: false,
- type: "array"
- });
- return parseUtil_1.INVALID;
- }
- const rest = this._def.rest;
- if (!rest && ctx.data.length > this._def.items.length) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- maximum: this._def.items.length,
- inclusive: true,
- exact: false,
- type: "array"
- });
- status.dirty();
- }
- const items = [...ctx.data].map((item, itemIndex) => {
- const schema = this._def.items[itemIndex] || this._def.rest;
- if (!schema)
- return null;
- return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
- }).filter((x2) => !!x2);
- if (ctx.common.async) {
- return Promise.all(items).then((results) => {
- return parseUtil_1.ParseStatus.mergeArray(status, results);
- });
- } else {
- return parseUtil_1.ParseStatus.mergeArray(status, items);
- }
- }
- get items() {
- return this._def.items;
- }
- rest(rest) {
- return new _ZodTuple({
- ...this._def,
- rest
- });
- }
- };
- exports.ZodTuple = ZodTuple;
- ZodTuple.create = (schemas, params) => {
- if (!Array.isArray(schemas)) {
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
- }
- return new ZodTuple({
- items: schemas,
- typeName: ZodFirstPartyTypeKind.ZodTuple,
- rest: null,
- ...processCreateParams(params)
- });
- };
- var ZodRecord = class _ZodRecord extends ZodType {
- get keySchema() {
- return this._def.keyType;
- }
- get valueSchema() {
- return this._def.valueType;
- }
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.object) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.object,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const pairs = [];
- const keyType = this._def.keyType;
- const valueType = this._def.valueType;
- for (const key in ctx.data) {
- pairs.push({
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
- alwaysSet: key in ctx.data
- });
- }
- if (ctx.common.async) {
- return parseUtil_1.ParseStatus.mergeObjectAsync(status, pairs);
- } else {
- return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs);
- }
- }
- get element() {
- return this._def.valueType;
- }
- static create(first, second, third) {
- if (second instanceof ZodType) {
- return new _ZodRecord({
- keyType: first,
- valueType: second,
- typeName: ZodFirstPartyTypeKind.ZodRecord,
- ...processCreateParams(third)
- });
- }
- return new _ZodRecord({
- keyType: ZodString.create(),
- valueType: first,
- typeName: ZodFirstPartyTypeKind.ZodRecord,
- ...processCreateParams(second)
- });
- }
- };
- exports.ZodRecord = ZodRecord;
- var ZodMap = class extends ZodType {
- get keySchema() {
- return this._def.keyType;
- }
- get valueSchema() {
- return this._def.valueType;
- }
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.map) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.map,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const keyType = this._def.keyType;
- const valueType = this._def.valueType;
- const pairs = [...ctx.data.entries()].map(([key, value], index) => {
- return {
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
- };
- });
- if (ctx.common.async) {
- const finalMap = /* @__PURE__ */ new Map();
- return Promise.resolve().then(async () => {
- for (const pair of pairs) {
- const key = await pair.key;
- const value = await pair.value;
- if (key.status === "aborted" || value.status === "aborted") {
- return parseUtil_1.INVALID;
- }
- if (key.status === "dirty" || value.status === "dirty") {
- status.dirty();
- }
- finalMap.set(key.value, value.value);
- }
- return { status: status.value, value: finalMap };
- });
- } else {
- const finalMap = /* @__PURE__ */ new Map();
- for (const pair of pairs) {
- const key = pair.key;
- const value = pair.value;
- if (key.status === "aborted" || value.status === "aborted") {
- return parseUtil_1.INVALID;
- }
- if (key.status === "dirty" || value.status === "dirty") {
- status.dirty();
- }
- finalMap.set(key.value, value.value);
- }
- return { status: status.value, value: finalMap };
- }
- }
- };
- exports.ZodMap = ZodMap;
- ZodMap.create = (keyType, valueType, params) => {
- return new ZodMap({
- valueType,
- keyType,
- typeName: ZodFirstPartyTypeKind.ZodMap,
- ...processCreateParams(params)
- });
- };
- var ZodSet = class _ZodSet extends ZodType {
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.set) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.set,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const def = this._def;
- if (def.minSize !== null) {
- if (ctx.data.size < def.minSize.value) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_small,
- minimum: def.minSize.value,
- type: "set",
- inclusive: true,
- exact: false,
- message: def.minSize.message
- });
- status.dirty();
- }
- }
- if (def.maxSize !== null) {
- if (ctx.data.size > def.maxSize.value) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.too_big,
- maximum: def.maxSize.value,
- type: "set",
- inclusive: true,
- exact: false,
- message: def.maxSize.message
- });
- status.dirty();
- }
- }
- const valueType = this._def.valueType;
- function finalizeSet(elements2) {
- const parsedSet = /* @__PURE__ */ new Set();
- for (const element of elements2) {
- if (element.status === "aborted")
- return parseUtil_1.INVALID;
- if (element.status === "dirty")
- status.dirty();
- parsedSet.add(element.value);
- }
- return { status: status.value, value: parsedSet };
- }
- const elements = [...ctx.data.values()].map((item, i5) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i5)));
- if (ctx.common.async) {
- return Promise.all(elements).then((elements2) => finalizeSet(elements2));
- } else {
- return finalizeSet(elements);
- }
- }
- min(minSize, message) {
- return new _ZodSet({
- ...this._def,
- minSize: { value: minSize, message: errorUtil_1.errorUtil.toString(message) }
- });
- }
- max(maxSize, message) {
- return new _ZodSet({
- ...this._def,
- maxSize: { value: maxSize, message: errorUtil_1.errorUtil.toString(message) }
- });
- }
- size(size, message) {
- return this.min(size, message).max(size, message);
- }
- nonempty(message) {
- return this.min(1, message);
- }
- };
- exports.ZodSet = ZodSet;
- ZodSet.create = (valueType, params) => {
- return new ZodSet({
- valueType,
- minSize: null,
- maxSize: null,
- typeName: ZodFirstPartyTypeKind.ZodSet,
- ...processCreateParams(params)
- });
- };
- var ZodFunction = class _ZodFunction extends ZodType {
- constructor() {
- super(...arguments);
- this.validate = this.implement;
- }
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.function) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.function,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- function makeArgsIssue(args, error) {
- return (0, parseUtil_1.makeIssue)({
- data: args,
- path: ctx.path,
- errorMaps: [
- ctx.common.contextualErrorMap,
- ctx.schemaErrorMap,
- (0, errors_1.getErrorMap)(),
- errors_1.defaultErrorMap
- ].filter((x2) => !!x2),
- issueData: {
- code: ZodError_1.ZodIssueCode.invalid_arguments,
- argumentsError: error
- }
- });
- }
- function makeReturnsIssue(returns, error) {
- return (0, parseUtil_1.makeIssue)({
- data: returns,
- path: ctx.path,
- errorMaps: [
- ctx.common.contextualErrorMap,
- ctx.schemaErrorMap,
- (0, errors_1.getErrorMap)(),
- errors_1.defaultErrorMap
- ].filter((x2) => !!x2),
- issueData: {
- code: ZodError_1.ZodIssueCode.invalid_return_type,
- returnTypeError: error
- }
- });
- }
- const params = { errorMap: ctx.common.contextualErrorMap };
- const fn = ctx.data;
- if (this._def.returns instanceof ZodPromise) {
- const me = this;
- return (0, parseUtil_1.OK)(async function(...args) {
- const error = new ZodError_1.ZodError([]);
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e4) => {
- error.addIssue(makeArgsIssue(args, e4));
- throw error;
- });
- const result = await Reflect.apply(fn, this, parsedArgs);
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e4) => {
- error.addIssue(makeReturnsIssue(result, e4));
- throw error;
- });
- return parsedReturns;
- });
- } else {
- const me = this;
- return (0, parseUtil_1.OK)(function(...args) {
- const parsedArgs = me._def.args.safeParse(args, params);
- if (!parsedArgs.success) {
- throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
- }
- const result = Reflect.apply(fn, this, parsedArgs.data);
- const parsedReturns = me._def.returns.safeParse(result, params);
- if (!parsedReturns.success) {
- throw new ZodError_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);
- }
- return parsedReturns.data;
- });
- }
- }
- parameters() {
- return this._def.args;
- }
- returnType() {
- return this._def.returns;
- }
- args(...items) {
- return new _ZodFunction({
- ...this._def,
- args: ZodTuple.create(items).rest(ZodUnknown.create())
- });
- }
- returns(returnType) {
- return new _ZodFunction({
- ...this._def,
- returns: returnType
- });
- }
- implement(func) {
- const validatedFunc = this.parse(func);
- return validatedFunc;
- }
- strictImplement(func) {
- const validatedFunc = this.parse(func);
- return validatedFunc;
- }
- static create(args, returns, params) {
- return new _ZodFunction({
- args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
- returns: returns || ZodUnknown.create(),
- typeName: ZodFirstPartyTypeKind.ZodFunction,
- ...processCreateParams(params)
- });
- }
- };
- exports.ZodFunction = ZodFunction;
- var ZodLazy = class extends ZodType {
- get schema() {
- return this._def.getter();
- }
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- const lazySchema = this._def.getter();
- return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
- }
- };
- exports.ZodLazy = ZodLazy;
- ZodLazy.create = (getter, params) => {
- return new ZodLazy({
- getter,
- typeName: ZodFirstPartyTypeKind.ZodLazy,
- ...processCreateParams(params)
- });
- };
- var ZodLiteral = class extends ZodType {
- _parse(input) {
- if (input.data !== this._def.value) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- received: ctx.data,
- code: ZodError_1.ZodIssueCode.invalid_literal,
- expected: this._def.value
- });
- return parseUtil_1.INVALID;
- }
- return { status: "valid", value: input.data };
- }
- get value() {
- return this._def.value;
- }
- };
- exports.ZodLiteral = ZodLiteral;
- ZodLiteral.create = (value, params) => {
- return new ZodLiteral({
- value,
- typeName: ZodFirstPartyTypeKind.ZodLiteral,
- ...processCreateParams(params)
- });
- };
- function createZodEnum(values, params) {
- return new ZodEnum({
- values,
- typeName: ZodFirstPartyTypeKind.ZodEnum,
- ...processCreateParams(params)
- });
- }
- var ZodEnum = class _ZodEnum extends ZodType {
- constructor() {
- super(...arguments);
- _ZodEnum_cache.set(this, void 0);
- }
- _parse(input) {
- if (typeof input.data !== "string") {
- const ctx = this._getOrReturnCtx(input);
- const expectedValues = this._def.values;
- (0, parseUtil_1.addIssueToContext)(ctx, {
- expected: util_1.util.joinValues(expectedValues),
- received: ctx.parsedType,
- code: ZodError_1.ZodIssueCode.invalid_type
- });
- return parseUtil_1.INVALID;
- }
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
- }
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
- const ctx = this._getOrReturnCtx(input);
- const expectedValues = this._def.values;
- (0, parseUtil_1.addIssueToContext)(ctx, {
- received: ctx.data,
- code: ZodError_1.ZodIssueCode.invalid_enum_value,
- options: expectedValues
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- get options() {
- return this._def.values;
- }
- get enum() {
- const enumValues = {};
- for (const val of this._def.values) {
- enumValues[val] = val;
- }
- return enumValues;
- }
- get Values() {
- const enumValues = {};
- for (const val of this._def.values) {
- enumValues[val] = val;
- }
- return enumValues;
- }
- get Enum() {
- const enumValues = {};
- for (const val of this._def.values) {
- enumValues[val] = val;
- }
- return enumValues;
- }
- extract(values, newDef = this._def) {
- return _ZodEnum.create(values, {
- ...this._def,
- ...newDef
- });
- }
- exclude(values, newDef = this._def) {
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
- ...this._def,
- ...newDef
- });
- }
- };
- exports.ZodEnum = ZodEnum;
- _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
- ZodEnum.create = createZodEnum;
- var ZodNativeEnum = class extends ZodType {
- constructor() {
- super(...arguments);
- _ZodNativeEnum_cache.set(this, void 0);
- }
- _parse(input) {
- const nativeEnumValues = util_1.util.getValidEnumValues(this._def.values);
- const ctx = this._getOrReturnCtx(input);
- if (ctx.parsedType !== util_1.ZodParsedType.string && ctx.parsedType !== util_1.ZodParsedType.number) {
- const expectedValues = util_1.util.objectValues(nativeEnumValues);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- expected: util_1.util.joinValues(expectedValues),
- received: ctx.parsedType,
- code: ZodError_1.ZodIssueCode.invalid_type
- });
- return parseUtil_1.INVALID;
- }
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util_1.util.getValidEnumValues(this._def.values)), "f");
- }
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
- const expectedValues = util_1.util.objectValues(nativeEnumValues);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- received: ctx.data,
- code: ZodError_1.ZodIssueCode.invalid_enum_value,
- options: expectedValues
- });
- return parseUtil_1.INVALID;
- }
- return (0, parseUtil_1.OK)(input.data);
- }
- get enum() {
- return this._def.values;
- }
- };
- exports.ZodNativeEnum = ZodNativeEnum;
- _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
- ZodNativeEnum.create = (values, params) => {
- return new ZodNativeEnum({
- values,
- typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
- ...processCreateParams(params)
- });
- };
- var ZodPromise = class extends ZodType {
- unwrap() {
- return this._def.type;
- }
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- if (ctx.parsedType !== util_1.ZodParsedType.promise && ctx.common.async === false) {
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.promise,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- const promisified = ctx.parsedType === util_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
- return (0, parseUtil_1.OK)(promisified.then((data) => {
- return this._def.type.parseAsync(data, {
- path: ctx.path,
- errorMap: ctx.common.contextualErrorMap
- });
- }));
- }
- };
- exports.ZodPromise = ZodPromise;
- ZodPromise.create = (schema, params) => {
- return new ZodPromise({
- type: schema,
- typeName: ZodFirstPartyTypeKind.ZodPromise,
- ...processCreateParams(params)
- });
- };
- var ZodEffects = class extends ZodType {
- innerType() {
- return this._def.schema;
- }
- sourceType() {
- return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
- }
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- const effect = this._def.effect || null;
- const checkCtx = {
- addIssue: (arg) => {
- (0, parseUtil_1.addIssueToContext)(ctx, arg);
- if (arg.fatal) {
- status.abort();
- } else {
- status.dirty();
- }
- },
- get path() {
- return ctx.path;
- }
- };
- checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
- if (effect.type === "preprocess") {
- const processed = effect.transform(ctx.data, checkCtx);
- if (ctx.common.async) {
- return Promise.resolve(processed).then(async (processed2) => {
- if (status.value === "aborted")
- return parseUtil_1.INVALID;
- const result = await this._def.schema._parseAsync({
- data: processed2,
- path: ctx.path,
- parent: ctx
- });
- if (result.status === "aborted")
- return parseUtil_1.INVALID;
- if (result.status === "dirty")
- return (0, parseUtil_1.DIRTY)(result.value);
- if (status.value === "dirty")
- return (0, parseUtil_1.DIRTY)(result.value);
- return result;
- });
- } else {
- if (status.value === "aborted")
- return parseUtil_1.INVALID;
- const result = this._def.schema._parseSync({
- data: processed,
- path: ctx.path,
- parent: ctx
- });
- if (result.status === "aborted")
- return parseUtil_1.INVALID;
- if (result.status === "dirty")
- return (0, parseUtil_1.DIRTY)(result.value);
- if (status.value === "dirty")
- return (0, parseUtil_1.DIRTY)(result.value);
- return result;
- }
- }
- if (effect.type === "refinement") {
- const executeRefinement = (acc) => {
- const result = effect.refinement(acc, checkCtx);
- if (ctx.common.async) {
- return Promise.resolve(result);
- }
- if (result instanceof Promise) {
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
- }
- return acc;
- };
- if (ctx.common.async === false) {
- const inner = this._def.schema._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- });
- if (inner.status === "aborted")
- return parseUtil_1.INVALID;
- if (inner.status === "dirty")
- status.dirty();
- executeRefinement(inner.value);
- return { status: status.value, value: inner.value };
- } else {
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
- if (inner.status === "aborted")
- return parseUtil_1.INVALID;
- if (inner.status === "dirty")
- status.dirty();
- return executeRefinement(inner.value).then(() => {
- return { status: status.value, value: inner.value };
- });
- });
- }
- }
- if (effect.type === "transform") {
- if (ctx.common.async === false) {
- const base3 = this._def.schema._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- });
- if (!(0, parseUtil_1.isValid)(base3))
- return base3;
- const result = effect.transform(base3.value, checkCtx);
- if (result instanceof Promise) {
- throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
- }
- return { status: status.value, value: result };
- } else {
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base3) => {
- if (!(0, parseUtil_1.isValid)(base3))
- return base3;
- return Promise.resolve(effect.transform(base3.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
- });
- }
- }
- util_1.util.assertNever(effect);
- }
- };
- exports.ZodEffects = ZodEffects;
- exports.ZodTransformer = ZodEffects;
- ZodEffects.create = (schema, effect, params) => {
- return new ZodEffects({
- schema,
- typeName: ZodFirstPartyTypeKind.ZodEffects,
- effect,
- ...processCreateParams(params)
- });
- };
- ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
- return new ZodEffects({
- schema,
- effect: { type: "preprocess", transform: preprocess },
- typeName: ZodFirstPartyTypeKind.ZodEffects,
- ...processCreateParams(params)
- });
- };
- var ZodOptional = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType === util_1.ZodParsedType.undefined) {
- return (0, parseUtil_1.OK)(void 0);
- }
- return this._def.innerType._parse(input);
- }
- unwrap() {
- return this._def.innerType;
- }
- };
- exports.ZodOptional = ZodOptional;
- ZodOptional.create = (type, params) => {
- return new ZodOptional({
- innerType: type,
- typeName: ZodFirstPartyTypeKind.ZodOptional,
- ...processCreateParams(params)
- });
- };
- var ZodNullable = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType === util_1.ZodParsedType.null) {
- return (0, parseUtil_1.OK)(null);
- }
- return this._def.innerType._parse(input);
- }
- unwrap() {
- return this._def.innerType;
- }
- };
- exports.ZodNullable = ZodNullable;
- ZodNullable.create = (type, params) => {
- return new ZodNullable({
- innerType: type,
- typeName: ZodFirstPartyTypeKind.ZodNullable,
- ...processCreateParams(params)
- });
- };
- var ZodDefault = class extends ZodType {
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- let data = ctx.data;
- if (ctx.parsedType === util_1.ZodParsedType.undefined) {
- data = this._def.defaultValue();
- }
- return this._def.innerType._parse({
- data,
- path: ctx.path,
- parent: ctx
- });
- }
- removeDefault() {
- return this._def.innerType;
- }
- };
- exports.ZodDefault = ZodDefault;
- ZodDefault.create = (type, params) => {
- return new ZodDefault({
- innerType: type,
- typeName: ZodFirstPartyTypeKind.ZodDefault,
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
- ...processCreateParams(params)
- });
- };
- var ZodCatch = class extends ZodType {
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- const newCtx = {
- ...ctx,
- common: {
- ...ctx.common,
- issues: []
- }
- };
- const result = this._def.innerType._parse({
- data: newCtx.data,
- path: newCtx.path,
- parent: {
- ...newCtx
- }
- });
- if ((0, parseUtil_1.isAsync)(result)) {
- return result.then((result2) => {
- return {
- status: "valid",
- value: result2.status === "valid" ? result2.value : this._def.catchValue({
- get error() {
- return new ZodError_1.ZodError(newCtx.common.issues);
- },
- input: newCtx.data
- })
- };
- });
- } else {
- return {
- status: "valid",
- value: result.status === "valid" ? result.value : this._def.catchValue({
- get error() {
- return new ZodError_1.ZodError(newCtx.common.issues);
- },
- input: newCtx.data
- })
- };
- }
- }
- removeCatch() {
- return this._def.innerType;
- }
- };
- exports.ZodCatch = ZodCatch;
- ZodCatch.create = (type, params) => {
- return new ZodCatch({
- innerType: type,
- typeName: ZodFirstPartyTypeKind.ZodCatch,
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
- ...processCreateParams(params)
- });
- };
- var ZodNaN = class extends ZodType {
- _parse(input) {
- const parsedType = this._getType(input);
- if (parsedType !== util_1.ZodParsedType.nan) {
- const ctx = this._getOrReturnCtx(input);
- (0, parseUtil_1.addIssueToContext)(ctx, {
- code: ZodError_1.ZodIssueCode.invalid_type,
- expected: util_1.ZodParsedType.nan,
- received: ctx.parsedType
- });
- return parseUtil_1.INVALID;
- }
- return { status: "valid", value: input.data };
- }
- };
- exports.ZodNaN = ZodNaN;
- ZodNaN.create = (params) => {
- return new ZodNaN({
- typeName: ZodFirstPartyTypeKind.ZodNaN,
- ...processCreateParams(params)
- });
- };
- exports.BRAND = Symbol("zod_brand");
- var ZodBranded = class extends ZodType {
- _parse(input) {
- const { ctx } = this._processInputParams(input);
- const data = ctx.data;
- return this._def.type._parse({
- data,
- path: ctx.path,
- parent: ctx
- });
- }
- unwrap() {
- return this._def.type;
- }
- };
- exports.ZodBranded = ZodBranded;
- var ZodPipeline = class _ZodPipeline extends ZodType {
- _parse(input) {
- const { status, ctx } = this._processInputParams(input);
- if (ctx.common.async) {
- const handleAsync = async () => {
- const inResult = await this._def.in._parseAsync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- });
- if (inResult.status === "aborted")
- return parseUtil_1.INVALID;
- if (inResult.status === "dirty") {
- status.dirty();
- return (0, parseUtil_1.DIRTY)(inResult.value);
- } else {
- return this._def.out._parseAsync({
- data: inResult.value,
- path: ctx.path,
- parent: ctx
- });
- }
- };
- return handleAsync();
- } else {
- const inResult = this._def.in._parseSync({
- data: ctx.data,
- path: ctx.path,
- parent: ctx
- });
- if (inResult.status === "aborted")
- return parseUtil_1.INVALID;
- if (inResult.status === "dirty") {
- status.dirty();
- return {
- status: "dirty",
- value: inResult.value
- };
- } else {
- return this._def.out._parseSync({
- data: inResult.value,
- path: ctx.path,
- parent: ctx
- });
- }
- }
- }
- static create(a3, b3) {
- return new _ZodPipeline({
- in: a3,
- out: b3,
- typeName: ZodFirstPartyTypeKind.ZodPipeline
- });
- }
- };
- exports.ZodPipeline = ZodPipeline;
- var ZodReadonly = class extends ZodType {
- _parse(input) {
- const result = this._def.innerType._parse(input);
- const freeze = (data) => {
- if ((0, parseUtil_1.isValid)(data)) {
- data.value = Object.freeze(data.value);
- }
- return data;
- };
- return (0, parseUtil_1.isAsync)(result) ? result.then((data) => freeze(data)) : freeze(result);
- }
- unwrap() {
- return this._def.innerType;
- }
- };
- exports.ZodReadonly = ZodReadonly;
- ZodReadonly.create = (type, params) => {
- return new ZodReadonly({
- innerType: type,
- typeName: ZodFirstPartyTypeKind.ZodReadonly,
- ...processCreateParams(params)
- });
- };
- function custom(check, params = {}, fatal) {
- if (check)
- return ZodAny.create().superRefine((data, ctx) => {
- var _a, _b;
- if (!check(data)) {
- const p3 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
- const _fatal = (_b = (_a = p3.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
- const p22 = typeof p3 === "string" ? { message: p3 } : p3;
- ctx.addIssue({ code: "custom", ...p22, fatal: _fatal });
- }
- });
- return ZodAny.create();
- }
- exports.custom = custom;
- exports.late = {
- object: ZodObject.lazycreate
- };
- var ZodFirstPartyTypeKind;
- (function(ZodFirstPartyTypeKind2) {
- ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
- ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber";
- ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN";
- ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt";
- ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean";
- ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate";
- ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol";
- ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined";
- ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull";
- ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny";
- ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown";
- ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever";
- ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid";
- ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray";
- ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject";
- ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion";
- ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
- ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection";
- ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple";
- ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord";
- ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap";
- ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet";
- ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction";
- ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy";
- ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral";
- ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum";
- ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects";
- ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum";
- ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional";
- ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable";
- ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault";
- ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch";
- ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
- ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
- ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
- ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
- })(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {}));
- var instanceOfType = (cls, params = {
- message: `Input not instance of ${cls.name}`
- }) => custom((data) => data instanceof cls, params);
- exports.instanceof = instanceOfType;
- var stringType = ZodString.create;
- exports.string = stringType;
- var numberType = ZodNumber.create;
- exports.number = numberType;
- var nanType = ZodNaN.create;
- exports.nan = nanType;
- var bigIntType = ZodBigInt.create;
- exports.bigint = bigIntType;
- var booleanType = ZodBoolean.create;
- exports.boolean = booleanType;
- var dateType = ZodDate.create;
- exports.date = dateType;
- var symbolType = ZodSymbol.create;
- exports.symbol = symbolType;
- var undefinedType = ZodUndefined.create;
- exports.undefined = undefinedType;
- var nullType = ZodNull.create;
- exports.null = nullType;
- var anyType = ZodAny.create;
- exports.any = anyType;
- var unknownType = ZodUnknown.create;
- exports.unknown = unknownType;
- var neverType = ZodNever.create;
- exports.never = neverType;
- var voidType = ZodVoid.create;
- exports.void = voidType;
- var arrayType = ZodArray.create;
- exports.array = arrayType;
- var objectType = ZodObject.create;
- exports.object = objectType;
- var strictObjectType = ZodObject.strictCreate;
- exports.strictObject = strictObjectType;
- var unionType = ZodUnion.create;
- exports.union = unionType;
- var discriminatedUnionType = ZodDiscriminatedUnion.create;
- exports.discriminatedUnion = discriminatedUnionType;
- var intersectionType = ZodIntersection.create;
- exports.intersection = intersectionType;
- var tupleType = ZodTuple.create;
- exports.tuple = tupleType;
- var recordType = ZodRecord.create;
- exports.record = recordType;
- var mapType = ZodMap.create;
- exports.map = mapType;
- var setType = ZodSet.create;
- exports.set = setType;
- var functionType = ZodFunction.create;
- exports.function = functionType;
- var lazyType = ZodLazy.create;
- exports.lazy = lazyType;
- var literalType = ZodLiteral.create;
- exports.literal = literalType;
- var enumType = ZodEnum.create;
- exports.enum = enumType;
- var nativeEnumType = ZodNativeEnum.create;
- exports.nativeEnum = nativeEnumType;
- var promiseType = ZodPromise.create;
- exports.promise = promiseType;
- var effectsType = ZodEffects.create;
- exports.effect = effectsType;
- exports.transformer = effectsType;
- var optionalType = ZodOptional.create;
- exports.optional = optionalType;
- var nullableType = ZodNullable.create;
- exports.nullable = nullableType;
- var preprocessType = ZodEffects.createWithPreprocess;
- exports.preprocess = preprocessType;
- var pipelineType = ZodPipeline.create;
- exports.pipeline = pipelineType;
- var ostring = () => stringType().optional();
- exports.ostring = ostring;
- var onumber = () => numberType().optional();
- exports.onumber = onumber;
- var oboolean = () => booleanType().optional();
- exports.oboolean = oboolean;
- exports.coerce = {
- string: (arg) => ZodString.create({ ...arg, coerce: true }),
- number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
- boolean: (arg) => ZodBoolean.create({
- ...arg,
- coerce: true
- }),
- bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
- date: (arg) => ZodDate.create({ ...arg, coerce: true })
- };
- exports.NEVER = parseUtil_1.INVALID;
- }
-});
-
-// node_modules/zod/lib/external.js
-var require_external = __commonJS({
- "node_modules/zod/lib/external.js"(exports) {
- "use strict";
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- Object.defineProperty(o4, k22, { enumerable: true, get: function() {
- return m2[k2];
- } });
- } : function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- o4[k22] = m2[k2];
- });
- var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
- for (var p3 in m2) if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p3)) __createBinding(exports2, m2, p3);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- __exportStar(require_errors(), exports);
- __exportStar(require_parseUtil(), exports);
- __exportStar(require_typeAliases(), exports);
- __exportStar(require_util(), exports);
- __exportStar(require_types(), exports);
- __exportStar(require_ZodError(), exports);
- }
-});
-
-// node_modules/zod/lib/index.js
-var require_lib = __commonJS({
- "node_modules/zod/lib/index.js"(exports) {
- "use strict";
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- Object.defineProperty(o4, k22, { enumerable: true, get: function() {
- return m2[k2];
- } });
- } : function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- o4[k22] = m2[k2];
- });
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v2) {
- Object.defineProperty(o4, "default", { enumerable: true, value: v2 });
- } : function(o4, v2) {
- o4["default"] = v2;
- });
- var __importStar = exports && exports.__importStar || function(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) {
- for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
- }
- __setModuleDefault(result, mod);
- return result;
- };
- var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
- for (var p3 in m2) if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p3)) __createBinding(exports2, m2, p3);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.z = void 0;
- var z2 = __importStar(require_external());
- exports.z = z2;
- __exportStar(require_external(), exports);
- exports.default = z2;
- }
-});
-
-// node_modules/@atproto/syntax/dist/handle.js
-var require_handle = __commonJS({
- "node_modules/@atproto/syntax/dist/handle.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.DisallowedDomainError = exports.UnsupportedDomainError = exports.ReservedHandleError = exports.InvalidHandleError = exports.isValidTld = exports.isValidHandle = exports.normalizeAndEnsureValidHandle = exports.normalizeHandle = exports.ensureValidHandleRegex = exports.ensureValidHandle = exports.DISALLOWED_TLDS = exports.INVALID_HANDLE = void 0;
- exports.INVALID_HANDLE = "handle.invalid";
- exports.DISALLOWED_TLDS = [
- ".local",
- ".arpa",
- ".invalid",
- ".localhost",
- ".internal",
- ".example",
- ".alt",
- // policy could concievably change on ".onion" some day
- ".onion"
- // NOTE: .test is allowed in testing and devopment. In practical terms
- // "should" "never" actually resolve and get registered in production
- ];
- var ensureValidHandle = (handle) => {
- if (!/^[a-zA-Z0-9.-]*$/.test(handle)) {
- throw new InvalidHandleError("Disallowed characters in handle (ASCII letters, digits, dashes, periods only)");
- }
- if (handle.length > 253) {
- throw new InvalidHandleError("Handle is too long (253 chars max)");
- }
- const labels = handle.split(".");
- if (labels.length < 2) {
- throw new InvalidHandleError("Handle domain needs at least two parts");
- }
- for (let i5 = 0; i5 < labels.length; i5++) {
- const l3 = labels[i5];
- if (l3.length < 1) {
- throw new InvalidHandleError("Handle parts can not be empty");
- }
- if (l3.length > 63) {
- throw new InvalidHandleError("Handle part too long (max 63 chars)");
- }
- if (l3.endsWith("-") || l3.startsWith("-")) {
- throw new InvalidHandleError("Handle parts can not start or end with hyphens");
- }
- if (i5 + 1 === labels.length && !/^[a-zA-Z]/.test(l3)) {
- throw new InvalidHandleError("Handle final component (TLD) must start with ASCII letter");
- }
- }
- };
- exports.ensureValidHandle = ensureValidHandle;
- var ensureValidHandleRegex = (handle) => {
- if (!/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/.test(handle)) {
- throw new InvalidHandleError("Handle didn't validate via regex");
- }
- if (handle.length > 253) {
- throw new InvalidHandleError("Handle is too long (253 chars max)");
- }
- };
- exports.ensureValidHandleRegex = ensureValidHandleRegex;
- var normalizeHandle = (handle) => {
- return handle.toLowerCase();
- };
- exports.normalizeHandle = normalizeHandle;
- var normalizeAndEnsureValidHandle = (handle) => {
- const normalized = (0, exports.normalizeHandle)(handle);
- (0, exports.ensureValidHandle)(normalized);
- return normalized;
- };
- exports.normalizeAndEnsureValidHandle = normalizeAndEnsureValidHandle;
- var isValidHandle = (handle) => {
- try {
- (0, exports.ensureValidHandle)(handle);
- } catch (err) {
- if (err instanceof InvalidHandleError) {
- return false;
- }
- throw err;
- }
- return true;
- };
- exports.isValidHandle = isValidHandle;
- var isValidTld = (handle) => {
- return !exports.DISALLOWED_TLDS.some((domain) => handle.endsWith(domain));
- };
- exports.isValidTld = isValidTld;
- var InvalidHandleError = class extends Error {
- };
- exports.InvalidHandleError = InvalidHandleError;
- var ReservedHandleError = class extends Error {
- };
- exports.ReservedHandleError = ReservedHandleError;
- var UnsupportedDomainError = class extends Error {
- };
- exports.UnsupportedDomainError = UnsupportedDomainError;
- var DisallowedDomainError = class extends Error {
- };
- exports.DisallowedDomainError = DisallowedDomainError;
- }
-});
-
-// node_modules/@atproto/syntax/dist/did.js
-var require_did = __commonJS({
- "node_modules/@atproto/syntax/dist/did.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.InvalidDidError = exports.ensureValidDidRegex = exports.ensureValidDid = void 0;
- var ensureValidDid = (did) => {
- if (!did.startsWith("did:")) {
- throw new InvalidDidError('DID requires "did:" prefix');
- }
- if (!/^[a-zA-Z0-9._:%-]*$/.test(did)) {
- throw new InvalidDidError("Disallowed characters in DID (ASCII letters, digits, and a couple other characters only)");
- }
- const { length: length2, 1: method } = did.split(":");
- if (length2 < 3) {
- throw new InvalidDidError("DID requires prefix, method, and method-specific content");
- }
- if (!/^[a-z]+$/.test(method)) {
- throw new InvalidDidError("DID method must be lower-case letters");
- }
- if (did.endsWith(":") || did.endsWith("%")) {
- throw new InvalidDidError('DID can not end with ":" or "%"');
- }
- if (did.length > 2 * 1024) {
- throw new InvalidDidError("DID is too long (2048 chars max)");
- }
- };
- exports.ensureValidDid = ensureValidDid;
- var ensureValidDidRegex = (did) => {
- if (!/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/.test(did)) {
- throw new InvalidDidError("DID didn't validate via regex");
- }
- if (did.length > 2 * 1024) {
- throw new InvalidDidError("DID is too long (2048 chars max)");
- }
- };
- exports.ensureValidDidRegex = ensureValidDidRegex;
- var InvalidDidError = class extends Error {
- };
- exports.InvalidDidError = InvalidDidError;
- }
-});
-
-// node_modules/@atproto/syntax/dist/nsid.js
-var require_nsid = __commonJS({
- "node_modules/@atproto/syntax/dist/nsid.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.InvalidNsidError = exports.ensureValidNsidRegex = exports.ensureValidNsid = exports.NSID = void 0;
- var NSID = class _NSID {
- static parse(nsid) {
- return new _NSID(nsid);
- }
- static create(authority, name2) {
- const segments = [...authority.split(".").reverse(), name2].join(".");
- return new _NSID(segments);
- }
- static isValid(nsid) {
- try {
- _NSID.parse(nsid);
- return true;
- } catch (e4) {
- return false;
- }
- }
- constructor(nsid) {
- Object.defineProperty(this, "segments", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: []
- });
- (0, exports.ensureValidNsid)(nsid);
- this.segments = nsid.split(".");
- }
- get authority() {
- return this.segments.slice(0, this.segments.length - 1).reverse().join(".");
- }
- get name() {
- return this.segments.at(this.segments.length - 1);
- }
- toString() {
- return this.segments.join(".");
- }
- };
- exports.NSID = NSID;
- var ensureValidNsid = (nsid) => {
- const toCheck = nsid;
- if (!/^[a-zA-Z0-9.-]*$/.test(toCheck)) {
- throw new InvalidNsidError("Disallowed characters in NSID (ASCII letters, digits, dashes, periods only)");
- }
- if (toCheck.length > 253 + 1 + 63) {
- throw new InvalidNsidError("NSID is too long (317 chars max)");
- }
- const labels = toCheck.split(".");
- if (labels.length < 3) {
- throw new InvalidNsidError("NSID needs at least three parts");
- }
- for (let i5 = 0; i5 < labels.length; i5++) {
- const l3 = labels[i5];
- if (l3.length < 1) {
- throw new InvalidNsidError("NSID parts can not be empty");
- }
- if (l3.length > 63) {
- throw new InvalidNsidError("NSID part too long (max 63 chars)");
- }
- if (l3.endsWith("-") || l3.startsWith("-")) {
- throw new InvalidNsidError("NSID parts can not start or end with hyphen");
- }
- if (/^[0-9]/.test(l3) && i5 === 0) {
- throw new InvalidNsidError("NSID first part may not start with a digit");
- }
- if (!/^[a-zA-Z]+$/.test(l3) && i5 + 1 === labels.length) {
- throw new InvalidNsidError("NSID name part must be only letters");
- }
- }
- };
- exports.ensureValidNsid = ensureValidNsid;
- var ensureValidNsidRegex = (nsid) => {
- if (!/^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\.[a-zA-Z]([a-zA-Z]{0,61}[a-zA-Z])?)$/.test(nsid)) {
- throw new InvalidNsidError("NSID didn't validate via regex");
- }
- if (nsid.length > 253 + 1 + 63) {
- throw new InvalidNsidError("NSID is too long (317 chars max)");
- }
- };
- exports.ensureValidNsidRegex = ensureValidNsidRegex;
- var InvalidNsidError = class extends Error {
- };
- exports.InvalidNsidError = InvalidNsidError;
- }
-});
-
-// node_modules/@atproto/syntax/dist/aturi_validation.js
-var require_aturi_validation = __commonJS({
- "node_modules/@atproto/syntax/dist/aturi_validation.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ensureValidAtUriRegex = exports.ensureValidAtUri = void 0;
- var handle_1 = require_handle();
- var did_1 = require_did();
- var nsid_1 = require_nsid();
- var ensureValidAtUri = (uri) => {
- const uriParts = uri.split("#");
- if (uriParts.length > 2) {
- throw new Error('ATURI can have at most one "#", separating fragment out');
- }
- const fragmentPart = uriParts[1] || null;
- uri = uriParts[0];
- if (!/^[a-zA-Z0-9._~:@!$&')(*+,;=%/-]*$/.test(uri)) {
- throw new Error("Disallowed characters in ATURI (ASCII)");
- }
- const parts = uri.split("/");
- if (parts.length >= 3 && (parts[0] !== "at:" || parts[1].length !== 0)) {
- throw new Error('ATURI must start with "at://"');
- }
- if (parts.length < 3) {
- throw new Error("ATURI requires at least method and authority sections");
- }
- try {
- if (parts[2].startsWith("did:")) {
- (0, did_1.ensureValidDid)(parts[2]);
- } else {
- (0, handle_1.ensureValidHandle)(parts[2]);
- }
- } catch {
- throw new Error("ATURI authority must be a valid handle or DID");
- }
- if (parts.length >= 4) {
- if (parts[3].length === 0) {
- throw new Error("ATURI can not have a slash after authority without a path segment");
- }
- try {
- (0, nsid_1.ensureValidNsid)(parts[3]);
- } catch {
- throw new Error("ATURI requires first path segment (if supplied) to be valid NSID");
- }
- }
- if (parts.length >= 5) {
- if (parts[4].length === 0) {
- throw new Error("ATURI can not have a slash after collection, unless record key is provided");
- }
- }
- if (parts.length >= 6) {
- throw new Error("ATURI path can have at most two parts, and no trailing slash");
- }
- if (uriParts.length >= 2 && fragmentPart == null) {
- throw new Error("ATURI fragment must be non-empty and start with slash");
- }
- if (fragmentPart != null) {
- if (fragmentPart.length === 0 || fragmentPart[0] !== "/") {
- throw new Error("ATURI fragment must be non-empty and start with slash");
- }
- if (!/^\/[a-zA-Z0-9._~:@!$&')(*+,;=%[\]/-]*$/.test(fragmentPart)) {
- throw new Error("Disallowed characters in ATURI fragment (ASCII)");
- }
- }
- if (uri.length > 8 * 1024) {
- throw new Error("ATURI is far too long");
- }
- };
- exports.ensureValidAtUri = ensureValidAtUri;
- var ensureValidAtUriRegex = (uri) => {
- const aturiRegex = /^at:\/\/(?[a-zA-Z0-9._:%-]+)(\/(?[a-zA-Z0-9-.]+)(\/(?[a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(#(?\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/;
- const rm = uri.match(aturiRegex);
- if (!rm || !rm.groups) {
- throw new Error("ATURI didn't validate via regex");
- }
- const groups = rm.groups;
- try {
- (0, handle_1.ensureValidHandleRegex)(groups.authority);
- } catch {
- try {
- (0, did_1.ensureValidDidRegex)(groups.authority);
- } catch {
- throw new Error("ATURI authority must be a valid handle or DID");
- }
- }
- if (groups.collection) {
- try {
- (0, nsid_1.ensureValidNsidRegex)(groups.collection);
- } catch {
- throw new Error("ATURI collection path segment must be a valid NSID");
- }
- }
- if (uri.length > 8 * 1024) {
- throw new Error("ATURI is far too long");
- }
- };
- exports.ensureValidAtUriRegex = ensureValidAtUriRegex;
- }
-});
-
-// node_modules/@atproto/syntax/dist/aturi.js
-var require_aturi = __commonJS({
- "node_modules/@atproto/syntax/dist/aturi.js"(exports) {
- "use strict";
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- var desc = Object.getOwnPropertyDescriptor(m2, k2);
- if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() {
- return m2[k2];
- } };
- }
- Object.defineProperty(o4, k22, desc);
- } : function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- o4[k22] = m2[k2];
- });
- var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
- for (var p3 in m2) if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p3)) __createBinding(exports2, m2, p3);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.AtUri = exports.ATP_URI_REGEX = void 0;
- __exportStar(require_aturi_validation(), exports);
- exports.ATP_URI_REGEX = // proto- --did-------------- --name---------------- --path---- --query-- --hash--
- /^(at:\/\/)?((?:did:[a-z0-9:%-]+)|(?:[a-z0-9][a-z0-9.:-]*))(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;
- var RELATIVE_REGEX = /^(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;
- var AtUri = class _AtUri {
- constructor(uri, base3) {
- Object.defineProperty(this, "hash", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- Object.defineProperty(this, "host", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- Object.defineProperty(this, "pathname", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- Object.defineProperty(this, "searchParams", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- let parsed;
- if (base3) {
- parsed = parse(base3);
- if (!parsed) {
- throw new Error(`Invalid at uri: ${base3}`);
- }
- const relativep = parseRelative(uri);
- if (!relativep) {
- throw new Error(`Invalid path: ${uri}`);
- }
- Object.assign(parsed, relativep);
- } else {
- parsed = parse(uri);
- if (!parsed) {
- throw new Error(`Invalid at uri: ${uri}`);
- }
- }
- this.hash = parsed.hash;
- this.host = parsed.host;
- this.pathname = parsed.pathname;
- this.searchParams = parsed.searchParams;
- }
- static make(handleOrDid, collection, rkey) {
- let str = handleOrDid;
- if (collection)
- str += "/" + collection;
- if (rkey)
- str += "/" + rkey;
- return new _AtUri(str);
- }
- get protocol() {
- return "at:";
- }
- get origin() {
- return `at://${this.host}`;
- }
- get hostname() {
- return this.host;
- }
- set hostname(v2) {
- this.host = v2;
- }
- get search() {
- return this.searchParams.toString();
- }
- set search(v2) {
- this.searchParams = new URLSearchParams(v2);
- }
- get collection() {
- return this.pathname.split("/").filter(Boolean)[0] || "";
- }
- set collection(v2) {
- const parts = this.pathname.split("/").filter(Boolean);
- parts[0] = v2;
- this.pathname = parts.join("/");
- }
- get rkey() {
- return this.pathname.split("/").filter(Boolean)[1] || "";
- }
- set rkey(v2) {
- const parts = this.pathname.split("/").filter(Boolean);
- if (!parts[0])
- parts[0] = "undefined";
- parts[1] = v2;
- this.pathname = parts.join("/");
- }
- get href() {
- return this.toString();
- }
- toString() {
- let path = this.pathname || "/";
- if (!path.startsWith("/")) {
- path = `/${path}`;
- }
- let qs = this.searchParams.toString();
- if (qs && !qs.startsWith("?")) {
- qs = `?${qs}`;
- }
- let hash = this.hash;
- if (hash && !hash.startsWith("#")) {
- hash = `#${hash}`;
- }
- return `at://${this.host}${path}${qs}${hash}`;
- }
- };
- exports.AtUri = AtUri;
- function parse(str) {
- const match = exports.ATP_URI_REGEX.exec(str);
- if (match) {
- return {
- hash: match[5] || "",
- host: match[2] || "",
- pathname: match[3] || "",
- searchParams: new URLSearchParams(match[4] || "")
- };
- }
- return void 0;
- }
- function parseRelative(str) {
- const match = RELATIVE_REGEX.exec(str);
- if (match) {
- return {
- hash: match[3] || "",
- pathname: match[1] || "",
- searchParams: new URLSearchParams(match[2] || "")
- };
- }
- return void 0;
- }
- }
-});
-
-// node_modules/@atproto/syntax/dist/tid.js
-var require_tid = __commonJS({
- "node_modules/@atproto/syntax/dist/tid.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.InvalidTidError = exports.isValidTid = exports.ensureValidTid = void 0;
- var ensureValidTid = (tid) => {
- if (tid.length !== 13) {
- throw new InvalidTidError("TID must be 13 characters");
- }
- if (!/^[234567abcdefghij][234567abcdefghijklmnopqrstuvwxyz]{12}$/.test(tid)) {
- throw new InvalidTidError("TID syntax not valid (regex)");
- }
- };
- exports.ensureValidTid = ensureValidTid;
- var isValidTid = (tid) => {
- try {
- (0, exports.ensureValidTid)(tid);
- } catch (err) {
- if (err instanceof InvalidTidError) {
- return false;
- }
- throw err;
- }
- return true;
- };
- exports.isValidTid = isValidTid;
- var InvalidTidError = class extends Error {
- };
- exports.InvalidTidError = InvalidTidError;
- }
-});
-
-// node_modules/@atproto/syntax/dist/recordkey.js
-var require_recordkey = __commonJS({
- "node_modules/@atproto/syntax/dist/recordkey.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.InvalidRecordKeyError = exports.isValidRecordKey = exports.ensureValidRecordKey = void 0;
- var ensureValidRecordKey = (rkey) => {
- if (rkey.length > 512 || rkey.length < 1) {
- throw new InvalidRecordKeyError("record key must be 1 to 512 characters");
- }
- if (!/^[a-zA-Z0-9_~.:-]{1,512}$/.test(rkey)) {
- throw new InvalidRecordKeyError("record key syntax not valid (regex)");
- }
- if (rkey === "." || rkey === "..")
- throw new InvalidRecordKeyError('record key can not be "." or ".."');
- };
- exports.ensureValidRecordKey = ensureValidRecordKey;
- var isValidRecordKey = (rkey) => {
- try {
- (0, exports.ensureValidRecordKey)(rkey);
- } catch (err) {
- if (err instanceof InvalidRecordKeyError) {
- return false;
- }
- throw err;
- }
- return true;
- };
- exports.isValidRecordKey = isValidRecordKey;
- var InvalidRecordKeyError = class extends Error {
- };
- exports.InvalidRecordKeyError = InvalidRecordKeyError;
- }
-});
-
-// node_modules/@atproto/syntax/dist/datetime.js
-var require_datetime = __commonJS({
- "node_modules/@atproto/syntax/dist/datetime.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.InvalidDatetimeError = exports.normalizeDatetimeAlways = exports.normalizeDatetime = exports.isValidDatetime = exports.ensureValidDatetime = void 0;
- var ensureValidDatetime = (dtStr) => {
- const date = new Date(dtStr);
- if (isNaN(date.getTime())) {
- throw new InvalidDatetimeError("datetime did not parse as ISO 8601");
- }
- if (date.toISOString().startsWith("-")) {
- throw new InvalidDatetimeError("datetime normalized to a negative time");
- }
- if (!/^[0-9]{4}-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](.[0-9]{1,20})?(Z|([+-][0-2][0-9]:[0-5][0-9]))$/.test(dtStr)) {
- throw new InvalidDatetimeError("datetime didn't validate via regex");
- }
- if (dtStr.length > 64) {
- throw new InvalidDatetimeError("datetime is too long (64 chars max)");
- }
- if (dtStr.endsWith("-00:00")) {
- throw new InvalidDatetimeError('datetime can not use "-00:00" for UTC timezone');
- }
- if (dtStr.startsWith("000")) {
- throw new InvalidDatetimeError("datetime so close to year zero not allowed");
- }
- };
- exports.ensureValidDatetime = ensureValidDatetime;
- var isValidDatetime = (dtStr) => {
- try {
- (0, exports.ensureValidDatetime)(dtStr);
- } catch (err) {
- if (err instanceof InvalidDatetimeError) {
- return false;
- }
- throw err;
- }
- return true;
- };
- exports.isValidDatetime = isValidDatetime;
- var normalizeDatetime = (dtStr) => {
- if ((0, exports.isValidDatetime)(dtStr)) {
- const outStr = new Date(dtStr).toISOString();
- if ((0, exports.isValidDatetime)(outStr)) {
- return outStr;
- }
- }
- if (!/.*(([+-]\d\d:?\d\d)|[a-zA-Z])$/.test(dtStr)) {
- const date2 = /* @__PURE__ */ new Date(dtStr + "Z");
- if (!isNaN(date2.getTime())) {
- const tzStr = date2.toISOString();
- if ((0, exports.isValidDatetime)(tzStr)) {
- return tzStr;
- }
- }
- }
- const date = new Date(dtStr);
- if (isNaN(date.getTime())) {
- throw new InvalidDatetimeError("datetime did not parse as any timestamp format");
- }
- const isoStr = date.toISOString();
- if ((0, exports.isValidDatetime)(isoStr)) {
- return isoStr;
- } else {
- throw new InvalidDatetimeError("datetime normalized to invalid timestamp string");
- }
- };
- exports.normalizeDatetime = normalizeDatetime;
- var normalizeDatetimeAlways = (dtStr) => {
- try {
- return (0, exports.normalizeDatetime)(dtStr);
- } catch (err) {
- if (err instanceof InvalidDatetimeError) {
- return (/* @__PURE__ */ new Date(0)).toISOString();
- }
- throw err;
- }
- };
- exports.normalizeDatetimeAlways = normalizeDatetimeAlways;
- var InvalidDatetimeError = class extends Error {
- };
- exports.InvalidDatetimeError = InvalidDatetimeError;
- }
-});
-
-// node_modules/@atproto/syntax/dist/index.js
-var require_dist = __commonJS({
- "node_modules/@atproto/syntax/dist/index.js"(exports) {
- "use strict";
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- var desc = Object.getOwnPropertyDescriptor(m2, k2);
- if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() {
- return m2[k2];
- } };
- }
- Object.defineProperty(o4, k22, desc);
- } : function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- o4[k22] = m2[k2];
- });
- var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
- for (var p3 in m2) if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p3)) __createBinding(exports2, m2, p3);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- __exportStar(require_handle(), exports);
- __exportStar(require_did(), exports);
- __exportStar(require_nsid(), exports);
- __exportStar(require_aturi(), exports);
- __exportStar(require_tid(), exports);
- __exportStar(require_recordkey(), exports);
- __exportStar(require_datetime(), exports);
- }
-});
-
-// node_modules/@atproto/lexicon/dist/util.js
-var require_util2 = __commonJS({
- "node_modules/@atproto/lexicon/dist/util.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.toLexUri = toLexUri;
- exports.toConcreteTypes = toConcreteTypes;
- exports.requiredPropertiesRefinement = requiredPropertiesRefinement;
- var zod_1 = require_lib();
- function toLexUri(str, baseUri) {
- if (str.split("#").length > 2) {
- throw new Error("Uri can only have one hash segment");
- }
- if (str.startsWith("lex:")) {
- return str;
- }
- if (str.startsWith("#")) {
- if (!baseUri) {
- throw new Error(`Unable to resolve uri without anchor: ${str}`);
- }
- return `${baseUri}${str}`;
- }
- return `lex:${str}`;
- }
- function toConcreteTypes(lexicons, def) {
- if (def.type === "ref") {
- return [lexicons.getDefOrThrow(def.ref)];
- } else if (def.type === "union") {
- return def.refs.map((ref) => lexicons.getDefOrThrow(ref)).flat();
- } else {
- return [def];
- }
- }
- function requiredPropertiesRefinement(object, ctx) {
- if (object.required === void 0) {
- return;
- }
- if (!Array.isArray(object.required)) {
- ctx.addIssue({
- code: zod_1.z.ZodIssueCode.invalid_type,
- received: typeof object.required,
- expected: "array"
- });
- return;
- }
- if (object.properties === void 0) {
- if (object.required.length > 0) {
- ctx.addIssue({
- code: zod_1.z.ZodIssueCode.custom,
- message: `Required fields defined but no properties defined`
- });
- }
- return;
- }
- for (const field of object.required) {
- if (object.properties[field] === void 0) {
- ctx.addIssue({
- code: zod_1.z.ZodIssueCode.custom,
- message: `Required field "${field}" not defined`
- });
- }
- }
- }
- }
-});
-
-// node_modules/@atproto/lexicon/dist/types.js
-var require_types2 = __commonJS({
- "node_modules/@atproto/lexicon/dist/types.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.LexiconDefNotFoundError = exports.InvalidLexiconError = exports.ValidationError = exports.discriminatedObject = exports.lexiconDoc = exports.lexUserType = exports.lexRecord = exports.lexXrpcSubscription = exports.lexXrpcProcedure = exports.lexXrpcQuery = exports.lexXrpcError = exports.lexXrpcSubscriptionMessage = exports.lexXrpcBody = exports.lexXrpcParameters = exports.lexObject = exports.lexToken = exports.lexPrimitiveArray = exports.lexArray = exports.lexBlob = exports.lexRefVariant = exports.lexRefUnion = exports.lexRef = exports.lexIpldType = exports.lexCidLink = exports.lexBytes = exports.lexPrimitive = exports.lexUnknown = exports.lexString = exports.lexStringFormat = exports.lexInteger = exports.lexBoolean = void 0;
- exports.isValidLexiconDoc = isValidLexiconDoc;
- exports.isObj = isObj;
- exports.hasProp = hasProp;
- exports.isDiscriminatedObject = isDiscriminatedObject;
- exports.parseLexiconDoc = parseLexiconDoc;
- var zod_1 = require_lib();
- var syntax_1 = require_dist();
- var util_1 = require_util2();
- exports.lexBoolean = zod_1.z.object({
- type: zod_1.z.literal("boolean"),
- description: zod_1.z.string().optional(),
- default: zod_1.z.boolean().optional(),
- const: zod_1.z.boolean().optional()
- }).strict();
- exports.lexInteger = zod_1.z.object({
- type: zod_1.z.literal("integer"),
- description: zod_1.z.string().optional(),
- default: zod_1.z.number().int().optional(),
- minimum: zod_1.z.number().int().optional(),
- maximum: zod_1.z.number().int().optional(),
- enum: zod_1.z.number().int().array().optional(),
- const: zod_1.z.number().int().optional()
- }).strict();
- exports.lexStringFormat = zod_1.z.enum([
- "datetime",
- "uri",
- "at-uri",
- "did",
- "handle",
- "at-identifier",
- "nsid",
- "cid",
- "language",
- "tid",
- "record-key"
- ]);
- exports.lexString = zod_1.z.object({
- type: zod_1.z.literal("string"),
- format: exports.lexStringFormat.optional(),
- description: zod_1.z.string().optional(),
- default: zod_1.z.string().optional(),
- minLength: zod_1.z.number().int().optional(),
- maxLength: zod_1.z.number().int().optional(),
- minGraphemes: zod_1.z.number().int().optional(),
- maxGraphemes: zod_1.z.number().int().optional(),
- enum: zod_1.z.string().array().optional(),
- const: zod_1.z.string().optional(),
- knownValues: zod_1.z.string().array().optional()
- }).strict();
- exports.lexUnknown = zod_1.z.object({
- type: zod_1.z.literal("unknown"),
- description: zod_1.z.string().optional()
- }).strict();
- exports.lexPrimitive = zod_1.z.discriminatedUnion("type", [
- exports.lexBoolean,
- exports.lexInteger,
- exports.lexString,
- exports.lexUnknown
- ]);
- exports.lexBytes = zod_1.z.object({
- type: zod_1.z.literal("bytes"),
- description: zod_1.z.string().optional(),
- maxLength: zod_1.z.number().optional(),
- minLength: zod_1.z.number().optional()
- }).strict();
- exports.lexCidLink = zod_1.z.object({
- type: zod_1.z.literal("cid-link"),
- description: zod_1.z.string().optional()
- }).strict();
- exports.lexIpldType = zod_1.z.discriminatedUnion("type", [exports.lexBytes, exports.lexCidLink]);
- exports.lexRef = zod_1.z.object({
- type: zod_1.z.literal("ref"),
- description: zod_1.z.string().optional(),
- ref: zod_1.z.string()
- }).strict();
- exports.lexRefUnion = zod_1.z.object({
- type: zod_1.z.literal("union"),
- description: zod_1.z.string().optional(),
- refs: zod_1.z.string().array(),
- closed: zod_1.z.boolean().optional()
- }).strict();
- exports.lexRefVariant = zod_1.z.discriminatedUnion("type", [exports.lexRef, exports.lexRefUnion]);
- exports.lexBlob = zod_1.z.object({
- type: zod_1.z.literal("blob"),
- description: zod_1.z.string().optional(),
- accept: zod_1.z.string().array().optional(),
- maxSize: zod_1.z.number().optional()
- }).strict();
- exports.lexArray = zod_1.z.object({
- type: zod_1.z.literal("array"),
- description: zod_1.z.string().optional(),
- items: zod_1.z.discriminatedUnion("type", [
- // lexPrimitive
- exports.lexBoolean,
- exports.lexInteger,
- exports.lexString,
- exports.lexUnknown,
- // lexIpldType
- exports.lexBytes,
- exports.lexCidLink,
- // lexRefVariant
- exports.lexRef,
- exports.lexRefUnion,
- // other
- exports.lexBlob
- ]),
- minLength: zod_1.z.number().int().optional(),
- maxLength: zod_1.z.number().int().optional()
- }).strict();
- exports.lexPrimitiveArray = exports.lexArray.merge(zod_1.z.object({
- items: exports.lexPrimitive
- }).strict());
- exports.lexToken = zod_1.z.object({
- type: zod_1.z.literal("token"),
- description: zod_1.z.string().optional()
- }).strict();
- exports.lexObject = zod_1.z.object({
- type: zod_1.z.literal("object"),
- description: zod_1.z.string().optional(),
- required: zod_1.z.string().array().optional(),
- nullable: zod_1.z.string().array().optional(),
- properties: zod_1.z.record(zod_1.z.discriminatedUnion("type", [
- exports.lexArray,
- // lexPrimitive
- exports.lexBoolean,
- exports.lexInteger,
- exports.lexString,
- exports.lexUnknown,
- // lexIpldType
- exports.lexBytes,
- exports.lexCidLink,
- // lexRefVariant
- exports.lexRef,
- exports.lexRefUnion,
- // other
- exports.lexBlob
- ]))
- }).strict().superRefine(util_1.requiredPropertiesRefinement);
- exports.lexXrpcParameters = zod_1.z.object({
- type: zod_1.z.literal("params"),
- description: zod_1.z.string().optional(),
- required: zod_1.z.string().array().optional(),
- properties: zod_1.z.record(zod_1.z.discriminatedUnion("type", [
- exports.lexPrimitiveArray,
- // lexPrimitive
- exports.lexBoolean,
- exports.lexInteger,
- exports.lexString,
- exports.lexUnknown
- ]))
- }).strict().superRefine(util_1.requiredPropertiesRefinement);
- exports.lexXrpcBody = zod_1.z.object({
- description: zod_1.z.string().optional(),
- encoding: zod_1.z.string(),
- // @NOTE using discriminatedUnion with a refined schema requires zod >= 4
- schema: zod_1.z.union([exports.lexRefVariant, exports.lexObject]).optional()
- }).strict();
- exports.lexXrpcSubscriptionMessage = zod_1.z.object({
- description: zod_1.z.string().optional(),
- // @NOTE using discriminatedUnion with a refined schema requires zod >= 4
- schema: zod_1.z.union([exports.lexRefVariant, exports.lexObject]).optional()
- }).strict();
- exports.lexXrpcError = zod_1.z.object({
- name: zod_1.z.string(),
- description: zod_1.z.string().optional()
- }).strict();
- exports.lexXrpcQuery = zod_1.z.object({
- type: zod_1.z.literal("query"),
- description: zod_1.z.string().optional(),
- parameters: exports.lexXrpcParameters.optional(),
- output: exports.lexXrpcBody.optional(),
- errors: exports.lexXrpcError.array().optional()
- }).strict();
- exports.lexXrpcProcedure = zod_1.z.object({
- type: zod_1.z.literal("procedure"),
- description: zod_1.z.string().optional(),
- parameters: exports.lexXrpcParameters.optional(),
- input: exports.lexXrpcBody.optional(),
- output: exports.lexXrpcBody.optional(),
- errors: exports.lexXrpcError.array().optional()
- }).strict();
- exports.lexXrpcSubscription = zod_1.z.object({
- type: zod_1.z.literal("subscription"),
- description: zod_1.z.string().optional(),
- parameters: exports.lexXrpcParameters.optional(),
- message: exports.lexXrpcSubscriptionMessage.optional(),
- errors: exports.lexXrpcError.array().optional()
- }).strict();
- exports.lexRecord = zod_1.z.object({
- type: zod_1.z.literal("record"),
- description: zod_1.z.string().optional(),
- key: zod_1.z.string().optional(),
- record: exports.lexObject
- }).strict();
- exports.lexUserType = zod_1.z.custom((val) => {
- if (!val || typeof val !== "object") {
- return;
- }
- if (val["type"] === void 0) {
- return;
- }
- switch (val["type"]) {
- case "record":
- return exports.lexRecord.parse(val);
- case "query":
- return exports.lexXrpcQuery.parse(val);
- case "procedure":
- return exports.lexXrpcProcedure.parse(val);
- case "subscription":
- return exports.lexXrpcSubscription.parse(val);
- case "blob":
- return exports.lexBlob.parse(val);
- case "array":
- return exports.lexArray.parse(val);
- case "token":
- return exports.lexToken.parse(val);
- case "object":
- return exports.lexObject.parse(val);
- case "boolean":
- return exports.lexBoolean.parse(val);
- case "integer":
- return exports.lexInteger.parse(val);
- case "string":
- return exports.lexString.parse(val);
- case "bytes":
- return exports.lexBytes.parse(val);
- case "cid-link":
- return exports.lexCidLink.parse(val);
- case "unknown":
- return exports.lexUnknown.parse(val);
- }
- }, (val) => {
- if (!val || typeof val !== "object") {
- return {
- message: "Must be an object",
- fatal: true
- };
- }
- if (val["type"] === void 0) {
- return {
- message: "Must have a type",
- fatal: true
- };
- }
- if (typeof val["type"] !== "string") {
- return {
- message: "Type property must be a string",
- fatal: true
- };
- }
- return {
- message: `Invalid type: ${val["type"]} must be one of: record, query, procedure, subscription, blob, array, token, object, boolean, integer, string, bytes, cid-link, unknown`,
- fatal: true
- };
- });
- exports.lexiconDoc = zod_1.z.object({
- lexicon: zod_1.z.literal(1),
- id: zod_1.z.string().refine((v2) => syntax_1.NSID.isValid(v2), {
- message: "Must be a valid NSID"
- }),
- revision: zod_1.z.number().optional(),
- description: zod_1.z.string().optional(),
- defs: zod_1.z.record(exports.lexUserType)
- }).strict().superRefine((doc, ctx) => {
- for (const defId in doc.defs) {
- const def = doc.defs[defId];
- if (defId !== "main" && (def.type === "record" || def.type === "procedure" || def.type === "query" || def.type === "subscription")) {
- ctx.addIssue({
- code: zod_1.z.ZodIssueCode.custom,
- message: `Records, procedures, queries, and subscriptions must be the main definition.`
- });
- }
- }
- });
- function isValidLexiconDoc(v2) {
- return exports.lexiconDoc.safeParse(v2).success;
- }
- function isObj(obj) {
- return obj !== null && typeof obj === "object";
- }
- function hasProp(data, prop) {
- return prop in data;
- }
- exports.discriminatedObject = zod_1.z.object({ $type: zod_1.z.string() });
- function isDiscriminatedObject(value) {
- return exports.discriminatedObject.safeParse(value).success;
- }
- function parseLexiconDoc(v2) {
- exports.lexiconDoc.parse(v2);
- return v2;
- }
- var ValidationError = class extends Error {
- };
- exports.ValidationError = ValidationError;
- var InvalidLexiconError = class extends Error {
- };
- exports.InvalidLexiconError = InvalidLexiconError;
- var LexiconDefNotFoundError = class extends Error {
- };
- exports.LexiconDefNotFoundError = LexiconDefNotFoundError;
- }
-});
-
-// node_modules/@atproto/common-web/dist/check.js
-var require_check = __commonJS({
- "node_modules/@atproto/common-web/dist/check.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.isObject = exports.assure = exports.create = exports.is = void 0;
- var is = (obj, def) => {
- return def.safeParse(obj).success;
- };
- exports.is = is;
- var create2 = (def) => (v2) => def.safeParse(v2).success;
- exports.create = create2;
- var assure = (def, obj) => {
- return def.parse(obj);
- };
- exports.assure = assure;
- var isObject = (obj) => {
- return typeof obj === "object" && obj !== null;
- };
- exports.isObject = isObject;
- }
-});
-
-// node_modules/@atproto/common-web/dist/util.js
-var require_util3 = __commonJS({
- "node_modules/@atproto/common-web/dist/util.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.parseIntWithFallback = exports.dedupeStrs = exports.range = exports.chunkArray = exports.errHasMsg = exports.isErrnoException = exports.asyncFilter = exports.s32decode = exports.s32encode = exports.streamToBuffer = exports.flattenUint8Arrays = exports.bailableWait = exports.wait = exports.jitter = exports.omit = exports.noUndefinedVals = void 0;
- var noUndefinedVals = (obj) => {
- Object.keys(obj).forEach((k2) => {
- if (obj[k2] === void 0) {
- delete obj[k2];
- }
- });
- return obj;
- };
- exports.noUndefinedVals = noUndefinedVals;
- function omit(obj, keys) {
- if (!obj)
- return obj;
- return Object.fromEntries(Object.entries(obj).filter((entry) => !keys.includes(entry[0])));
- }
- exports.omit = omit;
- var jitter = (maxMs) => {
- return Math.round((Math.random() - 0.5) * maxMs * 2);
- };
- exports.jitter = jitter;
- var wait = (ms) => {
- return new Promise((res) => setTimeout(res, ms));
- };
- exports.wait = wait;
- var bailableWait = (ms) => {
- let bail;
- const waitPromise = new Promise((res) => {
- const timeout = setTimeout(res, ms);
- bail = () => {
- clearTimeout(timeout);
- res();
- };
- });
- return { bail, wait: () => waitPromise };
- };
- exports.bailableWait = bailableWait;
- var flattenUint8Arrays = (arrs) => {
- const length2 = arrs.reduce((acc, cur) => {
- return acc + cur.length;
- }, 0);
- const flattened = new Uint8Array(length2);
- let offset = 0;
- arrs.forEach((arr) => {
- flattened.set(arr, offset);
- offset += arr.length;
- });
- return flattened;
- };
- exports.flattenUint8Arrays = flattenUint8Arrays;
- var streamToBuffer = async (stream) => {
- const arrays = [];
- for await (const chunk of stream) {
- arrays.push(chunk);
- }
- return (0, exports.flattenUint8Arrays)(arrays);
- };
- exports.streamToBuffer = streamToBuffer;
- var S32_CHAR = "234567abcdefghijklmnopqrstuvwxyz";
- var s32encode = (i5) => {
- let s3 = "";
- while (i5) {
- const c4 = i5 % 32;
- i5 = Math.floor(i5 / 32);
- s3 = S32_CHAR.charAt(c4) + s3;
- }
- return s3;
- };
- exports.s32encode = s32encode;
- var s32decode = (s3) => {
- let i5 = 0;
- for (const c4 of s3) {
- i5 = i5 * 32 + S32_CHAR.indexOf(c4);
- }
- return i5;
- };
- exports.s32decode = s32decode;
- var asyncFilter = async (arr, fn) => {
- const results = await Promise.all(arr.map((t3) => fn(t3)));
- return arr.filter((_2, i5) => results[i5]);
- };
- exports.asyncFilter = asyncFilter;
- var isErrnoException = (err) => {
- return !!err && err["code"];
- };
- exports.isErrnoException = isErrnoException;
- var errHasMsg = (err, msg) => {
- return !!err && typeof err === "object" && err["message"] === msg;
- };
- exports.errHasMsg = errHasMsg;
- var chunkArray = (arr, chunkSize) => {
- return arr.reduce((acc, cur, i5) => {
- const chunkI = Math.floor(i5 / chunkSize);
- if (!acc[chunkI]) {
- acc[chunkI] = [];
- }
- acc[chunkI].push(cur);
- return acc;
- }, []);
- };
- exports.chunkArray = chunkArray;
- var range = (num) => {
- const nums = [];
- for (let i5 = 0; i5 < num; i5++) {
- nums.push(i5);
- }
- return nums;
- };
- exports.range = range;
- var dedupeStrs = (strs) => {
- return [...new Set(strs)];
- };
- exports.dedupeStrs = dedupeStrs;
- var parseIntWithFallback = (value, fallback) => {
- const parsed = parseInt(value || "", 10);
- return isNaN(parsed) ? fallback : parsed;
- };
- exports.parseIntWithFallback = parseIntWithFallback;
- }
-});
-
-// node_modules/@atproto/common-web/dist/arrays.js
-var require_arrays = __commonJS({
- "node_modules/@atproto/common-web/dist/arrays.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.mapDefined = exports.keyBy = void 0;
- var keyBy = (arr, key) => {
- return arr.reduce((acc, cur) => {
- acc[cur[key]] = cur;
- return acc;
- }, {});
- };
- exports.keyBy = keyBy;
- var mapDefined = (arr, fn) => {
- const output = [];
- for (const item of arr) {
- const val = fn(item);
- if (val !== void 0) {
- output.push(val);
- }
- }
- return output;
- };
- exports.mapDefined = mapDefined;
- }
-});
-
-// node_modules/@atproto/common-web/dist/async.js
-var require_async = __commonJS({
- "node_modules/@atproto/common-web/dist/async.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.handleAllSettledErrors = exports.AsyncBufferFullError = exports.AsyncBuffer = exports.allComplete = exports.createDeferrables = exports.createDeferrable = exports.readFromGenerator = void 0;
- var util_1 = require_util3();
- var readFromGenerator = async (gen, isDone, waitFor = Promise.resolve(), maxLength = Number.MAX_SAFE_INTEGER) => {
- const evts = [];
- let bail;
- let hasBroke = false;
- const awaitDone = async () => {
- if (await isDone(evts.at(-1))) {
- return true;
- }
- const bailable = (0, util_1.bailableWait)(20);
- await bailable.wait();
- bail = bailable.bail;
- if (hasBroke)
- return false;
- return await awaitDone();
- };
- const breakOn = new Promise((resolve) => {
- waitFor.then(() => {
- awaitDone().then(() => resolve());
- });
- });
- try {
- while (evts.length < maxLength) {
- const maybeEvt = await Promise.race([gen.next(), breakOn]);
- if (!maybeEvt)
- break;
- const evt = maybeEvt;
- if (evt.done)
- break;
- evts.push(evt.value);
- }
- } finally {
- hasBroke = true;
- bail && bail();
- }
- return evts;
- };
- exports.readFromGenerator = readFromGenerator;
- var createDeferrable = () => {
- let resolve;
- const promise = new Promise((res) => {
- resolve = () => res();
- });
- return { resolve, complete: promise };
- };
- exports.createDeferrable = createDeferrable;
- var createDeferrables = (count) => {
- const list = [];
- for (let i5 = 0; i5 < count; i5++) {
- list.push((0, exports.createDeferrable)());
- }
- return list;
- };
- exports.createDeferrables = createDeferrables;
- var allComplete = async (deferrables) => {
- await Promise.all(deferrables.map((d3) => d3.complete));
- };
- exports.allComplete = allComplete;
- var AsyncBuffer = class {
- constructor(maxSize) {
- Object.defineProperty(this, "maxSize", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: maxSize
- });
- Object.defineProperty(this, "buffer", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: []
- });
- Object.defineProperty(this, "promise", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- Object.defineProperty(this, "resolve", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- Object.defineProperty(this, "closed", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: false
- });
- Object.defineProperty(this, "toThrow", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- this.promise = Promise.resolve();
- this.resolve = () => null;
- this.resetPromise();
- }
- get curr() {
- return this.buffer;
- }
- get size() {
- return this.buffer.length;
- }
- get isClosed() {
- return this.closed;
- }
- resetPromise() {
- this.promise = new Promise((r5) => this.resolve = r5);
- }
- push(item) {
- this.buffer.push(item);
- this.resolve();
- }
- pushMany(items) {
- items.forEach((i5) => this.buffer.push(i5));
- this.resolve();
- }
- async *events() {
- while (true) {
- if (this.closed && this.buffer.length === 0) {
- if (this.toThrow) {
- throw this.toThrow;
- } else {
- return;
- }
- }
- await this.promise;
- if (this.toThrow) {
- throw this.toThrow;
- }
- if (this.maxSize && this.size > this.maxSize) {
- throw new AsyncBufferFullError(this.maxSize);
- }
- const [first, ...rest] = this.buffer;
- if (first) {
- this.buffer = rest;
- yield first;
- } else {
- this.resetPromise();
- }
- }
- }
- throw(err) {
- this.toThrow = err;
- this.closed = true;
- this.resolve();
- }
- close() {
- this.closed = true;
- this.resolve();
- }
- };
- exports.AsyncBuffer = AsyncBuffer;
- var AsyncBufferFullError = class extends Error {
- constructor(maxSize) {
- super(`ReachedMaxBufferSize: ${maxSize}`);
- }
- };
- exports.AsyncBufferFullError = AsyncBufferFullError;
- var handleAllSettledErrors = (results) => {
- const errors = results.filter(isRejected).map((res) => res.reason);
- if (errors.length === 0) {
- return;
- }
- if (errors.length === 1) {
- throw errors[0];
- }
- throw new AggregateError(errors, "Multiple errors: " + errors.map((err) => err?.message).join("\n"));
- };
- exports.handleAllSettledErrors = handleAllSettledErrors;
- var isRejected = (result) => {
- return result.status === "rejected";
- };
- }
-});
-
-// node_modules/@atproto/common-web/dist/tid.js
-var require_tid2 = __commonJS({
- "node_modules/@atproto/common-web/dist/tid.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.TID = void 0;
- var util_1 = require_util3();
- var TID_LEN = 13;
- var lastTimestamp = 0;
- var timestampCount = 0;
- var clockid = null;
- function dedash(str) {
- return str.replaceAll("-", "");
- }
- var TID = class _TID {
- constructor(str) {
- Object.defineProperty(this, "str", {
- enumerable: true,
- configurable: true,
- writable: true,
- value: void 0
- });
- const noDashes = dedash(str);
- if (noDashes.length !== TID_LEN) {
- throw new Error(`Poorly formatted TID: ${noDashes.length} length`);
- }
- this.str = noDashes;
- }
- static next(prev) {
- const time = Math.max(Date.now(), lastTimestamp);
- if (time === lastTimestamp) {
- timestampCount++;
- }
- lastTimestamp = time;
- const timestamp = time * 1e3 + timestampCount;
- if (clockid === null) {
- clockid = Math.floor(Math.random() * 32);
- }
- const tid = _TID.fromTime(timestamp, clockid);
- if (!prev || tid.newerThan(prev)) {
- return tid;
- }
- return _TID.fromTime(prev.timestamp() + 1, clockid);
- }
- static nextStr(prev) {
- return _TID.next(prev ? new _TID(prev) : void 0).toString();
- }
- static fromTime(timestamp, clockid2) {
- const str = `${(0, util_1.s32encode)(timestamp)}${(0, util_1.s32encode)(clockid2).padStart(2, "2")}`;
- return new _TID(str);
- }
- static fromStr(str) {
- return new _TID(str);
- }
- static oldestFirst(a3, b3) {
- return a3.compareTo(b3);
- }
- static newestFirst(a3, b3) {
- return b3.compareTo(a3);
- }
- static is(str) {
- return dedash(str).length === TID_LEN;
- }
- timestamp() {
- return (0, util_1.s32decode)(this.str.slice(0, 11));
- }
- clockid() {
- return (0, util_1.s32decode)(this.str.slice(11, 13));
- }
- formatted() {
- const str = this.toString();
- return `${str.slice(0, 4)}-${str.slice(4, 7)}-${str.slice(7, 11)}-${str.slice(11, 13)}`;
- }
- toString() {
- return this.str;
- }
- // newer > older
- compareTo(other) {
- if (this.str > other.str)
- return 1;
- if (this.str < other.str)
- return -1;
- return 0;
- }
- equals(other) {
- return this.str === other.str;
- }
- newerThan(other) {
- return this.compareTo(other) > 0;
- }
- olderThan(other) {
- return this.compareTo(other) < 0;
- }
- };
- exports.TID = TID;
- exports.default = TID;
- }
-});
-
-// node_modules/multiformats/esm/vendor/varint.js
-function encode(num, out, offset) {
- out = out || [];
- offset = offset || 0;
- var oldOffset = offset;
- while (num >= INT) {
- out[offset++] = num & 255 | MSB;
- num /= 128;
- }
- while (num & MSBALL) {
- out[offset++] = num & 255 | MSB;
- num >>>= 7;
- }
- out[offset] = num | 0;
- encode.bytes = offset - oldOffset + 1;
- return out;
-}
-function read(buf, offset) {
- var res = 0, offset = offset || 0, shift = 0, counter = offset, b3, l3 = buf.length;
- do {
- if (counter >= l3) {
- read.bytes = 0;
- throw new RangeError("Could not decode varint");
- }
- b3 = buf[counter++];
- res += shift < 28 ? (b3 & REST$1) << shift : (b3 & REST$1) * Math.pow(2, shift);
- shift += 7;
- } while (b3 >= MSB$1);
- read.bytes = counter - offset;
- return res;
-}
-var encode_1, MSB, REST, MSBALL, INT, decode, MSB$1, REST$1, N1, N2, N3, N4, N5, N6, N7, N8, N9, length, varint, _brrp_varint, varint_default;
-var init_varint = __esm({
- "node_modules/multiformats/esm/vendor/varint.js"() {
- encode_1 = encode;
- MSB = 128;
- REST = 127;
- MSBALL = ~REST;
- INT = Math.pow(2, 31);
- decode = read;
- MSB$1 = 128;
- REST$1 = 127;
- N1 = Math.pow(2, 7);
- N2 = Math.pow(2, 14);
- N3 = Math.pow(2, 21);
- N4 = Math.pow(2, 28);
- N5 = Math.pow(2, 35);
- N6 = Math.pow(2, 42);
- N7 = Math.pow(2, 49);
- N8 = Math.pow(2, 56);
- N9 = Math.pow(2, 63);
- length = function(value) {
- return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;
- };
- varint = {
- encode: encode_1,
- decode,
- encodingLength: length
- };
- _brrp_varint = varint;
- varint_default = _brrp_varint;
- }
-});
-
-// node_modules/multiformats/esm/src/varint.js
-var decode2, encodeTo, encodingLength;
-var init_varint2 = __esm({
- "node_modules/multiformats/esm/src/varint.js"() {
- init_varint();
- decode2 = (data, offset = 0) => {
- const code2 = varint_default.decode(data, offset);
- return [
- code2,
- varint_default.decode.bytes
- ];
- };
- encodeTo = (int, target, offset = 0) => {
- varint_default.encode(int, target, offset);
- return target;
- };
- encodingLength = (int) => {
- return varint_default.encodingLength(int);
- };
- }
-});
-
-// node_modules/multiformats/esm/src/bytes.js
-var empty, equals, coerce, fromString, toString;
-var init_bytes = __esm({
- "node_modules/multiformats/esm/src/bytes.js"() {
- empty = new Uint8Array(0);
- equals = (aa, bb) => {
- if (aa === bb)
- return true;
- if (aa.byteLength !== bb.byteLength) {
- return false;
- }
- for (let ii = 0; ii < aa.byteLength; ii++) {
- if (aa[ii] !== bb[ii]) {
- return false;
- }
- }
- return true;
- };
- coerce = (o4) => {
- if (o4 instanceof Uint8Array && o4.constructor.name === "Uint8Array")
- return o4;
- if (o4 instanceof ArrayBuffer)
- return new Uint8Array(o4);
- if (ArrayBuffer.isView(o4)) {
- return new Uint8Array(o4.buffer, o4.byteOffset, o4.byteLength);
- }
- throw new Error("Unknown type, must be binary type");
- };
- fromString = (str) => new TextEncoder().encode(str);
- toString = (b3) => new TextDecoder().decode(b3);
- }
-});
-
-// node_modules/multiformats/esm/src/hashes/digest.js
-var create, decode3, equals2, Digest;
-var init_digest = __esm({
- "node_modules/multiformats/esm/src/hashes/digest.js"() {
- init_bytes();
- init_varint2();
- create = (code2, digest2) => {
- const size = digest2.byteLength;
- const sizeOffset = encodingLength(code2);
- const digestOffset = sizeOffset + encodingLength(size);
- const bytes = new Uint8Array(digestOffset + size);
- encodeTo(code2, bytes, 0);
- encodeTo(size, bytes, sizeOffset);
- bytes.set(digest2, digestOffset);
- return new Digest(code2, size, digest2, bytes);
- };
- decode3 = (multihash) => {
- const bytes = coerce(multihash);
- const [code2, sizeOffset] = decode2(bytes);
- const [size, digestOffset] = decode2(bytes.subarray(sizeOffset));
- const digest2 = bytes.subarray(sizeOffset + digestOffset);
- if (digest2.byteLength !== size) {
- throw new Error("Incorrect length");
- }
- return new Digest(code2, size, digest2, bytes);
- };
- equals2 = (a3, b3) => {
- if (a3 === b3) {
- return true;
- } else {
- return a3.code === b3.code && a3.size === b3.size && equals(a3.bytes, b3.bytes);
- }
- };
- Digest = class {
- constructor(code2, size, digest2, bytes) {
- this.code = code2;
- this.size = size;
- this.digest = digest2;
- this.bytes = bytes;
- }
- };
- }
-});
-
-// node_modules/multiformats/esm/vendor/base-x.js
-function base(ALPHABET, name2) {
- if (ALPHABET.length >= 255) {
- throw new TypeError("Alphabet too long");
- }
- var BASE_MAP = new Uint8Array(256);
- for (var j2 = 0; j2 < BASE_MAP.length; j2++) {
- BASE_MAP[j2] = 255;
- }
- for (var i5 = 0; i5 < ALPHABET.length; i5++) {
- var x2 = ALPHABET.charAt(i5);
- var xc = x2.charCodeAt(0);
- if (BASE_MAP[xc] !== 255) {
- throw new TypeError(x2 + " is ambiguous");
- }
- BASE_MAP[xc] = i5;
- }
- var BASE = ALPHABET.length;
- var LEADER = ALPHABET.charAt(0);
- var FACTOR = Math.log(BASE) / Math.log(256);
- var iFACTOR = Math.log(256) / Math.log(BASE);
- function encode5(source) {
- if (source instanceof Uint8Array) ;
- else if (ArrayBuffer.isView(source)) {
- source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
- } else if (Array.isArray(source)) {
- source = Uint8Array.from(source);
- }
- if (!(source instanceof Uint8Array)) {
- throw new TypeError("Expected Uint8Array");
- }
- if (source.length === 0) {
- return "";
- }
- var zeroes = 0;
- var length2 = 0;
- var pbegin = 0;
- var pend = source.length;
- while (pbegin !== pend && source[pbegin] === 0) {
- pbegin++;
- zeroes++;
- }
- var size = (pend - pbegin) * iFACTOR + 1 >>> 0;
- var b58 = new Uint8Array(size);
- while (pbegin !== pend) {
- var carry = source[pbegin];
- var i6 = 0;
- for (var it1 = size - 1; (carry !== 0 || i6 < length2) && it1 !== -1; it1--, i6++) {
- carry += 256 * b58[it1] >>> 0;
- b58[it1] = carry % BASE >>> 0;
- carry = carry / BASE >>> 0;
- }
- if (carry !== 0) {
- throw new Error("Non-zero carry");
- }
- length2 = i6;
- pbegin++;
- }
- var it2 = size - length2;
- while (it2 !== size && b58[it2] === 0) {
- it2++;
- }
- var str = LEADER.repeat(zeroes);
- for (; it2 < size; ++it2) {
- str += ALPHABET.charAt(b58[it2]);
- }
- return str;
- }
- function decodeUnsafe(source) {
- if (typeof source !== "string") {
- throw new TypeError("Expected String");
- }
- if (source.length === 0) {
- return new Uint8Array();
- }
- var psz = 0;
- if (source[psz] === " ") {
- return;
- }
- var zeroes = 0;
- var length2 = 0;
- while (source[psz] === LEADER) {
- zeroes++;
- psz++;
- }
- var size = (source.length - psz) * FACTOR + 1 >>> 0;
- var b256 = new Uint8Array(size);
- while (source[psz]) {
- var carry = BASE_MAP[source.charCodeAt(psz)];
- if (carry === 255) {
- return;
- }
- var i6 = 0;
- for (var it3 = size - 1; (carry !== 0 || i6 < length2) && it3 !== -1; it3--, i6++) {
- carry += BASE * b256[it3] >>> 0;
- b256[it3] = carry % 256 >>> 0;
- carry = carry / 256 >>> 0;
- }
- if (carry !== 0) {
- throw new Error("Non-zero carry");
- }
- length2 = i6;
- psz++;
- }
- if (source[psz] === " ") {
- return;
- }
- var it4 = size - length2;
- while (it4 !== size && b256[it4] === 0) {
- it4++;
- }
- var vch = new Uint8Array(zeroes + (size - it4));
- var j3 = zeroes;
- while (it4 !== size) {
- vch[j3++] = b256[it4++];
- }
- return vch;
- }
- function decode6(string2) {
- var buffer = decodeUnsafe(string2);
- if (buffer) {
- return buffer;
- }
- throw new Error(`Non-${name2} character`);
- }
- return {
- encode: encode5,
- decodeUnsafe,
- decode: decode6
- };
-}
-var src, _brrp__multiformats_scope_baseX, base_x_default;
-var init_base_x = __esm({
- "node_modules/multiformats/esm/vendor/base-x.js"() {
- src = base;
- _brrp__multiformats_scope_baseX = src;
- base_x_default = _brrp__multiformats_scope_baseX;
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base.js
-var Encoder, Decoder, ComposedDecoder, or, Codec, from, baseX, decode4, encode2, rfc4648;
-var init_base = __esm({
- "node_modules/multiformats/esm/src/bases/base.js"() {
- init_base_x();
- init_bytes();
- Encoder = class {
- constructor(name2, prefix, baseEncode) {
- this.name = name2;
- this.prefix = prefix;
- this.baseEncode = baseEncode;
- }
- encode(bytes) {
- if (bytes instanceof Uint8Array) {
- return `${this.prefix}${this.baseEncode(bytes)}`;
- } else {
- throw Error("Unknown type, must be binary type");
- }
- }
- };
- Decoder = class {
- constructor(name2, prefix, baseDecode) {
- this.name = name2;
- this.prefix = prefix;
- if (prefix.codePointAt(0) === void 0) {
- throw new Error("Invalid prefix character");
- }
- this.prefixCodePoint = prefix.codePointAt(0);
- this.baseDecode = baseDecode;
- }
- decode(text) {
- if (typeof text === "string") {
- if (text.codePointAt(0) !== this.prefixCodePoint) {
- throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
- }
- return this.baseDecode(text.slice(this.prefix.length));
- } else {
- throw Error("Can only multibase decode strings");
- }
- }
- or(decoder) {
- return or(this, decoder);
- }
- };
- ComposedDecoder = class {
- constructor(decoders) {
- this.decoders = decoders;
- }
- or(decoder) {
- return or(this, decoder);
- }
- decode(input) {
- const prefix = input[0];
- const decoder = this.decoders[prefix];
- if (decoder) {
- return decoder.decode(input);
- } else {
- throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`);
- }
- }
- };
- or = (left, right) => new ComposedDecoder({
- ...left.decoders || { [left.prefix]: left },
- ...right.decoders || { [right.prefix]: right }
- });
- Codec = class {
- constructor(name2, prefix, baseEncode, baseDecode) {
- this.name = name2;
- this.prefix = prefix;
- this.baseEncode = baseEncode;
- this.baseDecode = baseDecode;
- this.encoder = new Encoder(name2, prefix, baseEncode);
- this.decoder = new Decoder(name2, prefix, baseDecode);
- }
- encode(input) {
- return this.encoder.encode(input);
- }
- decode(input) {
- return this.decoder.decode(input);
- }
- };
- from = ({ name: name2, prefix, encode: encode5, decode: decode6 }) => new Codec(name2, prefix, encode5, decode6);
- baseX = ({ prefix, name: name2, alphabet: alphabet2 }) => {
- const { encode: encode5, decode: decode6 } = base_x_default(alphabet2, name2);
- return from({
- prefix,
- name: name2,
- encode: encode5,
- decode: (text) => coerce(decode6(text))
- });
- };
- decode4 = (string2, alphabet2, bitsPerChar, name2) => {
- const codes = {};
- for (let i5 = 0; i5 < alphabet2.length; ++i5) {
- codes[alphabet2[i5]] = i5;
- }
- let end = string2.length;
- while (string2[end - 1] === "=") {
- --end;
- }
- const out = new Uint8Array(end * bitsPerChar / 8 | 0);
- let bits = 0;
- let buffer = 0;
- let written = 0;
- for (let i5 = 0; i5 < end; ++i5) {
- const value = codes[string2[i5]];
- if (value === void 0) {
- throw new SyntaxError(`Non-${name2} character`);
- }
- buffer = buffer << bitsPerChar | value;
- bits += bitsPerChar;
- if (bits >= 8) {
- bits -= 8;
- out[written++] = 255 & buffer >> bits;
- }
- }
- if (bits >= bitsPerChar || 255 & buffer << 8 - bits) {
- throw new SyntaxError("Unexpected end of data");
- }
- return out;
- };
- encode2 = (data, alphabet2, bitsPerChar) => {
- const pad = alphabet2[alphabet2.length - 1] === "=";
- const mask = (1 << bitsPerChar) - 1;
- let out = "";
- let bits = 0;
- let buffer = 0;
- for (let i5 = 0; i5 < data.length; ++i5) {
- buffer = buffer << 8 | data[i5];
- bits += 8;
- while (bits > bitsPerChar) {
- bits -= bitsPerChar;
- out += alphabet2[mask & buffer >> bits];
- }
- }
- if (bits) {
- out += alphabet2[mask & buffer << bitsPerChar - bits];
- }
- if (pad) {
- while (out.length * bitsPerChar & 7) {
- out += "=";
- }
- }
- return out;
- };
- rfc4648 = ({ name: name2, prefix, bitsPerChar, alphabet: alphabet2 }) => {
- return from({
- prefix,
- name: name2,
- encode(input) {
- return encode2(input, alphabet2, bitsPerChar);
- },
- decode(input) {
- return decode4(input, alphabet2, bitsPerChar, name2);
- }
- });
- };
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base58.js
-var base58_exports = {};
-__export(base58_exports, {
- base58btc: () => base58btc,
- base58flickr: () => base58flickr
-});
-var base58btc, base58flickr;
-var init_base58 = __esm({
- "node_modules/multiformats/esm/src/bases/base58.js"() {
- init_base();
- base58btc = baseX({
- name: "base58btc",
- prefix: "z",
- alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
- });
- base58flickr = baseX({
- name: "base58flickr",
- prefix: "Z",
- alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base32.js
-var base32_exports = {};
-__export(base32_exports, {
- base32: () => base32,
- base32hex: () => base32hex,
- base32hexpad: () => base32hexpad,
- base32hexpadupper: () => base32hexpadupper,
- base32hexupper: () => base32hexupper,
- base32pad: () => base32pad,
- base32padupper: () => base32padupper,
- base32upper: () => base32upper,
- base32z: () => base32z
-});
-var base32, base32upper, base32pad, base32padupper, base32hex, base32hexupper, base32hexpad, base32hexpadupper, base32z;
-var init_base32 = __esm({
- "node_modules/multiformats/esm/src/bases/base32.js"() {
- init_base();
- base32 = rfc4648({
- prefix: "b",
- name: "base32",
- alphabet: "abcdefghijklmnopqrstuvwxyz234567",
- bitsPerChar: 5
- });
- base32upper = rfc4648({
- prefix: "B",
- name: "base32upper",
- alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
- bitsPerChar: 5
- });
- base32pad = rfc4648({
- prefix: "c",
- name: "base32pad",
- alphabet: "abcdefghijklmnopqrstuvwxyz234567=",
- bitsPerChar: 5
- });
- base32padupper = rfc4648({
- prefix: "C",
- name: "base32padupper",
- alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
- bitsPerChar: 5
- });
- base32hex = rfc4648({
- prefix: "v",
- name: "base32hex",
- alphabet: "0123456789abcdefghijklmnopqrstuv",
- bitsPerChar: 5
- });
- base32hexupper = rfc4648({
- prefix: "V",
- name: "base32hexupper",
- alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV",
- bitsPerChar: 5
- });
- base32hexpad = rfc4648({
- prefix: "t",
- name: "base32hexpad",
- alphabet: "0123456789abcdefghijklmnopqrstuv=",
- bitsPerChar: 5
- });
- base32hexpadupper = rfc4648({
- prefix: "T",
- name: "base32hexpadupper",
- alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=",
- bitsPerChar: 5
- });
- base32z = rfc4648({
- prefix: "h",
- name: "base32z",
- alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769",
- bitsPerChar: 5
- });
- }
-});
-
-// node_modules/multiformats/esm/src/cid.js
-var cid_exports = {};
-__export(cid_exports, {
- CID: () => CID
-});
-var CID, parseCIDtoBytes, toStringV0, toStringV1, DAG_PB_CODE, SHA_256_CODE, encodeCID, cidSymbol, readonly, hidden, version, deprecate, IS_CID_DEPRECATION;
-var init_cid = __esm({
- "node_modules/multiformats/esm/src/cid.js"() {
- init_varint2();
- init_digest();
- init_base58();
- init_base32();
- init_bytes();
- CID = class _CID {
- constructor(version2, code2, multihash, bytes) {
- this.code = code2;
- this.version = version2;
- this.multihash = multihash;
- this.bytes = bytes;
- this.byteOffset = bytes.byteOffset;
- this.byteLength = bytes.byteLength;
- this.asCID = this;
- this._baseCache = /* @__PURE__ */ new Map();
- Object.defineProperties(this, {
- byteOffset: hidden,
- byteLength: hidden,
- code: readonly,
- version: readonly,
- multihash: readonly,
- bytes: readonly,
- _baseCache: hidden,
- asCID: hidden
- });
- }
- toV0() {
- switch (this.version) {
- case 0: {
- return this;
- }
- default: {
- const { code: code2, multihash } = this;
- if (code2 !== DAG_PB_CODE) {
- throw new Error("Cannot convert a non dag-pb CID to CIDv0");
- }
- if (multihash.code !== SHA_256_CODE) {
- throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");
- }
- return _CID.createV0(multihash);
- }
- }
- }
- toV1() {
- switch (this.version) {
- case 0: {
- const { code: code2, digest: digest2 } = this.multihash;
- const multihash = create(code2, digest2);
- return _CID.createV1(this.code, multihash);
- }
- case 1: {
- return this;
- }
- default: {
- throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`);
- }
- }
- }
- equals(other) {
- return other && this.code === other.code && this.version === other.version && equals2(this.multihash, other.multihash);
- }
- toString(base3) {
- const { bytes, version: version2, _baseCache } = this;
- switch (version2) {
- case 0:
- return toStringV0(bytes, _baseCache, base3 || base58btc.encoder);
- default:
- return toStringV1(bytes, _baseCache, base3 || base32.encoder);
- }
- }
- toJSON() {
- return {
- code: this.code,
- version: this.version,
- hash: this.multihash.bytes
- };
- }
- get [Symbol.toStringTag]() {
- return "CID";
- }
- [Symbol.for("nodejs.util.inspect.custom")]() {
- return "CID(" + this.toString() + ")";
- }
- static isCID(value) {
- deprecate(/^0\.0/, IS_CID_DEPRECATION);
- return !!(value && (value[cidSymbol] || value.asCID === value));
- }
- get toBaseEncodedString() {
- throw new Error("Deprecated, use .toString()");
- }
- get codec() {
- throw new Error('"codec" property is deprecated, use integer "code" property instead');
- }
- get buffer() {
- throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead");
- }
- get multibaseName() {
- throw new Error('"multibaseName" property is deprecated');
- }
- get prefix() {
- throw new Error('"prefix" property is deprecated');
- }
- static asCID(value) {
- if (value instanceof _CID) {
- return value;
- } else if (value != null && value.asCID === value) {
- const { version: version2, code: code2, multihash, bytes } = value;
- return new _CID(version2, code2, multihash, bytes || encodeCID(version2, code2, multihash.bytes));
- } else if (value != null && value[cidSymbol] === true) {
- const { version: version2, multihash, code: code2 } = value;
- const digest2 = decode3(multihash);
- return _CID.create(version2, code2, digest2);
- } else {
- return null;
- }
- }
- static create(version2, code2, digest2) {
- if (typeof code2 !== "number") {
- throw new Error("String codecs are no longer supported");
- }
- switch (version2) {
- case 0: {
- if (code2 !== DAG_PB_CODE) {
- throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);
- } else {
- return new _CID(version2, code2, digest2, digest2.bytes);
- }
- }
- case 1: {
- const bytes = encodeCID(version2, code2, digest2.bytes);
- return new _CID(version2, code2, digest2, bytes);
- }
- default: {
- throw new Error("Invalid version");
- }
- }
- }
- static createV0(digest2) {
- return _CID.create(0, DAG_PB_CODE, digest2);
- }
- static createV1(code2, digest2) {
- return _CID.create(1, code2, digest2);
- }
- static decode(bytes) {
- const [cid, remainder] = _CID.decodeFirst(bytes);
- if (remainder.length) {
- throw new Error("Incorrect length");
- }
- return cid;
- }
- static decodeFirst(bytes) {
- const specs = _CID.inspectBytes(bytes);
- const prefixSize = specs.size - specs.multihashSize;
- const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize));
- if (multihashBytes.byteLength !== specs.multihashSize) {
- throw new Error("Incorrect length");
- }
- const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);
- const digest2 = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);
- const cid = specs.version === 0 ? _CID.createV0(digest2) : _CID.createV1(specs.codec, digest2);
- return [
- cid,
- bytes.subarray(specs.size)
- ];
- }
- static inspectBytes(initialBytes) {
- let offset = 0;
- const next = () => {
- const [i5, length2] = decode2(initialBytes.subarray(offset));
- offset += length2;
- return i5;
- };
- let version2 = next();
- let codec = DAG_PB_CODE;
- if (version2 === 18) {
- version2 = 0;
- offset = 0;
- } else if (version2 === 1) {
- codec = next();
- }
- if (version2 !== 0 && version2 !== 1) {
- throw new RangeError(`Invalid CID version ${version2}`);
- }
- const prefixSize = offset;
- const multihashCode = next();
- const digestSize = next();
- const size = offset + digestSize;
- const multihashSize = size - prefixSize;
- return {
- version: version2,
- codec,
- multihashCode,
- digestSize,
- multihashSize,
- size
- };
- }
- static parse(source, base3) {
- const [prefix, bytes] = parseCIDtoBytes(source, base3);
- const cid = _CID.decode(bytes);
- cid._baseCache.set(prefix, source);
- return cid;
- }
- };
- parseCIDtoBytes = (source, base3) => {
- switch (source[0]) {
- case "Q": {
- const decoder = base3 || base58btc;
- return [
- base58btc.prefix,
- decoder.decode(`${base58btc.prefix}${source}`)
- ];
- }
- case base58btc.prefix: {
- const decoder = base3 || base58btc;
- return [
- base58btc.prefix,
- decoder.decode(source)
- ];
- }
- case base32.prefix: {
- const decoder = base3 || base32;
- return [
- base32.prefix,
- decoder.decode(source)
- ];
- }
- default: {
- if (base3 == null) {
- throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");
- }
- return [
- source[0],
- base3.decode(source)
- ];
- }
- }
- };
- toStringV0 = (bytes, cache, base3) => {
- const { prefix } = base3;
- if (prefix !== base58btc.prefix) {
- throw Error(`Cannot string encode V0 in ${base3.name} encoding`);
- }
- const cid = cache.get(prefix);
- if (cid == null) {
- const cid2 = base3.encode(bytes).slice(1);
- cache.set(prefix, cid2);
- return cid2;
- } else {
- return cid;
- }
- };
- toStringV1 = (bytes, cache, base3) => {
- const { prefix } = base3;
- const cid = cache.get(prefix);
- if (cid == null) {
- const cid2 = base3.encode(bytes);
- cache.set(prefix, cid2);
- return cid2;
- } else {
- return cid;
- }
- };
- DAG_PB_CODE = 112;
- SHA_256_CODE = 18;
- encodeCID = (version2, code2, multihash) => {
- const codeOffset = encodingLength(version2);
- const hashOffset = codeOffset + encodingLength(code2);
- const bytes = new Uint8Array(hashOffset + multihash.byteLength);
- encodeTo(version2, bytes, 0);
- encodeTo(code2, bytes, codeOffset);
- bytes.set(multihash, hashOffset);
- return bytes;
- };
- cidSymbol = Symbol.for("@ipld/js-cid/CID");
- readonly = {
- writable: false,
- configurable: false,
- enumerable: true
- };
- hidden = {
- writable: false,
- enumerable: false,
- configurable: false
- };
- version = "0.0.0-dev";
- deprecate = (range, message) => {
- if (range.test(version)) {
- console.warn(message);
- } else {
- throw new Error(message);
- }
- };
- IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release.
-Following code pattern:
-
-if (CID.isCID(value)) {
- doSomethingWithCID(value)
-}
-
-Is replaced with:
-
-const cid = CID.asCID(value)
-if (cid) {
- // Make sure to use cid instead of value
- doSomethingWithCID(cid)
-}
-`;
- }
-});
-
-// node_modules/uint8arrays/esm/src/compare.js
-function compare(a3, b3) {
- for (let i5 = 0; i5 < a3.byteLength; i5++) {
- if (a3[i5] < b3[i5]) {
- return -1;
- }
- if (a3[i5] > b3[i5]) {
- return 1;
- }
- }
- if (a3.byteLength > b3.byteLength) {
- return 1;
- }
- if (a3.byteLength < b3.byteLength) {
- return -1;
- }
- return 0;
-}
-var init_compare = __esm({
- "node_modules/uint8arrays/esm/src/compare.js"() {
- }
-});
-
-// node_modules/uint8arrays/esm/src/concat.js
-function concat(arrays, length2) {
- if (!length2) {
- length2 = arrays.reduce((acc, curr) => acc + curr.length, 0);
- }
- const output = new Uint8Array(length2);
- let offset = 0;
- for (const arr of arrays) {
- output.set(arr, offset);
- offset += arr.length;
- }
- return output;
-}
-var init_concat = __esm({
- "node_modules/uint8arrays/esm/src/concat.js"() {
- }
-});
-
-// node_modules/uint8arrays/esm/src/equals.js
-function equals3(a3, b3) {
- if (a3 === b3) {
- return true;
- }
- if (a3.byteLength !== b3.byteLength) {
- return false;
- }
- for (let i5 = 0; i5 < a3.byteLength; i5++) {
- if (a3[i5] !== b3[i5]) {
- return false;
- }
- }
- return true;
-}
-var init_equals = __esm({
- "node_modules/uint8arrays/esm/src/equals.js"() {
- }
-});
-
-// node_modules/multiformats/esm/src/bases/identity.js
-var identity_exports = {};
-__export(identity_exports, {
- identity: () => identity
-});
-var identity;
-var init_identity = __esm({
- "node_modules/multiformats/esm/src/bases/identity.js"() {
- init_base();
- init_bytes();
- identity = from({
- prefix: "\0",
- name: "identity",
- encode: (buf) => toString(buf),
- decode: (str) => fromString(str)
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base2.js
-var base2_exports = {};
-__export(base2_exports, {
- base2: () => base2
-});
-var base2;
-var init_base2 = __esm({
- "node_modules/multiformats/esm/src/bases/base2.js"() {
- init_base();
- base2 = rfc4648({
- prefix: "0",
- name: "base2",
- alphabet: "01",
- bitsPerChar: 1
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base8.js
-var base8_exports = {};
-__export(base8_exports, {
- base8: () => base8
-});
-var base8;
-var init_base8 = __esm({
- "node_modules/multiformats/esm/src/bases/base8.js"() {
- init_base();
- base8 = rfc4648({
- prefix: "7",
- name: "base8",
- alphabet: "01234567",
- bitsPerChar: 3
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base10.js
-var base10_exports = {};
-__export(base10_exports, {
- base10: () => base10
-});
-var base10;
-var init_base10 = __esm({
- "node_modules/multiformats/esm/src/bases/base10.js"() {
- init_base();
- base10 = baseX({
- prefix: "9",
- name: "base10",
- alphabet: "0123456789"
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base16.js
-var base16_exports = {};
-__export(base16_exports, {
- base16: () => base16,
- base16upper: () => base16upper
-});
-var base16, base16upper;
-var init_base16 = __esm({
- "node_modules/multiformats/esm/src/bases/base16.js"() {
- init_base();
- base16 = rfc4648({
- prefix: "f",
- name: "base16",
- alphabet: "0123456789abcdef",
- bitsPerChar: 4
- });
- base16upper = rfc4648({
- prefix: "F",
- name: "base16upper",
- alphabet: "0123456789ABCDEF",
- bitsPerChar: 4
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base36.js
-var base36_exports = {};
-__export(base36_exports, {
- base36: () => base36,
- base36upper: () => base36upper
-});
-var base36, base36upper;
-var init_base36 = __esm({
- "node_modules/multiformats/esm/src/bases/base36.js"() {
- init_base();
- base36 = baseX({
- prefix: "k",
- name: "base36",
- alphabet: "0123456789abcdefghijklmnopqrstuvwxyz"
- });
- base36upper = baseX({
- prefix: "K",
- name: "base36upper",
- alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base64.js
-var base64_exports = {};
-__export(base64_exports, {
- base64: () => base64,
- base64pad: () => base64pad,
- base64url: () => base64url,
- base64urlpad: () => base64urlpad
-});
-var base64, base64pad, base64url, base64urlpad;
-var init_base64 = __esm({
- "node_modules/multiformats/esm/src/bases/base64.js"() {
- init_base();
- base64 = rfc4648({
- prefix: "m",
- name: "base64",
- alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
- bitsPerChar: 6
- });
- base64pad = rfc4648({
- prefix: "M",
- name: "base64pad",
- alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
- bitsPerChar: 6
- });
- base64url = rfc4648({
- prefix: "u",
- name: "base64url",
- alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
- bitsPerChar: 6
- });
- base64urlpad = rfc4648({
- prefix: "U",
- name: "base64urlpad",
- alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
- bitsPerChar: 6
- });
- }
-});
-
-// node_modules/multiformats/esm/src/bases/base256emoji.js
-var base256emoji_exports = {};
-__export(base256emoji_exports, {
- base256emoji: () => base256emoji
-});
-function encode3(data) {
- return data.reduce((p3, c4) => {
- p3 += alphabetBytesToChars[c4];
- return p3;
- }, "");
-}
-function decode5(str) {
- const byts = [];
- for (const char of str) {
- const byt = alphabetCharsToBytes[char.codePointAt(0)];
- if (byt === void 0) {
- throw new Error(`Non-base256emoji character: ${char}`);
- }
- byts.push(byt);
- }
- return new Uint8Array(byts);
-}
-var alphabet, alphabetBytesToChars, alphabetCharsToBytes, base256emoji;
-var init_base256emoji = __esm({
- "node_modules/multiformats/esm/src/bases/base256emoji.js"() {
- init_base();
- alphabet = Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}");
- alphabetBytesToChars = alphabet.reduce((p3, c4, i5) => {
- p3[i5] = c4;
- return p3;
- }, []);
- alphabetCharsToBytes = alphabet.reduce((p3, c4, i5) => {
- p3[c4.codePointAt(0)] = i5;
- return p3;
- }, []);
- base256emoji = from({
- prefix: "\u{1F680}",
- name: "base256emoji",
- encode: encode3,
- decode: decode5
- });
- }
-});
-
-// node_modules/multiformats/esm/src/hashes/hasher.js
-var from2, Hasher;
-var init_hasher = __esm({
- "node_modules/multiformats/esm/src/hashes/hasher.js"() {
- init_digest();
- from2 = ({ name: name2, code: code2, encode: encode5 }) => new Hasher(name2, code2, encode5);
- Hasher = class {
- constructor(name2, code2, encode5) {
- this.name = name2;
- this.code = code2;
- this.encode = encode5;
- }
- digest(input) {
- if (input instanceof Uint8Array) {
- const result = this.encode(input);
- return result instanceof Uint8Array ? create(this.code, result) : result.then((digest2) => create(this.code, digest2));
- } else {
- throw Error("Unknown type, must be binary type");
- }
- }
- };
- }
-});
-
-// node_modules/multiformats/esm/src/hashes/sha2-browser.js
-var sha2_browser_exports = {};
-__export(sha2_browser_exports, {
- sha256: () => sha256,
- sha512: () => sha512
-});
-var sha, sha256, sha512;
-var init_sha2_browser = __esm({
- "node_modules/multiformats/esm/src/hashes/sha2-browser.js"() {
- init_hasher();
- sha = (name2) => async (data) => new Uint8Array(await crypto.subtle.digest(name2, data));
- sha256 = from2({
- name: "sha2-256",
- code: 18,
- encode: sha("SHA-256")
- });
- sha512 = from2({
- name: "sha2-512",
- code: 19,
- encode: sha("SHA-512")
- });
- }
-});
-
-// node_modules/multiformats/esm/src/hashes/identity.js
-var identity_exports2 = {};
-__export(identity_exports2, {
- identity: () => identity2
-});
-var code, name, encode4, digest, identity2;
-var init_identity2 = __esm({
- "node_modules/multiformats/esm/src/hashes/identity.js"() {
- init_bytes();
- init_digest();
- code = 0;
- name = "identity";
- encode4 = coerce;
- digest = (input) => create(code, encode4(input));
- identity2 = {
- code,
- name,
- encode: encode4,
- digest
- };
- }
-});
-
-// node_modules/multiformats/esm/src/codecs/raw.js
-var init_raw = __esm({
- "node_modules/multiformats/esm/src/codecs/raw.js"() {
- init_bytes();
- }
-});
-
-// node_modules/multiformats/esm/src/codecs/json.js
-var textEncoder, textDecoder;
-var init_json = __esm({
- "node_modules/multiformats/esm/src/codecs/json.js"() {
- textEncoder = new TextEncoder();
- textDecoder = new TextDecoder();
- }
-});
-
-// node_modules/multiformats/esm/src/index.js
-var init_src = __esm({
- "node_modules/multiformats/esm/src/index.js"() {
- init_cid();
- init_varint2();
- init_bytes();
- init_hasher();
- init_digest();
- }
-});
-
-// node_modules/multiformats/esm/src/basics.js
-var bases, hashes;
-var init_basics = __esm({
- "node_modules/multiformats/esm/src/basics.js"() {
- init_identity();
- init_base2();
- init_base8();
- init_base10();
- init_base16();
- init_base32();
- init_base36();
- init_base58();
- init_base64();
- init_base256emoji();
- init_sha2_browser();
- init_identity2();
- init_raw();
- init_json();
- init_src();
- bases = {
- ...identity_exports,
- ...base2_exports,
- ...base8_exports,
- ...base10_exports,
- ...base16_exports,
- ...base32_exports,
- ...base36_exports,
- ...base58_exports,
- ...base64_exports,
- ...base256emoji_exports
- };
- hashes = {
- ...sha2_browser_exports,
- ...identity_exports2
- };
- }
-});
-
-// node_modules/uint8arrays/esm/src/util/bases.js
-function createCodec(name2, prefix, encode5, decode6) {
- return {
- name: name2,
- prefix,
- encoder: {
- name: name2,
- prefix,
- encode: encode5
- },
- decoder: { decode: decode6 }
- };
-}
-var string, ascii, BASES, bases_default;
-var init_bases = __esm({
- "node_modules/uint8arrays/esm/src/util/bases.js"() {
- init_basics();
- string = createCodec("utf8", "u", (buf) => {
- const decoder = new TextDecoder("utf8");
- return "u" + decoder.decode(buf);
- }, (str) => {
- const encoder = new TextEncoder();
- return encoder.encode(str.substring(1));
- });
- ascii = createCodec("ascii", "a", (buf) => {
- let string2 = "a";
- for (let i5 = 0; i5 < buf.length; i5++) {
- string2 += String.fromCharCode(buf[i5]);
- }
- return string2;
- }, (str) => {
- str = str.substring(1);
- const buf = new Uint8Array(str.length);
- for (let i5 = 0; i5 < str.length; i5++) {
- buf[i5] = str.charCodeAt(i5);
- }
- return buf;
- });
- BASES = {
- utf8: string,
- "utf-8": string,
- hex: bases.base16,
- latin1: ascii,
- ascii,
- binary: ascii,
- ...bases
- };
- bases_default = BASES;
- }
-});
-
-// node_modules/uint8arrays/esm/src/from-string.js
-function fromString2(string2, encoding = "utf8") {
- const base3 = bases_default[encoding];
- if (!base3) {
- throw new Error(`Unsupported encoding "${encoding}"`);
- }
- return base3.decoder.decode(`${base3.prefix}${string2}`);
-}
-var init_from_string = __esm({
- "node_modules/uint8arrays/esm/src/from-string.js"() {
- init_bases();
- }
-});
-
-// node_modules/uint8arrays/esm/src/to-string.js
-function toString2(array, encoding = "utf8") {
- const base3 = bases_default[encoding];
- if (!base3) {
- throw new Error(`Unsupported encoding "${encoding}"`);
- }
- return base3.encoder.encode(array).substring(1);
-}
-var init_to_string = __esm({
- "node_modules/uint8arrays/esm/src/to-string.js"() {
- init_bases();
- }
-});
-
-// node_modules/uint8arrays/esm/src/xor.js
-function xor(a3, b3) {
- if (a3.length !== b3.length) {
- throw new Error("Inputs should have the same length");
- }
- const result = new Uint8Array(a3.length);
- for (let i5 = 0; i5 < a3.length; i5++) {
- result[i5] = a3[i5] ^ b3[i5];
- }
- return result;
-}
-var init_xor = __esm({
- "node_modules/uint8arrays/esm/src/xor.js"() {
- }
-});
-
-// node_modules/uint8arrays/esm/src/index.js
-var src_exports = {};
-__export(src_exports, {
- compare: () => compare,
- concat: () => concat,
- equals: () => equals3,
- fromString: () => fromString2,
- toString: () => toString2,
- xor: () => xor
-});
-var init_src2 = __esm({
- "node_modules/uint8arrays/esm/src/index.js"() {
- init_compare();
- init_concat();
- init_equals();
- init_from_string();
- init_to_string();
- init_xor();
- }
-});
-
-// node_modules/@atproto/common-web/dist/ipld.js
-var require_ipld = __commonJS({
- "node_modules/@atproto/common-web/dist/ipld.js"(exports) {
- "use strict";
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- var desc = Object.getOwnPropertyDescriptor(m2, k2);
- if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() {
- return m2[k2];
- } };
- }
- Object.defineProperty(o4, k22, desc);
- } : function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- o4[k22] = m2[k2];
- });
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v2) {
- Object.defineProperty(o4, "default", { enumerable: true, value: v2 });
- } : function(o4, v2) {
- o4["default"] = v2;
- });
- var __importStar = exports && exports.__importStar || function(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) {
- for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
- }
- __setModuleDefault(result, mod);
- return result;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ipldEquals = exports.ipldToJson = exports.jsonToIpld = void 0;
- var cid_1 = (init_cid(), __toCommonJS(cid_exports));
- var ui8 = __importStar((init_src2(), __toCommonJS(src_exports)));
- var jsonToIpld = (val) => {
- if (Array.isArray(val)) {
- return val.map((item) => (0, exports.jsonToIpld)(item));
- }
- if (val && typeof val === "object") {
- if (typeof val["$link"] === "string" && Object.keys(val).length === 1) {
- return cid_1.CID.parse(val["$link"]);
- }
- if (typeof val["$bytes"] === "string" && Object.keys(val).length === 1) {
- return ui8.fromString(val["$bytes"], "base64");
- }
- const toReturn = {};
- for (const key of Object.keys(val)) {
- toReturn[key] = (0, exports.jsonToIpld)(val[key]);
- }
- return toReturn;
- }
- return val;
- };
- exports.jsonToIpld = jsonToIpld;
- var ipldToJson = (val) => {
- if (Array.isArray(val)) {
- return val.map((item) => (0, exports.ipldToJson)(item));
- }
- if (val && typeof val === "object") {
- if (val instanceof Uint8Array) {
- return {
- $bytes: ui8.toString(val, "base64")
- };
- }
- if (cid_1.CID.asCID(val)) {
- return {
- $link: val.toString()
- };
- }
- const toReturn = {};
- for (const key of Object.keys(val)) {
- toReturn[key] = (0, exports.ipldToJson)(val[key]);
- }
- return toReturn;
- }
- return val;
- };
- exports.ipldToJson = ipldToJson;
- var ipldEquals = (a3, b3) => {
- if (Array.isArray(a3) && Array.isArray(b3)) {
- if (a3.length !== b3.length)
- return false;
- for (let i5 = 0; i5 < a3.length; i5++) {
- if (!(0, exports.ipldEquals)(a3[i5], b3[i5]))
- return false;
- }
- return true;
- }
- if (a3 && b3 && typeof a3 === "object" && typeof b3 === "object") {
- if (a3 instanceof Uint8Array && b3 instanceof Uint8Array) {
- return ui8.equals(a3, b3);
- }
- if (cid_1.CID.asCID(a3) && cid_1.CID.asCID(b3)) {
- return cid_1.CID.asCID(a3)?.equals(cid_1.CID.asCID(b3));
- }
- if (Object.keys(a3).length !== Object.keys(b3).length)
- return false;
- for (const key of Object.keys(a3)) {
- if (!(0, exports.ipldEquals)(a3[key], b3[key]))
- return false;
- }
- return true;
- }
- return a3 === b3;
- };
- exports.ipldEquals = ipldEquals;
- }
-});
-
-// node_modules/@atproto/common-web/dist/retry.js
-var require_retry = __commonJS({
- "node_modules/@atproto/common-web/dist/retry.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.backoffMs = exports.retry = void 0;
- var util_1 = require_util3();
- async function retry(fn, opts = {}) {
- const { maxRetries = 3, retryable = () => true, getWaitMs = backoffMs } = opts;
- let retries = 0;
- let doneError;
- while (!doneError) {
- try {
- return await fn();
- } catch (err) {
- const waitMs = getWaitMs(retries);
- const willRetry = retries < maxRetries && waitMs !== null && retryable(err);
- if (willRetry) {
- retries += 1;
- if (waitMs !== 0) {
- await (0, util_1.wait)(waitMs);
- }
- } else {
- doneError = err;
- }
- }
- }
- throw doneError;
- }
- exports.retry = retry;
- function backoffMs(n4, multiplier = 100, max = 1e3) {
- const exponentialMs = Math.pow(2, n4) * multiplier;
- const ms = Math.min(exponentialMs, max);
- return jitter(ms);
- }
- exports.backoffMs = backoffMs;
- function jitter(value) {
- const delta = value * 0.15;
- return value + randomRange(-delta, delta);
- }
- function randomRange(from3, to) {
- const rand = Math.random() * (to - from3);
- return rand + from3;
- }
- }
-});
-
-// node_modules/@atproto/common-web/dist/types.js
-var require_types3 = __commonJS({
- "node_modules/@atproto/common-web/dist/types.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.def = exports.schema = void 0;
- var cid_1 = (init_cid(), __toCommonJS(cid_exports));
- var zod_1 = require_lib();
- var cidSchema = zod_1.z.any().refine((obj) => cid_1.CID.asCID(obj) !== null, {
- message: "Not a CID"
- }).transform((obj) => cid_1.CID.asCID(obj));
- exports.schema = {
- cid: cidSchema,
- bytes: zod_1.z.instanceof(Uint8Array),
- string: zod_1.z.string(),
- array: zod_1.z.array(zod_1.z.unknown()),
- map: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
- unknown: zod_1.z.unknown()
- };
- exports.def = {
- cid: {
- name: "cid",
- schema: exports.schema.cid
- },
- bytes: {
- name: "bytes",
- schema: exports.schema.bytes
- },
- string: {
- name: "string",
- schema: exports.schema.string
- },
- map: {
- name: "map",
- schema: exports.schema.map
- },
- unknown: {
- name: "unknown",
- schema: exports.schema.unknown
- }
- };
- }
-});
-
-// node_modules/@atproto/common-web/dist/times.js
-var require_times = __commonJS({
- "node_modules/@atproto/common-web/dist/times.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.addHoursToDate = exports.lessThanAgoMs = exports.DAY = exports.HOUR = exports.MINUTE = exports.SECOND = void 0;
- exports.SECOND = 1e3;
- exports.MINUTE = exports.SECOND * 60;
- exports.HOUR = exports.MINUTE * 60;
- exports.DAY = exports.HOUR * 24;
- var lessThanAgoMs = (time, range) => {
- return Date.now() < time.getTime() + range;
- };
- exports.lessThanAgoMs = lessThanAgoMs;
- var addHoursToDate = (hours, startingDate) => {
- const currentDate = startingDate ? new Date(startingDate) : /* @__PURE__ */ new Date();
- currentDate.setHours(currentDate.getHours() + hours);
- return currentDate;
- };
- exports.addHoursToDate = addHoursToDate;
- }
-});
-
-// node_modules/graphemer/lib/boundaries.js
-var require_boundaries = __commonJS({
- "node_modules/graphemer/lib/boundaries.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.EXTENDED_PICTOGRAPHIC = exports.CLUSTER_BREAK = void 0;
- var CLUSTER_BREAK;
- (function(CLUSTER_BREAK2) {
- CLUSTER_BREAK2[CLUSTER_BREAK2["CR"] = 0] = "CR";
- CLUSTER_BREAK2[CLUSTER_BREAK2["LF"] = 1] = "LF";
- CLUSTER_BREAK2[CLUSTER_BREAK2["CONTROL"] = 2] = "CONTROL";
- CLUSTER_BREAK2[CLUSTER_BREAK2["EXTEND"] = 3] = "EXTEND";
- CLUSTER_BREAK2[CLUSTER_BREAK2["REGIONAL_INDICATOR"] = 4] = "REGIONAL_INDICATOR";
- CLUSTER_BREAK2[CLUSTER_BREAK2["SPACINGMARK"] = 5] = "SPACINGMARK";
- CLUSTER_BREAK2[CLUSTER_BREAK2["L"] = 6] = "L";
- CLUSTER_BREAK2[CLUSTER_BREAK2["V"] = 7] = "V";
- CLUSTER_BREAK2[CLUSTER_BREAK2["T"] = 8] = "T";
- CLUSTER_BREAK2[CLUSTER_BREAK2["LV"] = 9] = "LV";
- CLUSTER_BREAK2[CLUSTER_BREAK2["LVT"] = 10] = "LVT";
- CLUSTER_BREAK2[CLUSTER_BREAK2["OTHER"] = 11] = "OTHER";
- CLUSTER_BREAK2[CLUSTER_BREAK2["PREPEND"] = 12] = "PREPEND";
- CLUSTER_BREAK2[CLUSTER_BREAK2["E_BASE"] = 13] = "E_BASE";
- CLUSTER_BREAK2[CLUSTER_BREAK2["E_MODIFIER"] = 14] = "E_MODIFIER";
- CLUSTER_BREAK2[CLUSTER_BREAK2["ZWJ"] = 15] = "ZWJ";
- CLUSTER_BREAK2[CLUSTER_BREAK2["GLUE_AFTER_ZWJ"] = 16] = "GLUE_AFTER_ZWJ";
- CLUSTER_BREAK2[CLUSTER_BREAK2["E_BASE_GAZ"] = 17] = "E_BASE_GAZ";
- })(CLUSTER_BREAK = exports.CLUSTER_BREAK || (exports.CLUSTER_BREAK = {}));
- exports.EXTENDED_PICTOGRAPHIC = 101;
- }
-});
-
-// node_modules/graphemer/lib/GraphemerHelper.js
-var require_GraphemerHelper = __commonJS({
- "node_modules/graphemer/lib/GraphemerHelper.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var boundaries_1 = require_boundaries();
- var NotBreak = 0;
- var BreakStart = 1;
- var Break = 2;
- var BreakLastRegional = 3;
- var BreakPenultimateRegional = 4;
- var GraphemerHelper = class {
- /**
- * Check if the the character at the position {pos} of the string is surrogate
- * @param str {string}
- * @param pos {number}
- * @returns {boolean}
- */
- static isSurrogate(str, pos) {
- return 55296 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 56319 && 56320 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 57343;
- }
- /**
- * The String.prototype.codePointAt polyfill
- * Private function, gets a Unicode code point from a JavaScript UTF-16 string
- * handling surrogate pairs appropriately
- * @param str {string}
- * @param idx {number}
- * @returns {number}
- */
- static codePointAt(str, idx) {
- if (idx === void 0) {
- idx = 0;
- }
- const code2 = str.charCodeAt(idx);
- if (55296 <= code2 && code2 <= 56319 && idx < str.length - 1) {
- const hi = code2;
- const low = str.charCodeAt(idx + 1);
- if (56320 <= low && low <= 57343) {
- return (hi - 55296) * 1024 + (low - 56320) + 65536;
- }
- return hi;
- }
- if (56320 <= code2 && code2 <= 57343 && idx >= 1) {
- const hi = str.charCodeAt(idx - 1);
- const low = code2;
- if (55296 <= hi && hi <= 56319) {
- return (hi - 55296) * 1024 + (low - 56320) + 65536;
- }
- return low;
- }
- return code2;
- }
- //
- /**
- * Private function, returns whether a break is allowed between the two given grapheme breaking classes
- * Implemented the UAX #29 3.1.1 Grapheme Cluster Boundary Rules on extended grapheme clusters
- * @param start {number}
- * @param mid {Array}
- * @param end {number}
- * @param startEmoji {number}
- * @param midEmoji {Array}
- * @param endEmoji {number}
- * @returns {number}
- */
- static shouldBreak(start, mid, end, startEmoji, midEmoji, endEmoji) {
- const all = [start].concat(mid).concat([end]);
- const allEmoji = [startEmoji].concat(midEmoji).concat([endEmoji]);
- const previous = all[all.length - 2];
- const next = end;
- const nextEmoji = endEmoji;
- const rIIndex = all.lastIndexOf(boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR);
- if (rIIndex > 0 && all.slice(1, rIIndex).every(function(c4) {
- return c4 === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR;
- }) && [boundaries_1.CLUSTER_BREAK.PREPEND, boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(previous) === -1) {
- if (all.filter(function(c4) {
- return c4 === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR;
- }).length % 2 === 1) {
- return BreakLastRegional;
- } else {
- return BreakPenultimateRegional;
- }
- }
- if (previous === boundaries_1.CLUSTER_BREAK.CR && next === boundaries_1.CLUSTER_BREAK.LF) {
- return NotBreak;
- } else if (previous === boundaries_1.CLUSTER_BREAK.CONTROL || previous === boundaries_1.CLUSTER_BREAK.CR || previous === boundaries_1.CLUSTER_BREAK.LF) {
- return BreakStart;
- } else if (next === boundaries_1.CLUSTER_BREAK.CONTROL || next === boundaries_1.CLUSTER_BREAK.CR || next === boundaries_1.CLUSTER_BREAK.LF) {
- return BreakStart;
- } else if (previous === boundaries_1.CLUSTER_BREAK.L && (next === boundaries_1.CLUSTER_BREAK.L || next === boundaries_1.CLUSTER_BREAK.V || next === boundaries_1.CLUSTER_BREAK.LV || next === boundaries_1.CLUSTER_BREAK.LVT)) {
- return NotBreak;
- } else if ((previous === boundaries_1.CLUSTER_BREAK.LV || previous === boundaries_1.CLUSTER_BREAK.V) && (next === boundaries_1.CLUSTER_BREAK.V || next === boundaries_1.CLUSTER_BREAK.T)) {
- return NotBreak;
- } else if ((previous === boundaries_1.CLUSTER_BREAK.LVT || previous === boundaries_1.CLUSTER_BREAK.T) && next === boundaries_1.CLUSTER_BREAK.T) {
- return NotBreak;
- } else if (next === boundaries_1.CLUSTER_BREAK.EXTEND || next === boundaries_1.CLUSTER_BREAK.ZWJ) {
- return NotBreak;
- } else if (next === boundaries_1.CLUSTER_BREAK.SPACINGMARK) {
- return NotBreak;
- } else if (previous === boundaries_1.CLUSTER_BREAK.PREPEND) {
- return NotBreak;
- }
- const previousNonExtendIndex = allEmoji.slice(0, -1).lastIndexOf(boundaries_1.EXTENDED_PICTOGRAPHIC);
- if (previousNonExtendIndex !== -1 && allEmoji[previousNonExtendIndex] === boundaries_1.EXTENDED_PICTOGRAPHIC && all.slice(previousNonExtendIndex + 1, -2).every(function(c4) {
- return c4 === boundaries_1.CLUSTER_BREAK.EXTEND;
- }) && previous === boundaries_1.CLUSTER_BREAK.ZWJ && nextEmoji === boundaries_1.EXTENDED_PICTOGRAPHIC) {
- return NotBreak;
- }
- if (mid.indexOf(boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR) !== -1) {
- return Break;
- }
- if (previous === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR && next === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR) {
- return NotBreak;
- }
- return BreakStart;
- }
- };
- exports.default = GraphemerHelper;
- }
-});
-
-// node_modules/graphemer/lib/GraphemerIterator.js
-var require_GraphemerIterator = __commonJS({
- "node_modules/graphemer/lib/GraphemerIterator.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var GraphemerIterator = class {
- constructor(str, nextBreak) {
- this._index = 0;
- this._str = str;
- this._nextBreak = nextBreak;
- }
- [Symbol.iterator]() {
- return this;
- }
- next() {
- let brk;
- if ((brk = this._nextBreak(this._str, this._index)) < this._str.length) {
- const value = this._str.slice(this._index, brk);
- this._index = brk;
- return { value, done: false };
- }
- if (this._index < this._str.length) {
- const value = this._str.slice(this._index);
- this._index = this._str.length;
- return { value, done: false };
- }
- return { value: void 0, done: true };
- }
- };
- exports.default = GraphemerIterator;
- }
-});
-
-// node_modules/graphemer/lib/Graphemer.js
-var require_Graphemer = __commonJS({
- "node_modules/graphemer/lib/Graphemer.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var boundaries_1 = require_boundaries();
- var GraphemerHelper_1 = __importDefault(require_GraphemerHelper());
- var GraphemerIterator_1 = __importDefault(require_GraphemerIterator());
- var Graphemer = class _Graphemer {
- /**
- * Returns the next grapheme break in the string after the given index
- * @param string {string}
- * @param index {number}
- * @returns {number}
- */
- static nextBreak(string2, index) {
- if (index === void 0) {
- index = 0;
- }
- if (index < 0) {
- return 0;
- }
- if (index >= string2.length - 1) {
- return string2.length;
- }
- const prevCP = GraphemerHelper_1.default.codePointAt(string2, index);
- const prev = _Graphemer.getGraphemeBreakProperty(prevCP);
- const prevEmoji = _Graphemer.getEmojiProperty(prevCP);
- const mid = [];
- const midEmoji = [];
- for (let i5 = index + 1; i5 < string2.length; i5++) {
- if (GraphemerHelper_1.default.isSurrogate(string2, i5 - 1)) {
- continue;
- }
- const nextCP = GraphemerHelper_1.default.codePointAt(string2, i5);
- const next = _Graphemer.getGraphemeBreakProperty(nextCP);
- const nextEmoji = _Graphemer.getEmojiProperty(nextCP);
- if (GraphemerHelper_1.default.shouldBreak(prev, mid, next, prevEmoji, midEmoji, nextEmoji)) {
- return i5;
- }
- mid.push(next);
- midEmoji.push(nextEmoji);
- }
- return string2.length;
- }
- /**
- * Breaks the given string into an array of grapheme clusters
- * @param str {string}
- * @returns {string[]}
- */
- splitGraphemes(str) {
- const res = [];
- let index = 0;
- let brk;
- while ((brk = _Graphemer.nextBreak(str, index)) < str.length) {
- res.push(str.slice(index, brk));
- index = brk;
- }
- if (index < str.length) {
- res.push(str.slice(index));
- }
- return res;
- }
- /**
- * Returns an iterator of grapheme clusters in the given string
- * @param str {string}
- * @returns {GraphemerIterator}
- */
- iterateGraphemes(str) {
- return new GraphemerIterator_1.default(str, _Graphemer.nextBreak);
- }
- /**
- * Returns the number of grapheme clusters in the given string
- * @param str {string}
- * @returns {number}
- */
- countGraphemes(str) {
- let count = 0;
- let index = 0;
- let brk;
- while ((brk = _Graphemer.nextBreak(str, index)) < str.length) {
- index = brk;
- count++;
- }
- if (index < str.length) {
- count++;
- }
- return count;
- }
- /**
- * Given a Unicode code point, determines this symbol's grapheme break property
- * @param code {number} Unicode code point
- * @returns {number}
- */
- static getGraphemeBreakProperty(code2) {
- if (code2 < 48905) {
- if (code2 < 44116) {
- if (code2 < 4141) {
- if (code2 < 2818) {
- if (code2 < 2363) {
- if (code2 < 1759) {
- if (code2 < 1471) {
- if (code2 < 127) {
- if (code2 < 11) {
- if (code2 < 10) {
- if (0 <= code2 && code2 <= 9) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (10 === code2) {
- return boundaries_1.CLUSTER_BREAK.LF;
- }
- }
- } else {
- if (code2 < 13) {
- if (11 <= code2 && code2 <= 12) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (code2 < 14) {
- if (13 === code2) {
- return boundaries_1.CLUSTER_BREAK.CR;
- }
- } else {
- if (14 <= code2 && code2 <= 31) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- }
- }
- }
- } else {
- if (code2 < 768) {
- if (code2 < 173) {
- if (127 <= code2 && code2 <= 159) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (173 === code2) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- }
- } else {
- if (code2 < 1155) {
- if (768 <= code2 && code2 <= 879) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 1425) {
- if (1155 <= code2 && code2 <= 1161) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1425 <= code2 && code2 <= 1469) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 1552) {
- if (code2 < 1476) {
- if (code2 < 1473) {
- if (1471 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1473 <= code2 && code2 <= 1474) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 1479) {
- if (1476 <= code2 && code2 <= 1477) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 1536) {
- if (1479 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1536 <= code2 && code2 <= 1541) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- }
- }
- }
- } else {
- if (code2 < 1648) {
- if (code2 < 1564) {
- if (1552 <= code2 && code2 <= 1562) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 1611) {
- if (1564 === code2) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (1611 <= code2 && code2 <= 1631) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 1750) {
- if (1648 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 1757) {
- if (1750 <= code2 && code2 <= 1756) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1757 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 2075) {
- if (code2 < 1840) {
- if (code2 < 1770) {
- if (code2 < 1767) {
- if (1759 <= code2 && code2 <= 1764) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1767 <= code2 && code2 <= 1768) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 1807) {
- if (1770 <= code2 && code2 <= 1773) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1807 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- if (1809 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 2027) {
- if (code2 < 1958) {
- if (1840 <= code2 && code2 <= 1866) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (1958 <= code2 && code2 <= 1968) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 2045) {
- if (2027 <= code2 && code2 <= 2035) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2070) {
- if (2045 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2070 <= code2 && code2 <= 2073) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 2200) {
- if (code2 < 2089) {
- if (code2 < 2085) {
- if (2075 <= code2 && code2 <= 2083) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2085 <= code2 && code2 <= 2087) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 2137) {
- if (2089 <= code2 && code2 <= 2093) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2192) {
- if (2137 <= code2 && code2 <= 2139) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2192 <= code2 && code2 <= 2193) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- }
- }
- }
- } else {
- if (code2 < 2275) {
- if (code2 < 2250) {
- if (2200 <= code2 && code2 <= 2207) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2274) {
- if (2250 <= code2 && code2 <= 2273) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2274 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- }
- }
- } else {
- if (code2 < 2307) {
- if (2275 <= code2 && code2 <= 2306) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2307 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (2362 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 2561) {
- if (code2 < 2434) {
- if (code2 < 2381) {
- if (code2 < 2366) {
- if (2363 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (2364 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2369) {
- if (2366 <= code2 && code2 <= 2368) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 2377) {
- if (2369 <= code2 && code2 <= 2376) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2377 <= code2 && code2 <= 2380) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 2385) {
- if (code2 < 2382) {
- if (2381 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2382 <= code2 && code2 <= 2383) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 2402) {
- if (2385 <= code2 && code2 <= 2391) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2433) {
- if (2402 <= code2 && code2 <= 2403) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2433 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 2503) {
- if (code2 < 2494) {
- if (code2 < 2492) {
- if (2434 <= code2 && code2 <= 2435) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2492 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 2495) {
- if (2494 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2497) {
- if (2495 <= code2 && code2 <= 2496) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2497 <= code2 && code2 <= 2500) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 2519) {
- if (code2 < 2507) {
- if (2503 <= code2 && code2 <= 2504) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 2509) {
- if (2507 <= code2 && code2 <= 2508) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2509 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 2530) {
- if (2519 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2558) {
- if (2530 <= code2 && code2 <= 2531) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2558 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 2691) {
- if (code2 < 2631) {
- if (code2 < 2620) {
- if (code2 < 2563) {
- if (2561 <= code2 && code2 <= 2562) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2563 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 2622) {
- if (2620 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2625) {
- if (2622 <= code2 && code2 <= 2624) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2625 <= code2 && code2 <= 2626) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 2672) {
- if (code2 < 2635) {
- if (2631 <= code2 && code2 <= 2632) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2641) {
- if (2635 <= code2 && code2 <= 2637) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2641 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 2677) {
- if (2672 <= code2 && code2 <= 2673) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2689) {
- if (2677 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2689 <= code2 && code2 <= 2690) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 2761) {
- if (code2 < 2750) {
- if (2691 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (2748 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2753) {
- if (2750 <= code2 && code2 <= 2752) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 2759) {
- if (2753 <= code2 && code2 <= 2757) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2759 <= code2 && code2 <= 2760) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 2786) {
- if (code2 < 2763) {
- if (2761 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 2765) {
- if (2763 <= code2 && code2 <= 2764) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2765 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 2810) {
- if (2786 <= code2 && code2 <= 2787) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2817) {
- if (2810 <= code2 && code2 <= 2815) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2817 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3315) {
- if (code2 < 3076) {
- if (code2 < 2946) {
- if (code2 < 2887) {
- if (code2 < 2878) {
- if (code2 < 2876) {
- if (2818 <= code2 && code2 <= 2819) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2876 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 2880) {
- if (2878 <= code2 && code2 <= 2879) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2881) {
- if (2880 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2881 <= code2 && code2 <= 2884) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 2893) {
- if (code2 < 2891) {
- if (2887 <= code2 && code2 <= 2888) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (2891 <= code2 && code2 <= 2892) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 2901) {
- if (2893 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 2914) {
- if (2901 <= code2 && code2 <= 2903) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (2914 <= code2 && code2 <= 2915) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3014) {
- if (code2 < 3007) {
- if (2946 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (3006 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3008) {
- if (3007 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 3009) {
- if (3008 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3009 <= code2 && code2 <= 3010) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 3031) {
- if (code2 < 3018) {
- if (3014 <= code2 && code2 <= 3016) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 3021) {
- if (3018 <= code2 && code2 <= 3020) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3021 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 3072) {
- if (3031 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3073) {
- if (3072 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3073 <= code2 && code2 <= 3075) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3262) {
- if (code2 < 3146) {
- if (code2 < 3134) {
- if (3076 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (3132 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3137) {
- if (3134 <= code2 && code2 <= 3136) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3142) {
- if (3137 <= code2 && code2 <= 3140) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3142 <= code2 && code2 <= 3144) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 3201) {
- if (code2 < 3157) {
- if (3146 <= code2 && code2 <= 3149) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3170) {
- if (3157 <= code2 && code2 <= 3158) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3170 <= code2 && code2 <= 3171) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 3202) {
- if (3201 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3260) {
- if (3202 <= code2 && code2 <= 3203) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3260 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3270) {
- if (code2 < 3264) {
- if (3262 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (3263 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3266) {
- if (3264 <= code2 && code2 <= 3265) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 3267) {
- if (3266 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3267 <= code2 && code2 <= 3268) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 3276) {
- if (code2 < 3271) {
- if (3270 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3274) {
- if (3271 <= code2 && code2 <= 3272) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3274 <= code2 && code2 <= 3275) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 3285) {
- if (3276 <= code2 && code2 <= 3277) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3298) {
- if (3285 <= code2 && code2 <= 3286) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3298 <= code2 && code2 <= 3299) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3551) {
- if (code2 < 3406) {
- if (code2 < 3391) {
- if (code2 < 3330) {
- if (code2 < 3328) {
- if (3315 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3328 <= code2 && code2 <= 3329) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 3387) {
- if (3330 <= code2 && code2 <= 3331) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 3390) {
- if (3387 <= code2 && code2 <= 3388) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3390 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 3398) {
- if (code2 < 3393) {
- if (3391 <= code2 && code2 <= 3392) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3393 <= code2 && code2 <= 3396) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 3402) {
- if (3398 <= code2 && code2 <= 3400) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 3405) {
- if (3402 <= code2 && code2 <= 3404) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3405 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3530) {
- if (code2 < 3426) {
- if (3406 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- if (3415 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3457) {
- if (3426 <= code2 && code2 <= 3427) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3458) {
- if (3457 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3458 <= code2 && code2 <= 3459) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 3538) {
- if (code2 < 3535) {
- if (3530 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3536) {
- if (3535 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3536 <= code2 && code2 <= 3537) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 3542) {
- if (3538 <= code2 && code2 <= 3540) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3544) {
- if (3542 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3544 <= code2 && code2 <= 3550) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3893) {
- if (code2 < 3655) {
- if (code2 < 3633) {
- if (code2 < 3570) {
- if (3551 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3570 <= code2 && code2 <= 3571) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 3635) {
- if (3633 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3636) {
- if (3635 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3636 <= code2 && code2 <= 3642) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 3764) {
- if (code2 < 3761) {
- if (3655 <= code2 && code2 <= 3662) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3761 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (3763 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 3784) {
- if (3764 <= code2 && code2 <= 3772) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3864) {
- if (3784 <= code2 && code2 <= 3790) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3864 <= code2 && code2 <= 3865) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 3967) {
- if (code2 < 3897) {
- if (3893 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (3895 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3902) {
- if (3897 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 3953) {
- if (3902 <= code2 && code2 <= 3903) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (3953 <= code2 && code2 <= 3966) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 3981) {
- if (code2 < 3968) {
- if (3967 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 3974) {
- if (3968 <= code2 && code2 <= 3972) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (3974 <= code2 && code2 <= 3975) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 3993) {
- if (3981 <= code2 && code2 <= 3991) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 4038) {
- if (3993 <= code2 && code2 <= 4028) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (4038 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 7204) {
- if (code2 < 6448) {
- if (code2 < 5938) {
- if (code2 < 4226) {
- if (code2 < 4157) {
- if (code2 < 4146) {
- if (code2 < 4145) {
- if (4141 <= code2 && code2 <= 4144) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (4145 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 4153) {
- if (4146 <= code2 && code2 <= 4151) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 4155) {
- if (4153 <= code2 && code2 <= 4154) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (4155 <= code2 && code2 <= 4156) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 4184) {
- if (code2 < 4182) {
- if (4157 <= code2 && code2 <= 4158) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (4182 <= code2 && code2 <= 4183) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 4190) {
- if (4184 <= code2 && code2 <= 4185) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 4209) {
- if (4190 <= code2 && code2 <= 4192) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (4209 <= code2 && code2 <= 4212) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 4352) {
- if (code2 < 4229) {
- if (4226 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (4228 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 4237) {
- if (4229 <= code2 && code2 <= 4230) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (4237 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (4253 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 4957) {
- if (code2 < 4448) {
- if (4352 <= code2 && code2 <= 4447) {
- return boundaries_1.CLUSTER_BREAK.L;
- }
- } else {
- if (code2 < 4520) {
- if (4448 <= code2 && code2 <= 4519) {
- return boundaries_1.CLUSTER_BREAK.V;
- }
- } else {
- if (4520 <= code2 && code2 <= 4607) {
- return boundaries_1.CLUSTER_BREAK.T;
- }
- }
- }
- } else {
- if (code2 < 5906) {
- if (4957 <= code2 && code2 <= 4959) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 5909) {
- if (5906 <= code2 && code2 <= 5908) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (5909 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 6089) {
- if (code2 < 6070) {
- if (code2 < 5970) {
- if (code2 < 5940) {
- if (5938 <= code2 && code2 <= 5939) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (5940 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 6002) {
- if (5970 <= code2 && code2 <= 5971) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 6068) {
- if (6002 <= code2 && code2 <= 6003) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6068 <= code2 && code2 <= 6069) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 6078) {
- if (code2 < 6071) {
- if (6070 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (6071 <= code2 && code2 <= 6077) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 6086) {
- if (6078 <= code2 && code2 <= 6085) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 6087) {
- if (6086 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6087 <= code2 && code2 <= 6088) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 6277) {
- if (code2 < 6155) {
- if (code2 < 6109) {
- if (6089 <= code2 && code2 <= 6099) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6109 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 6158) {
- if (6155 <= code2 && code2 <= 6157) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6158 === code2) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- if (6159 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 6435) {
- if (code2 < 6313) {
- if (6277 <= code2 && code2 <= 6278) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 6432) {
- if (6313 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6432 <= code2 && code2 <= 6434) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 6439) {
- if (6435 <= code2 && code2 <= 6438) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 6441) {
- if (6439 <= code2 && code2 <= 6440) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6441 <= code2 && code2 <= 6443) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 6971) {
- if (code2 < 6744) {
- if (code2 < 6681) {
- if (code2 < 6451) {
- if (code2 < 6450) {
- if (6448 <= code2 && code2 <= 6449) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (6450 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 6457) {
- if (6451 <= code2 && code2 <= 6456) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 6679) {
- if (6457 <= code2 && code2 <= 6459) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6679 <= code2 && code2 <= 6680) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 6741) {
- if (code2 < 6683) {
- if (6681 <= code2 && code2 <= 6682) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (6683 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 6742) {
- if (6741 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (6742 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (6743 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 6771) {
- if (code2 < 6754) {
- if (code2 < 6752) {
- if (6744 <= code2 && code2 <= 6750) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6752 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 6757) {
- if (6754 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 6765) {
- if (6757 <= code2 && code2 <= 6764) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6765 <= code2 && code2 <= 6770) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 6912) {
- if (code2 < 6783) {
- if (6771 <= code2 && code2 <= 6780) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 6832) {
- if (6783 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6832 <= code2 && code2 <= 6862) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 6916) {
- if (6912 <= code2 && code2 <= 6915) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 6964) {
- if (6916 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (6964 <= code2 && code2 <= 6970) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 7080) {
- if (code2 < 7019) {
- if (code2 < 6973) {
- if (6971 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (6972 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 6978) {
- if (6973 <= code2 && code2 <= 6977) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 6979) {
- if (6978 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (6979 <= code2 && code2 <= 6980) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 7073) {
- if (code2 < 7040) {
- if (7019 <= code2 && code2 <= 7027) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 7042) {
- if (7040 <= code2 && code2 <= 7041) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7042 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 7074) {
- if (7073 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 7078) {
- if (7074 <= code2 && code2 <= 7077) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7078 <= code2 && code2 <= 7079) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 7144) {
- if (code2 < 7083) {
- if (code2 < 7082) {
- if (7080 <= code2 && code2 <= 7081) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7082 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 7142) {
- if (7083 <= code2 && code2 <= 7085) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7142 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (7143 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 7150) {
- if (code2 < 7146) {
- if (7144 <= code2 && code2 <= 7145) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 7149) {
- if (7146 <= code2 && code2 <= 7148) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (7149 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 7151) {
- if (7150 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 7154) {
- if (7151 <= code2 && code2 <= 7153) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7154 <= code2 && code2 <= 7155) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 43346) {
- if (code2 < 11647) {
- if (code2 < 7415) {
- if (code2 < 7380) {
- if (code2 < 7220) {
- if (code2 < 7212) {
- if (7204 <= code2 && code2 <= 7211) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (7212 <= code2 && code2 <= 7219) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 7222) {
- if (7220 <= code2 && code2 <= 7221) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 7376) {
- if (7222 <= code2 && code2 <= 7223) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7376 <= code2 && code2 <= 7378) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 7394) {
- if (code2 < 7393) {
- if (7380 <= code2 && code2 <= 7392) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7393 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 7405) {
- if (7394 <= code2 && code2 <= 7400) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (7405 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (7412 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 8205) {
- if (code2 < 7616) {
- if (code2 < 7416) {
- if (7415 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (7416 <= code2 && code2 <= 7417) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 8203) {
- if (7616 <= code2 && code2 <= 7679) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (8203 === code2) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- if (8204 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 8288) {
- if (code2 < 8206) {
- if (8205 === code2) {
- return boundaries_1.CLUSTER_BREAK.ZWJ;
- }
- } else {
- if (code2 < 8232) {
- if (8206 <= code2 && code2 <= 8207) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (8232 <= code2 && code2 <= 8238) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- }
- }
- } else {
- if (code2 < 8400) {
- if (8288 <= code2 && code2 <= 8303) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (code2 < 11503) {
- if (8400 <= code2 && code2 <= 8432) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (11503 <= code2 && code2 <= 11505) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 43043) {
- if (code2 < 42612) {
- if (code2 < 12330) {
- if (code2 < 11744) {
- if (11647 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (11744 <= code2 && code2 <= 11775) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 12441) {
- if (12330 <= code2 && code2 <= 12335) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 42607) {
- if (12441 <= code2 && code2 <= 12442) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (42607 <= code2 && code2 <= 42610) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 43010) {
- if (code2 < 42654) {
- if (42612 <= code2 && code2 <= 42621) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 42736) {
- if (42654 <= code2 && code2 <= 42655) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (42736 <= code2 && code2 <= 42737) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 43014) {
- if (43010 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43014 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (43019 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 43188) {
- if (code2 < 43047) {
- if (code2 < 43045) {
- if (43043 <= code2 && code2 <= 43044) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (43045 <= code2 && code2 <= 43046) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 43052) {
- if (43047 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 43136) {
- if (43052 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43136 <= code2 && code2 <= 43137) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 43263) {
- if (code2 < 43204) {
- if (43188 <= code2 && code2 <= 43203) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 43232) {
- if (43204 <= code2 && code2 <= 43205) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43232 <= code2 && code2 <= 43249) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 43302) {
- if (43263 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 43335) {
- if (43302 <= code2 && code2 <= 43309) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43335 <= code2 && code2 <= 43345) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 43698) {
- if (code2 < 43493) {
- if (code2 < 43444) {
- if (code2 < 43392) {
- if (code2 < 43360) {
- if (43346 <= code2 && code2 <= 43347) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (43360 <= code2 && code2 <= 43388) {
- return boundaries_1.CLUSTER_BREAK.L;
- }
- }
- } else {
- if (code2 < 43395) {
- if (43392 <= code2 && code2 <= 43394) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43395 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (43443 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 43450) {
- if (code2 < 43446) {
- if (43444 <= code2 && code2 <= 43445) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (43446 <= code2 && code2 <= 43449) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 43452) {
- if (43450 <= code2 && code2 <= 43451) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 43454) {
- if (43452 <= code2 && code2 <= 43453) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43454 <= code2 && code2 <= 43456) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 43573) {
- if (code2 < 43567) {
- if (code2 < 43561) {
- if (43493 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43561 <= code2 && code2 <= 43566) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 43569) {
- if (43567 <= code2 && code2 <= 43568) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 43571) {
- if (43569 <= code2 && code2 <= 43570) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43571 <= code2 && code2 <= 43572) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 43597) {
- if (code2 < 43587) {
- if (43573 <= code2 && code2 <= 43574) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43587 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (43596 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 43644) {
- if (43597 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (43644 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (43696 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44006) {
- if (code2 < 43756) {
- if (code2 < 43710) {
- if (code2 < 43703) {
- if (43698 <= code2 && code2 <= 43700) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43703 <= code2 && code2 <= 43704) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 43713) {
- if (43710 <= code2 && code2 <= 43711) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (43713 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (43755 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 43766) {
- if (code2 < 43758) {
- if (43756 <= code2 && code2 <= 43757) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 43765) {
- if (43758 <= code2 && code2 <= 43759) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (43765 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 44003) {
- if (43766 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 44005) {
- if (44003 <= code2 && code2 <= 44004) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (44005 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44032) {
- if (code2 < 44009) {
- if (code2 < 44008) {
- if (44006 <= code2 && code2 <= 44007) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (44008 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 44012) {
- if (44009 <= code2 && code2 <= 44010) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (44012 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (44013 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 44061) {
- if (code2 < 44033) {
- if (44032 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44060) {
- if (44033 <= code2 && code2 <= 44059) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44060 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 44088) {
- if (44061 <= code2 && code2 <= 44087) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44089) {
- if (44088 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44089 <= code2 && code2 <= 44115) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46497) {
- if (code2 < 45293) {
- if (code2 < 44704) {
- if (code2 < 44397) {
- if (code2 < 44256) {
- if (code2 < 44173) {
- if (code2 < 44144) {
- if (code2 < 44117) {
- if (44116 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44117 <= code2 && code2 <= 44143) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 44145) {
- if (44144 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44172) {
- if (44145 <= code2 && code2 <= 44171) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44172 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 44201) {
- if (code2 < 44200) {
- if (44173 <= code2 && code2 <= 44199) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44200 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 44228) {
- if (44201 <= code2 && code2 <= 44227) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44229) {
- if (44228 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44229 <= code2 && code2 <= 44255) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44313) {
- if (code2 < 44284) {
- if (code2 < 44257) {
- if (44256 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44257 <= code2 && code2 <= 44283) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 44285) {
- if (44284 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44312) {
- if (44285 <= code2 && code2 <= 44311) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44312 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 44368) {
- if (code2 < 44340) {
- if (44313 <= code2 && code2 <= 44339) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44341) {
- if (44340 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44341 <= code2 && code2 <= 44367) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 44369) {
- if (44368 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44396) {
- if (44369 <= code2 && code2 <= 44395) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44396 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44537) {
- if (code2 < 44480) {
- if (code2 < 44425) {
- if (code2 < 44424) {
- if (44397 <= code2 && code2 <= 44423) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44424 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 44452) {
- if (44425 <= code2 && code2 <= 44451) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44453) {
- if (44452 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44453 <= code2 && code2 <= 44479) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 44508) {
- if (code2 < 44481) {
- if (44480 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44481 <= code2 && code2 <= 44507) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 44509) {
- if (44508 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44536) {
- if (44509 <= code2 && code2 <= 44535) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44536 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44620) {
- if (code2 < 44565) {
- if (code2 < 44564) {
- if (44537 <= code2 && code2 <= 44563) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44564 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 44592) {
- if (44565 <= code2 && code2 <= 44591) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44593) {
- if (44592 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44593 <= code2 && code2 <= 44619) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 44649) {
- if (code2 < 44621) {
- if (44620 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44648) {
- if (44621 <= code2 && code2 <= 44647) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44648 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 44676) {
- if (44649 <= code2 && code2 <= 44675) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44677) {
- if (44676 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44677 <= code2 && code2 <= 44703) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44985) {
- if (code2 < 44844) {
- if (code2 < 44761) {
- if (code2 < 44732) {
- if (code2 < 44705) {
- if (44704 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44705 <= code2 && code2 <= 44731) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 44733) {
- if (44732 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44760) {
- if (44733 <= code2 && code2 <= 44759) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44760 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 44789) {
- if (code2 < 44788) {
- if (44761 <= code2 && code2 <= 44787) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44788 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 44816) {
- if (44789 <= code2 && code2 <= 44815) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44817) {
- if (44816 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44817 <= code2 && code2 <= 44843) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 44901) {
- if (code2 < 44872) {
- if (code2 < 44845) {
- if (44844 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44845 <= code2 && code2 <= 44871) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 44873) {
- if (44872 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44900) {
- if (44873 <= code2 && code2 <= 44899) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44900 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 44956) {
- if (code2 < 44928) {
- if (44901 <= code2 && code2 <= 44927) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 44929) {
- if (44928 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (44929 <= code2 && code2 <= 44955) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 44957) {
- if (44956 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 44984) {
- if (44957 <= code2 && code2 <= 44983) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (44984 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 45152) {
- if (code2 < 45068) {
- if (code2 < 45013) {
- if (code2 < 45012) {
- if (44985 <= code2 && code2 <= 45011) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45012 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 45040) {
- if (45013 <= code2 && code2 <= 45039) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45041) {
- if (45040 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45041 <= code2 && code2 <= 45067) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 45097) {
- if (code2 < 45069) {
- if (45068 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45096) {
- if (45069 <= code2 && code2 <= 45095) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45096 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 45124) {
- if (45097 <= code2 && code2 <= 45123) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45125) {
- if (45124 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45125 <= code2 && code2 <= 45151) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 45209) {
- if (code2 < 45180) {
- if (code2 < 45153) {
- if (45152 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45153 <= code2 && code2 <= 45179) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 45181) {
- if (45180 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45208) {
- if (45181 <= code2 && code2 <= 45207) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45208 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 45264) {
- if (code2 < 45236) {
- if (45209 <= code2 && code2 <= 45235) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45237) {
- if (45236 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45237 <= code2 && code2 <= 45263) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 45265) {
- if (45264 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45292) {
- if (45265 <= code2 && code2 <= 45291) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45292 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 45908) {
- if (code2 < 45600) {
- if (code2 < 45433) {
- if (code2 < 45376) {
- if (code2 < 45321) {
- if (code2 < 45320) {
- if (45293 <= code2 && code2 <= 45319) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45320 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 45348) {
- if (45321 <= code2 && code2 <= 45347) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45349) {
- if (45348 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45349 <= code2 && code2 <= 45375) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 45404) {
- if (code2 < 45377) {
- if (45376 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45377 <= code2 && code2 <= 45403) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 45405) {
- if (45404 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45432) {
- if (45405 <= code2 && code2 <= 45431) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45432 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 45516) {
- if (code2 < 45461) {
- if (code2 < 45460) {
- if (45433 <= code2 && code2 <= 45459) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45460 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 45488) {
- if (45461 <= code2 && code2 <= 45487) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45489) {
- if (45488 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45489 <= code2 && code2 <= 45515) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 45545) {
- if (code2 < 45517) {
- if (45516 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45544) {
- if (45517 <= code2 && code2 <= 45543) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45544 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 45572) {
- if (45545 <= code2 && code2 <= 45571) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45573) {
- if (45572 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45573 <= code2 && code2 <= 45599) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 45741) {
- if (code2 < 45657) {
- if (code2 < 45628) {
- if (code2 < 45601) {
- if (45600 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45601 <= code2 && code2 <= 45627) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 45629) {
- if (45628 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45656) {
- if (45629 <= code2 && code2 <= 45655) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45656 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 45712) {
- if (code2 < 45684) {
- if (45657 <= code2 && code2 <= 45683) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45685) {
- if (45684 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45685 <= code2 && code2 <= 45711) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 45713) {
- if (45712 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45740) {
- if (45713 <= code2 && code2 <= 45739) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45740 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 45824) {
- if (code2 < 45769) {
- if (code2 < 45768) {
- if (45741 <= code2 && code2 <= 45767) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45768 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 45796) {
- if (45769 <= code2 && code2 <= 45795) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45797) {
- if (45796 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45797 <= code2 && code2 <= 45823) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 45853) {
- if (code2 < 45825) {
- if (45824 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45852) {
- if (45825 <= code2 && code2 <= 45851) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45852 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 45880) {
- if (45853 <= code2 && code2 <= 45879) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 45881) {
- if (45880 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45881 <= code2 && code2 <= 45907) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46189) {
- if (code2 < 46048) {
- if (code2 < 45965) {
- if (code2 < 45936) {
- if (code2 < 45909) {
- if (45908 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (45909 <= code2 && code2 <= 45935) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 45937) {
- if (45936 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 45964) {
- if (45937 <= code2 && code2 <= 45963) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45964 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 45993) {
- if (code2 < 45992) {
- if (45965 <= code2 && code2 <= 45991) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (45992 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 46020) {
- if (45993 <= code2 && code2 <= 46019) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46021) {
- if (46020 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46021 <= code2 && code2 <= 46047) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46105) {
- if (code2 < 46076) {
- if (code2 < 46049) {
- if (46048 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46049 <= code2 && code2 <= 46075) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 46077) {
- if (46076 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46104) {
- if (46077 <= code2 && code2 <= 46103) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46104 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 46160) {
- if (code2 < 46132) {
- if (46105 <= code2 && code2 <= 46131) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46133) {
- if (46132 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46133 <= code2 && code2 <= 46159) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 46161) {
- if (46160 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46188) {
- if (46161 <= code2 && code2 <= 46187) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46188 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46356) {
- if (code2 < 46272) {
- if (code2 < 46217) {
- if (code2 < 46216) {
- if (46189 <= code2 && code2 <= 46215) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46216 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 46244) {
- if (46217 <= code2 && code2 <= 46243) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46245) {
- if (46244 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46245 <= code2 && code2 <= 46271) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 46301) {
- if (code2 < 46273) {
- if (46272 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46300) {
- if (46273 <= code2 && code2 <= 46299) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46300 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 46328) {
- if (46301 <= code2 && code2 <= 46327) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46329) {
- if (46328 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46329 <= code2 && code2 <= 46355) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46413) {
- if (code2 < 46384) {
- if (code2 < 46357) {
- if (46356 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46357 <= code2 && code2 <= 46383) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 46385) {
- if (46384 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46412) {
- if (46385 <= code2 && code2 <= 46411) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46412 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 46468) {
- if (code2 < 46440) {
- if (46413 <= code2 && code2 <= 46439) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46441) {
- if (46440 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46441 <= code2 && code2 <= 46467) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 46469) {
- if (46468 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46496) {
- if (46469 <= code2 && code2 <= 46495) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46496 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47701) {
- if (code2 < 47112) {
- if (code2 < 46804) {
- if (code2 < 46637) {
- if (code2 < 46580) {
- if (code2 < 46525) {
- if (code2 < 46524) {
- if (46497 <= code2 && code2 <= 46523) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46524 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 46552) {
- if (46525 <= code2 && code2 <= 46551) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46553) {
- if (46552 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46553 <= code2 && code2 <= 46579) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 46608) {
- if (code2 < 46581) {
- if (46580 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46581 <= code2 && code2 <= 46607) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 46609) {
- if (46608 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46636) {
- if (46609 <= code2 && code2 <= 46635) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46636 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46720) {
- if (code2 < 46665) {
- if (code2 < 46664) {
- if (46637 <= code2 && code2 <= 46663) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46664 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 46692) {
- if (46665 <= code2 && code2 <= 46691) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46693) {
- if (46692 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46693 <= code2 && code2 <= 46719) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 46749) {
- if (code2 < 46721) {
- if (46720 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46748) {
- if (46721 <= code2 && code2 <= 46747) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46748 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 46776) {
- if (46749 <= code2 && code2 <= 46775) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46777) {
- if (46776 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46777 <= code2 && code2 <= 46803) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 46945) {
- if (code2 < 46861) {
- if (code2 < 46832) {
- if (code2 < 46805) {
- if (46804 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46805 <= code2 && code2 <= 46831) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 46833) {
- if (46832 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46860) {
- if (46833 <= code2 && code2 <= 46859) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46860 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 46916) {
- if (code2 < 46888) {
- if (46861 <= code2 && code2 <= 46887) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 46889) {
- if (46888 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (46889 <= code2 && code2 <= 46915) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 46917) {
- if (46916 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 46944) {
- if (46917 <= code2 && code2 <= 46943) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46944 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47028) {
- if (code2 < 46973) {
- if (code2 < 46972) {
- if (46945 <= code2 && code2 <= 46971) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (46972 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 47e3) {
- if (46973 <= code2 && code2 <= 46999) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47001) {
- if (47e3 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47001 <= code2 && code2 <= 47027) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 47057) {
- if (code2 < 47029) {
- if (47028 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47056) {
- if (47029 <= code2 && code2 <= 47055) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47056 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 47084) {
- if (47057 <= code2 && code2 <= 47083) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47085) {
- if (47084 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47085 <= code2 && code2 <= 47111) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47393) {
- if (code2 < 47252) {
- if (code2 < 47169) {
- if (code2 < 47140) {
- if (code2 < 47113) {
- if (47112 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47113 <= code2 && code2 <= 47139) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 47141) {
- if (47140 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47168) {
- if (47141 <= code2 && code2 <= 47167) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47168 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 47197) {
- if (code2 < 47196) {
- if (47169 <= code2 && code2 <= 47195) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47196 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 47224) {
- if (47197 <= code2 && code2 <= 47223) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47225) {
- if (47224 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47225 <= code2 && code2 <= 47251) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47309) {
- if (code2 < 47280) {
- if (code2 < 47253) {
- if (47252 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47253 <= code2 && code2 <= 47279) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 47281) {
- if (47280 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47308) {
- if (47281 <= code2 && code2 <= 47307) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47308 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 47364) {
- if (code2 < 47336) {
- if (47309 <= code2 && code2 <= 47335) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47337) {
- if (47336 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47337 <= code2 && code2 <= 47363) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 47365) {
- if (47364 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47392) {
- if (47365 <= code2 && code2 <= 47391) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47392 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47560) {
- if (code2 < 47476) {
- if (code2 < 47421) {
- if (code2 < 47420) {
- if (47393 <= code2 && code2 <= 47419) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47420 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 47448) {
- if (47421 <= code2 && code2 <= 47447) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47449) {
- if (47448 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47449 <= code2 && code2 <= 47475) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 47505) {
- if (code2 < 47477) {
- if (47476 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47504) {
- if (47477 <= code2 && code2 <= 47503) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47504 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 47532) {
- if (47505 <= code2 && code2 <= 47531) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47533) {
- if (47532 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47533 <= code2 && code2 <= 47559) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47617) {
- if (code2 < 47588) {
- if (code2 < 47561) {
- if (47560 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47561 <= code2 && code2 <= 47587) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 47589) {
- if (47588 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47616) {
- if (47589 <= code2 && code2 <= 47615) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47616 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 47672) {
- if (code2 < 47644) {
- if (47617 <= code2 && code2 <= 47643) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47645) {
- if (47644 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47645 <= code2 && code2 <= 47671) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 47673) {
- if (47672 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47700) {
- if (47673 <= code2 && code2 <= 47699) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47700 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48316) {
- if (code2 < 48008) {
- if (code2 < 47841) {
- if (code2 < 47784) {
- if (code2 < 47729) {
- if (code2 < 47728) {
- if (47701 <= code2 && code2 <= 47727) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47728 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 47756) {
- if (47729 <= code2 && code2 <= 47755) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47757) {
- if (47756 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47757 <= code2 && code2 <= 47783) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 47812) {
- if (code2 < 47785) {
- if (47784 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47785 <= code2 && code2 <= 47811) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 47813) {
- if (47812 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47840) {
- if (47813 <= code2 && code2 <= 47839) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47840 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 47924) {
- if (code2 < 47869) {
- if (code2 < 47868) {
- if (47841 <= code2 && code2 <= 47867) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47868 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 47896) {
- if (47869 <= code2 && code2 <= 47895) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47897) {
- if (47896 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47897 <= code2 && code2 <= 47923) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 47953) {
- if (code2 < 47925) {
- if (47924 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 47952) {
- if (47925 <= code2 && code2 <= 47951) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (47952 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 47980) {
- if (47953 <= code2 && code2 <= 47979) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 47981) {
- if (47980 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (47981 <= code2 && code2 <= 48007) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48149) {
- if (code2 < 48065) {
- if (code2 < 48036) {
- if (code2 < 48009) {
- if (48008 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48009 <= code2 && code2 <= 48035) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 48037) {
- if (48036 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48064) {
- if (48037 <= code2 && code2 <= 48063) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48064 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 48120) {
- if (code2 < 48092) {
- if (48065 <= code2 && code2 <= 48091) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48093) {
- if (48092 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48093 <= code2 && code2 <= 48119) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 48121) {
- if (48120 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48148) {
- if (48121 <= code2 && code2 <= 48147) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48148 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48232) {
- if (code2 < 48177) {
- if (code2 < 48176) {
- if (48149 <= code2 && code2 <= 48175) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48176 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 48204) {
- if (48177 <= code2 && code2 <= 48203) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48205) {
- if (48204 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48205 <= code2 && code2 <= 48231) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 48261) {
- if (code2 < 48233) {
- if (48232 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48260) {
- if (48233 <= code2 && code2 <= 48259) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48260 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 48288) {
- if (48261 <= code2 && code2 <= 48287) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48289) {
- if (48288 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48289 <= code2 && code2 <= 48315) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48597) {
- if (code2 < 48456) {
- if (code2 < 48373) {
- if (code2 < 48344) {
- if (code2 < 48317) {
- if (48316 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48317 <= code2 && code2 <= 48343) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 48345) {
- if (48344 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48372) {
- if (48345 <= code2 && code2 <= 48371) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48372 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 48401) {
- if (code2 < 48400) {
- if (48373 <= code2 && code2 <= 48399) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48400 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 48428) {
- if (48401 <= code2 && code2 <= 48427) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48429) {
- if (48428 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48429 <= code2 && code2 <= 48455) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48513) {
- if (code2 < 48484) {
- if (code2 < 48457) {
- if (48456 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48457 <= code2 && code2 <= 48483) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 48485) {
- if (48484 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48512) {
- if (48485 <= code2 && code2 <= 48511) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48512 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 48568) {
- if (code2 < 48540) {
- if (48513 <= code2 && code2 <= 48539) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48541) {
- if (48540 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48541 <= code2 && code2 <= 48567) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 48569) {
- if (48568 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48596) {
- if (48569 <= code2 && code2 <= 48595) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48596 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48764) {
- if (code2 < 48680) {
- if (code2 < 48625) {
- if (code2 < 48624) {
- if (48597 <= code2 && code2 <= 48623) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48624 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 48652) {
- if (48625 <= code2 && code2 <= 48651) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48653) {
- if (48652 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48653 <= code2 && code2 <= 48679) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 48709) {
- if (code2 < 48681) {
- if (48680 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48708) {
- if (48681 <= code2 && code2 <= 48707) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48708 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 48736) {
- if (48709 <= code2 && code2 <= 48735) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48737) {
- if (48736 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48737 <= code2 && code2 <= 48763) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 48821) {
- if (code2 < 48792) {
- if (code2 < 48765) {
- if (48764 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48765 <= code2 && code2 <= 48791) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 48793) {
- if (48792 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48820) {
- if (48793 <= code2 && code2 <= 48819) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48820 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 48876) {
- if (code2 < 48848) {
- if (48821 <= code2 && code2 <= 48847) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48849) {
- if (48848 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48849 <= code2 && code2 <= 48875) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 48877) {
- if (48876 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 48904) {
- if (48877 <= code2 && code2 <= 48903) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48904 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53720) {
- if (code2 < 51312) {
- if (code2 < 50108) {
- if (code2 < 49493) {
- if (code2 < 49212) {
- if (code2 < 49045) {
- if (code2 < 48988) {
- if (code2 < 48933) {
- if (code2 < 48932) {
- if (48905 <= code2 && code2 <= 48931) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (48932 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 48960) {
- if (48933 <= code2 && code2 <= 48959) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 48961) {
- if (48960 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48961 <= code2 && code2 <= 48987) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 49016) {
- if (code2 < 48989) {
- if (48988 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (48989 <= code2 && code2 <= 49015) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 49017) {
- if (49016 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49044) {
- if (49017 <= code2 && code2 <= 49043) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49044 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 49128) {
- if (code2 < 49073) {
- if (code2 < 49072) {
- if (49045 <= code2 && code2 <= 49071) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49072 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 49100) {
- if (49073 <= code2 && code2 <= 49099) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49101) {
- if (49100 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49101 <= code2 && code2 <= 49127) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 49157) {
- if (code2 < 49129) {
- if (49128 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49156) {
- if (49129 <= code2 && code2 <= 49155) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49156 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 49184) {
- if (49157 <= code2 && code2 <= 49183) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49185) {
- if (49184 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49185 <= code2 && code2 <= 49211) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 49352) {
- if (code2 < 49269) {
- if (code2 < 49240) {
- if (code2 < 49213) {
- if (49212 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49213 <= code2 && code2 <= 49239) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 49241) {
- if (49240 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49268) {
- if (49241 <= code2 && code2 <= 49267) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49268 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 49297) {
- if (code2 < 49296) {
- if (49269 <= code2 && code2 <= 49295) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49296 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 49324) {
- if (49297 <= code2 && code2 <= 49323) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49325) {
- if (49324 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49325 <= code2 && code2 <= 49351) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 49409) {
- if (code2 < 49380) {
- if (code2 < 49353) {
- if (49352 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49353 <= code2 && code2 <= 49379) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 49381) {
- if (49380 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49408) {
- if (49381 <= code2 && code2 <= 49407) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49408 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 49464) {
- if (code2 < 49436) {
- if (49409 <= code2 && code2 <= 49435) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49437) {
- if (49436 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49437 <= code2 && code2 <= 49463) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 49465) {
- if (49464 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49492) {
- if (49465 <= code2 && code2 <= 49491) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49492 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 49800) {
- if (code2 < 49633) {
- if (code2 < 49576) {
- if (code2 < 49521) {
- if (code2 < 49520) {
- if (49493 <= code2 && code2 <= 49519) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49520 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 49548) {
- if (49521 <= code2 && code2 <= 49547) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49549) {
- if (49548 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49549 <= code2 && code2 <= 49575) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 49604) {
- if (code2 < 49577) {
- if (49576 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49577 <= code2 && code2 <= 49603) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 49605) {
- if (49604 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49632) {
- if (49605 <= code2 && code2 <= 49631) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49632 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 49716) {
- if (code2 < 49661) {
- if (code2 < 49660) {
- if (49633 <= code2 && code2 <= 49659) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49660 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 49688) {
- if (49661 <= code2 && code2 <= 49687) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49689) {
- if (49688 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49689 <= code2 && code2 <= 49715) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 49745) {
- if (code2 < 49717) {
- if (49716 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49744) {
- if (49717 <= code2 && code2 <= 49743) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49744 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 49772) {
- if (49745 <= code2 && code2 <= 49771) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49773) {
- if (49772 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49773 <= code2 && code2 <= 49799) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 49941) {
- if (code2 < 49857) {
- if (code2 < 49828) {
- if (code2 < 49801) {
- if (49800 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49801 <= code2 && code2 <= 49827) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 49829) {
- if (49828 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49856) {
- if (49829 <= code2 && code2 <= 49855) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49856 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 49912) {
- if (code2 < 49884) {
- if (49857 <= code2 && code2 <= 49883) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49885) {
- if (49884 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49885 <= code2 && code2 <= 49911) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 49913) {
- if (49912 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 49940) {
- if (49913 <= code2 && code2 <= 49939) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49940 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 50024) {
- if (code2 < 49969) {
- if (code2 < 49968) {
- if (49941 <= code2 && code2 <= 49967) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (49968 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 49996) {
- if (49969 <= code2 && code2 <= 49995) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 49997) {
- if (49996 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (49997 <= code2 && code2 <= 50023) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 50053) {
- if (code2 < 50025) {
- if (50024 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50052) {
- if (50025 <= code2 && code2 <= 50051) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50052 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 50080) {
- if (50053 <= code2 && code2 <= 50079) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50081) {
- if (50080 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50081 <= code2 && code2 <= 50107) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 50697) {
- if (code2 < 50389) {
- if (code2 < 50248) {
- if (code2 < 50165) {
- if (code2 < 50136) {
- if (code2 < 50109) {
- if (50108 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50109 <= code2 && code2 <= 50135) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 50137) {
- if (50136 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50164) {
- if (50137 <= code2 && code2 <= 50163) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50164 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 50193) {
- if (code2 < 50192) {
- if (50165 <= code2 && code2 <= 50191) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50192 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 50220) {
- if (50193 <= code2 && code2 <= 50219) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50221) {
- if (50220 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50221 <= code2 && code2 <= 50247) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 50305) {
- if (code2 < 50276) {
- if (code2 < 50249) {
- if (50248 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50249 <= code2 && code2 <= 50275) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 50277) {
- if (50276 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50304) {
- if (50277 <= code2 && code2 <= 50303) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50304 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 50360) {
- if (code2 < 50332) {
- if (50305 <= code2 && code2 <= 50331) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50333) {
- if (50332 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50333 <= code2 && code2 <= 50359) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 50361) {
- if (50360 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50388) {
- if (50361 <= code2 && code2 <= 50387) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50388 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 50556) {
- if (code2 < 50472) {
- if (code2 < 50417) {
- if (code2 < 50416) {
- if (50389 <= code2 && code2 <= 50415) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50416 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 50444) {
- if (50417 <= code2 && code2 <= 50443) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50445) {
- if (50444 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50445 <= code2 && code2 <= 50471) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 50501) {
- if (code2 < 50473) {
- if (50472 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50500) {
- if (50473 <= code2 && code2 <= 50499) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50500 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 50528) {
- if (50501 <= code2 && code2 <= 50527) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50529) {
- if (50528 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50529 <= code2 && code2 <= 50555) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 50613) {
- if (code2 < 50584) {
- if (code2 < 50557) {
- if (50556 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50557 <= code2 && code2 <= 50583) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 50585) {
- if (50584 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50612) {
- if (50585 <= code2 && code2 <= 50611) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50612 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 50668) {
- if (code2 < 50640) {
- if (50613 <= code2 && code2 <= 50639) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50641) {
- if (50640 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50641 <= code2 && code2 <= 50667) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 50669) {
- if (50668 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50696) {
- if (50669 <= code2 && code2 <= 50695) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50696 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 51004) {
- if (code2 < 50837) {
- if (code2 < 50780) {
- if (code2 < 50725) {
- if (code2 < 50724) {
- if (50697 <= code2 && code2 <= 50723) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50724 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 50752) {
- if (50725 <= code2 && code2 <= 50751) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50753) {
- if (50752 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50753 <= code2 && code2 <= 50779) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 50808) {
- if (code2 < 50781) {
- if (50780 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50781 <= code2 && code2 <= 50807) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 50809) {
- if (50808 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50836) {
- if (50809 <= code2 && code2 <= 50835) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50836 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 50920) {
- if (code2 < 50865) {
- if (code2 < 50864) {
- if (50837 <= code2 && code2 <= 50863) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50864 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 50892) {
- if (50865 <= code2 && code2 <= 50891) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50893) {
- if (50892 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50893 <= code2 && code2 <= 50919) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 50949) {
- if (code2 < 50921) {
- if (50920 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 50948) {
- if (50921 <= code2 && code2 <= 50947) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (50948 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 50976) {
- if (50949 <= code2 && code2 <= 50975) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 50977) {
- if (50976 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (50977 <= code2 && code2 <= 51003) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 51145) {
- if (code2 < 51061) {
- if (code2 < 51032) {
- if (code2 < 51005) {
- if (51004 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51005 <= code2 && code2 <= 51031) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 51033) {
- if (51032 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51060) {
- if (51033 <= code2 && code2 <= 51059) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51060 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 51116) {
- if (code2 < 51088) {
- if (51061 <= code2 && code2 <= 51087) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51089) {
- if (51088 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51089 <= code2 && code2 <= 51115) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 51117) {
- if (51116 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51144) {
- if (51117 <= code2 && code2 <= 51143) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51144 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 51228) {
- if (code2 < 51173) {
- if (code2 < 51172) {
- if (51145 <= code2 && code2 <= 51171) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51172 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 51200) {
- if (51173 <= code2 && code2 <= 51199) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51201) {
- if (51200 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51201 <= code2 && code2 <= 51227) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 51257) {
- if (code2 < 51229) {
- if (51228 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51256) {
- if (51229 <= code2 && code2 <= 51255) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51256 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 51284) {
- if (51257 <= code2 && code2 <= 51283) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51285) {
- if (51284 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51285 <= code2 && code2 <= 51311) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52516) {
- if (code2 < 51901) {
- if (code2 < 51593) {
- if (code2 < 51452) {
- if (code2 < 51369) {
- if (code2 < 51340) {
- if (code2 < 51313) {
- if (51312 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51313 <= code2 && code2 <= 51339) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 51341) {
- if (51340 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51368) {
- if (51341 <= code2 && code2 <= 51367) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51368 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 51397) {
- if (code2 < 51396) {
- if (51369 <= code2 && code2 <= 51395) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51396 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 51424) {
- if (51397 <= code2 && code2 <= 51423) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51425) {
- if (51424 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51425 <= code2 && code2 <= 51451) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 51509) {
- if (code2 < 51480) {
- if (code2 < 51453) {
- if (51452 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51453 <= code2 && code2 <= 51479) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 51481) {
- if (51480 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51508) {
- if (51481 <= code2 && code2 <= 51507) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51508 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 51564) {
- if (code2 < 51536) {
- if (51509 <= code2 && code2 <= 51535) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51537) {
- if (51536 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51537 <= code2 && code2 <= 51563) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 51565) {
- if (51564 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51592) {
- if (51565 <= code2 && code2 <= 51591) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51592 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 51760) {
- if (code2 < 51676) {
- if (code2 < 51621) {
- if (code2 < 51620) {
- if (51593 <= code2 && code2 <= 51619) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51620 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 51648) {
- if (51621 <= code2 && code2 <= 51647) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51649) {
- if (51648 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51649 <= code2 && code2 <= 51675) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 51705) {
- if (code2 < 51677) {
- if (51676 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51704) {
- if (51677 <= code2 && code2 <= 51703) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51704 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 51732) {
- if (51705 <= code2 && code2 <= 51731) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51733) {
- if (51732 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51733 <= code2 && code2 <= 51759) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 51817) {
- if (code2 < 51788) {
- if (code2 < 51761) {
- if (51760 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51761 <= code2 && code2 <= 51787) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 51789) {
- if (51788 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51816) {
- if (51789 <= code2 && code2 <= 51815) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51816 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 51872) {
- if (code2 < 51844) {
- if (51817 <= code2 && code2 <= 51843) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51845) {
- if (51844 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51845 <= code2 && code2 <= 51871) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 51873) {
- if (51872 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 51900) {
- if (51873 <= code2 && code2 <= 51899) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51900 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52208) {
- if (code2 < 52041) {
- if (code2 < 51984) {
- if (code2 < 51929) {
- if (code2 < 51928) {
- if (51901 <= code2 && code2 <= 51927) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (51928 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 51956) {
- if (51929 <= code2 && code2 <= 51955) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 51957) {
- if (51956 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51957 <= code2 && code2 <= 51983) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 52012) {
- if (code2 < 51985) {
- if (51984 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (51985 <= code2 && code2 <= 52011) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 52013) {
- if (52012 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52040) {
- if (52013 <= code2 && code2 <= 52039) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52040 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52124) {
- if (code2 < 52069) {
- if (code2 < 52068) {
- if (52041 <= code2 && code2 <= 52067) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52068 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 52096) {
- if (52069 <= code2 && code2 <= 52095) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52097) {
- if (52096 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52097 <= code2 && code2 <= 52123) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 52153) {
- if (code2 < 52125) {
- if (52124 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52152) {
- if (52125 <= code2 && code2 <= 52151) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52152 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 52180) {
- if (52153 <= code2 && code2 <= 52179) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52181) {
- if (52180 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52181 <= code2 && code2 <= 52207) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52349) {
- if (code2 < 52265) {
- if (code2 < 52236) {
- if (code2 < 52209) {
- if (52208 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52209 <= code2 && code2 <= 52235) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 52237) {
- if (52236 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52264) {
- if (52237 <= code2 && code2 <= 52263) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52264 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 52320) {
- if (code2 < 52292) {
- if (52265 <= code2 && code2 <= 52291) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52293) {
- if (52292 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52293 <= code2 && code2 <= 52319) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 52321) {
- if (52320 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52348) {
- if (52321 <= code2 && code2 <= 52347) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52348 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52432) {
- if (code2 < 52377) {
- if (code2 < 52376) {
- if (52349 <= code2 && code2 <= 52375) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52376 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 52404) {
- if (52377 <= code2 && code2 <= 52403) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52405) {
- if (52404 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52405 <= code2 && code2 <= 52431) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 52461) {
- if (code2 < 52433) {
- if (52432 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52460) {
- if (52433 <= code2 && code2 <= 52459) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52460 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 52488) {
- if (52461 <= code2 && code2 <= 52487) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52489) {
- if (52488 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52489 <= code2 && code2 <= 52515) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53105) {
- if (code2 < 52797) {
- if (code2 < 52656) {
- if (code2 < 52573) {
- if (code2 < 52544) {
- if (code2 < 52517) {
- if (52516 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52517 <= code2 && code2 <= 52543) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 52545) {
- if (52544 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52572) {
- if (52545 <= code2 && code2 <= 52571) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52572 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 52601) {
- if (code2 < 52600) {
- if (52573 <= code2 && code2 <= 52599) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52600 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 52628) {
- if (52601 <= code2 && code2 <= 52627) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52629) {
- if (52628 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52629 <= code2 && code2 <= 52655) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52713) {
- if (code2 < 52684) {
- if (code2 < 52657) {
- if (52656 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52657 <= code2 && code2 <= 52683) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 52685) {
- if (52684 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52712) {
- if (52685 <= code2 && code2 <= 52711) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52712 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 52768) {
- if (code2 < 52740) {
- if (52713 <= code2 && code2 <= 52739) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52741) {
- if (52740 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52741 <= code2 && code2 <= 52767) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 52769) {
- if (52768 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52796) {
- if (52769 <= code2 && code2 <= 52795) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52796 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 52964) {
- if (code2 < 52880) {
- if (code2 < 52825) {
- if (code2 < 52824) {
- if (52797 <= code2 && code2 <= 52823) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52824 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 52852) {
- if (52825 <= code2 && code2 <= 52851) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52853) {
- if (52852 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52853 <= code2 && code2 <= 52879) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 52909) {
- if (code2 < 52881) {
- if (52880 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 52908) {
- if (52881 <= code2 && code2 <= 52907) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (52908 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 52936) {
- if (52909 <= code2 && code2 <= 52935) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 52937) {
- if (52936 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52937 <= code2 && code2 <= 52963) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53021) {
- if (code2 < 52992) {
- if (code2 < 52965) {
- if (52964 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (52965 <= code2 && code2 <= 52991) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 52993) {
- if (52992 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53020) {
- if (52993 <= code2 && code2 <= 53019) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53020 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 53076) {
- if (code2 < 53048) {
- if (53021 <= code2 && code2 <= 53047) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53049) {
- if (53048 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53049 <= code2 && code2 <= 53075) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 53077) {
- if (53076 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53104) {
- if (53077 <= code2 && code2 <= 53103) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53104 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53412) {
- if (code2 < 53245) {
- if (code2 < 53188) {
- if (code2 < 53133) {
- if (code2 < 53132) {
- if (53105 <= code2 && code2 <= 53131) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53132 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 53160) {
- if (53133 <= code2 && code2 <= 53159) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53161) {
- if (53160 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53161 <= code2 && code2 <= 53187) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 53216) {
- if (code2 < 53189) {
- if (53188 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53189 <= code2 && code2 <= 53215) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 53217) {
- if (53216 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53244) {
- if (53217 <= code2 && code2 <= 53243) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53244 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53328) {
- if (code2 < 53273) {
- if (code2 < 53272) {
- if (53245 <= code2 && code2 <= 53271) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53272 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 53300) {
- if (53273 <= code2 && code2 <= 53299) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53301) {
- if (53300 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53301 <= code2 && code2 <= 53327) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 53357) {
- if (code2 < 53329) {
- if (53328 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53356) {
- if (53329 <= code2 && code2 <= 53355) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53356 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 53384) {
- if (53357 <= code2 && code2 <= 53383) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53385) {
- if (53384 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53385 <= code2 && code2 <= 53411) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53553) {
- if (code2 < 53469) {
- if (code2 < 53440) {
- if (code2 < 53413) {
- if (53412 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53413 <= code2 && code2 <= 53439) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 53441) {
- if (53440 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53468) {
- if (53441 <= code2 && code2 <= 53467) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53468 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 53524) {
- if (code2 < 53496) {
- if (53469 <= code2 && code2 <= 53495) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53497) {
- if (53496 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53497 <= code2 && code2 <= 53523) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 53525) {
- if (53524 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53552) {
- if (53525 <= code2 && code2 <= 53551) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53552 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53636) {
- if (code2 < 53581) {
- if (code2 < 53580) {
- if (53553 <= code2 && code2 <= 53579) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53580 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 53608) {
- if (53581 <= code2 && code2 <= 53607) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53609) {
- if (53608 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53609 <= code2 && code2 <= 53635) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 53665) {
- if (code2 < 53637) {
- if (53636 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53664) {
- if (53637 <= code2 && code2 <= 53663) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53664 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 53692) {
- if (53665 <= code2 && code2 <= 53691) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53693) {
- if (53692 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53693 <= code2 && code2 <= 53719) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 70459) {
- if (code2 < 54897) {
- if (code2 < 54308) {
- if (code2 < 54001) {
- if (code2 < 53860) {
- if (code2 < 53777) {
- if (code2 < 53748) {
- if (code2 < 53721) {
- if (53720 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53721 <= code2 && code2 <= 53747) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 53749) {
- if (53748 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53776) {
- if (53749 <= code2 && code2 <= 53775) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53776 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 53805) {
- if (code2 < 53804) {
- if (53777 <= code2 && code2 <= 53803) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53804 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 53832) {
- if (53805 <= code2 && code2 <= 53831) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53833) {
- if (53832 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53833 <= code2 && code2 <= 53859) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 53917) {
- if (code2 < 53888) {
- if (code2 < 53861) {
- if (53860 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53861 <= code2 && code2 <= 53887) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 53889) {
- if (53888 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 53916) {
- if (53889 <= code2 && code2 <= 53915) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (53916 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 53972) {
- if (code2 < 53944) {
- if (53917 <= code2 && code2 <= 53943) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 53945) {
- if (53944 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (53945 <= code2 && code2 <= 53971) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 53973) {
- if (53972 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54e3) {
- if (53973 <= code2 && code2 <= 53999) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54e3 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 54141) {
- if (code2 < 54084) {
- if (code2 < 54029) {
- if (code2 < 54028) {
- if (54001 <= code2 && code2 <= 54027) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54028 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 54056) {
- if (54029 <= code2 && code2 <= 54055) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54057) {
- if (54056 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54057 <= code2 && code2 <= 54083) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 54112) {
- if (code2 < 54085) {
- if (54084 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54085 <= code2 && code2 <= 54111) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 54113) {
- if (54112 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54140) {
- if (54113 <= code2 && code2 <= 54139) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54140 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 54224) {
- if (code2 < 54169) {
- if (code2 < 54168) {
- if (54141 <= code2 && code2 <= 54167) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54168 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 54196) {
- if (54169 <= code2 && code2 <= 54195) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54197) {
- if (54196 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54197 <= code2 && code2 <= 54223) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 54253) {
- if (code2 < 54225) {
- if (54224 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54252) {
- if (54225 <= code2 && code2 <= 54251) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54252 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 54280) {
- if (54253 <= code2 && code2 <= 54279) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54281) {
- if (54280 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54281 <= code2 && code2 <= 54307) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 54589) {
- if (code2 < 54448) {
- if (code2 < 54365) {
- if (code2 < 54336) {
- if (code2 < 54309) {
- if (54308 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54309 <= code2 && code2 <= 54335) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 54337) {
- if (54336 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54364) {
- if (54337 <= code2 && code2 <= 54363) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54364 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 54393) {
- if (code2 < 54392) {
- if (54365 <= code2 && code2 <= 54391) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54392 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 54420) {
- if (54393 <= code2 && code2 <= 54419) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54421) {
- if (54420 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54421 <= code2 && code2 <= 54447) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 54505) {
- if (code2 < 54476) {
- if (code2 < 54449) {
- if (54448 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54449 <= code2 && code2 <= 54475) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 54477) {
- if (54476 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54504) {
- if (54477 <= code2 && code2 <= 54503) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54504 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 54560) {
- if (code2 < 54532) {
- if (54505 <= code2 && code2 <= 54531) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54533) {
- if (54532 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54533 <= code2 && code2 <= 54559) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 54561) {
- if (54560 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54588) {
- if (54561 <= code2 && code2 <= 54587) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54588 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 54756) {
- if (code2 < 54672) {
- if (code2 < 54617) {
- if (code2 < 54616) {
- if (54589 <= code2 && code2 <= 54615) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54616 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 54644) {
- if (54617 <= code2 && code2 <= 54643) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54645) {
- if (54644 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54645 <= code2 && code2 <= 54671) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 54701) {
- if (code2 < 54673) {
- if (54672 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54700) {
- if (54673 <= code2 && code2 <= 54699) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54700 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 54728) {
- if (54701 <= code2 && code2 <= 54727) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54729) {
- if (54728 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54729 <= code2 && code2 <= 54755) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 54813) {
- if (code2 < 54784) {
- if (code2 < 54757) {
- if (54756 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54757 <= code2 && code2 <= 54783) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 54785) {
- if (54784 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54812) {
- if (54785 <= code2 && code2 <= 54811) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54812 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- } else {
- if (code2 < 54868) {
- if (code2 < 54840) {
- if (54813 <= code2 && code2 <= 54839) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54841) {
- if (54840 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54841 <= code2 && code2 <= 54867) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- } else {
- if (code2 < 54869) {
- if (54868 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 54896) {
- if (54869 <= code2 && code2 <= 54895) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54896 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 69632) {
- if (code2 < 55216) {
- if (code2 < 55037) {
- if (code2 < 54980) {
- if (code2 < 54925) {
- if (code2 < 54924) {
- if (54897 <= code2 && code2 <= 54923) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (54924 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 54952) {
- if (54925 <= code2 && code2 <= 54951) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 54953) {
- if (54952 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54953 <= code2 && code2 <= 54979) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 55008) {
- if (code2 < 54981) {
- if (54980 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (54981 <= code2 && code2 <= 55007) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- } else {
- if (code2 < 55009) {
- if (55008 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 55036) {
- if (55009 <= code2 && code2 <= 55035) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (55036 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 55120) {
- if (code2 < 55065) {
- if (code2 < 55064) {
- if (55037 <= code2 && code2 <= 55063) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (55064 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- } else {
- if (code2 < 55092) {
- if (55065 <= code2 && code2 <= 55091) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 55093) {
- if (55092 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (55093 <= code2 && code2 <= 55119) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- } else {
- if (code2 < 55149) {
- if (code2 < 55121) {
- if (55120 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (code2 < 55148) {
- if (55121 <= code2 && code2 <= 55147) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (55148 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- }
- }
- } else {
- if (code2 < 55176) {
- if (55149 <= code2 && code2 <= 55175) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- } else {
- if (code2 < 55177) {
- if (55176 === code2) {
- return boundaries_1.CLUSTER_BREAK.LV;
- }
- } else {
- if (55177 <= code2 && code2 <= 55203) {
- return boundaries_1.CLUSTER_BREAK.LVT;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 68097) {
- if (code2 < 65279) {
- if (code2 < 64286) {
- if (code2 < 55243) {
- if (55216 <= code2 && code2 <= 55238) {
- return boundaries_1.CLUSTER_BREAK.V;
- }
- } else {
- if (55243 <= code2 && code2 <= 55291) {
- return boundaries_1.CLUSTER_BREAK.T;
- }
- }
- } else {
- if (code2 < 65024) {
- if (64286 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 65056) {
- if (65024 <= code2 && code2 <= 65039) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (65056 <= code2 && code2 <= 65071) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 66045) {
- if (code2 < 65438) {
- if (65279 === code2) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (code2 < 65520) {
- if (65438 <= code2 && code2 <= 65439) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (65520 <= code2 && code2 <= 65531) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- }
- }
- } else {
- if (code2 < 66272) {
- if (66045 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 66422) {
- if (66272 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (66422 <= code2 && code2 <= 66426) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 68325) {
- if (code2 < 68108) {
- if (code2 < 68101) {
- if (68097 <= code2 && code2 <= 68099) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (68101 <= code2 && code2 <= 68102) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 68152) {
- if (68108 <= code2 && code2 <= 68111) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 68159) {
- if (68152 <= code2 && code2 <= 68154) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (68159 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 69373) {
- if (code2 < 68900) {
- if (68325 <= code2 && code2 <= 68326) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 69291) {
- if (68900 <= code2 && code2 <= 68903) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (69291 <= code2 && code2 <= 69292) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 69446) {
- if (69373 <= code2 && code2 <= 69375) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 69506) {
- if (69446 <= code2 && code2 <= 69456) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (69506 <= code2 && code2 <= 69509) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 70016) {
- if (code2 < 69815) {
- if (code2 < 69747) {
- if (code2 < 69634) {
- if (69632 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (69633 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 69688) {
- if (69634 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 69744) {
- if (69688 <= code2 && code2 <= 69702) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (69744 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 69762) {
- if (code2 < 69759) {
- if (69747 <= code2 && code2 <= 69748) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (69759 <= code2 && code2 <= 69761) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 69808) {
- if (69762 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 69811) {
- if (69808 <= code2 && code2 <= 69810) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (69811 <= code2 && code2 <= 69814) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 69888) {
- if (code2 < 69821) {
- if (code2 < 69817) {
- if (69815 <= code2 && code2 <= 69816) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (69817 <= code2 && code2 <= 69818) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 69826) {
- if (69821 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (69826 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (69837 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- }
- }
- } else {
- if (code2 < 69933) {
- if (code2 < 69927) {
- if (69888 <= code2 && code2 <= 69890) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 69932) {
- if (69927 <= code2 && code2 <= 69931) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (69932 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 69957) {
- if (69933 <= code2 && code2 <= 69940) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70003) {
- if (69957 <= code2 && code2 <= 69958) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70003 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 70194) {
- if (code2 < 70082) {
- if (code2 < 70067) {
- if (code2 < 70018) {
- if (70016 <= code2 && code2 <= 70017) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70018 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 70070) {
- if (70067 <= code2 && code2 <= 70069) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 70079) {
- if (70070 <= code2 && code2 <= 70078) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70079 <= code2 && code2 <= 70080) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 70095) {
- if (code2 < 70089) {
- if (70082 <= code2 && code2 <= 70083) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (code2 < 70094) {
- if (70089 <= code2 && code2 <= 70092) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70094 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 70188) {
- if (70095 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70191) {
- if (70188 <= code2 && code2 <= 70190) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70191 <= code2 && code2 <= 70193) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 70209) {
- if (code2 < 70197) {
- if (code2 < 70196) {
- if (70194 <= code2 && code2 <= 70195) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70196 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 70198) {
- if (70197 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 70206) {
- if (70198 <= code2 && code2 <= 70199) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70206 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 70371) {
- if (code2 < 70367) {
- if (70209 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70368) {
- if (70367 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70368 <= code2 && code2 <= 70370) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 70400) {
- if (70371 <= code2 && code2 <= 70378) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70402) {
- if (70400 <= code2 && code2 <= 70401) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70402 <= code2 && code2 <= 70403) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 72343) {
- if (code2 < 71339) {
- if (code2 < 70841) {
- if (code2 < 70512) {
- if (code2 < 70471) {
- if (code2 < 70463) {
- if (code2 < 70462) {
- if (70459 <= code2 && code2 <= 70460) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70462 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 70464) {
- if (70463 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 70465) {
- if (70464 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70465 <= code2 && code2 <= 70468) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 70487) {
- if (code2 < 70475) {
- if (70471 <= code2 && code2 <= 70472) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70475 <= code2 && code2 <= 70477) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 70498) {
- if (70487 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70502) {
- if (70498 <= code2 && code2 <= 70499) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70502 <= code2 && code2 <= 70508) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 70725) {
- if (code2 < 70712) {
- if (code2 < 70709) {
- if (70512 <= code2 && code2 <= 70516) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (70709 <= code2 && code2 <= 70711) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 70720) {
- if (70712 <= code2 && code2 <= 70719) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70722) {
- if (70720 <= code2 && code2 <= 70721) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70722 <= code2 && code2 <= 70724) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 70832) {
- if (code2 < 70726) {
- if (70725 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70726 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (70750 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 70833) {
- if (70832 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70835) {
- if (70833 <= code2 && code2 <= 70834) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70835 <= code2 && code2 <= 70840) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 71096) {
- if (code2 < 70847) {
- if (code2 < 70843) {
- if (70841 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (70842 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70845) {
- if (70843 <= code2 && code2 <= 70844) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70845 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (70846 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 71087) {
- if (code2 < 70849) {
- if (70847 <= code2 && code2 <= 70848) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 70850) {
- if (70849 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (70850 <= code2 && code2 <= 70851) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 71088) {
- if (71087 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71090) {
- if (71088 <= code2 && code2 <= 71089) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (71090 <= code2 && code2 <= 71093) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 71216) {
- if (code2 < 71102) {
- if (code2 < 71100) {
- if (71096 <= code2 && code2 <= 71099) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (71100 <= code2 && code2 <= 71101) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 71103) {
- if (71102 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 71132) {
- if (71103 <= code2 && code2 <= 71104) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (71132 <= code2 && code2 <= 71133) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 71229) {
- if (code2 < 71219) {
- if (71216 <= code2 && code2 <= 71218) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 71227) {
- if (71219 <= code2 && code2 <= 71226) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (71227 <= code2 && code2 <= 71228) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 71230) {
- if (71229 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71231) {
- if (71230 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (71231 <= code2 && code2 <= 71232) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 71999) {
- if (code2 < 71463) {
- if (code2 < 71350) {
- if (code2 < 71341) {
- if (71339 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (71340 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 71342) {
- if (71341 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71344) {
- if (71342 <= code2 && code2 <= 71343) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (71344 <= code2 && code2 <= 71349) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 71453) {
- if (71350 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (71351 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71458) {
- if (71453 <= code2 && code2 <= 71455) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71462) {
- if (71458 <= code2 && code2 <= 71461) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (71462 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 71984) {
- if (code2 < 71727) {
- if (code2 < 71724) {
- if (71463 <= code2 && code2 <= 71467) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (71724 <= code2 && code2 <= 71726) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 71736) {
- if (71727 <= code2 && code2 <= 71735) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71737) {
- if (71736 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (71737 <= code2 && code2 <= 71738) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 71995) {
- if (code2 < 71985) {
- if (71984 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 71991) {
- if (71985 <= code2 && code2 <= 71989) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (71991 <= code2 && code2 <= 71992) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 71997) {
- if (71995 <= code2 && code2 <= 71996) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (71997 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (71998 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 72193) {
- if (code2 < 72145) {
- if (code2 < 72001) {
- if (71999 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- if (72e3 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 72002) {
- if (72001 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (72002 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (72003 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 72156) {
- if (code2 < 72148) {
- if (72145 <= code2 && code2 <= 72147) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 72154) {
- if (72148 <= code2 && code2 <= 72151) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (72154 <= code2 && code2 <= 72155) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 72160) {
- if (72156 <= code2 && code2 <= 72159) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (72160 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (72164 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 72263) {
- if (code2 < 72249) {
- if (code2 < 72243) {
- if (72193 <= code2 && code2 <= 72202) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (72243 <= code2 && code2 <= 72248) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 72250) {
- if (72249 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 72251) {
- if (72250 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (72251 <= code2 && code2 <= 72254) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 72281) {
- if (code2 < 72273) {
- if (72263 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 72279) {
- if (72273 <= code2 && code2 <= 72278) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (72279 <= code2 && code2 <= 72280) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- } else {
- if (code2 < 72324) {
- if (72281 <= code2 && code2 <= 72283) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 72330) {
- if (72324 <= code2 && code2 <= 72329) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (72330 <= code2 && code2 <= 72342) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 94033) {
- if (code2 < 73104) {
- if (code2 < 72881) {
- if (code2 < 72766) {
- if (code2 < 72751) {
- if (code2 < 72344) {
- if (72343 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (72344 <= code2 && code2 <= 72345) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 72752) {
- if (72751 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 72760) {
- if (72752 <= code2 && code2 <= 72758) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (72760 <= code2 && code2 <= 72765) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 72850) {
- if (72766 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (72767 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 72873) {
- if (72850 <= code2 && code2 <= 72871) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 72874) {
- if (72873 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (72874 <= code2 && code2 <= 72880) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 73018) {
- if (code2 < 72884) {
- if (code2 < 72882) {
- if (72881 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (72882 <= code2 && code2 <= 72883) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 72885) {
- if (72884 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (code2 < 73009) {
- if (72885 <= code2 && code2 <= 72886) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73009 <= code2 && code2 <= 73014) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 73030) {
- if (code2 < 73020) {
- if (73018 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 73023) {
- if (73020 <= code2 && code2 <= 73021) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73023 <= code2 && code2 <= 73029) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 73031) {
- if (73030 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (code2 < 73098) {
- if (73031 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73098 <= code2 && code2 <= 73102) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 73526) {
- if (code2 < 73459) {
- if (code2 < 73109) {
- if (code2 < 73107) {
- if (73104 <= code2 && code2 <= 73105) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73107 <= code2 && code2 <= 73108) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 73110) {
- if (73109 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73110 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (73111 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 73474) {
- if (code2 < 73461) {
- if (73459 <= code2 && code2 <= 73460) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 73472) {
- if (73461 <= code2 && code2 <= 73462) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (73472 <= code2 && code2 <= 73473) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 73475) {
- if (73474 === code2) {
- return boundaries_1.CLUSTER_BREAK.PREPEND;
- }
- } else {
- if (code2 < 73524) {
- if (73475 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (73524 <= code2 && code2 <= 73525) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 78896) {
- if (code2 < 73536) {
- if (code2 < 73534) {
- if (73526 <= code2 && code2 <= 73530) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73534 <= code2 && code2 <= 73535) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 73537) {
- if (73536 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (73537 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- if (73538 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 92912) {
- if (code2 < 78912) {
- if (78896 <= code2 && code2 <= 78911) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (code2 < 78919) {
- if (78912 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (78919 <= code2 && code2 <= 78933) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 92976) {
- if (92912 <= code2 && code2 <= 92916) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 94031) {
- if (92976 <= code2 && code2 <= 92982) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (94031 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 121476) {
- if (code2 < 119143) {
- if (code2 < 113824) {
- if (code2 < 94180) {
- if (code2 < 94095) {
- if (94033 <= code2 && code2 <= 94087) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (94095 <= code2 && code2 <= 94098) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 94192) {
- if (94180 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 113821) {
- if (94192 <= code2 && code2 <= 94193) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- } else {
- if (113821 <= code2 && code2 <= 113822) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 118576) {
- if (code2 < 118528) {
- if (113824 <= code2 && code2 <= 113827) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (118528 <= code2 && code2 <= 118573) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 119141) {
- if (118576 <= code2 && code2 <= 118598) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (119141 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- if (119142 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- }
- }
- } else {
- if (code2 < 119173) {
- if (code2 < 119150) {
- if (code2 < 119149) {
- if (119143 <= code2 && code2 <= 119145) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (119149 === code2) {
- return boundaries_1.CLUSTER_BREAK.SPACINGMARK;
- }
- }
- } else {
- if (code2 < 119155) {
- if (119150 <= code2 && code2 <= 119154) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 119163) {
- if (119155 <= code2 && code2 <= 119162) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (119163 <= code2 && code2 <= 119170) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 121344) {
- if (code2 < 119210) {
- if (119173 <= code2 && code2 <= 119179) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 119362) {
- if (119210 <= code2 && code2 <= 119213) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (119362 <= code2 && code2 <= 119364) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 121403) {
- if (121344 <= code2 && code2 <= 121398) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 121461) {
- if (121403 <= code2 && code2 <= 121452) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (121461 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 123628) {
- if (code2 < 122907) {
- if (code2 < 121505) {
- if (code2 < 121499) {
- if (121476 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (121499 <= code2 && code2 <= 121503) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 122880) {
- if (121505 <= code2 && code2 <= 121519) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 122888) {
- if (122880 <= code2 && code2 <= 122886) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (122888 <= code2 && code2 <= 122904) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- } else {
- if (code2 < 123023) {
- if (code2 < 122915) {
- if (122907 <= code2 && code2 <= 122913) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 122918) {
- if (122915 <= code2 && code2 <= 122916) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (122918 <= code2 && code2 <= 122922) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 123184) {
- if (123023 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 123566) {
- if (123184 <= code2 && code2 <= 123190) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (123566 === code2) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 127995) {
- if (code2 < 125136) {
- if (code2 < 124140) {
- if (123628 <= code2 && code2 <= 123631) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (124140 <= code2 && code2 <= 124143) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- } else {
- if (code2 < 125252) {
- if (125136 <= code2 && code2 <= 125142) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 127462) {
- if (125252 <= code2 && code2 <= 125258) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (127462 <= code2 && code2 <= 127487) {
- return boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR;
- }
- }
- }
- }
- } else {
- if (code2 < 917632) {
- if (code2 < 917504) {
- if (127995 <= code2 && code2 <= 127999) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (code2 < 917536) {
- if (917504 <= code2 && code2 <= 917535) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (917536 <= code2 && code2 <= 917631) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- }
- }
- } else {
- if (code2 < 917760) {
- if (917632 <= code2 && code2 <= 917759) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- } else {
- if (code2 < 918e3) {
- if (917760 <= code2 && code2 <= 917999) {
- return boundaries_1.CLUSTER_BREAK.EXTEND;
- }
- } else {
- if (918e3 <= code2 && code2 <= 921599) {
- return boundaries_1.CLUSTER_BREAK.CONTROL;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return boundaries_1.CLUSTER_BREAK.OTHER;
- }
- /**
- * Given a Unicode code point, returns if symbol is an extended pictographic or some other break
- * @param code {number} Unicode code point
- * @returns {number}
- */
- static getEmojiProperty(code2) {
- if (code2 < 10160) {
- if (code2 < 9728) {
- if (code2 < 9e3) {
- if (code2 < 8482) {
- if (code2 < 8252) {
- if (169 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (174 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (8252 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (8265 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 8596) {
- if (8482 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (8505 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 8617) {
- if (8596 <= code2 && code2 <= 8601) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 8986) {
- if (8617 <= code2 && code2 <= 8618) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (8986 <= code2 && code2 <= 8987) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 9410) {
- if (code2 < 9167) {
- if (9e3 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (9096 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 9193) {
- if (9167 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 9208) {
- if (9193 <= code2 && code2 <= 9203) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (9208 <= code2 && code2 <= 9210) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 9654) {
- if (code2 < 9642) {
- if (9410 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (9642 <= code2 && code2 <= 9643) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 9664) {
- if (9654 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 9723) {
- if (9664 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (9723 <= code2 && code2 <= 9726) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 10035) {
- if (code2 < 10004) {
- if (code2 < 9748) {
- if (code2 < 9735) {
- if (9728 <= code2 && code2 <= 9733) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (9735 <= code2 && code2 <= 9746) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 9872) {
- if (9748 <= code2 && code2 <= 9861) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 9992) {
- if (9872 <= code2 && code2 <= 9989) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (9992 <= code2 && code2 <= 10002) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 10013) {
- if (10004 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (10006 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 10017) {
- if (10013 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (10017 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (10024 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 10067) {
- if (code2 < 10055) {
- if (code2 < 10052) {
- if (10035 <= code2 && code2 <= 10036) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (10052 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 10060) {
- if (10055 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (10060 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (10062 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- } else {
- if (code2 < 10083) {
- if (code2 < 10071) {
- if (10067 <= code2 && code2 <= 10069) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (10071 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 10133) {
- if (10083 <= code2 && code2 <= 10087) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 10145) {
- if (10133 <= code2 && code2 <= 10135) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (10145 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 127489) {
- if (code2 < 12951) {
- if (code2 < 11035) {
- if (code2 < 10548) {
- if (10160 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (10175 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 11013) {
- if (10548 <= code2 && code2 <= 10549) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (11013 <= code2 && code2 <= 11015) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- } else {
- if (code2 < 11093) {
- if (code2 < 11088) {
- if (11035 <= code2 && code2 <= 11036) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (11088 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 12336) {
- if (11093 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (12336 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (12349 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 127340) {
- if (code2 < 126976) {
- if (12951 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- if (12953 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 127245) {
- if (126976 <= code2 && code2 <= 127231) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 127279) {
- if (127245 <= code2 && code2 <= 127247) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (127279 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 127374) {
- if (code2 < 127358) {
- if (127340 <= code2 && code2 <= 127345) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (127358 <= code2 && code2 <= 127359) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 127377) {
- if (127374 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 127405) {
- if (127377 <= code2 && code2 <= 127386) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (127405 <= code2 && code2 <= 127461) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- }
- }
- } else {
- if (code2 < 128981) {
- if (code2 < 127561) {
- if (code2 < 127535) {
- if (code2 < 127514) {
- if (127489 <= code2 && code2 <= 127503) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (127514 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 127538) {
- if (127535 === code2) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 127548) {
- if (127538 <= code2 && code2 <= 127546) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (127548 <= code2 && code2 <= 127551) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 128326) {
- if (code2 < 128e3) {
- if (127561 <= code2 && code2 <= 127994) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (128e3 <= code2 && code2 <= 128317) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 128640) {
- if (128326 <= code2 && code2 <= 128591) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 128884) {
- if (128640 <= code2 && code2 <= 128767) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (128884 <= code2 && code2 <= 128895) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- }
- } else {
- if (code2 < 129198) {
- if (code2 < 129096) {
- if (code2 < 129036) {
- if (128981 <= code2 && code2 <= 129023) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (129036 <= code2 && code2 <= 129039) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 129114) {
- if (129096 <= code2 && code2 <= 129103) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 129160) {
- if (129114 <= code2 && code2 <= 129119) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (129160 <= code2 && code2 <= 129167) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- } else {
- if (code2 < 129340) {
- if (code2 < 129292) {
- if (129198 <= code2 && code2 <= 129279) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (129292 <= code2 && code2 <= 129338) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- } else {
- if (code2 < 129351) {
- if (129340 <= code2 && code2 <= 129349) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (code2 < 130048) {
- if (129351 <= code2 && code2 <= 129791) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- } else {
- if (130048 <= code2 && code2 <= 131069) {
- return boundaries_1.EXTENDED_PICTOGRAPHIC;
- }
- }
- }
- }
- }
- }
- }
- }
- return boundaries_1.CLUSTER_BREAK.OTHER;
- }
- };
- exports.default = Graphemer;
- }
-});
-
-// node_modules/graphemer/lib/index.js
-var require_lib2 = __commonJS({
- "node_modules/graphemer/lib/index.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var Graphemer_1 = __importDefault(require_Graphemer());
- exports.default = Graphemer_1.default;
- }
-});
-
-// node_modules/@atproto/common-web/dist/strings.js
-var require_strings = __commonJS({
- "node_modules/@atproto/common-web/dist/strings.js"(exports) {
- "use strict";
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- var desc = Object.getOwnPropertyDescriptor(m2, k2);
- if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() {
- return m2[k2];
- } };
- }
- Object.defineProperty(o4, k22, desc);
- } : function(o4, m2, k2, k22) {
- if (k22 === void 0) k22 = k2;
- o4[k22] = m2[k2];
- });
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v2) {
- Object.defineProperty(o4, "default", { enumerable: true, value: v2 });
- } : function(o4, v2) {
- o4["default"] = v2;
- });
- var __importStar = exports && exports.__importStar || function(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) {
- for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
- }
- __setModuleDefault(result, mod);
- return result;
- };
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.validateLanguage = exports.parseLanguage = exports.b64UrlToUtf8 = exports.utf8ToB64Url = exports.graphemeLen = exports.utf8Len = void 0;
- var graphemer_1 = __importDefault(require_lib2());
- var ui8 = __importStar((init_src2(), __toCommonJS(src_exports)));
- var utf8Len = (str) => {
- return new TextEncoder().encode(str).byteLength;
- };
- exports.utf8Len = utf8Len;
- var graphemeLen = (str) => {
- const splitter = new graphemer_1.default();
- return splitter.countGraphemes(str);
- };
- exports.graphemeLen = graphemeLen;
- var utf8ToB64Url = (utf8) => {
- return ui8.toString(ui8.fromString(utf8, "utf8"), "base64url");
- };
- exports.utf8ToB64Url = utf8ToB64Url;
- var b64UrlToUtf8 = (b64) => {
- return ui8.toString(ui8.fromString(b64, "base64url"), "utf8");
- };
- exports.b64UrlToUtf8 = b64UrlToUtf8;
- var parseLanguage = (langTag) => {
- const parsed = langTag.match(bcp47Regexp);
- if (!parsed?.groups)
- return null;
- const parts = parsed.groups;
- return {
- grandfathered: parts.grandfathered,
- language: parts.language,
- extlang: parts.extlang,
- script: parts.script,
- region: parts.region,
- variant: parts.variant,
- extension: parts.extension,
- privateUse: parts.privateUseA || parts.privateUseB
- };
- };
- exports.parseLanguage = parseLanguage;
- var validateLanguage = (langTag) => {
- return bcp47Regexp.test(langTag);
- };
- exports.validateLanguage = validateLanguage;
- var bcp47Regexp = /^((?(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?([A-Za-z]{2,3}(-(?[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable).attribute = false;\n }\n this.__prepare();\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get(this: ReactiveElement) {\n return get?.call(this);\n },\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set!.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that ust run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n * (<=41), properties created for native platform properties like (`id` or\n * `name`) may not have default values set in the element constructor. On\n * these browsers native properties appear on instances and therefore their\n * default value will overwrite any element default (e.g. if the element sets\n * this.id = 'id' in the constructor, the 'id' will become '' since this is\n * the native platform default).\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [using the lifecycle callbacks](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n this[propName as keyof this] = converter.fromAttribute!(\n value,\n options.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) as any;\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n options ??= (\n this.constructor as typeof ReactiveElement\n ).getPropertyOptions(name);\n const hasChanged = options.hasChanged ?? notEqual;\n const newValue = this[name as keyof this];\n if (hasChanged(newValue, oldValue)) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n options: PropertyDeclaration\n ) {\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (options.reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // changedProperties map, but only for the case of experimental\n // decorators on accessors, which will not have already populated the\n // changedProperties map. We can't know if these accessors had\n // initializers, so we just set them anyway - a difference from\n // experimental decorators on fields and standard decorators on\n // auto-accessors.\n // For context why experimentalDecorators with auto accessors are handled\n // specifically also see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n if (\n options.wrapped === true &&\n !this._$changedProperties.has(p) &&\n this[p as keyof this] !== undefined\n ) {\n this._$changeProperty(p, this[p as keyof this], options);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.0.4');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: HTMLElement | DocumentFragment;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: HTMLElement | DocumentFragment;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n // Issue a warning, if we haven't already.\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (!global.litIssuedWarnings!.has(warning)) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as (node: T) => T)\n : (node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with