From 53839286dbaf88c0cc717c06a12d60a91365d993 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Thu, 1 Nov 2018 12:50:19 +0100 Subject: [PATCH 01/50] Created dev branch --- cshub-client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cshub-client/package.json b/cshub-client/package.json index 657f864a..c101e023 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -1,6 +1,6 @@ { "name": "cshub-client", - "version": "0.1.0", + "version": "0.2.0", "private": true, "scripts": { "serve": "vue-cli-service serve", From 024e1ce189bcd3a7a1f3e4315bbb4fb64bb206ea Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Thu, 1 Nov 2018 12:54:45 +0100 Subject: [PATCH 02/50] Updated package json and added local env files to gitignore --- cshub-client/.gitignore | 2 ++ cshub-client/package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/cshub-client/.gitignore b/cshub-client/.gitignore index 8db22d36..ad1d9fa4 100644 --- a/cshub-client/.gitignore +++ b/cshub-client/.gitignore @@ -2,6 +2,8 @@ node_modules /dist +*.local + # Log files npm-debug.log* yarn-debug.log* diff --git a/cshub-client/package.json b/cshub-client/package.json index c101e023..4f386af6 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -5,6 +5,7 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", + "dev-build": "vue-cli-service build --mode development", "lint": "vue-cli-service lint" }, "dependencies": { From 4a6c6ace6c53d49eca40da9f1b07f0ba66e8afee Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Thu, 1 Nov 2018 13:14:50 +0100 Subject: [PATCH 03/50] Added analytics --- cshub-client/public/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cshub-client/public/index.html b/cshub-client/public/index.html index f3c53424..bbae8e19 100644 --- a/cshub-client/public/index.html +++ b/cshub-client/public/index.html @@ -16,5 +16,13 @@
+ + From d58f14b165ddc24286251f00f596e92161d124b1 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Thu, 1 Nov 2018 13:21:44 +0100 Subject: [PATCH 04/50] Changed test to dev --- cshub-client/.env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cshub-client/.env.development b/cshub-client/.env.development index 9c1c1755..8b107d58 100644 --- a/cshub-client/.env.development +++ b/cshub-client/.env.development @@ -1,2 +1,2 @@ -VUE_APP_API_URL=https://api-test.cshub.nl:3001 +VUE_APP_API_URL=https://api-dev.cshub.nl:3001 VUE_APP_DEBUG=true From 52a021a808ab8e989f0637a843183b448df29f0a Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 2 Nov 2018 20:09:51 +0100 Subject: [PATCH 05/50] Added Node version 11 CI --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8cedaa5c..b96ed5ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ matrix: node_js: - "8" - "10" + - "11" before_script: - cd cshub-client script: @@ -18,6 +19,7 @@ matrix: node_js: - "8" - "10" + - "11" before_script: - cd cshub-server/src/ - cp settings_baseline.ts settings.ts From 6061e5b0ab7d446287c991bfd78a0af051a606db Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Fri, 2 Nov 2018 22:05:05 +0100 Subject: [PATCH 06/50] WIP On cache --- cshub-client/.env.development | 2 +- cshub-client/package-lock.json | 64 ++++----- cshub-client/package.json | 1 + cshub-client/src/components/posts/Post.vue | 100 +++++++------- cshub-client/src/utilities/cache-types.ts | 3 + cshub-server/src/components/pages/post.ts | 124 +++++++++--------- .../src/components/pages/postContent.ts | 60 +++++---- .../api-calls/pages/PostContentRequest.ts | 22 ---- cshub-shared/api-calls/pages/PostRequest.ts | 7 +- .../api-calls/pages/PostVersionRequest.ts | 28 ++++ cshub-shared/api-calls/pages/index.ts | 2 +- cshub-shared/models/IPost.ts | 2 + 12 files changed, 216 insertions(+), 199 deletions(-) create mode 100644 cshub-client/src/utilities/cache-types.ts delete mode 100644 cshub-shared/api-calls/pages/PostContentRequest.ts create mode 100644 cshub-shared/api-calls/pages/PostVersionRequest.ts diff --git a/cshub-client/.env.development b/cshub-client/.env.development index 8b107d58..4cdb3798 100644 --- a/cshub-client/.env.development +++ b/cshub-client/.env.development @@ -1,2 +1,2 @@ -VUE_APP_API_URL=https://api-dev.cshub.nl:3001 +VUE_APP_API_URL=https://api-dev.cshub.nl VUE_APP_DEBUG=true diff --git a/cshub-client/package-lock.json b/cshub-client/package-lock.json index 8254dbe6..3d0e3292 100644 --- a/cshub-client/package-lock.json +++ b/cshub-client/package-lock.json @@ -1,6 +1,6 @@ { "name": "cshub-client", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4849,8 +4849,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -4871,14 +4870,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4893,20 +4890,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5023,8 +5017,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5036,7 +5029,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5051,7 +5043,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5059,14 +5050,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5085,7 +5074,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5166,8 +5154,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5179,7 +5166,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -5265,8 +5251,7 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -5302,7 +5287,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5322,7 +5306,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5366,14 +5349,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -6236,6 +6217,11 @@ "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, "import-cwd": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", @@ -6906,6 +6892,14 @@ "invert-kv": "^2.0.0" } }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, "loader-runner": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.1.tgz", @@ -6923,6 +6917,14 @@ "json5": "^0.5.0" } }, + "localforage": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.7.3.tgz", + "integrity": "sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==", + "requires": { + "lie": "3.1.1" + } + }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", diff --git a/cshub-client/package.json b/cshub-client/package.json index 4f386af6..2be4fe8b 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -14,6 +14,7 @@ "axios": "^0.18.0", "jquery": "^3.3.1", "katex": "^0.7.1", + "localforage": "^1.7.3", "moment": "^2.22.2", "quill-delta": "^4.1.0", "register-service-worker": "^1.0.0", diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index 4f6ea493..1d7971d4 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -44,9 +44,9 @@ - - - + + +
@@ -66,14 +66,16 @@ PostCallBack, PostRequest, VerifyPostCallBack, VerifyPostRequest, - EditPostRequest, EditPostCallback, PostContentRequest, PostContentCallBack + EditPostRequest, EditPostCallback, PostVersionRequest, PostVersionCallBack } from "../../../../cshub-shared/api-calls"; import {IPost, ITopic} from "../../../../cshub-shared/models"; import {Routes} from "../../views/router/router"; import dataState from "../../store/data"; import userState from "../../store/user"; import Delta from "quill-delta/dist/Delta"; + import localForage from "localforage"; import {getTopicFromHash} from "../../../../cshub-shared/utilities/topics"; + import {CacheTypes} from "../../utilities/cache-types"; interface IBreadCrumbType { name: string; @@ -87,8 +89,7 @@ return { post: null as IPost, editMode: false as boolean, - topicNames: [] as IBreadCrumbType[], - content: null as Delta + topicNames: [] as IBreadCrumbType[] }; }, props: { @@ -98,11 +99,7 @@ mounted() { window.addEventListener("resize", this.windowHeightChanged); - if (this.isFullPost) { - this.getFullPostRequest(); - } else { - this.getPreviewPostRequest(); - } + this.getPostRequest(); }, computed: { backgroundColorComputed(): string { @@ -180,54 +177,63 @@ }); }, - getPreviewPostRequest() { - ApiWrapper.sendPostRequest(new PostRequest(this.postHash, false), (callbackData: PostCallBack) => { - this.post = callbackData.post; - LogObjectConsole(callbackData.post, "PostPreview"); + isContentSet() { + return typeof this.post.htmlContent === "string"; + }, + getPostRequest() { + localForage.getItem(CacheTypes.POSTS + this.postHash) + .then((value: IPost) => { + if (value === null) { + ApiWrapper.sendPostRequest(new PostRequest(this.postHash), (callbackData: PostCallBack) => { + this.post = callbackData.post; + this.topicNames = this.getTopicListWhereFinalChildIs(getTopicFromHash(this.post.topicHash, dataState.topics)); - this.getContentRequest(); - }); + LogObjectConsole(callbackData.post, "getPostRequest"); + + if (this.isFullPost) { + this.getContentRequest(); + } else { + localForage.setItem(CacheTypes.POSTS + this.postHash, callbackData.post) + .then(() => { + LogStringConsole("Added post to cache", "getPostRequest"); + }); + } + }); + } else { + LogStringConsole("Gotten post from cache", "getPostRequest"); + this.post = value as IPost; + this.getContentRequest(); + } + }); }, getContentRequest() { - ApiWrapper.sendPostRequest(new PostContentRequest(this.postHash), (callbackContent: PostContentCallBack) => { - LogStringConsole("Preview post gotten content"); - this.topicNames = this.getTopicListWhereFinalChildIs(getTopicFromHash(this.post.topicHash, dataState.topics)); - this.content = callbackContent.content; - }); - }, - getFullPostRequest() { - if (this.post === null) { - ApiWrapper.sendPostRequest(new PostRequest(this.postHash, this.content === null), (callbackData: PostCallBack) => { + ApiWrapper.sendPostRequest(new PostVersionRequest(this.postHash, !this.isContentSet(), this.post.postVersion), (callbackContent: PostVersionCallBack) => { - LogObjectConsole(callbackData.post, `Getting data for ${callbackData.post.title} fullpostrequest`); + let hasBeenUpdated = false; - const currTopic: ITopic = getTopicFromHash(callbackData.post.topicHash, dataState.topics); - this.topicNames = this.getTopicListWhereFinalChildIs(currTopic); - this.post = callbackData.post; + if (callbackContent.postUpdated !== undefined) { + this.post = callbackContent.postUpdated; + this.post.htmlContent = callbackContent.htmlContent; + hasBeenUpdated = true; + } - if (this.content === null && callbackData.content !== null) { - this.content = callbackData.content; - } + if (callbackContent.htmlContent !== undefined) { + this.post.htmlContent = callbackContent.htmlContent; + hasBeenUpdated = true; + } - // Wait for one tick, then init height - Vue.nextTick() + if (hasBeenUpdated) { + this.$forceUpdate(); + localForage.setItem(CacheTypes.POSTS + this.postHash, this.post) .then(() => { - this.windowHeightChanged(); + LogStringConsole("Changed post in cache", "getContentRequest"); }); - }); - } else if (this.content === null) { - this.getContentRequest(); - } - - // Wait for one tick, then init height - Vue.nextTick() - .then(() => { - this.windowHeightChanged(); - }); + } + }); }, navigateToPost(): void { LogStringConsole(`Going to post ${this.post.title}`, "PostPreview navigateToPost"); - this.getFullPostRequest(); + this.getPostRequest(); if (!this.$router.currentRoute.path.includes(Routes.USERDASHBOARD) && !this.$router.currentRoute.path.includes(Routes.ADMINDASHBOARD)) { this.$router.push(`${Routes.POST}/${this.post.hash}`); diff --git a/cshub-client/src/utilities/cache-types.ts b/cshub-client/src/utilities/cache-types.ts new file mode 100644 index 00000000..728dfff6 --- /dev/null +++ b/cshub-client/src/utilities/cache-types.ts @@ -0,0 +1,3 @@ +export enum CacheTypes { + POSTS = "POST_" +} \ No newline at end of file diff --git a/cshub-server/src/components/pages/post.ts b/cshub-server/src/components/pages/post.ts index 23f2df5e..1d1f613f 100644 --- a/cshub-server/src/components/pages/post.ts +++ b/cshub-server/src/components/pages/post.ts @@ -1,14 +1,13 @@ import {app, logger} from "../../"; import {Request, Response} from "express"; import { - PostCallBack, PostContentCallBack, + PostCallBack, PostRequest } from "../../../../cshub-shared/api-calls"; import {IPost} from "../../../../cshub-shared/models"; import {DatabaseResultSet, query} from "../../utilities/database-connection"; import {hasAccessToPost} from "../../auth/validateRights/post"; -import {getPostContent} from "./postContent"; app.post(PostRequest.getURL, (req: Request, res: Response) => { @@ -21,68 +20,67 @@ app.post(PostRequest.getURL, (req: Request, res: Response) => { res.status(401).send(); } // Get all the post data from database - query(` - SELECT T1.datetime, - T1.title, - T1.hash, - T1.upvotes, - T2.id AS authorId, - T2.firstname AS authorFirstName, - T2.lastname AS authorLastName, - T2.avatar AS authorAvatar, - T2.admin AS authorAdmin, - T3.name, - T3.hash AS topicHash, - T1.id, - T1.approved, - T1.approvedBy, - T1.rejectedReason, - T4.id AS approvedById, - T4.firstname AS approvedByFirstName, - T4.lastname AS approvedByLastName, - T4.avatar AS approvedByAvatar, - T4.admin AS approvedByAdmin - FROM posts T1 - INNER JOIN users T2 ON T1.author = T2.id - INNER JOIN topics T3 ON T1.topic = T3.id - LEFT JOIN users T4 ON T1.approvedBy = T4.id - WHERE T1.hash = ? - ORDER BY datetime DESC - `, postRequest.postHash) - .then((post: DatabaseResultSet) => { - - // Create the postBase object, it will be expanded depending on the type of request (Preview or full, preview has less data) - // The author is of typed IUserCensored as it protects a bit of privacy, it doesn't get all their data, just name and avatar - const postBase: IPost = { - topicHash: post.getNumberFromDB("topicHash"), - datetime: post.getStringFromDB("datetime"), - title: post.getStringFromDB("title"), - upvotes: post.getNumberFromDB("upvotes"), - hash: post.getNumberFromDB("hash"), - id: post.getNumberFromDB("id"), - author: { - id: post.getNumberFromDB("authorId"), - firstname: post.getStringFromDB("authorFirstName"), - lastname: post.getStringFromDB("authorLastName"), - avatar: post.getStringFromDB("authorAvatar"), - admin: post.getNumberFromDB("authorAdmin") === 1 - }, - approved: post.getNumberFromDB("approved") === 1 - }; - - if (postRequest.giveContent) { - getPostContent(postRequest.postHash) - .then((content: PostContentCallBack) => { - res.json(new PostCallBack(postBase, content.content)); - }) + getPostData(postRequest.postHash) + .then((data: PostCallBack) => { + if (data === null) { + res.status(500).send(); } else { - res.json(new PostCallBack(postBase)); + res.json(data); } }) - .catch(err => { - logger.error(`Retreiving post data failed`); - logger.error(err); - res.status(500).send(); - }); - }) + }); }); + +export const getPostData = (postHash: number): Promise => { + return query(` + SELECT T1.datetime, + T1.title, + T1.hash, + T1.upvotes, + T2.id AS authorId, + T2.firstname AS authorFirstName, + T2.lastname AS authorLastName, + T2.avatar AS authorAvatar, + T2.admin AS authorAdmin, + T3.name, + T3.hash AS topicHash, + T1.id, + T1.approved, + T1.postVersion + FROM posts T1 + INNER JOIN users T2 ON T1.author = T2.id + INNER JOIN topics T3 ON T1.topic = T3.id + LEFT JOIN users T4 ON T1.approvedBy = T4.id + WHERE T1.hash = ? + ORDER BY datetime DESC + `, postHash) + .then((post: DatabaseResultSet) => { + + // Create the postBase object, it will be expanded depending on the type of request (Preview or full, preview has less data) + // The author is of typed IUserCensored as it protects a bit of privacy, it doesn't get all their data, just name and avatar + const postBase: IPost = { + topicHash: post.getNumberFromDB("topicHash"), + datetime: post.getStringFromDB("datetime"), + title: post.getStringFromDB("title"), + upvotes: post.getNumberFromDB("upvotes"), + hash: post.getNumberFromDB("hash"), + id: post.getNumberFromDB("id"), + author: { + id: post.getNumberFromDB("authorId"), + firstname: post.getStringFromDB("authorFirstName"), + lastname: post.getStringFromDB("authorLastName"), + avatar: post.getStringFromDB("authorAvatar"), + admin: post.getNumberFromDB("authorAdmin") === 1 + }, + approved: post.getNumberFromDB("approved") === 1, + postVersion: post.getNumberFromDB("postVersion") + }; + + return new PostCallBack(postBase); + }) + .catch(err => { + logger.error(`Retreiving post data failed`); + logger.error(err); + return null; + }); +} \ No newline at end of file diff --git a/cshub-server/src/components/pages/postContent.ts b/cshub-server/src/components/pages/postContent.ts index dc86e015..acf7b626 100644 --- a/cshub-server/src/components/pages/postContent.ts +++ b/cshub-server/src/components/pages/postContent.ts @@ -1,16 +1,19 @@ import {app, logger} from "../../."; import {Request, Response} from "express"; import { - PostContentCallBack, - PostContentRequest + PostCallBack, + PostVersionCallBack, + PostVersionRequest, + PostVersionTypes } from "../../../../cshub-shared/api-calls"; import {DatabaseResultSet, query} from "../../utilities/database-connection"; import {hasAccessToPost} from "../../auth/validateRights/post"; +import {getPostData} from "./post"; -app.post(PostContentRequest.getURL, (req: Request, res: Response) => { +app.post(PostVersionRequest.getURL, (req: Request, res: Response) => { - const postContentRequest = req.body as PostContentRequest; + const postContentRequest = req.body as PostVersionRequest; // Check if the user actually has access to the post hasAccessToPost(postContentRequest.postHash, req.cookies["token"]) @@ -19,34 +22,33 @@ app.post(PostContentRequest.getURL, (req: Request, res: Response) => { res.status(401).send(); } - getPostContent(postContentRequest.postHash) - .then((callback: PostContentCallBack) => { - res.json(callback); - - }) - .catch(err => { - res.status(500).send(); - }); - }); -}); - -export const getPostContent = (postHash: number): Promise => { - - // Get all the post data from database - return query(` - SELECT T1.content + query(` + SELECT T1.htmlContent, T2.postVersion FROM edits T1 INNER JOIN posts T2 ON T1.post = T2.id WHERE T2.hash = ? ORDER BY T1.datetime DESC LIMIT 1 - `, postHash) - .then((post: DatabaseResultSet) => { - return new PostContentCallBack(JSON.parse(post.getStringFromDB("content"))); - }) - .catch(err => { - logger.error(`Retreiving post content failed`); - logger.error(err); - return null; + `, postContentRequest.postHash) + .then((post: DatabaseResultSet) => { + const htmlContent: string = post.getStringFromDB("htmlContent"); + + if (post.getNumberFromDB("postVersion") !== postContentRequest.postVersion) { + getPostData(postContentRequest.postHash) + .then((data: PostCallBack) => { + res.json(new PostVersionCallBack(PostVersionTypes.UPDATEDPOST, htmlContent, data.post)); + }) + } else if (postContentRequest.getHTMLOnNoUpdate) { + res.json(new PostVersionCallBack(PostVersionTypes.RETRIEVEDCONTENT, htmlContent)); + } else { + res.json(new PostVersionCallBack(PostVersionTypes.NOCHANGE)); + } + + }) + .catch(err => { + logger.error("Error at post content"); + logger.error(err); + res.status(500).send(); + }); }); -}; \ No newline at end of file +}); \ No newline at end of file diff --git a/cshub-shared/api-calls/pages/PostContentRequest.ts b/cshub-shared/api-calls/pages/PostContentRequest.ts deleted file mode 100644 index 0ca98229..00000000 --- a/cshub-shared/api-calls/pages/PostContentRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {IApiRequest} from "../../models/IApiRequest"; - -import {NonAuthRequests} from "../NonAuthRequests"; -// @ts-ignore -import Delta from "quill-delta/dist/Delta"; - -export class PostContentCallBack { - - constructor( - public content: Delta - ) {} -} - -export class PostContentRequest implements IApiRequest { - - public static getURL: string = NonAuthRequests.POSTCONTENT; - public URL: string = PostContentRequest.getURL; - public isReduced: boolean = false; - - constructor(public postHash: number) {} - -} diff --git a/cshub-shared/api-calls/pages/PostRequest.ts b/cshub-shared/api-calls/pages/PostRequest.ts index 88357674..172fc958 100644 --- a/cshub-shared/api-calls/pages/PostRequest.ts +++ b/cshub-shared/api-calls/pages/PostRequest.ts @@ -2,14 +2,11 @@ import {IApiRequest} from "../../models/IApiRequest"; import {IPost} from "../../models/IPost"; import {NonAuthRequests} from "../NonAuthRequests"; -// @ts-ignore -import Delta from "quill-delta/dist/Delta"; export class PostCallBack { constructor( - public post: IPost, - public content?: Delta + public post: IPost ) {} } @@ -18,6 +15,6 @@ export class PostRequest implements IApiRequest { public static getURL: string = NonAuthRequests.POSTDATA; public URL: string = PostRequest.getURL; - constructor(public postHash: number, public giveContent: boolean) {} + constructor(public postHash: number) {} } diff --git a/cshub-shared/api-calls/pages/PostVersionRequest.ts b/cshub-shared/api-calls/pages/PostVersionRequest.ts new file mode 100644 index 00000000..17ada8ca --- /dev/null +++ b/cshub-shared/api-calls/pages/PostVersionRequest.ts @@ -0,0 +1,28 @@ +import {IApiRequest} from "../../models"; +import {NonAuthRequests} from "../NonAuthRequests"; +import {IPost} from "../../models"; + +export enum PostVersionTypes { + UPDATEDPOST, + RETRIEVEDCONTENT, + POSTDELETED, + NOCHANGE +} + +export class PostVersionCallBack { + + constructor( + public postVersionType: PostVersionTypes, + public htmlContent?: string, + public postUpdated?: IPost + ) {} +} + +export class PostVersionRequest implements IApiRequest { + + public static getURL: string = NonAuthRequests.POSTCONTENT; + public URL: string = PostVersionRequest.getURL; + + constructor(public postHash: number, public getHTMLOnNoUpdate: boolean, public postVersion: number) {} + +} diff --git a/cshub-shared/api-calls/pages/index.ts b/cshub-shared/api-calls/pages/index.ts index 4769d8d1..afbb4486 100644 --- a/cshub-shared/api-calls/pages/index.ts +++ b/cshub-shared/api-calls/pages/index.ts @@ -4,7 +4,7 @@ export * from "./TopicsRequest"; export * from "./SubmitPostRequest"; export * from "./SubmitTopicRequest"; export * from "./EditPostRequest"; -export * from "./PostContentRequest"; +export * from "./PostVersionRequest"; export * from "./user"; diff --git a/cshub-shared/models/IPost.ts b/cshub-shared/models/IPost.ts index 85465d88..257ff3fc 100644 --- a/cshub-shared/models/IPost.ts +++ b/cshub-shared/models/IPost.ts @@ -9,4 +9,6 @@ export interface IPost { approved: boolean; upvotes: number; id: number; + postVersion: number; + htmlContent?: string; } From 49a508af4ff7959fc012de200dabb5745db05312 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Fri, 2 Nov 2018 22:52:50 +0100 Subject: [PATCH 07/50] Topics also cached --- .../src/components/global/NavDrawer.vue | 54 +++++++++++++++---- cshub-client/src/components/posts/Post.vue | 33 ++++++++---- cshub-client/src/utilities/cache-types.ts | 5 +- cshub-client/tslint.json | 1 + .../src/components/pages/postContent.ts | 4 +- cshub-server/src/components/pages/topics.ts | 38 +++++++++---- cshub-shared/api-calls/pages/TopicsRequest.ts | 5 +- 7 files changed, 107 insertions(+), 33 deletions(-) diff --git a/cshub-client/src/components/global/NavDrawer.vue b/cshub-client/src/components/global/NavDrawer.vue index 7bb56dcd..88d6bb54 100644 --- a/cshub-client/src/components/global/NavDrawer.vue +++ b/cshub-client/src/components/global/NavDrawer.vue @@ -59,8 +59,10 @@ diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index 1d7971d4..47d7f8a2 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -1,6 +1,7 @@ @@ -137,13 +137,6 @@ logObjectConsole(callbackData.postHashes, "User dashboard posthashes"); }); }, - toggleFullPost(postHash: number) { - if (postHash !== null) { - this.currentPostHash = postHash; - } else { - this.currentPostHash = -1; - } - }, changePassword() { ApiWrapper.sendPostRequest(new ChangeUserPassword(this.userData.currentPassword, this.userData.newPassword), (callBack: ChangeUserPasswordCallback) => { if (callBack.response === ChangeUserPasswordReponseTypes.SUCCESS) { diff --git a/cshub-server/src/components/pages/CreatePost.ts b/cshub-server/src/components/pages/CreatePost.ts index 2508312e..bec84110 100644 --- a/cshub-server/src/components/pages/CreatePost.ts +++ b/cshub-server/src/components/pages/CreatePost.ts @@ -60,8 +60,9 @@ app.post(CreatePost.getURL, (req: Request, res: Response) => { INSERT INTO edits SET post = ?, content = ?, - editedBy = ? - `, insertResult.getInsertId(), JSON.stringify(submitPostRequest.postBody), userObj.tokenObj.user.id); + editedBy = ?, + htmlContent = ? + `, insertResult.getInsertId(), JSON.stringify(submitPostRequest.postBody), userObj.tokenObj.user.id, JSON.stringify(submitPostRequest.postBody)); }) .then((insertEdit: DatabaseResultSet) => { res.json(new CreatePostCallback(SubmitPostResponse.SUCCESS, topicHash)); diff --git a/cshub-server/src/components/pages/GetPost.ts b/cshub-server/src/components/pages/GetPost.ts index 43116607..c4f7daae 100644 --- a/cshub-server/src/components/pages/GetPost.ts +++ b/cshub-server/src/components/pages/GetPost.ts @@ -56,6 +56,9 @@ export const getPostData = (postHash: number): Promise => { `, postHash) .then((post: DatabaseResultSet) => { + if (post.convertRowsToResultObjects().length === 0) { + return new GetPostCallBack(null); + } // Create the postBase object, it will be expanded depending on the type of request (Preview or full, preview has less data) // The author is of typed IUserCensored as it protects a bit of privacy, it doesn't get all their data, just name and avatar const postBase: IPost = { diff --git a/cshub-server/src/components/pages/GetPostContent.ts b/cshub-server/src/components/pages/GetPostContent.ts index 60229088..497a73e9 100644 --- a/cshub-server/src/components/pages/GetPostContent.ts +++ b/cshub-server/src/components/pages/GetPostContent.ts @@ -2,8 +2,8 @@ import {app, logger} from "../../."; import {Request, Response} from "express"; import { GetPostCallBack, - GetPostContentCallBack, GetPostContent, + GetPostContentCallBack, PostVersionTypes } from "../../../../cshub-shared/api-calls"; @@ -23,7 +23,7 @@ app.post(GetPostContent.getURL, (req: Request, res: Response) => { } query(` - SELECT T1.htmlContent, T2.postVersion + SELECT T2.postVersion FROM edits T1 INNER JOIN posts T2 ON T1.post = T2.id WHERE T2.hash = ? @@ -31,17 +31,26 @@ app.post(GetPostContent.getURL, (req: Request, res: Response) => { LIMIT 1 `, postContentRequest.postHash) .then((post: DatabaseResultSet) => { - const htmlContent: string = post.getStringFromDB("htmlContent"); if (post.convertRowsToResultObjects().length === 0) { res.json(new GetPostContentCallBack(PostVersionTypes.POSTDELETED)); } else if (post.getNumberFromDB("postVersion") !== postContentRequest.postVersion) { - getPostData(postContentRequest.postHash) - .then((data: GetPostCallBack) => { - res.json(new GetPostContentCallBack(PostVersionTypes.UPDATEDPOST, htmlContent, data.post)); + getContent() + .then((htmlContent: string) => { + getPostData(postContentRequest.postHash) + .then((data: GetPostCallBack) => { + if (data !== null) { + res.json(new GetPostContentCallBack(PostVersionTypes.UPDATEDPOST, htmlContent, data.post)); + } else { + res.json(new GetPostContentCallBack(PostVersionTypes.POSTDELETED)); + } + }) }) } else if (postContentRequest.getHTMLOnNoUpdate) { - res.json(new GetPostContentCallBack(PostVersionTypes.RETRIEVEDCONTENT, htmlContent)); + getContent() + .then((htmlContent: string) => { + res.json(new GetPostContentCallBack(PostVersionTypes.RETRIEVEDCONTENT, htmlContent)); + }) } else { res.json(new GetPostContentCallBack(PostVersionTypes.NOCHANGE)); } @@ -53,4 +62,18 @@ app.post(GetPostContent.getURL, (req: Request, res: Response) => { res.status(500).send(); }); }); + + const getContent = () => { + return query(` + SELECT T1.htmlContent + FROM edits T1 + INNER JOIN posts T2 ON T1.post = T2.id + WHERE T2.hash = ? + ORDER BY T1.datetime DESC + LIMIT 1 + `, postContentRequest.postHash) + .then((content: DatabaseResultSet) => { + return content.getStringFromDB("htmlContent"); + }) + } }); \ No newline at end of file diff --git a/cshub-server/src/components/pages/GetTopicPosts.ts b/cshub-server/src/components/pages/GetTopicPosts.ts index 26a3b3d7..12984d91 100644 --- a/cshub-server/src/components/pages/GetTopicPosts.ts +++ b/cshub-server/src/components/pages/GetTopicPosts.ts @@ -48,12 +48,13 @@ app.post(GetTopicPosts.getURL, (req: Request, res: Response) => { if (topicHashes.length > 0) { // Retreiving all post hashes of the current topic query(` - SELECT T1.hash - FROM posts T1 - INNER JOIN topics T2 ON T1.topic = T2.id - WHERE approved = 1 AND T2.hash IN (?) - ORDER BY datetime DESC - `, topicHashes, topicPostsRequest.startFromResult) + SELECT T1.hash + FROM posts T1 + INNER JOIN topics T2 ON T1.topic = T2.id + WHERE approved = 1 + AND T2.hash IN (?) + ORDER BY datetime DESC + `, topicHashes, topicPostsRequest.startFromResult) .then((posts: DatabaseResultSet) => { const postHashes: number[] = []; diff --git a/cshub-server/src/components/pages/admin/VerifyPost.ts b/cshub-server/src/components/pages/admin/VerifyPost.ts index a14956f1..ae0fd60c 100644 --- a/cshub-server/src/components/pages/admin/VerifyPost.ts +++ b/cshub-server/src/components/pages/admin/VerifyPost.ts @@ -13,7 +13,7 @@ app.post(VerifyPost.getURL, (req: Request, res: Response) => { if (token.valid && token.tokenObj.user.admin) { query(` UPDATE posts - SET approved = 1, approvedBy = ? + SET approved = 1, approvedBy = ?, postVersion = postVersion + 1 WHERE hash = ? `, token.tokenObj.user.id, verifyPostRequest.postHash) .then((result: DatabaseResultSet) => { From 8aa0610950f60998806263788f7e0fff7a299c67 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sat, 3 Nov 2018 21:27:04 +0100 Subject: [PATCH 17/50] Fixed postview --- cshub-client/src/App.vue | 9 +- cshub-client/src/components/posts/Post.vue | 40 ++--- cshub-client/src/views/posts/PostView.vue | 46 ++++- cshub-client/src/views/router/router.ts | 28 +-- .../src/views/user/AdminDashboard.vue | 35 ++-- cshub-client/src/views/user/UserDashboard.vue | 163 +++++++++--------- 6 files changed, 175 insertions(+), 146 deletions(-) diff --git a/cshub-client/src/App.vue b/cshub-client/src/App.vue index 1d42f87b..2f5c7a26 100644 --- a/cshub-client/src/App.vue +++ b/cshub-client/src/App.vue @@ -90,9 +90,12 @@ }, watch: { $route(to: Route, from: Route) { - if (from.fullPath === Routes.INDEX && to.name === "post") { - this.activeclass = ""; - } else if (to.fullPath === Routes.INDEX && from.name === "post") { + const excludeTransition = (from.fullPath === Routes.INDEX && to.name === "post") || + (to.fullPath === Routes.INDEX && from.name === "post") || + (from.name === "user" && to.name === "post") || + (from.name === "admin" && to.name === "post"); + + if (excludeTransition) { this.activeclass = ""; } else { this.activeclass = "animated fadeInLeft"; diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index ff9c5b69..b2f66078 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -1,13 +1,12 @@ @@ -130,6 +134,8 @@ import {AxiosError} from "axios"; import {ImgurUpload} from "../../utilities/imgur"; import {Route} from "vue-router"; + import PostEditsDialog from "./PostEditsDialog.vue"; + import uiState from "../../store/ui"; interface IBreadCrumbType { name: string; @@ -138,7 +144,7 @@ export default Vue.extend({ name: "Post", - components: {Quill}, + components: {Quill, PostEditsDialog}, data() { return { post: null as IPost, @@ -146,7 +152,8 @@ editContent: {} as Delta, showContent: true, topicNames: [] as IBreadCrumbType[], - loadingIcon: false + loadingIcon: false, + previousTopicURL: "" as string }; }, props: { @@ -156,8 +163,12 @@ window.addEventListener("resize", this.windowHeightChanged); this.getPostRequest(); + this.previousTopicURL = Routes.INDEX; + if (this.editModeComputed) { this.enableEdit(); + } else if (this.editsListComputed) { + uiState.setEditDialogState(true); } }, computed: { @@ -187,7 +198,12 @@ }, editModeComputed: { get(): boolean { - return this.$route.fullPath.includes(`${this.postHash}/edit`); + return this.$route.fullPath === `${this.currentPostURLComputed}/edit`; + } + }, + editsListComputed: { + get(): boolean { + return this.$route.fullPath === `${this.currentPostURLComputed}/edits`; } } }, @@ -195,6 +211,12 @@ $route(to: Route, from: Route) { if (this.fullPostComputed && (from.name === "topic" || from.fullPath === Routes.INDEX)) { this.getContentRequest(this.post); + this.previousTopicURL = from.fullPath; + } else if (this.editsListComputed) { + this.previousTopicURL = Routes.INDEX; + this.viewEditDialog(); + } else { + this.previousTopicURL = Routes.INDEX; } } }, @@ -230,7 +252,8 @@ }); }, returnToPostMenu() { - this.$router.go(-1); + console.log(this.previousTopicURL); + this.$router.push(this.previousTopicURL); }, getParentTopic(child: ITopic, topics: ITopic[]): ITopic { for (const topic of topics) { @@ -247,9 +270,9 @@ }, enableEdit() { ApiWrapper.sendPostRequest(new GetEditContent(this.postHash), (callbackData: GetEditContentCallback) => { - let baseDelta = new Delta(callbackData.deltas[0]); - for (let i = 1; i < callbackData.deltas.length; i++) { - baseDelta = baseDelta.compose(callbackData.deltas[i]); + let baseDelta = new Delta(callbackData.edits[0].content); + for (let i = 1; i < callbackData.edits.length; i++) { + baseDelta = baseDelta.compose(callbackData.edits[i].content); } this.editContent = baseDelta; @@ -372,6 +395,10 @@ afterAnimation() { this.showContent = true; }, + viewEditDialog() { + this.$router.push(`${this.currentPostURLComputed}/edits`); + uiState.setEditDialogState(true); + }, navigateToPost(): void { logStringConsole(`Going to post ${this.post.title}`, "PostPreview navigateToPost"); diff --git a/cshub-client/src/components/posts/PostEditsDialog.vue b/cshub-client/src/components/posts/PostEditsDialog.vue new file mode 100644 index 00000000..32d68d5f --- /dev/null +++ b/cshub-client/src/components/posts/PostEditsDialog.vue @@ -0,0 +1,136 @@ + + + + + \ No newline at end of file diff --git a/cshub-client/src/store/ui/getters.ts b/cshub-client/src/store/ui/getters.ts index 81541bfa..b5fe67dd 100644 --- a/cshub-client/src/store/ui/getters.ts +++ b/cshub-client/src/store/ui/getters.ts @@ -1,3 +1,5 @@ import {uiStoreBuilder} from "./state"; export const drawerState = uiStoreBuilder.read((state) => state.navbar.open, "drawerState"); + +export const editDialogState = uiStoreBuilder.read((state) => state.editDialogState, "editDialogState"); diff --git a/cshub-client/src/store/ui/index.ts b/cshub-client/src/store/ui/index.ts index 8928eddb..ef28cd38 100644 --- a/cshub-client/src/store/ui/index.ts +++ b/cshub-client/src/store/ui/index.ts @@ -1,13 +1,15 @@ import {uiStateGetter, uiStoreBuilder} from "./state"; -import {drawerState} from "./getters"; -import {setDrawerState} from "./mutations"; +import {drawerState, editDialogState} from "./getters"; +import {setDrawerState, setEditDialogState} from "./mutations"; const uiState = { get state() { return uiStateGetter(); }, get drawerState() { return drawerState(); }, + get editDialogState() { return editDialogState(); }, setDrawerState: uiStoreBuilder.commit(setDrawerState), + setEditDialogState: uiStoreBuilder.commit(setEditDialogState) }; export default uiState; diff --git a/cshub-client/src/store/ui/mutations.ts b/cshub-client/src/store/ui/mutations.ts index 08564838..b130c093 100644 --- a/cshub-client/src/store/ui/mutations.ts +++ b/cshub-client/src/store/ui/mutations.ts @@ -3,3 +3,8 @@ import {IUIState} from "./state"; export const setDrawerState = (state: IUIState, payload: boolean) => { state.navbar.open = payload; }; + +export const setEditDialogState = (state: IUIState, payload: boolean) => { + state.editDialogState = payload; +}; + diff --git a/cshub-client/src/store/ui/state.ts b/cshub-client/src/store/ui/state.ts index c04965af..37e1bf7e 100644 --- a/cshub-client/src/store/ui/state.ts +++ b/cshub-client/src/store/ui/state.ts @@ -5,12 +5,14 @@ export interface IUIState { navbar: { open: boolean }; + editDialogState: boolean; } export const UIState: IUIState = { navbar: { open: null - } + }, + editDialogState: false }; export const uiStoreBuilder = getStoreBuilder().module("ui", UIState); diff --git a/cshub-client/src/views/posts/PostView.vue b/cshub-client/src/views/posts/PostView.vue index d40ed98d..dc0639e8 100644 --- a/cshub-client/src/views/posts/PostView.vue +++ b/cshub-client/src/views/posts/PostView.vue @@ -62,7 +62,7 @@ }, methods: { doOnRouteChange() { - const currentHash = +this.$route.params.hash + const currentHash = +this.$route.params.hash; if (this.$router.currentRoute.fullPath.includes(Routes.POST)) { this.currentTopicHash = -1; if (this.postHashes.length === 0) { diff --git a/cshub-client/src/views/router/router.ts b/cshub-client/src/views/router/router.ts index 2c821d72..d135829c 100644 --- a/cshub-client/src/views/router/router.ts +++ b/cshub-client/src/views/router/router.ts @@ -74,6 +74,11 @@ const router = new Router({ name: "postEdit", component: PostView }, + { + path: `${Routes.POST}/:hash/edits`, + name: "postEdits", + component: PostView + }, { path: Routes.EDITOR, // TODO: Same as import name: "editor", diff --git a/cshub-server/src/components/pages/GetEditContent.ts b/cshub-server/src/components/pages/GetEditContent.ts index 760735a7..64744caf 100644 --- a/cshub-server/src/components/pages/GetEditContent.ts +++ b/cshub-server/src/components/pages/GetEditContent.ts @@ -12,6 +12,7 @@ import {GetEditContent, GetEditContentCallback} from "../../../../cshub-shared/a // @ts-ignore import Delta from "quill-delta/dist/Delta"; import moment, {Moment} from "moment"; +import {IEdit} from "../../../../cshub-shared/models"; app.post(GetEditContent.getURL, (req: Request, res: Response) => { @@ -26,33 +27,48 @@ app.post(GetEditContent.getURL, (req: Request, res: Response) => { .then((approved: postAccessType) => { if (approved.access) { query(` - SELECT T1.content, T1.datetime + SELECT T1.content, + T1.datetime, + T1.post, + T1.approved, + T1.id, + T1.datetime, + T3.id AS authorId, + T3.firstname AS authorFirstName, + T3.lastname AS authorLastName, + T3.avatar AS authorAvatar, + T3.admin AS authorAdmin FROM edits T1 INNER JOIN posts T2 ON T1.post = T2.id + INNER JOIN users T3 ON T1.editedBy = T3.id WHERE T2.hash = ? `, getEditContent.postHash) - .then((deltas: DatabaseResultSet) => { - - const deltaArray: {delta: Delta, datetime: Moment}[] = []; - - for (const delta of deltas.convertRowsToResultObjects()) { - deltaArray.push({ - delta: JSON.parse(delta.getStringFromDB("content")), - datetime: moment(delta.getStringFromDB("datetime")) + .then((edits: DatabaseResultSet) => { + + const editArray: IEdit[] = []; + + for (const edit of edits.convertRowsToResultObjects()) { + editArray.push({ + parentPostId: edit.getNumberFromDB("post"), + content: JSON.parse(edit.getStringFromDB("content")), + datetime: moment(edit.getStringFromDB("datetime")), + editedBy: { + id: edit.getNumberFromDB("authorId"), + firstname: edit.getStringFromDB("authorFirstName"), + lastname: edit.getStringFromDB("authorLastName"), + avatar: edit.getStringFromDB("authorAvatar"), + admin: edit.getNumberFromDB("authorAdmin") === 1 + }, + id: edit.getNumberFromDB("id"), + approved: edit.getNumberFromDB("approved") === 1 }); } - deltaArray.sort((left, right) => { + editArray.sort((left, right) => { return moment.utc(left.datetime).diff(moment.utc(right.datetime)) }); - const deltaSorted: Delta[] = []; - - for (const delta of deltaArray) { - deltaSorted.push(delta.delta); - } - - res.json(new GetEditContentCallback(deltaSorted)); + res.json(new GetEditContentCallback(editArray)); }) .catch(err => { logger.error(`Editing failed`); diff --git a/cshub-shared/api-calls/pages/GetEditContent.ts b/cshub-shared/api-calls/pages/GetEditContent.ts index 313ba822..c648ac92 100644 --- a/cshub-shared/api-calls/pages/GetEditContent.ts +++ b/cshub-shared/api-calls/pages/GetEditContent.ts @@ -1,12 +1,11 @@ import {IApiRequest} from "../../models/IApiRequest"; import {AuthRequests} from "../AuthRequests"; -// @ts-ignore -import Delta from "quill-delta/dist/Delta"; +import {IEdit} from "../../models"; export class GetEditContentCallback { - constructor(public deltas: Delta[]) {} + constructor(public edits: IEdit[]) {} } export class GetEditContent implements IApiRequest { diff --git a/cshub-shared/models/IEdit.ts b/cshub-shared/models/IEdit.ts index b09c5142..7a4bcc3e 100644 --- a/cshub-shared/models/IEdit.ts +++ b/cshub-shared/models/IEdit.ts @@ -1,12 +1,13 @@ import {IUserCensored} from "./IUser"; +// @ts-ignore +import Delta from "quill-delta/dist/Delta"; +import {Moment} from "moment"; export interface IEdit { parentPostId: number; - content: object; + content: Delta; editedBy: IUserCensored; approved: boolean; - approvedBy: IUserCensored; - rejectedReason: string; id: number; - datetime: string; + datetime: Moment; } diff --git a/cshub-shared/package-lock.json b/cshub-shared/package-lock.json index cac89d06..aea03fc7 100644 --- a/cshub-shared/package-lock.json +++ b/cshub-shared/package-lock.json @@ -22,14 +22,20 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=", + "dev": true + }, "quill-delta": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-4.1.0.tgz", "integrity": "sha512-GQi04cJRnGcUR3fN8ChjfJGdnCF297BVTb4kEgnlewiyu/PRnWZDchmiJoc9Whq+ZwHgbUbcVgrbGU/dQgOVFw==", "dev": true, "requires": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", + "deep-equal": "1.0.1", + "extend": "3.0.2", "fast-diff": "1.2.0" } } diff --git a/cshub-shared/package.json b/cshub-shared/package.json index 45012ae8..8c1e1a27 100644 --- a/cshub-shared/package.json +++ b/cshub-shared/package.json @@ -2,6 +2,7 @@ "name": "cshub-shared", "version": "0.1.0", "devDependencies": { - "quill-delta": "^4.1.0" + "quill-delta": "^4.1.0", + "moment": "^2.22.2" } } From 14c020a4ef345c011daa87c1cf25b688f1ca46b0 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 11:56:56 +0100 Subject: [PATCH 20/50] Post edit list works --- .../src/components/posts/PostEditsDialog.vue | 77 +++++++++---------- cshub-client/src/components/quill/Quill.vue | 18 +++-- 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/cshub-client/src/components/posts/PostEditsDialog.vue b/cshub-client/src/components/posts/PostEditsDialog.vue index 32d68d5f..afbfb03f 100644 --- a/cshub-client/src/components/posts/PostEditsDialog.vue +++ b/cshub-client/src/components/posts/PostEditsDialog.vue @@ -5,14 +5,14 @@ mdi-close - Settings + Edits
- +
-
@@ -64,8 +64,9 @@ data() { return { edits: [] as IEdit[], - showIndex: -1 - } + showIndex: -1, + initQuill: false + }; }, computed: { dialogActive: { @@ -80,47 +81,45 @@ }, watch: { dialogActive(newVal: boolean) { - ApiWrapper.sendPostRequest(new GetEditContent(this.postHash), (callbackData: GetEditContentCallback) => { + if (newVal) { + ApiWrapper.sendPostRequest(new GetEditContent(this.postHash), (callbackData: GetEditContentCallback) => { - let previousDelta = new Delta(JSON.parse(JSON.stringify(callbackData.edits[0].content))); + let previousDelta = new Delta(JSON.parse(JSON.stringify(callbackData.edits[0].content))); - for (let i = 1; i < callbackData.edits.length; i++) { + for (let i = 1; i < callbackData.edits.length; i++) { - let currContent = callbackData.edits[i].content; - let originalContent = JSON.parse(JSON.stringify(callbackData.edits[i].content)); + let currContent = callbackData.edits[i].content; + const originalContent = JSON.parse(JSON.stringify(callbackData.edits[i].content)); - for (const op of currContent.ops) { - // if the change was an insertion - if (op.hasOwnProperty('insert')) { - // color it green - op.attributes = { - background: "#cce8cc", - color: "#003700" - }; - } - // if the change was a deletion - if (op.hasOwnProperty('delete')) { - // keep the text - op.retain = op.delete; - delete op.delete; - // but color it red and struckthrough - op.attributes = { - background: "#e8cccc", - color: "#370000", - strike: true - }; + for (const op of currContent.ops) { + if (op.hasOwnProperty("insert")) { + op.attributes = { + ...op.attributes, + background: "#65e832", + color: "#003700" + }; + } + if (op.hasOwnProperty("delete")) { + op.retain = op.delete; + delete op.delete; + op.attributes = { + ...op.attributes, + background: "#e8553e", + color: "#370000", + strike: true + }; + } } - } - - currContent = previousDelta.compose(currContent); - previousDelta = previousDelta.compose(originalContent); - } + callbackData.edits[i].content = previousDelta.compose(currContent); + previousDelta = previousDelta.compose(originalContent); + } - console.log(callbackData.edits) - - this.edits = callbackData.edits; - }); + this.edits = callbackData.edits; + }); + } else { + this.showIndex = -1; + } } } }); diff --git a/cshub-client/src/components/quill/Quill.vue b/cshub-client/src/components/quill/Quill.vue index df7b968a..8175d618 100644 --- a/cshub-client/src/components/quill/Quill.vue +++ b/cshub-client/src/components/quill/Quill.vue @@ -203,14 +203,16 @@ mounted() { - this.postHashCacheItemID = `POSTDRAFT_${this.editorSetup.postHash === -1 ? "def" : this.editorSetup.postHash}`; - localForage.getItem(this.postHashCacheItemID) - .then((cachedDraft) => { - if (cachedDraft !== null) { - this.loadDraftDialog = true; - this.draftValue = cachedDraft; - } - }); + if (this.editorSetup.allowEdit) { + this.postHashCacheItemID = `POSTDRAFT_${this.editorSetup.postHash === -1 ? "def" : this.editorSetup.postHash}`; + localForage.getItem(this.postHashCacheItemID) + .then((cachedDraft) => { + if (cachedDraft !== null) { + this.loadDraftDialog = true; + this.draftValue = cachedDraft; + } + }); + } logStringConsole("Mounted quill with edit: " + this.editorSetup.allowEdit); From b95f577094b8315ce69460329d66139d96e17bca Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 11:58:30 +0100 Subject: [PATCH 21/50] Fixed linting warnings --- cshub-client/src/components/posts/Post.vue | 1 - cshub-client/src/components/posts/PostEditsDialog.vue | 2 +- cshub-client/src/views/posts/PostView.vue | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index 2d92672e..af21103f 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -252,7 +252,6 @@ }); }, returnToPostMenu() { - console.log(this.previousTopicURL); this.$router.push(this.previousTopicURL); }, getParentTopic(child: ITopic, topics: ITopic[]): ITopic { diff --git a/cshub-client/src/components/posts/PostEditsDialog.vue b/cshub-client/src/components/posts/PostEditsDialog.vue index afbfb03f..c3801898 100644 --- a/cshub-client/src/components/posts/PostEditsDialog.vue +++ b/cshub-client/src/components/posts/PostEditsDialog.vue @@ -88,7 +88,7 @@ for (let i = 1; i < callbackData.edits.length; i++) { - let currContent = callbackData.edits[i].content; + const currContent = callbackData.edits[i].content; const originalContent = JSON.parse(JSON.stringify(callbackData.edits[i].content)); for (const op of currContent.ops) { diff --git a/cshub-client/src/views/posts/PostView.vue b/cshub-client/src/views/posts/PostView.vue index dc0639e8..7370fe2c 100644 --- a/cshub-client/src/views/posts/PostView.vue +++ b/cshub-client/src/views/posts/PostView.vue @@ -66,7 +66,7 @@ if (this.$router.currentRoute.fullPath.includes(Routes.POST)) { this.currentTopicHash = -1; if (this.postHashes.length === 0) { - this.postHashes = [currentHash] + this.postHashes = [currentHash]; } this.currentPostHash = currentHash; } else if (this.$router.currentRoute.fullPath.includes(Routes.TOPIC)) { From 7a18d1840d88aba03231875028b1d81b0d4b42ed Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 12:00:28 +0100 Subject: [PATCH 22/50] Added npm install to yml for travis --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7e5f1960..7f92359a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,9 @@ matrix: - "8" - "10" before_script: + - cd cshub-shared + - npm install + - cd .. - cd cshub-client script: - npm install @@ -19,6 +22,9 @@ matrix: - "8" - "10" before_script: + - cd cshub-shared + - npm install + - cd .. - cd cshub-server/src/ - cp SettingsBaseline.ts settings.ts - cd .. From 2118b83316527e01acafb2fddf39fdcd4f7ee957 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 14:07:57 +0100 Subject: [PATCH 23/50] Start on refactor to class based components --- cshub-client/package-lock.json | 13 + cshub-client/package.json | 2 + .../src/components/admin/UserTable.vue | 93 ++-- .../src/components/global/NavDrawer.vue | 132 +++-- .../src/components/global/NavDrawerItem.vue | 24 +- .../src/components/global/Toolbar.vue | 45 +- cshub-client/src/components/posts/Post.vue | 507 ++++++++++-------- .../src/components/posts/PostEditsDialog.vue | 2 +- cshub-client/tsconfig.json | 1 + 9 files changed, 456 insertions(+), 363 deletions(-) diff --git a/cshub-client/package-lock.json b/cshub-client/package-lock.json index 3d0e3292..7ad58c60 100644 --- a/cshub-client/package-lock.json +++ b/cshub-client/package-lock.json @@ -11441,6 +11441,11 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.17.tgz", "integrity": "sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ==" }, + "vue-class-component": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-6.3.2.tgz", + "integrity": "sha512-cH208IoM+jgZyEf/g7mnFyofwPDJTM/QvBNhYMjqGB8fCsRyTf68rH2ISw/G20tJv+5mIThQ3upKwoL4jLTr1A==" + }, "vue-cli-plugin-vuetify": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-0.2.0.tgz", @@ -11466,6 +11471,14 @@ "vue-style-loader": "^4.1.0" } }, + "vue-property-decorator": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-7.2.0.tgz", + "integrity": "sha512-sCI6NVM3tEDg+mpZrQlgkddtxd9LbFWetue8D+nqO3agfSLz0KoC/UIi2P1l5E0TDhcUeIXS9rasuP2HWg+L4w==", + "requires": { + "vue-class-component": "^6.2.0" + } + }, "vue-router": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.1.tgz", diff --git a/cshub-client/package.json b/cshub-client/package.json index 2be4fe8b..71d3edcd 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -21,6 +21,8 @@ "rxjs": "^6.3.3", "vee-validate": "^2.1.0-beta.9", "vue": "^2.5.17", + "vue-class-component": "^6.3.2", + "vue-property-decorator": "^7.2.0", "vue-router": "^3.0.1", "vuetify": "^1.3.0-alpha.2", "vuex": "^3.0.1", diff --git a/cshub-client/src/components/admin/UserTable.vue b/cshub-client/src/components/admin/UserTable.vue index 1886a1fa..64185e3c 100644 --- a/cshub-client/src/components/admin/UserTable.vue +++ b/cshub-client/src/components/admin/UserTable.vue @@ -24,54 +24,65 @@ \ No newline at end of file diff --git a/cshub-client/src/components/global/NavDrawer.vue b/cshub-client/src/components/global/NavDrawer.vue index c357b70f..46184d64 100644 --- a/cshub-client/src/components/global/NavDrawer.vue +++ b/cshub-client/src/components/global/NavDrawer.vue @@ -60,12 +60,17 @@ - \ No newline at end of file diff --git a/cshub-client/src/components/global/NavDrawerItem.vue b/cshub-client/src/components/global/NavDrawerItem.vue index 8fb75a5a..b43ba34d 100644 --- a/cshub-client/src/components/global/NavDrawerItem.vue +++ b/cshub-client/src/components/global/NavDrawerItem.vue @@ -1,7 +1,5 @@ @@ -28,7 +23,7 @@ import {Component} from "vue-property-decorator"; import UserTable from "../../components/admin/UserTable.vue"; - import Post from "../../components/posts/Post.vue"; + import PostList from "../../components/posts/PostList.vue"; import {ApiWrapper, logObjectConsole} from "../../utilities"; @@ -39,7 +34,7 @@ @Component({ name: "AdminDashboard", - components: {UserTable, Post}, + components: {UserTable, PostList}, }) export default class AdminDashboard extends Vue { @@ -47,19 +42,20 @@ * Data */ private postHashes: number[] = []; + private currPostHashes: number[] = []; /** * Lifecycle hooks */ private mounted() { - this.getHashes(0); + this.getHashes(); } /** * Methods */ - private getHashes(startIndex: number) { - ApiWrapper.sendPostRequest(new GetUnverifiedPosts(startIndex), (callbackData: GetUnverifiedPostsCallBack) => { + private getHashes() { + ApiWrapper.sendPostRequest(new GetUnverifiedPosts(), (callbackData: GetUnverifiedPostsCallBack) => { this.postHashes = callbackData.postHashes; logObjectConsole(callbackData.postHashes, "User dashboard posthashes"); }); diff --git a/cshub-client/src/views/user/UserDashboard.vue b/cshub-client/src/views/user/UserDashboard.vue index 64242a0b..e3750a2f 100644 --- a/cshub-client/src/views/user/UserDashboard.vue +++ b/cshub-client/src/views/user/UserDashboard.vue @@ -81,10 +81,7 @@ Your posts -
- -
-

No posts found!

+ @@ -92,7 +89,7 @@ import Vue from "vue"; import {Component} from "vue-property-decorator"; - import Post from "../../components/posts/Post.vue"; + import PostList from "../../components/posts/PostList.vue"; import userState from "../../store/user"; @@ -109,7 +106,7 @@ @Component({ name: "UserDashboard", inject: ["$validator"], - components: {Post}, + components: {PostList}, }) export default class UserDashboard extends Vue { @@ -136,14 +133,14 @@ * Lifecycle hooks */ private mounted() { - this.getHashes(0); + this.getHashes(); } /** * Methods */ - private getHashes(startIndex: number) { - ApiWrapper.sendPostRequest(new GetUserPosts(startIndex), (callbackData: GetUserPostsCallback) => { + private getHashes() { + ApiWrapper.sendPostRequest(new GetUserPosts(), (callbackData: GetUserPostsCallback) => { this.postHashes = callbackData.postHashes; logObjectConsole(callbackData.postHashes, "User dashboard posthashes"); }); diff --git a/cshub-server/src/components/pages/GetTopicPosts.ts b/cshub-server/src/components/pages/GetTopicPosts.ts index 12984d91..63d858e8 100644 --- a/cshub-server/src/components/pages/GetTopicPosts.ts +++ b/cshub-server/src/components/pages/GetTopicPosts.ts @@ -54,7 +54,7 @@ app.post(GetTopicPosts.getURL, (req: Request, res: Response) => { WHERE approved = 1 AND T2.hash IN (?) ORDER BY datetime DESC - `, topicHashes, topicPostsRequest.startFromResult) + `, topicHashes) .then((posts: DatabaseResultSet) => { const postHashes: number[] = []; diff --git a/cshub-server/src/components/pages/admin/GetUnverifiedPosts.ts b/cshub-server/src/components/pages/admin/GetUnverifiedPosts.ts index 6e918f73..3bc840ca 100644 --- a/cshub-server/src/components/pages/admin/GetUnverifiedPosts.ts +++ b/cshub-server/src/components/pages/admin/GetUnverifiedPosts.ts @@ -19,7 +19,7 @@ app.post(GetUnverifiedPosts.getURL, (req: Request, res: Response) => { FROM posts WHERE approved = 0 ORDER BY datetime DESC - `, getUnverifiedPostsRequest.startFromResult) + `) .then((result: DatabaseResultSet) => { const hashes: number[] = []; diff --git a/cshub-server/src/components/pages/user/GetUserPosts.ts b/cshub-server/src/components/pages/user/GetUserPosts.ts index 77989991..d746dd27 100644 --- a/cshub-server/src/components/pages/user/GetUserPosts.ts +++ b/cshub-server/src/components/pages/user/GetUserPosts.ts @@ -16,7 +16,7 @@ app.post(GetUserPosts.getURL, (req: Request, res: Response) => { FROM posts WHERE author = ? ORDER BY datetime DESC - `, token.tokenObj.user.id, userDashboardRequest.startFromResult) + `, token.tokenObj.user.id) .then((result: DatabaseResultSet) => { const hashes: number[] = []; diff --git a/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts b/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts index af1c6735..c8703dba 100644 --- a/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts +++ b/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts @@ -12,5 +12,5 @@ export class GetUnverifiedPosts implements IApiRequest { public static getURL: string = AdminRequests.GETUNVERIFIEDPOSTS; public URL: string = GetUnverifiedPosts.getURL; - constructor(public startFromResult: number) {} + constructor() {} } diff --git a/cshub-shared/api-calls/pages/GetTopicPosts.ts b/cshub-shared/api-calls/pages/GetTopicPosts.ts index d3cc0db1..eb3595f8 100644 --- a/cshub-shared/api-calls/pages/GetTopicPosts.ts +++ b/cshub-shared/api-calls/pages/GetTopicPosts.ts @@ -15,7 +15,6 @@ export class GetTopicPosts implements IApiRequest { public URL: string = GetTopicPosts.getURL; constructor( - public topicHash: number, - public startFromResult: number + public topicHash: number ) {} } diff --git a/cshub-shared/api-calls/pages/user/GetUserPosts.ts b/cshub-shared/api-calls/pages/user/GetUserPosts.ts index e52ffc9f..29933353 100644 --- a/cshub-shared/api-calls/pages/user/GetUserPosts.ts +++ b/cshub-shared/api-calls/pages/user/GetUserPosts.ts @@ -14,5 +14,5 @@ export class GetUserPosts implements IApiRequest { public static getURL: string = AuthRequests.DASHBOARD; public URL: string = GetUserPosts.getURL; - constructor(public startFromResult: number) {} + constructor() {} } From 2678f80fabb458844c242639021fb20e396f1496 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 18:16:54 +0100 Subject: [PATCH 32/50] Fixed linting issues --- cshub-client/src/components/posts/PostList.vue | 2 +- cshub-shared/api-calls/admin/GetUnverifiedPosts.ts | 2 -- cshub-shared/api-calls/pages/user/GetUserPosts.ts | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cshub-client/src/components/posts/PostList.vue b/cshub-client/src/components/posts/PostList.vue index 00be7ff6..dd702ce2 100644 --- a/cshub-client/src/components/posts/PostList.vue +++ b/cshub-client/src/components/posts/PostList.vue @@ -14,7 +14,7 @@ import {Route} from "vue-router"; import Post from "./Post.vue"; - import PostPagination from "./PostPagination"; + import PostPagination from "./PostPagination.vue"; import uiState from "../../store/ui"; import {Routes} from "../../views/router/router"; diff --git a/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts b/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts index c8703dba..d2bebf54 100644 --- a/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts +++ b/cshub-shared/api-calls/admin/GetUnverifiedPosts.ts @@ -11,6 +11,4 @@ export class GetUnverifiedPostsCallBack { export class GetUnverifiedPosts implements IApiRequest { public static getURL: string = AdminRequests.GETUNVERIFIEDPOSTS; public URL: string = GetUnverifiedPosts.getURL; - - constructor() {} } diff --git a/cshub-shared/api-calls/pages/user/GetUserPosts.ts b/cshub-shared/api-calls/pages/user/GetUserPosts.ts index 29933353..0f33bc3b 100644 --- a/cshub-shared/api-calls/pages/user/GetUserPosts.ts +++ b/cshub-shared/api-calls/pages/user/GetUserPosts.ts @@ -13,6 +13,4 @@ export class GetUserPosts implements IApiRequest { public static getURL: string = AuthRequests.DASHBOARD; public URL: string = GetUserPosts.getURL; - - constructor() {} } From 6bd87b8af1f8a7d37874f4f83d4a9dc8946f6be0 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 20:30:49 +0100 Subject: [PATCH 33/50] Search working & pagination improvements --- cshub-client/src/App.vue | 4 +- .../src/components/global/Toolbar.vue | 24 ++++- .../src/components/posts/PostList.vue | 28 ++++-- .../src/components/posts/PostPagination.vue | 4 +- cshub-client/src/store/data/getters.ts | 2 + cshub-client/src/store/data/index.ts | 6 +- cshub-client/src/store/data/mutations.ts | 4 + cshub-client/src/store/data/state.ts | 4 +- cshub-client/src/views/posts/PostsSearch.vue | 92 +++++++++++++++++++ cshub-client/src/views/router/router.ts | 7 ++ .../src/views/user/AdminDashboard.vue | 1 - .../src/components/pages/GetSearchPosts.ts | 46 ++++++++++ cshub-server/src/components/pages/index.ts | 1 + cshub-shared/api-calls/NonAuthRequests.ts | 1 + .../api-calls/pages/GetSearchPosts.ts | 17 ++++ cshub-shared/api-calls/pages/index.ts | 2 +- 16 files changed, 228 insertions(+), 15 deletions(-) create mode 100644 cshub-client/src/views/posts/PostsSearch.vue create mode 100644 cshub-server/src/components/pages/GetSearchPosts.ts create mode 100644 cshub-shared/api-calls/pages/GetSearchPosts.ts diff --git a/cshub-client/src/App.vue b/cshub-client/src/App.vue index 945b4240..f9c1f1ee 100644 --- a/cshub-client/src/App.vue +++ b/cshub-client/src/App.vue @@ -90,7 +90,9 @@ const excludeTransition = (from.fullPath === Routes.INDEX && to.name === "post") || (to.fullPath === Routes.INDEX && from.name === "post") || (from.name === "user" && to.name === "post") || - (from.name === "admin" && to.name === "post"); + (from.name === "admin" && to.name === "post") || + (to.fullPath === Routes.SEARCH) || + (from.fullPath === Routes.SEARCH); if (excludeTransition) { this.activeclass = ""; diff --git a/cshub-client/src/components/global/Toolbar.vue b/cshub-client/src/components/global/Toolbar.vue index e881fd41..177d628e 100644 --- a/cshub-client/src/components/global/Toolbar.vue +++ b/cshub-client/src/components/global/Toolbar.vue @@ -3,6 +3,7 @@
CS Hub
import Vue from "vue"; + import {Component, Watch} from "vue-property-decorator"; import uiState from "../../store/ui/index"; + import dataState from "../../store/data"; import router, {Routes} from "../../views/router/router"; - import {Component} from "vue-property-decorator"; @Component({ name: "Toolbar" @@ -37,6 +39,14 @@ uiState.setDrawerState(newValue); } + get searchQuery(): string { + return dataState.searchQuery; + } + + set searchQuery(newValue: string) { + dataState.setSearchQuery(newValue); + } + /** * Methods */ @@ -44,6 +54,18 @@ router.push(Routes.INDEX); } + /** + * Watchers + */ + @Watch("searchQuery") + private searchQueryChanged() { + if (this.searchQuery.length >= 3) { + if (this.$route.fullPath !== Routes.SEARCH) { + this.$router.push(Routes.SEARCH); + } + } + } + } diff --git a/cshub-client/src/components/posts/PostList.vue b/cshub-client/src/components/posts/PostList.vue index dd702ce2..9d38eb0f 100644 --- a/cshub-client/src/components/posts/PostList.vue +++ b/cshub-client/src/components/posts/PostList.vue @@ -1,10 +1,10 @@ @@ -30,8 +30,9 @@ */ @Prop(null) private postHashes: number[]; - private currPostHashes: number[] = []; + private paginationStartIndex: number = 0; private currentPostHash = -1; + private range = 5; // Just the default value /** * Computed properties @@ -59,7 +60,7 @@ @Watch("postHashes") private postHashesChanged(hashes: number[]) { - if (Math.ceil(hashes.length / 5) < this.paginationPageState) { + if (Math.ceil(hashes.length / this.range) < this.paginationPageState) { this.paginationPageState = 1; } this.updateCurrHashes(); @@ -69,7 +70,9 @@ * Lifecycle hooks */ private mounted() { + window.addEventListener("resize", this.windowHeightChanged); this.doOnRouteChange(); + this.windowHeightChanged(); } private beforeDestroy() { @@ -79,9 +82,20 @@ /** * Methods */ + private windowHeightChanged() { + // Getting the window height, subtracting 300 pixels. Then dividing by 100 for a very wild guess of amount of possible cards on this screen + this.range = Math.floor((window.innerHeight - 350) / 100); + } + + private showCurrentPost(index: number, postHash: number): boolean { + + const inIndexRange = index >= this.paginationStartIndex && index < (this.paginationStartIndex + this.range); + + return (this.currentPostHash === -1 && inIndexRange) || this.currentPostHash === postHash; + } + private updateCurrHashes() { - const paginationPageState = (this.paginationPageState - 1) * 5; - this.currPostHashes = this.postHashes.slice(paginationPageState, paginationPageState + 5); + this.paginationStartIndex = (this.paginationPageState - 1) * this.range; } private doOnRouteChange() { diff --git a/cshub-client/src/components/posts/PostPagination.vue b/cshub-client/src/components/posts/PostPagination.vue index 55f82295..f90aa24c 100644 --- a/cshub-client/src/components/posts/PostPagination.vue +++ b/cshub-client/src/components/posts/PostPagination.vue @@ -7,7 +7,7 @@ @@ -31,8 +31,10 @@ /** * Data */ + @Prop(Number) private range: number; @Prop(Number) private elements: number; + /** * Computed properties */ diff --git a/cshub-client/src/store/data/getters.ts b/cshub-client/src/store/data/getters.ts index a2ef2398..e210def8 100644 --- a/cshub-client/src/store/data/getters.ts +++ b/cshub-client/src/store/data/getters.ts @@ -3,3 +3,5 @@ import {dataStoreBuilder} from "./state"; export const topics = dataStoreBuilder.read((state) => state.topics, "topics"); export const hasConnection = dataStoreBuilder.read((state) => state.hasConnection, "hasConnection"); + +export const searchQuery = dataStoreBuilder.read((state) => state.searchQuery, "searchQuery"); diff --git a/cshub-client/src/store/data/index.ts b/cshub-client/src/store/data/index.ts index 36c5afb0..e7dd2408 100644 --- a/cshub-client/src/store/data/index.ts +++ b/cshub-client/src/store/data/index.ts @@ -1,15 +1,17 @@ import {dataStateGetter, dataStoreBuilder} from "./state"; -import {hasConnection, topics} from "./getters"; -import {setConnection, setTopics} from "./mutations"; +import {hasConnection, searchQuery, topics} from "./getters"; +import {setConnection, setSearchQuery, setTopics} from "./mutations"; const dataState = { get state() { return dataStateGetter(); }, get topics() { return topics(); }, get hasConnection() { return hasConnection(); }, + get searchQuery() { return searchQuery(); }, setConnection: dataStoreBuilder.commit(setConnection), setTopics: dataStoreBuilder.commit(setTopics), + setSearchQuery: dataStoreBuilder.commit(setSearchQuery) }; diff --git a/cshub-client/src/store/data/mutations.ts b/cshub-client/src/store/data/mutations.ts index ee37cb84..bf026482 100644 --- a/cshub-client/src/store/data/mutations.ts +++ b/cshub-client/src/store/data/mutations.ts @@ -10,3 +10,7 @@ export const setTopics = (state: IDataState, payload: ITopic[]) => { export const setConnection = (state: IDataState, payload: boolean) => { state.hasConnection = payload; }; + +export const setSearchQuery = (state: IDataState, payload: string) => { + state.searchQuery = payload; +}; diff --git a/cshub-client/src/store/data/state.ts b/cshub-client/src/store/data/state.ts index 35aff449..ccf78e1c 100644 --- a/cshub-client/src/store/data/state.ts +++ b/cshub-client/src/store/data/state.ts @@ -5,11 +5,13 @@ import {IPost, ITopic} from "../../../../cshub-shared/models"; export interface IDataState { topics: ITopic[]; hasConnection: boolean; + searchQuery: string; } export const DataState: IDataState = { topics: null, - hasConnection: true + hasConnection: true, + searchQuery: "" }; export const dataStoreBuilder = getStoreBuilder().module("data", DataState); diff --git a/cshub-client/src/views/posts/PostsSearch.vue b/cshub-client/src/views/posts/PostsSearch.vue new file mode 100644 index 00000000..bb36bb74 --- /dev/null +++ b/cshub-client/src/views/posts/PostsSearch.vue @@ -0,0 +1,92 @@ + + + + + \ No newline at end of file diff --git a/cshub-client/src/views/router/router.ts b/cshub-client/src/views/router/router.ts index b17f32dd..e59c7bfc 100644 --- a/cshub-client/src/views/router/router.ts +++ b/cshub-client/src/views/router/router.ts @@ -10,6 +10,7 @@ import UserDashboard from "../user/UserDashboard.vue"; import PostView from "../posts/PostView.vue"; import PostCreate from "../posts/PostCreate.vue"; +import PostsSearch from "../posts/PostsSearch.vue"; import {userBeforeEnter} from "./guards/userDashboardGuard"; import {adminBeforeEnter} from "./guards/adminDashboardGuard"; @@ -35,6 +36,7 @@ export class Routes { public static readonly TOPIC = "/topic"; public static readonly USERDASHBOARD = "/user"; public static readonly ADMINDASHBOARD = "/admin"; + public static readonly SEARCH = "/search"; } const router = new Router({ @@ -89,6 +91,11 @@ const router = new Router({ name: "topic", component: PostView }, + { + path: Routes.SEARCH, + name: "search", + component: PostsSearch + }, { path: Routes.USERDASHBOARD, name: "user", diff --git a/cshub-client/src/views/user/AdminDashboard.vue b/cshub-client/src/views/user/AdminDashboard.vue index 267c5c65..717638c6 100644 --- a/cshub-client/src/views/user/AdminDashboard.vue +++ b/cshub-client/src/views/user/AdminDashboard.vue @@ -42,7 +42,6 @@ * Data */ private postHashes: number[] = []; - private currPostHashes: number[] = []; /** * Lifecycle hooks diff --git a/cshub-server/src/components/pages/GetSearchPosts.ts b/cshub-server/src/components/pages/GetSearchPosts.ts new file mode 100644 index 00000000..0d69c26c --- /dev/null +++ b/cshub-server/src/components/pages/GetSearchPosts.ts @@ -0,0 +1,46 @@ +import {app, logger} from "../../."; +import {Request, Response} from "express"; +import { + GetSearchPosts, GetSearchPostsCallback +} from "../../../../cshub-shared/api-calls"; + +import {DatabaseResultSet, query} from "../../utilities/DatabaseConnection"; +import {checkTokenValidity} from "../../auth/AuthMiddleware"; + +app.post(GetSearchPosts.getURL, (req: Request, res: Response) => { + + const searchPostRequest = req.body as GetSearchPosts; + + if (searchPostRequest.query.length >= 3) { + const user = checkTokenValidity(req); + const userId = user.valid ? user.tokenObj.user.id : -1; + + query(` + SELECT hash + FROM edits T1 + INNER JOIN posts T2 ON T1.post = T2.id + WHERE htmlContent LIKE ? + AND (T2.author = ? OR (T2.approved = 1 AND T1.approved = 1) OR (SELECT admin FROM users WHERE id = ?) = 1) + ORDER BY T2.upvotes DESC, T2.datetime DESC + LIMIT 5 + `, `%${searchPostRequest.query}%`, userId, userId) + .then((hashes: DatabaseResultSet) => { + + console.log(userId) + const hashesArray: number[] = []; + + for (const hash of hashes.convertRowsToResultObjects()) { + hashesArray.push(hash.getNumberFromDB("hash")); + } + + res.json(new GetSearchPostsCallback(hashesArray)); + }) + .catch((err) => { + logger.error("Error at GetSearchPosts"); + logger.error(err); + }) + } else { + res.status(500).send(); + } + +}); \ No newline at end of file diff --git a/cshub-server/src/components/pages/index.ts b/cshub-server/src/components/pages/index.ts index 0630c4c0..fe126f45 100644 --- a/cshub-server/src/components/pages/index.ts +++ b/cshub-server/src/components/pages/index.ts @@ -6,6 +6,7 @@ import "./CreateTopic"; import "./EditPost"; import "./GetPostContent"; import "./GetEditContent"; +import "./GetSearchPosts"; import "./admin"; import "./user"; diff --git a/cshub-shared/api-calls/NonAuthRequests.ts b/cshub-shared/api-calls/NonAuthRequests.ts index c3426659..c8920cd9 100644 --- a/cshub-shared/api-calls/NonAuthRequests.ts +++ b/cshub-shared/api-calls/NonAuthRequests.ts @@ -9,4 +9,5 @@ export class NonAuthRequests { public static readonly TOPICS: string = "/0/topics"; public static readonly VERIFYTOKEN: string = "/0/verifytoken"; public static readonly VERIFYMAIL: string = "/0/verifymail"; + public static readonly SEARCH: string = "/0/search"; } diff --git a/cshub-shared/api-calls/pages/GetSearchPosts.ts b/cshub-shared/api-calls/pages/GetSearchPosts.ts new file mode 100644 index 00000000..2b19415e --- /dev/null +++ b/cshub-shared/api-calls/pages/GetSearchPosts.ts @@ -0,0 +1,17 @@ +import {IApiRequest} from "../../models/IApiRequest"; +import {NonAuthRequests} from "../NonAuthRequests"; + +export class GetSearchPostsCallback { + + constructor(public hashes: number[]) {} +} + +export class GetSearchPosts implements IApiRequest { + + public static getURL: string = NonAuthRequests.SEARCH; + public URL: string = GetSearchPosts.getURL; + + constructor( + public query: string + ) {} +} diff --git a/cshub-shared/api-calls/pages/index.ts b/cshub-shared/api-calls/pages/index.ts index 8acddc11..ede1ac9e 100644 --- a/cshub-shared/api-calls/pages/index.ts +++ b/cshub-shared/api-calls/pages/index.ts @@ -6,6 +6,6 @@ export * from "./CreateTopic"; export * from "./EditPost"; export * from "./GetPostContent"; export * from "./GetEditContent"; - +export * from "./GetSearchPosts"; export * from "./user"; From c139f9ee312b5f1d52c9437e33875e09c6af04d5 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 20:55:40 +0100 Subject: [PATCH 34/50] Some performance improvements and linting issues fixed --- cshub-client/package-lock.json | 306 +++++++++--------- cshub-client/package.json | 2 + cshub-client/src/views/posts/PostView.vue | 4 +- cshub-client/src/views/posts/PostsSearch.vue | 2 +- .../src/components/pages/GetSearchPosts.ts | 1 - 5 files changed, 153 insertions(+), 162 deletions(-) diff --git a/cshub-client/package-lock.json b/cshub-client/package-lock.json index 73cff8e0..d744ed04 100644 --- a/cshub-client/package-lock.json +++ b/cshub-client/package-lock.json @@ -826,6 +826,11 @@ "integrity": "sha1-p9u5gfG8icixtef6ihziYXqy81g=", "dev": true }, + "@types/lodash": { + "version": "4.14.117", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.117.tgz", + "integrity": "sha512-xyf2m6tRbz8qQKcxYZa7PA4SllYcay+eh25DN3jmNYY6gSTL7Htc/bttVdkqj2wfJGbeWlQiX8pIyJpKU+tubw==" + }, "@types/sizzle": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", @@ -1022,9 +1027,9 @@ "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", - "source-map": "0.6.1", - "supports-color": "5.5.0" + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" }, "dependencies": { "source-map": { @@ -1041,9 +1046,9 @@ "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", "dev": true, "requires": { - "dot-prop": "4.2.0", - "indexes-of": "1.0.1", - "uniq": "1.0.1" + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" } } } @@ -3058,12 +3063,12 @@ "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", "dev": true, "requires": { - "array-union": "1.0.2", - "dir-glob": "2.0.0", - "glob": "7.1.3", - "ignore": "3.3.10", - "pify": "3.0.0", - "slash": "1.0.0" + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" } }, "is-extglob": { @@ -3216,9 +3221,9 @@ "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", - "source-map": "0.6.1", - "supports-color": "5.5.0" + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" } }, "source-map": { @@ -3270,9 +3275,9 @@ "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", "dev": true, "requires": { - "regenerate": "1.4.0", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" } }, "regjsgen": { @@ -3287,7 +3292,7 @@ "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { - "jsesc": "0.5.0" + "jsesc": "~0.5.0" } } } @@ -4863,23 +4868,21 @@ "dev": true, "optional": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -4892,20 +4895,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -4946,7 +4946,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "^2.2.1" } }, "fs.realpath": { @@ -4961,14 +4961,14 @@ "dev": true, "optional": true, "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "glob": { @@ -4977,12 +4977,12 @@ "dev": true, "optional": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "has-unicode": { @@ -4997,7 +4997,7 @@ "dev": true, "optional": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "^2.1.0" } }, "ignore-walk": { @@ -5006,7 +5006,7 @@ "dev": true, "optional": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "inflight": { @@ -5015,15 +5015,14 @@ "dev": true, "optional": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5035,9 +5034,8 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "isarray": { @@ -5050,25 +5048,22 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" } }, "minizlib": { @@ -5077,14 +5072,13 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "^2.2.1" } }, "mkdirp": { "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5101,9 +5095,9 @@ "dev": true, "optional": true, "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.21", - "sax": "1.2.4" + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" } }, "node-pre-gyp": { @@ -5112,16 +5106,16 @@ "dev": true, "optional": true, "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.0", - "nopt": "4.0.1", - "npm-packlist": "1.1.10", - "npmlog": "4.1.2", - "rc": "1.2.7", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.1" + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" } }, "nopt": { @@ -5130,8 +5124,8 @@ "dev": true, "optional": true, "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "npm-bundled": { @@ -5146,8 +5140,8 @@ "dev": true, "optional": true, "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" } }, "npmlog": { @@ -5156,17 +5150,16 @@ "dev": true, "optional": true, "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5178,9 +5171,8 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "os-homedir": { @@ -5201,8 +5193,8 @@ "dev": true, "optional": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "path-is-absolute": { @@ -5223,10 +5215,10 @@ "dev": true, "optional": true, "requires": { - "deep-extend": "0.5.1", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -5243,13 +5235,13 @@ "dev": true, "optional": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "rimraf": { @@ -5258,7 +5250,7 @@ "dev": true, "optional": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "safe-buffer": { @@ -5300,11 +5292,10 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -5313,7 +5304,7 @@ "dev": true, "optional": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { @@ -5321,7 +5312,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-json-comments": { @@ -5336,13 +5327,13 @@ "dev": true, "optional": true, "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.2.4", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" } }, "util-deprecate": { @@ -5357,7 +5348,7 @@ "dev": true, "optional": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2" } }, "wrappy": { @@ -6952,8 +6943,7 @@ "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "lodash._reinterpolate": { "version": "3.0.0", @@ -7283,10 +7273,10 @@ "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "fast-deep-equal": { @@ -7307,9 +7297,9 @@ "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", "dev": true, "requires": { - "ajv": "6.5.4", - "ajv-errors": "1.0.0", - "ajv-keywords": "3.2.0" + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" } } } @@ -8407,9 +8397,9 @@ "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", - "source-map": "0.6.1", - "supports-color": "5.5.0" + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" } }, "source-map": { @@ -9427,10 +9417,10 @@ "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "dev": true, "requires": { - "boolbase": "1.0.0", - "css-what": "2.1.0", + "boolbase": "~1.0.0", + "css-what": "2.1", "domutils": "1.5.1", - "nth-check": "1.0.1" + "nth-check": "~1.0.1" } }, "domutils": { @@ -9439,8 +9429,8 @@ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" } }, "strip-ansi": { @@ -9449,7 +9439,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "utila": { @@ -10085,7 +10075,7 @@ "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", "dev": true, "requires": { - "websocket-driver": "0.7.0" + "websocket-driver": ">=0.5.1" } }, "ms": { @@ -11319,10 +11309,10 @@ "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "fast-deep-equal": { @@ -11343,9 +11333,9 @@ "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", "dev": true, "requires": { - "ajv": "6.5.4", - "ajv-errors": "1.0.0", - "ajv-keywords": "3.2.0" + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" } } } @@ -11615,10 +11605,10 @@ "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "arr-diff": { @@ -12008,10 +11998,10 @@ "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ansi-regex": { @@ -12038,9 +12028,9 @@ "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", "dev": true, "requires": { - "ajv": "6.5.4", - "ajv-errors": "1.0.0", - "ajv-keywords": "3.2.0" + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" } }, "strip-ansi": { @@ -12049,7 +12039,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -12182,9 +12172,9 @@ "integrity": "sha512-O7Uw+w/zEWgbL6OcHbyACKSj0PkQeUgmehdoXVSxt92QFCq4+1390Rwh5moI2K/OgC7D8RHRZqHZxT2husMJHA==", "dev": true, "requires": { - "hoek": "4.2.1", - "isemail": "3.1.3", - "topo": "2.0.2" + "hoek": "4.x.x", + "isemail": "3.x.x", + "topo": "2.x.x" } }, "topo": { @@ -12193,7 +12183,7 @@ "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=", "dev": true, "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } } } diff --git a/cshub-client/package.json b/cshub-client/package.json index 505a22d3..5150f85e 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -10,11 +10,13 @@ }, "dependencies": { "@babel/polyfill": "^7.0.0-rc.1", + "@types/lodash": "^4.14.117", "animate.css": "^3.7.0", "axios": "^0.18.0", "jquery": "^3.3.1", "katex": "^0.7.1", "localforage": "^1.7.3", + "lodash": "^4.17.11", "moment": "^2.22.2", "quill-delta": "^4.1.0", "register-service-worker": "^1.0.0", diff --git a/cshub-client/src/views/posts/PostView.vue b/cshub-client/src/views/posts/PostView.vue index 25107b76..734e805e 100644 --- a/cshub-client/src/views/posts/PostView.vue +++ b/cshub-client/src/views/posts/PostView.vue @@ -15,6 +15,7 @@ import {AxiosError} from "axios"; import {Route} from "vue-router"; import {Component, Watch} from "vue-property-decorator"; + import _ from "lodash"; import PostList from "../../components/posts/PostList.vue"; @@ -28,7 +29,6 @@ import {ApiWrapper, logObjectConsole, logStringConsole} from "../../utilities/index"; import {CacheTypes} from "../../utilities/cache-types"; - @Component({ name: "PostView", components: {PostList} @@ -105,7 +105,7 @@ ApiWrapper.sendPostRequest(new GetTopicPosts(topicHash), (callbackData: GetTopicPostsCallBack) => { - if (callbackData.postHashes !== this.postHashes) { + if (!_.isEqual(callbackData.postHashes, this.postHashes)) { this.postHashes = callbackData.postHashes; logObjectConsole(callbackData.postHashes, "Topic posthashes"); diff --git a/cshub-client/src/views/posts/PostsSearch.vue b/cshub-client/src/views/posts/PostsSearch.vue index bb36bb74..fdb051f4 100644 --- a/cshub-client/src/views/posts/PostsSearch.vue +++ b/cshub-client/src/views/posts/PostsSearch.vue @@ -81,7 +81,7 @@ private getSearchResults() { ApiWrapper.sendPostRequest(new GetSearchPosts(this.searchQuery), (result: GetSearchPostsCallback) => { this.postHashes = result.hashes; - }) + }); } } diff --git a/cshub-server/src/components/pages/GetSearchPosts.ts b/cshub-server/src/components/pages/GetSearchPosts.ts index 0d69c26c..0c01262f 100644 --- a/cshub-server/src/components/pages/GetSearchPosts.ts +++ b/cshub-server/src/components/pages/GetSearchPosts.ts @@ -26,7 +26,6 @@ app.post(GetSearchPosts.getURL, (req: Request, res: Response) => { `, `%${searchPostRequest.query}%`, userId, userId) .then((hashes: DatabaseResultSet) => { - console.log(userId) const hashesArray: number[] = []; for (const hash of hashes.convertRowsToResultObjects()) { From 132ac4c165f36aefc5de83542541c4a67ca2e89f Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 21:23:01 +0100 Subject: [PATCH 35/50] Bugfixes --- cshub-client/src/components/posts/Post.vue | 6 ++++-- cshub-client/src/components/posts/PostList.vue | 6 +++++- cshub-client/src/views/posts/PostCreate.vue | 2 +- cshub-server/src/components/pages/CreatePost.ts | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index 9dbbf64d..33cfe75a 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -114,11 +114,13 @@ mdi-close - Post + {{post.title}} -
+
+
+
diff --git a/cshub-client/src/components/posts/PostList.vue b/cshub-client/src/components/posts/PostList.vue index 9d38eb0f..aab4ad42 100644 --- a/cshub-client/src/components/posts/PostList.vue +++ b/cshub-client/src/components/posts/PostList.vue @@ -84,7 +84,11 @@ */ private windowHeightChanged() { // Getting the window height, subtracting 300 pixels. Then dividing by 100 for a very wild guess of amount of possible cards on this screen - this.range = Math.floor((window.innerHeight - 350) / 100); + let range = Math.floor((window.innerHeight - 350) / 100); + if (range === 0) { + range++; + } + this.range = range; } private showCurrentPost(index: number, postHash: number): boolean { diff --git a/cshub-client/src/views/posts/PostCreate.vue b/cshub-client/src/views/posts/PostCreate.vue index b2fabbd9..59d404bf 100644 --- a/cshub-client/src/views/posts/PostCreate.vue +++ b/cshub-client/src/views/posts/PostCreate.vue @@ -30,7 +30,7 @@ label="Title" box v-model="postTitle" - v-validate="'required|min:4|max:127'" + v-validate="'required|min:4|max:50'" :error-messages="errors.collect('postTitle') + postTitleError" @change="postTitleError = ''" name="postTitle" diff --git a/cshub-server/src/components/pages/CreatePost.ts b/cshub-server/src/components/pages/CreatePost.ts index 0bc8b5e4..7740427a 100644 --- a/cshub-server/src/components/pages/CreatePost.ts +++ b/cshub-server/src/components/pages/CreatePost.ts @@ -20,7 +20,7 @@ app.post(CreatePost.getURL, (req: Request, res: Response) => { input: submitPostRequest.postTitle, validationObject: { minlength: 4, - maxlength: 127 + maxlength: 50 } }, {input: JSON.stringify(submitPostRequest.postBody)}, {input: submitPostRequest.postTopicHash}); From 53228f0f0f27e3381700e566d67d2512ca6f9a53 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 22:03:19 +0100 Subject: [PATCH 36/50] Window now almost always resizing, though quite hacky --- cshub-client/src/components/posts/Post.vue | 36 ++++++++++----------- cshub-client/src/components/quill/Quill.vue | 10 ++---- cshub-client/src/utilities/id-generator.ts | 10 ++++++ 3 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 cshub-client/src/utilities/id-generator.ts diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index 33cfe75a..3a010714 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -6,8 +6,8 @@
- - + + @@ -64,7 +64,7 @@ v-show="fullPostComputed" position="relative" class="scroll-y" - id="post-scroll-target" + :class="'postScrollWindow_' + domId" style="margin: 0; padding-top: 0; max-width: none; overflow-wrap: break-word" > - + @@ -155,6 +155,7 @@ import {ApiWrapper, logObjectConsole, logStringConsole} from "../../utilities"; import {CacheTypes} from "../../utilities/cache-types"; import {ImgurUpload} from "../../utilities/imgur"; + import {idGenerator} from "../../utilities/id-generator"; import {Routes} from "../../views/router/router"; @@ -178,6 +179,7 @@ */ @Prop(Number) private postHash: number; + private domId: string = idGenerator(); private post: IPost = null; private topicNames: IBreadCrumbType[] = []; private canResize = true; @@ -186,7 +188,6 @@ private loadingIcon = false; private previousTopicURL = ""; private fullScreenDialog = false; - private heightChangedInterval: number; /** * Computed properties @@ -239,10 +240,6 @@ * Lifecycle hooks */ private mounted() { - this.heightChangedInterval = setInterval(() => { - this.windowHeightChanged(); - }, 1000); - window.addEventListener("resize", this.windowHeightChanged); this.getPostRequest(); @@ -255,6 +252,12 @@ } } + private updated() { + setTimeout(() => { + this.windowHeightChanged(); + }, 500) + } + private beforeDestroy() { clearInterval(this.heightChangedInterval); } @@ -267,15 +270,16 @@ // Calculate the right height for the postcardtext, 100px padding this.canResize = false; - const postCard = document.getElementById("postCard"); - const postCardTitle = document.getElementById("postCardTitle"); + const postCard = document.getElementById(`post_${this.domId}`); + const postCardTitle = document.getElementById(`postTitle_${this.domId}`); if (postCard !== null && postCardTitle !== null) { const newHeight = postCard.clientHeight - postCardTitle.clientHeight - 50; - document.getElementById("post-scroll-target").style.maxHeight = `${newHeight}px`; + + (document.getElementsByClassName(`postScrollWindow_${this.domId}`).item(0) as HTMLElement).style.maxHeight = `${newHeight}px`; setTimeout(() => { this.canResize = true; - }, 500); + }, 1000); } else { this.canResize = true; } @@ -419,12 +423,6 @@ logStringConsole("Changed post in cache", "getContentRequest"); }); } - - Vue.nextTick() - .then(() => { - logStringConsole("Resizing viewport after post content set"); - this.windowHeightChanged(); - }); }, (err: AxiosError) => { clearTimeout(timeOut); diff --git a/cshub-client/src/components/quill/Quill.vue b/cshub-client/src/components/quill/Quill.vue index 4098dc23..84bc9509 100644 --- a/cshub-client/src/components/quill/Quill.vue +++ b/cshub-client/src/components/quill/Quill.vue @@ -159,6 +159,7 @@ import {IQuillEditSetup} from "./IQuillEditSetup"; import {logStringConsole} from "../../utilities"; + import {idGenerator} from "../../utilities/id-generator"; const QuillWindow = (window as any).Quill; QuillWindow.register("modules/resize", ImageResize); @@ -214,14 +215,7 @@ logStringConsole("Mounted quill with edit: " + this.editorSetup.allowEdit); - let id = ""; - const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - - for (let i = 0; i < 5; i++) { - id += possible.charAt(Math.floor(Math.random() * possible.length)); - } - - this.quillId = id; + this.quillId = idGenerator(); // Assign jquery and katex for use by mathquillMin (window as any).jQuery = JQuery; diff --git a/cshub-client/src/utilities/id-generator.ts b/cshub-client/src/utilities/id-generator.ts new file mode 100644 index 00000000..074d5ee6 --- /dev/null +++ b/cshub-client/src/utilities/id-generator.ts @@ -0,0 +1,10 @@ +export const idGenerator = (): string => { + let id = ""; + const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + for (let i = 0; i < 10; i++) { + id += possible.charAt(Math.floor(Math.random() * possible.length)); + } + + return id; +}; From 9d4efb580bee8376005019c4d973bf118659f99d Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Sun, 4 Nov 2018 22:08:53 +0100 Subject: [PATCH 37/50] Fixed travis --- cshub-client/src/components/posts/Post.vue | 6 +----- cshub-client/src/components/posts/PostList.vue | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cshub-client/src/components/posts/Post.vue b/cshub-client/src/components/posts/Post.vue index 3a010714..a1bb47df 100644 --- a/cshub-client/src/components/posts/Post.vue +++ b/cshub-client/src/components/posts/Post.vue @@ -255,11 +255,7 @@ private updated() { setTimeout(() => { this.windowHeightChanged(); - }, 500) - } - - private beforeDestroy() { - clearInterval(this.heightChangedInterval); + }, 500); } /** diff --git a/cshub-client/src/components/posts/PostList.vue b/cshub-client/src/components/posts/PostList.vue index aab4ad42..5939a556 100644 --- a/cshub-client/src/components/posts/PostList.vue +++ b/cshub-client/src/components/posts/PostList.vue @@ -83,7 +83,7 @@ * Methods */ private windowHeightChanged() { - // Getting the window height, subtracting 300 pixels. Then dividing by 100 for a very wild guess of amount of possible cards on this screen + // Getting the window height, subtracting 350 pixels. Then dividing by 100 for a very wild guess of amount of possible cards on this screen let range = Math.floor((window.innerHeight - 350) / 100); if (range === 0) { range++; From ced6eddc8f32bfad4e0dcad334e81ad0c63057e9 Mon Sep 17 00:00:00 2001 From: Victor Date: Sun, 4 Nov 2018 22:53:30 +0100 Subject: [PATCH 38/50] Minor typos fixed --- cshub-client/src/components/quill/Quill.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cshub-client/src/components/quill/Quill.vue b/cshub-client/src/components/quill/Quill.vue index ce9440d5..4d41e9c3 100644 --- a/cshub-client/src/components/quill/Quill.vue +++ b/cshub-client/src/components/quill/Quill.vue @@ -258,12 +258,12 @@ } }, initRequirements() { - // Assign jquery and katex for use by mathquillMin + // Assign jquery and katex for use by mathquill window.jQuery = JQuery; window.katex = katex; mathquill(); // Load mathquillMin after jquery and katex were defined - mathquill4quill(Quill, window.MathQuill); // Load mathquill4quillMin after all its dependencies are accounted for + mathquill4quill(Quill, window.MathQuill); // Load mathquill4quill after all its dependencies are accounted for }, initQuill() { // Set options and override the default with the user specified ones (Order of importance if right to left) @@ -279,7 +279,7 @@ this.editor = new Quill(`#${this.quillId} .editor`, this._options); // @ts-ignore - this.editor.enableMathQuillFormulaAuthoring(); // Enable mathquill4quillMin + this.editor.enableMathQuillFormulaAuthoring(); // Enable mathquill4quill this.editor.enable(false); // Hide it before we set the content // Set the content (with input a quill delta object) From 4a58758abad8540d8c86cca5c3e260bc569fd385 Mon Sep 17 00:00:00 2001 From: Robbin Baauw Date: Mon, 5 Nov 2018 08:22:23 +0100 Subject: [PATCH 39/50] Fixed 401 issue in GetEditContent --- cshub-server/src/components/pages/GetEditContent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cshub-server/src/components/pages/GetEditContent.ts b/cshub-server/src/components/pages/GetEditContent.ts index 64744caf..ed35ae25 100644 --- a/cshub-server/src/components/pages/GetEditContent.ts +++ b/cshub-server/src/components/pages/GetEditContent.ts @@ -22,7 +22,7 @@ app.post(GetEditContent.getURL, (req: Request, res: Response) => { const inputsValidation = validateMultipleInputs({input: getEditContent.postHash}); - if (inputsValidation.valid && userObj.valid) { + if (inputsValidation.valid) { hasAccessToPost(getEditContent.postHash, req.cookies["token"]) .then((approved: postAccessType) => { if (approved.access) { From 8cd617982fa9d09df0c60e360691060cb83ce927 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 5 Nov 2018 10:10:44 +0100 Subject: [PATCH 40/50] This hopefully works? Still needs to be tested --- cshub-client/package-lock.json | 3 ++- cshub-client/package.json | 2 +- cshub-client/vue.config.js | 28 ++++++++++++++++------------ cshub-server/package.json | 10 +++++----- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/cshub-client/package-lock.json b/cshub-client/package-lock.json index 5d2c07f8..a39a818e 100644 --- a/cshub-client/package-lock.json +++ b/cshub-client/package-lock.json @@ -864,7 +864,8 @@ "@types/lodash": { "version": "4.14.117", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.117.tgz", - "integrity": "sha512-xyf2m6tRbz8qQKcxYZa7PA4SllYcay+eh25DN3jmNYY6gSTL7Htc/bttVdkqj2wfJGbeWlQiX8pIyJpKU+tubw==" + "integrity": "sha512-xyf2m6tRbz8qQKcxYZa7PA4SllYcay+eh25DN3jmNYY6gSTL7Htc/bttVdkqj2wfJGbeWlQiX8pIyJpKU+tubw==", + "dev": true }, "@types/sizzle": { "version": "2.3.2", diff --git a/cshub-client/package.json b/cshub-client/package.json index 9f7aff30..c5296438 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "@babel/polyfill": "^7.0.0-rc.1", - "@types/lodash": "^4.14.117", "animate.css": "^3.7.0", "axios": "^0.18.0", "jquery": "^3.3.1", @@ -34,6 +33,7 @@ "@mdi/font": "^2.8.94", "@types/jquery": "^3.3.22", "@types/katex": "^0.5.0", + "@types/lodash": "^4.14.117", "@vue/cli-plugin-babel": "^3.1.1", "@vue/cli-plugin-pwa": "^3.1.1", "@vue/cli-plugin-typescript": "^3.1.1", diff --git a/cshub-client/vue.config.js b/cshub-client/vue.config.js index cdfa60b0..d09b6344 100644 --- a/cshub-client/vue.config.js +++ b/cshub-client/vue.config.js @@ -1,14 +1,18 @@ module.exports = { - pwa: { - themeColor: '#00A6D8', - name: 'CSHub' - }, + pwa: { + themeColor: '#00A6D8', + name: 'CSHub', + workboxPluginMode: 'GenerateSW', + appleMobileWebAppCapable: true, + assetsVersion: Date.now() + }, - baseUrl: undefined, - outputDir: undefined, - assetsDir: undefined, - runtimeCompiler: undefined, - productionSourceMap: false, - parallel: undefined, - css: undefined -} \ No newline at end of file + baseUrl: undefined, + outputDir: undefined, + assetsDir: undefined, + runtimeCompiler: undefined, + productionSourceMap: false, + parallel: undefined, + css: undefined, + +}; \ No newline at end of file diff --git a/cshub-server/package.json b/cshub-server/package.json index 782297c2..02a05ee3 100644 --- a/cshub-server/package.json +++ b/cshub-server/package.json @@ -7,11 +7,6 @@ }, "dependencies": { "@sendgrid/mail": "^6.3.1", - "@types/async": "^2.0.49", - "@types/cors": "^2.8.4", - "@types/express": "^4.16.0", - "@types/jsonwebtoken": "^7.2.8", - "@types/ssh2": "^0.5.36", "async": "^2.6.1", "body-parser": "^1.18.3", "cookie-parser": "^1.4.3", @@ -27,6 +22,11 @@ "winston": "^3.1.0" }, "devDependencies": { + "@types/async": "^2.0.49", + "@types/cors": "^2.8.4", + "@types/express": "^4.16.0", + "@types/jsonwebtoken": "^7.2.8", + "@types/ssh2": "^0.5.36", "@types/node": "^10.7.1", "quill-delta": "^4.1.0", "ts-node": "^7.0.1", From 85466ea772171b71b20a00be0ada23a010055f31 Mon Sep 17 00:00:00 2001 From: RobbinBaauw Date: Mon, 5 Nov 2018 19:55:12 +0100 Subject: [PATCH 41/50] Moved quill dependencies to public assets --- cshub-client/.env.production | 2 +- cshub-client/package-lock.json | 24 ++++++++++++++++ cshub-client/package.json | 4 ++- .../quill => public/assets}/Sailec-Light.otf | Bin .../assets/highlight.min.css} | 0 .../assets}/highlight.pack.min.js | 0 cshub-client/public/assets/katex.min.css | 1 + cshub-client/public/assets/katex.min.js | 4 +++ .../quill => public/assets}/mathquill.min.css | 0 cshub-client/public/assets/mathquill.min.js | 12 ++++++++ cshub-client/public/assets/quill2.min.css | 6 ++++ cshub-client/public/assets/quill2.min.js | 8 ++++++ cshub-client/public/index.html | 18 ++++++++++++ cshub-client/src/App.vue | 2 +- cshub-client/src/components/posts/Post.vue | 2 +- .../src/components/posts/PostPagination.vue | 2 +- cshub-client/src/components/quill/Quill.vue | 26 +++--------------- cshub-client/src/plugins/font-awesome.ts | 4 +++ cshub-client/src/plugins/index.ts | 1 + cshub-client/src/plugins/quill/Symbola.ttf | Bin 2240100 -> 0 bytes .../src/plugins/quill/mathquill.min.js | 1 - cshub-client/src/plugins/quill/quill2.min.css | 6 ---- cshub-client/src/plugins/quill/quill2.min.js | 8 ------ cshub-client/src/plugins/vuetify/vuetify.ts | 2 +- cshub-client/tslint.json | 1 + 25 files changed, 91 insertions(+), 43 deletions(-) rename cshub-client/{src/plugins/quill => public/assets}/Sailec-Light.otf (100%) rename cshub-client/{src/plugins/quill/gruvbox-dark.min.css => public/assets/highlight.min.css} (100%) rename cshub-client/{src/plugins/quill => public/assets}/highlight.pack.min.js (100%) create mode 100644 cshub-client/public/assets/katex.min.css create mode 100644 cshub-client/public/assets/katex.min.js rename cshub-client/{src/plugins/quill => public/assets}/mathquill.min.css (100%) create mode 100644 cshub-client/public/assets/mathquill.min.js create mode 100644 cshub-client/public/assets/quill2.min.css create mode 100644 cshub-client/public/assets/quill2.min.js create mode 100644 cshub-client/src/plugins/font-awesome.ts delete mode 100644 cshub-client/src/plugins/quill/Symbola.ttf delete mode 100644 cshub-client/src/plugins/quill/mathquill.min.js delete mode 100644 cshub-client/src/plugins/quill/quill2.min.css delete mode 100644 cshub-client/src/plugins/quill/quill2.min.js diff --git a/cshub-client/.env.production b/cshub-client/.env.production index 128253c2..50df19ce 100644 --- a/cshub-client/.env.production +++ b/cshub-client/.env.production @@ -1,2 +1,2 @@ -VUE_APP_API_URL=https://api.cshub.nl +VUE_APP_API_URL=https://api-dev.cshub.nl VUE_APP_DEBUG=false diff --git a/cshub-client/package-lock.json b/cshub-client/package-lock.json index a39a818e..50d11e49 100644 --- a/cshub-client/package-lock.json +++ b/cshub-client/package-lock.json @@ -813,6 +813,30 @@ "to-fast-properties": "^2.0.0" } }, + "@fortawesome/fontawesome-common-types": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.8.tgz", + "integrity": "sha512-0sU7JDLdEeGQlWBSr5uEE6PZOM15YM1s9rFlpZV+WhNdX2V6Co3Sj0OW5el4F54X1Tw+nfxf4Cc3dUedudaDWg==", + "dev": true + }, + "@fortawesome/fontawesome-svg-core": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.8.tgz", + "integrity": "sha512-cvcMQZ5F8WSNSGMk9uWlkmZNfDzmdsWLRrTMrNwwihHcEmWRlIuSbDt+PQ/rXsnGmJnmLQJLFBT1cse/3swxbg==", + "dev": true, + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.8" + } + }, + "@fortawesome/free-solid-svg-icons": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.5.0.tgz", + "integrity": "sha512-VawIT2owNP97EwehZmxkvZDhoKwEevU/1HOMkln6kc4OtfE+JKYr6DpyzQnHVWXvz/eFj36QElHNe6zT8gR+Tg==", + "dev": true, + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.8" + } + }, "@intervolga/optimize-cssnano-plugin": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@intervolga/optimize-cssnano-plugin/-/optimize-cssnano-plugin-1.0.6.tgz", diff --git a/cshub-client/package.json b/cshub-client/package.json index c5296438..b3de060f 100644 --- a/cshub-client/package.json +++ b/cshub-client/package.json @@ -38,9 +38,11 @@ "@vue/cli-plugin-pwa": "^3.1.1", "@vue/cli-plugin-typescript": "^3.1.1", "@vue/cli-service": "^3.1.2", + "parchment": "latest", "typescript": "^3.1.6", "vue-cli-plugin-vuetify": "^0.2.1", "vue-template-compiler": "^2.5.17", - "parchment": "latest" + "@fortawesome/fontawesome-svg-core": "latest", + "@fortawesome/free-solid-svg-icons": "latest" } } diff --git a/cshub-client/src/plugins/quill/Sailec-Light.otf b/cshub-client/public/assets/Sailec-Light.otf similarity index 100% rename from cshub-client/src/plugins/quill/Sailec-Light.otf rename to cshub-client/public/assets/Sailec-Light.otf diff --git a/cshub-client/src/plugins/quill/gruvbox-dark.min.css b/cshub-client/public/assets/highlight.min.css similarity index 100% rename from cshub-client/src/plugins/quill/gruvbox-dark.min.css rename to cshub-client/public/assets/highlight.min.css diff --git a/cshub-client/src/plugins/quill/highlight.pack.min.js b/cshub-client/public/assets/highlight.pack.min.js similarity index 100% rename from cshub-client/src/plugins/quill/highlight.pack.min.js rename to cshub-client/public/assets/highlight.pack.min.js diff --git a/cshub-client/public/assets/katex.min.css b/cshub-client/public/assets/katex.min.css new file mode 100644 index 00000000..d6fb8374 --- /dev/null +++ b/cshub-client/public/assets/katex.min.css @@ -0,0 +1 @@ +@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.eot);src:url(fonts/KaTeX_AMS-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'),url(fonts/KaTeX_AMS-Regular.woff) format('woff'),url(fonts/KaTeX_AMS-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.eot);src:url(fonts/KaTeX_Caligraphic-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'),url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'),url(fonts/KaTeX_Caligraphic-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.eot);src:url(fonts/KaTeX_Caligraphic-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'),url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'),url(fonts/KaTeX_Caligraphic-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.eot);src:url(fonts/KaTeX_Fraktur-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'),url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'),url(fonts/KaTeX_Fraktur-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.eot);src:url(fonts/KaTeX_Fraktur-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'),url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'),url(fonts/KaTeX_Fraktur-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.eot);src:url(fonts/KaTeX_Main-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Bold.woff2) format('woff2'),url(fonts/KaTeX_Main-Bold.woff) format('woff'),url(fonts/KaTeX_Main-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.eot);src:url(fonts/KaTeX_Main-Italic.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Italic.woff2) format('woff2'),url(fonts/KaTeX_Main-Italic.woff) format('woff'),url(fonts/KaTeX_Main-Italic.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.eot);src:url(fonts/KaTeX_Main-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Regular.woff2) format('woff2'),url(fonts/KaTeX_Main-Regular.woff) format('woff'),url(fonts/KaTeX_Main-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.eot);src:url(fonts/KaTeX_Math-Italic.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Math-Italic.woff2) format('woff2'),url(fonts/KaTeX_Math-Italic.woff) format('woff'),url(fonts/KaTeX_Math-Italic.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:KaTeX_SansSerif;src:url(fonts/KaTeX_SansSerif-Regular.eot);src:url(fonts/KaTeX_SansSerif-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'),url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'),url(fonts/KaTeX_SansSerif-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.eot);src:url(fonts/KaTeX_Script-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Script-Regular.woff2) format('woff2'),url(fonts/KaTeX_Script-Regular.woff) format('woff'),url(fonts/KaTeX_Script-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.eot);src:url(fonts/KaTeX_Size1-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size1-Regular.woff) format('woff'),url(fonts/KaTeX_Size1-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.eot);src:url(fonts/KaTeX_Size2-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size2-Regular.woff) format('woff'),url(fonts/KaTeX_Size2-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.eot);src:url(fonts/KaTeX_Size3-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size3-Regular.woff) format('woff'),url(fonts/KaTeX_Size3-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.eot);src:url(fonts/KaTeX_Size4-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size4-Regular.woff) format('woff'),url(fonts/KaTeX_Size4-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.eot);src:url(fonts/KaTeX_Typewriter-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'),url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'),url(fonts/KaTeX_Typewriter-Regular.ttf) format('truetype');font-weight:400;font-style:normal}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:inline-block;text-align:initial}.katex{font:400 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;white-space:nowrap;text-indent:0}.katex .katex-html{display:inline-block}.katex .katex-mathml{position:absolute;clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}.katex .base,.katex .strut{display:inline-block}.katex .mathrm{font-style:normal}.katex .textit{font-style:italic}.katex .mathit{font-family:KaTeX_Math;font-style:italic}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .amsrm,.katex .mathbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr{font-family:KaTeX_Script}.katex .mathsf{font-family:KaTeX_SansSerif}.katex .mainit{font-family:KaTeX_Main;font-style:italic}.katex .mord+.mop{margin-left:.16667em}.katex .mord+.mbin{margin-left:.22222em}.katex .mord+.mrel{margin-left:.27778em}.katex .mop+.mop,.katex .mop+.mord,.katex .mord+.minner{margin-left:.16667em}.katex .mop+.mrel{margin-left:.27778em}.katex .mop+.minner{margin-left:.16667em}.katex .mbin+.minner,.katex .mbin+.mop,.katex .mbin+.mopen,.katex .mbin+.mord{margin-left:.22222em}.katex .mrel+.minner,.katex .mrel+.mop,.katex .mrel+.mopen,.katex .mrel+.mord{margin-left:.27778em}.katex .mclose+.mop{margin-left:.16667em}.katex .mclose+.mbin{margin-left:.22222em}.katex .mclose+.mrel{margin-left:.27778em}.katex .mclose+.minner,.katex .minner+.mop,.katex .minner+.mord,.katex .mpunct+.mclose,.katex .mpunct+.minner,.katex .mpunct+.mop,.katex .mpunct+.mopen,.katex .mpunct+.mord,.katex .mpunct+.mpunct,.katex .mpunct+.mrel{margin-left:.16667em}.katex .minner+.mbin{margin-left:.22222em}.katex .minner+.mrel{margin-left:.27778em}.katex .minner+.minner,.katex .minner+.mopen,.katex .minner+.mpunct{margin-left:.16667em}.katex .mbin.mtight,.katex .mclose.mtight,.katex .minner.mtight,.katex .mop.mtight,.katex .mopen.mtight,.katex .mord.mtight,.katex .mpunct.mtight,.katex .mrel.mtight{margin-left:0}.katex .mclose+.mop.mtight,.katex .minner+.mop.mtight,.katex .mop+.mop.mtight,.katex .mop+.mord.mtight,.katex .mord+.mop.mtight{margin-left:.16667em}.katex .reset-textstyle.textstyle{font-size:1em}.katex .reset-textstyle.scriptstyle{font-size:.7em}.katex .reset-textstyle.scriptscriptstyle{font-size:.5em}.katex .reset-scriptstyle.textstyle{font-size:1.42857em}.katex .reset-scriptstyle.scriptstyle{font-size:1em}.katex .reset-scriptstyle.scriptscriptstyle{font-size:.71429em}.katex .reset-scriptscriptstyle.textstyle{font-size:2em}.katex .reset-scriptscriptstyle.scriptstyle{font-size:1.4em}.katex .reset-scriptscriptstyle.scriptscriptstyle{font-size:1em}.katex .style-wrap{position:relative}.katex .vlist{display:inline-block}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist .baseline-fix{display:inline-table;table-layout:fixed}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{width:100%}.katex .mfrac .frac-line:before{border-bottom-style:solid;border-bottom-width:1px;content:"";display:block}.katex .mfrac .frac-line:after{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block;margin-top:-1px}.katex .mspace{display:inline-block}.katex .mspace.negativethinspace{margin-left:-.16667em}.katex .mspace.thinspace{width:.16667em}.katex .mspace.negativemediumspace{margin-left:-.22222em}.katex .mspace.mediumspace{width:.22222em}.katex .mspace.thickspace{width:.27778em}.katex .mspace.sixmuspace{width:.333333em}.katex .mspace.eightmuspace{width:.444444em}.katex .mspace.enspace{width:.5em}.katex .mspace.twelvemuspace{width:.666667em}.katex .mspace.quad{width:1em}.katex .mspace.qquad{width:2em}.katex .llap,.katex .rlap{width:0;position:relative}.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .rlap>.inner{left:0}.katex .katex-logo .a{font-size:.75em;margin-left:-.32em;position:relative;top:-.2em}.katex .katex-logo .t{margin-left:-.23em}.katex .katex-logo .e{margin-left:-.1667em;position:relative;top:.2155em}.katex .katex-logo .x{margin-left:-.125em}.katex .rule{display:inline-block;border:0 solid;position:relative}.katex .overline .overline-line,.katex .underline .underline-line{width:100%}.katex .overline .overline-line:before,.katex .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:1px;content:"";display:block}.katex .overline .overline-line:after,.katex .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block;margin-top:-1px}.katex .sqrt>.sqrt-sign{position:relative}.katex .sqrt .sqrt-line{width:100%}.katex .sqrt .sqrt-line:before{border-bottom-style:solid;border-bottom-width:1px;content:"";display:block}.katex .sqrt .sqrt-line:after{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block;margin-top:-1px}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer,.katex .sizing{display:inline-block}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:2em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:3.46em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:4.14em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.98em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.47142857em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.95714286em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.55714286em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.875em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.125em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.25em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.5em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.8em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.1625em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.5875em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:3.1125em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.77777778em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.88888889em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.6em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.92222222em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.3em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.76666667em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.7em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.8em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.9em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.2em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.44em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.73em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:2.07em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.49em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.58333333em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.66666667em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.75em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.83333333em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44166667em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.725em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.075em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.48611111em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.55555556em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.625em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.69444444em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.20138889em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.4375em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72916667em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.28901734em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.40462428em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.46242775em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.52023121em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.57803468em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69364162em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83236994em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.19653179em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.43930636em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.24154589em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.33816425em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.38647343em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.43478261em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.48309179em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.57971014em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69565217em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83574879em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20289855em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.20080321em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2811245em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.32128514em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.36144578em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.40160643em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48192771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57831325em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69477912em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8313253em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist>span,.katex .op-limits>.vlist>span{text-align:center}.katex .accent .accent-body>span{width:0}.katex .accent .accent-body.accent-vec>span{position:relative;left:.326em}.katex .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid #000}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist{text-align:center}.katex .mtable .col-align-l>.vlist{text-align:left}.katex .mtable .col-align-r>.vlist{text-align:right} \ No newline at end of file diff --git a/cshub-client/public/assets/katex.min.js b/cshub-client/public/assets/katex.min.js new file mode 100644 index 00000000..66c08216 --- /dev/null +++ b/cshub-client/public/assets/katex.min.js @@ -0,0 +1,4 @@ +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.katex=e()}})(function(){var e,t,r;return function a(e,t,r){function i(s,l){if(!t[s]){if(!e[s]){var o=typeof require=="function"&&require;if(!l&&o)return o(s,!0);if(n)return n(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=t[s]={exports:{}};e[s][0].call(p.exports,function(t){var r=e[s][1][t];return i(r?r:t)},p,p.exports,a,e,t,r)}return t[s].exports}var n=typeof require=="function"&&require;for(var s=0;s15){o="\u2026"+s.slice(i-15,i)}else{o=s.slice(0,i)}var u;if(n+15v){return this.parseFunction(i)}else{throw new p("Got function '"+i.result+"' with no arguments "+"as "+e,t)}}else{return i.result}};h.prototype.handleUnsupportedCmd=function(){var e=this.nextToken.text;var t=[];for(var r=0;ri){c=this.parseFunction(h)}else{throw new p("Got function '"+h.result+"' as "+"argument to '"+e+"'",o)}}else{c=h.result}s.push(c);n.push(this.pos)}s.push(n);return s};h.prototype.parseGroupOfType=function(e,t){var r=this.mode;if(e==="original"){e=r}if(e==="color"){return this.parseColorGroup(t)}if(e==="size"){return this.parseSizeGroup(t)}this.switchMode(e);if(e==="text"){while(this.nextToken.text===" "){this.consume()}}var a=this.parseGroup(t);this.switchMode(r);return a};h.prototype.parseStringGroup=function(e,t){if(t&&this.nextToken.text!=="["){return null}var r=this.mode;this.mode="text";this.expect(t?"[":"{");var a="";var i=this.nextToken;var n=i;while(this.nextToken.text!==(t?"]":"}")){if(this.nextToken.text==="EOF"){throw new p("Unexpected end of input in "+e,i.range(this.nextToken,a))}n=this.nextToken;a+=n.text;this.consume()}this.mode=r;this.expect(t?"]":"}");return i.range(n,a)};h.prototype.parseRegexGroup=function(e,t){var r=this.mode;this.mode="text";var a=this.nextToken;var i=a;var n="";while(this.nextToken.text!=="EOF"&&e.test(n+this.nextToken.text)){i=this.nextToken;n+=i.text;this.consume()}if(n===""){throw new p("Invalid "+t+": '"+a.text+"'",a)}this.mode=r;return a.range(i,n)};h.prototype.parseColorGroup=function(e){var t=this.parseStringGroup("color",e);if(!t){return null}var r=/^(#[a-z0-9]+|[a-z]+)$/i.exec(t.text);if(!r){throw new p("Invalid color: '"+t.text+"'",t)}return new m(new c("color",r[0],this.mode),false)};h.prototype.parseSizeGroup=function(e){var t;if(!e&&this.nextToken.text!=="{"){t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2}$/,"size")}else{t=this.parseStringGroup("size",e)}if(!t){return null}var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r){throw new p("Invalid size: '"+t.text+"'",t)}var a={number:+(r[1]+r[2]),unit:r[3]};if(a.unit!=="em"&&a.unit!=="ex"&&a.unit!=="mu"){throw new p("Invalid unit: '"+a.unit+"'",t)}return new m(new c("color",a,this.mode),false)};h.prototype.parseGroup=function(e){var t=this.nextToken;if(this.nextToken.text===(e?"[":"{")){this.consume();var r=this.parseExpression(false,e?"]":null);var a=this.nextToken;this.expect(e?"]":"}");if(this.mode==="text"){this.formLigatures(r)}return new m(new c("ordgroup",r,this.mode,t,a),false)}else{return e?null:this.parseSymbol()}};h.prototype.formLigatures=function(e){var t;var r=e.length-1;for(t=0;t0?t-1:0]}l.prototype.sup=function(){return y[x[this.id]]};l.prototype.sub=function(){return y[b[this.id]]};l.prototype.fracNum=function(){return y[w[this.id]]};l.prototype.fracDen=function(){return y[k[this.id]]};l.prototype.cramp=function(){return y[z[this.id]]};l.prototype.cls=function(){return d[this.size]+(this.cramped?" cramped":" uncramped")};l.prototype.reset=function(){return g[this.size]};l.prototype.isTight=function(){return this.size>=2};var o=0;var u=1;var p=2;var h=3;var c=4;var m=5;var f=6;var v=7;var d=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"];var g=["reset-textstyle","reset-textstyle","reset-scriptstyle","reset-scriptscriptstyle"];var y=[new l(o,0,1,false),new l(u,0,1,true),new l(p,1,1,false),new l(h,1,1,true),new l(c,2,.7,false),new l(m,2,.7,true),new l(f,3,.5,false),new l(v,3,.5,true)];var x=[c,m,c,m,f,v,f,v];var b=[m,m,m,m,v,v,v,v];var w=[p,h,c,m,f,v,f,v];var k=[h,h,m,m,v,v,v,v];var z=[u,u,h,h,m,m,v,v];t.exports={DISPLAY:y[o],TEXT:y[p],SCRIPT:y[c],SCRIPTSCRIPT:y[f]}},{"./fontMetrics.js":17}],10:[function(e,t,r){var a=e("./domTree");var i=e("./fontMetrics");var n=e("./symbols");var s=e("./utils");var l=["\\Gamma","\\Delta","\\Theta","\\Lambda","\\Xi","\\Pi","\\Sigma","\\Upsilon","\\Phi","\\Psi","\\Omega"];var o=["\u0131","\u0237","\xa3"];var u=function(e,t,r,s,l){if(n[r][e]&&n[r][e].replace){e=n[r][e].replace}var o=i.getCharacterMetrics(e,t);var u;if(o){var p=o.italic;if(r==="text"){p=0}u=new a.symbolNode(e,o.height,o.depth,p,o.skew,l)}else{typeof console!=="undefined"&&console.warn("No character metrics for '"+e+"' in style '"+t+"'");u=new a.symbolNode(e,0,0,0,0,l)}if(s){if(s.style.isTight()){u.classes.push("mtight")}if(s.getColor()){u.style.color=s.getColor()}}return u};var p=function(e,t,r,a){if(e==="\\"||n[t][e].font==="main"){return u(e,"Main-Regular",t,r,a)}else{return u(e,"AMS-Regular",t,r,a.concat(["amsrm"]))}};var h=function(e,t,r,a,i){if(i==="mathord"){return c(e,t,r,a)}else if(i==="textord"){return u(e,"Main-Regular",t,r,a.concat(["mathrm"]))}else{throw new Error("unexpected type: "+i+" in mathDefault")}};var c=function(e,t,r,a){if(/[0-9]/.test(e.charAt(0))||s.contains(o,e)||s.contains(l,e)){return u(e,"Main-Italic",t,r,a.concat(["mainit"]))}else{return u(e,"Math-Italic",t,r,a.concat(["mathit"]))}};var m=function(e,t,r){var a=e.mode;var l=e.value;if(n[a][l]&&n[a][l].replace){l=n[a][l].replace}var p=["mord"];var m=t.font;if(m){if(m==="mathit"||s.contains(o,l)){return c(l,a,t,p)}else{var f=k[m].fontName;if(i.getCharacterMetrics(l,f)){return u(l,f,a,t,p.concat([m]))}else{return h(l,a,t,p,r)}}}else{return h(l,a,t,p,r)}};var f=function(e){var t=0;var r=0;var a=0;if(e.children){for(var i=0;it){t=e.children[i].height}if(e.children[i].depth>r){r=e.children[i].depth}if(e.children[i].maxFontSize>a){a=e.children[i].maxFontSize}}}e.height=t;e.depth=r;e.maxFontSize=a};var v=function(e,t,r){var i=new a.span(e,t,r);f(i);return i};var d=function(e,t){e.children=t.concat(e.children);f(e)};var g=function(e){var t=new a.documentFragment(e);f(t);return t};var y=function(e,t){var r=v([],[new a.symbolNode("\u200b")]);r.style.fontSize=t/e.style.sizeMultiplier+"em";var i=v(["fontsize-ensurer","reset-"+e.size,"size5"],[r]);return i};var x=function(e,t,r,i){var n;var s;var l;if(t==="individualShift"){var o=e;e=[o[0]];n=-o[0].shift-o[0].elem.depth;s=n;for(l=1;l0){f+=T;v-=T}}S=n.makeVList([{type:"elem",elem:s,shift:v},{type:"elem",elem:a,shift:-f}],"individualShift",null,t);if(r instanceof l.symbolNode){S.children[0].style.marginLeft=-r.italic+"em"}S.children[0].style.marginRight=k;S.children[1].style.marginRight=k}var A=d(r)||"mord";return p([A],[r,p(["msupsub"],[S])],t)};w.genfrac=function(e,t){var r=t.style;if(e.value.size==="display"){r=i.DISPLAY}else if(e.value.size==="text"){r=i.TEXT}var a=r.fracNum();var l=r.fracDen();var u;u=t.withStyle(a);var h=z(e.value.numer,u);var c=p([r.reset(),a.cls()],[h],u);u=t.withStyle(l);var m=z(e.value.denom,u);var f=p([r.reset(),l.cls()],[m],u);var v;if(e.value.hasBarLine){v=o.metrics.defaultRuleThickness/t.style.sizeMultiplier}else{v=0}var d;var g;var y;if(r.size===i.DISPLAY.size){d=r.metrics.num1;if(v>0){g=3*v}else{g=7*o.metrics.defaultRuleThickness}y=r.metrics.denom1}else{if(v>0){d=r.metrics.num2;g=v}else{d=r.metrics.num3;g=3*o.metrics.defaultRuleThickness}y=r.metrics.denom2}var x;if(v===0){var w=d-h.depth-(m.height-y);if(w0){N+=x;if(M=l){continue}var I;if(i>0||e.value.hskipBeforeAndAfter){I=u.deflt(O.pregap,f);if(I!==0){C=p(["arraycolsep"],[]);C.style.width=I+"em";E.push(C)}}var L=[];for(r=0;ra.height+a.depth+c){c=(c+d-a.height-a.depth)/2}var g=-(a.height+c+l)+v.height;v.style.top=g+"em";v.height-=g;v.depth+=g;var y;if(a.height===0&&a.depth===0){y=p()}else{y=n.makeVList([{type:"elem",elem:a},{type:"kern",size:c},{type:"elem",elem:u},{type:"kern",size:l}],"firstBaseline",null,t)}if(!e.value.index){return p(["mord","sqrt"],[v,y],t)}else{var x=t.withStyle(i.SCRIPTSCRIPT);var b=z(e.value.index,x);var w=p([r.reset(),i.SCRIPTSCRIPT.cls()],[b],x);var k=Math.max(v.height,y.height);var S=Math.max(v.depth,y.depth);var M=.6*(k-S);var T=n.makeVList([{type:"elem",elem:w}],"shift",-M,t);var A=p(["root"],[T]);return p(["mord","sqrt"],[A,v,y],t)}};w.sizing=function(e,t){var r=v(e.value.value,t.withSize(e.value.size),false);var a=t.style;var i=n.sizingMultiplier[e.value.size];i=i*a.sizeMultiplier;for(var s=0;s","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"];var b=[0,1.2,1.8,2.4,3];var w=function(e,t,r,i,n){if(e==="<"||e==="\\lt"){e="\\langle"}else if(e===">"||e==="\\gt"){e="\\rangle"}if(o.contains(g,e)||o.contains(x,e)){return f(e,t,false,r,i,n)}else if(o.contains(y,e)){return d(e,b[t],false,r,i,n)}else{throw new a("Illegal delimiter: '"+e+"'")}};var k=[{type:"small",style:i.SCRIPTSCRIPT},{type:"small",style:i.SCRIPT},{type:"small",style:i.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}];var z=[{type:"small",style:i.SCRIPTSCRIPT},{type:"small",style:i.SCRIPT},{type:"small",style:i.TEXT},{type:"stack"}];var S=[{type:"small",style:i.SCRIPTSCRIPT},{type:"small",style:i.SCRIPT},{type:"small",style:i.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];var M=function(e){if(e.type==="small"){return"Main-Regular"}else if(e.type==="large"){return"Size"+e.size+"-Regular"}else if(e.type==="stack"){return"Size4-Regular"}};var T=function(e,t,r,a){var i=Math.min(2,3-a.style.size);for(var n=i;nt){return r[n]}}return r[r.length-1]};var A=function(e,t,r,a,i,n){if(e==="<"||e==="\\lt"){e="\\langle"}else if(e===">"||e==="\\gt"){e="\\rangle"}var s;if(o.contains(x,e)){s=k}else if(o.contains(g,e)){s=S}else{s=z}var l=T(e,t,s,a);if(l.type==="small"){return m(e,l.style,r,a,i,n)}else if(l.type==="large"){return f(e,l.size,r,a,i,n)}else if(l.type==="stack"){return d(e,t,r,a,i,n)}};var N=function(e,t,r,a,i,n){var l=a.style.metrics.axisHeight*a.style.sizeMultiplier;var o=901;var u=5/s.metrics.ptPerEm;var p=Math.max(t-l,r+l);var h=Math.max(p/500*o,2*p-u);return A(e,h,true,a,i,n)};t.exports={sizedDelim:w,customSizedDelim:A,leftRightDelim:N}},{"./ParseError":6,"./Style":9,"./buildCommon":10,"./fontMetrics":17,"./symbols":23,"./utils":25}],15:[function(e,t,r){var a=e("./unicodeRegexes");var i=e("./utils");var n=function(e){e=e.slice();for(var t=e.length-1;t>=0;t--){if(!e[t]){e.splice(t,1)}}return e.join(" ")};function s(e,t,r){this.classes=e||[];this.children=t||[];this.height=0;this.depth=0;this.maxFontSize=0;this.style={};this.attributes={};if(r){if(r.style.isTight()){this.classes.push("mtight")}if(r.getColor()){this.style.color=r.getColor()}}}s.prototype.setAttribute=function(e,t){this.attributes[e]=t};s.prototype.tryCombine=function(e){return false};s.prototype.toNode=function(){var e=document.createElement("span");e.className=n(this.classes);for(var t in this.style){if(Object.prototype.hasOwnProperty.call(this.style,t)){e.style[t]=this.style[t]}}for(var r in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,r)){e.setAttribute(r,this.attributes[r])}}for(var a=0;a";return e};function l(e){this.children=e||[];this.height=0;this.depth=0;this.maxFontSize=0}l.prototype.toNode=function(){var e=document.createDocumentFragment();for(var t=0;t0||n(this.classes)!==n(e.classes)||this.skew!==e.skew||this.maxFontSize!==e.maxFontSize){return false}for(var t in this.style){if(this.style.hasOwnProperty(t)&&this.style[t]!==e.style[t]){return false}}for(t in e.style){if(e.style.hasOwnProperty(t)&&this.style[t]!==e.style[t]){return false}}this.value+=e.value;this.height=Math.max(this.height,e.height);this.depth=Math.max(this.depth,e.depth);this.italic=e.italic;return true};u.prototype.toNode=function(){var e=document.createTextNode(this.value);var t=null;if(this.italic>0){t=document.createElement("span");t.style.marginRight=this.italic+"em"}if(this.classes.length>0){t=t||document.createElement("span");t.className=n(this.classes)}for(var r in this.style){if(this.style.hasOwnProperty(r)){t=t||document.createElement("span");t.style[r]=this.style[r]}}if(t){t.appendChild(e);return t}else{return e}};u.prototype.toMarkup=function(){var e=false;var t="0){r+="margin-right:"+this.italic+"em;"}for(var a in this.style){if(this.style.hasOwnProperty(a)){r+=i.hyphenate(a)+":"+this.style[a]+";"}}if(r){e=true;t+=' style="'+i.escape(r)+'"'}var s=i.escape(this.value);if(e){t+=">";t+=s;t+="";return t}else{return s}};t.exports={span:s,documentFragment:l,symbolNode:u}},{"./unicodeRegexes":24,"./utils":25}],16:[function(e,t,r){var a=e("./parseData");var i=e("./ParseError");var n=e("./Style");var s=a.ParseNode;function l(e,t){var r=[];var a=[r];var n=[];while(true){var l=e.parseExpression(false,null);r.push(new s("ordgroup",l,e.mode));var o=e.nextToken.text;if(o==="&"){e.consume()}else if(o==="\\end"){break}else if(o==="\\\\"||o==="\\cr"){var u=e.parseFunction();n.push(u.value.size);r=[];a.push(r)}else{throw new i("Expected & or \\\\ or \\end",e.nextToken)}}t.body=a;t.rowGaps=n;return new s(t.type,t,e.mode)}function o(e,r,a){if(typeof e==="string"){e=[e]}if(typeof r==="number"){r={numArgs:r}}var i={numArgs:r.numArgs||0,argTypes:r.argTypes,greediness:1,allowedInText:!!r.allowedInText,numOptionalArgs:r.numOptionalArgs||0,handler:a};for(var n=0;n0){o=2}t.value.cols[i]={type:"align",align:n,pregap:o,postgap:0}}return t})},{"./ParseError":6,"./Style":9,"./parseData":21}],17:[function(e,t,r){var a=e("./Style");var i=e("./unicodeRegexes").cjkRegex;var n={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]};var s=0;var l=0;var o=0;var u=0;var p=.431;var h=1;var c=0;var m=.04;var f=.111;var v=.166;var d=.2;var g=.6;var y=.1;var x=10;var b=2/x;var w={defaultRuleThickness:m,bigOpSpacing1:f,bigOpSpacing2:v,bigOpSpacing3:d,bigOpSpacing4:g,bigOpSpacing5:y,ptPerEm:x,doubleRuleSep:b};var k=e("./fontMetricsData");var z={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"A","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"o","\xdf":"B","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"a","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"o","\xff":"y","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041a":"K","\u041b":"N","\u041c":"M","\u041d":"H","\u041e":"O","\u041f":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042a":"B","\u042b":"X","\u042c":"B","\u042d":"3","\u042e":"X","\u042f":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043a":"n","\u043b":"n","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044a":"a","\u044b":"m","\u044c":"a","\u044d":"e","\u044e":"m","\u044f":"r"};var S=function(e,t){var r=e.charCodeAt(0);if(e[0]in z){r=z[e[0]].charCodeAt(0)}else if(i.test(e[0])){r="M".charCodeAt(0)}var a=k[t][r];if(a){return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}};t.exports={metrics:w,sigmas:n,getCharacterMetrics:S}},{"./Style":9,"./fontMetricsData":18,"./unicodeRegexes":24}],18:[function(e,t,r){t.exports={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0], +8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0], +10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}}},{}],19:[function(e,t,r){var a=e("./utils");var i=e("./ParseError");var n=e("./parseData");var s=n.ParseNode;function l(e,r,a){if(typeof e==="string"){e=[e]}if(typeof r==="number"){r={numArgs:r}}var i={numArgs:r.numArgs,argTypes:r.argTypes,greediness:r.greediness===undefined?1:r.greediness,allowedInText:!!r.allowedInText,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,handler:a};for(var n=0;n","\\langle","\\rangle","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];var c={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};l(["\\blue","\\orange","\\pink","\\red","\\green","\\gray","\\purple","\\blueA","\\blueB","\\blueC","\\blueD","\\blueE","\\tealA","\\tealB","\\tealC","\\tealD","\\tealE","\\greenA","\\greenB","\\greenC","\\greenD","\\greenE","\\goldA","\\goldB","\\goldC","\\goldD","\\goldE","\\redA","\\redB","\\redC","\\redD","\\redE","\\maroonA","\\maroonB","\\maroonC","\\maroonD","\\maroonE","\\purpleA","\\purpleB","\\purpleC","\\purpleD","\\purpleE","\\mintA","\\mintB","\\mintC","\\grayA","\\grayB","\\grayC","\\grayD","\\grayE","\\grayF","\\grayG","\\grayH","\\grayI","\\kaBlue","\\kaGreen"],{numArgs:1,allowedInText:true,greediness:3},function(e,t){var r=t[0];return{type:"color",color:"katex-"+e.funcName.slice(1),value:o(r)}});l(["\\arcsin","\\arccos","\\arctan","\\arg","\\cos","\\cosh","\\cot","\\coth","\\csc","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\tan","\\tanh"],{numArgs:0},function(e){return{type:"op",limits:false,symbol:false,body:e.funcName}});l(["\\det","\\gcd","\\inf","\\lim","\\liminf","\\limsup","\\max","\\min","\\Pr","\\sup"],{numArgs:0},function(e){return{type:"op",limits:true,symbol:false,body:e.funcName}});l(["\\int","\\iint","\\iiint","\\oint"],{numArgs:0},function(e){return{type:"op",limits:false,symbol:true,body:e.funcName}});l(["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint"],{numArgs:0},function(e){return{type:"op",limits:true,symbol:true,body:e.funcName}});l("\\mathop",{numArgs:1},function(e,t){var r=t[0];return{type:"op",limits:false,symbol:false,value:o(r)}});l(["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac"],{numArgs:2,greediness:2},function(e,t){var r=t[0];var a=t[1];var i;var n=null;var s=null;var l="auto";switch(e.funcName){case"\\dfrac":case"\\frac":case"\\tfrac":i=true;break;case"\\\\atopfrac":i=false;break;case"\\dbinom":case"\\binom":case"\\tbinom":i=false;n="(";s=")";break;default:throw new Error("Unrecognized genfrac command")}switch(e.funcName){case"\\dfrac":case"\\dbinom":l="display";break;case"\\tfrac":case"\\tbinom":l="text";break}return{type:"genfrac",numer:r,denom:a,hasBarLine:i,leftDelim:n,rightDelim:s,size:l}});l(["\\llap","\\rlap"],{numArgs:1,allowedInText:true},function(e,t){var r=t[0];return{type:e.funcName.slice(1),body:r}});var m=function(e,t){if(a.contains(h,e.value)){return e}else{throw new i("Invalid delimiter: '"+e.value+"' after '"+t.funcName+"'",e)}};l(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],{numArgs:1},function(e,t){var r=m(t[0],e);return{type:"delimsizing",size:p[e.funcName].size,mclass:p[e.funcName].mclass,value:r.value}});l(["\\left","\\right"],{numArgs:1},function(e,t){var r=m(t[0],e);return{type:"leftright",value:r.value}});l("\\middle",{numArgs:1},function(e,t){var r=m(t[0],e);if(!e.parser.leftrightDepth){throw new i("\\middle without preceding \\left",r)}return{type:"middle",value:r.value}});l(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],0,null);l(["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],0,null);l(["\\mathrm","\\mathit","\\mathbf","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],{numArgs:1,greediness:2},function(e,t){var r=t[0];var a=e.funcName;if(a in c){a=c[a]}return{type:"font",font:a.slice(1),body:r}});l(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot"],{numArgs:1},function(e,t){var r=t[0];return{type:"accent",accent:e.funcName,base:r}});l(["\\over","\\choose","\\atop"],{numArgs:0,infix:true},function(e){var t;switch(e.funcName){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",replaceWith:t,token:e.token}});l(["\\\\","\\cr"],{numArgs:0,numOptionalArgs:1,argTypes:["size"]},function(e,t){var r=t[0];return{type:"cr",size:r}});l(["\\begin","\\end"],{numArgs:1,argTypes:["text"]},function(e,t){var r=t[0];if(r.type!=="ordgroup"){throw new i("Invalid environment name",r)}var a="";for(var n=0;n";return e};function n(e){this.text=e}n.prototype.toNode=function(){return document.createTextNode(this.text)};n.prototype.toMarkup=function(){return a.escape(this.text)};t.exports={MathNode:i,TextNode:n}},{"./utils":25}],21:[function(e,t,r){function a(e,t,r,a,i){this.type=e;this.value=t;this.mode=r;if(a&&(!i||i.lexer===a.lexer)){this.lexer=a.lexer;this.start=a.start;this.end=(i||a).end}}t.exports={ParseNode:a}},{}],22:[function(e,t,r){var a=e("./Parser");var i=function(e,t){if(!(typeof e==="string"||e instanceof String)){throw new TypeError("KaTeX can only parse string typed expression")}var r=new a(e,t);return r.parse()};t.exports=i},{"./Parser":7}],23:[function(e,t,r){t.exports={math:{},text:{}};function a(e,r,a,i,n){t.exports[e][n]={font:r,group:a,replace:i}}var i="math";var n="text";var s="main";var l="ams";var o="accent";var u="bin";var p="close";var h="inner";var c="mathord";var m="op";var f="open";var v="punct";var d="rel";var g="spacing";var y="textord";a(i,s,d,"\u2261","\\equiv");a(i,s,d,"\u227a","\\prec");a(i,s,d,"\u227b","\\succ");a(i,s,d,"\u223c","\\sim");a(i,s,d,"\u22a5","\\perp");a(i,s,d,"\u2aaf","\\preceq");a(i,s,d,"\u2ab0","\\succeq");a(i,s,d,"\u2243","\\simeq");a(i,s,d,"\u2223","\\mid");a(i,s,d,"\u226a","\\ll");a(i,s,d,"\u226b","\\gg");a(i,s,d,"\u224d","\\asymp");a(i,s,d,"\u2225","\\parallel");a(i,s,d,"\u22c8","\\bowtie");a(i,s,d,"\u2323","\\smile");a(i,s,d,"\u2291","\\sqsubseteq");a(i,s,d,"\u2292","\\sqsupseteq");a(i,s,d,"\u2250","\\doteq");a(i,s,d,"\u2322","\\frown");a(i,s,d,"\u220b","\\ni");a(i,s,d,"\u221d","\\propto");a(i,s,d,"\u22a2","\\vdash");a(i,s,d,"\u22a3","\\dashv");a(i,s,d,"\u220b","\\owns");a(i,s,v,".","\\ldotp");a(i,s,v,"\u22c5","\\cdotp");a(i,s,y,"#","\\#");a(n,s,y,"#","\\#");a(i,s,y,"&","\\&");a(n,s,y,"&","\\&");a(i,s,y,"\u2135","\\aleph");a(i,s,y,"\u2200","\\forall");a(i,s,y,"\u210f","\\hbar");a(i,s,y,"\u2203","\\exists");a(i,s,y,"\u2207","\\nabla");a(i,s,y,"\u266d","\\flat");a(i,s,y,"\u2113","\\ell");a(i,s,y,"\u266e","\\natural");a(i,s,y,"\u2663","\\clubsuit");a(i,s,y,"\u2118","\\wp");a(i,s,y,"\u266f","\\sharp");a(i,s,y,"\u2662","\\diamondsuit");a(i,s,y,"\u211c","\\Re");a(i,s,y,"\u2661","\\heartsuit");a(i,s,y,"\u2111","\\Im");a(i,s,y,"\u2660","\\spadesuit");a(i,s,y,"\u2020","\\dag");a(i,s,y,"\u2021","\\ddag");a(i,s,p,"\u23b1","\\rmoustache");a(i,s,f,"\u23b0","\\lmoustache");a(i,s,p,"\u27ef","\\rgroup");a(i,s,f,"\u27ee","\\lgroup");a(i,s,u,"\u2213","\\mp");a(i,s,u,"\u2296","\\ominus");a(i,s,u,"\u228e","\\uplus");a(i,s,u,"\u2293","\\sqcap");a(i,s,u,"\u2217","\\ast");a(i,s,u,"\u2294","\\sqcup");a(i,s,u,"\u25ef","\\bigcirc");a(i,s,u,"\u2219","\\bullet");a(i,s,u,"\u2021","\\ddagger");a(i,s,u,"\u2240","\\wr");a(i,s,u,"\u2a3f","\\amalg");a(i,s,d,"\u27f5","\\longleftarrow");a(i,s,d,"\u21d0","\\Leftarrow");a(i,s,d,"\u27f8","\\Longleftarrow");a(i,s,d,"\u27f6","\\longrightarrow");a(i,s,d,"\u21d2","\\Rightarrow");a(i,s,d,"\u27f9","\\Longrightarrow");a(i,s,d,"\u2194","\\leftrightarrow");a(i,s,d,"\u27f7","\\longleftrightarrow");a(i,s,d,"\u21d4","\\Leftrightarrow");a(i,s,d,"\u27fa","\\Longleftrightarrow");a(i,s,d,"\u21a6","\\mapsto");a(i,s,d,"\u27fc","\\longmapsto");a(i,s,d,"\u2197","\\nearrow");a(i,s,d,"\u21a9","\\hookleftarrow");a(i,s,d,"\u21aa","\\hookrightarrow");a(i,s,d,"\u2198","\\searrow");a(i,s,d,"\u21bc","\\leftharpoonup");a(i,s,d,"\u21c0","\\rightharpoonup");a(i,s,d,"\u2199","\\swarrow");a(i,s,d,"\u21bd","\\leftharpoondown");a(i,s,d,"\u21c1","\\rightharpoondown");a(i,s,d,"\u2196","\\nwarrow");a(i,s,d,"\u21cc","\\rightleftharpoons");a(i,l,d,"\u226e","\\nless");a(i,l,d,"\ue010","\\nleqslant");a(i,l,d,"\ue011","\\nleqq");a(i,l,d,"\u2a87","\\lneq");a(i,l,d,"\u2268","\\lneqq");a(i,l,d,"\ue00c","\\lvertneqq");a(i,l,d,"\u22e6","\\lnsim");a(i,l,d,"\u2a89","\\lnapprox");a(i,l,d,"\u2280","\\nprec");a(i,l,d,"\u22e0","\\npreceq");a(i,l,d,"\u22e8","\\precnsim");a(i,l,d,"\u2ab9","\\precnapprox");a(i,l,d,"\u2241","\\nsim");a(i,l,d,"\ue006","\\nshortmid");a(i,l,d,"\u2224","\\nmid");a(i,l,d,"\u22ac","\\nvdash");a(i,l,d,"\u22ad","\\nvDash");a(i,l,d,"\u22ea","\\ntriangleleft");a(i,l,d,"\u22ec","\\ntrianglelefteq");a(i,l,d,"\u228a","\\subsetneq");a(i,l,d,"\ue01a","\\varsubsetneq");a(i,l,d,"\u2acb","\\subsetneqq");a(i,l,d,"\ue017","\\varsubsetneqq");a(i,l,d,"\u226f","\\ngtr");a(i,l,d,"\ue00f","\\ngeqslant");a(i,l,d,"\ue00e","\\ngeqq");a(i,l,d,"\u2a88","\\gneq");a(i,l,d,"\u2269","\\gneqq");a(i,l,d,"\ue00d","\\gvertneqq");a(i,l,d,"\u22e7","\\gnsim");a(i,l,d,"\u2a8a","\\gnapprox");a(i,l,d,"\u2281","\\nsucc");a(i,l,d,"\u22e1","\\nsucceq");a(i,l,d,"\u22e9","\\succnsim");a(i,l,d,"\u2aba","\\succnapprox");a(i,l,d,"\u2246","\\ncong");a(i,l,d,"\ue007","\\nshortparallel");a(i,l,d,"\u2226","\\nparallel");a(i,l,d,"\u22af","\\nVDash");a(i,l,d,"\u22eb","\\ntriangleright");a(i,l,d,"\u22ed","\\ntrianglerighteq");a(i,l,d,"\ue018","\\nsupseteqq");a(i,l,d,"\u228b","\\supsetneq");a(i,l,d,"\ue01b","\\varsupsetneq");a(i,l,d,"\u2acc","\\supsetneqq");a(i,l,d,"\ue019","\\varsupsetneqq");a(i,l,d,"\u22ae","\\nVdash");a(i,l,d,"\u2ab5","\\precneqq");a(i,l,d,"\u2ab6","\\succneqq");a(i,l,d,"\ue016","\\nsubseteqq");a(i,l,u,"\u22b4","\\unlhd");a(i,l,u,"\u22b5","\\unrhd");a(i,l,d,"\u219a","\\nleftarrow");a(i,l,d,"\u219b","\\nrightarrow");a(i,l,d,"\u21cd","\\nLeftarrow");a(i,l,d,"\u21cf","\\nRightarrow");a(i,l,d,"\u21ae","\\nleftrightarrow");a(i,l,d,"\u21ce","\\nLeftrightarrow");a(i,l,d,"\u25b3","\\vartriangle");a(i,l,y,"\u210f","\\hslash");a(i,l,y,"\u25bd","\\triangledown");a(i,l,y,"\u25ca","\\lozenge");a(i,l,y,"\u24c8","\\circledS");a(i,l,y,"\xae","\\circledR");a(i,l,y,"\u2221","\\measuredangle");a(i,l,y,"\u2204","\\nexists");a(i,l,y,"\u2127","\\mho");a(i,l,y,"\u2132","\\Finv");a(i,l,y,"\u2141","\\Game");a(i,l,y,"k","\\Bbbk");a(i,l,y,"\u2035","\\backprime");a(i,l,y,"\u25b2","\\blacktriangle");a(i,l,y,"\u25bc","\\blacktriangledown");a(i,l,y,"\u25a0","\\blacksquare");a(i,l,y,"\u29eb","\\blacklozenge");a(i,l,y,"\u2605","\\bigstar");a(i,l,y,"\u2222","\\sphericalangle");a(i,l,y,"\u2201","\\complement");a(i,l,y,"\xf0","\\eth");a(i,l,y,"\u2571","\\diagup");a(i,l,y,"\u2572","\\diagdown");a(i,l,y,"\u25a1","\\square");a(i,l,y,"\u25a1","\\Box");a(i,l,y,"\u25ca","\\Diamond");a(i,l,y,"\xa5","\\yen");a(i,l,y,"\u2713","\\checkmark");a(i,l,y,"\u2136","\\beth");a(i,l,y,"\u2138","\\daleth");a(i,l,y,"\u2137","\\gimel");a(i,l,y,"\u03dd","\\digamma");a(i,l,y,"\u03f0","\\varkappa");a(i,l,f,"\u250c","\\ulcorner");a(i,l,p,"\u2510","\\urcorner");a(i,l,f,"\u2514","\\llcorner");a(i,l,p,"\u2518","\\lrcorner");a(i,l,d,"\u2266","\\leqq");a(i,l,d,"\u2a7d","\\leqslant");a(i,l,d,"\u2a95","\\eqslantless");a(i,l,d,"\u2272","\\lesssim");a(i,l,d,"\u2a85","\\lessapprox");a(i,l,d,"\u224a","\\approxeq");a(i,l,u,"\u22d6","\\lessdot");a(i,l,d,"\u22d8","\\lll");a(i,l,d,"\u2276","\\lessgtr");a(i,l,d,"\u22da","\\lesseqgtr");a(i,l,d,"\u2a8b","\\lesseqqgtr");a(i,l,d,"\u2251","\\doteqdot");a(i,l,d,"\u2253","\\risingdotseq");a(i,l,d,"\u2252","\\fallingdotseq");a(i,l,d,"\u223d","\\backsim");a(i,l,d,"\u22cd","\\backsimeq");a(i,l,d,"\u2ac5","\\subseteqq");a(i,l,d,"\u22d0","\\Subset");a(i,l,d,"\u228f","\\sqsubset");a(i,l,d,"\u227c","\\preccurlyeq");a(i,l,d,"\u22de","\\curlyeqprec");a(i,l,d,"\u227e","\\precsim");a(i,l,d,"\u2ab7","\\precapprox");a(i,l,d,"\u22b2","\\vartriangleleft");a(i,l,d,"\u22b4","\\trianglelefteq");a(i,l,d,"\u22a8","\\vDash");a(i,l,d,"\u22aa","\\Vvdash");a(i,l,d,"\u2323","\\smallsmile");a(i,l,d,"\u2322","\\smallfrown");a(i,l,d,"\u224f","\\bumpeq");a(i,l,d,"\u224e","\\Bumpeq");a(i,l,d,"\u2267","\\geqq");a(i,l,d,"\u2a7e","\\geqslant");a(i,l,d,"\u2a96","\\eqslantgtr");a(i,l,d,"\u2273","\\gtrsim");a(i,l,d,"\u2a86","\\gtrapprox");a(i,l,u,"\u22d7","\\gtrdot");a(i,l,d,"\u22d9","\\ggg");a(i,l,d,"\u2277","\\gtrless");a(i,l,d,"\u22db","\\gtreqless");a(i,l,d,"\u2a8c","\\gtreqqless");a(i,l,d,"\u2256","\\eqcirc");a(i,l,d,"\u2257","\\circeq");a(i,l,d,"\u225c","\\triangleq");a(i,l,d,"\u223c","\\thicksim");a(i,l,d,"\u2248","\\thickapprox");a(i,l,d,"\u2ac6","\\supseteqq");a(i,l,d,"\u22d1","\\Supset");a(i,l,d,"\u2290","\\sqsupset");a(i,l,d,"\u227d","\\succcurlyeq");a(i,l,d,"\u22df","\\curlyeqsucc");a(i,l,d,"\u227f","\\succsim");a(i,l,d,"\u2ab8","\\succapprox");a(i,l,d,"\u22b3","\\vartriangleright");a(i,l,d,"\u22b5","\\trianglerighteq");a(i,l,d,"\u22a9","\\Vdash");a(i,l,d,"\u2223","\\shortmid");a(i,l,d,"\u2225","\\shortparallel");a(i,l,d,"\u226c","\\between");a(i,l,d,"\u22d4","\\pitchfork");a(i,l,d,"\u221d","\\varpropto");a(i,l,d,"\u25c0","\\blacktriangleleft");a(i,l,d,"\u2234","\\therefore");a(i,l,d,"\u220d","\\backepsilon");a(i,l,d,"\u25b6","\\blacktriangleright");a(i,l,d,"\u2235","\\because");a(i,l,d,"\u22d8","\\llless");a(i,l,d,"\u22d9","\\gggtr");a(i,l,u,"\u22b2","\\lhd");a(i,l,u,"\u22b3","\\rhd");a(i,l,d,"\u2242","\\eqsim");a(i,s,d,"\u22c8","\\Join");a(i,l,d,"\u2251","\\Doteq");a(i,l,u,"\u2214","\\dotplus");a(i,l,u,"\u2216","\\smallsetminus");a(i,l,u,"\u22d2","\\Cap");a(i,l,u,"\u22d3","\\Cup");a(i,l,u,"\u2a5e","\\doublebarwedge");a(i,l,u,"\u229f","\\boxminus");a(i,l,u,"\u229e","\\boxplus");a(i,l,u,"\u22c7","\\divideontimes");a(i,l,u,"\u22c9","\\ltimes");a(i,l,u,"\u22ca","\\rtimes");a(i,l,u,"\u22cb","\\leftthreetimes");a(i,l,u,"\u22cc","\\rightthreetimes");a(i,l,u,"\u22cf","\\curlywedge");a(i,l,u,"\u22ce","\\curlyvee");a(i,l,u,"\u229d","\\circleddash");a(i,l,u,"\u229b","\\circledast");a(i,l,u,"\u22c5","\\centerdot");a(i,l,u,"\u22ba","\\intercal");a(i,l,u,"\u22d2","\\doublecap");a(i,l,u,"\u22d3","\\doublecup");a(i,l,u,"\u22a0","\\boxtimes");a(i,l,d,"\u21e2","\\dashrightarrow");a(i,l,d,"\u21e0","\\dashleftarrow");a(i,l,d,"\u21c7","\\leftleftarrows");a(i,l,d,"\u21c6","\\leftrightarrows");a(i,l,d,"\u21da","\\Lleftarrow");a(i,l,d,"\u219e","\\twoheadleftarrow");a(i,l,d,"\u21a2","\\leftarrowtail");a(i,l,d,"\u21ab","\\looparrowleft");a(i,l,d,"\u21cb","\\leftrightharpoons");a(i,l,d,"\u21b6","\\curvearrowleft");a(i,l,d,"\u21ba","\\circlearrowleft");a(i,l,d,"\u21b0","\\Lsh");a(i,l,d,"\u21c8","\\upuparrows");a(i,l,d,"\u21bf","\\upharpoonleft");a(i,l,d,"\u21c3","\\downharpoonleft");a(i,l,d,"\u22b8","\\multimap");a(i,l,d,"\u21ad","\\leftrightsquigarrow");a(i,l,d,"\u21c9","\\rightrightarrows");a(i,l,d,"\u21c4","\\rightleftarrows");a(i,l,d,"\u21a0","\\twoheadrightarrow");a(i,l,d,"\u21a3","\\rightarrowtail");a(i,l,d,"\u21ac","\\looparrowright");a(i,l,d,"\u21b7","\\curvearrowright");a(i,l,d,"\u21bb","\\circlearrowright");a(i,l,d,"\u21b1","\\Rsh");a(i,l,d,"\u21ca","\\downdownarrows");a(i,l,d,"\u21be","\\upharpoonright");a(i,l,d,"\u21c2","\\downharpoonright");a(i,l,d,"\u21dd","\\rightsquigarrow");a(i,l,d,"\u21dd","\\leadsto");a(i,l,d,"\u21db","\\Rrightarrow");a(i,l,d,"\u21be","\\restriction");a(i,s,y,"\u2018","`");a(i,s,y,"$","\\$");a(n,s,y,"$","\\$");a(i,s,y,"%","\\%");a(n,s,y,"%","\\%");a(i,s,y,"_","\\_");a(n,s,y,"_","\\_");a(i,s,y,"\u2220","\\angle");a(i,s,y,"\u221e","\\infty");a(i,s,y,"\u2032","\\prime");a(i,s,y,"\u25b3","\\triangle");a(i,s,y,"\u0393","\\Gamma");a(i,s,y,"\u0394","\\Delta");a(i,s,y,"\u0398","\\Theta");a(i,s,y,"\u039b","\\Lambda");a(i,s,y,"\u039e","\\Xi");a(i,s,y,"\u03a0","\\Pi");a(i,s,y,"\u03a3","\\Sigma");a(i,s,y,"\u03a5","\\Upsilon");a(i,s,y,"\u03a6","\\Phi");a(i,s,y,"\u03a8","\\Psi");a(i,s,y,"\u03a9","\\Omega");a(i,s,y,"\xac","\\neg");a(i,s,y,"\xac","\\lnot");a(i,s,y,"\u22a4","\\top");a(i,s,y,"\u22a5","\\bot");a(i,s,y,"\u2205","\\emptyset");a(i,l,y,"\u2205","\\varnothing");a(i,s,c,"\u03b1","\\alpha");a(i,s,c,"\u03b2","\\beta");a(i,s,c,"\u03b3","\\gamma");a(i,s,c,"\u03b4","\\delta");a(i,s,c,"\u03f5","\\epsilon");a(i,s,c,"\u03b6","\\zeta");a(i,s,c,"\u03b7","\\eta");a(i,s,c,"\u03b8","\\theta");a(i,s,c,"\u03b9","\\iota");a(i,s,c,"\u03ba","\\kappa");a(i,s,c,"\u03bb","\\lambda");a(i,s,c,"\u03bc","\\mu");a(i,s,c,"\u03bd","\\nu");a(i,s,c,"\u03be","\\xi");a(i,s,c,"o","\\omicron");a(i,s,c,"\u03c0","\\pi");a(i,s,c,"\u03c1","\\rho");a(i,s,c,"\u03c3","\\sigma");a(i,s,c,"\u03c4","\\tau");a(i,s,c,"\u03c5","\\upsilon");a(i,s,c,"\u03d5","\\phi");a(i,s,c,"\u03c7","\\chi");a(i,s,c,"\u03c8","\\psi");a(i,s,c,"\u03c9","\\omega");a(i,s,c,"\u03b5","\\varepsilon");a(i,s,c,"\u03d1","\\vartheta");a(i,s,c,"\u03d6","\\varpi");a(i,s,c,"\u03f1","\\varrho");a(i,s,c,"\u03c2","\\varsigma");a(i,s,c,"\u03c6","\\varphi");a(i,s,u,"\u2217","*");a(i,s,u,"+","+");a(i,s,u,"\u2212","-");a(i,s,u,"\u22c5","\\cdot");a(i,s,u,"\u2218","\\circ");a(i,s,u,"\xf7","\\div");a(i,s,u,"\xb1","\\pm");a(i,s,u,"\xd7","\\times");a(i,s,u,"\u2229","\\cap");a(i,s,u,"\u222a","\\cup");a(i,s,u,"\u2216","\\setminus");a(i,s,u,"\u2227","\\land");a(i,s,u,"\u2228","\\lor");a(i,s,u,"\u2227","\\wedge");a(i,s,u,"\u2228","\\vee");a(i,s,y,"\u221a","\\surd");a(i,s,f,"(","(");a(i,s,f,"[","[");a(i,s,f,"\u27e8","\\langle");a(i,s,f,"\u2223","\\lvert");a(i,s,f,"\u2225","\\lVert");a(i,s,p,")",")");a(i,s,p,"]","]");a(i,s,p,"?","?");a(i,s,p,"!","!");a(i,s,p,"\u27e9","\\rangle");a(i,s,p,"\u2223","\\rvert");a(i,s,p,"\u2225","\\rVert");a(i,s,d,"=","=");a(i,s,d,"<","<");a(i,s,d,">",">");a(i,s,d,":",":");a(i,s,d,"\u2248","\\approx");a(i,s,d,"\u2245","\\cong");a(i,s,d,"\u2265","\\ge");a(i,s,d,"\u2265","\\geq");a(i,s,d,"\u2190","\\gets");a(i,s,d,">","\\gt");a(i,s,d,"\u2208","\\in");a(i,s,d,"\u2209","\\notin");a(i,s,d,"\u2282","\\subset");a(i,s,d,"\u2283","\\supset");a(i,s,d,"\u2286","\\subseteq");a(i,s,d,"\u2287","\\supseteq");a(i,l,d,"\u2288","\\nsubseteq");a(i,l,d,"\u2289","\\nsupseteq");a(i,s,d,"\u22a8","\\models");a(i,s,d,"\u2190","\\leftarrow");a(i,s,d,"\u2264","\\le");a(i,s,d,"\u2264","\\leq");a(i,s,d,"<","\\lt");a(i,s,d,"\u2260","\\ne");a(i,s,d,"\u2260","\\neq");a(i,s,d,"\u2192","\\rightarrow");a(i,s,d,"\u2192","\\to");a(i,l,d,"\u2271","\\ngeq");a(i,l,d,"\u2270","\\nleq");a(i,s,g,null,"\\!");a(i,s,g,"\xa0","\\ ");a(i,s,g,"\xa0","~");a(i,s,g,null,"\\,");a(i,s,g,null,"\\:");a(i,s,g,null,"\\;");a(i,s,g,null,"\\enspace");a(i,s,g,null,"\\qquad");a(i,s,g,null,"\\quad");a(i,s,g,"\xa0","\\space");a(i,s,v,",",",");a(i,s,v,";",";");a(i,s,v,":","\\colon");a(i,l,u,"\u22bc","\\barwedge");a(i,l,u,"\u22bb","\\veebar");a(i,s,u,"\u2299","\\odot");a(i,s,u,"\u2295","\\oplus");a(i,s,u,"\u2297","\\otimes");a(i,s,y,"\u2202","\\partial");a(i,s,u,"\u2298","\\oslash");a(i,l,u,"\u229a","\\circledcirc");a(i,l,u,"\u22a1","\\boxdot");a(i,s,u,"\u25b3","\\bigtriangleup");a(i,s,u,"\u25bd","\\bigtriangledown");a(i,s,u,"\u2020","\\dagger");a(i,s,u,"\u22c4","\\diamond");a(i,s,u,"\u22c6","\\star");a(i,s,u,"\u25c3","\\triangleleft");a(i,s,u,"\u25b9","\\triangleright");a(i,s,f,"{","\\{");a(n,s,y,"{","\\{");a(i,s,p,"}","\\}");a(n,s,y,"}","\\}");a(i,s,f,"{","\\lbrace");a(i,s,p,"}","\\rbrace");a(i,s,f,"[","\\lbrack");a(i,s,p,"]","\\rbrack");a(i,s,f,"\u230a","\\lfloor");a(i,s,p,"\u230b","\\rfloor");a(i,s,f,"\u2308","\\lceil");a(i,s,p,"\u2309","\\rceil");a(i,s,y,"\\","\\backslash");a(i,s,y,"\u2223","|");a(i,s,y,"\u2223","\\vert");a(i,s,y,"\u2225","\\|");a(i,s,y,"\u2225","\\Vert");a(i,s,d,"\u2191","\\uparrow");a(i,s,d,"\u21d1","\\Uparrow");a(i,s,d,"\u2193","\\downarrow");a(i,s,d,"\u21d3","\\Downarrow");a(i,s,d,"\u2195","\\updownarrow");a(i,s,d,"\u21d5","\\Updownarrow");a(i,i,m,"\u2210","\\coprod");a(i,i,m,"\u22c1","\\bigvee");a(i,i,m,"\u22c0","\\bigwedge");a(i,i,m,"\u2a04","\\biguplus");a(i,i,m,"\u22c2","\\bigcap");a(i,i,m,"\u22c3","\\bigcup");a(i,i,m,"\u222b","\\int");a(i,i,m,"\u222b","\\intop");a(i,i,m,"\u222c","\\iint");a(i,i,m,"\u222d","\\iiint");a(i,i,m,"\u220f","\\prod");a(i,i,m,"\u2211","\\sum");a(i,i,m,"\u2a02","\\bigotimes");a(i,i,m,"\u2a01","\\bigoplus");a(i,i,m,"\u2a00","\\bigodot");a(i,i,m,"\u222e","\\oint");a(i,i,m,"\u2a06","\\bigsqcup");a(i,i,m,"\u222b","\\smallint");a(n,s,h,"\u2026","\\textellipsis");a(i,s,h,"\u2026","\\mathellipsis");a(n,s,h,"\u2026","\\ldots");a(i,s,h,"\u2026","\\ldots");a(i,s,h,"\u22ef","\\cdots");a(i,s,h,"\u22f1","\\ddots");a(i,s,y,"\u22ee","\\vdots");a(i,s,o,"\xb4","\\acute");a(i,s,o,"`","\\grave");a(i,s,o,"\xa8","\\ddot");a(i,s,o,"~","\\tilde");a(i,s,o,"\xaf","\\bar");a(i,s,o,"\u02d8","\\breve");a(i,s,o,"\u02c7","\\check");a(i,s,o,"^","\\hat");a(i,s,o,"\u20d7","\\vec");a(i,s,o,"\u02d9","\\dot");a(i,s,c,"\u0131","\\imath");a(i,s,c,"\u0237","\\jmath");a(n,s,y,"\u2013","--");a(n,s,y,"\u2014","---");a(n,s,y,"\u2018","`");a(n,s,y,"\u2019","'");a(n,s,y,"\u201c","``");a(n,s,y,"\u201d","''");a(i,s,y,"\xb0","\\degree");a(n,s,y,"\xb0","\\degree");a(i,s,c,"\xa3","\\pounds");a(i,l,y,"\u2720","\\maltese");a(n,l,y,"\u2720","\\maltese");a(n,s,g,"\xa0","\\ ");a(n,s,g,"\xa0"," ");a(n,s,g,"\xa0","~");var x;var b;var w='0123456789/@."';for(x=0;x":">","<":"<",'"':""","'":"'"};var p=/[&><"']/g;function h(e){return u[e]}function c(e){return(""+e).replace(p,h)}var m;if(typeof document!=="undefined"){var f=document.createElement("span");if("textContent"in f){m=function(e,t){e.textContent=t}}else{m=function(e,t){e.innerText=t}}}function v(e){m(e,"")}t.exports={contains:n,deflt:s,escape:c,hyphenate:o,indexOf:i,setTextContent:m,clearNode:v}},{}]},{},[1])(1)}); diff --git a/cshub-client/src/plugins/quill/mathquill.min.css b/cshub-client/public/assets/mathquill.min.css similarity index 100% rename from cshub-client/src/plugins/quill/mathquill.min.css rename to cshub-client/public/assets/mathquill.min.css diff --git a/cshub-client/public/assets/mathquill.min.js b/cshub-client/public/assets/mathquill.min.js new file mode 100644 index 00000000..2952e214 --- /dev/null +++ b/cshub-client/public/assets/mathquill.min.js @@ -0,0 +1,12 @@ +/** + * MathQuill v0.10.1 http://mathquill.com + * by Han, Jeanine, and Mary maintainers@mathquill.com + * + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL + * was not distributed with this file, You can obtain + * one at http://mozilla.org/MPL/2.0/. + */ +!function(){function t(){}function e(t){var e=t.length-1;return function(){var n=kt.call(arguments,0,e),i=kt.call(arguments,e);return t.apply(this,n.concat([i]))}}function n(t){return e(function(e,n){"function"!=typeof e&&(e=jt(e));var i=function(t){return e.apply(t,[t].concat(n))};return t.call(this,i)})}function i(t){var e=kt.call(arguments,1);return function(){return t.apply(this,e)}}function s(t,e){if(!e)throw new Error("prayer failed: "+t)}function r(t){s("a direction was passed",t===Tt||t===Ct)}function o(t,e,n){s("a parent is always present",t),s("leftward is properly set up",function(){return e?e[Ct]===n&&e.parent===t:t.ends[Tt]===n}()),s("rightward is properly set up",function(){return n?n[Tt]===e&&n.parent===t:t.ends[Ct]===e}())}function a(){window.console&&console.warn('You are using the MathQuill API without specifying an interface version, which will fail in v1.0.0. You can fix this easily by doing this before doing anything else:\n\n MathQuill = MathQuill.getInterface(1);\n // now MathQuill.MathField() works like it used to\n\nSee also the "`dev` branch (2014–2015) → v0.10.0 Migration Guide" at\n https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide')}function l(t){return a(),bt(t)}function c(e){function n(t){var e,n;return t&&t.nodeType?(e=Dt(t).children(".mq-root-block").attr(xt),n=e&&St.byId[e].controller,n?s[n.KIND_OF_MQ](n):null):null}function i(t,e){var n,i,r;e&&e.handlers&&(e.handlers={fns:e.handlers,APIClasses:s});for(n in e)e.hasOwnProperty(n)&&(i=e[n],r=Ft[n],t[n]=r?r(i):i)}var s,r,o;if(!(e>=g&&b>=e))throw"Only interface versions between "+g+" and "+b+" supported. You specified: "+e;s={},n.L=Tt,n.R=Ct,n.config=function(t){return i(Bt.p,t),this},n.registerEmbed=function(t,e){if(!/^[a-z][a-z0-9]*$/i.test(t))throw"Embed name must start with letter and be only letters and digits";Nt[t]=e},r=s.AbstractMathQuill=Qt($t,function(t){t.init=function(t){this.__controller=t,this.__options=t.options,this.id=t.id,this.data=t.data},t.__mathquillify=function(t){var e,n=this.__controller,i=n.root,s=n.container;n.createTextarea(),e=s.addClass(t).contents().detach(),i.jQ=Dt('').attr(xt,i.id).appendTo(s),this.latex(e.text()),this.revert=function(){return s.empty().unbind(".mathquill").removeClass("mq-editable-field mq-math-mode mq-text-mode").append(e)}},t.config=function(t){return i(this.__options,t),this},t.el=function(){return this.__controller.container[0]},t.text=function(){return this.__controller.exportText()},t.latex=function(t){return arguments.length>0?(this.__controller.renderLatexMath(t),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()},t.html=function(){return this.__controller.root.jQ.html().replace(/ mathquill-(?:command|block)-id="?\d+"?/g,"").replace(/.?<\/span>/i,"").replace(/ mq-hasCursor|mq-hasCursor ?/,"").replace(/ class=(""|(?= |>))/g,"")},t.reflow=function(){return this.__controller.root.postOrder("reflow"),this}}),n.prototype=r.prototype,s.EditableField=Qt(r,function(e,n){e.__mathquillify=function(){return n.__mathquillify.apply(this,arguments),this.__controller.editable=!0,this.__controller.delegateMouseEvents(),this.__controller.editablesTextareaEvents(),this},e.focus=function(){return this.__controller.textarea.focus(),this},e.blur=function(){return this.__controller.textarea.blur(),this},e.write=function(t){return this.__controller.writeLatex(t),this.__controller.scrollHoriz(),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this},e.cmd=function(t){var e,n=this.__controller.notify(),i=n.cursor;return/^\\[a-z]+$/i.test(t)?(t=t.slice(1),e=Et[t],e&&(t=e(t),i.selection&&t.replaces(i.replaceSelection()),t.createLeftOf(i.show()),this.__controller.scrollHoriz())):i.parent.write(i,t),n.blurred&&i.hide().parent.blur(),this},e.select=function(){var t=this.__controller;for(t.notify("move").cursor.insAtRightEnd(t.root);t.cursor[Tt];)t.selectLeft();return this},e.clearSelection=function(){return this.__controller.cursor.clearSelection(),this},e.moveToDirEnd=function(t){return this.__controller.notify("move").cursor.insAtDirEnd(t,this.__controller.root),this},e.moveToLeftEnd=function(){return this.moveToDirEnd(Tt)},e.moveToRightEnd=function(){return this.moveToDirEnd(Ct)},e.keystroke=function(e){var n;for(e=e.replace(/^\s+|\s+$/g,"").split(/\s+/),n=0;n&0"})}function f(t){var e=this.parent,n=t;do{if(n[Ct])return t.insLeftOf(e);n=n.parent.parent}while(n!==e);t.insRightOf(e)}function p(t,e){t.jQadd=function(){e.jQadd.apply(this,arguments),this.delimjQs=this.jQ.children(":first").add(this.jQ.children(":last")),this.contentjQ=this.jQ.children(":eq(1)")},t.reflow=function(){var t=this.contentjQ.outerHeight()/parseFloat(this.contentjQ.css("fontSize"));Y(this.delimjQs,yt(1+.2*(t-1),1.2),1.2*t)}}function d(t,e){var e=e||t,n=pt[t],s=pt[e];At[t]=i(ft,Tt,t,n,e,s),At[n]=i(ft,Ct,t,n,e,s)}var m,g,b,v,w,q,x,y,O,k,j,Q,T,C,D,_,S,L,E,A,R,I,z,M,B,F,$,N,P,U,W,H,G,K,Y,X,Z,V,J,tt,et,nt,it,st,rt,ot,at,lt,ct,ut,ht,ft,pt,dt,mt,gt,bt,vt,wt=window.jQuery,qt="mathquill-command-id",xt="mathquill-block-id",yt=Math.min,Ot=Math.max,kt=[].slice,jt=e(function(t,n){return e(function(e,i){return t in e?e[t].apply(e,n.concat(i)):void 0})}),Qt=function(t,e,n){function i(t){return"object"==typeof t}function s(t){return"function"==typeof t}function r(){}return function o(a,l){function c(){var t=new u;return s(t.init)&&t.init.apply(t,arguments),t}function u(){}var h,f,p;return l===n&&(l=a,a=Object),c.Bare=u,h=r[t]=a[t],f=u[t]=c[t]=c.p=new r,f.constructor=c,c.mixin=function(e){return u[t]=c[t]=o(c,e)[t],c},(c.open=function(t){if(p={},s(t)?p=t.call(c,f,h,c,a):i(t)&&(p=t),i(p))for(var n in p)e.call(p,n)&&(f[n]=p[n]);return s(f.init)||(f.init=a),c})(l)}}("prototype",{}.hasOwnProperty),Tt=-1,Ct=1,Dt=Qt(wt,function(t){t.insDirOf=function(t,e){return t===Tt?this.insertBefore(e.first()):this.insertAfter(e.last())},t.insAtDirEnd=function(t,e){return t===Tt?this.prependTo(e):this.appendTo(e)}}),_t=Qt(function(t){t.parent=0,t[Tt]=0,t[Ct]=0,t.init=function(t,e,n){this.parent=t,this[Tt]=e,this[Ct]=n},this.copy=function(t){return _t(t.parent,t[Tt],t[Ct])}}),St=Qt(function(t){function e(){return i+=1}t[Tt]=0,t[Ct]=0,t.parent=0;var i=0;this.byId={},t.init=function(){this.id=e(),St.byId[this.id]=this,this.ends={},this.ends[Tt]=0,this.ends[Ct]=0},t.dispose=function(){delete St.byId[this.id]},t.toString=function(){return"{{ MathQuill Node #"+this.id+" }}"},t.jQ=Dt(),t.jQadd=function(t){return this.jQ=this.jQ.add(t)},t.jQize=function(t){function e(t){var n,i;for(t.getAttribute&&(n=t.getAttribute("mathquill-command-id"),i=t.getAttribute("mathquill-block-id"),n&&St.byId[n].jQadd(t),i&&St.byId[i].jQadd(t)),t=t.firstChild;t;t=t.nextSibling)e(t)}var n;for(t=Dt(t||this.html()),n=0;n');this.blink=function(){n.toggleClass("mq-blink")},this.upDownCache={}},t.show=function(){return this.jQ=this._jQ.removeClass("mq-blink"),"intervalId"in this?clearInterval(this.intervalId):(this[Ct]?this.selection&&this.selection.ends[Tt][Tt]===this[Tt]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[Ct].jQ.first()):this.jQ.appendTo(this.parent.jQ),this.parent.focus()),this.intervalId=setInterval(this.blink,500),this},t.hide=function(){return"intervalId"in this&&clearInterval(this.intervalId),delete this.intervalId,this.jQ.detach(),this.jQ=Dt(),this},t.withDirInsertAt=function(t,e,n,i){var s=this.parent;this.parent=e,this[t]=n,this[-t]=i,s!==e&&s.blur&&s.blur()},t.insDirOf=function(t,e){return r(t),this.jQ.insDirOf(t,e.jQ),this.withDirInsertAt(t,e.parent,e[t],e),this.parent.jQ.addClass("mq-hasCursor"),this},t.insLeftOf=function(t){return this.insDirOf(Tt,t)},t.insRightOf=function(t){return this.insDirOf(Ct,t)},t.insAtDirEnd=function(t,e){return r(t),this.jQ.insAtDirEnd(t,e.jQ),this.withDirInsertAt(t,e,0,e.ends[t]),e.focus(),this},t.insAtLeftEnd=function(t){return this.insAtDirEnd(Tt,t)},t.insAtRightEnd=function(t){return this.insAtDirEnd(Ct,t)},t.jumpUpDown=function(t,e){var n,i,s=this;s.upDownCache[t.id]=_t.copy(s),n=s.upDownCache[e.id],n?n[Ct]?s.insLeftOf(n[Ct]):s.insAtRightEnd(n.parent):(i=s.offset().left,e.seek(i,s))},t.offset=function(){var t=this,e=t.jQ.removeClass("mq-cursor").offset();return t.jQ.addClass("mq-cursor"),e},t.unwrapGramp=function(){var t=this.parent.parent,e=t.parent,n=t[Ct],i=this,s=t[Tt];if(t.disown().eachChild(function(i){i.isEmpty()||(i.children().adopt(e,s,n).each(function(e){e.jQ.insertBefore(t.jQ.first())}),s=i.ends[Ct])}),!this[Ct])if(this[Tt])this[Ct]=this[Tt][Ct];else for(;!this[Ct];){if(this.parent=this.parent[Ct],!this.parent){this[Ct]=t[Ct],this.parent=e;break}this[Ct]=this.parent.ends[Tt]}this[Ct]?this.insLeftOf(this[Ct]):this.insAtRightEnd(e),t.jQ.remove(),t[Tt].siblingDeleted&&t[Tt].siblingDeleted(i.options,Ct),t[Ct].siblingDeleted&&t[Ct].siblingDeleted(i.options,Tt)},t.startSelection=function(){var t,e=this.anticursor=_t.copy(this),n=e.ancestors={};for(t=e;t.parent;t=t.parent)n[t.parent.id]=t},t.endSelection=function(){delete this.anticursor},t.select=function(){var t,e,n,i,r,o,a,l=this.anticursor;if(this[Tt]===l[Tt]&&this.parent===l.parent)return!1;for(t=this;t.parent;t=t.parent)if(t.parent.id in l.ancestors){e=t.parent;break}if(s("cursor and anticursor in the same tree",e),n=l.ancestors[e.id],o=Ct,t[Tt]!==n)for(a=t;a;a=a[Ct])if(a[Ct]===n[Ct]){o=Tt,i=t,r=n;break}return o===Ct&&(i=n,r=t),i instanceof _t&&(i=i[Ct]),r instanceof _t&&(r=r[Tt]),this.hide().selection=e.selectChildren(i,r),this.insDirOf(o,this.selection.ends[o]),this.selectionChanged(),!0},t.clearSelection=function(){return this.selection&&(this.selection.clear(),delete this.selection,this.selectionChanged()),this},t.deleteSelection=function(){this.selection&&(this[Tt]=this.selection.ends[Tt][Tt],this[Ct]=this.selection.ends[Ct][Ct],this.selection.remove(),this.selectionChanged(),delete this.selection)},t.replaceSelection=function(){var t=this.selection;return t&&(this[Tt]=t.ends[Tt][Tt],this[Ct]=t.ends[Ct][Ct],delete this.selection),t}}),It=Qt(Lt,function(t,e){t.init=function(){e.init.apply(this,arguments),this.jQ=this.jQ.wrapAll('').parent()},t.adopt=function(){return this.jQ.replaceWith(this.jQ=this.jQ.children()),e.adopt.apply(this,arguments)},t.clear=function(){return this.jQ.replaceWith(this.jQ[0].childNodes),this},t.join=function(t){return this.fold("",function(e,n){return e+n[t]()})}}),zt=Qt(function(t){t.init=function(t,e,n){this.id=t.id,this.data={},this.root=t,this.container=e,this.options=n,t.controller=this,this.cursor=t.cursor=Rt(t,n)},t.handle=function(t,e){var n,i=this.options.handlers;i&&i.fns[t]&&(n=i.APIClasses[this.KIND_OF_MQ](this),e===Tt||e===Ct?i.fns[t](e,n):i.fns[t](n))};var e=[];this.onNotify=function(t){e.push(t)},t.notify=function(){for(var t=0;tu;u+=1)if(f=i._(n,o,a),!f)return r(n,c);for(;e>u&&f;u+=1)f=i._(n,o,l);return s(n,h)})},t.result=function(t){return this.then(a(t))},t.atMost=function(t){return this.times(0,t)},t.atLeast=function(t){var e=this;return e.times(t).then(function(t){return e.many().map(function(e){return t.concat(e)})})},t.map=function(t){return this.then(function(e){return a(t(e))})},t.skip=function(t){return this.then(function(e){return t.result(e)})},r=this.string=function(t){var e=t.length,i="expected '"+t+"'";return n(function(n,s,r){var o=n.slice(0,e);return o===t?s(n.slice(e),o):r(n,i)})},o=this.regex=function(t){s("regexp parser is anchored","^"===t.toString().charAt(1));var e="expected "+t;return n(function(n,i,s){var r,o=t.exec(n);return o?(r=o[0],i(n.slice(r.length),r)):s(n,e)})},a=n.succeed=function(t){return n(function(e,n){return n(e,t)})},l=n.fail=function(t){return n(function(e,n,i){return i(e,t)})},c=n.letter=o(/^[a-z]/i),u=n.letters=o(/^[a-z]*/i),h=n.digit=o(/^[0-9]/),f=n.digits=o(/^[0-9]*/),p=n.whitespace=o(/^\s+/),d=n.optWhitespace=o(/^\s*/),m=n.any=n(function(t,e,n){return t?e(t.slice(1),t.charAt(0)):n(t,"expected any character")}),g=n.all=n(function(t,e,n){return e("",t)}),b=n.eof=n(function(t,e,n){return t?n(t,"expected EOF"):e(t,t)})}),q=function(){function e(t){var e,i=t.which||t.keyCode,s=n[i],r=[];return t.ctrlKey&&r.push("Ctrl"),t.originalEvent&&t.originalEvent.metaKey&&r.push("Meta"),t.altKey&&r.push("Alt"),t.shiftKey&&r.push("Shift"),e=s||String.fromCharCode(i),r.length||s?(r.push(e),r.join("-")):e}var n={8:"Backspace",9:"Tab",10:"Enter",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Esc",32:"Spacebar",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Del",144:"NumLock"};return function(n,i){function s(t){q=t,clearTimeout(d),d=setTimeout(t)}function r(e){q(),q=t,clearTimeout(d),v.val(e),e&&v[0].select&&v[0].select(),m=!!e}function o(){var t=v[0];return"selectionStart"in t?t.selectionStart!==t.selectionEnd:!1}function a(){i.keystroke(e(g),g)}function l(e){g=e,b=null,m&&s(function(e){e&&"focusout"===e.type||!v[0].select||v[0].select(),q=t,clearTimeout(d)}),a()}function c(t){g&&b&&a(),b=t,s(u)}function u(){if(!o()){var t=v.val();1===t.length?(v.val(""),i.typedText(t)):t&&v[0].select&&v[0].select()}}function h(){g=b=null}function f(t){v.focus(),s(p)}function p(){var t=v.val();v.val(""),t&&i.paste(t)}var d,m,g=null,b=null,v=wt(n),w=wt(i.container||v),q=t;return w.bind("keydown keypress input keyup focusout paste",function(t){q(t)}),m=!1,w.bind({keydown:l,keypress:c,focusout:h,paste:f}),{select:r}}}(),zt.open(function(t,e){t.exportText=function(){return this.root.foldChildren("",function(t,e){return t+e.text()})}}),zt.open(function(t){t.focusBlurEvents=function(){function t(){clearTimeout(n),r.selection&&r.selection.jQ.addClass("mq-blur"),e()}function e(){r.hide().parent.blur(),i.container.removeClass("mq-focused"),Dt(window).off("blur",t)}var n,i=this,s=i.root,r=i.cursor;i.textarea.focus(function(){i.blurred=!1,clearTimeout(n),i.container.addClass("mq-focused"),r.parent||r.insAtRightEnd(s),r.selection?(r.selection.jQ.removeClass("mq-blur"),i.selectionChanged()):r.show()}).blur(function(){i.blurred=!0,n=setTimeout(function(){s.postOrder("intentionalBlur"),r.clearSelection().endSelection(),e()}),Dt(window).on("blur",t)}),i.blurred=!0,r.hide().parent.blur()}}),zt.open(function(t){t.keystroke=function(t,e){this.cursor.parent.keystroke(t,e,this)}}),St.open(function(t){t.keystroke=function(t,e,n){var i=n.cursor;switch(t){case"Ctrl-Shift-Backspace":case"Ctrl-Backspace":n.ctrlDeleteDir(Tt);break;case"Shift-Backspace":case"Backspace":n.backspace();break;case"Esc":case"Tab":return void n.escapeDir(Ct,t,e);case"Shift-Tab":case"Shift-Esc":return void n.escapeDir(Tt,t,e);case"End":n.notify("move").cursor.insAtRightEnd(i.parent);break;case"Ctrl-End":n.notify("move").cursor.insAtRightEnd(n.root);break;case"Shift-End":for(;i[Ct];)n.selectRight();break;case"Ctrl-Shift-End":for(;i[Ct]||i.parent!==n.root;)n.selectRight();break;case"Home":n.notify("move").cursor.insAtLeftEnd(i.parent);break;case"Ctrl-Home":n.notify("move").cursor.insAtLeftEnd(n.root);break;case"Shift-Home":for(;i[Tt];)n.selectLeft();break;case"Ctrl-Shift-Home":for(;i[Tt]||i.parent!==n.root;)n.selectLeft();break;case"Left":n.moveLeft();break;case"Shift-Left":n.selectLeft();break;case"Ctrl-Left":break;case"Right":n.moveRight();break;case"Shift-Right":n.selectRight();break;case"Ctrl-Right":break;case"Up":n.moveUp();break;case"Down":n.moveDown();break;case"Shift-Up":if(i[Tt])for(;i[Tt];)n.selectLeft();else n.selectLeft();case"Shift-Down":if(i[Ct])for(;i[Ct];)n.selectRight();else n.selectRight();case"Ctrl-Up":break;case"Ctrl-Down":break;case"Ctrl-Shift-Del":case"Ctrl-Del":n.ctrlDeleteDir(Ct);break;case"Shift-Del":case"Del":n.deleteForward();break;case"Meta-A":case"Ctrl-A":for(n.notify("move").cursor.insAtRightEnd(n.root);i[Tt];)n.selectLeft();break;default:return}e.preventDefault(),n.scrollHoriz()},t.moveOutOf=t.moveTowards=t.deleteOutOf=t.deleteTowards=t.unselectInto=t.selectOutOf=t.selectTowards=function(){s("overridden or never called on this node")}}),zt.open(function(t){function e(t,e){var n=t.notify("upDown").cursor,i=e+"Into",s=e+"OutOf";return n[Ct][i]?n.insAtLeftEnd(n[Ct][i]):n[Tt][i]?n.insAtRightEnd(n[Tt][i]):n.parent.bubble(function(t){var e=t[s];return e&&("function"==typeof e&&(e=t[s](n)),e instanceof St&&n.jumpUpDown(t,e),e!==!0)?!1:void 0}),t}this.onNotify(function(t){("move"===t||"upDown"===t)&&this.show().clearSelection()}),t.escapeDir=function(t,e,n){r(t);var i=this.cursor;return i.parent!==this.root&&n.preventDefault(),i.parent!==this.root?(i.parent.moveOutOf(t,i),this.notify("move")):void 0},Ft.leftRightIntoCmdGoes=function(t){if(t&&"up"!==t&&"down"!==t)throw'"up" or "down" required for leftRightIntoCmdGoes option, got "'+t+'"';return t},t.moveDir=function(t){r(t);var e=this.cursor,n=e.options.leftRightIntoCmdGoes;return e.selection?e.insDirOf(t,e.selection.ends[t]):e[t]?e[t].moveTowards(t,e,n):e.parent.moveOutOf(t,e,n),this.notify("move")},t.moveLeft=function(){return this.moveDir(Tt)},t.moveRight=function(){return this.moveDir(Ct)},t.moveUp=function(){return e(this,"up")},t.moveDown=function(){return e(this,"down")},this.onNotify(function(t){"upDown"!==t&&(this.upDownCache={})}),this.onNotify(function(t){"edit"===t&&this.show().deleteSelection()}),t.deleteDir=function(t){var e,n;return r(t),e=this.cursor,n=e.selection,this.notify("edit"),n||(e[t]?e[t].deleteTowards(t,e):e.parent.deleteOutOf(t,e)),e[Tt].siblingDeleted&&e[Tt].siblingDeleted(e.options,Ct),e[Ct].siblingDeleted&&e[Ct].siblingDeleted(e.options,Tt),e.parent.bubble("reflow"),this},t.ctrlDeleteDir=function(t){r(t);var e=this.cursor;return!e[Tt]||e.selection?ctrlr.deleteDir():(this.notify("edit"),Lt(e.parent.ends[Tt],e[Tt]).remove(),e.insAtDirEnd(Tt,e.parent),e[Tt].siblingDeleted&&e[Tt].siblingDeleted(e.options,Ct),e[Ct].siblingDeleted&&e[Ct].siblingDeleted(e.options,Tt),e.parent.bubble("reflow"),this)},t.backspace=function(){return this.deleteDir(Tt)},t.deleteForward=function(){return this.deleteDir(Ct)},this.onNotify(function(t){"select"!==t&&this.endSelection()}),t.selectDir=function(t){var e,n=this.notify("select").cursor,i=n.selection;r(t),n.anticursor||n.startSelection(),e=n[t],e?i&&i.ends[t]===e&&n.anticursor[-t]!==e?e.unselectInto(t,n):e.selectTowards(t,n):n.parent.selectOutOf(t,n),n.clearSelection(),n.select()||n.show()},t.selectLeft=function(){return this.selectDir(Tt)},t.selectRight=function(){return this.selectDir(Ct)}}),x=function(){function t(t){var e=T();return t.adopt(e,0,0),e}function e(t){var e,n=t[0]||T();for(e=1;ei)e=i;else{if(!(s>0))return;e=n.left-s0)e=s;else{if(!(0>i))return;e=n.right-i>a.right-20?s:i}else if(t=r.jQ[0].getBoundingClientRect().left,t>a.right-20)e=t-(a.right-20);else{if(!(t")[0]},t.createTextarea=function(){var t,e=this.textareaSpan=Dt(''),n=this.options.substituteTextarea();if(!n.nodeType)throw"substituteTextarea() must return a DOM element, got "+n;n=this.textarea=Dt(n).appendTo(e),t=this,t.cursor.selectionChanged=function(){t.selectionChanged()},t.container.bind("copy",function(){t.setTextareaSelection()})},t.selectionChanged=function(){var t=this;X(t.container[0]),t.textareaSelectionTimeout===m&&(t.textareaSelectionTimeout=setTimeout(function(){t.setTextareaSelection()}))},t.setTextareaSelection=function(){this.textareaSelectionTimeout=m;var t="";this.cursor.selection&&(t=this.cursor.selection.join("latex"),this.options.statelessClipboard&&(t="$"+t+"$")),this.selectFn(t)},t.staticMathTextareaEvents=function(){function t(){s.detach(),e.blurred=!0}var e=this,n=(e.root,e.cursor),i=e.textarea,s=e.textareaSpan;this.container.prepend('$'+e.exportLatex()+"$"),e.blurred=!0,i.bind("cut paste",!1).focus(function(){e.blurred=!1}).blur(function(){n.selection&&n.selection.clear(),setTimeout(t)}),e.selectFn=function(t){i.val(t),t&&i.select()}},t.editablesTextareaEvents=function(){var t=this,e=(t.root,t.cursor),n=t.textarea,i=t.textareaSpan,s=q(n,this);this.selectFn=function(t){s.select(t)},this.container.prepend(i).on("cut",function(n){e.selection&&setTimeout(function(){t.notify("edit"),e.parent.bubble("reflow")})}),this.focusBlurEvents()},t.typedText=function(t){if("\n"===t)return this.handle("enter");var e=this.notify().cursor;e.parent.write(e,t),this.scrollHoriz()},t.paste=function(t){this.options.statelessClipboard&&(t="$"===t.slice(0,1)&&"$"===t.slice(-1)?t.slice(1,-1):"\\text{"+t+"}"),this.writeLatex(t).cursor.show()}}),y=Qt(St,function(t,e){t.finalizeInsert=function(t,e){var n=this;n.postOrder("finalizeTree",t),n.postOrder("contactWeld",e),n.postOrder("blur"),n.postOrder("reflow"),n[Ct].siblingCreated&&n[Ct].siblingCreated(t,Tt),n[Tt].siblingCreated&&n[Tt].siblingCreated(t,Ct),n.bubble("reflow")}}),O=Qt(y,function(t,e){t.init=function(t,n,i){var s=this;e.init.call(s),s.ctrlSeq||(s.ctrlSeq=t),n&&(s.htmlTemplate=n),i&&(s.textTemplate=i)},t.replaces=function(t){t.disown(),this.replacedFragment=t},t.isEmpty=function(){return this.foldChildren(!0,function(t,e){return t&&e.isEmpty()})},t.parser=function(){var t=x.block,e=this;return t.times(e.numBlocks()).map(function(t){e.blocks=t;for(var n=0;nt;t+=1)e=s[t]=T(),e.adopt(n,n.ends[Ct],0)},t.placeCursor=function(t){t.insAtRightEnd(this.foldChildren(this.ends[Tt],function(t,e){return t.isEmpty()?t:e}))},t.moveTowards=function(t,e,n){var i=n&&this[n+"Into"];e.insAtDirEnd(-t,i||this.ends[-t])},t.deleteTowards=function(t,e){this.isEmpty()?e[t]=this.remove()[t]:this.moveTowards(t,e,null)},t.selectTowards=function(t,e){e[-t]=this,e[t]=this[t]},t.selectChildren=function(){return It(this,this)},t.unselectInto=function(t,e){e.insAtDirEnd(-t,e.anticursor.ancestors[this.id])},t.seek=function(t,e){function n(t){var e={};return e[Tt]=t.jQ.offset().left,e[Ct]=e[Tt]+t.jQ.outerWidth(),e}var i,s=this,r=n(s);return tr[Ct]?e.insRightOf(s):(i=r[Tt],void s.eachChild(function(o){var a=n(o);return ta[Ct]?void(o[Ct]?i=a[Ct]:r[Ct]-t"===e.slice(-2))a[t]=e.slice(0,-2)+o+"/>";else if("<"===e.charAt(0)){s("not an unmatched top-level close tag","/"!==e.charAt(1)),a[t]=e.slice(0,-1)+o+">",n=1;do t+=1, + e=a[t],s("no missing close tags",e),""!==e.slice(-2)&&(n+=1);while(n>0)}return a.join("").replace(/>&(\d+)/g,function(t,e){return" mathquill-block-id="+r[e].id+">"+r[e].join("html")})},t.latex=function(){return this.foldChildren(this.ctrlSeq,function(t,e){return t+"{"+(e.latex()||" ")+"}"})},t.textTemplate=[""],t.text=function(){var t=this,e=0;return t.foldChildren(t.textTemplate[e],function(n,i){e+=1;var s=i.text();return n&&"("===t.textTemplate[e]&&"("===s[0]&&")"===s.slice(-1)?n+s.slice(1,-1)+t.textTemplate[e]:n+i.text()+(t.textTemplate[e]||"")})}}),k=Qt(O,function(e,n){e.init=function(t,e,i){i||(i=t&&t.length>1?t.slice(1):t),n.init.call(this,t,e,[i])},e.parser=function(){return w.succeed(this)},e.numBlocks=function(){return 0},e.replaces=function(t){t.remove()},e.createBlocks=t,e.moveTowards=function(t,e){e.jQ.insDirOf(t,this.jQ),e[-t]=this,e[t]=this[t]},e.deleteTowards=function(t,e){e[t]=this.remove()[t]},e.seek=function(t,e){t-this.jQ.offset().left"+(n||t)+"")}}),Q=Qt(k,function(t,e){t.init=function(t,n,i){e.init.call(this,t,''+n+"",i)}}),T=Qt(y,function(t,e){t.join=function(t){return this.foldChildren("",function(e,n){return e+n[t]()})},t.html=function(){return this.join("html")},t.latex=function(){return this.join("latex")},t.text=function(){return this.ends[Tt]===this.ends[Ct]&&0!==this.ends[Tt]?this.ends[Tt].text():this.join("text")},t.keystroke=function(t,n,i){return!i.options.spaceBehavesLikeTab||"Spacebar"!==t&&"Shift-Spacebar"!==t?e.keystroke.apply(this,arguments):(n.preventDefault(),void i.escapeDir("Shift-Spacebar"===t?Tt:Ct,t,n))},t.moveOutOf=function(t,e,n){var i=n&&this.parent[n+"Into"];!i&&this[t]?e.insAtDirEnd(-t,this[t]):e.insDirOf(t,this.parent)},t.selectOutOf=function(t,e){e.insDirOf(t,this.parent)},t.deleteOutOf=function(t,e){e.unwrapGramp()},t.seek=function(t,e){var n=this.ends[Ct];if(!n||n.jQ.offset().left+n.jQ.outerWidth()0&&this.__controller.root.postOrder("registerInnerField",this.innerFields=[],t.MathField),e}})},C=Qt(T,u),Mt.MathField=function(e){return Qt(e.EditableField,function(e,n){this.RootBlock=C,e.__mathquillify=function(e,i){return this.config(e),i>1&&(this.__controller.root.reflow=t),n.__mathquillify.call(this,"mq-editable-field mq-math-mode"),delete this.__controller.root.reflow,this}})},D=Qt(St,function(t,e){function n(t){var e,n;return t.jQ[0].normalize(),e=t.jQ[0].firstChild,s("only node in TextBlock span is Text node",3===e.nodeType),n=_(e.data),n.jQadd(e),t.children().disown(),n.adopt(t,0,0)}t.ctrlSeq="\\text",t.replaces=function(t){t instanceof Lt?this.replacedText=t.remove().jQ.text():"string"==typeof t&&(this.replacedText=t)},t.jQadd=function(t){e.jQadd.call(this,t),this.ends[Tt]&&this.ends[Tt].jQadd(this.jQ[0].firstChild)},t.createLeftOf=function(t){var n,i=this;if(e.createLeftOf.call(this,t),i[Ct].siblingCreated&&i[Ct].siblingCreated(t.options,Tt),i[Tt].siblingCreated&&i[Tt].siblingCreated(t.options,Ct),i.bubble("reflow"),t.insAtRightEnd(i),i.replacedText)for(n=0;n&0',t.createBlocks=function(){e.createBlocks.call(this),this.ends[Tt].cursor=this.cursor,this.ends[Tt].write=function(t,e){"$"!==e?T.prototype.write.call(this,t,e):this.isEmpty()?(t.insRightOf(this.parent),this.parent.deleteTowards(dir,t),j("\\$","$").createLeftOf(t.show())):t[Ct]?t[Tt]?T.prototype.write.call(this,t,e):t.insLeftOf(this.parent):t.insRightOf(this.parent)}},t.latex=function(){return"$"+this.ends[Tt].latex()+"$"}}),L=Qt(C,function(t,e){t.keystroke=function(t){return"Spacebar"!==t&&"Shift-Spacebar"!==t?e.keystroke.apply(this,arguments):void 0},t.write=function(t,e){if(t.show().deleteSelection(),"$"===e)S(t).createLeftOf(t);else{var n;"<"===e?n="<":">"===e&&(n=">"),j(e,n).createLeftOf(t)}}}),Mt.TextField=function(t){return Qt(t.EditableField,function(t,e){this.RootBlock=L,t.__mathquillify=function(){return e.__mathquillify.call(this,"mq-editable-field mq-text-mode")},t.latex=function(t){return arguments.length>0?(this.__controller.renderLatexText(t),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()}})},E=At["\\"]=Qt(O,function(t,e){t.ctrlSeq="\\",t.replaces=function(t){this._replacedFragment=t.disown(),this.isEmpty=function(){return!1}},t.htmlTemplate='\\&0',t.textTemplate=["\\"],t.createBlocks=function(){e.createBlocks.call(this),this.ends[Tt].focus=function(){return this.parent.jQ.addClass("mq-hasCursor"),this.isEmpty()&&this.parent.jQ.removeClass("mq-empty"),this},this.ends[Tt].blur=function(){return this.parent.jQ.removeClass("mq-hasCursor"),this.isEmpty()&&this.parent.jQ.addClass("mq-empty"),this},this.ends[Tt].write=function(t,e){t.show().deleteSelection(),e.match(/[a-z]/i)?j(e).createLeftOf(t):(this.parent.renderCommand(t),"\\"===e&&this.isEmpty()||this.parent.parent.write(t,e))},this.ends[Tt].keystroke=function(t,n,i){return"Tab"===t||"Enter"===t||"Spacebar"===t?(this.parent.renderCommand(i.cursor),void n.preventDefault()):e.keystroke.apply(this,arguments)}},t.createLeftOf=function(t){if(e.createLeftOf.call(this,t),this._replacedFragment){var n=this.jQ[0];this.jQ=this._replacedFragment.jQ.addClass("mq-blur").bind("mousedown mousemove",function(t){return Dt(t.target=n).trigger(t),!1}).insertBefore(this.jQ).add(this.jQ)}},t.latex=function(){return"\\"+this.ends[Tt].latex()+" "},t.renderCommand=function(t){var e,n;this.jQ=this.jQ.last(),this.remove(),this[Ct]?t.insLeftOf(this[Ct]):t.insAtRightEnd(this.parent),e=this.ends[Tt].latex(),e||(e=" "),n=Et[e],n?(n=n(e),this._replacedFragment&&n.replaces(this._replacedFragment),n.createLeftOf(t)):(n=D(),n.replaces(e),n.createLeftOf(t),t.insRightOf(n),this._replacedFragment&&this._replacedFragment.remove())}}),Et.notin=Et.cong=Et.equiv=Et.oplus=Et.otimes=Qt(Q,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ","&"+t+";")}}),Et["≠"]=Et.ne=Et.neq=i(Q,"\\ne ","≠"),Et.ast=Et.star=Et.loast=Et.lowast=i(Q,"\\ast ","∗"),Et.therefor=Et.therefore=i(Q,"\\therefore ","∴"),Et.cuz=Et.because=i(Q,"\\because ","∵"),Et.prop=Et.propto=i(Q,"\\propto ","∝"),Et["≈"]=Et.asymp=Et.approx=i(Q,"\\approx ","≈"),Et.isin=Et["in"]=i(Q,"\\in ","∈"),Et.ni=Et.contains=i(Q,"\\ni ","∋"),Et.notni=Et.niton=Et.notcontains=Et.doesnotcontain=i(Q,"\\not\\ni ","∌"),Et.sub=Et.subset=i(Q,"\\subset ","⊂"),Et.sup=Et.supset=Et.superset=i(Q,"\\supset ","⊃"),Et.nsub=Et.notsub=Et.nsubset=Et.notsubset=i(Q,"\\not\\subset ","⊄"),Et.nsup=Et.notsup=Et.nsupset=Et.notsupset=Et.nsuperset=Et.notsuperset=i(Q,"\\not\\supset ","⊅"),Et.sube=Et.subeq=Et.subsete=Et.subseteq=i(Q,"\\subseteq ","⊆"),Et.supe=Et.supeq=Et.supsete=Et.supseteq=Et.supersete=Et.superseteq=i(Q,"\\supseteq ","⊇"),Et.nsube=Et.nsubeq=Et.notsube=Et.notsubeq=Et.nsubsete=Et.nsubseteq=Et.notsubsete=Et.notsubseteq=i(Q,"\\not\\subseteq ","⊈"),Et.nsupe=Et.nsupeq=Et.notsupe=Et.notsupeq=Et.nsupsete=Et.nsupseteq=Et.notsupsete=Et.notsupseteq=Et.nsupersete=Et.nsuperseteq=Et.notsupersete=Et.notsuperseteq=i(Q,"\\not\\supseteq ","⊉"),Et.N=Et.naturals=Et.Naturals=i(j,"\\mathbb{N}","ℕ"),Et.P=Et.primes=Et.Primes=Et.projective=Et.Projective=Et.probability=Et.Probability=i(j,"\\mathbb{P}","ℙ"),Et.Z=Et.integers=Et.Integers=i(j,"\\mathbb{Z}","ℤ"),Et.Q=Et.rationals=Et.Rationals=i(j,"\\mathbb{Q}","ℚ"),Et.R=Et.reals=Et.Reals=i(j,"\\mathbb{R}","ℝ"),Et.C=Et.complex=Et.Complex=Et.complexes=Et.Complexes=Et.complexplane=Et.Complexplane=Et.ComplexPlane=i(j,"\\mathbb{C}","ℂ"),Et.H=Et.Hamiltonian=Et.quaternions=Et.Quaternions=i(j,"\\mathbb{H}","ℍ"),Et.quad=Et.emsp=i(j,"\\quad "," "),Et.qquad=i(j,"\\qquad "," "),Et.diamond=i(j,"\\diamond ","◇"),Et.bigtriangleup=i(j,"\\bigtriangleup ","△"),Et.ominus=i(j,"\\ominus ","⊖"),Et.uplus=i(j,"\\uplus ","⊎"),Et.bigtriangledown=i(j,"\\bigtriangledown ","▽"),Et.sqcap=i(j,"\\sqcap ","⊓"),Et.triangleleft=i(j,"\\triangleleft ","⊲"),Et.sqcup=i(j,"\\sqcup ","⊔"),Et.triangleright=i(j,"\\triangleright ","⊳"),Et.odot=Et.circledot=i(j,"\\odot ","⊙"),Et.bigcirc=i(j,"\\bigcirc ","◯"),Et.dagger=i(j,"\\dagger ","†"),Et.ddagger=i(j,"\\ddagger ","‡"),Et.wr=i(j,"\\wr ","≀"),Et.amalg=i(j,"\\amalg ","∐"),Et.models=i(j,"\\models ","⊨"),Et.prec=i(j,"\\prec ","≺"),Et.succ=i(j,"\\succ ","≻"),Et.preceq=i(j,"\\preceq ","≼"),Et.succeq=i(j,"\\succeq ","≽"),Et.simeq=i(j,"\\simeq ","≃"),Et.mid=i(j,"\\mid ","∣"),Et.ll=i(j,"\\ll ","≪"),Et.gg=i(j,"\\gg ","≫"),Et.parallel=i(j,"\\parallel ","∥"),Et.nparallel=i(j,"\\nparallel ","∦"),Et.bowtie=i(j,"\\bowtie ","⋈"),Et.sqsubset=i(j,"\\sqsubset ","⊏"),Et.sqsupset=i(j,"\\sqsupset ","⊐"),Et.smile=i(j,"\\smile ","⌣"),Et.sqsubseteq=i(j,"\\sqsubseteq ","⊑"),Et.sqsupseteq=i(j,"\\sqsupseteq ","⊒"),Et.doteq=i(j,"\\doteq ","≐"),Et.frown=i(j,"\\frown ","⌢"),Et.vdash=i(j,"\\vdash ","⊦"),Et.dashv=i(j,"\\dashv ","⊣"),Et.nless=i(j,"\\nless ","≮"),Et.ngtr=i(j,"\\ngtr ","≯"),Et.longleftarrow=i(j,"\\longleftarrow ","←"),Et.longrightarrow=i(j,"\\longrightarrow ","→"),Et.Longleftarrow=i(j,"\\Longleftarrow ","⇐"),Et.Longrightarrow=i(j,"\\Longrightarrow ","⇒"),Et.longleftrightarrow=i(j,"\\longleftrightarrow ","↔"),Et.updownarrow=i(j,"\\updownarrow ","↕"),Et.Longleftrightarrow=i(j,"\\Longleftrightarrow ","⇔"),Et.Updownarrow=i(j,"\\Updownarrow ","⇕"),Et.mapsto=i(j,"\\mapsto ","↦"),Et.nearrow=i(j,"\\nearrow ","↗"),Et.hookleftarrow=i(j,"\\hookleftarrow ","↩"),Et.hookrightarrow=i(j,"\\hookrightarrow ","↪"),Et.searrow=i(j,"\\searrow ","↘"),Et.leftharpoonup=i(j,"\\leftharpoonup ","↼"),Et.rightharpoonup=i(j,"\\rightharpoonup ","⇀"),Et.swarrow=i(j,"\\swarrow ","↙"),Et.leftharpoondown=i(j,"\\leftharpoondown ","↽"),Et.rightharpoondown=i(j,"\\rightharpoondown ","⇁"),Et.nwarrow=i(j,"\\nwarrow ","↖"),Et.ldots=i(j,"\\ldots ","…"),Et.cdots=i(j,"\\cdots ","⋯"),Et.vdots=i(j,"\\vdots ","⋮"),Et.ddots=i(j,"\\ddots ","⋱"),Et.surd=i(j,"\\surd ","√"),Et.triangle=i(j,"\\triangle ","△"),Et.ell=i(j,"\\ell ","ℓ"),Et.top=i(j,"\\top ","⊤"),Et.flat=i(j,"\\flat ","♭"),Et.natural=i(j,"\\natural ","♮"),Et.sharp=i(j,"\\sharp ","♯"),Et.wp=i(j,"\\wp ","℘"),Et.bot=i(j,"\\bot ","⊥"),Et.clubsuit=i(j,"\\clubsuit ","♣"),Et.diamondsuit=i(j,"\\diamondsuit ","♢"),Et.heartsuit=i(j,"\\heartsuit ","♡"),Et.spadesuit=i(j,"\\spadesuit ","♠"),Et.parallelogram=i(j,"\\parallelogram ","▱"),Et.square=i(j,"\\square ","⬜"),Et.oint=i(j,"\\oint ","∮"),Et.bigcap=i(j,"\\bigcap ","∩"),Et.bigcup=i(j,"\\bigcup ","∪"),Et.bigsqcup=i(j,"\\bigsqcup ","⊔"),Et.bigvee=i(j,"\\bigvee ","∨"),Et.bigwedge=i(j,"\\bigwedge ","∧"),Et.bigodot=i(j,"\\bigodot ","⊙"),Et.bigotimes=i(j,"\\bigotimes ","⊗"),Et.bigoplus=i(j,"\\bigoplus ","⊕"),Et.biguplus=i(j,"\\biguplus ","⊎"),Et.lfloor=i(j,"\\lfloor ","⌊"),Et.rfloor=i(j,"\\rfloor ","⌋"),Et.lceil=i(j,"\\lceil ","⌈"),Et.rceil=i(j,"\\rceil ","⌉"),Et.opencurlybrace=Et.lbrace=i(j,"\\lbrace ","{"),Et.closecurlybrace=Et.rbrace=i(j,"\\rbrace ","}"),Et.lbrack=i(j,"["),Et.rbrack=i(j,"]"),Et["∫"]=Et["int"]=Et.integral=i(k,"\\int ",""),Et.slash=i(j,"/"),Et.vert=i(j,"|"),Et.perp=Et.perpendicular=i(j,"\\perp ","⊥"),Et.nabla=Et.del=i(j,"\\nabla ","∇"),Et.hbar=i(j,"\\hbar ","ℏ"),Et.AA=Et.Angstrom=Et.angstrom=i(j,"\\text\\AA ","Å"),Et.ring=Et.circ=Et.circle=i(j,"\\circ ","∘"),Et.bull=Et.bullet=i(j,"\\bullet ","•"),Et.setminus=Et.smallsetminus=i(j,"\\setminus ","∖"),Et.not=Et["¬"]=Et.neg=i(j,"\\neg ","¬"),Et["…"]=Et.dots=Et.ellip=Et.hellip=Et.ellipsis=Et.hellipsis=i(j,"\\dots ","…"),Et.converges=Et.darr=Et.dnarr=Et.dnarrow=Et.downarrow=i(j,"\\downarrow ","↓"),Et.dArr=Et.dnArr=Et.dnArrow=Et.Downarrow=i(j,"\\Downarrow ","⇓"),Et.diverges=Et.uarr=Et.uparrow=i(j,"\\uparrow ","↑"),Et.uArr=Et.Uparrow=i(j,"\\Uparrow ","⇑"),Et.to=i(Q,"\\to ","→"),Et.rarr=Et.rightarrow=i(j,"\\rightarrow ","→"),Et.implies=i(Q,"\\Rightarrow ","⇒"),Et.rArr=Et.Rightarrow=i(j,"\\Rightarrow ","⇒"),Et.gets=i(Q,"\\gets ","←"),Et.larr=Et.leftarrow=i(j,"\\leftarrow ","←"),Et.impliedby=i(Q,"\\Leftarrow ","⇐"),Et.lArr=Et.Leftarrow=i(j,"\\Leftarrow ","⇐"),Et.harr=Et.lrarr=Et.leftrightarrow=i(j,"\\leftrightarrow ","↔"),Et.iff=i(Q,"\\Leftrightarrow ","⇔"),Et.hArr=Et.lrArr=Et.Leftrightarrow=i(j,"\\Leftrightarrow ","⇔"),Et.Re=Et.Real=Et.real=i(j,"\\Re ","ℜ"),Et.Im=Et.imag=Et.image=Et.imagin=Et.imaginary=Et.Imaginary=i(j,"\\Im ","ℑ"),Et.part=Et.partial=i(j,"\\partial ","∂"),Et.infty=Et.infin=Et.infinity=i(j,"\\infty ","∞"),Et.alef=Et.alefsym=Et.aleph=Et.alephsym=i(j,"\\aleph ","ℵ"),Et.xist=Et.xists=Et.exist=Et.exists=i(j,"\\exists ","∃"),Et.and=Et.land=Et.wedge=i(j,"\\wedge ","∧"),Et.or=Et.lor=Et.vee=i(j,"\\vee ","∨"),Et.o=Et.O=Et.empty=Et.emptyset=Et.oslash=Et.Oslash=Et.nothing=Et.varnothing=i(Q,"\\varnothing ","∅"),Et.cup=Et.union=i(Q,"\\cup ","∪"),Et.cap=Et.intersect=Et.intersection=i(Q,"\\cap ","∩"),Et.deg=Et.degree=i(j,"\\degree ","°"),Et.ang=Et.angle=i(j,"\\angle ","∠"),Et.measuredangle=i(j,"\\measuredangle ","∡"),A=Qt(j,function(t,e){t.createLeftOf=function(t){t.options.autoSubscriptNumerals&&t.parent!==t.parent.parent.sub&&(t[Tt]instanceof R&&t[Tt].isItalic!==!1||t[Tt]instanceof rt&&t[Tt][Tt]instanceof R&&t[Tt][Tt].isItalic!==!1)?(Et._().createLeftOf(t),e.createLeftOf.call(this,t),t.insRightOf(t.parent.parent)):e.createLeftOf.call(this,t)}}),R=Qt(k,function(t,e){t.init=function(t,n){e.init.call(this,t,""+(n||t)+"")},t.text=function(){var t=this.ctrlSeq;return!this[Tt]||this[Tt]instanceof R||this[Tt]instanceof Q||"\\ "===this[Tt].ctrlSeq||(t="*"+t),!this[Ct]||this[Ct]instanceof Q||this[Ct]instanceof rt||(t+="*"),t}}),Bt.p.autoCommands={_maxLength:0},Ft.autoCommands=function(t){var e,n,i,s,r;if(!/^[a-z]+(?: [a-z]+)*$/i.test(t))throw'"'+t+'" not a space-delimited list of only letters';for(e=t.split(" "),n={},i=0,s=0;s0){for(n=this.letter,i=t[Tt],s=1;i instanceof I&&o>s;)n=i.letter+n,i=i[Tt],s+=1;for(;n.length;){if(r.hasOwnProperty(n)){for(s=2,i=t[Tt];s0;a-=1)if(l=e.slice(r,r+a),p.hasOwnProperty(l)){for(c=0,u=o;a>c;c+=1,u=u[Ct])u.italicize(!1),h=u;f=z.hasOwnProperty(l),o.ctrlSeq=(f?"\\":"\\operatorname{")+o.ctrlSeq,h.ctrlSeq+=f?" ":"}",B.hasOwnProperty(l)&&h[Tt][Tt][Tt].jQ.addClass("mq-last"),n(o[Tt])&&o.jQ.addClass("mq-first"),n(h[Ct])&&h.jQ.addClass("mq-last"),r+=a-1,o=h;continue t}}}}),z={},M=Bt.p.autoOperatorNames={_maxLength:9},B={limsup:1,liminf:1,projlim:1,injlim:1},function(){var t,e,n,i,s="arg deg det dim exp gcd hom inf ker lg lim ln log max min sup limsup liminf injlim projlim Pr".split(" ");for(t=0;tf')},t.italicize=function(t){return this.jQ.html("f").toggleClass("mq-f",t),e.italicize.apply(this,arguments)}}),Et[" "]=Et.space=i(j,"\\ "," "),Et["'"]=Et.prime=i(j,"'","′"),Et.backslash=i(j,"\\backslash ","\\"),At["\\"]||(At["\\"]=Et.backslash),Et.$=i(j,"\\$","$"),N=Qt(k,function(t,e){t.init=function(t,n){e.init.call(this,t,''+(n||t)+"")}}),Et["@"]=N,Et["&"]=i(N,"\\&","&"),Et["%"]=i(N,"\\%","%"),Et.alpha=Et.beta=Et.gamma=Et.delta=Et.zeta=Et.eta=Et.theta=Et.iota=Et.kappa=Et.mu=Et.nu=Et.xi=Et.rho=Et.sigma=Et.tau=Et.chi=Et.psi=Et.omega=Qt(R,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ","&"+t+";")}}),Et.phi=i(R,"\\phi ","ϕ"),Et.phiv=Et.varphi=i(R,"\\varphi ","φ"),Et.epsilon=i(R,"\\epsilon ","ϵ"),Et.epsiv=Et.varepsilon=i(R,"\\varepsilon ","ε"),Et.piv=Et.varpi=i(R,"\\varpi ","ϖ"),Et.sigmaf=Et.sigmav=Et.varsigma=i(R,"\\varsigma ","ς"),Et.thetav=Et.vartheta=Et.thetasym=i(R,"\\vartheta ","ϑ"),Et.upsilon=Et.upsi=i(R,"\\upsilon ","υ"),Et.gammad=Et.Gammad=Et.digamma=i(R,"\\digamma ","ϝ"),Et.kappav=Et.varkappa=i(R,"\\varkappa ","ϰ"),Et.rhov=Et.varrho=i(R,"\\varrho ","ϱ"),Et.pi=Et["π"]=i(N,"\\pi ","π"),Et.lambda=i(N,"\\lambda ","λ"),Et.Upsilon=Et.Upsi=Et.upsih=Et.Upsih=i(k,"\\Upsilon ",'ϒ'),Et.Gamma=Et.Delta=Et.Theta=Et.Lambda=Et.Xi=Et.Pi=Et.Sigma=Et.Phi=Et.Psi=Et.Omega=Et.forall=Qt(j,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ","&"+t+";")}}),P=Qt(O,function(t){t.init=function(t){this.latex=t},t.createLeftOf=function(t){var e=x.parse(this.latex);e.children().adopt(t.parent,t[Tt],t[Ct]),t[Tt]=e.ends[Ct],e.jQize().insertBefore(t.jQ),e.finalizeInsert(t.options,t),e.ends[Ct][Ct].siblingCreated&&e.ends[Ct][Ct].siblingCreated(t.options,Tt),e.ends[Tt][Tt].siblingCreated&&e.ends[Tt][Tt].siblingCreated(t.options,Ct),t.parent.bubble("reflow")},t.parser=function(){var t=x.parse(this.latex).children();return w.succeed(t)}}),Et["¹"]=i(P,"^1"),Et["²"]=i(P,"^2"),Et["³"]=i(P,"^3"),Et["¼"]=i(P,"\\frac14"),Et["½"]=i(P,"\\frac12"),Et["¾"]=i(P,"\\frac34"),U=Qt(Q,function(t){t.init=j.prototype.init,t.contactWeld=t.siblingCreated=t.siblingDeleted=function(t,e){return e!==Ct?(this.jQ[0].className=!this[Tt]||this[Tt]instanceof Q?"":"mq-binary-operator",this):void 0}}),Et["+"]=i(U,"+","+"),Et["–"]=Et["-"]=i(U,"-","−"),Et["±"]=Et.pm=Et.plusmn=Et.plusminus=i(U,"\\pm ","±"),Et.mp=Et.mnplus=Et.minusplus=i(U,"\\mp ","∓"),At["*"]=Et.sdot=Et.cdot=i(Q,"\\cdot ","·","*"),W=Qt(Q,function(t,e){t.init=function(t,n){this.data=t,this.strict=n;var i=n?"Strict":"";e.init.call(this,t["ctrlSeq"+i],t["html"+i],t["text"+i])},t.swap=function(t){this.strict=t;var e=t?"Strict":"";this.ctrlSeq=this.data["ctrlSeq"+e],this.jQ.html(this.data["html"+e]),this.textTemplate=[this.data["text"+e]]},t.deleteTowards=function(t,n){return t!==Tt||this.strict?void e.deleteTowards.apply(this,arguments):(this.swap(!0),void this.bubble("reflow"))}}),H={ctrlSeq:"\\le ",html:"≤",text:"≤",ctrlSeqStrict:"<",htmlStrict:"<",textStrict:"<"},G={ctrlSeq:"\\ge ",html:"≥",text:"≥",ctrlSeqStrict:">",htmlStrict:">",textStrict:">"},Et["<"]=Et.lt=i(W,H,!0),Et[">"]=Et.gt=i(W,G,!0),Et["≤"]=Et.le=Et.leq=i(W,H,!1),Et["≥"]=Et.ge=Et.geq=i(W,G,!1),K=Qt(Q,function(t,e){t.init=function(){e.init.call(this,"=","=")},t.createLeftOf=function(t){return t[Tt]instanceof W&&t[Tt].strict?(t[Tt].swap(!1),void t[Tt].bubble("reflow")):void e.createLeftOf.apply(this,arguments)}}),Et["="]=K,Et["×"]=Et.times=i(Q,"\\times ","×","[x]"),Et["÷"]=Et.div=Et.divide=Et.divides=i(Q,"\\div ","÷","[/]"),At["~"]=Et.sim=i(Q,"\\sim ","~","~"),X=t,Z=document.createElement("div"),V=Z.style,J={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1};for(et in J)if(et in V){tt=et;break}tt?Y=function(t,e,n){t.css(tt,"scale("+e+","+n+")")}:"filter"in V?(X=function(t){t.className=t.className},Y=function(t,e,n){function i(){t.css("marginRight",(s.width()-1)*(e-1)/e+"px")}var s,r;e/=1+(n-1)/2,t.css("fontSize",n+"em"),t.hasClass("mq-matrixed-container")||t.addClass("mq-matrixed-container").wrapInner(''),s=t.children().css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+e+",SizingMethod='auto expand')"),i(),r=setInterval(i),Dt(window).load(function(){clearTimeout(r),i()})}):Y=function(t,e,n){t.css("fontSize",n+"em")},nt=Qt(O,function(t,e){t.init=function(t,n,i){e.init.call(this,t,"<"+n+" "+i+">&0")}}),Et.mathrm=i(nt,"\\mathrm","span",'class="mq-roman mq-font"'),Et.mathit=i(nt,"\\mathit","i",'class="mq-font"'),Et.mathbf=i(nt,"\\mathbf","b",'class="mq-font"'),Et.mathsf=i(nt,"\\mathsf","span",'class="mq-sans-serif mq-font"'),Et.mathtt=i(nt,"\\mathtt","span",'class="mq-monospace mq-font"'),Et.underline=i(nt,"\\underline","span",'class="mq-non-leaf mq-underline"'),Et.overline=Et.bar=i(nt,"\\overline","span",'class="mq-non-leaf mq-overline"'),Et.overrightarrow=i(nt,"\\overrightarrow","span",'class="mq-non-leaf mq-overarrow mq-arrow-right"'),Et.overleftarrow=i(nt,"\\overleftarrow","span",'class="mq-non-leaf mq-overarrow mq-arrow-left"'),it=Et.textcolor=Qt(O,function(t,e){t.setColor=function(t){this.color=t,this.htmlTemplate='&0'},t.latex=function(){return"\\textcolor{"+this.color+"}{"+this.blocks[0].latex()+"}"},t.parser=function(){var t=this,n=w.optWhitespace,i=w.string,s=w.regex;return n.then(i("{")).then(s(/^[#\w\s.,()%-]*/)).skip(i("}")).then(function(n){return t.setColor(n),e.parser.call(t)})}}),st=Et["class"]=Qt(O,function(t,e){t.parser=function(){var t=this,n=w.string,i=w.regex;return w.optWhitespace.then(n("{")).then(i(/^[-\w\s\\\xA0-\xFF]*/)).skip(n("}")).then(function(n){return t.htmlTemplate='&0',e.parser.call(t)})}}),rt=Qt(O,function(t,e){t.ctrlSeq="_{...}^{...}",t.createLeftOf=function(t){return t[Tt]||!t.options.supSubsRequireOperand?e.createLeftOf.apply(this,arguments):void 0},t.contactWeld=function(t){var e,n,i,s,r,o;for(e=Tt;e;e=e===Tt?Ct:!1)if(this[e]instanceof rt){for(n="sub";n;n="sub"===n?"sup":!1)i=this[n],s=this[e][n],i&&(s?i.isEmpty()?o=_t(s,0,s.ends[Tt]):(i.jQ.children().insAtDirEnd(-e,s.jQ),r=i.children().disown(),o=_t(s,r.ends[Ct],s.ends[Tt]),e===Tt?r.adopt(s,s.ends[Ct],0):r.adopt(s,0,s.ends[Tt])):this[e].addBlock(i.disown()),this.placeCursor=function(t,n){return function(i){i.insAtDirEnd(-e,t||n)}}(s,i));this.remove(),t&&t[Tt]===this&&(e===Ct&&o?o[Tt]?t.insRightOf(o[Tt]):t.insAtLeftEnd(o.parent):t.insRightOf(this[e]));break}this.respace()},Bt.p.charsThatBreakOutOfSupSub="",t.finalizeTree=function(){this.ends[Tt].write=function(t,e){if(t.options.autoSubscriptNumerals&&this===this.parent.sub){if("_"===e)return;var n=this.chToCmd(e);return n instanceof k?t.deleteSelection():t.clearSelection().insRightOf(this.parent),n.createLeftOf(t.show())}t[Tt]&&!t[Ct]&&!t.selection&&t.options.charsThatBreakOutOfSupSub.indexOf(e)>-1&&t.insRightOf(this.parent),T.p.write.apply(this,arguments)}},t.moveTowards=function(t,n,i){n.options.autoSubscriptNumerals&&!this.sup?n.insDirOf(t,this):e.moveTowards.apply(this,arguments)},t.deleteTowards=function(t,n){if(n.options.autoSubscriptNumerals&&this.sub){var i=this.sub.ends[-t];i instanceof k?i.remove():i&&i.deleteTowards(t,n.insAtDirEnd(-t,this.sub)),this.sub.isEmpty()&&(this.sub.deleteOutOf(Tt,n.insAtLeftEnd(this.sub)),this.sup&&n.insDirOf(-t,this))}else e.deleteTowards.apply(this,arguments)},t.latex=function(){function t(t,e){var n=e&&e.latex();return e?t+(1===n.length?n:"{"+(n||" ")+"}"):""}return t("_",this.sub)+t("^",this.sup)},t.respace=t.siblingCreated=t.siblingDeleted=function(t,e){e!==Ct&&this.jQ.toggleClass("mq-limit","\\int "===this[Tt].ctrlSeq)},t.addBlock=function(t){"sub"===this.supsub?(this.sup=this.upInto=this.sub.upOutOf=t,t.adopt(this,this.sub,0).downOutOf=this.sub,t.jQ=Dt('').append(t.jQ.children()).attr(xt,t.id).prependTo(this.jQ)):(this.sub=this.downInto=this.sup.downOutOf=t,t.adopt(this,0,this.sup).upOutOf=this.sup,t.jQ=Dt('').append(t.jQ.children()).attr(xt,t.id).appendTo(this.jQ.removeClass("mq-sup-only")),this.jQ.append(''));for(var e=0;2>e;e+=1)(function(t,e,n,i){t[e].deleteOutOf=function(s,r){if(r.insDirOf(this[s]?-s:s,this.parent),!this.isEmpty()){var o=this.ends[s];this.children().disown().withDirAdopt(s,r.parent,r[s],r[-s]).jQ.insDirOf(-s,r.jQ),r[-s]=o}t.supsub=n,delete t[e],delete t[i+"Into"],t[n][i+"OutOf"]=f,delete t[n].deleteOutOf,"sub"===e&&Dt(t.jQ.addClass("mq-sup-only")[0].lastChild).remove(),this.remove()}})(this,"sub sup".split(" ")[e],"sup sub".split(" ")[e],"down up".split(" ")[e])}}),Et.subscript=Et._=Qt(rt,function(t,e){t.supsub="sub", + t.htmlTemplate='&0',t.textTemplate=["_"],t.finalizeTree=function(){this.downInto=this.sub=this.ends[Tt],this.sub.upOutOf=f,e.finalizeTree.call(this)}}),Et.superscript=Et.supscript=Et["^"]=Qt(rt,function(t,e){t.supsub="sup",t.htmlTemplate='&0',t.textTemplate=["^"],t.finalizeTree=function(){this.upInto=this.sup=this.ends[Ct],this.sup.downOutOf=f,e.finalizeTree.call(this)}}),ot=Qt(O,function(t,e){t.init=function(t,e){var n='&1'+e+'&0';k.prototype.init.call(this,t,n)},t.createLeftOf=function(t){e.createLeftOf.apply(this,arguments),t.options.sumStartsWithNEquals&&(I("n").createLeftOf(t),K().createLeftOf(t))},t.latex=function(){function t(t){return 1===t.length?t:"{"+(t||" ")+"}"}return this.ctrlSeq+"_"+t(this.ends[Tt].latex())+"^"+t(this.ends[Ct].latex())},t.parser=function(){var t,e=w.string,n=w.optWhitespace,i=w.succeed,s=x.block,r=this,o=r.blocks=[T(),T()];for(t=0;t&0&1',t.textTemplate=["(",")/(",")"],t.finalizeTree=function(){this.upInto=this.ends[Ct].upOutOf=this.ends[Tt],this.downInto=this.ends[Tt].downOutOf=this.ends[Ct]}}),lt=Et.over=At["/"]=Qt(at,function(e,n){e.createLeftOf=function(e){if(!this.replacedFragment){for(var i=e[Tt];i&&!(i instanceof Q||i instanceof(Et.text||t)||i instanceof ot||"\\ "===i.ctrlSeq||/^[,;:]$/.test(i.ctrlSeq));)i=i[Tt];i instanceof ot&&i[Ct]instanceof rt&&(i=i[Ct],i[Ct]instanceof rt&&i[Ct].ctrlSeq!=i.ctrlSeq&&(i=i[Ct])),i!==e[Tt]&&(this.replaces(Lt(i[Ct]||e.parent.ends[Tt],e[Tt])),e[Tt]=i)}n.createLeftOf.call(this,e)}}),ct=Et.sqrt=Et["√"]=Qt(O,function(t,e){t.ctrlSeq="\\sqrt",t.htmlTemplate='&0',t.textTemplate=["sqrt(",")"],t.parser=function(){return x.optBlock.then(function(t){return x.block.map(function(e){var n=ht();return n.blocks=[t,e],t.adopt(n,0,0),e.adopt(n,t,0),n})}).or(e.parser.call(this))},t.reflow=function(){var t=this.ends[Ct].jQ;Y(t.prev(),1,t.innerHeight()/+t.css("fontSize").slice(0,-2)-.1)}}),ut=Et.vec=Qt(O,function(t,e){t.ctrlSeq="\\vec",t.htmlTemplate='&0',t.textTemplate=["vec(",")"]}),ht=Et.nthroot=Qt(ct,function(t,e){t.htmlTemplate='&0&1',t.textTemplate=["sqrt[","](",")"],t.latex=function(){return"\\sqrt["+this.ends[Tt].latex()+"]{"+this.ends[Ct].latex()+"}"}}),ft=Qt(Qt(O,p),function(e,n){e.init=function(t,e,i,s,r){n.init.call(this,"\\left"+s,m,[e,i]),this.side=t,this.sides={},this.sides[Tt]={ch:e,ctrlSeq:s},this.sides[Ct]={ch:i,ctrlSeq:r}},e.numBlocks=function(){return 1},e.html=function(){return this.htmlTemplate=''+this.sides[Tt].ch+'&0'+this.sides[Ct].ch+"",n.html.call(this)},e.latex=function(){return"\\left"+this.sides[Tt].ctrlSeq+this.ends[Tt].latex()+"\\right"+this.sides[Ct].ctrlSeq},e.oppBrack=function(t,e,n){return e instanceof ft&&e.side&&e.side!==-n&&("|"===this.sides[this.side].ch||e.side===-this.side)&&(!t.restrictMismatchedBrackets||pt[this.sides[this.side].ch]===e.sides[e.side].ch||{"(":"]","[":")"}[this.sides[Tt].ch]===e.sides[Ct].ch)&&e},e.closeOpposing=function(t){t.side=0,t.sides[this.side]=this.sides[this.side],t.delimjQs.eq(this.side===Tt?0:1).removeClass("mq-ghost").html(this.sides[this.side].ch)},e.createLeftOf=function(t){var e,i,s;this.replacedFragment||(e=t.options,i=this.oppBrack(e,t[Tt],Tt)||this.oppBrack(e,t[Ct],Ct)||this.oppBrack(e,t.parent.parent)),i?(s=this.side=-i.side,this.closeOpposing(i),i===t.parent.parent&&t[s]&&(Lt(t[s],t.parent.ends[s],-s).disown().withDirAdopt(-s,i.parent,i,i[s]).jQ.insDirOf(s,i.jQ),i.bubble("reflow"))):(i=this,s=i.side,i.replacedFragment?i.side=0:t[-s]&&(i.replaces(Lt(t[-s],t.parent.ends[-s],s)),t[-s]=0),n.createLeftOf.call(i,t)),s===Tt?t.insAtLeftEnd(i.ends[Tt]):t.insRightOf(i)},e.placeCursor=t,e.unwrap=function(){this.ends[Tt].children().disown().adopt(this.parent,this,this[Ct]).jQ.insertAfter(this.jQ),this.remove()},e.deleteSide=function(t,e,n){var i,s,r,o=this.parent,a=this[t],l=o.ends[t];if(t===this.side)return this.unwrap(),void(a?n.insDirOf(-t,a):n.insAtDirEnd(t,o));if(i=n.options,s=!this.side,this.side=-t,this.oppBrack(i,this.ends[Tt].ends[this.side],t))this.closeOpposing(this.ends[Tt].ends[this.side]),r=this.ends[Tt].ends[t],this.unwrap(),r.siblingCreated&&r.siblingCreated(n.options,t),a?n.insDirOf(-t,a):n.insAtDirEnd(t,o);else{if(this.oppBrack(i,this.parent.parent,t))this.parent.parent.closeOpposing(this),this.parent.parent.unwrap();else{if(e&&s)return this.unwrap(),void(a?n.insDirOf(-t,a):n.insAtDirEnd(t,o));this.sides[t]={ch:pt[this.sides[this.side].ch],ctrlSeq:pt[this.sides[this.side].ctrlSeq]},this.delimjQs.removeClass("mq-ghost").eq(t===Tt?0:1).addClass("mq-ghost").html(this.sides[t].ch)}a?(r=this.ends[Tt].ends[t],Lt(a,l,-t).disown().withDirAdopt(-t,this.ends[Tt],r,0).jQ.insAtDirEnd(t,this.ends[Tt].jQ.removeClass("mq-empty")),r.siblingCreated&&r.siblingCreated(n.options,t),n.insDirOf(-t,a)):e?n.insDirOf(t,this):n.insAtDirEnd(t,this.ends[Tt])}},e.deleteTowards=function(t,e){this.deleteSide(-t,!1,e)},e.finalizeTree=function(){this.ends[Tt].deleteOutOf=function(t,e){this.parent.deleteSide(t,!0,e)},this.finalizeTree=this.intentionalBlur=function(){this.delimjQs.eq(this.side===Tt?1:0).removeClass("mq-ghost"),this.side=0}},e.siblingCreated=function(t,e){e===-this.side&&this.finalizeTree()}}),pt={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{","\\{":"\\}","\\}":"\\{","⟨":"⟩","⟩":"⟨","\\langle ":"\\rangle ","\\rangle ":"\\langle ","|":"|"},d("("),d("["),d("{","\\{"),Et.langle=i(ft,Tt,"⟨","⟩","\\langle ","\\rangle "),Et.rangle=i(ft,Ct,"⟨","⟩","\\langle ","\\rangle "),At["|"]=i(ft,Tt,"|","|","|","|"),Et.left=Qt(O,function(t){t.parser=function(){var t=w.regex,e=w.string,n=(w.succeed,w.optWhitespace);return n.then(t(/^(?:[([|]|\\\{)/)).then(function(i){var s="\\"===i.charAt(0)?i.slice(1):i;return x.then(function(r){return e("\\right").skip(n).then(t(/^(?:[\])|]|\\\})/)).map(function(t){var e="\\"===t.charAt(0)?t.slice(1):t,n=ft(0,s,e,i,t);return n.blocks=[r],r.adopt(n,0,0),n})})})}}),Et.right=Qt(O,function(t){t.parser=function(){return w.fail("unmatched \\right")}}),dt=Et.binom=Et.binomial=Qt(Qt(O,p),function(t,e){t.ctrlSeq="\\binom",t.htmlTemplate='(&0&1)',t.textTemplate=["choose(",",",")"]}),mt=Et.choose=Qt(dt,function(t){t.createLeftOf=lt.prototype.createLeftOf}),Et.editable=Et.MathQuillMathField=Qt(O,function(t,e){t.ctrlSeq="\\MathQuillMathField",t.htmlTemplate='&0',t.parser=function(){var t=this,n=w.string,i=w.regex,s=w.succeed;return n("[").then(i(/^[a-z][a-z0-9]*/i)).skip(n("]")).map(function(e){t.name=e}).or(s()).then(e.parser.call(t))},t.finalizeTree=function(){var t=zt(this.ends[Tt],this.jQ,Bt());t.KIND_OF_MQ="MathField",t.editable=!0,t.createTextarea(),t.editablesTextareaEvents(),t.cursor.insAtRightEnd(t.root),u(t.root)},t.registerInnerField=function(t,e){t.push(t[this.name]=e(this.ends[Tt].controller))},t.latex=function(){return this.ends[Tt].latex()},t.text=function(){return this.ends[Tt].text()}}),gt=Et.embed=Qt(k,function(t,e){t.setOptions=function(t){function e(){return""}return this.text=t.text||e,this.htmlTemplate=t.htmlString||"",this.latex=t.latex||e,this},t.parser=function(){var t=this;return string=w.string,regex=w.regex,succeed=w.succeed,string("{").then(regex(/^[a-z][a-z0-9]*/i)).skip(string("}")).then(function(e){return string("[").then(regex(/^[-\w\s]*/)).skip(string("]")).or(succeed()).map(function(n){return t.setOptions(Nt[e](n))})})}}),bt=c(1);for(vt in bt)(function(t,e){"function"==typeof e?(l[t]=function(){return a(),e.apply(this,arguments)},l[t].prototype=e.prototype):l[t]=e})(vt,bt[vt])}(); diff --git a/cshub-client/public/assets/quill2.min.css b/cshub-client/public/assets/quill2.min.css new file mode 100644 index 00000000..abfd7e54 --- /dev/null +++ b/cshub-client/public/assets/quill2.min.css @@ -0,0 +1,6 @@ +/*! + * Quill Editor v2.0.0-dev.3 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */.ql-editor table td,.ql-snow .ql-toolbar button:active:hover,.ql-snow.ql-toolbar button:active:hover{outline:0}.ql-container.ql-disabled .ql-tooltip,.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-container,.ql-editor,.ql-snow,.ql-snow *,.ql-toolbar.ql-snow{box-sizing:border-box}.ql-container{font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{counter-reset:list-0;line-height:1.42;height:100%;outline:0;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor ol,.ql-editor p,.ql-editor pre{margin:0;padding:0}.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor p{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor li,.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\2610'}.ql-editor li[data-list=ordered]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0,decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1;counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1,lower-alpha) '. '}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2;counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2,lower-roman) '. '}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3;counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3,decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4;counter-reset:list-5 list-6 list-7 list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4,lower-alpha) '. '}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5;counter-reset:list-6 list-7 list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5,lower-roman) '. '}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6;counter-reset:list-7 list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6,decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7;counter-reset:list-8 list-9}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7,lower-alpha) '. '}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8;counter-reset:list-9}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8,lower-roman) '. '}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9,decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{border-collapse:collapse;table-layout:fixed;width:100%}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow .ql-toolbar:after,.ql-snow.ql-toolbar:after{clear:both;content:'';display:table}.ql-snow .ql-toolbar button,.ql-snow.ql-toolbar button{background:0 0;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow .ql-hidden,.ql-snow .ql-toolbar input.ql-image[type=file],.ql-snow.ql-toolbar input.ql-image[type=file]{display:none}.ql-snow .ql-toolbar button svg,.ql-snow.ql-toolbar button svg{float:left;height:100%}.ql-snow .ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar button.ql-active,.ql-snow .ql-toolbar button:focus,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar button.ql-active,.ql-snow.ql-toolbar button:focus,.ql-snow.ql-toolbar button:hover{color:#06c}.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill{fill:#06c}.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow .ql-toolbar button:hover:not(.ql-active),.ql-snow.ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-stroke.ql-thin,.ql-snow .ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor .ql-code-block-container,.ql-snow .ql-editor code{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px;background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-item::before,.ql-snow .ql-picker.ql-header .ql-picker-label::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-item::before,.ql-snow .ql-picker.ql-font .ql-picker-label::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-item::before,.ql-snow .ql-picker.ql-size .ql-picker-label::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label,.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow+.ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:"Visit URL:";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:"Enter link:"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:"Enter formula:"}.ql-snow .ql-tooltip[data-mode=video]::before{content:"Enter video:"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc} \ No newline at end of file diff --git a/cshub-client/public/assets/quill2.min.js b/cshub-client/public/assets/quill2.min.js new file mode 100644 index 00000000..52bc2a24 --- /dev/null +++ b/cshub-client/public/assets/quill2.min.js @@ -0,0 +1,8 @@ +/*! + * Quill Editor v2.0.0-dev.3 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}(window,function(){return function(t){var e={};function s(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,s),r.l=!0,r.exports}return s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)s.d(i,r,function(e){return t[e]}.bind(null,r));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=36)}([function(t,e,s){"use strict";var i;s.r(e),function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(i||(i={}));var r=i;var n=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){this.insertBefore(t[0],null),t.length>1&&this.append.apply(this,t.slice(1))}at(t){const e=this.iterator();let s=e();for(;s&&t>0;)t-=1,s=e();return s}contains(t){const e=this.iterator();let s=e();for(;s;){if(s===t)return!0;s=e()}return!1}indexOf(t){const e=this.iterator();let s=e(),i=0;for(;s;){if(s===t)return i;i+=1,s=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,s=this.head;for(;null!=s;){if(s===t)return e;e+=s.length(),s=s.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t,e=!1){const s=this.iterator();let i=s();for(;i;){const r=i.length();if(tn?s(o,t-n,Math.min(e,n+i-t)):s(o,0,Math.min(i,t+e-n)),n+=i,o=l()}}map(t){return this.reduce((e,s)=>(e.push(t(s)),e),[])}reduce(t,e){const s=this.iterator();let i=s();for(;i;)e=t(e,i),i=s();return e}};class l extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}class o{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){return null==t?null:this.blots.has(t)?this.blots.get(t)||null:e?this.find(t.parentNode,e):null}create(t,e,s){const i=this.query(e);if(null==i)throw new l(`Unable to create ${e} blot`);const r=i,n=new r(t,e instanceof Node||e.nodeType===Node.TEXT_NODE?e:r.create(s),s);return o.blots.set(n.domNode,n),n}find(t,e=!1){return o.find(t,e)}query(t,e=r.ANY){let s;if("string"==typeof t)s=this.types[t]||this.attributes[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)s=this.types.text;else if("number"==typeof t)t&r.LEVEL&r.BLOCK?s=this.types.block:t&r.LEVEL&r.INLINE&&(s=this.types.inline);else if(t instanceof HTMLElement){(t.getAttribute("class")||"").split(/\s+/).some(t=>!!(s=this.classes[t])),s=s||this.tags[t.tagName]}return null==s?null:e&r.LEVEL&s.scope&&e&r.TYPE&s.scope?s:null}register(...t){if(t.length>1)return t.map(t=>this.register(t));const e=t[0];if("string"!=typeof e.blotName&&"string"!=typeof e.attrName)throw new l("Invalid definition");if("abstract"===e.blotName)throw new l("Cannot register abstract class");if(this.types[e.blotName||e.attrName]=e,"string"==typeof e.keyName)this.attributes[e.keyName]=e;else if(null!=e.className&&(this.classes[e.className]=e),null!=e.tagName){Array.isArray(e.tagName)?e.tagName=e.tagName.map(t=>t.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{null!=this.tags[t]&&null!=e.className||(this.tags[t]=e)})}return e}}o.blots=new WeakMap;class a{constructor(t,e){this.scroll=t,this.domNode=e,o.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new l("Blot definition missing tagName");let e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t,10).toString()===t&&(t=parseInt(t,10))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),o.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,s,i){const n=this.isolate(t,e);if(null!=this.scroll.query(s,r.BLOT)&&i)n.wrap(s,i);else if(null!=this.scroll.query(s,r.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);n.wrap(t),t.format(s,i)}}insertAt(t,e,s){const i=null==s?this.scroll.create("text",e):this.scroll.create(e,s),r=this.split(t);this.parent.insertBefore(i,r||void 0)}isolate(t,e){const s=this.split(t);if(null==s)throw new Error("Attempt to isolate at end");return s.split(e),s}length(){return 1}offset(t=this.parent){return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const s="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(s,this.next||void 0),this.remove()),s}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const s="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(s,this.next||void 0),"function"!=typeof s.appendChild)throw new l(`Cannot wrap ${t}`);return s.appendChild(this),s}}a.blotName="abstract";var u=a;class c extends u{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,c.uiClass&&this.uiNode.classList.add(c.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new n,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=h(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof l)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,s)=>{t.deleteAt(e,s)})}descendant(t,e=0){const[s,i]=this.children.find(e);return null==t.blotName&&t(s)||null!=t.blotName&&s instanceof t?[s,i]:s instanceof c?s.descendant(t,i):[null,-1]}descendants(t,e=0,s=Number.MAX_VALUE){let i=[],r=s;return this.children.forEachAt(e,s,(e,s,n)=>{(null==t.blotName&&t(e)||null!=t.blotName&&e instanceof t)&&i.push(e),e instanceof c&&(i=i.concat(e.descendants(t,s,r))),r-=n}),i}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{if(t)return;this.statics.allowedChildren.some(t=>e instanceof t)||(e.statics.scope===r.BLOCK_BLOT?(null!=e.next&&this.splitAfter(e),null!=e.prev&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof c?e.unwrap():e.remove())})}formatAt(t,e,s,i){this.children.forEachAt(t,e,(t,e,r)=>{t.formatAt(e,r,s,i)})}insertAt(t,e,s){const[i,r]=this.children.find(t);if(i)i.insertAt(r,e,s);else{const t=null==s?this.scroll.create("text",e):this.scroll.create(e,s);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let s=null;this.children.insertBefore(t,e||null),null!=e&&(s=e.domNode),this.domNode.parentNode===t.domNode&&this.domNode.nextSibling===s||this.domNode.insertBefore(t.domNode,s),t.parent=this,t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(s=>{t.insertBefore(s,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(t,e=!1){const[s,i]=this.children.find(t,e),r=[[this,t]];return s instanceof c?r.concat(s.path(i,e)):(null!=s&&r.push([s,i]),r)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const s="string"==typeof t?this.scroll.create(t,e):t;return s instanceof c&&this.moveChildren(s),super.replaceWith(s)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const s=this.clone();return this.parent&&this.parent.insertBefore(s,this.next||void 0),this.children.forEachAt(t,this.length(),(t,i,r)=>{const n=t.split(i,e);null!=n&&s.appendChild(n)}),s}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const s=[],i=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(s.push.apply(s,t.addedNodes),i.push.apply(i,t.removedNodes))}),i.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==this.domNode||e.detach())}),s.filter(t=>t.parentNode===this.domNode||t===this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const s=h(t,this.scroll);s.next===e&&null!=s.next||(null!=s.parent&&s.parent.removeChild(this),this.insertBefore(s,e||void 0))}),this.enforceAllowedChildren()}}function h(t,e){let s=e.find(t);if(null==s)try{s=e.create(t)}catch(i){s=e.create(r.INLINE),Array.from(t.childNodes).forEach(t=>{s.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(s.domNode,t),s.attach()}return s}c.uiClass="";var d=c;class f extends d{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,s,i){super.formatAt(t,e,s,i),this.enforceAllowedChildren()}insertAt(t,e,s){super.insertAt(t,e,s),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}}f.blotName="container",f.scope=r.BLOCK_BLOT;var p=f;class m extends u{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let s=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(s+=1),[this.parent.domNode,s]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}}m.scope=r.INLINE_BLOT;var g=m;class b{static keys(t){return Array.from(t.attributes).map(t=>t.name)}constructor(t,e,s={}){this.attrName=t,this.keyName=e;const i=r.TYPE&r.ATTRIBUTE;this.scope=null!=s.scope?s.scope&r.LEVEL|i:r.ATTRIBUTE,null!=s.whitelist&&(this.whitelist=s.whitelist)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}function y(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf(`${e}-`))}var v=class extends b{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){y(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(y(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function x(t){const e=t.split("-"),s=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+s}var N=class extends b{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[x(this.keyName)]=e,!0)}remove(t){t.style[x(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[x(this.keyName)];return this.canAdd(t,e)?e:""}};var E=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=o.find(this.domNode);if(null==t)return;const e=b.keys(this.domNode),s=v.keys(this.domNode),i=N.keys(this.domNode);e.concat(s).concat(i).forEach(e=>{const s=t.scroll.query(e,r.ATTRIBUTE);s instanceof b&&(this.attributes[s.attrName]=s)})}copy(t){Object.keys(this.attributes).forEach(e=>{const s=this.attributes[e].value(this.domNode);t.format(e,s)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}};class A extends d{constructor(t,e){super(t,e),this.attributes=new E(this.domNode)}static formats(t,e){const s=e.query(A.blotName);if(null==s||t.tagName!==s.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){if(t!==this.statics.blotName||e){const s=this.scroll.query(t,r.INLINE);if(null==s)return;s instanceof b?this.attributes.attribute(s,e):!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e)}else this.children.forEach(t=>{t instanceof A||(t=t.wrap(A.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,s,i){if(null!=this.formats()[s]||this.scroll.query(s,r.ATTRIBUTE)){this.isolate(t,e).format(s,i)}else super.formatAt(t,e,s,i)}optimize(t){super.optimize(t);const e=this.formats();if(0===Object.keys(e).length)return this.unwrap();const s=this.next;s instanceof A&&s.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}(e,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,e){const s=super.replaceWith(t,e);return this.attributes.copy(s),s}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(t,e){const s=super.wrap(t,e);return s instanceof A&&this.attributes.move(s),s}}A.allowedChildren=[A,g],A.blotName="inline",A.scope=r.INLINE_BLOT,A.tagName="SPAN";var q=A;class w extends d{constructor(t,e){super(t,e),this.attributes=new E(this.domNode)}static formats(t,e){const s=e.query(w.blotName);if(null==s||t.tagName!==s.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){const s=this.scroll.query(t,r.BLOCK);null!=s&&(s instanceof b?this.attributes.attribute(s,e):t!==this.statics.blotName||e?!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e):this.replaceWith(w.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,s,i){null!=this.scroll.query(s,r.BLOCK)?this.format(s,i):super.formatAt(t,e,s,i)}insertAt(t,e,s){if(null==s||null!=this.scroll.query(e,r.INLINE))super.insertAt(t,e,s);else{const i=this.split(t);if(null==i)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,s);i.parent.insertBefore(t,i)}}}replaceWith(t,e){const s=super.replaceWith(t,e);return this.attributes.copy(s),s}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}}w.blotName="block",w.scope=r.BLOCK_BLOT,w.tagName="P",w.allowedChildren=[q,w,g];var k=w;var L=class extends g{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,s,i){0===t&&e===this.length()?this.format(s,i):super.formatAt(t,e,s,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}};const T={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},S=100;class O extends d{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,T),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){return this.registry.find(t,e)}query(t,e=r.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,s,i){this.update(),super.formatAt(t,e,s,i)}insertAt(t,e,s){this.update(),super.insertAt(t,e,s)}optimize(t=[],e={}){super.optimize(e);const s=e.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)t.push(i.pop());const r=(t,e=!0)=>{null!=t&&t!==this&&null!=t.domNode.parentNode&&(s.has(t.domNode)||s.set(t.domNode,[]),e&&r(t.parent))},n=t=>{s.has(t.domNode)&&(t instanceof d&&t.children.forEach(n),s.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=S)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);r(e,!1),e instanceof d&&e.children.forEach(t=>{r(t,!1)})})):"attributes"===t.type&&r(e.prev)),r(e))}),this.children.forEach(n),i=(l=Array.from(this.observer.takeRecords())).slice();i.length>0;)t.push(i.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const s=new WeakMap;t.map(t=>{const e=o.find(t.target,!0);return null==e?null:s.has(e.domNode)?(s.get(e.domNode).push(t),null):(s.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&s.has(t.domNode)&&t.update(s.get(t.domNode)||[],e)}),e.mutationsMap=s,s.has(this.domNode)&&super.update(s.get(this.domNode),e),this.optimize(t,e)}}O.blotName="scroll",O.defaultChild=k,O.allowedChildren=[k,p],O.scope=r.BLOCK_BLOT,O.tagName="DIV";var C=O;class _ extends g{constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}static create(t){return document.createTextNode(t)}static value(t){return t.data}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,s){null==s?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,s)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof _&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const s=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(s,this.next||void 0),this.text=this.statics.value(this.domNode),s}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}}_.blotName="text",_.scope=r.INLINE_BLOT;var M=_;s.d(e,"ParentBlot",function(){return d}),s.d(e,"ContainerBlot",function(){return p}),s.d(e,"LeafBlot",function(){return g}),s.d(e,"EmbedBlot",function(){return L}),s.d(e,"ScrollBlot",function(){return C}),s.d(e,"BlockBlot",function(){return k}),s.d(e,"InlineBlot",function(){return q}),s.d(e,"TextBlot",function(){return M}),s.d(e,"Attributor",function(){return b}),s.d(e,"ClassAttributor",function(){return v}),s.d(e,"StyleAttributor",function(){return N}),s.d(e,"AttributorStore",function(){return E}),s.d(e,"Registry",function(){return o}),s.d(e,"Scope",function(){return r})},function(t,e,s){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},r=i(s(11)),n=i(s(2)),l=i(s(40)),o=i(s(41)),a=i(s(21)),u=String.fromCharCode(0),c=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var s={};return"string"==typeof t&&0===t.length?this:(s.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(s.attributes=e),this.push(s))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var s={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(s.attributes=e),this.push(s)},t.prototype.push=function(t){var e=this.ops.length,s=this.ops[e-1];if(t=n.default(!0,{},t),"object"==typeof s){if("number"==typeof t.delete&&"number"==typeof s.delete)return this.ops[e-1]={delete:s.delete+t.delete},this;if("number"==typeof s.delete&&null!=t.insert&&(e-=1,"object"!=typeof(s=this.ops[e-1])))return this.ops.unshift(t),this;if(r.default(t.attributes,s.attributes)){if("string"==typeof t.insert&&"string"==typeof s.insert)return this.ops[e-1]={insert:s.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof s.retain)return this.ops[e-1]={retain:s.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],s=[];return this.forEach(function(i){(t(i)?e:s).push(i)}),[e,s]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+a.default.length(e):e.delete?t-e.delete:t},0)},t.prototype.length=function(){return this.reduce(function(t,e){return t+a.default.length(e)},0)},t.prototype.slice=function(e,s){void 0===e&&(e=0),void 0===s&&(s=1/0);for(var i=[],r=a.default.iterator(this.ops),n=0;n0&&i.next(l.retain-u)}for(var c=new t(n);s.hasNext()||i.hasNext();)if("insert"===i.peekType())c.push(i.next());else if("delete"===s.peekType())c.push(s.next());else{var h=Math.min(s.peekLength(),i.peekLength()),d=s.next(h),f=i.next(h);if("number"==typeof f.retain){var p={};"number"==typeof d.retain?p.retain=h:p.insert=d.insert;var m=o.default.compose(d.attributes,f.attributes,"number"==typeof d.retain);if(m&&(p.attributes=m),c.push(p),!i.hasNext()&&r.default(c.ops[c.ops.length-1],p)){var g=new t(s.rest());return c.concat(g).chop()}}else"number"==typeof f.delete&&"number"==typeof d.retain&&c.push(f)}return c.chop()},t.prototype.concat=function(e){var s=new t(this.ops.slice());return e.ops.length>0&&(s.push(e.ops[0]),s.ops=s.ops.concat(e.ops.slice(1))),s},t.prototype.diff=function(e,s){if(this.ops===e.ops)return new t;var i=[this,e].map(function(t){return t.map(function(s){if(null!=s.insert)return"string"==typeof s.insert?s.insert:u;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),n=new t,c=l.default(i[0],i[1],s),h=a.default.iterator(this.ops),d=a.default.iterator(e.ops);return c.forEach(function(t){for(var e=t[1].length;e>0;){var s=0;switch(t[0]){case l.default.INSERT:s=Math.min(d.peekLength(),e),n.push(d.next(s));break;case l.default.DELETE:s=Math.min(e,h.peekLength()),h.next(s),n.delete(s);break;case l.default.EQUAL:s=Math.min(h.peekLength(),d.peekLength(),e);var i=h.next(s),a=d.next(s);r.default(i.insert,a.insert)?n.retain(s,o.default.diff(i.attributes,a.attributes)):n.push(a).delete(s)}e-=s}}),n.chop()},t.prototype.eachLine=function(e,s){void 0===s&&(s="\n");for(var i=a.default.iterator(this.ops),r=new t,n=0;i.hasNext();){if("insert"!==i.peekType())return;var l=i.peek(),o=a.default.length(l)-i.peekLength(),u="string"==typeof l.insert?l.insert.indexOf(s,o)-o:-1;if(u<0)r.push(i.next());else if(u>0)r.push(i.next(u));else{if(!1===e(r,i.next(1).attributes||{},n))return;n+=1,r=new t}}r.length()>0&&e(r,{},n)},t.prototype.transform=function(e,s){if(void 0===s&&(s=!1),s=!!s,"number"==typeof e)return this.transformPosition(e,s);for(var i=e,r=a.default.iterator(this.ops),n=a.default.iterator(i.ops),l=new t;r.hasNext()||n.hasNext();)if("insert"!==r.peekType()||!s&&"insert"===n.peekType())if("insert"===n.peekType())l.push(n.next());else{var u=Math.min(r.peekLength(),n.peekLength()),c=r.next(u),h=n.next(u);if(c.delete)continue;h.delete?l.push(h):l.retain(u,o.default.transform(c.attributes,h.attributes,s))}else l.retain(a.default.length(r.next()));return l.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var s=a.default.iterator(this.ops),i=0;s.hasNext()&&i<=t;){var r=s.peekLength(),n=s.peekType();s.next(),"delete"!==n?("insert"===n&&(i0&&(t((n=n.split(t,!0)).insertAt(0,e),e.length),t+r.length)}insertBefore(t,e){const s=this.children.head;super.insertBefore(t,e),s instanceof l.default&&s.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+c),this.cache.length}moveChildren(t,e){super.moveChildren(t,e),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t,e=!1){if(e&&(0===t||t>=this.length()-c)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const s=super.split(t,e);return this.cache={},s}}h.blotName="block",h.tagName="P",h.defaultChild=l.default,h.allowedChildren=[l.default,o.default,n.EmbedBlot,a.default];class d extends n.EmbedBlot{attach(){super.attach(),this.attributes=new n.AttributorStore(this.domNode)}delta(){return(new r.default).insert(this.value(),(0,i.default)(this.formats(),this.attributes.values()))}format(t,e){const s=this.scroll.query(t,n.Scope.BLOCK_ATTRIBUTE);null!=s&&this.attributes.attribute(s,e)}formatAt(t,e,s,i){this.format(s,i)}insertAt(t,e,s){if("string"==typeof e&&e.endsWith("\n")){const s=this.scroll.create(h.blotName);this.parent.insertBefore(s,0===t?this:this.next),s.insertAt(0,e.slice(0,-1))}else super.insertAt(t,e,s)}}function f(t){return t.descendants(n.LeafBlot).reduce((t,e)=>0===e.length()?t:t.insert(e.value(),p(e)),new r.default).insert("\n",p(t))}function p(t,e={}){return null==t?e:("function"==typeof t.formats&&delete(e=(0,i.default)(e,t.formats()))["code-token"],null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:p(t.parent,e))}d.scope=n.Scope.BLOCK_BLOT,e.blockDelta=f,e.bubbleFormats=p,e.BlockEmbed=d,e.default=h},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=e.globalRegistry=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=m(s(1)),n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}(s(0)),l=m(s(2)),o=m(s(43)),a=m(s(8)),u=m(s(7)),c=s(13),h=m(c),d=m(s(22)),f=m(s(10)),p=m(s(23));function m(t){return t&&t.__esModule?t:{default:t}}const g=(0,f.default)("quill"),b=new n.Registry;n.ParentBlot.uiClass="ql-ui";class y{static debug(t){!0===t&&(t="log"),f.default.level(t)}static find(t){return d.default.get(t)||b.find(t)}static import(t){return null==this.imports[t]&&g.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(t,e,s=!1){if("string"!=typeof t){const s=t.attrName||t.blotName;"string"==typeof s?this.register(`formats/${s}`,t,e):Object.keys(t).forEach(s=>{this.register(s,t[s],e)})}else null==this.imports[t]||s||g.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName&&b.register(e),"function"==typeof e.register&&e.register(b)}constructor(t,e={}){if(this.options=v(t,e),this.container=this.options.container,null==this.container)return g.error("Invalid Quill container",t);this.options.debug&&y.debug(this.options.debug);const s=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",d.default.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.addEventListener("dragstart",t=>{t.preventDefault()}),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new a.default;const r=this.options.registry.query(n.ScrollBlot.blotName);this.scroll=new r(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new o.default(this.scroll),this.selection=new h.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.init(),this.emitter.on(a.default.events.EDITOR_CHANGE,t=>{t===a.default.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(a.default.events.SCROLL_UPDATE,(t,e)=>{const s=this.selection.lastRange;var r=this.selection.getRange();const n=i(r,1)[0],l=s&&n?{oldRange:s,newRange:n}:void 0;x.call(this,()=>this.editor.update(null,e,l),t)});const l=this.clipboard.convert({html:`${s}


`,text:"\n"});this.setContents(l),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t,e=null){if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,s){var r=N(t,e,s),n=i(r,4);return t=n[0],e=n[1],s=n[3],x.call(this,()=>this.editor.deleteText(t,e),s,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(t=!0){this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){const t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}format(t,e,s=a.default.sources.API){return x.call(this,()=>{const s=this.getSelection(!0);let i=new r.default;if(null==s)return i;if(this.scroll.query(t,n.Scope.BLOCK))i=this.editor.formatLine(s.index,s.length,{[t]:e});else{if(0===s.length)return this.selection.format(t,e),i;i=this.editor.formatText(s.index,s.length,{[t]:e})}return this.setSelection(s,a.default.sources.SILENT),i},s)}formatLine(t,e,s,r,n){let l;var o=N(t,e,s,r,n),a=i(o,4);return t=a[0],e=a[1],l=a[2],n=a[3],x.call(this,()=>this.editor.formatLine(t,e,l),n,t,0)}formatText(t,e,s,r,n){let l;var o=N(t,e,s,r,n),a=i(o,4);return t=a[0],e=a[1],l=a[2],n=a[3],x.call(this,()=>this.editor.formatText(t,e,l),n,t,0)}getBounds(t,e=0){let s;s="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);const i=this.container.getBoundingClientRect();return{bottom:s.bottom-i.top,height:s.height,left:s.left-i.left,right:s.right-i.left,top:s.top-i.top,width:s.width}}getContents(t=0,e=this.getLength()-t){var s=N(t,e),r=i(s,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}getFormat(t=this.getSelection(!0),e=0){return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(t=0,e=Number.MAX_VALUE){return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(t=!1){return t&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(t=0,e=this.getLength()-t){var s=N(t,e),r=i(s,2);return t=r[0],e=r[1],this.editor.getHTML(t,e)}getText(t=0,e=this.getLength()-t){var s=N(t,e),r=i(s,2);return t=r[0],e=r[1],this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,s,i=y.sources.API){return x.call(this,()=>this.editor.insertEmbed(t,e,s),i,t)}insertText(t,e,s,r,n){let l;var o=N(t,0,s,r,n),a=i(o,4);return t=a[0],l=a[2],n=a[3],x.call(this,()=>this.editor.insertText(t,e,l),n,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(...t){return this.emitter.off(...t)}on(...t){return this.emitter.on(...t)}once(...t){return this.emitter.once(...t)}removeFormat(t,e,s){var r=N(t,e,s),n=i(r,4);return t=n[0],e=n[1],s=n[3],x.call(this,()=>this.editor.removeFormat(t,e),s,t)}scrollIntoView(){this.selection.scrollIntoView(this.scrollingContainer)}setContents(t,e=a.default.sources.API){return x.call(this,()=>{t=new r.default(t);const e=this.getLength(),s=this.editor.deleteText(0,e),i=this.editor.applyDelta(t),n=i.ops[i.ops.length-1];return null!=n&&"string"==typeof n.insert&&"\n"===n.insert[n.insert.length-1]&&(this.editor.deleteText(this.getLength()-1,1),i.delete(1)),s.compose(i)},e)}setSelection(t,e,s){if(null==t)this.selection.setRange(null,e||y.sources.API);else{var r=N(t,e,s),n=i(r,4);t=n[0],e=n[1],s=n[3],this.selection.setRange(new c.Range(Math.max(0,t),e),s),s!==a.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}setText(t,e=a.default.sources.API){const s=(new r.default).insert(t);return this.setContents(s,e)}update(t=a.default.sources.USER){const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t,e=a.default.sources.API){return x.call(this,()=>(t=new r.default(t),this.editor.applyDelta(t,e)),e,!0)}}function v(t,e){if((e=(0,l.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0}},e)).theme&&e.theme!==y.DEFAULTS.theme){if(e.theme=y.import(`themes/${e.theme}`),null==e.theme)throw new Error(`Invalid theme ${e.theme}. Did you register it?`)}else e.theme=p.default;const s=(0,l.default)(!0,{},e.theme.DEFAULTS);[s,e].forEach(t=>{t.modules=t.modules||{},Object.keys(t.modules).forEach(e=>{!0===t.modules[e]&&(t.modules[e]={})})});const i=Object.keys(s.modules).concat(Object.keys(e.modules)).reduce((t,e)=>{const s=y.import(`modules/${e}`);return null==s?g.error(`Cannot load ${e} module. Are you sure you registered it?`):t[e]=s.DEFAULTS||{},t},{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,l.default)(!0,{},y.DEFAULTS,{modules:i},s,e),["bounds","container","scrollingContainer"].forEach(t=>{"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce((t,s)=>(e.modules[s]&&(t[s]=e.modules[s]),t),{}),e}function x(t,e,s,i){if(!this.isEnabled()&&e===a.default.sources.USER&&!this.allowReadOnlyEdits)return new r.default;let n=null==s?null:this.getSelection();const l=this.editor.delta,o=t();if(null!=n&&(!0===s&&(s=n.index),null==i?n=E(n,o,e):0!==i&&(n=E(n,s,i,e)),this.setSelection(n,a.default.sources.SILENT)),o.length()>0){const t=[a.default.events.TEXT_CHANGE,o,l,e];this.emitter.emit(a.default.events.EDITOR_CHANGE,...t),e!==a.default.sources.SILENT&&this.emitter.emit(...t)}return o}function N(t,e,s,i,r){let n={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(r=i,i=s,s=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(r=i,i=s,s=e,e=0),"object"==typeof s?(n=s,r=i):"string"==typeof s&&(null!=i?n[s]=i:r=s),[t,e,n,r=r||a.default.sources.API]}function E(t,e,s,n){if(null==t)return null;let l,o;if(e instanceof r.default){var u=[t.index,t.index+t.length].map(t=>e.transformPosition(t,n!==a.default.sources.USER)),h=i(u,2);l=h[0],o=h[1]}else{var d=[t.index,t.index+t.length].map(t=>t=0?t+s:Math.max(e,t+s)),f=i(d,2);l=f[0],o=f[1]}return new c.Range(l,o-l)}y.DEFAULTS={bounds:null,modules:{},placeholder:"",readOnly:!1,registry:b,scrollingContainer:null,theme:"default"},y.events=a.default.events,y.sources=a.default.sources,y.version="2.0.0-dev.3",y.imports={delta:r.default,parchment:n,"core/module":u.default,"core/theme":p.default},e.globalRegistry=b,e.expandConfig=v,e.overload=N,e.default=y},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0),r=l(s(9)),n=l(s(6));function l(t){return t&&t.__esModule?t:{default:t}}class o extends i.InlineBlot{static compare(t,e){const s=o.order.indexOf(t),i=o.order.indexOf(e);return s>=0||i>=0?s-i:t===e?0:t0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}o.allowedChildren=[o,r.default,i.EmbedBlot,n.default],o.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],e.default=o},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.escapeText=e.default=void 0;var i=s(0);e.default=class extends i.TextBlot{},e.escapeText=function(t){return t.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{constructor(t,e={}){this.quill=t,this.options=e}}i.DEFAULTS={},e.default=i},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(s(44)),r=n(s(22));function n(t){return t&&t.__esModule?t:{default:t}}const l=(0,n(s(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(t=>{document.addEventListener(t,(...t)=>{Array.from(document.querySelectorAll(".ql-container")).forEach(e=>{const s=r.default.get(e);s&&s.emitter&&s.emitter.handleDOM(...t)})})});class o extends i.default{constructor(){super(),this.listeners={},this.on("error",l.error)}emit(...t){l.log.call(l,...t),super.emit(...t)}handleDOM(t,...e){(this.listeners[t.type]||[]).forEach(({node:s,handler:i})=>{(t.target===s||s.contains(t.target))&&i(t,...e)})}listenDOM(t,e,s){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:s})}}o.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},o.sources={API:"api",SILENT:"silent",USER:"user"},e.default=o},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0);class r extends i.EmbedBlot{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}r.blotName="break",r.tagName="BR",e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=["error","warn","log","info"];let r="warn";function n(t,...e){i.indexOf(t)<=i.indexOf(r)&&console[t](...e)}function l(t){return i.reduce((e,s)=>(e[s]=n.bind(console,s,t),e),{})}l.level=(t=>{r=t}),n.level=l.level,e.default=l},function(t,e,s){var i=Array.prototype.slice,r=s(38),n=s(39),l=t.exports=function(t,e,s){return s||(s={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?s.strict?t===e:t==e:function(t,e,s){var u,c;if(o(t)||o(e))return!1;if(t.prototype!==e.prototype)return!1;if(n(t))return!!n(e)&&(t=i.call(t),e=i.call(e),l(t,e,s));if(a(t)){if(!a(e))return!1;if(t.length!==e.length)return!1;for(u=0;u=0;u--)if(h[u]!=d[u])return!1;for(u=h.length-1;u>=0;u--)if(c=h[u],!l(t[c],e[c],s))return!1;return typeof t==typeof e}(t,e,s))};function o(t){return null===t||void 0===t}function a(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0);e.default=class extends i.ContainerBlot{}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=s(0),n=a(s(17)),l=a(s(11)),o=a(s(8));function a(t){return t&&t.__esModule?t:{default:t}}const u=(0,a(s(10)).default)("quill:selection");class c{constructor(t,e=0){this.index=t,this.length=e}}function h(t,e){try{e.parentNode}catch(t){return!1}return t.contains(e)}e.Range=c,e.default=class{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new c(0,0),this.lastRange=this.savedRange,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,o.default.sources.USER),1)}),this.emitter.on(o.default.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(o.default.events.SCROLL_UPDATE,()=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset),this.update(o.default.sources.SILENT)}catch(t){}})}),this.emitter.on(o.default.events.SCROLL_OPTIMIZE,(t,e)=>{if(e.range){var s=e.range;const t=s.startNode,i=s.startOffset,r=s.endNode,n=s.endOffset;this.setNativeRange(t,i,r,n),this.update(o.default.sources.SILENT)}}),this.update(o.default.sources.SILENT)}handleComposition(){this.root.addEventListener("compositionstart",()=>{this.composing=!0,this.scroll.batchStart()}),this.root.addEventListener("compositionend",()=>{if(this.scroll.batchEnd(),this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(o.default.sources.USER)})}focus(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const s=this.getNativeRange();if(null!=s&&s.native.collapsed&&!this.scroll.query(t,r.Scope.BLOCK)){if(s.start.node!==this.cursor.textNode){const t=this.scroll.find(s.start.node,!1);if(null==t)return;if(t instanceof r.LeafBlot){const e=t.split(s.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,s.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t,e=0){const s=this.scroll.length();let r;t=Math.min(t,s-1),e=Math.min(t+e,s-1)-t;var n=this.scroll.leaf(t),l=i(n,2);let o=l[0],a=l[1];if(null==o)return null;var u=o.position(a,!0),c=i(u,2);r=c[0],a=c[1];const h=document.createRange();if(e>0){h.setStart(r,a);var d=this.scroll.leaf(t+e),f=i(d,2);if(o=f[0],a=f[1],null==o)return null;var p=o.position(a,!0),m=i(p,2);return r=m[0],a=m[1],h.setEnd(r,a),h.getBoundingClientRect()}let g,b="left";return r instanceof Text?(a0&&(b="right")),{bottom:g.top+g.height,height:g.height,left:g[b],right:g[b],top:g.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const s=this.normalizeNative(e);return u.info("getNativeRange",s),s}getRange(){const t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||h(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const s=e.map(t=>{var e=i(t,2);const s=e[0],n=e[1],l=this.scroll.find(s,!0),o=l.offset(this.scroll);return 0===n?o:l instanceof r.LeafBlot?o+l.index(s,n):o+l.length()}),n=Math.min(Math.max(...s),this.scroll.length()-1),l=Math.min(n,...s);return new c(l,n-l)}normalizeNative(t){if(!h(this.root,t.startContainer)||!t.collapsed&&!h(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(t=>{let e=t.node,s=t.offset;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>s)e=e.childNodes[s],s=0;else{if(e.childNodes.length!==s)break;s=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=s}),e}rangeToNative(t){const e=t.collapsed?[t.index]:[t.index,t.index+t.length],s=[],r=this.scroll.length();return e.forEach((t,e)=>{t=Math.min(r-1,t);var n=this.scroll.leaf(t),l=i(n,2);const o=l[0],a=l[1];var u=o.position(a,0!==e),c=i(u,2);const h=c[0],d=c[1];s.push(h,d)}),s.length<2?s.concat(s):s}scrollIntoView(t){const e=this.lastRange;if(null==e)return;const s=this.getBounds(e.index,e.length);if(null==s)return;const r=this.scroll.length()-1;var n=this.scroll.line(Math.min(e.index,r));const l=i(n,1)[0];let o=l;if(e.length>0){var a=this.scroll.line(Math.min(e.index+e.length,r));o=i(a,1)[0]}if(null==l||null==o)return;const u=t.getBoundingClientRect();s.topu.bottom&&(t.scrollTop+=s.bottom-u.bottom)}setNativeRange(t,e,s=t,i=e,r=!1){if(u.info("setNativeRange",t,e,s,i),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==s.parentNode))return;const n=document.getSelection();if(null!=n)if(null!=t){this.hasFocus()||this.root.focus();const l=(this.getNativeRange()||{}).native;if(null==l||r||t!==l.startContainer||e!==l.startOffset||s!==l.endContainer||i!==l.endOffset){"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),"BR"===s.tagName&&(i=Array.from(s.parentNode.childNodes).indexOf(s),s=s.parentNode);const r=document.createRange();r.setStart(t,e),r.setEnd(s,i),n.removeAllRanges(),n.addRange(r)}}else n.removeAllRanges(),this.root.blur()}setRange(t,e=!1,s=o.default.sources.API){if("string"==typeof e&&(s=e,e=!1),u.info("setRange",t),null!=t){const s=this.rangeToNative(t);this.setNativeRange(...s,e)}else this.setNativeRange(null);this.update(s)}update(t=o.default.sources.USER){const e=this.lastRange;var s=this.getRange(),r=i(s,2);const a=r[0],u=r[1];if(this.lastRange=a,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,l.default)(e,this.lastRange)){if(!this.composing&&null!=u&&u.native.collapsed&&u.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const s=[o.default.events.SELECTION_CHANGE,(0,n.default)(this.lastRange),(0,n.default)(e),t];this.emitter.emit(o.default.events.EDITOR_CHANGE,...s),t!==o.default.sources.SILENT&&this.emitter.emit(...s)}}}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0),r=function(t){return t&&t.__esModule?t:{default:t}}(s(6));class n extends i.EmbedBlot{static value(){}constructor(t,e,s){super(t,e),this.selection=s,this.textNode=document.createTextNode(n.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let s=this,r=0;for(;null!=s&&s.statics.scope!==i.Scope.BLOCK_BLOT;)r+=s.offset(s.parent),s=s.parent;null!=s&&(this.savedLength=n.CONTENTS.length,s.optimize(),s.formatAt(r,n.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof r.default?this.prev:null,s=e?e.length():0,i=this.next instanceof r.default?this.next:null,l=i?i.text:"",o=this.textNode,a=o.data.split(n.CONTENTS).join("");let u;if(o.data=n.CONTENTS,e)u=e,(a||i)&&(e.insertAt(e.length(),a+l),i&&i.remove());else if(i)u=i,i.insertAt(0,a);else{const t=document.createTextNode(a);u=this.scroll.create(t),this.parent.insertBefore(u,this)}if(this.remove(),t){const r=(t,r)=>e&&t===e.domNode?r:t===o?s+r-1:i&&t===i.domNode?s+a.length+r:null,n=r(t.start.node,t.start.offset),l=r(t.end.node,t.end.offset);if(null!==n&&null!==l)return{startNode:u.domNode,startOffset:n,endNode:u.domNode,endOffset:l}}return null}update(t,e){if(t.some(t=>"characterData"===t.type&&t.target===this.textNode)){const t=this.restore();t&&(e.range=t)}}value(){return""}}n.blotName="cursor",n.className="ql-cursor",n.tagName="span",n.CONTENTS="\ufeff",e.default=n},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(s(5));class r extends i.default{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return n(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function n(t,e){const s=document.createElement("a");s.href=t;const i=s.href.slice(0,s.href.indexOf(":"));return e.indexOf(i)>-1}r.blotName="link",r.tagName="A",r.SANITIZED_URL="about:blank",r.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=r,e.sanitize=n},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(93));let r=0;function n(t,e){t.setAttribute(e,!("true"===t.getAttribute(e)))}e.default=class{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),n(this.label,"aria-expanded"),n(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");return e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item"),t.hasAttribute("value")&&e.setAttribute("data-value",t.getAttribute("value")),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=i.default,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${r}`,r+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const s=this.buildItem(e);t.appendChild(s),!0===e.selected&&this.selectItem(s)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t,e=!1){const s=this.container.querySelector(".ql-selected");t!==s&&(null!=s&&s.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}},function(t,e){var s=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,s,i;try{e=Map}catch(t){e=function(){}}try{s=Set}catch(t){s=function(){}}try{i=Promise}catch(t){i=function(){}}function r(n,o,a,u,c){"object"==typeof o&&(a=o.depth,u=o.prototype,c=o.includeNonEnumerable,o=o.circular);var h=[],d=[],f="undefined"!=typeof Buffer;return void 0===o&&(o=!0),void 0===a&&(a=1/0),function n(a,p){if(null===a)return null;if(0===p)return a;var m,g;if("object"!=typeof a)return a;if(t(a,e))m=new e;else if(t(a,s))m=new s;else if(t(a,i))m=new i(function(t,e){a.then(function(e){t(n(e,p-1))},function(t){e(n(t,p-1))})});else if(r.__isArray(a))m=[];else if(r.__isRegExp(a))m=new RegExp(a.source,l(a)),a.lastIndex&&(m.lastIndex=a.lastIndex);else if(r.__isDate(a))m=new Date(a.getTime());else{if(f&&Buffer.isBuffer(a))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(a.length):new Buffer(a.length),a.copy(m),m;t(a,Error)?m=Object.create(a):void 0===u?(g=Object.getPrototypeOf(a),m=Object.create(g)):(m=Object.create(u),g=u)}if(o){var b=h.indexOf(a);if(-1!=b)return d[b];h.push(a),d.push(m)}for(var y in t(a,e)&&a.forEach(function(t,e){var s=n(e,p-1),i=n(t,p-1);m.set(s,i)}),t(a,s)&&a.forEach(function(t){var e=n(t,p-1);m.add(e)}),a){var v;g&&(v=Object.getOwnPropertyDescriptor(g,y)),v&&null==v.set||(m[y]=n(a[y],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(a);for(y=0;y`00${parseInt(t,10).toString(16)}`.slice(-2)).join("")}`}}const n=new i.ClassAttributor("color","ql-color",{scope:i.Scope.INLINE}),l=new r("color","color",{scope:i.Scope.INLINE});e.ColorAttributor=r,e.ColorClass=n,e.ColorStyle=l},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CodeBlockContainer=e.Code=void 0;var i=h(s(3)),r=h(s(9)),n=h(s(14)),l=h(s(5)),o=s(6),a=h(o),u=h(s(12)),c=h(s(4));function h(t){return t&&t.__esModule?t:{default:t}}class d extends u.default{static create(t){const e=super.create(t);return e.setAttribute("spellcheck",!1),e}html(t,e){const s=this.children.map(t=>t.domNode.innerText).join("\n").slice(t,t+e);return`
${(0,o.escapeText)(s)}
`}}class f extends i.default{static register(){c.default.register(d)}}class p extends l.default{}p.blotName="code",p.tagName="CODE",f.blotName="code-block",f.className="ql-code-block",f.tagName="DIV",d.blotName="code-block-container",d.className="ql-code-block-container",d.tagName="DIV",d.allowedChildren=[f],f.allowedChildren=[a.default,r.default,n.default],f.requiredContainer=d,f.TAB=" ",e.Code=p,e.CodeBlockContainer=d,e.default=f},function(t,e,s){"use strict";var i=_(s(64)),r=_(s(65)),n=_(s(66)),l=_(s(67)),o=_(s(68)),a=_(s(69)),u=_(s(70)),c=_(s(71)),h=_(s(72)),d=_(s(73)),f=_(s(74)),p=_(s(75)),m=_(s(76)),g=_(s(77)),b=_(s(78)),y=_(s(79)),v=_(s(80)),x=_(s(81)),N=_(s(82)),E=_(s(83)),A=_(s(84)),q=_(s(85)),w=_(s(86)),k=_(s(87)),L=_(s(88)),T=_(s(89)),S=_(s(90)),O=_(s(91)),C=_(s(92));function _(t){return t&&t.__esModule?t:{default:t}}t.exports={align:{"":i.default,center:r.default,right:n.default,justify:l.default},background:o.default,blockquote:a.default,bold:u.default,clean:c.default,code:h.default,"code-block":h.default,color:d.default,direction:{"":f.default,rtl:p.default},formula:m.default,header:{1:g.default,2:b.default},italic:y.default,image:v.default,indent:{"+1":x.default,"-1":N.default},link:E.default,list:{bullet:A.default,check:q.default,ordered:w.default},script:{sub:k.default,super:L.default},strike:T.default,table:S.default,underline:O.default,video:C.default}},function(t,e,s){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r,n=i(s(42));!function(t){t.iterator=function(t){return new n.default(t)},t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}}(r||(r={})),e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=new WeakMap},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{constructor(t,e){this.quill=t,this.options=e,this.modules={}}init(){Object.keys(this.options.modules).forEach(t=>{null==this.modules[t]&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}i.DEFAULTS={modules:{}},i.themes={default:i},e.default=i},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0),r=function(t){return t&&t.__esModule?t:{default:t}}(s(6));const n="\ufeff";e.default=class extends i.EmbedBlot{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable",!1),Array.from(this.domNode.childNodes).forEach(t=>{this.contentNode.appendChild(t)}),this.leftGuard=document.createTextNode(n),this.rightGuard=document.createTextNode(n),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e,s;const i=t.data.split(n).join("");if(t===this.leftGuard)if(this.prev instanceof r.default){const t=this.prev.length();this.prev.insertAt(t,i),e={startNode:this.prev.domNode,startOffset:t+i.length}}else s=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(s),this),e={startNode:s,startOffset:i.length};else t===this.rightGuard&&(this.next instanceof r.default?(this.next.insertAt(0,i),e={startNode:this.next.domNode,startOffset:i.length}):(s=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(s),this.next),e={startNode:s,startOffset:i.length}));return t.data=n,e}update(t,e){t.forEach(t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const s=this.restore(t.target);s&&(e.range=s)}})}}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.traverse=e.matchText=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=b(s(2)),n=b(s(1)),l=s(0),o=b(s(4)),a=b(s(10)),u=b(s(7)),c=s(26),h=s(27),d=b(s(19)),f=s(18),p=s(28),m=s(29),g=s(30);function b(t){return t&&t.__esModule?t:{default:t}}const y=(0,a.default)("quill:clipboard"),v=[[Node.TEXT_NODE,_],[Node.TEXT_NODE,C],["br",function(t,e){q(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,C],[Node.ELEMENT_NODE,O],[Node.ELEMENT_NODE,S],[Node.ELEMENT_NODE,function(t,e){const s={},i=t.style||{};"italic"===i.fontStyle&&(s.italic=!0);(i.fontWeight.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(s.bold=!0);Object.keys(s).length>0&&(e=A(e,s));if(parseFloat(i.textIndent||0)>0)return(new n.default).insert("\t").concat(e);return e}],["li",function(t,e,s){const i=s.query(t);if(null==i||"list"!==i.blotName||!q(e,"\n"))return e;let r=-1,l=t.parentNode;for(;null!=l;)["OL","UL"].includes(l.tagName)&&(r+=1),l=l.parentNode;return r<=0?e:e.compose((new n.default).retain(e.length()-1).retain(1,{indent:r}))}],["ol, ul",function(t,e){const s="OL"===t.tagName?"ordered":"bullet";return A(e,"list",s)}],["pre",function(t,e,s){const i=s.query("code-block"),r=!i||i.formats(t,s);return A(e,"code-block",r)}],["tr",function(t,e){const s="TABLE"===t.parentNode.tagName?t.parentNode:t.parentNode.parentNode,i=Array.from(s.querySelectorAll("tr")).indexOf(t)+1;return A(e,"table",i)}],["b",T.bind(T,"bold")],["i",T.bind(T,"italic")],["style",function(){return new n.default}]],x=[c.AlignAttribute,p.DirectionAttribute].reduce((t,e)=>(t[e.keyName]=e,t),{}),N=[c.AlignStyle,h.BackgroundStyle,f.ColorStyle,p.DirectionStyle,m.FontStyle,g.SizeStyle].reduce((t,e)=>(t[e.keyName]=e,t),{});class E extends u.default{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",t=>this.onCaptureCopy(t,!1)),this.quill.root.addEventListener("cut",t=>this.onCaptureCopy(t,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],v.concat(this.options.matchers).forEach(([t,e])=>{this.addMatcher(t,e)})}addMatcher(t,e){this.matchers.push([t,e])}convert({html:t,text:e},s={}){if(s[d.default.blotName])return(new n.default).insert(e,{[d.default.blotName]:s[d.default.blotName]});if(!t)return(new n.default).insert(e||"");const r=(new DOMParser).parseFromString(t,"text/html").body,l=new WeakMap;var o=this.prepareMatching(r,l),a=i(o,2);const u=a[0],c=a[1],h=L(this.quill.scroll,r,u,c,l);return q(h,"\n")&&(null==h.ops[h.ops.length-1].attributes||s.table)?h.compose((new n.default).retain(h.length()-1).delete(1)):h}dangerouslyPasteHTML(t,e,s=o.default.sources.API){if("string"==typeof t){const s=this.convert({html:t,text:""});this.quill.setContents(s,e),this.quill.setSelection(0,o.default.sources.SILENT)}else{const i=this.convert({html:e,text:""});this.quill.updateContents((new n.default).retain(t).concat(i),s),this.quill.setSelection(t+i.length(),o.default.sources.SILENT)}}onCaptureCopy(t,e=!1){if(t.defaultPrevented)return;t.preventDefault();var s=this.quill.selection.getRange();const r=i(s,1)[0];if(null==r)return;var n=this.onCopy(r,e);const l=n.html,a=n.text;t.clipboardData.setData("text/plain",a),t.clipboardData.setData("text/html",l),e&&this.quill.deleteText(r,o.default.sources.USER)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(null==e)return;const s=t.clipboardData.getData("text/html"),i=t.clipboardData.getData("text/plain"),r=Array.from(t.clipboardData.files||[]);!s&&r.length>0?this.quill.uploader.upload(e,r):this.onPaste(e,{html:s,text:i})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,{text:e,html:s}){const i=this.quill.getFormat(t.index),r=this.convert({text:e,html:s},i);y.log("onPaste",r,{text:e,html:s});const l=(new n.default).retain(t.index).delete(t.length).concat(r);this.quill.updateContents(l,o.default.sources.USER),this.quill.setSelection(l.length()-t.length,o.default.sources.SILENT),this.quill.scrollIntoView()}prepareMatching(t,e){const s=[],r=[];return this.matchers.forEach(n=>{var l=i(n,2);const o=l[0],a=l[1];switch(o){case Node.TEXT_NODE:r.push(a);break;case Node.ELEMENT_NODE:s.push(a);break;default:Array.from(t.querySelectorAll(o)).forEach(t=>{if(e.has(t)){e.get(t).push(a)}else e.set(t,[a])})}}),[s,r]}}function A(t,e,s){return"object"==typeof e?Object.keys(e).reduce((t,s)=>A(t,s,e[s]),t):t.reduce((t,i)=>i.attributes&&i.attributes[e]?t.push(i):t.insert(i.insert,(0,r.default)({},{[e]:s},i.attributes)),new n.default)}function q(t,e){let s="";for(let i=t.ops.length-1;i>=0&&s.lengthi(e,s,t),new n.default):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((n,l)=>{let o=L(t,l,s,i,r);return l.nodeType===e.ELEMENT_NODE&&(o=s.reduce((e,s)=>s(l,e,t),o),o=(r.get(l)||[]).reduce((e,s)=>s(l,e,t),o)),n.concat(o)},new n.default):new n.default}function T(t,e,s){return A(s,t,!0)}function S(t,e,s){const i=l.Attributor.keys(t),r=l.ClassAttributor.keys(t),n=l.StyleAttributor.keys(t),o={};return i.concat(r).concat(n).forEach(e=>{let i=s.query(e,l.Scope.ATTRIBUTE);null!=i&&(o[i.attrName]=i.value(t),o[i.attrName])||(null==(i=x[e])||i.attrName!==e&&i.keyName!==e||(o[i.attrName]=i.value(t)||void 0),null==(i=N[e])||i.attrName!==e&&i.keyName!==e||(i=N[e],o[i.attrName]=i.value(t)||void 0))}),Object.keys(o).length>0?A(e,o):e}function O(t,e,s){const i=s.query(t);if(null==i)return e;if(i.prototype instanceof l.EmbedBlot){const e={},r=i.value(t);if(null!=r)return e[i.blotName]=r,(new n.default).insert(e,i.formats(t,s))}else if(i.prototype instanceof l.BlockBlot&&!q(e,"\n")&&e.insert("\n"),"function"==typeof i.formats)return A(e,i.blotName,i.formats(t,s));return e}function C(t,e){return q(e,"\n")||(w(t)||e.length()>0&&t.nextSibling&&w(t.nextSibling))&&e.insert("\n"),e}function _(t,e){let s=t.data;if("O:P"===t.parentNode.tagName)return e.insert(s.trim());if(0===s.trim().length)return e;if(!function t(e){return null!=e&&(k.has(e)||("PRE"===e.tagName?k.set(e,!0):k.set(e,t(e.parentNode))),k.get(e))}(t)){const e=(t,e)=>{const s=e.replace(/[^\u00a0]/g,"");return s.length<1&&t?" ":s};s=(s=s.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,e.bind(e,!0)),(null==t.previousSibling&&w(t.parentNode)||null!=t.previousSibling&&w(t.previousSibling))&&(s=s.replace(/^\s+/,e.bind(e,!1))),(null==t.nextSibling&&w(t.parentNode)||null!=t.nextSibling&&w(t.nextSibling))&&(s=s.replace(/\s+$/,e.bind(e,!1)))}return e.insert(s)}e.default=E,e.matchAttributor=S,e.matchBlot=O,e.matchNewline=C,e.matchText=_,e.traverse=L},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlignStyle=e.AlignClass=e.AlignAttribute=void 0;var i=s(0);const r={scope:i.Scope.BLOCK,whitelist:["right","center","justify"]},n=new i.Attributor("align","align",r),l=new i.ClassAttributor("align","ql-align",r),o=new i.StyleAttributor("align","text-align",r);e.AlignAttribute=n,e.AlignClass=l,e.AlignStyle=o},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundStyle=e.BackgroundClass=void 0;var i=s(0),r=s(18);const n=new i.ClassAttributor("background","ql-bg",{scope:i.Scope.INLINE}),l=new r.ColorAttributor("background","background-color",{scope:i.Scope.INLINE});e.BackgroundClass=n,e.BackgroundStyle=l},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirectionStyle=e.DirectionClass=e.DirectionAttribute=void 0;var i=s(0);const r={scope:i.Scope.BLOCK,whitelist:["rtl"]},n=new i.Attributor("direction","dir",r),l=new i.ClassAttributor("direction","ql-direction",r),o=new i.StyleAttributor("direction","direction",r);e.DirectionAttribute=n,e.DirectionClass=l,e.DirectionStyle=o},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontClass=e.FontStyle=void 0;var i=s(0);const r={scope:i.Scope.INLINE,whitelist:["serif","monospace"]},n=new i.ClassAttributor("font","ql-font",r);const l=new class extends i.StyleAttributor{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",r);e.FontStyle=l,e.FontClass=n},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SizeStyle=e.SizeClass=void 0;var i=s(0);const r=new i.ClassAttributor("size","ql-size",{scope:i.Scope.INLINE,whitelist:["small","large","huge"]}),n=new i.StyleAttributor("size","font-size",{scope:i.Scope.INLINE,whitelist:["10px","18px","32px"]});e.SizeClass=r,e.SizeStyle=n},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(5));class r extends i.default{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}r.blotName="bold",r.tagName=["STRONG","B"],e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(16));e.default=class extends i.default{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(t=>{t.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const s=this.label.querySelector(".ql-color-label"),i=t&&t.getAttribute("data-value")||"";s&&("line"===s.tagName?s.style.stroke=i:s.style.fill=i)}}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(16));e.default=class extends i.default{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const s=t||this.defaultItem;this.label.innerHTML!==s.innerHTML&&(this.label.innerHTML=s.innerHTML)}}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2,s=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${s}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect();let n=0;if(r.right>i.right&&(n=i.right-r.right,this.root.style.left=`${e+n}px`),r.lefti.bottom){const e=r.bottom-r.top,i=t.bottom-t.top+e;this.root.style.top=`${s-i}px`,this.root.classList.add("ql-flip")}return n}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var i=c(s(2)),r=c(s(8)),n=c(s(23)),l=c(s(32)),o=c(s(33)),a=c(s(16)),u=c(s(34));function c(t){return t&&t.__esModule?t:{default:t}}const h=[!1,"center","right","justify"],d=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],f=[!1,"serif","monospace"],p=["1","2","3",!1],m=["small",!1,"large","huge"];class g extends n.default{constructor(t,e){super(t,e);const s=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach(t=>{t.container.contains(e.target)||t.close()})):document.body.removeEventListener("click",s)};t.emitter.listenDOM("click",document.body,s)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(t=>{(t.getAttribute("class")||"").split(/\s+/).forEach(s=>{if(s.startsWith("ql-")&&(s=s.slice("ql-".length),null!=e[s]))if("direction"===s)t.innerHTML=e[s][""]+e[s].rtl;else if("string"==typeof e[s])t.innerHTML=e[s];else{const i=t.value||"";null!=i&&e[s][i]&&(t.innerHTML=e[s][i])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(t=>{if(t.classList.contains("ql-align"))return null==t.querySelector("option")&&b(t,h),new o.default(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const s=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&b(t,d,"background"===s?"#ffffff":"#000000"),new l.default(t,e[s])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?b(t,f):t.classList.contains("ql-header")?b(t,p):t.classList.contains("ql-size")&&b(t,m)),new a.default(t)});this.quill.on(r.default.events.EDITOR_CHANGE,()=>{this.pickers.forEach(t=>{t.update()})})}}g.DEFAULTS=(0,i.default)(!0,{},n.default.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});function b(t,e,s=!1){e.forEach(e=>{const i=document.createElement("option");e===s?i.setAttribute("selected","selected"):i.setAttribute("value",e),t.appendChild(i)})}e.BaseTooltip=class extends u.default{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())})}cancel(){this.hide()}edit(t="link",e=null){this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){const t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}save(){let t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{const e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,r.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,r.default.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const s=e.index+e.length;this.quill.insertEmbed(s,this.root.getAttribute("data-mode"),t,r.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(s+1," ",r.default.sources.USER),this.quill.setSelection(s+2,r.default.sources.USER)}break}}this.textbox.value="",this.hide()}},e.default=g},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=B(s(37)),r=s(26),n=s(28),l=B(s(49)),o=B(s(50)),a=B(s(51)),u=B(s(52)),c=s(27),h=s(18),d=s(29),f=s(30),p=B(s(31)),m=B(s(53)),g=B(s(15)),b=B(s(54)),y=B(s(55)),v=B(s(56)),x=B(s(57)),N=B(s(58)),E=B(s(59)),A=s(19),q=B(A),w=B(s(60)),k=B(s(61)),L=B(s(63)),T=B(s(20)),S=B(s(16)),O=B(s(32)),C=B(s(33)),_=B(s(34)),M=B(s(94)),R=B(s(95));function B(t){return t&&t.__esModule?t:{default:t}}i.default.register({"attributors/attribute/direction":n.DirectionAttribute,"attributors/class/align":r.AlignClass,"attributors/class/background":c.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":n.DirectionClass,"attributors/class/font":d.FontClass,"attributors/class/size":f.SizeClass,"attributors/style/align":r.AlignStyle,"attributors/style/background":c.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":n.DirectionStyle,"attributors/style/font":d.FontStyle,"attributors/style/size":f.SizeStyle},!0),i.default.register({"formats/align":r.AlignClass,"formats/direction":n.DirectionClass,"formats/indent":l.default,"formats/background":c.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":d.FontClass,"formats/size":f.SizeClass,"formats/blockquote":o.default,"formats/code-block":q.default,"formats/header":a.default,"formats/list":u.default,"formats/bold":p.default,"formats/code":A.Code,"formats/italic":m.default,"formats/link":g.default,"formats/script":b.default,"formats/strike":y.default,"formats/underline":v.default,"formats/formula":x.default,"formats/image":N.default,"formats/video":E.default,"modules/syntax":w.default,"modules/table":k.default,"modules/toolbar":L.default,"themes/bubble":M.default,"themes/snow":R.default,"ui/icons":T.default,"ui/picker":S.default,"ui/icon-picker":C.default,"ui/color-picker":O.default,"ui/tooltip":_.default},!0),e.default=i.default},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=b(s(4)),r=s(3),n=b(r),l=b(s(9)),o=b(s(12)),a=b(s(14)),u=b(s(24)),c=b(s(5)),h=b(s(45)),d=b(s(6)),f=b(s(25)),p=b(s(46)),m=b(s(47)),g=b(s(48));function b(t){return t&&t.__esModule?t:{default:t}}i.default.register({"blots/block":n.default,"blots/block/embed":r.BlockEmbed,"blots/break":l.default,"blots/container":o.default,"blots/cursor":a.default,"blots/embed":u.default,"blots/inline":c.default,"blots/scroll":h.default,"blots/text":d.default,"modules/clipboard":f.default,"modules/history":p.default,"modules/keyboard":m.default,"modules/uploader":g.default}),e.default=i.default},function(t,e){function s(t){var e=[];for(var s in t)e.push(s);return e}(t.exports="function"==typeof Object.keys?Object.keys:s).shim=s},function(t,e){var s="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function i(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(e=t.exports=s?i:r).supported=i,e.unsupported=r},function(t,e){var s=-1,i=1,r=0;function n(t,e,u,c){if(t===e)return t?[[r,t]]:[];if(null!=u){var p=function(t,e,s){var i="number"==typeof s?{index:s,length:0}:s.oldRange,r="number"==typeof s?null:s.newRange,n=t.length,l=e.length;if(0===i.length&&(null===r||0===r.length)){var o=i.index,a=t.slice(0,o),u=t.slice(o),c=r?r.index:null,h=o+l-n;if((null===c||c===h)&&!(h<0||h>l)){var d=e.slice(0,h),p=e.slice(h);if(p===u){var m=Math.min(o,h),g=a.slice(0,m),b=d.slice(0,m);if(g===b){var y=a.slice(m),v=d.slice(m);return f(g,y,v,u)}}}if(null===c||c===o){var x=o,d=e.slice(0,x),p=e.slice(x);if(d===a){var N=Math.min(n-x,l-x),E=u.slice(u.length-N),A=p.slice(p.length-N);if(E===A){var y=u.slice(0,u.length-N),v=p.slice(0,p.length-N);return f(a,y,v,E)}}}}if(i.length>0&&r&&0===r.length){var g=t.slice(0,i.index),E=t.slice(i.index+i.length),m=g.length,N=E.length;if(!(le.length?t:e,h=t.length>e.length?e:t,d=c.indexOf(h);if(-1!==d)return u=[[i,c.substring(0,d)],[r,h],[i,c.substring(d+h.length)]],t.length>e.length&&(u[0][0]=u[2][0]=s),u;if(1===h.length)return[[s,t],[i,e]];var f=function(t,e){var s=t.length>e.length?t:e,i=t.length>e.length?e:t;if(s.length<4||2*i.length=t.length?[i,r,n,l,h]:null}var n,l,u,c,h,d=r(s,i,Math.ceil(s.length/4)),f=r(s,i,Math.ceil(s.length/2));if(!d&&!f)return null;n=f?d&&d[4].length>f[4].length?d:f:d;t.length>e.length?(l=n[0],u=n[1],c=n[2],h=n[3]):(c=n[0],h=n[1],l=n[2],u=n[3]);var p=n[4];return[l,u,c,h,p]}(t,e);if(f){var p=f[0],m=f[1],g=f[2],b=f[3],y=f[4],v=n(p,g),x=n(m,b);return v.concat([[r,y]],x)}return function(t,e){for(var r=t.length,n=e.length,o=Math.ceil((r+n)/2),a=o,u=2*o,c=new Array(u),h=new Array(u),d=0;dr)g+=2;else if(E>n)m+=2;else if(p){var A=a+f-x;if(A>=0&&A=q)return l(t,e,L,E)}}}for(var w=-v+b;w<=v-y;w+=2){for(var A=a+w,k=(q=w===-v||w!==v&&h[A-1]r)y+=2;else if(k>n)b+=2;else if(!p){var N=a+f-w;if(N>=0&&N=(q=r-q))return l(t,e,L,E)}}}}return[[s,t],[i,e]]}(t,e)}(t=t.substring(0,t.length-m),e=e.substring(0,e.length-m));return g&&y.unshift([r,g]),b&&y.push([r,b]),function t(e,n){e.push([r,""]);var l=0;var u=0;var c=0;var f="";var p="";var m;for(;l=0&&d(e[g][1])){var b=e[g][1].slice(-1);if(e[g][1]=e[g][1].slice(0,-1),f=b+f,p=b+p,!e[g][1]){e.splice(g,1),l--;var y=g-1;e[y]&&e[y][0]===i&&(c++,p=e[y][1]+p,y--),e[y]&&e[y][0]===s&&(u++,f=e[y][1]+f,y--),g=y}}if(h(e[l][1])){var b=e[l][1].charAt(0);e[l][1]=e[l][1].slice(1),f+=b,p+=b}}if(l0||p.length>0){f.length>0&&p.length>0&&(0!==(m=o(p,f))&&(g>=0?e[g][1]+=p.substring(0,m):(e.splice(0,0,[r,p.substring(0,m)]),l++),p=p.substring(m),f=f.substring(m)),0!==(m=a(p,f))&&(e[l][1]=p.substring(p.length-m)+e[l][1],p=p.substring(0,p.length-m),f=f.substring(0,f.length-m)));var v=c+u;0===f.length&&0===p.length?(e.splice(l-v,v),l-=v):0===f.length?(e.splice(l-v,v,[i,p]),l=l-v+1):0===p.length?(e.splice(l-v,v,[s,f]),l=l-v+1):(e.splice(l-v,v,[s,f],[i,p]),l=l-v+2)}0!==l&&e[l-1][0]===r?(e[l-1][1]+=e[l][1],e.splice(l,1)):l++,c=0,u=0,f="",p=""}""===e[e.length-1][1]&&e.pop();var x=!1;l=1;for(;l=55296&&t<=56319}function c(t){return t>=56320&&t<=57343}function h(t){return c(t.charCodeAt(0))}function d(t){return u(t.charCodeAt(t.length-1))}function f(t,e,n,l){return d(t)||h(l)?null:function(t){for(var e=[],s=0;s0&&e.push(t[s]);return e}([[r,t],[s,e],[i,n],[r,l]])}function p(t,e,s){return n(t,e,s,!0)}p.INSERT=i,p.DELETE=s,p.EQUAL=r,t.exports=p},function(t,e,s){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r,n=i(s(11)),l=i(s(2));!function(t){t.compose=function(t,e,s){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var i=l.default(!0,{},e);for(var r in s||(i=Object.keys(i).reduce(function(t,e){return null!=i[e]&&(t[e]=i[e]),t},{})),t)void 0!==t[r]&&void 0===e[r]&&(i[r]=t[r]);return Object.keys(i).length>0?i:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var s=Object.keys(t).concat(Object.keys(e)).reduce(function(s,i){return n.default(t[i],e[i])||(s[i]=void 0===e[i]?null:e[i]),s},{});return Object.keys(s).length>0?s:void 0},t.transform=function(t,e,s){if(void 0===s&&(s=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!s)return e;var i=Object.keys(e).reduce(function(s,i){return void 0===t[i]&&(s[i]=e[i]),s},{});return Object.keys(i).length>0?i:void 0}}}(r||(r={})),e.default=r},function(t,e,s){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(s(21)),n=function(){function t(t){this.ops=t,this.index=0,this.offset=0}return t.prototype.hasNext=function(){return this.peekLength()<1/0},t.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var s=this.offset,i=r.default.length(e);if(t>=i-s?(t=i-s,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var n={};return e.attributes&&(n.attributes=e.attributes),"number"==typeof e.retain?n.retain=t:"string"==typeof e.insert?n.insert=e.insert.substr(s,t):n.insert=e.insert,n}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,s=this.next(),i=this.ops.slice(this.index);return this.offset=t,this.index=e,[s].concat(i)}return[]},t}();e.default=n},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=b(s(17)),n=b(s(11)),l=b(s(2)),o=s(1),a=b(o),u=s(0),c=s(13),h=b(s(14)),d=s(3),f=b(d),p=b(s(9)),m=s(6),g=b(m);function b(t){return t&&t.__esModule?t:{default:t}}const y=/^[ -~]*$/;function v(t,e,s){if(0===t.length){var r=E(s.pop());const t=i(r,1)[0];return e<=0?``:`${v([],e-1,s)}`}var n=function(t){return Array.isArray(t)?t:Array.from(t)}(t),l=n[0];const o=l.child,a=l.offset,u=l.length,c=l.indent,h=l.type,d=n.slice(1);var f=E(h),p=i(f,2);const m=p[0],g=p[1];if(c>e)return s.push(h),`<${m}>${x(o,a,u)}${v(d,c,s)}`;if(c===e)return`${x(o,a,u)}${v(d,c,s)}`;var b=E(s.pop());return`${v(t,e-1,s)}`}function x(t,e,s,r=!1){if("function"==typeof t.html)return t.html(e,s);if(t instanceof g.default)return(0,m.escapeText)(t.value().slice(e,e+s));if(t.children){if("list-container"===t.statics.blotName){const i=[];return t.children.forEachAt(e,s,(t,e,s)=>{const r=t.formats();i.push({child:t,offset:e,length:s,indent:r.indent||0,type:r.list})}),v(i,-1,[])}const a=[];if(t.children.forEachAt(e,s,(t,e,s)=>{a.push(x(t,e,s))}),r||"list"===t.statics.blotName)return a.join("");var n=t.domNode;const u=n.outerHTML,c=n.innerHTML;var l=u.split(`>${c}<`),o=i(l,2);const h=o[0],d=o[1];return"${a.join("")}<${d}`:`${h}>${a.join("")}<${d}`}return t.domNode.outerHTML}function N(t,e){return Object.keys(e).reduce((s,i)=>null==t[i]?s:(e[i]===t[i]?s[i]=e[i]:Array.isArray(e[i])?e[i].indexOf(t[i])<0&&(s[i]=e[i].concat([t[i]])):s[i]=[e[i],t[i]],s),{})}function E(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function A({index:t,length:e},s){return new c.Range(t+s,e)}e.default=class{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){let e=!1;this.scroll.update();let s=this.scroll.length();this.scroll.batchStart();const r=function(t){return t.reduce((t,e)=>{if("string"==typeof e.insert){const s=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(s,e.attributes)}return t.push(e)},new a.default)}(t);return r.reduce((t,r)=>{const n=r.retain||r.delete||r.insert.length||1;let a=r.attributes||{};if(null!=r.insert){if("string"==typeof r.insert){let n=r.insert;n.endsWith("\n")&&e&&(e=!1,n=n.slice(0,-1)),(t>=s||this.scroll.descendant(d.BlockEmbed,t)[0])&&!n.endsWith("\n")&&(e=!0),this.scroll.insertAt(t,n);var c=this.scroll.line(t),h=i(c,2);const m=h[0],g=h[1];let b=(0,l.default)({},(0,d.bubbleFormats)(m));if(m instanceof f.default){var p=m.descendant(u.LeafBlot,g);const t=i(p,1)[0];b=(0,l.default)(b,(0,d.bubbleFormats)(t))}a=o.AttributeMap.diff(b,a)||{}}else if("object"==typeof r.insert){const e=Object.keys(r.insert)[0];if(null==e)return t;this.scroll.insertAt(t,e,r.insert[e])}s+=n}return Object.keys(a).forEach(e=>{this.scroll.formatAt(t,n,e,a[e])}),t+n},0),r.reduce((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+(e.retain||e.insert.length||1),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new a.default).retain(t).delete(e))}formatLine(t,e,s={}){this.scroll.update(),Object.keys(s).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(t=>{t.format(i,s[i])})}),this.scroll.optimize();const i=(new a.default).retain(t).retain(e,(0,r.default)(s));return this.update(i)}formatText(t,e,s={}){Object.keys(s).forEach(i=>{this.scroll.formatAt(t,e,i,s[i])});const i=(new a.default).retain(t).retain(e,(0,r.default)(s));return this.update(i)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new a.default)}getFormat(t,e=0){let s=[],r=[];0===e?this.scroll.path(t).forEach(t=>{const e=i(t,1)[0];e instanceof f.default?s.push(e):e instanceof u.LeafBlot&&r.push(e)}):(s=this.scroll.lines(t,e),r=this.scroll.descendants(u.LeafBlot,t,e));const n=[s,r].map(t=>{if(0===t.length)return{};let e=(0,d.bubbleFormats)(t.shift());for(;Object.keys(e).length>0;){const s=t.shift();if(null==s)return e;e=N((0,d.bubbleFormats)(s),e)}return e});return l.default.apply(l.default,n)}getHTML(t,e){var s=this.scroll.line(t),r=i(s,2);const n=r[0],l=r[1];return n.length()>=l+e?x(n,l,e,!0):x(this.scroll,t,e,!0)}getText(t,e){return this.getContents(t,e).filter(t=>"string"==typeof t.insert).map(t=>t.insert).join("")}insertEmbed(t,e,s){return this.scroll.insertAt(t,e,s),this.update((new a.default).retain(t).insert({[e]:s}))}insertText(t,e,s={}){return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(s).forEach(i=>{this.scroll.formatAt(t,e.length,i,s[i])}),this.update((new a.default).retain(t).insert(e,(0,r.default)(s)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t.statics.blotName===f.default.blotName&&!(t.children.length>1)&&t.children.head instanceof p.default}removeFormat(t,e){const s=this.getText(t,e);var r=this.scroll.line(t+e),n=i(r,2);const l=n[0],o=n[1];let u=0,c=new a.default;null!=l&&(u=l.length()-o,c=l.delta().slice(o,o+u-1).insert("\n"));const h=this.getContents(t,e+u).diff((new a.default).insert(s).concat(c)),d=(new a.default).retain(t).concat(h);return this.applyDelta(d)}update(t,e=[],s){const i=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(y)&&this.scroll.find(e[0].target)){const r=this.scroll.find(e[0].target),n=(0,d.bubbleFormats)(r),l=r.offset(this.scroll),o=e[0].oldValue.replace(h.default.CONTENTS,""),u=(new a.default).insert(o),c=(new a.default).insert(r.value()),f=s&&{oldRange:A(s.oldRange,-l),newRange:A(s.newRange,-l)};t=(new a.default).retain(l).concat(u.diff(c,f)).reduce((t,e)=>e.insert?t.insert(e.insert,n):t.push(e),new a.default),this.delta=i.compose(t)}else this.delta=this.getDelta(),t&&(0,n.default)(i.compose(t),this.delta)||(t=i.diff(this.delta,s));return t}}},function(t,e){"use strict";var s=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,s,r,n){if("function"!=typeof s)throw new TypeError("The listener must be a function");var l=new function(t,e,s){this.fn=t,this.context=e,this.once=s||!1}(s,r||t,n),o=i?i+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],l]:t._events[o].push(l):(t._events[o]=l,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)s.call(t,e)&&r.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,l=new Array(n);r0){if(n instanceof l.BlockEmbed||c instanceof l.BlockEmbed)return void this.optimize();const t=c.children.head instanceof a.default?null:c.children.head;n.moveChildren(c,t),n.remove()}this.optimize()}enable(t=!0){this.domNode.setAttribute("contenteditable",t)}formatAt(t,e,s,i){super.formatAt(t,e,s,i),this.optimize()}insertAt(t,e,s){if(t>=this.length())if(null==s||null==this.scroll.query(e,r.Scope.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==s&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),s):t.insertAt(0,e,s)}else{const t=this.scroll.create(e,s);this.appendChild(t)}else super.insertAt(t,e,s);this.optimize()}insertBefore(t,e){if(t.statics.scope===r.Scope.INLINE_BLOT){const s=this.scroll.create(this.statics.defaultChild.blotName);s.appendChild(t),super.insertBefore(s,e)}else super.insertBefore(t,e)}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){return this.path(t).pop()||[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(h,t)}lines(t=0,e=Number.MAX_VALUE){const s=(t,e,i)=>{let n=[],l=i;return t.children.forEachAt(e,i,(t,e,i)=>{h(t)?n.push(t):t instanceof r.ContainerBlot&&(n=n.concat(s(t,e,l))),l-=i}),n};return s(this,t,e)}optimize(t=[],e={}){this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(n.default.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=n.default.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(n.default.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(n.default.events.SCROLL_UPDATE,e,t)}}d.blotName="scroll",d.className="ql-editor",d.tagName="DIV",d.defaultChild=o.default,d.allowedChildren=[o.default,l.BlockEmbed,u.default],e.default=d},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var i=s(0),r=s(1),n=a(r),l=a(s(4)),o=a(s(7));function a(t){return t&&t.__esModule?t:{default:t}}class u extends o.default{constructor(t,e){super(t,e),this.lastRecorded=0,this.ignoreChange=!1,this.clear(),this.quill.on(l.default.events.EDITOR_CHANGE,(t,e,s,i)=>{t!==l.default.events.TEXT_CHANGE||this.ignoreChange||(this.options.userOnly&&i!==l.default.sources.USER?this.transform(e):this.record(e,s))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:"z",shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this))}change(t,e){if(0===this.stack[t].length)return;const s=this.stack[t].pop();this.stack[e].push(s),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s[t],l.default.sources.USER),this.ignoreChange=!1;const i=c(this.quill.scroll,s[t]);this.quill.setSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let s=function(t){const e=new n.default;let s=!1;return t.forEach(t=>{if(t.insert)e.delete(r.Op.length(t));else{if(!t.retain||null!=t.attributes)return s=!0,!1;e.retain(t.retain)}return!0}),s?null:e}(t);null==s&&(s=this.quill.getContents().diff(e));const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const e=this.stack.undo.pop();s=s.compose(e.undo),t=e.redo.compose(t)}else this.lastRecorded=i;this.stack.undo.push({redo:t,undo:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}redo(){this.change("redo","undo")}transform(t){this.stack.undo.forEach(e=>{e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(e=>{e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}undo(){this.change("undo","redo")}}function c(t,e){const s=e.reduce((t,e)=>t+(e.delete||0),0);let r=e.length()-s;return function(t,e){const s=e.ops[e.ops.length-1];return null!=s&&(null!=s.insert?"string"==typeof s.insert&&s.insert.endsWith("\n"):null!=s.attributes&&Object.keys(s.attributes).some(e=>null!=t.query(e,i.Scope.BLOCK)))}(t,e)&&(r-=1),r}u.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=u,e.getLastChangeIndex=c},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalize=e.SHORTKEY=e.default=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=f(s(17)),n=f(s(11)),l=f(s(2)),o=s(1),a=f(o),u=s(0),c=f(s(4)),h=f(s(10)),d=f(s(7));function f(t){return t&&t.__esModule?t:{default:t}}const p=(0,h.default)("quill:keyboard"),m=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class g extends d.default{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some(s=>!!e[s]!==t[s]&&null!==e[s])&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])}),this.addBinding({key:"Enter",shiftKey:null},x),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},b),this.addBinding({key:"Delete"},{collapsed:!0},y)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},b),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},y)),this.addBinding({key:"Backspace"},{collapsed:!1},v),this.addBinding({key:"Delete"},{collapsed:!1},v),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},b),this.listen()}addBinding(t,e={},s={}){const i=w(t);null!=i?("function"==typeof e&&(e={handler:e}),"function"==typeof s&&(s={handler:s}),(Array.isArray(i.key)?i.key:[i.key]).forEach(t=>{const r=(0,l.default)({},i,{key:t},e,s);this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)})):p.warn("Attempted to add invalid keyboard binding",i)}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented)return;const e=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(e=>g.match(t,e));if(0===e.length)return;const s=this.quill.getSelection();if(null==s||!this.quill.hasFocus())return;var r=this.quill.getLine(s.index),l=i(r,2);const o=l[0],a=l[1];var c=this.quill.getLeaf(s.index),h=i(c,2);const d=h[0],f=h[1];var p=0===s.length?[d,f]:this.quill.getLeaf(s.index+s.length),m=i(p,2);const b=m[0],y=m[1],v=d instanceof u.TextBlot?d.value().slice(0,f):"",x=b instanceof u.TextBlot?b.value().slice(y):"",N={collapsed:0===s.length,empty:0===s.length&&o.length()<=1,format:this.quill.getFormat(s),line:o,offset:a,prefix:v,suffix:x,event:t};e.some(t=>{if(null!=t.collapsed&&t.collapsed!==N.collapsed)return!1;if(null!=t.empty&&t.empty!==N.empty)return!1;if(null!=t.offset&&t.offset!==N.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(t=>null==N.format[t]))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every(e=>!0===t.format[e]?null!=N.format[e]:!1===t.format[e]?null==N.format[e]:(0,n.default)(t.format[e],N.format[e])))return!1;return!(null!=t.prefix&&!t.prefix.test(N.prefix))&&(!(null!=t.suffix&&!t.suffix.test(N.suffix))&&!0!==t.handler.call(this,s,N,t))})&&t.preventDefault()})}}function b(t,e){if(0===t.index||this.quill.getLength()<=1)return;var s=this.quill.getLine(t.index);const r=i(s,1)[0];let n={};if(0===e.offset){var l=this.quill.getLine(t.index-1);const e=i(l,1)[0];if(null!=e&&(e.length()>1||"table"===e.statics.blotName)){const e=r.formats(),s=this.quill.getFormat(t.index-1,1);n=o.AttributeMap.diff(e,s)||{}}}const a=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-a,a,c.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index-a,a,n,c.default.sources.USER),this.quill.focus()}function y(t,e){const s=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-s)return;let r={},n=0;var l=this.quill.getLine(t.index);const a=i(l,1)[0];if(e.offset>=a.length()-1){var u=this.quill.getLine(t.index+1);const e=i(u,1)[0];if(e){const s=a.formats(),i=this.quill.getFormat(t.index,1);r=o.AttributeMap.diff(s,i)||{},n=e.length()}}this.quill.deleteText(t.index,s,c.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+n-1,s,r,c.default.sources.USER)}function v(t){const e=this.quill.getLines(t);let s={};if(e.length>1){const t=e[0].formats(),i=e[e.length-1].formats();s=o.AttributeMap.diff(i,t)||{}}this.quill.deleteText(t,c.default.sources.USER),Object.keys(s).length>0&&this.quill.formatLine(t.index,1,s,c.default.sources.USER),this.quill.setSelection(t.index,c.default.sources.SILENT),this.quill.focus()}function x(t,e){t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);const s=Object.keys(e.format).reduce((t,s)=>(this.quill.scroll.query(s,u.Scope.BLOCK)&&!Array.isArray(e.format[s])&&(t[s]=e.format[s]),t),{});this.quill.insertText(t.index,"\n",s,c.default.sources.USER),this.quill.setSelection(t.index+1,c.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(t=>{null==s[t]&&(Array.isArray(e.format[t])||"link"!==t&&this.quill.format(t,e.format[t],c.default.sources.USER))})}function N(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e){const s=this.quill.scroll.query("code-block"),i=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let r=e.index,n=e.length;i.forEach((e,i)=>{t?(e.insertAt(0,s.TAB),0===i?r+=s.TAB.length:n+=s.TAB.length):e.domNode.textContent.startsWith(s.TAB)&&(e.deleteAt(0,s.TAB.length),0===i?r-=s.TAB.length:n-=s.TAB.length)}),this.quill.update(c.default.sources.USER),this.quill.setSelection(r,n,c.default.sources.SILENT)}}}function E(t,e){return{key:t,shiftKey:e,altKey:null,["ArrowLeft"===t?"prefix":"suffix"]:/^$/,handler(s){let r=s.index;"ArrowRight"===t&&(r+=s.length+1);var n=this.quill.getLeaf(r);return!(i(n,1)[0]instanceof u.EmbedBlot)||("ArrowLeft"===t?e?this.quill.setSelection(s.index-1,s.length+1,c.default.sources.USER):this.quill.setSelection(s.index-1,c.default.sources.USER):e?this.quill.setSelection(s.index,s.length+1,c.default.sources.USER):this.quill.setSelection(s.index+s.length+1,c.default.sources.USER),!1)}}}function A(t){return{key:t[0],shortKey:!0,handler(e,s){this.quill.format(t,!s.format[t],c.default.sources.USER)}}}function q(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,s){const i=t?"prev":"next",r=s.line,n=r.parent[i];if(null!=n){if("table-row"===n.statics.blotName){let t=n.children.head,e=r;for(;null!=e.prev;)e=e.prev,t=t.next;const i=t.offset(this.quill.scroll)+Math.min(s.offset,t.length()-1);this.quill.setSelection(i,0,c.default.sources.USER)}}else{const e=r.table()[i];null!=e&&(t?this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,c.default.sources.USER):this.quill.setSelection(e.offset(this.quill.scroll),0,c.default.sources.USER))}return!1}}}function w(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=(0,r.default)(t,!1)}return t.shortKey&&(t[m]=t.shortKey,delete t.shortKey),t}g.DEFAULTS={bindings:{bold:A("bold"),italic:A("italic"),underline:A("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",c.default.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",c.default.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",c.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,c.default.sources.USER)}},"indent code-block":N(!0),"outdent code-block":N(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,c.default.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const s=(new a.default).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(s,c.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,c.default.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,c.default.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const s={list:!1};e.format.indent&&(s.indent=!1),this.quill.formatLine(t.index,t.length,s,c.default.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){var e=this.quill.getLine(t.index),s=i(e,2);const r=s[0],n=s[1],o=(0,l.default)({},r.formats(),{list:"checked"}),u=(new a.default).retain(t.index).insert("\n",o).retain(r.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(u,c.default.sources.USER),this.quill.setSelection(t.index+1,c.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){var s=this.quill.getLine(t.index),r=i(s,2);const n=r[0],l=r[1],o=(new a.default).retain(t.index).insert("\n",e.format).retain(n.length()-l-1).retain(1,{header:null});this.quill.updateContents(o,c.default.sources.USER),this.quill.setSelection(t.index+1,c.default.sources.SILENT),this.quill.scrollIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){var s=e.getTable(t),r=i(s,4);const n=r[0],l=function(t,e,s,i){if(null==e.prev&&null==e.next)return null==s.prev&&null==s.next?0===i?-1:1:null==s.prev?-1:1;if(null==e.prev)return-1;if(null==e.next)return 1;return null}(0,r[1],r[2],r[3]);if(null==l)return;let o=n.offset();if(l<0){const e=(new a.default).retain(o).insert("\n");this.quill.updateContents(e,c.default.sources.USER),this.quill.setSelection(t.index+1,t.length,c.default.sources.SILENT)}else if(l>0){o+=n.length();const t=(new a.default).retain(o).insert("\n");this.quill.updateContents(t,c.default.sources.USER),this.quill.setSelection(o,c.default.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const s=e.event,i=e.line,r=i.offset(this.quill.scroll);s.shiftKey?this.quill.setSelection(r-1,c.default.sources.USER):this.quill.setSelection(r+i.length(),c.default.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{list:!1,"code-block":!1,blockquote:!1,header:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const s=e.prefix.length;var r=this.quill.getLine(t.index),n=i(r,2);const l=n[0],o=n[1];if(o>s)return!0;let u;switch(e.prefix.trim()){case"[]":case"[ ]":u="unchecked";break;case"[x]":u="checked";break;case"-":case"*":u="bullet";break;default:u="ordered"}this.quill.insertText(t.index," ",c.default.sources.USER),this.quill.history.cutoff();const h=(new a.default).retain(t.index-o).delete(s+1).retain(l.length()-2-o).retain(1,{list:u});return this.quill.updateContents(h,c.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-s,c.default.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){var e=this.quill.getLine(t.index),s=i(e,2);const r=s[0],n=s[1];let l=2,o=r;for(;null!=o&&o.length()<=1&&o.formats()["code-block"];)if(o=o.prev,(l-=1)<=0){const e=(new a.default).retain(t.index+r.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(e,c.default.sources.USER),this.quill.setSelection(t.index-1,c.default.sources.SILENT),!1}return!0}},"embed left":E("ArrowLeft",!1),"embed left shift":E("ArrowLeft",!0),"embed right":E("ArrowRight",!1),"embed right shift":E("ArrowRight",!0),"table down":q(!1),"table up":q(!0)}},e.default=g,e.SHORTKEY=m,e.normalize=w},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=l(s(1)),r=l(s(8)),n=l(s(7));function l(t){return t&&t.__esModule?t:{default:t}}class o extends n.default{constructor(t,e){super(t,e),t.root.addEventListener("drop",e=>{let s;if(e.preventDefault(),document.caretRangeFromPoint)s=document.caretRangeFromPoint(e.clientX,e.clientY);else{if(!document.caretPositionFromPoint)return;{const t=document.caretPositionFromPoint(e.clientX,e.clientY);(s=document.createRange()).setStart(t.offsetNode,t.offset),s.setEnd(t.offsetNode,t.offset)}}const i=t.selection.normalizeNative(s),r=t.selection.normalizedToRange(i);this.upload(r,e.dataTransfer.files)})}upload(t,e){const s=[];Array.from(e).forEach(t=>{t&&this.options.mimetypes.includes(t.type)&&s.push(t)}),s.length>0&&this.options.handler.call(this,t,s)}}o.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){const s=e.map(t=>new Promise(e=>{const s=new FileReader;s.onload=(t=>{e(t.target.result)}),s.readAsDataURL(t)}));Promise.all(s).then(e=>{const s=e.reduce((t,e)=>t.insert({image:e}),(new i.default).retain(t.index).delete(t.length));this.quill.updateContents(s,r.default.sources.USER),this.quill.setSelection(t.index+e.length,r.default.sources.SILENT)})}},e.default=o},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0);const r=new class extends i.ClassAttributor{add(t,e){if("+1"===e||"-1"===e){const s=this.value(t)||0;e="+1"===e?s+1:s-1}return 0===e?(this.remove(t),!0):super.add(t,e)}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}("indent","ql-indent",{scope:i.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(3));class r extends i.default{}r.blotName="blockquote",r.tagName="blockquote",e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(3));class r extends i.default{static formats(t){return this.tagName.indexOf(t.tagName)+1}}r.blotName="header",r.tagName=["H1","H2","H3","H4","H5","H6"],e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ListContainer=void 0;var i=l(s(3)),r=l(s(12)),n=l(s(4));function l(t){return t&&t.__esModule?t:{default:t}}class o extends r.default{}o.blotName="list-container",o.tagName="OL";class a extends i.default{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){n.default.register(o)}constructor(t,e){super(t,e);const s=e.ownerDocument.createElement("span"),i=s=>{if(!t.isEnabled())return;const i=this.statics.formats(e,t);"checked"===i?(this.format("list","unchecked"),s.preventDefault()):"unchecked"===i&&(this.format("list","checked"),s.preventDefault())};s.addEventListener("mousedown",i),s.addEventListener("touchstart",i),this.attachUI(s)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}a.blotName="list",a.tagName="LI",o.allowedChildren=[a],a.requiredContainer=o,e.ListContainer=o,e.default=a},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(31));class r extends i.default{}r.blotName="italic",r.tagName=["EM","I"],e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(5));class r extends i.default{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}r.blotName="script",r.tagName=["SUB","SUP"],e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(5));class r extends i.default{}r.blotName="strike",r.tagName="S",e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(5));class r extends i.default{}r.blotName="underline",r.tagName="U",e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(s(24));class r extends i.default{static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){return`${this.value().formula}`}}r.blotName="formula",r.className="ql-formula",r.tagName="SPAN",e.default=r},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(0),r=s(15);const n=["alt","height","width"];class l extends i.EmbedBlot{static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return n.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static register(){/Firefox/i.test(navigator.userAgent)&&setTimeout(()=>{document.execCommand("enableObjectResizing",!1,!1)},1)}static sanitize(t){return(0,r.sanitize)(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){n.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}l.blotName="image",l.tagName="IMG",e.default=l},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(3),r=function(t){return t&&t.__esModule?t:{default:t}}(s(15));const n=["height","width"];class l extends i.BlockEmbed{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",!0),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return n.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static sanitize(t){return r.default.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){n.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const t=this.value().video;return`${t}`}}l.blotName="video",l.className="ql-video",l.tagName="IFRAME",e.default=l},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CodeToken=e.CodeBlock=void 0;var i=g(s(1)),r=s(0),n=g(s(5)),l=g(s(4)),o=g(s(7)),a=s(3),u=g(s(9)),c=g(s(14)),h=s(6),d=g(h),f=s(19),p=g(f),m=s(25);function g(t){return t&&t.__esModule?t:{default:t}}const b=new r.ClassAttributor("code-token","hljs",{scope:r.Scope.INLINE});class y extends n.default{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList.contains(p.default.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,s){super(t,e,s),b.add(this.domNode,s)}format(t,e){t!==y.blotName?super.format(t,e):e?b.add(this.domNode,e):(b.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(...t){super.optimize(...t),b.value(this.domNode)||this.unwrap()}}y.blotName="code-token",y.className="ql-token";class v extends p.default{static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),y.blotName,!1),super.replaceWith(t,e)}}class x extends f.CodeBlockContainer{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===v.blotName&&(this.forceNext=!0,this.children.forEach(s=>{s.format(t,e)}))}formatAt(t,e,s,i){s===v.blotName&&(this.forceNext=!0),super.formatAt(t,e,s,i)}highlight(t,e=!1){if(null==this.children.head)return;const s=`${Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).map(t=>t.textContent).join("\n")}\n`,r=v.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||null==this.cachedText){const e=this.children.reduce((t,e)=>t.concat((0,a.blockDelta)(e)),new i.default),n=t(s,r);e.diff(n).reduce((t,{retain:e,attributes:s})=>e?(s&&Object.keys(s).forEach(i=>{[v.blotName,y.blotName].includes(i)&&this.formatAt(t,e,i,s[i])}),t+e):t,0)}this.cachedText=s,this.forceNext=!1}}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=v.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}x.allowedChildren=[v],v.requiredContainer=x,v.allowedChildren=[y,c.default,d.default,u.default];class N extends o.default{static register(){l.default.register(y,!0),l.default.register(v,!0),l.default.register(x,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(l.default.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof x))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(({key:t,label:s})=>{const i=e.ownerDocument.createElement("option");i.textContent=s,i.setAttribute("value",t),e.appendChild(i)}),e.addEventListener("change",()=>{t.format(v.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=v.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(l.default.events.SCROLL_OPTIMIZE,()=>{clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(t=null,e=!1){if(this.quill.selection.composing)return;this.quill.update(l.default.sources.USER);const s=this.quill.getSelection();(null==t?this.quill.scroll.descendants(x):[t]).forEach(t=>{t.highlight(this.highlightBlot,e)}),this.quill.update(l.default.sources.SILENT),null!=s&&this.quill.setSelection(s,l.default.sources.SILENT)}highlightBlot(t,e="plain"){if("plain"===e)return(0,h.escapeText)(t).split("\n").reduce((t,s,i)=>(0!==i&&t.insert("\n",{[p.default.blotName]:e}),t.insert(s)),new i.default);const s=this.quill.root.ownerDocument.createElement("div");return s.classList.add(p.default.className),s.innerHTML=this.options.hljs.highlight(e,t).value,(0,m.traverse)(this.quill.scroll,s,[(t,e)=>{const s=b.value(t);return s?e.compose((new i.default).retain(e.length(),{[y.blotName]:s})):e}],[(t,s)=>t.data.split("\n").reduce((t,s,i)=>(0!==i&&t.insert("\n",{[p.default.blotName]:e}),t.insert(s)),s)],new WeakMap)}}N.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"Javascript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]},e.CodeBlock=v,e.CodeToken=y,e.default=N},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(s(1)),n=a(s(4)),l=a(s(7)),o=s(62);function a(t){return t&&t.__esModule?t:{default:t}}e.default=class extends l.default{static register(){n.default.register(o.TableCell),n.default.register(o.TableRow),n.default.register(o.TableBody),n.default.register(o.TableContainer)}constructor(...t){super(...t),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(o.TableContainer).forEach(t=>{t.balanceCells()})}deleteColumn(){var t=this.getTable(),e=i(t,3);const s=e[0],r=e[2];null!=r&&(s.deleteColumn(r.cellOffset()),this.quill.update(n.default.sources.USER))}deleteRow(){var t=this.getTable();const e=i(t,2)[1];null!=e&&(e.remove(),this.quill.update(n.default.sources.USER))}deleteTable(){var t=this.getTable();const e=i(t,1)[0];if(null==e)return;const s=e.offset();e.remove(),this.quill.update(n.default.sources.USER),this.quill.setSelection(s,n.default.sources.SILENT)}getTable(t=this.quill.getSelection()){if(null==t)return[null,null,null,-1];var e=this.quill.getLine(t.index),s=i(e,2);const r=s[0],n=s[1];if(null==r||r.statics.blotName!==o.TableCell.blotName)return[null,null,null,-1];const l=r.parent;return[l.parent.parent,l,r,n]}insertColumn(t){const e=this.quill.getSelection();var s=this.getTable(e),r=i(s,3);const l=r[0],o=r[1],a=r[2];if(null==a)return;const u=a.cellOffset();l.insertColumn(u+t),this.quill.update(n.default.sources.USER);let c=o.rowOffset();0===t&&(c+=1),this.quill.setSelection(e.index+c,e.length,n.default.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();var s=this.getTable(e),r=i(s,3);const l=r[0],o=r[1];if(null==r[2])return;const a=o.rowOffset();l.insertRow(a+t),this.quill.update(n.default.sources.USER),t>0?this.quill.setSelection(e,n.default.sources.SILENT):this.quill.setSelection(e.index+o.children.length,e.length,n.default.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const s=this.quill.getSelection();if(null==s)return;const i=new Array(t).fill(0).reduce(t=>{const s=new Array(e).fill("\n").join("");return t.insert(s,{table:(0,o.tableId)()})},(new r.default).retain(s.index));this.quill.updateContents(i,n.default.sources.USER),this.quill.setSelection(s.index,n.default.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(n.default.events.SCROLL_OPTIMIZE,t=>{t.some(t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(n.default.events.TEXT_CHANGE,(t,e,s)=>{s===n.default.sources.USER&&this.balanceTables()}),!0))})}}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tableId=e.TableContainer=e.TableBody=e.TableRow=e.TableCell=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=l(s(3)),n=l(s(12));function l(t){return t&&t.__esModule?t:{default:t}}class o extends r.default{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",h()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===o.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}o.blotName="table",o.tagName="TD";class a extends n.default{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),s=this.next.children.head.formats(),i=this.next.children.tail.formats();return t.table===e.table&&t.table===s.table&&t.table===i.table}return!1}optimize(...t){super.optimize(...t),this.children.forEach(t=>{if(null==t.next)return;const e=t.formats(),s=t.next.formats();if(e.table!==s.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}a.blotName="table-row",a.tagName="TR";class u extends n.default{}u.blotName="table-body",u.tagName="TBODY";class c extends n.default{balanceCells(){const t=this.descendants(a),e=t.reduce((t,e)=>Math.max(e.children.length,t),0);t.forEach(t=>{new Array(e-t.children.length).fill(0).forEach(()=>{let e;null!=t.children.head&&(e=o.formats(t.children.head.domNode));const s=this.scroll.create(o.blotName,e);t.appendChild(s),s.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){var e=this.descendant(u);const s=i(e,1)[0];null!=s&&null!=s.children.head&&s.children.forEach(e=>{const s=e.children.at(t);null!=s&&s.remove()})}insertColumn(t){var e=this.descendant(u);const s=i(e,1)[0];null!=s&&null!=s.children.head&&s.children.forEach(e=>{const s=e.children.at(t),i=o.formats(e.children.head.domNode),r=this.scroll.create(o.blotName,i);e.insertBefore(r,s)})}insertRow(t){var e=this.descendant(u);const s=i(e,1)[0];if(null==s||null==s.children.head)return;const r=h(),n=this.scroll.create(a.blotName);s.children.head.children.forEach(()=>{const t=this.scroll.create(o.blotName,r);n.appendChild(t)});const l=s.children.at(t);s.insertBefore(n,l)}rows(){const t=this.children.head;return null==t?[]:t.children.map(t=>t)}}function h(){return`row-${Math.random().toString(36).slice(2,6)}`}c.blotName="table-container",c.tagName="TABLE",c.allowedChildren=[u],u.requiredContainer=c,u.allowedChildren=[a],a.requiredContainer=u,a.allowedChildren=[o],o.requiredContainer=a,e.TableCell=o,e.TableRow=a,e.TableBody=u,e.TableContainer=c,e.tableId=h},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=u(s(1)),n=s(0),l=u(s(4)),o=u(s(10)),a=u(s(7));function u(t){return t&&t.__esModule?t:{default:t}}const c=(0,o.default)("quill:toolbar");class h extends a.default{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const e=document.createElement("div");f(e,this.options.container),t.container.parentNode.insertBefore(e,t.container),this.container=e}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement))return c.error("Container required for toolbar",this.options);this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},Object.keys(this.options.handlers).forEach(t=>{this.addHandler(t,this.options.handlers[t])}),Array.from(this.container.querySelectorAll("button, select")).forEach(t=>{this.attach(t)}),this.quill.on(l.default.events.EDITOR_CHANGE,(t,e)=>{t===l.default.events.SELECTION_CHANGE&&this.update(e)}),this.quill.on(l.default.events.SCROLL_OPTIMIZE,()=>{var t=this.quill.selection.getRange();const e=i(t,1)[0];this.update(e)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(t=>0===t.indexOf("ql-"));if(!e)return;if(e=e.slice("ql-".length),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[e]&&null==this.quill.scroll.query(e))return void c.warn("ignoring attaching to nonexistent format",e,t);const s="SELECT"===t.tagName?"change":"click";t.addEventListener(s,s=>{let o;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];o=!e.hasAttribute("selected")&&(e.value||!1)}else o=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),s.preventDefault();this.quill.focus();var a=this.quill.selection.getRange();const u=i(a,1)[0];if(null!=this.handlers[e])this.handlers[e].call(this,o);else if(this.quill.scroll.query(e).prototype instanceof n.EmbedBlot){if(!(o=prompt(`Enter ${e}`)))return;this.quill.updateContents((new r.default).retain(u.index).delete(u.length).insert({[e]:o}),l.default.sources.USER)}else this.quill.format(e,o,l.default.sources.USER);this.update(u)}),this.controls.push([e,t])}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach(s=>{var r=i(s,2);const n=r[0],l=r[1];if("SELECT"===l.tagName){let s;if(null==t)s=null;else if(null==e[n])s=l.querySelector("option[selected]");else if(!Array.isArray(e[n])){let t=e[n];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),s=l.querySelector(`option[value="${t}"]`)}null==s?(l.value="",l.selectedIndex=-1):s.selected=!0}else if(null==t)l.classList.remove("ql-active");else if(l.hasAttribute("value")){const t=e[n]===l.getAttribute("value")||null!=e[n]&&e[n].toString()===l.getAttribute("value")||null==e[n]&&!l.getAttribute("value");l.classList.toggle("ql-active",t)}else l.classList.toggle("ql-active",null!=e[n])})}}function d(t,e,s){const i=document.createElement("button");i.setAttribute("type","button"),i.classList.add(`ql-${e}`),null!=s&&(i.value=s),t.appendChild(i)}function f(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(e=>{const s=document.createElement("span");s.classList.add("ql-formats"),e.forEach(t=>{if("string"==typeof t)d(s,t);else{const e=Object.keys(t)[0],i=t[e];Array.isArray(i)?function(t,e,s){const i=document.createElement("select");i.classList.add(`ql-${e}`),s.forEach(t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),i.appendChild(e)}),t.appendChild(i)}(s,e,i):d(s,e,i)}}),t.appendChild(s)})}h.DEFAULTS={},h.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach(t=>{null!=this.quill.scroll.query(t,n.Scope.INLINE)&&this.quill.format(t,!1,l.default.sources.USER)})}else this.quill.removeFormat(t,l.default.sources.USER)},direction(t){const e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",l.default.sources.USER):t||"right"!==e||this.quill.format("align",!1,l.default.sources.USER),this.quill.format("direction",t,l.default.sources.USER)},indent(t){const e=this.quill.getSelection(),s=this.quill.getFormat(e),i=parseInt(s.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===s.direction&&(e*=-1),this.quill.format("indent",i+e,l.default.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,l.default.sources.USER)},list(t){const e=this.quill.getSelection(),s=this.quill.getFormat(e);"check"===t?"checked"===s.list||"unchecked"===s.list?this.quill.format("list",!1,l.default.sources.USER):this.quill.format("list","unchecked",l.default.sources.USER):this.quill.format("list",t,l.default.sources.USER)}}},e.default=h,e.addControls=f},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var i=u(s(2)),r=u(s(8)),n=s(35),l=u(n),o=s(13),a=u(s(20));function u(t){return t&&t.__esModule?t:{default:t}}const c=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class h extends n.BaseTooltip{constructor(t,e){super(t,e),this.quill.on(r.default.events.EDITOR_CHANGE,(t,e,s,i)=>{if(t===r.default.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&i===r.default.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const t=this.quill.getLines(e.index,e.length);if(1===t.length)this.position(this.quill.getBounds(e));else{const s=t[t.length-1],i=this.quill.getIndex(s),r=Math.min(s.length()-1,e.index+e.length-i),n=this.quill.getBounds(new o.Range(i,r));this.position(n)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(r.default.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();null!=t&&this.position(this.quill.getBounds(t))},1)})}cancel(){this.show()}position(t){const e=super.position(t),s=this.root.querySelector(".ql-tooltip-arrow");return s.style.marginLeft="",0!==e&&(s.style.marginLeft=`${-1*e-s.offsetWidth/2}px`),e}}h.TEMPLATE=['','
','','',"
"].join("");class d extends l.default{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=c),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new h(this.quill,this.options.bounds),this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),a.default),this.buildPickers(t.container.querySelectorAll("select"),a.default)}}d.DEFAULTS=(0,i.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}}),e.BubbleTooltip=h,e.default=d},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var s=[],i=!0,r=!1,n=void 0;try{for(var l,o=t[Symbol.iterator]();!(i=(l=o.next()).done)&&(s.push(l.value),!e||s.length!==e);i=!0);}catch(t){r=!0,n=t}finally{try{!i&&o.return&&o.return()}finally{if(r)throw n}}return s}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=h(s(2)),n=h(s(8)),l=s(35),o=h(l),a=h(s(15)),u=s(13),c=h(s(20));function h(t){return t&&t.__esModule?t:{default:t}}const d=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class f extends l.BaseTooltip{constructor(t,e){super(t,e),this.preview=this.root.querySelector("a.ql-preview")}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,n.default.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(n.default.events.SELECTION_CHANGE,(t,e,s)=>{if(null!=t){if(0===t.length&&s===n.default.sources.USER){var r=this.quill.scroll.descendant(a.default,t.index),l=i(r,2);const e=l[0],s=l[1];if(null!=e){this.linkRange=new u.Range(t.index-s,e.length());const i=a.default.formats(e.domNode);return this.preview.textContent=i,this.preview.setAttribute("href",i),this.show(),void this.position(this.quill.getBounds(this.linkRange))}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}f.TEMPLATE=['','','',''].join("");class p extends o.default{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=d),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),c.default),this.buildPickers(t.container.querySelectorAll("select"),c.default),this.tooltip=new f(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,s)=>{t.handlers.link.call(t,!s.format.link)})}}p.DEFAULTS=(0,r.default)(!0,{},o.default.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e=`mailto:${e}`),this.quill.theme.tooltip.edit("link",e)}else this.quill.format("link",!1)}}}}}),e.default=p}]).default}); +//# sourceMappingURL=quill.min.js.map \ No newline at end of file diff --git a/cshub-client/public/index.html b/cshub-client/public/index.html index 90bc6a41..8a6082e9 100644 --- a/cshub-client/public/index.html +++ b/cshub-client/public/index.html @@ -6,7 +6,25 @@ CSHub + + + + + + + + + + + + +