ghost 5.54.1 → 5.54.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tryghost-adapter-cache-memory-ttl-5.54.3.tgz +0 -0
- package/components/{tryghost-adapter-cache-redis-5.54.1.tgz → tryghost-adapter-cache-redis-5.54.3.tgz} +0 -0
- package/components/{tryghost-adapter-manager-5.54.1.tgz → tryghost-adapter-manager-5.54.3.tgz} +0 -0
- package/components/tryghost-announcement-bar-settings-5.54.3.tgz +0 -0
- package/components/{tryghost-api-framework-5.54.1.tgz → tryghost-api-framework-5.54.3.tgz} +0 -0
- package/components/{tryghost-api-version-compatibility-service-5.54.1.tgz → tryghost-api-version-compatibility-service-5.54.3.tgz} +0 -0
- package/components/{tryghost-audience-feedback-5.54.1.tgz → tryghost-audience-feedback-5.54.3.tgz} +0 -0
- package/components/tryghost-bootstrap-socket-5.54.3.tgz +0 -0
- package/components/tryghost-collections-5.54.3.tgz +0 -0
- package/components/{tryghost-constants-5.54.1.tgz → tryghost-constants-5.54.3.tgz} +0 -0
- package/components/tryghost-custom-theme-settings-service-5.54.3.tgz +0 -0
- package/components/{tryghost-data-generator-5.54.1.tgz → tryghost-data-generator-5.54.3.tgz} +0 -0
- package/components/tryghost-domain-events-5.54.3.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.54.3.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.54.3.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.54.3.tgz +0 -0
- package/components/tryghost-email-content-generator-5.54.3.tgz +0 -0
- package/components/{tryghost-email-events-5.54.1.tgz → tryghost-email-events-5.54.3.tgz} +0 -0
- package/components/{tryghost-email-service-5.54.1.tgz → tryghost-email-service-5.54.3.tgz} +0 -0
- package/components/tryghost-email-suppression-list-5.54.3.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.54.3.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.54.3.tgz +0 -0
- package/components/{tryghost-external-media-inliner-5.54.1.tgz → tryghost-external-media-inliner-5.54.3.tgz} +0 -0
- package/components/{tryghost-extract-api-key-5.54.1.tgz → tryghost-extract-api-key-5.54.3.tgz} +0 -0
- package/components/tryghost-html-to-plaintext-5.54.3.tgz +0 -0
- package/components/{tryghost-i18n-5.54.1.tgz → tryghost-i18n-5.54.3.tgz} +0 -0
- package/components/{tryghost-importer-handler-content-files-5.54.1.tgz → tryghost-importer-handler-content-files-5.54.3.tgz} +0 -0
- package/components/{tryghost-importer-revue-5.54.1.tgz → tryghost-importer-revue-5.54.3.tgz} +0 -0
- package/components/tryghost-in-memory-repository-5.54.3.tgz +0 -0
- package/components/{tryghost-job-manager-5.54.1.tgz → tryghost-job-manager-5.54.3.tgz} +0 -0
- package/components/tryghost-link-redirects-5.54.3.tgz +0 -0
- package/components/{tryghost-link-replacer-5.54.1.tgz → tryghost-link-replacer-5.54.3.tgz} +0 -0
- package/components/tryghost-link-tracking-5.54.3.tgz +0 -0
- package/components/{tryghost-magic-link-5.54.1.tgz → tryghost-magic-link-5.54.3.tgz} +0 -0
- package/components/tryghost-mail-events-5.54.3.tgz +0 -0
- package/components/{tryghost-mailgun-client-5.54.1.tgz → tryghost-mailgun-client-5.54.3.tgz} +0 -0
- package/components/{tryghost-member-attribution-5.54.1.tgz → tryghost-member-attribution-5.54.3.tgz} +0 -0
- package/components/{tryghost-member-events-5.54.1.tgz → tryghost-member-events-5.54.3.tgz} +0 -0
- package/components/{tryghost-members-api-5.54.1.tgz → tryghost-members-api-5.54.3.tgz} +0 -0
- package/components/tryghost-members-csv-5.54.3.tgz +0 -0
- package/components/{tryghost-members-events-service-5.54.1.tgz → tryghost-members-events-service-5.54.3.tgz} +0 -0
- package/components/tryghost-members-importer-5.54.3.tgz +0 -0
- package/components/{tryghost-members-offers-5.54.1.tgz → tryghost-members-offers-5.54.3.tgz} +0 -0
- package/components/{tryghost-members-payments-5.54.1.tgz → tryghost-members-payments-5.54.3.tgz} +0 -0
- package/components/tryghost-members-ssr-5.54.3.tgz +0 -0
- package/components/{tryghost-members-stripe-service-5.54.1.tgz → tryghost-members-stripe-service-5.54.3.tgz} +0 -0
- package/components/tryghost-mentions-email-report-5.54.3.tgz +0 -0
- package/components/tryghost-milestones-5.54.3.tgz +0 -0
- package/components/{tryghost-minifier-5.54.1.tgz → tryghost-minifier-5.54.3.tgz} +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.54.3.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.54.3.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.54.3.tgz +0 -0
- package/components/{tryghost-mw-error-handler-5.54.1.tgz → tryghost-mw-error-handler-5.54.3.tgz} +0 -0
- package/components/{tryghost-mw-session-from-token-5.54.1.tgz → tryghost-mw-session-from-token-5.54.3.tgz} +0 -0
- package/components/{tryghost-mw-update-user-last-seen-5.54.1.tgz → tryghost-mw-update-user-last-seen-5.54.3.tgz} +0 -0
- package/components/tryghost-mw-version-match-5.54.3.tgz +0 -0
- package/components/tryghost-mw-vhost-5.54.3.tgz +0 -0
- package/components/{tryghost-oembed-service-5.54.1.tgz → tryghost-oembed-service-5.54.3.tgz} +0 -0
- package/components/{tryghost-package-json-5.54.1.tgz → tryghost-package-json-5.54.3.tgz} +0 -0
- package/components/tryghost-post-revisions-5.54.3.tgz +0 -0
- package/components/{tryghost-posts-service-5.54.1.tgz → tryghost-posts-service-5.54.3.tgz} +0 -0
- package/components/tryghost-referrers-5.54.3.tgz +0 -0
- package/components/{tryghost-security-5.54.1.tgz → tryghost-security-5.54.3.tgz} +0 -0
- package/components/tryghost-session-service-5.54.3.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.54.3.tgz +0 -0
- package/components/{tryghost-slack-notifications-5.54.1.tgz → tryghost-slack-notifications-5.54.3.tgz} +0 -0
- package/components/{tryghost-staff-service-5.54.1.tgz → tryghost-staff-service-5.54.3.tgz} +0 -0
- package/components/{tryghost-stats-service-5.54.1.tgz → tryghost-stats-service-5.54.3.tgz} +0 -0
- package/components/{tryghost-tiers-5.54.1.tgz → tryghost-tiers-5.54.3.tgz} +0 -0
- package/components/tryghost-update-check-service-5.54.3.tgz +0 -0
- package/components/{tryghost-verification-trigger-5.54.1.tgz → tryghost-verification-trigger-5.54.3.tgz} +0 -0
- package/components/{tryghost-version-notifications-data-service-5.54.1.tgz → tryghost-version-notifications-data-service-5.54.3.tgz} +0 -0
- package/components/{tryghost-webmentions-5.54.1.tgz → tryghost-webmentions-5.54.3.tgz} +0 -0
- package/content/themes/casper/assets/built/screen.css +1 -1
- package/content/themes/casper/assets/built/screen.css.map +1 -1
- package/content/themes/casper/assets/css/screen.css +0 -5
- package/content/themes/casper/page.hbs +24 -26
- package/core/built/admin/assets/chunk.143.fbb46d934931ab3f351d.js +35 -0
- package/core/built/admin/assets/chunk.178.aef0c4fe1860cee21418.js +11 -0
- package/core/built/admin/assets/chunk.486.3896d2a7816cf03a0794.js +12708 -0
- package/core/built/admin/assets/chunk.486.3896d2a7816cf03a0794.js.LICENSE.txt +250 -0
- package/core/built/admin/assets/codemirror/codemirror-31d641cdd0cb3388688402609608cb10.js +1440 -0
- package/core/built/admin/assets/fonts/Inter-italic.var-1f7ca6383ea7c74a7f5ddd76c3d3cef2.woff2 +0 -0
- package/core/built/admin/assets/fonts/Inter-roman.var-66c6e40883646a7ad993108b2ce2da32.woff2 +0 -0
- package/core/built/admin/assets/ghost-14eecea754ec854244d71e1300ec75f2.js +6643 -0
- package/core/built/admin/assets/ghost-4c37b19a127806313f64fcd759eaa0e2.css +1 -0
- package/core/built/admin/assets/ghost-dark-b80a5d657c788174451fd218428af744.css +1 -0
- package/core/built/admin/assets/img/404-ghost-e112dbfadde79cf30dbca8e8cfe7a21a.png +0 -0
- package/core/built/admin/assets/img/404-ghost@2x-34c1119ed15cc3ea71e4406f80c8e810.png +0 -0
- package/core/built/admin/assets/img/amp-d7b72aae3315fda95921fb575dfca100.svg +4 -0
- package/core/built/admin/assets/img/apple-touch-icon-74680e326a7e87b159d366c7d4fb3d4b.png +0 -0
- package/core/built/admin/assets/img/buffer-db31f6b5dc27a298050e16312619c586.png +0 -0
- package/core/built/admin/assets/img/community-background-3f501ff1d764d0cb81f7c2cbacfc6503.jpg +0 -0
- package/core/built/admin/assets/img/disqus-43503a3fa4f38dc8c61c7358b811f343.svg +4 -0
- package/core/built/admin/assets/img/favicon-a9c6dbdcdc3ae568f4e0dad92149a0e3.ico +0 -0
- package/core/built/admin/assets/img/firstpromoter-ce8b5219e5b5ebda463bd60396c6ab81.png +0 -0
- package/core/built/admin/assets/img/footer-marketplace-bg-572b6c6486a7e26316954d599eaa9f30.png +0 -0
- package/core/built/admin/assets/img/github-c3a739c59df26fed12c10ffb00b33bd4.svg +4 -0
- package/core/built/admin/assets/img/google-analytics-e05fc1327377939663407200d4978eba.png +0 -0
- package/core/built/admin/assets/img/google-docs-1e42cc272fc088da49e4b0ddfb01b006.svg +6 -0
- package/core/built/admin/assets/img/large-ac90af7c93a4b47e8d956fa9fef31d9d.png +0 -0
- package/core/built/admin/assets/img/latest-posts-1-ea1e669b275f2c7dfa23abd4be8d7ad5.png +0 -0
- package/core/built/admin/assets/img/latest-posts-2-e6b0809353ac31642839a6f3bab0d4e8.png +0 -0
- package/core/built/admin/assets/img/latest-posts-3-ac8c2e95dd9adecb9029a7b037ed7f15.png +0 -0
- package/core/built/admin/assets/img/loadingcat-5f501b7a8c7bd54b253463e261c99634.gif +0 -0
- package/core/built/admin/assets/img/logos/ghost-logo-black-1-fb561a374422b405ec90fa586b05ebdf.png +0 -0
- package/core/built/admin/assets/img/logos/orb-black-1-32b72766be2164fdea6ab2565fb1c137.png +0 -0
- package/core/built/admin/assets/img/logos/orb-black-2-4b0baef1ec34816af6f3fbede7ab191d.png +0 -0
- package/core/built/admin/assets/img/logos/orb-black-3-9780c5e9991b69ed2303b526aa3e3252.png +0 -0
- package/core/built/admin/assets/img/logos/orb-black-4-d9c3caacb8d2ba98a52517ff2971433c.png +0 -0
- package/core/built/admin/assets/img/logos/orb-black-5-063a200f749e09c587b9443ffd2c4cfa.png +0 -0
- package/core/built/admin/assets/img/logos/orb-pink-3-a66abc6df2b6ab64d1459a6535b725cd.png +0 -0
- package/core/built/admin/assets/img/mailchimp-f22b1e130aac764965b9306d7265a6b2.svg +8 -0
- package/core/built/admin/assets/img/marketing/analytics-1-aa2d72c4e7347a3cb5666d07916b92aa.jpg +0 -0
- package/core/built/admin/assets/img/marketing/analytics-2-389d53f80041ff98111cce79facf66b8.jpg +0 -0
- package/core/built/admin/assets/img/marketing/members-1-8b89a1f48fe7b336754e91a429531f65.jpg +0 -0
- package/core/built/admin/assets/img/marketing/members-2-791205c82d5cf221f8c99a74f9ee1739.jpg +0 -0
- package/core/built/admin/assets/img/marketing/offers-1-f2e1b653c4d5bb90eea9d7a2862530f9.jpg +0 -0
- package/core/built/admin/assets/img/marketing/offers-2-28a225d34cc39d133748431536961d00.jpg +0 -0
- package/core/built/admin/assets/img/marketing/offers-3-2094c91ab21a16c37fbe6ec16c140160.jpg +0 -0
- package/core/built/admin/assets/img/medium-fef07013cffd5c45a655a250912a0ad7.png +0 -0
- package/core/built/admin/assets/img/mentions-background-fa39b7597e875c165b12190eda606993.png +0 -0
- package/core/built/admin/assets/img/orb-squircle-645fd62e92a80557905c0cb60874b699.png +0 -0
- package/core/built/admin/assets/img/patreon-b19a5e6418a72977a16b30039d374d04.svg +7 -0
- package/core/built/admin/assets/img/paypal-38e9448ce7549ea4caf8e7753ae661d6.svg +8 -0
- package/core/built/admin/assets/img/pintura-75cf0fd7cbc6ca3c8fbdb3f1b31f730b.png +0 -0
- package/core/built/admin/assets/img/pintura-screenshot-7668975389aac80607ec489b48b75e0f.png +0 -0
- package/core/built/admin/assets/img/plausible-1b754a95e19a6d935e0bc8bf6790ba56.png +0 -0
- package/core/built/admin/assets/img/resource-1-722f202795856e4a5596c8a3b7bedc43.jpg +0 -0
- package/core/built/admin/assets/img/slackicon-406aadea8994ca2ddee9c1d7157208db.png +0 -0
- package/core/built/admin/assets/img/small-b90396925485f17b2ca82c31be42de5f.png +0 -0
- package/core/built/admin/assets/img/stripe-3af79c77413d7e58d0322c1de5bfdb8e.svg +1 -0
- package/core/built/admin/assets/img/themes/Alto-0dfe76694ed222d6d96fc9c8db979a38.png +0 -0
- package/core/built/admin/assets/img/themes/Bulletin-d66dec818ad0ba2965dd7eb3130c621c.png +0 -0
- package/core/built/admin/assets/img/themes/Casper-9a0ce71df3a1c589c1414ad2aa5b8aeb.png +0 -0
- package/core/built/admin/assets/img/themes/Dawn-302fbfdbc352098a256137159bd83dd8.png +0 -0
- package/core/built/admin/assets/img/themes/Digest-698e78d8e8481daff8ae4a8647528dc9.png +0 -0
- package/core/built/admin/assets/img/themes/Dope-d099dfca697adae16baa76f89520c5b3.png +0 -0
- package/core/built/admin/assets/img/themes/Ease-7075f809892f10c58892e15a57a4aae4.png +0 -0
- package/core/built/admin/assets/img/themes/Edge-1e5e0eec6941d7bdca02cebb66187357.png +0 -0
- package/core/built/admin/assets/img/themes/Edition-10111a2b8458168dcff81b7fb151be70.png +0 -0
- package/core/built/admin/assets/img/themes/Episode-e4c86d1f75ef1d8a77791d7fd519fdd4.png +0 -0
- package/core/built/admin/assets/img/themes/Headline-f70eaf49b9fcae1ddfe3d4496d8be54d.png +0 -0
- package/core/built/admin/assets/img/themes/Journal-07d35b2311501d2738bad1907ba2f7e1.png +0 -0
- package/core/built/admin/assets/img/themes/London-4e042390da16fecef947f3a7001d03db.png +0 -0
- package/core/built/admin/assets/img/themes/Ruby-b896885448e0f28ca62c6dcd56c732aa.png +0 -0
- package/core/built/admin/assets/img/themes/Solo-0292eb9ae0ca7b578cff50824d40cc86.png +0 -0
- package/core/built/admin/assets/img/themes/Taste-a24d2a786900d9caff7e773ca0040991.png +0 -0
- package/core/built/admin/assets/img/themes/Wave-b98fadfd3ed16e8b2e383dd8e8e5dca2.png +0 -0
- package/core/built/admin/assets/img/touch-icon-ipad-2e78629d62ad05746f980f14623dfadb.png +0 -0
- package/core/built/admin/assets/img/touch-icon-iphone-93ed4382d391be9180093fd77ce8f410.png +0 -0
- package/core/built/admin/assets/img/twitter-7a7a0ba12d9b5bfb8a2058764a827c31.svg +4 -0
- package/core/built/admin/assets/img/typeform-9f23f8712d776a7515594676285266f5.svg +7 -0
- package/core/built/admin/assets/img/ulysses-3c66b59fb45c285bf336b4b613dc86e4.png +0 -0
- package/core/built/admin/assets/img/unsplash-404-71ab3705c9920a9706bb822c3d7e34d1.png +0 -0
- package/core/built/admin/assets/img/unsplash-5b329eef0b11447b4117eaf817ebad6f.svg +4 -0
- package/core/built/admin/assets/img/user-cover-e8f42b12b5fcba292a8b5dfa81e13dd2.png +0 -0
- package/core/built/admin/assets/img/user-image-639a88b784fb5f10964be8b975ca9fdf.png +0 -0
- package/core/built/admin/assets/img/zapier-bf93bc440a3fd43b73489a63c215cdc7.svg +4 -0
- package/core/built/admin/assets/img/zapier-logo-a125f24313dfe01ef49af01fc90061fb.svg +4 -0
- package/core/built/admin/assets/img/zero-bounce-ee799eddb1f88e33ab8c462858cbfed9.png +0 -0
- package/core/built/admin/assets/simplemde/simplemde-8f638be9b49c6c5fc95902d6e470c1a3.js +1874 -0
- package/core/built/admin/assets/vendor-0d244308df4eb04209cbd5fa6abe358b.js +14072 -0
- package/core/built/admin/assets/vendor-3e6947aa681f0fb82b193090e520dc73.css +1512 -0
- package/core/built/admin/assets/videos/logo-loader-d91f93ba1dbf0f52a22815b5a571bd31.mp4 +0 -0
- package/core/built/admin/index.html +64 -0
- package/package.json +141 -141
- package/yarn.lock +19 -31
- package/components/tryghost-adapter-cache-memory-ttl-5.54.1.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.54.1.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.54.1.tgz +0 -0
- package/components/tryghost-collections-5.54.1.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.54.1.tgz +0 -0
- package/components/tryghost-domain-events-5.54.1.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.54.1.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.54.1.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.54.1.tgz +0 -0
- package/components/tryghost-email-content-generator-5.54.1.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.54.1.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.54.1.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.54.1.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.54.1.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.54.1.tgz +0 -0
- package/components/tryghost-link-redirects-5.54.1.tgz +0 -0
- package/components/tryghost-link-tracking-5.54.1.tgz +0 -0
- package/components/tryghost-mail-events-5.54.1.tgz +0 -0
- package/components/tryghost-members-csv-5.54.1.tgz +0 -0
- package/components/tryghost-members-importer-5.54.1.tgz +0 -0
- package/components/tryghost-members-ssr-5.54.1.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.54.1.tgz +0 -0
- package/components/tryghost-milestones-5.54.1.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.54.1.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.54.1.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.54.1.tgz +0 -0
- package/components/tryghost-mw-version-match-5.54.1.tgz +0 -0
- package/components/tryghost-mw-vhost-5.54.1.tgz +0 -0
- package/components/tryghost-post-revisions-5.54.1.tgz +0 -0
- package/components/tryghost-referrers-5.54.1.tgz +0 -0
- package/components/tryghost-session-service-5.54.1.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.54.1.tgz +0 -0
- package/components/tryghost-update-check-service-5.54.1.tgz +0 -0
|
@@ -0,0 +1,1440 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,(function(){"use strict"
|
|
2
|
+
var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=n||i||o,l=a&&(n?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/)
|
|
3
|
+
x&&(x=Number(x[1])),x&&x>=15&&(d=!1,s=!0)
|
|
4
|
+
var k=y&&(u||d&&(null==x||x<12.11)),C=r||a&&l>=9
|
|
5
|
+
function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var r=e.className,n=S(t).exec(r)
|
|
6
|
+
if(n){var i=r.slice(n.index+n[0].length)
|
|
7
|
+
e.className=r.slice(0,n.index)+(i?n[1]+i:"")}}
|
|
8
|
+
function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild)
|
|
9
|
+
return e}function N(e,t){return M(e).appendChild(t)}function A(e,t,r,n){var i=document.createElement(e)
|
|
10
|
+
if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t))
|
|
11
|
+
else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o])
|
|
12
|
+
return i}function O(e,t,r,n){var i=A(e,t,r,n)
|
|
13
|
+
return i.setAttribute("role","presentation"),i}function W(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t)
|
|
14
|
+
do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e
|
|
15
|
+
try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement
|
|
16
|
+
return e}function z(e,t){var r=e.className
|
|
17
|
+
S(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n])
|
|
18
|
+
return t}L=document.createRange?function(e,t,r,n){var i=document.createRange()
|
|
19
|
+
return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange()
|
|
20
|
+
try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n}
|
|
21
|
+
var H=function(e){e.select()}
|
|
22
|
+
function I(e){var t=Array.prototype.slice.call(arguments,1)
|
|
23
|
+
return function(){return e.apply(null,t)}}function E(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n])
|
|
24
|
+
return t}function F(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length)
|
|
25
|
+
for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o)
|
|
26
|
+
if(l<0||l>=t)return a+(t-o)
|
|
27
|
+
a+=l-o,a+=r-a%r,o=l+1}}g?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(H=function(e){try{e.select()}catch(e){}})
|
|
28
|
+
var R=function(){this.id=null}
|
|
29
|
+
function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r
|
|
30
|
+
return-1}R.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}
|
|
31
|
+
var j=30,V={toString:function(){return"CodeMirror.Pass"}},K={scroll:!1},G={origin:"*mouse"},U={origin:"+move"}
|
|
32
|
+
function q(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length)
|
|
33
|
+
var a=o-n
|
|
34
|
+
if(o==e.length||i+a>=t)return n+Math.min(a,t-i)
|
|
35
|
+
if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var _=[""]
|
|
36
|
+
function $(e){for(;_.length<=e;)_.push(X(_)+" ")
|
|
37
|
+
return _[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n)
|
|
38
|
+
return r}function Z(){}function Q(e,t){var r
|
|
39
|
+
return Object.create?r=Object.create(e):(Z.prototype=e,r=new Z),t&&E(t,r),r}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/
|
|
40
|
+
function ee(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1
|
|
41
|
+
return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/
|
|
42
|
+
function ie(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,r){for(;(r<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=r
|
|
43
|
+
return t}function ae(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t
|
|
44
|
+
var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i)
|
|
45
|
+
if(o==t)return e(o)?t:r
|
|
46
|
+
e(o)?r=o:t=o+n}}var le=null
|
|
47
|
+
function se(e,t,r){var n
|
|
48
|
+
le=null
|
|
49
|
+
for(var i=0;i<e.length;++i){var o=e[i]
|
|
50
|
+
if(o.from<t&&o.to>t)return i
|
|
51
|
+
o.to==t&&(o.from!=o.to&&"before"==r?n=i:le=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:le=i)}return null!=n?n:le}var ue=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/
|
|
52
|
+
function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,l){var s="ltr"==l?"L":"R"
|
|
53
|
+
if(0==a.length||"ltr"==l&&!e.test(a))return!1
|
|
54
|
+
for(var u,c=a.length,d=[],f=0;f<c;++f)d.push((u=a.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L")
|
|
55
|
+
for(var h=0,p=s;h<c;++h){var g=d[h]
|
|
56
|
+
"m"==g?d[h]=p:p=g}for(var m=0,v=s;m<c;++m){var y=d[m]
|
|
57
|
+
"1"==y&&"r"==v?d[m]="n":r.test(y)&&(v=y,"r"==y&&(d[m]="R"))}for(var b=1,w=d[0];b<c-1;++b){var x=d[b]
|
|
58
|
+
"+"==x&&"1"==w&&"1"==d[b+1]?d[b]="1":","!=x||w!=d[b+1]||"1"!=w&&"n"!=w||(d[b]=w),w=x}for(var k=0;k<c;++k){var C=d[k]
|
|
59
|
+
if(","==C)d[k]="N"
|
|
60
|
+
else if("%"==C){var S=void 0
|
|
61
|
+
for(S=k+1;S<c&&"%"==d[S];++S);for(var L=k&&"!"==d[k-1]||S<c&&"1"==d[S]?"1":"N",T=k;T<S;++T)d[T]=L
|
|
62
|
+
k=S-1}}for(var M=0,N=s;M<c;++M){var A=d[M]
|
|
63
|
+
"L"==N&&"1"==A?d[M]="L":r.test(A)&&(N=A)}for(var O=0;O<c;++O)if(t.test(d[O])){var W=void 0
|
|
64
|
+
for(W=O+1;W<c&&t.test(d[W]);++W);for(var D="L"==(O?d[O-1]:s),z=D==("L"==(W<c?d[W]:s))?D?"L":"R":s,P=O;P<W;++P)d[P]=z
|
|
65
|
+
O=W-1}for(var H,I=[],E=0;E<c;)if(n.test(d[E])){var F=E
|
|
66
|
+
for(++E;E<c&&n.test(d[E]);++E);I.push(new o(0,F,E))}else{var R=E,B=I.length
|
|
67
|
+
for(++E;E<c&&"L"!=d[E];++E);for(var j=R;j<E;)if(i.test(d[j])){R<j&&I.splice(B,0,new o(1,R,j))
|
|
68
|
+
var V=j
|
|
69
|
+
for(++j;j<E&&i.test(d[j]);++j);I.splice(B,0,new o(2,V,j)),R=j}else++j
|
|
70
|
+
R<E&&I.splice(B,0,new o(1,R,E))}return"ltr"==l&&(1==I[0].level&&(H=a.match(/^\s+/))&&(I[0].from=H[0].length,I.unshift(new o(0,0,H[0].length))),1==X(I).level&&(H=a.match(/\s+$/))&&(X(I).to-=H[0].length,I.push(new o(0,c-H[0].length,c)))),"rtl"==l?I.reverse():I}}()
|
|
71
|
+
function ce(e,t){var r=e.order
|
|
72
|
+
return null==r&&(r=e.order=ue(e.text,t)),r}var de=[],fe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1)
|
|
73
|
+
else if(e.attachEvent)e.attachEvent("on"+t,r)
|
|
74
|
+
else{var n=e._handlers||(e._handlers={})
|
|
75
|
+
n[t]=(n[t]||de).concat(r)}}
|
|
76
|
+
function he(e,t){return e._handlers&&e._handlers[t]||de}function pe(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1)
|
|
77
|
+
else if(e.detachEvent)e.detachEvent("on"+t,r)
|
|
78
|
+
else{var n=e._handlers,i=n&&n[t]
|
|
79
|
+
if(i){var o=B(i,r)
|
|
80
|
+
o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ge(e,t){var r=he(e,t)
|
|
81
|
+
if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function me(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ge(e,r||t.type,e,t),ke(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity
|
|
82
|
+
if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function ye(e,t){return he(e,t).length>0}function be(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function we(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){we(e),xe(e)}function Se(e){return e.target||e.srcElement}function Le(e){var t=e.which
|
|
83
|
+
return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Te,Me,Ne=function(){if(a&&l<9)return!1
|
|
84
|
+
var e=A("div")
|
|
85
|
+
return"draggable"in e||"dragDrop"in e}()
|
|
86
|
+
function Ae(e){if(null==Te){var t=A("span","")
|
|
87
|
+
N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Te=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var r=Te?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")
|
|
88
|
+
return r.setAttribute("cm-text",""),r}function Oe(e){if(null!=Me)return Me
|
|
89
|
+
var t=N(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect()
|
|
90
|
+
return M(e),!(!r||r.left==r.right)&&(Me=n.right-r.right<3)}var We,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length)
|
|
91
|
+
var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ze=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t
|
|
92
|
+
try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe="oncopy"in(We=A("div"))||(We.setAttribute("oncopy","return;"),"function"==typeof We.oncopy),He=null,Ie={},Ee={}
|
|
93
|
+
function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ie[e]=t}function Re(e){if("string"==typeof e&&Ee.hasOwnProperty(e))e=Ee[e]
|
|
94
|
+
else if(e&&"string"==typeof e.name&&Ee.hasOwnProperty(e.name)){var t=Ee[e.name]
|
|
95
|
+
"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Re("application/xml")
|
|
96
|
+
if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Re("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Be(e,t){t=Re(t)
|
|
97
|
+
var r=Ie[t.name]
|
|
98
|
+
if(!r)return Be(e,"text/plain")
|
|
99
|
+
var n=r(e,t)
|
|
100
|
+
if(je.hasOwnProperty(t.name)){var i=je[t.name]
|
|
101
|
+
for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a]
|
|
102
|
+
return n}var je={}
|
|
103
|
+
function Ve(e,t){E(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function Ke(e,t){if(!0===t)return t
|
|
104
|
+
if(e.copyState)return e.copyState(t)
|
|
105
|
+
var r={}
|
|
106
|
+
for(var n in t){var i=t[n]
|
|
107
|
+
i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ge(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode
|
|
108
|
+
return r||{mode:e,state:t}}function Ue(e,t,r){return!e.startState||e.startState(t,r)}var qe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r}
|
|
109
|
+
function _e(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.")
|
|
110
|
+
for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize()
|
|
111
|
+
if(t<o){r=i
|
|
112
|
+
break}t-=o}return r.lines[t]}function $e(e,t,r){var n=[],i=t.line
|
|
113
|
+
return e.iter(t.line,r.line+1,(function(e){var o=e.text
|
|
114
|
+
i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function Xe(e,t,r){var n=[]
|
|
115
|
+
return e.iter(t,r,(function(e){n.push(e.text)})),n}function Ye(e,t){var r=t-e.height
|
|
116
|
+
if(r)for(var n=e;n;n=n.parent)n.height+=r}function Ze(e){if(null==e.parent)return null
|
|
117
|
+
for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize()
|
|
118
|
+
return r+t.first}function Qe(e,t){var r=e.first
|
|
119
|
+
e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height
|
|
120
|
+
if(t<o){e=i
|
|
121
|
+
continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines)
|
|
122
|
+
for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height
|
|
123
|
+
if(t<l)break
|
|
124
|
+
t-=l}return r+a}function Je(e,t){return t>=e.first&&t<e.first+e.size}function et(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,r){if(void 0===r&&(r=null),!(this instanceof tt))return new tt(e,t,r)
|
|
125
|
+
this.line=e,this.ch=t,this.sticky=r}function rt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==rt(e,t)}function it(e){return tt(e.line,e.ch)}function ot(e,t){return rt(e,t)<0?t:e}function at(e,t){return rt(e,t)<0?e:t}function lt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return tt(e.first,0)
|
|
126
|
+
var r=e.first+e.size-1
|
|
127
|
+
return t.line>r?tt(r,_e(e,r).text.length):function(e,t){var r=e.ch
|
|
128
|
+
return null==r||r>t?tt(e.line,t):r<0?tt(e.line,0):e}(t,_e(e,t.line).text.length)}function ut(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=st(e,t[n])
|
|
129
|
+
return r}qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(e){var t=this.string.charAt(this.pos)
|
|
130
|
+
if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos
|
|
131
|
+
return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos)
|
|
132
|
+
if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e)
|
|
133
|
+
return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e}
|
|
134
|
+
if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e
|
|
135
|
+
try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle
|
|
136
|
+
return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle
|
|
137
|
+
return e&&e.baseToken(this.pos)}
|
|
138
|
+
var ct=function(e,t){this.state=e,this.lookAhead=t},dt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1}
|
|
139
|
+
function ft(e,t,r,n){var i=[e.state.modeGen],o={}
|
|
140
|
+
xt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n)
|
|
141
|
+
for(var a=r.state,l=function(n){r.baseTokens=i
|
|
142
|
+
var l=e.state.overlays[n],s=1,u=0
|
|
143
|
+
r.state=!0,xt(e,t.text,l.mode,r,(function(e,t){for(var r=s;u<e;){var n=i[s]
|
|
144
|
+
n>e&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2
|
|
145
|
+
else for(;r<s;r+=2){var o=i[r+1]
|
|
146
|
+
i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s)
|
|
147
|
+
return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ht(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=pt(e,Ze(t)),i=t.text.length>e.options.maxHighlightLength&&Ke(e.doc.mode,n.state),o=ft(e,t,n)
|
|
148
|
+
i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pt(e,t,r){var n=e.doc,i=e.display
|
|
149
|
+
if(!n.mode.startState)return new dt(n,!0,t)
|
|
150
|
+
var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first
|
|
151
|
+
var s=_e(o,l-1),u=s.stateAfter
|
|
152
|
+
if(u&&(!r||l+(u instanceof ct?u.lookAhead:0)<=o.modeFrontier))return l
|
|
153
|
+
var c=F(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}(e,t,r),a=o>n.first&&_e(n,o-1).stateAfter,l=a?dt.fromSaved(n,a,o):new dt(n,Ue(n.mode),o)
|
|
154
|
+
return n.iter(o,t,(function(r){gt(e,r.text,l)
|
|
155
|
+
var n=l.line
|
|
156
|
+
r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?l.save():null,l.nextLine()})),r&&(n.modeFrontier=l.line),l}function gt(e,t,r,n){var i=e.doc.mode,o=new qe(t,e.options.tabSize,r)
|
|
157
|
+
for(o.start=o.pos=n||0,""==t&&mt(i,r.state);!o.eol();)vt(i,o,r.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t)
|
|
158
|
+
if(e.innerMode){var r=Ge(e,t)
|
|
159
|
+
return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function vt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ge(e,r).mode)
|
|
160
|
+
var o=e.token(t,r)
|
|
161
|
+
if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e)
|
|
162
|
+
return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},dt.prototype.baseToken=function(e){if(!this.baseTokens)return null
|
|
163
|
+
for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2
|
|
164
|
+
var t=this.baseTokens[this.baseTokenPos+1]
|
|
165
|
+
return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},dt.fromSaved=function(e,t,r){return t instanceof ct?new dt(e,Ke(e.mode,t.state),r,t.lookAhead):new dt(e,Ke(e.mode,t),r)},dt.prototype.save=function(e){var t=!1!==e?Ke(this.doc.mode,this.state):this.state
|
|
166
|
+
return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t}
|
|
167
|
+
var yt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r}
|
|
168
|
+
function bt(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=_e(a,(t=st(a,t)).line),u=pt(e,t.line,r),c=new qe(s.text,e.options.tabSize,u)
|
|
169
|
+
for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=vt(l,c,u.state),n&&o.push(new yt(c,i,Ke(a.mode,u.state)))
|
|
170
|
+
return n?o:new yt(c,i,u.state)}function wt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/)
|
|
171
|
+
if(!r)break
|
|
172
|
+
e=e.slice(0,r.index)+e.slice(r.index+r[0].length)
|
|
173
|
+
var n=r[1]?"bgClass":"textClass"
|
|
174
|
+
null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function xt(e,t,r,n,i,o,a){var l=r.flattenSpans
|
|
175
|
+
null==l&&(l=e.options.flattenSpans)
|
|
176
|
+
var s,u=0,c=null,d=new qe(t,e.options.tabSize,n),f=e.options.addModeClass&&[null]
|
|
177
|
+
for(""==t&&wt(mt(r,n.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&>(e,t,n,d.pos),d.pos=t.length,s=null):s=wt(vt(r,d,n.state,f),o),f){var h=f[0].name
|
|
178
|
+
h&&(s="m-"+(s?h+" "+s:h))}if(!l||c!=s){for(;u<d.start;)i(u=Math.min(d.start,u+5e3),c)
|
|
179
|
+
c=s}d.start=d.pos}for(;u<d.pos;){var p=Math.min(d.pos,u+5e3)
|
|
180
|
+
i(p,c),u=p}}var kt=!1,Ct=!1
|
|
181
|
+
function St(e,t,r){this.marker=e,this.from=t,this.to=r}function Lt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r]
|
|
182
|
+
if(n.marker==t)return n}}function Tt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n])
|
|
183
|
+
return r}function Mt(e,t){if(t.full)return null
|
|
184
|
+
var r=Je(e,t.from.line)&&_e(e,t.from.line).markedSpans,n=Je(e,t.to.line)&&_e(e,t.to.line).markedSpans
|
|
185
|
+
if(!r&&!n)return null
|
|
186
|
+
var i=t.from.ch,o=t.to.ch,a=0==rt(t.from,t.to),l=function(e,t,r){var n
|
|
187
|
+
if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker
|
|
188
|
+
if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new St(a,o.from,l?null:o.to))}}return n}(r,i,a),s=function(e,t,r){var n
|
|
189
|
+
if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker
|
|
190
|
+
if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new St(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),u=1==t.text.length,c=X(t.text).length+(u?i:0)
|
|
191
|
+
if(l)for(var d=0;d<l.length;++d){var f=l[d]
|
|
192
|
+
if(null==f.to){var h=Lt(s,f.marker)
|
|
193
|
+
h?u&&(f.to=null==h.to?null:h.to+c):f.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p]
|
|
194
|
+
null!=g.to&&(g.to+=c),null==g.from?Lt(l,g.marker)||(g.from=c,u&&(l||(l=[])).push(g)):(g.from+=c,u&&(l||(l=[])).push(g))}l&&(l=Nt(l)),s&&s!=l&&(s=Nt(s))
|
|
195
|
+
var m=[l]
|
|
196
|
+
if(!u){var v,y=t.text.length-2
|
|
197
|
+
if(y>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new St(l[b].marker,null,null))
|
|
198
|
+
for(var w=0;w<y;++w)m.push(v)
|
|
199
|
+
m.push(s)}return m}function Nt(e){for(var t=0;t<e.length;++t){var r=e[t]
|
|
200
|
+
null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function At(e){var t=e.markedSpans
|
|
201
|
+
if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e)
|
|
202
|
+
e.markedSpans=null}}function Ot(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e)
|
|
203
|
+
e.markedSpans=t}}function Wt(e){return e.inclusiveLeft?-1:0}function Dt(e){return e.inclusiveRight?1:0}function zt(e,t){var r=e.lines.length-t.lines.length
|
|
204
|
+
if(0!=r)return r
|
|
205
|
+
var n=e.find(),i=t.find(),o=rt(n.from,i.from)||Wt(e)-Wt(t)
|
|
206
|
+
return o?-o:rt(n.to,i.to)||Dt(e)-Dt(t)||t.id-e.id}function Pt(e,t){var r,n=Ct&&e.markedSpans
|
|
207
|
+
if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||zt(r,i.marker)<0)&&(r=i.marker)
|
|
208
|
+
return r}function Ht(e){return Pt(e,!0)}function It(e){return Pt(e,!1)}function Et(e,t){var r,n=Ct&&e.markedSpans
|
|
209
|
+
if(n)for(var i=0;i<n.length;++i){var o=n[i]
|
|
210
|
+
o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||zt(r,o.marker)<0)&&(r=o.marker)}return r}function Ft(e,t,r,n,i){var o=_e(e,t),a=Ct&&o.markedSpans
|
|
211
|
+
if(a)for(var l=0;l<a.length;++l){var s=a[l]
|
|
212
|
+
if(s.marker.collapsed){var u=s.marker.find(0),c=rt(u.from,r)||Wt(s.marker)-Wt(i),d=rt(u.to,n)||Dt(s.marker)-Dt(i)
|
|
213
|
+
if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?rt(u.to,r)>=0:rt(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?rt(u.from,n)<=0:rt(u.from,n)<0)))return!0}}}function Rt(e){for(var t;t=Ht(e);)e=t.find(-1,!0).line
|
|
214
|
+
return e}function Bt(e,t){var r=_e(e,t),n=Rt(r)
|
|
215
|
+
return r==n?t:Ze(n)}function jt(e,t){if(t>e.lastLine())return t
|
|
216
|
+
var r,n=_e(e,t)
|
|
217
|
+
if(!Vt(e,n))return t
|
|
218
|
+
for(;r=It(n);)n=r.find(1,!0).line
|
|
219
|
+
return Ze(n)+1}function Vt(e,t){var r=Ct&&t.markedSpans
|
|
220
|
+
if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0
|
|
221
|
+
if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Kt(e,t,n))return!0}}function Kt(e,t,r){if(null==r.to){var n=r.marker.find(1,!0)
|
|
222
|
+
return Kt(e,n.line,Lt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0
|
|
223
|
+
for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Kt(e,t,i))return!0}function Gt(e){for(var t=0,r=(e=Rt(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n]
|
|
224
|
+
if(i==e)break
|
|
225
|
+
t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a]
|
|
226
|
+
if(l==r)break
|
|
227
|
+
t+=l.height}return t}function Ut(e){if(0==e.height)return 0
|
|
228
|
+
for(var t,r=e.text.length,n=e;t=Ht(n);){var i=t.find(0,!0)
|
|
229
|
+
n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=It(n);){var o=t.find(0,!0)
|
|
230
|
+
r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function qt(e){var t=e.display,r=e.doc
|
|
231
|
+
t.maxLine=_e(r,r.first),t.maxLineLength=Ut(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Ut(e)
|
|
232
|
+
r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var _t=function(e,t,r){this.text=e,Ot(this,t),this.height=r?r(this):1}
|
|
233
|
+
function $t(e){e.parent=null,At(e)}_t.prototype.lineNo=function(){return Ze(this)},be(_t)
|
|
234
|
+
var Xt={},Yt={}
|
|
235
|
+
function Zt(e,t){if(!e||/^\s*$/.test(e))return null
|
|
236
|
+
var r=t.addModeClass?Yt:Xt
|
|
237
|
+
return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var r=O("span",null,null,s?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")}
|
|
238
|
+
t.measure={}
|
|
239
|
+
for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0
|
|
240
|
+
n.pos=0,n.addToken=er,Oe(e.display.measure)&&(a=ce(o,e.doc.direction))&&(n.addToken=tr(n.addToken,a)),n.map=[],nr(o,n,ht(e,o,t!=e.display.externalMeasured&&Ze(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ae(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function Jt(e){var t=A("span","•","cm-invalidchar")
|
|
241
|
+
return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function er(e,t,r,n,i,o,s){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e
|
|
242
|
+
for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i)
|
|
243
|
+
" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1
|
|
244
|
+
if(d.test(t)){u=document.createDocumentFragment()
|
|
245
|
+
for(var h=0;;){d.lastIndex=h
|
|
246
|
+
var p=d.exec(t),g=p?p.index-h:t.length-h
|
|
247
|
+
if(g){var m=document.createTextNode(c.slice(h,h+g))
|
|
248
|
+
a&&l<9?u.appendChild(A("span",[m])):u.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break
|
|
249
|
+
h+=g+1
|
|
250
|
+
var v=void 0
|
|
251
|
+
if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(A("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(A("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&l<9?u.appendChild(A("span",[v])):u.appendChild(v),e.col+=1)
|
|
252
|
+
e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&l<9&&(f=!0),e.pos+=t.length
|
|
253
|
+
if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||f||o){var w=r||""
|
|
254
|
+
n&&(w+=n),i&&(w+=i)
|
|
255
|
+
var x=A("span",[u],w,o)
|
|
256
|
+
if(s)for(var k in s)s.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&x.setAttribute(k,s[k])
|
|
257
|
+
return e.content.appendChild(x)}e.content.appendChild(u)}}function tr(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border"
|
|
258
|
+
for(var u=r.pos,c=u+n.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>u&&d.from<=u);f++);if(d.to>=c)return e(r,n,i,o,a,l,s)
|
|
259
|
+
e(r,n.slice(0,d.to-u),i,o,null,l,s),o=null,n=n.slice(d.to-u),u=d.to}}}function rr(e,t,r,n){var i=!n&&r.widgetNode
|
|
260
|
+
i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nr(e,t,r){var n=e.markedSpans,i=e.text,o=0
|
|
261
|
+
if(n)for(var a,l,s,u,c,d,f,h=i.length,p=0,g=1,m="",v=0;;){if(v==p){s=u=c=l="",f=null,d=null,v=1/0
|
|
262
|
+
for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker
|
|
263
|
+
if("bookmark"==k.type&&x.from==p&&k.widgetNode)y.push(k)
|
|
264
|
+
else if(x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,u=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(c+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var C in k.attributes)(f||(f={}))[C]=k.attributes[C]
|
|
265
|
+
k.collapsed&&(!d||zt(d.marker,k)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(u+=" "+b[S])
|
|
266
|
+
if(!d||d.from==p)for(var L=0;L<y.length;++L)rr(t,0,y[L])
|
|
267
|
+
if(d&&(d.from||0)==p){if(rr(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return
|
|
268
|
+
d.to==p&&(d=!1)}}if(p>=h)break
|
|
269
|
+
for(var T=Math.min(h,v);;){if(m){var M=p+m.length
|
|
270
|
+
if(!d){var N=M>T?m.slice(0,T-p):m
|
|
271
|
+
t.addToken(t,N,a?a+s:s,c,p+N.length==v?u:"",l,f)}if(M>=T){m=m.slice(T-p),p=T
|
|
272
|
+
break}p=M,c=""}m=i.slice(o,o=r[g++]),a=Zt(r[g++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),Zt(r[A+1],t.cm.options))}function ir(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=It(e);)e=t.find(1,!0).line,(r||(r=[])).push(e)
|
|
273
|
+
return r}(t),this.size=this.rest?Ze(X(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Vt(e,t)}function or(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new ir(e.doc,_e(e.doc,o),o)
|
|
274
|
+
n=o+a.size,i.push(a)}return i}var ar=null,lr=null
|
|
275
|
+
function sr(e,t){var r=he(e,t)
|
|
276
|
+
if(r.length){var n,i=Array.prototype.slice.call(arguments,2)
|
|
277
|
+
ar?n=ar.delayedCallbacks:lr?n=lr:(n=lr=[],setTimeout(ur,0))
|
|
278
|
+
for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},a=0;a<r.length;++a)o(a)}}function ur(){var e=lr
|
|
279
|
+
lr=null
|
|
280
|
+
for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i]
|
|
281
|
+
"text"==o?hr(e,t):"gutter"==o?gr(e,t,r,n):"class"==o?pr(e,t):"widget"==o&&mr(e,t,n)}t.changes=null}function dr(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured
|
|
282
|
+
return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Qt(e,t)}function hr(e,t){var r=t.text.className,n=fr(e,t)
|
|
283
|
+
t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,pr(e,t)):r&&(t.text.className=r)}function pr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass
|
|
284
|
+
if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null)
|
|
285
|
+
else if(r){var n=dr(t)
|
|
286
|
+
t.background=n.insertBefore(A("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="")
|
|
287
|
+
var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass
|
|
288
|
+
t.text.className=r||""}function gr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=dr(t)
|
|
289
|
+
t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers
|
|
290
|
+
if(e.options.lineNumbers||o){var a=dr(t),l=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px")
|
|
291
|
+
if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(A("div",et(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u]
|
|
292
|
+
c&&l.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function mr(e,t,r){t.alignable&&(t.alignable=null)
|
|
293
|
+
for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n)
|
|
294
|
+
yr(e,t,r)}function vr(e,t,r,n){var i=fr(e,t)
|
|
295
|
+
return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pr(e,t),gr(e,t,r,n),yr(e,t,n),t.node}function yr(e,t,r){if(br(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)br(e,t.rest[n],t,r,!1)}function br(e,t,r,n,i){if(t.widgets)for(var o=dr(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=A("div",[s.node],"CodeMirror-linewidget")
|
|
296
|
+
s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),wr(s,u,r,n),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),sr(s,"redraw")}}function wr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t)
|
|
297
|
+
var i=n.wrapperWidth
|
|
298
|
+
t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function xr(e){if(null!=e.height)return e.height
|
|
299
|
+
var t=e.doc.cm
|
|
300
|
+
if(!t)return 0
|
|
301
|
+
if(!W(document.body,e.node)){var r="position: relative;"
|
|
302
|
+
e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,A("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function kr(e,t){for(var r=Se(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Cr(e){return e.lineSpace.offsetTop}function Sr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lr(e){if(e.cachedPaddingH)return e.cachedPaddingH
|
|
303
|
+
var t=N(e.measure,A("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)}
|
|
304
|
+
return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Tr(e){return j-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-Tr(e)-e.display.barWidth}function Nr(e){return e.display.scroller.clientHeight-Tr(e)-e.display.barHeight}function Ar(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache}
|
|
305
|
+
for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]}
|
|
306
|
+
for(var i=0;i<e.rest.length;i++)if(Ze(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Or(e,t,r,n){return zr(e,Dr(e,t),r,n)}function Wr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[dn(e,t)]
|
|
307
|
+
var r=e.display.externalMeasured
|
|
308
|
+
return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Dr(e,t){var r=Ze(t),n=Wr(e,r)
|
|
309
|
+
n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,an(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=Ze(t=Rt(t)),n=e.display.externalMeasured=new ir(e.doc,t,r)
|
|
310
|
+
n.lineN=r
|
|
311
|
+
var i=n.built=Qt(e,n)
|
|
312
|
+
return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}(e,t))
|
|
313
|
+
var i=Ar(n,t,r)
|
|
314
|
+
return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function zr(e,t,r,n,i){t.before&&(r=-1)
|
|
315
|
+
var o,s=r+(n||"")
|
|
316
|
+
return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&Mr(e)
|
|
317
|
+
if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[]
|
|
318
|
+
if(n){t.measure.width=i
|
|
319
|
+
for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1]
|
|
320
|
+
Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),o=function(e,t,r,n){var i,o=Ir(t.map,r,n),s=o.node,u=o.start,c=o.end,d=o.collapse
|
|
321
|
+
if(3==s.nodeType){for(var f=0;f<4;f++){for(;u&&ie(t.line.text.charAt(o.coverStart+u));)--u
|
|
322
|
+
for(;o.coverStart+c<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+c));)++c
|
|
323
|
+
if((i=a&&l<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Er(L(s,u,c).getClientRects(),n)).left||i.right||0==u)break
|
|
324
|
+
c=u,u-=1,d="right"}a&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=He)return He
|
|
325
|
+
var t=N(e,A("span","x")),r=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect()
|
|
326
|
+
return He=Math.abs(r.left-n.left)>1}(e))return t
|
|
327
|
+
var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI
|
|
328
|
+
return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var h
|
|
329
|
+
u>0&&(d=n="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==n?h.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0]
|
|
330
|
+
i=p?{left:p.left,right:p.left+on(e.display),top:p.top,bottom:p.bottom}:Hr}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var w=b?y[b-1]:0,x=y[b],k={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:x}
|
|
331
|
+
return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=g,k.rbottom=m),k}(e,t,r,n),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Pr,Hr={left:0,right:0,top:0,bottom:0}
|
|
332
|
+
function Ir(e,t,r){for(var n,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?o=1+(i=t-l):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(n=e[u+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left"
|
|
333
|
+
if("right"==r&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],a="right"
|
|
334
|
+
break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Er(e,t){var r=Hr
|
|
335
|
+
if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Fr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Rr(e){e.display.externalMeasure=null,M(e.display.lineMeasure)
|
|
336
|
+
for(var t=0;t<e.display.view.length;t++)Fr(e.display.view[t])}function Br(e){Rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function jr(){return c&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vr(){return c&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Kr(e){var t=0
|
|
337
|
+
if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=xr(e.widgets[r]))
|
|
338
|
+
return t}function Gr(e,t,r,n,i){if(!i){var o=Kr(t)
|
|
339
|
+
r.top+=o,r.bottom+=o}if("line"==n)return r
|
|
340
|
+
n||(n="local")
|
|
341
|
+
var a=Gt(t)
|
|
342
|
+
if("local"==n?a+=Cr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect()
|
|
343
|
+
a+=l.top+("window"==n?0:Vr())
|
|
344
|
+
var s=l.left+("window"==n?0:jr())
|
|
345
|
+
r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function Ur(e,t,r){if("div"==r)return t
|
|
346
|
+
var n=t.left,i=t.top
|
|
347
|
+
if("page"==r)n-=jr(),i-=Vr()
|
|
348
|
+
else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect()
|
|
349
|
+
n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect()
|
|
350
|
+
return{left:n-a.left,top:i-a.top}}function qr(e,t,r,n,i){return n||(n=_e(e.doc,t.line)),Gr(e,n,Or(e,n,t.ch,i),r)}function _r(e,t,r,n,i,o){function a(t,a){var l=zr(e,i,t,a?"right":"left",o)
|
|
351
|
+
return a?l.left=l.right:l.right=l.left,Gr(e,n,l,r)}n=n||_e(e.doc,t.line),i||(i=Dr(e,n))
|
|
352
|
+
var l=ce(n,e.doc.direction),s=t.ch,u=t.sticky
|
|
353
|
+
if(s>=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a("before"==u?s-1:s,"before"==u)
|
|
354
|
+
function c(e,t,r){return a(r?e-1:e,1==l[t].level!=r)}var d=se(l,s,u),f=le,h=c(s,d,"before"==u)
|
|
355
|
+
return null!=f&&(h.other=c(s,f,"before"!=u)),h}function $r(e,t){var r=0
|
|
356
|
+
t=st(e.doc,t),e.options.lineWrapping||(r=on(e.display)*t.ch)
|
|
357
|
+
var n=_e(e.doc,t.line),i=Gt(n)+Cr(e.display)
|
|
358
|
+
return{left:r,right:r,top:i,bottom:i+n.height}}function Xr(e,t,r,n,i){var o=tt(e,t,r)
|
|
359
|
+
return o.xRel=i,n&&(o.outside=!0),o}function Yr(e,t,r){var n=e.doc
|
|
360
|
+
if((r+=e.display.viewOffset)<0)return Xr(n.first,0,null,!0,-1)
|
|
361
|
+
var i=Qe(n,r),o=n.first+n.size-1
|
|
362
|
+
if(i>o)return Xr(n.first+n.size-1,_e(n,o).text.length,null,!0,1)
|
|
363
|
+
t<0&&(t=0)
|
|
364
|
+
for(var a=_e(n,i);;){var l=en(e,a,i,t,r),s=Et(a,l.ch+(l.xRel>0?1:0))
|
|
365
|
+
if(!s)return l
|
|
366
|
+
var u=s.find(1)
|
|
367
|
+
if(u.line==i)return u
|
|
368
|
+
a=_e(n,i=u.line)}}function Zr(e,t,r,n){n-=Kr(t)
|
|
369
|
+
var i=t.text.length,o=ae((function(t){return zr(e,r,t-1).bottom<=n}),i,0)
|
|
370
|
+
return{begin:o,end:i=ae((function(t){return zr(e,r,t).top>n}),o,i)}}function Qr(e,t,r,n){return r||(r=Dr(e,t)),Zr(e,t,r,Gr(e,t,zr(e,r,n),"line").top)}function Jr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function en(e,t,r,n,i){i-=Gt(t)
|
|
371
|
+
var o=Dr(e,t),a=Kr(t),l=0,s=t.text.length,u=!0,c=ce(t,e.doc.direction)
|
|
372
|
+
if(c){var d=(e.options.lineWrapping?rn:tn)(e,t,r,o,c,n,i)
|
|
373
|
+
l=(u=1!=d.level)?d.from:d.to-1,s=u?d.to:d.from-1}var f,h,p=null,g=null,m=ae((function(t){var r=zr(e,o,t)
|
|
374
|
+
return r.top+=a,r.bottom+=a,!!Jr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),l,s),v=!1
|
|
375
|
+
if(g){var y=n-g.left<g.right-n,b=y==u
|
|
376
|
+
m=p+(b?0:1),h=b?"after":"before",f=y?g.left:g.right}else{u||m!=s&&m!=l||m++,h=0==m?"after":m==t.text.length?"before":zr(e,o,m-(u?1:0)).bottom+a<=i==u?"after":"before"
|
|
377
|
+
var w=_r(e,tt(r,m,h),"line",t,o)
|
|
378
|
+
f=w.left,v=i<w.top||i>=w.bottom}return Xr(r,m=oe(t.text,m,1),h,v,n-f)}function tn(e,t,r,n,i,o,a){var l=ae((function(l){var s=i[l],u=1!=s.level
|
|
379
|
+
return Jr(_r(e,tt(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),s=i[l]
|
|
380
|
+
if(l>0){var u=1!=s.level,c=_r(e,tt(r,u?s.from:s.to,u?"after":"before"),"line",t,n)
|
|
381
|
+
Jr(c,o,a,!0)&&c.top>a&&(s=i[l-1])}return s}function rn(e,t,r,n,i,o,a){var l=Zr(e,t,n,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--
|
|
382
|
+
for(var c=null,d=null,f=0;f<i.length;f++){var h=i[f]
|
|
383
|
+
if(!(h.from>=u||h.to<=s)){var p=zr(e,n,1!=h.level?Math.min(u,h.to)-1:Math.max(s,h.from)).right,g=p<o?o-p+1e9:p-o;(!c||d>g)&&(c=h,d=g)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight
|
|
384
|
+
if(null==Pr){Pr=A("pre")
|
|
385
|
+
for(var t=0;t<49;++t)Pr.appendChild(document.createTextNode("x")),Pr.appendChild(A("br"))
|
|
386
|
+
Pr.appendChild(document.createTextNode("x"))}N(e.measure,Pr)
|
|
387
|
+
var r=Pr.offsetHeight/50
|
|
388
|
+
return r>3&&(e.cachedTextHeight=r),M(e.measure),r||1}function on(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth
|
|
389
|
+
var t=A("span","xxxxxxxxxx"),r=A("pre",[t])
|
|
390
|
+
N(e.measure,r)
|
|
391
|
+
var n=t.getBoundingClientRect(),i=(n.right-n.left)/10
|
|
392
|
+
return i>2&&(e.cachedCharWidth=i),i||10}function an(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className
|
|
393
|
+
r[l]=o.offsetLeft+o.clientLeft+i,n[l]=o.clientWidth}return{fixedPos:ln(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ln(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sn(e){var t=nn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/on(e.display)-3)
|
|
394
|
+
return function(i){if(Vt(e.doc,i))return 0
|
|
395
|
+
var o=0
|
|
396
|
+
if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height)
|
|
397
|
+
return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function un(e){var t=e.doc,r=sn(e)
|
|
398
|
+
t.iter((function(e){var t=r(e)
|
|
399
|
+
t!=e.height&&Ye(e,t)}))}function cn(e,t,r,n){var i=e.display
|
|
400
|
+
if(!r&&"true"==Se(t).getAttribute("cm-not-content"))return null
|
|
401
|
+
var o,a,l=i.lineSpace.getBoundingClientRect()
|
|
402
|
+
try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,u=Yr(e,o,a)
|
|
403
|
+
if(n&&1==u.xRel&&(s=_e(e.doc,u.line).text).length==u.ch){var c=F(s,s.length,e.options.tabSize)-s.length
|
|
404
|
+
u=tt(u.line,Math.max(0,Math.round((o-Lr(e.display).left)/on(e.display))-c))}return u}function dn(e,t){if(t>=e.display.viewTo)return null
|
|
405
|
+
if((t-=e.display.viewFrom)<0)return null
|
|
406
|
+
for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function fn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0)
|
|
407
|
+
var i=e.display
|
|
408
|
+
if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ct&&Bt(e.doc,t)<i.viewTo&&pn(e)
|
|
409
|
+
else if(r<=i.viewFrom)Ct&&jt(e.doc,r+n)>i.viewFrom?pn(e):(i.viewFrom+=n,i.viewTo+=n)
|
|
410
|
+
else if(t<=i.viewFrom&&r>=i.viewTo)pn(e)
|
|
411
|
+
else if(t<=i.viewFrom){var o=gn(e,r,r+n,1)
|
|
412
|
+
o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):pn(e)}else if(r>=i.viewTo){var a=gn(e,t,t,-1)
|
|
413
|
+
a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pn(e)}else{var l=gn(e,t,t,-1),s=gn(e,r,r+n,1)
|
|
414
|
+
l&&s?(i.view=i.view.slice(0,l.index).concat(or(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):pn(e)}var u=i.externalMeasured
|
|
415
|
+
u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function hn(e,t,r){e.curOp.viewChanged=!0
|
|
416
|
+
var n=e.display,i=e.display.externalMeasured
|
|
417
|
+
if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[dn(e,t)]
|
|
418
|
+
if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,r)&&a.push(r)}}}function pn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gn(e,t,r,n){var i,o=dn(e,t),a=e.display.view
|
|
419
|
+
if(!Ct||r==e.doc.first+e.doc.size)return{index:o,lineN:r}
|
|
420
|
+
for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size
|
|
421
|
+
if(l!=t){if(n>0){if(o==a.length-1)return null
|
|
422
|
+
i=l+a[o].size-t,o++}else i=l-t
|
|
423
|
+
t+=i,r+=i}for(;Bt(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null
|
|
424
|
+
r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function mn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n]
|
|
425
|
+
i.hidden||i.node&&!i.changes||++r}return r}function vn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function yn(e,t){void 0===t&&(t=!0)
|
|
426
|
+
for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var l=r.sel.ranges[a]
|
|
427
|
+
if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&bn(e,l.head,i),s||xn(e,l,o)}}return n}function bn(e,t,r){var n=_r(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(A("div"," ","CodeMirror-cursor"))
|
|
428
|
+
if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"))
|
|
429
|
+
o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function wn(e,t){return e.top-t.top||e.left-t.left}function xn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),a=Lr(e.display),l=a.left,s=Math.max(n.sizerWidth,Mr(e)-n.sizer.offsetLeft)-a.right,u="ltr"==i.direction
|
|
430
|
+
function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?s-e:r)+"px;\n height: "+(n-t)+"px"))}function d(t,r,n){var o,a,d=_e(i,t),f=d.text.length
|
|
431
|
+
function h(r,n){return qr(e,tt(t,r),"div",d,n)}function p(t,r,n){var i=Qr(e,d,null,t),o="ltr"==r==("after"==n)?"left":"right"
|
|
432
|
+
return h("after"==n?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var g=ce(d,i.direction)
|
|
433
|
+
return function(e,t,r,n){if(!e)return n(t,r,"ltr",0)
|
|
434
|
+
for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?f:n,(function(e,t,i,d){var m="ltr"==i,v=h(e,m?"left":"right"),y=h(t-1,m?"right":"left"),b=null==r&&0==e,w=null==n&&t==f,x=0==d,k=!g||d==g.length-1
|
|
435
|
+
if(y.top-v.top<=3){var C=(u?w:b)&&k,S=(u?b:w)&&x?l:(m?v:y).left,L=C?s:(m?y:v).right
|
|
436
|
+
c(S,v.top,L-S,v.bottom)}else{var T,M,N,A
|
|
437
|
+
m?(T=u&&b&&x?l:v.left,M=u?s:p(e,i,"before"),N=u?l:p(t,i,"after"),A=u&&w&&k?s:y.right):(T=u?p(e,i,"before"):l,M=!u&&b&&x?s:v.right,N=!u&&w&&k?l:y.left,A=u?p(t,i,"after"):s),c(T,v.top,M-T,v.bottom),v.bottom<y.top&&c(l,v.bottom,null,y.top),c(N,y.top,A-N,y.bottom)}(!o||wn(v,o)<0)&&(o=v),wn(y,o)<0&&(o=y),(!a||wn(v,a)<0)&&(a=v),wn(y,a)<0&&(a=y)})),{start:o,end:a}}var f=t.from(),h=t.to()
|
|
438
|
+
if(f.line==h.line)d(f.line,f.ch,h.ch)
|
|
439
|
+
else{var p=_e(i,f.line),g=_e(i,h.line),m=Rt(p)==Rt(g),v=d(f.line,f.ch,m?p.text.length+1:null).end,y=d(h.line,m?0:null,h.ch).start
|
|
440
|
+
m&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(l,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(l,v.bottom,null,y.top)}r.appendChild(o)}function kn(e){if(e.state.focused){var t=e.display
|
|
441
|
+
clearInterval(t.blinker)
|
|
442
|
+
var r=!0
|
|
443
|
+
t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cn(e){e.state.focused||(e.display.input.focus(),Ln(e))}function Sn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Tn(e))}),100)}function Ln(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),kn(e))}function Tn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Mn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,s=void 0,u=0
|
|
444
|
+
if(!i.hidden){if(a&&l<8){var c=i.node.offsetTop+i.node.offsetHeight
|
|
445
|
+
s=c-r,r=c}else{var d=i.node.getBoundingClientRect()
|
|
446
|
+
s=d.bottom-d.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-s
|
|
447
|
+
if((f>.005||f<-.005)&&(Ye(i.line,s),Nn(i.line),i.rest))for(var h=0;h<i.rest.length;h++)Nn(i.rest[h])
|
|
448
|
+
if(u>e.display.sizerWidth){var p=Math.ceil(u/on(e.display))
|
|
449
|
+
p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Nn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode
|
|
450
|
+
n&&(r.height=n.offsetHeight)}}function An(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop
|
|
451
|
+
n=Math.floor(n-Cr(e))
|
|
452
|
+
var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=Qe(t,n),a=Qe(t,i)
|
|
453
|
+
if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line
|
|
454
|
+
l<o?(o=l,a=Qe(t,Gt(_e(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Qe(t,Gt(_e(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function On(e,t){var r=e.display,n=nn(e.display)
|
|
455
|
+
t.top<0&&(t.top=0)
|
|
456
|
+
var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Nr(e),a={}
|
|
457
|
+
t.bottom-t.top>o&&(t.bottom=t.top+o)
|
|
458
|
+
var l=e.doc.height+Sr(r),s=t.top<n,u=t.bottom>l-n
|
|
459
|
+
if(t.top<i)a.scrollTop=s?0:t.top
|
|
460
|
+
else if(t.bottom>i+o){var c=Math.min(t.top,(u?l:t.bottom)-o)
|
|
461
|
+
c!=i&&(a.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Mr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>f
|
|
462
|
+
return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Wn(e,t){null!=t&&(Pn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Dn(e){Pn(e)
|
|
463
|
+
var t=e.getCursor()
|
|
464
|
+
e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function zn(e,t,r){null==t&&null==r||Pn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Pn(e){var t=e.curOp.scrollToPos
|
|
465
|
+
t&&(e.curOp.scrollToPos=null,Hn(e,$r(e,t.from),$r(e,t.to),t.margin))}function Hn(e,t,r,n){var i=On(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n})
|
|
466
|
+
zn(e,i.scrollLeft,i.scrollTop)}function In(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||ui(e,{top:t}),En(e,t,!0),r&&ui(e),ii(e,100))}function En(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,fi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Rn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Sr(e.display))
|
|
467
|
+
return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Bn=function(e,t,r){this.cm=r
|
|
468
|
+
var n=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar")
|
|
469
|
+
n.tabIndex=i.tabIndex=-1,e(n),e(i),fe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}
|
|
470
|
+
Bn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth
|
|
471
|
+
if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0"
|
|
472
|
+
var i=e.viewHeight-(t?n:0)
|
|
473
|
+
this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0"
|
|
474
|
+
if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px"
|
|
475
|
+
var o=e.viewWidth-e.barLeft-(r?n:0)
|
|
476
|
+
this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0"
|
|
477
|
+
return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Bn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bn.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px"
|
|
478
|
+
this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Bn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Bn.prototype.clear=function(){var e=this.horiz.parentNode
|
|
479
|
+
e.removeChild(this.horiz),e.removeChild(this.vert)}
|
|
480
|
+
var jn=function(){}
|
|
481
|
+
function Vn(e,t){t||(t=Rn(e))
|
|
482
|
+
var r=e.display.barWidth,n=e.display.barHeight
|
|
483
|
+
Kn(e,t)
|
|
484
|
+
for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Mn(e),Kn(e,Rn(e)),r=e.display.barWidth,n=e.display.barHeight}function Kn(e,t){var r=e.display,n=r.scrollbars.update(t)
|
|
485
|
+
r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}jn.prototype.update=function(){return{bottom:0,right:0}},jn.prototype.setScrollLeft=function(){},jn.prototype.setScrollTop=function(){},jn.prototype.clear=function(){}
|
|
486
|
+
var Gn={native:Bn,null:jn}
|
|
487
|
+
function Un(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Gn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Fn(e,t):In(e,t)}),e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var qn=0
|
|
488
|
+
function _n(e){var t
|
|
489
|
+
e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qn},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function $n(e){var t=e.curOp
|
|
490
|
+
t&&function(e,t){var r=e.ownsGroup
|
|
491
|
+
if(r)try{!function(e){var t=e.delayedCallbacks,r=0
|
|
492
|
+
do{for(;r<t.length;r++)t[r].call(null)
|
|
493
|
+
for(var n=0;n<e.ops.length;n++){var i=e.ops[n]
|
|
494
|
+
if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{ar=null,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null
|
|
495
|
+
!function(e){for(var t=e.ops,r=0;r<t.length;r++)Xn(t[r])
|
|
496
|
+
for(var n=0;n<t.length;n++)Yn(t[n])
|
|
497
|
+
for(var i=0;i<t.length;i++)Zn(t[i])
|
|
498
|
+
for(var o=0;o<t.length;o++)Qn(t[o])
|
|
499
|
+
for(var a=0;a<t.length;a++)Jn(t[a])}(e)}(r)}}(t)}function Xn(e){var t=e.cm,r=t.display
|
|
500
|
+
!function(e){var t=e.display
|
|
501
|
+
!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Tr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Tr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&qt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yn(e){e.updatedDisplay=e.mustUpdate&&li(e.cm,e.update)}function Zn(e){var t=e.cm,r=t.display
|
|
502
|
+
e.updatedDisplay&&Mn(t),e.barMeasure=Rn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Or(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Qn(e){var t=e.cm
|
|
503
|
+
null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1)
|
|
504
|
+
var r=e.focus&&e.focus==D()
|
|
505
|
+
e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Vn(t,e.barMeasure),e.updatedDisplay&&di(t,e.barMeasure),e.selectionChanged&&kn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Cn(e.cm)}function Jn(e){var t=e.cm,r=t.display,n=t.doc
|
|
506
|
+
if(e.updatedDisplay&&si(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&En(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Fn(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,r,n){var i
|
|
507
|
+
null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?tt(t.line,t.ch+1,"before"):t)
|
|
508
|
+
for(var o=0;o<5;o++){var a=!1,l=_r(e,t),s=r&&r!=t?_r(e,r):l,u=On(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),c=e.doc.scrollTop,d=e.doc.scrollLeft
|
|
509
|
+
if(null!=u.scrollTop&&(In(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Fn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,st(n,e.scrollToPos.from),st(n,e.scrollToPos.to),e.scrollToPos.margin)
|
|
510
|
+
!function(e,t){if(!me(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null
|
|
511
|
+
if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;")
|
|
512
|
+
e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers
|
|
513
|
+
if(o)for(var l=0;l<o.length;++l)o[l].lines.length||ge(o[l],"hide")
|
|
514
|
+
if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&ge(a[s],"unhide")
|
|
515
|
+
r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ei(e,t){if(e.curOp)return t()
|
|
516
|
+
_n(e)
|
|
517
|
+
try{return t()}finally{$n(e)}}function ti(e,t){return function(){if(e.curOp)return t.apply(e,arguments)
|
|
518
|
+
_n(e)
|
|
519
|
+
try{return t.apply(e,arguments)}finally{$n(e)}}}function ri(e){return function(){if(this.curOp)return e.apply(this,arguments)
|
|
520
|
+
_n(this)
|
|
521
|
+
try{return e.apply(this,arguments)}finally{$n(this)}}}function ni(e){return function(){var t=this.cm
|
|
522
|
+
if(!t||t.curOp)return e.apply(this,arguments)
|
|
523
|
+
_n(t)
|
|
524
|
+
try{return e.apply(this,arguments)}finally{$n(t)}}}function ii(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(oi,e))}function oi(e){var t=e.doc
|
|
525
|
+
if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=pt(e,t.highlightFrontier),i=[]
|
|
526
|
+
t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Ke(t.mode,n.state):null,s=ft(e,o,n,!0)
|
|
527
|
+
l&&(n.state=l),o.styles=s.styles
|
|
528
|
+
var u=o.styleClasses,c=s.classes
|
|
529
|
+
c?o.styleClasses=c:u&&(o.styleClasses=null)
|
|
530
|
+
for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f]
|
|
531
|
+
d&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&>(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine()
|
|
532
|
+
if(+new Date>r)return ii(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ei(e,(function(){for(var t=0;t<i.length;t++)hn(e,i[t],"text")}))}}var ai=function(e,t,r){var n=e.display
|
|
533
|
+
this.viewport=t,this.visible=An(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=r,this.dims=an(e),this.events=[]}
|
|
534
|
+
function li(e,t){var r=e.display,n=e.doc
|
|
535
|
+
if(t.editorIsHidden)return pn(e),!1
|
|
536
|
+
if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==mn(e))return!1
|
|
537
|
+
hi(e)&&(pn(e),t.dims=an(e))
|
|
538
|
+
var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin)
|
|
539
|
+
r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Ct&&(o=Bt(e.doc,o),a=jt(e.doc,a))
|
|
540
|
+
var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth
|
|
541
|
+
!function(e,t,r){var n=e.display
|
|
542
|
+
0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=or(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(dn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(or(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,dn(e,r)))),n.viewTo=r}(e,o,a),r.viewOffset=Gt(_e(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px"
|
|
543
|
+
var u=mn(e)
|
|
544
|
+
if(!l&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1
|
|
545
|
+
var c=function(e){if(e.hasFocus())return null
|
|
546
|
+
var t=D()
|
|
547
|
+
if(!t||!W(e.display.lineDiv,t))return null
|
|
548
|
+
var r={activeElt:t}
|
|
549
|
+
if(window.getSelection){var n=window.getSelection()
|
|
550
|
+
n.anchorNode&&n.extend&&W(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e)
|
|
551
|
+
return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild
|
|
552
|
+
function l(t){var r=t.nextSibling
|
|
553
|
+
return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,d=0;d<u.length;d++){var f=u[d]
|
|
554
|
+
if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=l(a)
|
|
555
|
+
var h=i&&null!=t&&t<=c&&f.lineNumber
|
|
556
|
+
f.changes&&(B(f.changes,"gutter")>-1&&(h=!1),cr(e,f,c,r)),h&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(et(e.options,c)))),a=f.node.nextSibling}else{var p=vr(e,f,c,r)
|
|
557
|
+
o.insertBefore(p,a)}c+=f.size}for(;a;)a=l(a)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),e.anchorNode&&W(document.body,e.anchorNode)&&W(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange()
|
|
558
|
+
r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ii(e,400)),r.updateLineNumbers=null,!0}function si(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Mr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Sr(e.display)-Nr(e),r.top)}),t.visible=An(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&li(e,t);n=!1){Mn(e)
|
|
559
|
+
var i=Rn(e)
|
|
560
|
+
vn(e),Vn(e,i),di(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ui(e,t){var r=new ai(e,t)
|
|
561
|
+
if(li(e,r)){Mn(e),si(e,r)
|
|
562
|
+
var n=Rn(e)
|
|
563
|
+
vn(e),Vn(e,n),di(e,n),r.finish()}}function ci(e){var t=e.gutters.offsetWidth
|
|
564
|
+
e.sizer.style.marginLeft=t+"px"}function di(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tr(e)+"px"}function fi(e){var t=e.display,r=t.view
|
|
565
|
+
if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=ln(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o))
|
|
566
|
+
var l=r[a].alignable
|
|
567
|
+
if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function hi(e){if(!e.options.lineNumbers)return!1
|
|
568
|
+
var t=e.doc,r=et(e.options,t.first+t.size-1),n=e.display
|
|
569
|
+
if(r.length!=n.lineNumChars){var i=n.measure.appendChild(A("div",[A("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o
|
|
570
|
+
return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ci(e.display),!0}return!1}function pi(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],a=null
|
|
571
|
+
if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue
|
|
572
|
+
n=!0}r.push({className:o,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function gi(e){var t=e.gutters,r=e.gutterSpecs
|
|
573
|
+
M(t),e.lineGutter=null
|
|
574
|
+
for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,l=t.appendChild(A("div",null,"CodeMirror-gutter "+o))
|
|
575
|
+
a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",ci(e)}function mi(e){gi(e.display),fn(e),fi(e)}function vi(e,t,n,i){var o=this
|
|
576
|
+
this.input=n,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=O("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=O("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none")
|
|
577
|
+
var u=O("div",[o.lineSpace],"CodeMirror-lines")
|
|
578
|
+
o.mover=A("div",[u],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+j+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||r&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pi(i.gutters,i.lineNumbers),gi(o),n.init(o)}ai.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.apply(null,this.events[e])}
|
|
579
|
+
var yi=0,bi=null
|
|
580
|
+
function wi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY
|
|
581
|
+
return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function xi(e){var t=wi(e)
|
|
582
|
+
return t.x*=bi,t.y*=bi,t}function ki(e,t){var n=wi(t),i=n.x,o=n.y,a=e.display,l=a.scroller,u=l.scrollWidth>l.clientWidth,c=l.scrollHeight>l.clientHeight
|
|
583
|
+
if(i&&u||o&&c){if(o&&y&&s)e:for(var f=t.target,h=a.view;f!=l;f=f.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==f){e.display.currentWheelTarget=f
|
|
584
|
+
break e}if(i&&!r&&!d&&null!=bi)return o&&c&&In(e,Math.max(0,l.scrollTop+o*bi)),Fn(e,Math.max(0,l.scrollLeft+i*bi)),(!o||o&&c)&&we(t),void(a.wheelStartX=null)
|
|
585
|
+
if(o&&null!=bi){var g=o*bi,m=e.doc.scrollTop,v=m+a.wrapper.clientHeight
|
|
586
|
+
g<0?m=Math.max(0,m+g-50):v=Math.min(e.doc.height,v+g+50),ui(e,{top:m,bottom:v})}yi<20&&(null==a.wheelStartX?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=l.scrollLeft-a.wheelStartX,t=l.scrollTop-a.wheelStartY,r=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX
|
|
587
|
+
a.wheelStartX=a.wheelStartY=null,r&&(bi=(bi*yi+r)/(yi+1),++yi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?bi=-.53:r?bi=15:c?bi=-.7:f&&(bi=-1/3)
|
|
588
|
+
var Ci=function(e,t){this.ranges=e,this.primIndex=t}
|
|
589
|
+
Ci.prototype.primary=function(){return this.ranges[this.primIndex]},Ci.prototype.equals=function(e){if(e==this)return!0
|
|
590
|
+
if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1
|
|
591
|
+
for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t]
|
|
592
|
+
if(!nt(r.anchor,n.anchor)||!nt(r.head,n.head))return!1}return!0},Ci.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Si(it(this.ranges[t].anchor),it(this.ranges[t].head))
|
|
593
|
+
return new Ci(e,this.primIndex)},Ci.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0
|
|
594
|
+
return!1},Ci.prototype.contains=function(e,t){t||(t=e)
|
|
595
|
+
for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r]
|
|
596
|
+
if(rt(t,n.from())>=0&&rt(e,n.to())<=0)return r}return-1}
|
|
597
|
+
var Si=function(e,t){this.anchor=e,this.head=t}
|
|
598
|
+
function Li(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r]
|
|
599
|
+
t.sort((function(e,t){return rt(e.from(),t.from())})),r=B(t,i)
|
|
600
|
+
for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=rt(l.to(),a.from())
|
|
601
|
+
if(n&&!a.empty()?s>0:s>=0){var u=at(l.from(),a.from()),c=ot(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head
|
|
602
|
+
o<=r&&--r,t.splice(--o,2,new Si(d?c:u,d?u:c))}}return new Ci(t,r)}function Ti(e,t){return new Ci([new Si(e,t||e)],0)}function Mi(e){return e.text?tt(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ni(e,t){if(rt(e,t.from)<0)return e
|
|
603
|
+
if(rt(e,t.to)<=0)return Mi(t)
|
|
604
|
+
var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch
|
|
605
|
+
return e.line==t.to.line&&(n+=Mi(t).ch-t.to.ch),tt(r,n)}function Ai(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n]
|
|
606
|
+
r.push(new Si(Ni(i.anchor,t),Ni(i.head,t)))}return Li(e.cm,r,e.sel.primIndex)}function Oi(e,t,r){return e.line==t.line?tt(r.line,e.ch-t.ch+r.ch):tt(r.line+(e.line-t.line),e.ch)}function Wi(e){e.doc.mode=Be(e.options,e.doc.modeOption),Di(e)}function Di(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ii(e,100),e.state.modeGen++,e.curOp&&fn(e)}function zi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Pi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),At(e),Ot(e,r)
|
|
607
|
+
var i=n?n(e):1
|
|
608
|
+
i!=e.height&&Ye(e,i)}(e,r,i,n),sr(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new _t(u[o],i(o),n))
|
|
609
|
+
return r}var l=t.from,s=t.to,u=t.text,c=_e(e,l.line),d=_e(e,s.line),f=X(u),h=i(u.length-1),p=s.line-l.line
|
|
610
|
+
if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length)
|
|
611
|
+
else if(zi(e,t)){var g=a(0,u.length-1)
|
|
612
|
+
o(d,d.text,h),p&&e.remove(l.line,p),g.length&&e.insert(l.line,g)}else if(c==d)if(1==u.length)o(c,c.text.slice(0,l.ch)+f+c.text.slice(s.ch),h)
|
|
613
|
+
else{var m=a(1,u.length-1)
|
|
614
|
+
m.push(new _t(f+c.text.slice(s.ch),h,n)),o(c,c.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,l.ch)+u[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p)
|
|
615
|
+
else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(d,f+d.text.slice(s.ch),h)
|
|
616
|
+
var v=a(1,u.length-1)
|
|
617
|
+
p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}sr(e,"change",e,t)}function Hi(e,t,r){!function e(n,i,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var l=n.linked[a]
|
|
618
|
+
if(l.doc!=i){var s=o&&l.sharedHist
|
|
619
|
+
r&&!s||(t(l.doc,s),e(l.doc,n,s))}}}(e,null,!0)}function Ii(e,t){if(t.cm)throw new Error("This document is already in use.")
|
|
620
|
+
e.doc=t,t.cm=e,un(e),Wi(e),Ei(e),e.options.lineWrapping||qt(e),e.options.mode=t.modeOption,fn(e)}function Ei(e){("rtl"==e.doc.direction?z:T)(e.display.lineDiv,"CodeMirror-rtl")}function Fi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ri(e,t){var r={from:it(t.from),to:Mi(t),text:$e(e,t.from,t.to)}
|
|
621
|
+
return Ki(e,r,t.from.line,t.to.line+1),Hi(e,(function(e){return Ki(e,r,t.from.line,t.to.line+1)}),!0),r}function Bi(e){for(;e.length&&X(e).ranges;)e.pop()}function ji(e,t,r,n){var i=e.history
|
|
622
|
+
i.undone.length=0
|
|
623
|
+
var o,a,l=+new Date
|
|
624
|
+
if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Bi(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}(i,i.lastOp==n)))a=X(o.changes),0==rt(t.from,t.to)&&0==rt(t.from,a.to)?a.to=Mi(t):o.changes.push(Ri(e,t))
|
|
625
|
+
else{var s=X(i.done)
|
|
626
|
+
for(s&&s.ranges||Vi(e.sel,i.done),o={changes:[Ri(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||ge(e,"historyAdded")}function Vi(e,t){var r=X(t)
|
|
627
|
+
r&&r.ranges&&r.equals(e)||t.push(e)}function Ki(e,t,r,n){var i=t["spans_"+e.id],o=0
|
|
628
|
+
e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Gi(e){if(!e)return null
|
|
629
|
+
for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r])
|
|
630
|
+
return t?t.length?t:null:e}function Ui(e,t){var r=function(e,t){var r=t["spans_"+e.id]
|
|
631
|
+
if(!r)return null
|
|
632
|
+
for(var n=[],i=0;i<t.text.length;++i)n.push(Gi(r[i]))
|
|
633
|
+
return n}(e,t),n=Mt(e,t)
|
|
634
|
+
if(!r)return n
|
|
635
|
+
if(!n)return r
|
|
636
|
+
for(var i=0;i<r.length;++i){var o=r[i],a=n[i]
|
|
637
|
+
if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e
|
|
638
|
+
o.push(s)}else a&&(r[i]=a)}return r}function qi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i]
|
|
639
|
+
if(o.ranges)n.push(r?Ci.prototype.deepCopy.call(o):o)
|
|
640
|
+
else{var a=o.changes,l=[]
|
|
641
|
+
n.push({changes:l})
|
|
642
|
+
for(var s=0;s<a.length;++s){var u=a[s],c=void 0
|
|
643
|
+
if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&B(t,Number(c[1]))>-1&&(X(l)[d]=u[d],delete u[d])}}}return n}function _i(e,t,r,n){if(n){var i=e.anchor
|
|
644
|
+
if(r){var o=rt(t,i)<0
|
|
645
|
+
o!=rt(r,i)<0?(i=t,t=r):o!=rt(t,r)<0&&(t=r)}return new Si(i,t)}return new Si(r||t,t)}function $i(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ji(e,new Ci([_i(e.sel.primary(),t,r,i)],0),n)}function Xi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=_i(e.sel.ranges[o],t[o],null,i)
|
|
646
|
+
Ji(e,Li(e.cm,n,e.sel.primIndex),r)}function Yi(e,t,r,n){var i=e.sel.ranges.slice(0)
|
|
647
|
+
i[t]=r,Ji(e,Li(e.cm,i,e.sel.primIndex),n)}function Zi(e,t,r,n){Ji(e,Ti(t,r),n)}function Qi(e,t,r){var n=e.history.done,i=X(n)
|
|
648
|
+
i&&i.ranges?(n[n.length-1]=t,eo(e,t,r)):Ji(e,t,r)}function Ji(e,t,r){eo(e,t,r),function(e,t,r,n){var i=e.history,o=n&&n.origin
|
|
649
|
+
r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0)
|
|
650
|
+
return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Vi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Bi(i.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function eo(e,t,r){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[]
|
|
651
|
+
for(var r=0;r<t.length;r++)this.ranges[r]=new Si(st(e,t[r].anchor),st(e,t[r].head))},origin:r&&r.origin}
|
|
652
|
+
return ge(e,"beforeSelectionChange",e,n),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Li(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r))
|
|
653
|
+
var n=r&&r.bias||(rt(t.primary().head,e.sel.primary().head)<0?-1:1)
|
|
654
|
+
to(e,no(e,t,n,!0)),r&&!1===r.scroll||!e.cm||Dn(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),sr(e,"cursorActivity",e))}function ro(e){to(e,no(e,e.sel,null,!1))}function no(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=oo(e,a.anchor,l&&l.anchor,r,n),u=oo(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(s,u))}return i?Li(e.cm,i,t.primIndex):t}function io(e,t,r,n,i){var o=_e(e,t.line)
|
|
655
|
+
if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight
|
|
656
|
+
if((null==l.from||(u?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(c?l.to>=t.ch:l.to>t.ch))){if(i&&(ge(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a
|
|
657
|
+
continue}break}if(!s.atomic)continue
|
|
658
|
+
if(r){var d=s.find(n<0?1:-1),f=void 0
|
|
659
|
+
if((n<0?c:u)&&(d=ao(e,d,-n,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=rt(d,r))&&(n<0?f<0:f>0))return io(e,d,t,n,i)}var h=s.find(n<0?-1:1)
|
|
660
|
+
return(n<0?u:c)&&(h=ao(e,h,n,h.line==t.line?o:null)),h?io(e,h,t,n,i):null}}return t}function oo(e,t,r,n,i){var o=n||1
|
|
661
|
+
return io(e,t,r,o,i)||!i&&io(e,t,r,o,!0)||io(e,t,r,-o,i)||!i&&io(e,t,r,-o,!0)||(e.cantEdit=!0,tt(e.first,0))}function ao(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?st(e,tt(t.line-1)):null:r>0&&t.ch==(n||_e(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+r)}function lo(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),K)}function so(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}}
|
|
662
|
+
return r&&(n.update=function(t,r,i,o){t&&(n.from=st(e,t)),r&&(n.to=st(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),ge(e,"beforeChange",e,n),e.cm&&ge(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function uo(e,t,r){if(e.cm){if(!e.cm.curOp)return ti(e.cm,uo)(e,t,r)
|
|
663
|
+
if(e.cm.state.suppressEdits)return}if(!(ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))||(t=so(e,t,!0))){var n=kt&&!r&&function(e,t,r){var n=null
|
|
664
|
+
if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker
|
|
665
|
+
!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null
|
|
666
|
+
for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s]
|
|
667
|
+
if(!(rt(u.to,l.from)<0||rt(u.from,l.to)>0)){var c=[s,1],d=rt(u.from,l.from),f=rt(u.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:l.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}(e,t.from,t.to)
|
|
668
|
+
if(n)for(var i=n.length-1;i>=0;--i)co(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin})
|
|
669
|
+
else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=rt(t.from,t.to)){var r=Ai(e,t)
|
|
670
|
+
ji(e,t,r,e.cm?e.cm.curOp.id:NaN),po(e,t,r,Mt(e,t))
|
|
671
|
+
var n=[]
|
|
672
|
+
Hi(e,(function(e,r){r||-1!=B(n,e.history)||(yo(e.history,t),n.push(e.history)),po(e,t,null,Mt(e,t))}))}}function fo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits
|
|
673
|
+
if(!n||r){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<l.length&&(i=l[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(n)return void l.push(i)
|
|
674
|
+
break}if(Vi(i,s),r&&!i.equals(e.sel))return void Ji(e,i,{clearRedo:!1})
|
|
675
|
+
a=i}var c=[]
|
|
676
|
+
Vi(a,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration
|
|
677
|
+
for(var d=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),f=function(r){var n=i.changes[r]
|
|
678
|
+
if(n.origin=t,d&&!so(e,n,!1))return l.length=0,{}
|
|
679
|
+
c.push(Ri(e,n))
|
|
680
|
+
var o=r?Ai(e,n):X(l)
|
|
681
|
+
po(e,n,o,Ui(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:Mi(n)})
|
|
682
|
+
var a=[]
|
|
683
|
+
Hi(e,(function(e,t){t||-1!=B(a,e.history)||(yo(e.history,n),a.push(e.history)),po(e,n,null,Ui(e,n))}))},h=i.changes.length-1;h>=0;--h){var p=f(h)
|
|
684
|
+
if(p)return p.v}}}}function ho(e,t){if(0!=t&&(e.first+=t,e.sel=new Ci(Y(e.sel.ranges,(function(e){return new Si(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fn(e.cm,e.first,e.first-t,t)
|
|
685
|
+
for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)hn(e.cm,n,"gutter")}}function po(e,t,r,n){if(e.cm&&!e.cm.curOp)return ti(e.cm,po)(e,t,r,n)
|
|
686
|
+
if(t.to.line<e.first)ho(e,t.text.length-1-(t.to.line-t.from.line))
|
|
687
|
+
else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line)
|
|
688
|
+
ho(e,i),t={from:tt(e.first,0),to:tt(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine()
|
|
689
|
+
t.to.line>o&&(t={from:t.from,to:tt(o,_e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$e(e,t.from,t.to),r||(r=Ai(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line
|
|
690
|
+
e.options.lineWrapping||(s=Ze(Rt(_e(n,o.line))),n.iter(s,a.line+1,(function(e){if(e==i.maxLine)return l=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ve(e),Pi(n,t,r,sn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,(function(e){var t=Ut(e)
|
|
691
|
+
t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=_e(e,n).stateAfter
|
|
692
|
+
if(i&&(!(i instanceof ct)||n+i.lookAhead<t)){r=n+1
|
|
693
|
+
break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,o.line),ii(e,400)
|
|
694
|
+
var u=t.text.length-(a.line-o.line)-1
|
|
695
|
+
t.full?fn(e):o.line!=a.line||1!=t.text.length||zi(e.doc,t)?fn(e,o.line,a.line+1,u):hn(e,o.line,"text")
|
|
696
|
+
var c=ye(e,"changes"),d=ye(e,"change")
|
|
697
|
+
if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin}
|
|
698
|
+
d&&sr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Pi(e,t,n),eo(e,r,K)}}function go(e,t,r,n,i){var o
|
|
699
|
+
n||(n=r),rt(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),uo(e,{from:r,to:n,text:t,origin:i})}function mo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0
|
|
700
|
+
if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0)
|
|
701
|
+
for(var l=0;l<o.ranges.length;l++)mo(o.ranges[l].anchor,t,r,n),mo(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s]
|
|
702
|
+
if(r<u.from.line)u.from=tt(u.from.line+n,u.from.ch),u.to=tt(u.to.line+n,u.to.ch)
|
|
703
|
+
else if(t<=u.to.line){a=!1
|
|
704
|
+
break}}a||(e.splice(0,i+1),i=0)}}}function yo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1
|
|
705
|
+
vo(e.done,r,n,i),vo(e.undone,r,n,i)}function bo(e,t,r,n){var i=t,o=t
|
|
706
|
+
return"number"==typeof t?o=_e(e,lt(e,t)):i=Ze(t),null==i?null:(n(o,i)&&e.cm&&hn(e.cm,i,r),o)}function wo(e){this.lines=e,this.parent=null
|
|
707
|
+
for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height
|
|
708
|
+
this.height=t}function xo(e){this.children=e
|
|
709
|
+
for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n]
|
|
710
|
+
t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Si.prototype.from=function(){return at(this.anchor,this.head)},Si.prototype.to=function(){return ot(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r]
|
|
711
|
+
this.height-=i.height,$t(i),sr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e))
|
|
712
|
+
for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},xo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this
|
|
713
|
+
this.size-=t
|
|
714
|
+
for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize()
|
|
715
|
+
if(e<o){var a=Math.min(t,o-e),l=i.height
|
|
716
|
+
if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break
|
|
717
|
+
e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wo))){var s=[]
|
|
718
|
+
this.collapse(s),this.children=[new wo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){var n=this
|
|
719
|
+
this.size+=t.length,this.height+=r
|
|
720
|
+
for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize()
|
|
721
|
+
if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var u=new wo(o.lines.slice(s,s+=25))
|
|
722
|
+
o.height-=u.height,n.children.splice(++i,0,u),u.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this
|
|
723
|
+
do{var t=new xo(e.children.splice(e.children.length-5,5))
|
|
724
|
+
if(e.parent){e.size-=t.size,e.height-=t.height
|
|
725
|
+
var r=B(e.parent.children,e)
|
|
726
|
+
e.parent.children.splice(r+1,0,t)}else{var n=new xo(e.children)
|
|
727
|
+
n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10)
|
|
728
|
+
e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize()
|
|
729
|
+
if(e<o){var a=Math.min(t,o-e)
|
|
730
|
+
if(i.iterN(e,a,r))return!0
|
|
731
|
+
if(0==(t-=a))break
|
|
732
|
+
e=0}else e-=o}}}
|
|
733
|
+
var ko=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n])
|
|
734
|
+
this.doc=e,this.node=t}
|
|
735
|
+
function Co(e,t,r){Gt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Wn(e,r)}ko.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Ze(r)
|
|
736
|
+
if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1)
|
|
737
|
+
t.length||(r.widgets=null)
|
|
738
|
+
var o=xr(this)
|
|
739
|
+
Ye(r,Math.max(0,r.height-o)),e&&(ei(e,(function(){Co(e,r,-o),hn(e,n,"widget")})),sr(e,"lineWidgetCleared",e,this,n))}},ko.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line
|
|
740
|
+
this.height=null
|
|
741
|
+
var i=xr(this)-t
|
|
742
|
+
i&&(Vt(this.doc,n)||Ye(n,n.height+i),r&&ei(r,(function(){r.curOp.forceUpdate=!0,Co(r,n,i),sr(r,"lineWidgetChanged",r,e,Ze(n))})))},be(ko)
|
|
743
|
+
var So=0,Lo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++So}
|
|
744
|
+
function To(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=E(n)).shared=!1
|
|
745
|
+
var o=[To(e,t,r,n,i)],a=o[0],l=n.widgetNode
|
|
746
|
+
return Hi(e,(function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(To(e,st(e,t),st(e,r),n,i))
|
|
747
|
+
for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return
|
|
748
|
+
a=X(o)})),new Mo(o,a)}(e,t,r,n,i)
|
|
749
|
+
if(e.cm&&!e.cm.curOp)return ti(e.cm,To)(e,t,r,n,i)
|
|
750
|
+
var o=new Lo(e,i),a=rt(t,r)
|
|
751
|
+
if(n&&E(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o
|
|
752
|
+
if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ft(e,t.line,t,r,o)||t.line!=r.line&&Ft(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one")
|
|
753
|
+
Ct=!0}o.addToHistory&&ji(e,{from:t,to:r,origin:"markText"},e.sel,NaN)
|
|
754
|
+
var l,s=t.line,u=e.cm
|
|
755
|
+
if(e.iter(s,r.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Rt(e)==u.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Ye(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new St(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Vt(e,t)&&Ye(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(kt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),u){if(l&&(u.curOp.updateMaxLine=!0),o.collapsed)fn(u,t.line,r.line+1)
|
|
756
|
+
else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)hn(u,c,"text")
|
|
757
|
+
o.atomic&&ro(u.doc),sr(u,"markerAdded",u,o)}return o}Lo.prototype.clear=function(){var e=this
|
|
758
|
+
if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp
|
|
759
|
+
if(r&&_n(t),ye(this,"clear")){var n=this.find()
|
|
760
|
+
n&&sr(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=Lt(l.markedSpans,e)
|
|
761
|
+
t&&!e.collapsed?hn(t,Ze(l),"text"):t&&(null!=s.to&&(o=Ze(l)),null!=s.from&&(i=Ze(l))),l.markedSpans=Tt(l.markedSpans,s),null==s.from&&e.collapsed&&!Vt(e.doc,l)&&t&&Ye(l,nn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var c=Rt(e.lines[u]),d=Ut(c)
|
|
762
|
+
d>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&fn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ro(t.doc)),t&&sr(t,"markerCleared",t,this,i,o),r&&$n(t),this.parent&&this.parent.clear()}},Lo.prototype.find=function(e,t){var r,n
|
|
763
|
+
null==e&&"bookmark"==this.type&&(e=1)
|
|
764
|
+
for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Lt(o.markedSpans,this)
|
|
765
|
+
if(null!=a.from&&(r=tt(t?o:Ze(o),a.from),-1==e))return r
|
|
766
|
+
if(null!=a.to&&(n=tt(t?o:Ze(o),a.to),1==e))return n}return r&&{from:r,to:n}},Lo.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm
|
|
767
|
+
t&&n&&ei(n,(function(){var i=t.line,o=Ze(t.line),a=Wr(n,o)
|
|
768
|
+
if(a&&(Fr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Vt(r.doc,i)&&null!=r.height){var l=r.height
|
|
769
|
+
r.height=null
|
|
770
|
+
var s=xr(r)-l
|
|
771
|
+
s&&Ye(i,i.height+s)}sr(n,"markerChanged",n,e)}))},Lo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp
|
|
772
|
+
t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Lo.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(Lo)
|
|
773
|
+
var Mo=function(e,t){this.markers=e,this.primary=t
|
|
774
|
+
for(var r=0;r<e.length;++r)e[r].parent=this}
|
|
775
|
+
function No(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),(function(e){return e.parent}))}function Ao(e){for(var t=function(t){var r=e[t],n=[r.primary.doc]
|
|
776
|
+
Hi(r.primary.doc,(function(e){return n.push(e)}))
|
|
777
|
+
for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==B(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}Mo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0
|
|
778
|
+
for(var e=0;e<this.markers.length;++e)this.markers[e].clear()
|
|
779
|
+
sr(this,"clear")}},Mo.prototype.find=function(e,t){return this.primary.find(e,t)},be(Mo)
|
|
780
|
+
var Oo=0,Wo=function(e,t,r,n,i){if(!(this instanceof Wo))return new Wo(e,t,r,n,i)
|
|
781
|
+
null==r&&(r=0),xo.call(this,[new wo([new _t("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r
|
|
782
|
+
var o=tt(r,0)
|
|
783
|
+
this.sel=Ti(o),this.history=new Fi(null),this.id=++Oo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Pi(this,{from:o,to:o,text:e}),Ji(this,Ti(o),K)}
|
|
784
|
+
Wo.prototype=Q(xo.prototype,{constructor:Wo,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height
|
|
785
|
+
this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Xe(this,this.first,this.first+this.size)
|
|
786
|
+
return!1===e?t:t.join(e||this.lineSeparator())},setValue:ni((function(e){var t=tt(this.first,0),r=this.first+this.size-1
|
|
787
|
+
uo(this,{from:t,to:tt(r,_e(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&zn(this.cm,0,0),Ji(this,Ti(t),K)})),replaceRange:function(e,t,r,n){go(this,e,t=st(this,t),r=r?st(this,r):t,n)},getRange:function(e,t,r){var n=$e(this,st(this,e),st(this,t))
|
|
788
|
+
return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e)
|
|
789
|
+
return t&&t.text},getLineHandle:function(e){if(Je(this,e))return _e(this,e)},getLineNumber:function(e){return Ze(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=_e(this,e)),Rt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary()
|
|
790
|
+
return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(e,t,r){Zi(this,st(this,"number"==typeof e?tt(e,t||0):e),null,r)})),setSelection:ni((function(e,t,r){Zi(this,st(this,e),st(this,t||e),r)})),extendSelection:ni((function(e,t,r){$i(this,st(this,e),t&&st(this,t),r)})),extendSelections:ni((function(e,t){Xi(this,ut(this,e),t)})),extendSelectionsBy:ni((function(e,t){Xi(this,ut(this,Y(this.sel.ranges,e)),t)})),setSelections:ni((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Si(st(this,e[i].anchor),st(this,e[i].head))
|
|
791
|
+
null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ji(this,Li(this.cm,n,t),r)}})),addSelection:ni((function(e,t,r){var n=this.sel.ranges.slice(0)
|
|
792
|
+
n.push(new Si(st(this,e),st(this,t||e))),Ji(this,Li(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=$e(this,r[n].from(),r[n].to())
|
|
793
|
+
t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=$e(this,r[n].from(),r[n].to())
|
|
794
|
+
!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e
|
|
795
|
+
this.replaceSelections(n,t,r||"+input")},replaceSelections:ni((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o]
|
|
796
|
+
n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=tt(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Oi(l.from,i,o),u=Oi(Mi(l),i,o)
|
|
797
|
+
if(i=l.to,o=u,"around"==r){var c=e.sel.ranges[a],d=rt(c.head,c.anchor)<0
|
|
798
|
+
n[a]=new Si(d?u:s,d?s:u)}else n[a]=new Si(s,s)}return new Ci(n,e.sel.primIndex)}(this,n,t),s=n.length-1;s>=0;s--)uo(this,n[s])
|
|
799
|
+
l?Qi(this,l):this.cm&&Dn(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t
|
|
800
|
+
for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r
|
|
801
|
+
return{undo:t,redo:r}},clearHistory:function(){this.history=new Fi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:qi(this.history.done),undone:qi(this.history.undone)}},setHistory:function(e){var t=this.history=new Fi(this.history.maxGeneration)
|
|
802
|
+
t.done=qi(e.done.slice(0),null,!0),t.undone=qi(e.undone.slice(0),null,!0)},setGutterMarker:ni((function(e,t,r){return bo(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={})
|
|
803
|
+
return n[t]=r,!r&&re(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ni((function(e){var t=this
|
|
804
|
+
this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&bo(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,re(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t
|
|
805
|
+
if("number"==typeof e){if(!Je(this,e))return null
|
|
806
|
+
if(t=e,!(e=_e(this,e)))return null}else if(null==(t=Ze(e)))return null
|
|
807
|
+
return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ni((function(e,t,r){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass"
|
|
808
|
+
if(e[n]){if(S(r).test(e[n]))return!1
|
|
809
|
+
e[n]+=" "+r}else e[n]=r
|
|
810
|
+
return!0}))})),removeLineClass:ni((function(e,t,r){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n]
|
|
811
|
+
if(!i)return!1
|
|
812
|
+
if(null==r)e[n]=null
|
|
813
|
+
else{var o=i.match(S(r))
|
|
814
|
+
if(!o)return!1
|
|
815
|
+
var a=o.index+o[0].length
|
|
816
|
+
e[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ni((function(e,t,r){return function(e,t,r,n){var i=new ko(e,r,n),o=e.cm
|
|
817
|
+
return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[])
|
|
818
|
+
if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Vt(e,t)){var n=Gt(t)<e.scrollTop
|
|
819
|
+
Ye(t,t.height+xr(i)),n&&Wn(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&sr(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Ze(t)),i}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return To(this,st(this,e),st(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents}
|
|
820
|
+
return To(this,e=st(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=_e(this,(e=st(this,e)).line).markedSpans
|
|
821
|
+
if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=st(this,e),t=st(this,t)
|
|
822
|
+
var n=[],i=e.line
|
|
823
|
+
return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans
|
|
824
|
+
if(a)for(var l=0;l<a.length;l++){var s=a[l]
|
|
825
|
+
null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i})),n},getAllMarks:function(){var e=[]
|
|
826
|
+
return this.iter((function(t){var r=t.markedSpans
|
|
827
|
+
if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length
|
|
828
|
+
return this.iter((function(i){var o=i.text.length+n
|
|
829
|
+
if(o>e)return t=e,!0
|
|
830
|
+
e-=o,++r})),st(this,tt(r,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch
|
|
831
|
+
if(e.line<this.first||e.ch<0)return 0
|
|
832
|
+
var r=this.lineSeparator().length
|
|
833
|
+
return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Wo(Xe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction)
|
|
834
|
+
return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={})
|
|
835
|
+
var t=this.first,r=this.first+this.size
|
|
836
|
+
null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to)
|
|
837
|
+
var n=new Wo(Xe(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction)
|
|
838
|
+
return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to)
|
|
839
|
+
if(rt(o,a)){var l=To(e,o,a,n.primary,n.primary.type)
|
|
840
|
+
n.markers.push(l),l.parent=n}}}(n,No(this)),n},unlinkDoc:function(e){var t=this
|
|
841
|
+
if(e instanceof La&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r)if(t.linked[r].doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Ao(No(t))
|
|
842
|
+
break}if(e.history==this.history){var n=[e.id]
|
|
843
|
+
Hi(e,(function(e){return n.push(e.id)}),!0),e.history=new Fi(null),e.history.done=qi(this.history.done,n),e.history.undone=qi(this.history.undone,n)}},iterLinkedDocs:function(e){Hi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(e){var t
|
|
844
|
+
"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&ei(t=this.cm,(function(){Ei(t),fn(t)})))}))}),Wo.prototype.eachLine=Wo.prototype.iter
|
|
845
|
+
var Do=0
|
|
846
|
+
function zo(e){var t=this
|
|
847
|
+
if(Po(t),!me(t,e)&&!kr(t.display,e)){we(e),a&&(Do=+new Date)
|
|
848
|
+
var r=cn(t,e,!0),n=e.dataTransfer.files
|
|
849
|
+
if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){if(!t.options.allowDropFileTypes||-1!=B(t.options.allowDropFileTypes,e.type)){var a=new FileReader
|
|
850
|
+
a.onload=ti(t,(function(){var e=a.result
|
|
851
|
+
if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){var s={from:r=st(t.doc,r),to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"}
|
|
852
|
+
uo(t.doc,s),Qi(t.doc,Ti(r,Mi(s)))}})),a.readAsText(e)}},u=0;u<i;++u)s(n[u],u)
|
|
853
|
+
else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20)
|
|
854
|
+
try{var c=e.dataTransfer.getData("Text")
|
|
855
|
+
if(c){var d
|
|
856
|
+
if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,Ti(r,r)),d)for(var f=0;f<d.length;++f)go(t.doc,"",d[f].anchor,d[f].head,"drag")
|
|
857
|
+
t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Po(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ho(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror
|
|
858
|
+
i&&r.push(i)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Io=!1
|
|
859
|
+
function Eo(e){var t=e.display
|
|
860
|
+
t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Fo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ro=0;Ro<10;Ro++)Fo[Ro+48]=Fo[Ro+96]=String(Ro)
|
|
861
|
+
for(var Bo=65;Bo<=90;Bo++)Fo[Bo]=String.fromCharCode(Bo)
|
|
862
|
+
for(var jo=1;jo<=12;jo++)Fo[jo+111]=Fo[jo+63235]="F"+jo
|
|
863
|
+
var Vo={}
|
|
864
|
+
function Ko(e){var t,r,n,i,o=e.split(/-(?!$)/)
|
|
865
|
+
e=o[o.length-1]
|
|
866
|
+
for(var a=0;a<o.length-1;a++){var l=o[a]
|
|
867
|
+
if(/^(cmd|meta|m)$/i.test(l))i=!0
|
|
868
|
+
else if(/^a(lt)?$/i.test(l))t=!0
|
|
869
|
+
else if(/^(c|ctrl|control)$/i.test(l))r=!0
|
|
870
|
+
else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l)
|
|
871
|
+
n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Go(e){var t={}
|
|
872
|
+
for(var r in e)if(e.hasOwnProperty(r)){var n=e[r]
|
|
873
|
+
if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue
|
|
874
|
+
if("..."==n){delete e[r]
|
|
875
|
+
continue}for(var i=Y(r.split(" "),Ko),o=0;o<i.length;o++){var a=void 0,l=void 0
|
|
876
|
+
o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...")
|
|
877
|
+
var s=t[l]
|
|
878
|
+
if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var u in t)e[u]=t[u]
|
|
879
|
+
return e}function Uo(e,t,r,n){var i=(t=Xo(t)).call?t.call(e,n):t[e]
|
|
880
|
+
if(!1===i)return"nothing"
|
|
881
|
+
if("..."===i)return"multi"
|
|
882
|
+
if(null!=i&&r(i))return"handled"
|
|
883
|
+
if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Uo(e,t.fallthrough,r,n)
|
|
884
|
+
for(var o=0;o<t.fallthrough.length;o++){var a=Uo(e,t.fallthrough[o],r,n)
|
|
885
|
+
if(a)return a}}}function qo(e){var t="string"==typeof e?e:Fo[e.keyCode]
|
|
886
|
+
return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function _o(e,t,r){var n=e
|
|
887
|
+
return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function $o(e,t){if(d&&34==e.keyCode&&e.char)return!1
|
|
888
|
+
var r=Fo[e.keyCode]
|
|
889
|
+
return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),_o(r,e,t))}function Xo(e){return"string"==typeof e?Vo[e]:e}function Yo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&rt(o.from,X(n).to)<=0;){var a=n.pop()
|
|
890
|
+
if(rt(a.from,o.from)<0){o.from=a.from
|
|
891
|
+
break}}n.push(o)}ei(e,(function(){for(var t=n.length-1;t>=0;t--)go(e.doc,"",n[t].from,n[t].to,"+delete")
|
|
892
|
+
Dn(e)}))}function Zo(e,t,r){var n=oe(e.text,t+r,r)
|
|
893
|
+
return n<0||n>e.text.length?null:n}function Qo(e,t,r){var n=Zo(e,t.ch,r)
|
|
894
|
+
return null==n?null:new tt(t.line,n,r<0?"after":"before")}function Jo(e,t,r,n,i){if(e){var o=ce(r,t.doc.direction)
|
|
895
|
+
if(o){var a,l=i<0?X(o):o[0],s=i<0==(1==l.level)?"after":"before"
|
|
896
|
+
if(l.level>0||"rtl"==t.doc.direction){var u=Dr(t,r)
|
|
897
|
+
a=i<0?r.text.length-1:0
|
|
898
|
+
var c=zr(t,u,a).top
|
|
899
|
+
a=ae((function(e){return zr(t,u,e).top==c}),i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Zo(r,a,1))}else a=i<0?l.to:l.from
|
|
900
|
+
return new tt(n,a,s)}}return new tt(n,i<0?r.text.length:0,i<0?"before":"after")}Vo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vo.default=y?Vo.macDefault:Vo.pcDefault
|
|
901
|
+
var ea={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),K)},killLine:function(e){return Yo(e,(function(t){if(t.empty()){var r=_e(e.doc,t.head.line).text.length
|
|
902
|
+
return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Yo(e,(function(t){return{from:tt(t.from().line,0),to:st(e.doc,tt(t.to().line+1,0))}}))},delLineLeft:function(e){return Yo(e,(function(e){return{from:tt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Yo(e,(function(t){var r=e.charCoords(t.head,"div").top+5
|
|
903
|
+
return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Yo(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")
|
|
904
|
+
return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ta(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=_e(e.doc,t),n=function(e){for(var t;t=It(e);)e=t.find(1,!0).line
|
|
905
|
+
return e}(r)
|
|
906
|
+
return n!=r&&(t=Ze(n)),Jo(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5
|
|
907
|
+
return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),U)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5
|
|
908
|
+
return e.coordsChar({left:0,top:r},"div")}),U)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div")
|
|
909
|
+
return n.ch<e.getLine(n.line).search(/\S/)?ra(e,t.head):n}),U)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=F(e.getLine(o.line),o.ch,n)
|
|
910
|
+
t.push($(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ei(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=_e(e.doc,i.line).text
|
|
911
|
+
if(o)if(i.ch==o.length&&(i=new tt(i.line,i.ch-1)),i.ch>0)i=new tt(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),tt(i.line,i.ch-2),i,"+transpose")
|
|
912
|
+
else if(i.line>e.doc.first){var a=_e(e.doc,i.line-1).text
|
|
913
|
+
a&&(i=new tt(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(i.line-1,a.length-1),i,"+transpose"))}r.push(new Si(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return ei(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input")
|
|
914
|
+
t=e.listSelections()
|
|
915
|
+
for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0)
|
|
916
|
+
Dn(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}}
|
|
917
|
+
function ta(e,t){var r=_e(e.doc,t),n=Rt(r)
|
|
918
|
+
return n!=r&&(t=Ze(n)),Jo(!0,e,n,t,1)}function ra(e,t){var r=ta(e,t.line),n=_e(e.doc,r.line),i=ce(n,e.doc.direction)
|
|
919
|
+
if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch
|
|
920
|
+
return tt(r.line,a?0:o,r.sticky)}return r}function na(e,t,r){if("string"==typeof t&&!(t=ea[t]))return!1
|
|
921
|
+
e.display.input.ensurePolled()
|
|
922
|
+
var n=e.display.shift,i=!1
|
|
923
|
+
try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=V}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var ia=new R
|
|
924
|
+
function oa(e,t,r,n){var i=e.state.keySeq
|
|
925
|
+
if(i){if(qo(t))return"handled"
|
|
926
|
+
if(/\'$/.test(t)?e.state.keySeq=null:ia.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),aa(e,i+" "+t,r,n))return!0}return aa(e,t,r,n)}function aa(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Uo(t,e.state.keyMaps[n],r,e)
|
|
927
|
+
if(i)return i}return e.options.extraKeys&&Uo(t,e.options.extraKeys,r,e)||Uo(t,e.options.keyMap,r,e)}(e,t,n)
|
|
928
|
+
return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(we(r),kn(e)),!!i}function la(e,t){var r=$o(t,!0)
|
|
929
|
+
return!!r&&(t.shiftKey&&!e.state.keySeq?oa(e,"Shift-"+r,t,(function(t){return na(e,t,!0)}))||oa(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return na(e,t)})):oa(e,r,t,(function(t){return na(e,t)})))}var sa=null
|
|
930
|
+
function ua(e){var t=this
|
|
931
|
+
if(t.curOp.focus=D(),!me(t,e)){a&&l<11&&27==e.keyCode&&(e.returnValue=!1)
|
|
932
|
+
var r=e.keyCode
|
|
933
|
+
t.display.shift=16==r||e.shiftKey
|
|
934
|
+
var n=la(t,e)
|
|
935
|
+
d&&(sa=n?r:null,n||88!=r||Pe||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv
|
|
936
|
+
function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),pe(document,"keyup",r),pe(document,"mouseover",r))}z(t,"CodeMirror-crosshair"),fe(document,"keyup",r),fe(document,"mouseover",r)}(t)}}function ca(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function da(e){var t=this
|
|
937
|
+
if(!(kr(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode
|
|
938
|
+
if(d&&r==sa)return sa=null,void we(e)
|
|
939
|
+
if(!d||e.which&&!(e.which<10)||!la(t,e)){var i=String.fromCharCode(null==n?r:n)
|
|
940
|
+
"\b"!=i&&(function(e,t,r){return oa(e,"'"+r+"'",t,(function(t){return na(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var fa,ha,pa=function(e,t,r){this.time=e,this.pos=t,this.button=r}
|
|
941
|
+
function ga(e){var t=this,r=t.display
|
|
942
|
+
if(!(me(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,kr(r,e))s||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100))
|
|
943
|
+
else if(!ya(t,e)){var n=cn(t,e),i=Le(e),o=n?function(e,t){var r=+new Date
|
|
944
|
+
return ha&&ha.compare(r,e,t)?(fa=ha=null,"triple"):fa&&fa.compare(r,e,t)?(ha=new pa(r,e,t),fa=null,"double"):(fa=new pa(r,e,t),ha=null,"single")}(n,i):"single"
|
|
945
|
+
window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,i){var o="Click"
|
|
946
|
+
return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),oa(e,_o(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=ea[t]),!t)return!1
|
|
947
|
+
var n=!1
|
|
948
|
+
try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=V}finally{e.state.suppressEdits=!1}return n}))}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){a?setTimeout(I(Cn,e),0):e.curOp.focus=D()
|
|
949
|
+
var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{}
|
|
950
|
+
if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey
|
|
951
|
+
i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey)),i}(e,r,n),u=e.doc.sel
|
|
952
|
+
e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==r&&(i=u.contains(t))>-1&&(rt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(rt(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,u=ti(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",u),pe(i.wrapper.ownerDocument,"mousemove",c),pe(i.scroller,"dragstart",d),pe(i.scroller,"drop",u),o||(we(t),n.addNew||$i(e.doc,r,null,null,n.extend),s||a&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0}
|
|
953
|
+
s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),fe(i.wrapper.ownerDocument,"mouseup",u),fe(i.wrapper.ownerDocument,"mousemove",c),fe(i.scroller,"dragstart",d),fe(i.scroller,"drop",u),Sn(e),setTimeout((function(){return i.input.focus()}),20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc
|
|
954
|
+
we(t)
|
|
955
|
+
var a,l,s=o.sel,u=s.ranges
|
|
956
|
+
if(n.addNew&&!n.extend?(l=o.sel.contains(r),a=l>-1?u[l]:new Si(r,r)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(a=new Si(r,r)),r=cn(e,t,!0,!0),l=-1
|
|
957
|
+
else{var c=ma(e,r,n.unit)
|
|
958
|
+
a=n.extend?_i(a,c.anchor,c.head,n.extend):c}n.addNew?-1==l?(l=u.length,Ji(o,Li(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==n.unit&&!n.extend?(Ji(o,Li(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Yi(o,l,a,G):(l=0,Ji(o,new Ci([a],0),G),s=o.sel)
|
|
959
|
+
var d=r
|
|
960
|
+
function f(t){if(0!=rt(d,t))if(d=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=F(_e(o,r.line).text,r.ch,u),f=F(_e(o,t.line).text,t.ch,u),h=Math.min(c,f),p=Math.max(c,f),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=_e(o,g).text,y=q(v,h,u)
|
|
961
|
+
h==p?i.push(new Si(tt(g,y),tt(g,y))):v.length>y&&i.push(new Si(tt(g,y),tt(g,q(v,p,u))))}i.length||i.push(new Si(r,r)),Ji(o,Li(e,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=a,x=ma(e,t,n.unit),k=w.anchor
|
|
962
|
+
rt(x.anchor,k)>0?(b=x.head,k=at(w.from(),x.anchor)):(b=x.anchor,k=ot(w.to(),x.head))
|
|
963
|
+
var C=s.ranges.slice(0)
|
|
964
|
+
C[l]=function(e,t){var r=t.anchor,n=t.head,i=_e(e.doc,r.line)
|
|
965
|
+
if(0==rt(r,n)&&r.sticky==n.sticky)return t
|
|
966
|
+
var o=ce(i)
|
|
967
|
+
if(!o)return t
|
|
968
|
+
var a=se(o,r.ch,r.sticky),l=o[a]
|
|
969
|
+
if(l.from!=r.ch&&l.to!=r.ch)return t
|
|
970
|
+
var s,u=a+(l.from==r.ch==(1!=l.level)?0:1)
|
|
971
|
+
if(0==u||u==o.length)return t
|
|
972
|
+
if(n.line!=r.line)s=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0
|
|
973
|
+
else{var c=se(o,n.ch,n.sticky),d=c-a||(n.ch-r.ch)*(1==l.level?-1:1)
|
|
974
|
+
s=c==u-1||c==u?d<0:d>0}var f=o[u+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,g=h?"after":"before"
|
|
975
|
+
return r.ch==p&&r.sticky==g?t:new Si(new tt(r.line,p,g),n)}(e,new Si(st(o,k),b)),Ji(o,Li(e,C,l),G)}}var h=i.wrapper.getBoundingClientRect(),p=0
|
|
976
|
+
function g(t){var r=++p,a=cn(e,t,!0,"rectangle"==n.unit)
|
|
977
|
+
if(a)if(0!=rt(a,d)){e.curOp.focus=D(),f(a)
|
|
978
|
+
var l=An(i,o);(a.line>=l.to||a.line<l.from)&&setTimeout(ti(e,(function(){p==r&&g(t)})),150)}else{var s=t.clientY<h.top?-20:t.clientY>h.bottom?20:0
|
|
979
|
+
s&&setTimeout(ti(e,(function(){p==r&&(i.scroller.scrollTop+=s,g(t))})),50)}}function m(t){e.state.selectingText=!1,p=1/0,t&&(we(t),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",v),pe(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var v=ti(e,(function(e){0!==e.buttons&&Le(e)?g(e):m(e)})),y=ti(e,m)
|
|
980
|
+
e.state.selectingText=y,fe(i.wrapper.ownerDocument,"mousemove",v),fe(i.wrapper.ownerDocument,"mouseup",y)}(e,n,t,o)}(t,n,o,e):Se(e)==r.scroller&&we(e):2==i?(n&&$i(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(C?t.display.input.onContextMenu(e):Sn(t)))}}function ma(e,t,r){if("char"==r)return new Si(t,t)
|
|
981
|
+
if("word"==r)return e.findWordAt(t)
|
|
982
|
+
if("line"==r)return new Si(tt(t.line,0),st(e.doc,tt(t.line+1,0)))
|
|
983
|
+
var n=r(e,t)
|
|
984
|
+
return new Si(n.from,n.to)}function va(e,t,r,n){var i,o
|
|
985
|
+
if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY
|
|
986
|
+
else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1
|
|
987
|
+
n&&we(t)
|
|
988
|
+
var a=e.display,l=a.lineDiv.getBoundingClientRect()
|
|
989
|
+
if(o>l.bottom||!ye(e,r))return ke(t)
|
|
990
|
+
o-=l.top-a.viewOffset
|
|
991
|
+
for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s]
|
|
992
|
+
if(u&&u.getBoundingClientRect().right>=i)return ge(e,r,e,Qe(e.doc,o),e.display.gutterSpecs[s].className,t),ke(t)}}function ya(e,t){return va(e,t,"gutterClick",!0)}function ba(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Br(e)}pa.prototype.compare=function(e,t,r){return this.time+400>e&&0==rt(t,this.pos)&&r==this.button}
|
|
993
|
+
var wa={toString:function(){return"CodeMirror.Init"}},xa={},ka={}
|
|
994
|
+
function Ca(e,t,r){if(!t!=!(r&&r!=wa)){var n=e.display.dragFunctions,i=t?fe:pe
|
|
995
|
+
i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Sa(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),qt(e)),un(e),fn(e),Br(e),setTimeout((function(){return Vn(e)}),100)}function La(e,t){var r=this
|
|
996
|
+
if(!(this instanceof La))return new La(e,t)
|
|
997
|
+
this.options=t=t?E(t):{},E(xa,t,!1)
|
|
998
|
+
var n=t.value
|
|
999
|
+
"string"==typeof n?n=new Wo(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n
|
|
1000
|
+
var i=new La.inputStyles[t.inputStyle](this),o=this.display=new vi(e,n,i,t)
|
|
1001
|
+
for(var u in o.wrapper.CodeMirror=this,ba(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Un(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&l<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display
|
|
1002
|
+
fe(t.scroller,"mousedown",ti(e,ga)),fe(t.scroller,"dblclick",a&&l<11?ti(e,(function(t){if(!me(e,t)){var r=cn(e,t)
|
|
1003
|
+
if(r&&!ya(e,t)&&!kr(e.display,t)){we(t)
|
|
1004
|
+
var n=e.findWordAt(r)
|
|
1005
|
+
$i(e.doc,n.anchor,n.head)}}})):function(t){return me(e,t)||we(t)}),fe(t.scroller,"contextmenu",(function(t){return function(e,t){kr(e.display,t)||function(e,t){return!!ye(e,"gutterContextMenu")&&va(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}(e,t)}))
|
|
1006
|
+
var r,n={end:0}
|
|
1007
|
+
function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0
|
|
1008
|
+
var r=t.left-e.left,n=t.top-e.top
|
|
1009
|
+
return r*r+n*n>400}fe(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1
|
|
1010
|
+
var t=e.touches[0]
|
|
1011
|
+
return t.radiusX<=1&&t.radiusY<=1}(i)&&!ya(e,i)){t.input.ensurePolled(),clearTimeout(r)
|
|
1012
|
+
var o=+new Date
|
|
1013
|
+
t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(r){var n=t.activeTouch
|
|
1014
|
+
if(n&&!kr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,l=e.coordsChar(t.activeTouch,"page")
|
|
1015
|
+
a=!n.prev||o(n,n.prev)?new Si(l,l):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(l):new Si(tt(l.line,0),st(e.doc,tt(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),we(r)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(In(e,t.scroller.scrollTop),Fn(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return ki(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return ki(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||Ce(t)},over:function(t){me(e,t)||(function(e,t){var r=cn(e,t)
|
|
1016
|
+
if(r){var n=document.createDocumentFragment()
|
|
1017
|
+
bn(e,r,n),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Do<100))Ce(t)
|
|
1018
|
+
else if(!me(e,t)&&!kr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=A("img",null,null,"position: fixed; left: 0; top: 0;")
|
|
1019
|
+
r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),d&&r.parentNode.removeChild(r)}}(e,t)},drop:ti(e,zo),leave:function(t){me(e,t)||Po(e)}}
|
|
1020
|
+
var s=t.input.getField()
|
|
1021
|
+
fe(s,"keyup",(function(t){return ca.call(e,t)})),fe(s,"keydown",ti(e,ua)),fe(s,"keypress",ti(e,da)),fe(s,"focus",(function(t){return Ln(e,t)})),fe(s,"blur",(function(t){return Tn(e,t)}))}(this),function(){var e
|
|
1022
|
+
Io||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ho(Eo)}),100))})),fe(window,"blur",(function(){return Ho(Tn)})),Io=!0)}(),_n(this),this.curOp.forceUpdate=!0,Ii(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(I(Ln,this),20):Tn(this),ka)ka.hasOwnProperty(u)&&ka[u](r,t[u],wa)
|
|
1023
|
+
hi(this),t.finishInit&&t.finishInit(this)
|
|
1024
|
+
for(var c=0;c<Ta.length;++c)Ta[c](r)
|
|
1025
|
+
$n(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}La.defaults=xa,La.optionHandlers=ka
|
|
1026
|
+
var Ta=[]
|
|
1027
|
+
function Ma(e,t,r,n){var i,o=e.doc
|
|
1028
|
+
null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=pt(e,t).state:r="prev")
|
|
1029
|
+
var a=e.options.tabSize,l=_e(o,t),s=F(l.text,null,a)
|
|
1030
|
+
l.stateAfter&&(l.stateAfter=null)
|
|
1031
|
+
var u,c=l.text.match(/^\s*/)[0]
|
|
1032
|
+
if(n||/\S/.test(l.text)){if("smart"==r&&((u=o.mode.indent(i,l.text.slice(c.length),l.text))==V||u>150)){if(!n)return
|
|
1033
|
+
r="prev"}}else u=0,r="not"
|
|
1034
|
+
"prev"==r?u=t>o.first?F(_e(o,t-1).text,null,a):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u)
|
|
1035
|
+
var d="",f=0
|
|
1036
|
+
if(e.options.indentWithTabs)for(var h=Math.floor(u/a);h;--h)f+=a,d+="\t"
|
|
1037
|
+
if(f<u&&(d+=$(u-f)),d!=c)return go(o,d,tt(t,0),tt(t,c.length),"+input"),l.stateAfter=null,!0
|
|
1038
|
+
for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p]
|
|
1039
|
+
if(g.head.line==t&&g.head.ch<c.length){var m=tt(t,c.length)
|
|
1040
|
+
Yi(o,p,new Si(m,m))
|
|
1041
|
+
break}}}La.defineInitHook=function(e){return Ta.push(e)}
|
|
1042
|
+
var Na=null
|
|
1043
|
+
function Aa(e){Na=e}function Oa(e,t,r,n,i){var o=e.doc
|
|
1044
|
+
e.display.shift=!1,n||(n=o.sel)
|
|
1045
|
+
var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=De(t),u=null
|
|
1046
|
+
if(l&&n.ranges.length>1)if(Na&&Na.text.join("\n")==t){if(n.ranges.length%Na.text.length==0){u=[]
|
|
1047
|
+
for(var c=0;c<Na.text.length;c++)u.push(o.splitLines(Na.text[c]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=Y(s,(function(e){return[e]})))
|
|
1048
|
+
for(var d=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var h=n.ranges[f],p=h.from(),g=h.to()
|
|
1049
|
+
h.empty()&&(r&&r>0?p=tt(p.line,p.ch-r):e.state.overwrite&&!l?g=tt(g.line,Math.min(_e(o,g.line).text.length,g.ch+X(s).length)):l&&Na&&Na.lineWise&&Na.text.join("\n")==t&&(p=g=tt(p.line,0)))
|
|
1050
|
+
var m={from:p,to:g,text:u?u[f%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")}
|
|
1051
|
+
uo(e.doc,m),sr(e,"inputRead",e,m)}t&&!l&&Da(e,t),Dn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Wa(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text")
|
|
1052
|
+
if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ei(t,(function(){return Oa(t,r,0,null,"paste")})),!0}function Da(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n]
|
|
1053
|
+
if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1
|
|
1054
|
+
if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Ma(e,i.head.line,"smart")
|
|
1055
|
+
break}}else o.electricInput&&o.electricInput.test(_e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ma(e,i.head.line,"smart"))
|
|
1056
|
+
a&&sr(e,"electricInput",e,i.head.line)}}}function za(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:tt(i,0),head:tt(i+1,0)}
|
|
1057
|
+
r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Pa(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ha(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;")
|
|
1058
|
+
return s?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Pa(e),t}function Ia(e,t,r,n,i){var o=t,a=r,l=_e(e,t.line)
|
|
1059
|
+
function s(n){var o,a
|
|
1060
|
+
if(o=i?function(e,t,r,n){var i=ce(t,e.doc.direction)
|
|
1061
|
+
if(!i)return Qo(t,r,n)
|
|
1062
|
+
r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after")
|
|
1063
|
+
var o=se(i,r.ch,r.sticky),a=i[o]
|
|
1064
|
+
if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Qo(t,r,n)
|
|
1065
|
+
var l,s=function(e,r){return Zo(t,e instanceof tt?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(l=l||Dr(e,t),Qr(e,t,l,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?s(r,-1):r.ch)
|
|
1066
|
+
if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,f=s(r,d?1:-1)
|
|
1067
|
+
if(null!=f&&(d?f<=a.to&&f<=c.end:f>=a.from&&f>=c.begin)){var h=d?"before":"after"
|
|
1068
|
+
return new tt(r.line,f,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new tt(r.line,s(e,1),"before"):new tt(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),u=l?n.begin:s(n.end,-1)
|
|
1069
|
+
if(a.from<=u&&u<a.to)return o(u,l)
|
|
1070
|
+
if(u=l?a.from:s(a.to,-1),n.begin<=u&&u<n.end)return o(u,l)}},g=p(o+n,n,c)
|
|
1071
|
+
if(g)return g
|
|
1072
|
+
var m=n>0?c.end:s(c.begin,-1)
|
|
1073
|
+
return null==m||n>0&&m==t.text.length||!(g=p(n>0?0:i.length-1,n,u(m)))?null:g}(e.cm,l,t,r):Qo(l,t,r),null==o){if(n||(a=t.line+r)<e.first||a>=e.first+e.size||(t=new tt(a,t.ch,t.sticky),!(l=_e(e,a))))return!1
|
|
1074
|
+
t=Jo(i,e.cm,l,t.line,r)}else t=o
|
|
1075
|
+
return!0}if("char"==n)s()
|
|
1076
|
+
else if("column"==n)s(!0)
|
|
1077
|
+
else if("word"==n||"group"==n)for(var u=null,c="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||s(!f);f=!1){var h=l.text.charAt(t.ch)||"\n",p=te(h,d)?"w":c&&"\n"==h?"n":!c||/\s/.test(h)?null:"p"
|
|
1078
|
+
if(!c||f||p||(p="s"),u&&u!=p){r<0&&(r=1,s(),t.sticky="after")
|
|
1079
|
+
break}if(p&&(u=p),r>0&&!s(!f))break}var g=oo(e,t,o,a,!0)
|
|
1080
|
+
return nt(o,g)&&(g.hitSide=!0),g}function Ea(e,t,r,n){var i,o,a=e.doc,l=t.left
|
|
1081
|
+
if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*nn(e.display),3)
|
|
1082
|
+
i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3)
|
|
1083
|
+
for(;(o=Yr(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0
|
|
1084
|
+
break}i+=5*r}return o}var Fa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}
|
|
1085
|
+
function Ra(e,t){var r=Wr(e,t.line)
|
|
1086
|
+
if(!r||r.hidden)return null
|
|
1087
|
+
var n=_e(e.doc,t.line),i=Ar(r,n,t.line),o=ce(n,e.doc.direction),a="left"
|
|
1088
|
+
o&&(a=se(o,t.ch)%2?"right":"left")
|
|
1089
|
+
var l=Ir(i.map,t.ch,a)
|
|
1090
|
+
return l.offset="right"==l.collapse?l.end:l.start,l}function Ba(e,t){return t&&(e.bad=!0),e}function ja(e,t,r){var n
|
|
1091
|
+
if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ba(e.clipPos(tt(e.display.viewTo-1)),!0)
|
|
1092
|
+
t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null
|
|
1093
|
+
if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i]
|
|
1094
|
+
if(o.node==n)return Va(o,t,r)}}function Va(e,t,r){var n=e.text.firstChild,i=!1
|
|
1095
|
+
if(!t||!W(n,t))return Ba(tt(Ze(e.line),0),!0)
|
|
1096
|
+
if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?X(e.rest):e.line
|
|
1097
|
+
return Ba(tt(Ze(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t
|
|
1098
|
+
for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));l.parentNode!=n;)l=l.parentNode
|
|
1099
|
+
var s=e.measure,u=s.maps
|
|
1100
|
+
function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2]
|
|
1101
|
+
if(l==t||l==r){var c=Ze(i<0?e.line:e.rest[i]),d=o[a]+n
|
|
1102
|
+
return(n<0||l!=t)&&(d=o[a+(n?1:0)]),tt(c,d)}}}var d=c(a,l,r)
|
|
1103
|
+
if(d)return Ba(d,i)
|
|
1104
|
+
for(var f=l.nextSibling,h=a?a.nodeValue.length-r:0;f;f=f.nextSibling){if(d=c(f,f.firstChild,0))return Ba(tt(d.line,d.ch-h),i)
|
|
1105
|
+
h+=f.textContent.length}for(var p=l.previousSibling,g=r;p;p=p.previousSibling){if(d=c(p,p.firstChild,-1))return Ba(tt(d.line,d.ch+g),i)
|
|
1106
|
+
g+=p.textContent.length}}Fa.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv
|
|
1107
|
+
function o(e){if(!me(n,e)){if(n.somethingSelected())Aa({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut")
|
|
1108
|
+
else{if(!n.options.lineWiseCopyCut)return
|
|
1109
|
+
var t=za(n)
|
|
1110
|
+
Aa({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,K),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData()
|
|
1111
|
+
var o=Na.text.join("\n")
|
|
1112
|
+
if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Ha(),l=a.firstChild
|
|
1113
|
+
n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild),l.value=Na.text.join("\n")
|
|
1114
|
+
var s=document.activeElement
|
|
1115
|
+
H(l),setTimeout((function(){n.display.lineSpace.removeChild(a),s.focus(),s==i&&r.showPrimarySelection()}),50)}}Pa(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),fe(i,"paste",(function(e){me(n,e)||Wa(e,n)||l<=11&&setTimeout(ti(n,(function(){return t.updateFromDOM()})),20)})),fe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(i,"touchstart",(function(){return r.forceCompositionEnd()})),fe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(i,"copy",o),fe(i,"cut",o)},Fa.prototype.prepareSelection=function(){var e=yn(this.cm,!1)
|
|
1116
|
+
return e.focus=this.cm.state.focused,e},Fa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to()
|
|
1117
|
+
if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges()
|
|
1118
|
+
else{var a=ja(t,e.anchorNode,e.anchorOffset),l=ja(t,e.focusNode,e.focusOffset)
|
|
1119
|
+
if(!a||a.bad||!l||l.bad||0!=rt(at(a,l),i)||0!=rt(ot(a,l),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&Ra(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ra(t,o)
|
|
1120
|
+
if(!c){var d=s[s.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map
|
|
1121
|
+
c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var h,p=e.rangeCount&&e.getRangeAt(0)
|
|
1122
|
+
try{h=L(u.node,u.offset,c.offset,c.node)}catch(e){}h&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Fa.prototype.startGracePeriod=function(){var e=this
|
|
1123
|
+
clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Fa.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},Fa.prototype.rememberSelection=function(){var e=this.getSelection()
|
|
1124
|
+
this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fa.prototype.selectionInEditor=function(){var e=this.getSelection()
|
|
1125
|
+
if(!e.rangeCount)return!1
|
|
1126
|
+
var t=e.getRangeAt(0).commonAncestorContainer
|
|
1127
|
+
return W(this.div,t)},Fa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fa.prototype.blur=function(){this.div.blur()},Fa.prototype.getField=function(){return this.div},Fa.prototype.supportsTouch=function(){return!0},Fa.prototype.receivedFocus=function(){var e=this
|
|
1128
|
+
this.selectionInEditor()?this.pollSelection():ei(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Fa.prototype.selectionChanged=function(){var e=this.getSelection()
|
|
1129
|
+
return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm
|
|
1130
|
+
if(m&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0
|
|
1131
|
+
return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus()
|
|
1132
|
+
if(!this.composing){this.rememberSelection()
|
|
1133
|
+
var r=ja(t,e.anchorNode,e.anchorOffset),n=ja(t,e.focusNode,e.focusOffset)
|
|
1134
|
+
r&&n&&ei(t,(function(){Ji(t.doc,Ti(r,n),K),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Fa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null)
|
|
1135
|
+
var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to()
|
|
1136
|
+
if(0==a.ch&&a.line>n.firstLine()&&(a=tt(a.line-1,_e(n.doc,a.line-1).length)),l.ch==_e(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=tt(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1
|
|
1137
|
+
a.line==i.viewFrom||0==(e=dn(n,a.line))?(t=Ze(i.view[0].line),r=i.view[0].node):(t=Ze(i.view[e].line),r=i.view[e-1].node.nextSibling)
|
|
1138
|
+
var s,u,c=dn(n,l.line)
|
|
1139
|
+
if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=Ze(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1
|
|
1140
|
+
for(var d=n.doc.splitLines(function(e,t,r,n,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1
|
|
1141
|
+
function u(){a&&(o+=l,s&&(o+=l),a=s=!1)}function c(e){e&&(u(),o+=e)}function d(t){if(1==t.nodeType){var r=t.getAttribute("cm-text")
|
|
1142
|
+
if(r)return void c(r)
|
|
1143
|
+
var o,f=t.getAttribute("cm-marker")
|
|
1144
|
+
if(f){var h=e.findMarks(tt(n,0),tt(i+1,0),function(e){return function(t){return t.id==e}}(+f))
|
|
1145
|
+
return void(h.length&&(o=h[0].find(0))&&c($e(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return
|
|
1146
|
+
var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName)
|
|
1147
|
+
if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return
|
|
1148
|
+
p&&u()
|
|
1149
|
+
for(var g=0;g<t.childNodes.length;g++)d(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),p&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(t),t!=r;)t=t.nextSibling,s=!1
|
|
1150
|
+
return o}(n,r,u,t,s)),f=$e(n.doc,tt(t,0),tt(s,_e(n.doc,s).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),s--
|
|
1151
|
+
else{if(d[0]!=f[0])break
|
|
1152
|
+
d.shift(),f.shift(),t++}for(var h=0,p=0,g=d[0],m=f[0],v=Math.min(g.length,m.length);h<v&&g.charCodeAt(h)==m.charCodeAt(h);)++h
|
|
1153
|
+
for(var y=X(d),b=X(f),w=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p
|
|
1154
|
+
if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++
|
|
1155
|
+
d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"")
|
|
1156
|
+
var x=tt(t,h),k=tt(s,f.length?X(f).length-p:0)
|
|
1157
|
+
return d.length>1||d[0]||rt(x,k)?(go(n.doc,d,x,k,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var e=this
|
|
1158
|
+
null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return
|
|
1159
|
+
e.composing=null}e.updateFromDOM()}),80))},Fa.prototype.updateFromDOM=function(){var e=this
|
|
1160
|
+
!this.cm.isReadOnly()&&this.pollContent()||ei(this.cm,(function(){return fn(e.cm)}))},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Oa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0
|
|
1161
|
+
var Ka=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null}
|
|
1162
|
+
Ka.prototype.init=function(e){var t=this,r=this,n=this.cm
|
|
1163
|
+
this.createField(e)
|
|
1164
|
+
var i=this.textarea
|
|
1165
|
+
function o(e){if(!me(n,e)){if(n.somethingSelected())Aa({lineWise:!1,text:n.getSelections()})
|
|
1166
|
+
else{if(!n.options.lineWiseCopyCut)return
|
|
1167
|
+
var t=za(n)
|
|
1168
|
+
Aa({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,K):(r.prevInput="",i.value=t.text.join("\n"),H(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),fe(i,"input",(function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),fe(i,"paste",(function(e){me(n,e)||Wa(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!kr(e,t)&&!me(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus()
|
|
1169
|
+
var o=new Event("paste")
|
|
1170
|
+
o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){kr(e,t)||we(t)})),fe(i,"compositionstart",(function(){var e=n.getCursor("from")
|
|
1171
|
+
r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Ka.prototype.createField=function(e){this.wrapper=Ha(),this.textarea=this.wrapper.firstChild},Ka.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=yn(e)
|
|
1172
|
+
if(e.options.moveInputWithCursor){var i=_r(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect()
|
|
1173
|
+
n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Ka.prototype.showSelection=function(e){var t=this.cm.display
|
|
1174
|
+
N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ka.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm
|
|
1175
|
+
if(t.somethingSelected()){this.prevInput=""
|
|
1176
|
+
var r=t.getSelection()
|
|
1177
|
+
this.textarea.value=r,t.state.focused&&H(this.textarea),a&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null))}},Ka.prototype.getField=function(){return this.textarea},Ka.prototype.supportsTouch=function(){return!1},Ka.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ka.prototype.blur=function(){this.textarea.blur()},Ka.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ka.prototype.receivedFocus=function(){this.slowPoll()},Ka.prototype.slowPoll=function(){var e=this
|
|
1178
|
+
this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ka.prototype.fastPoll=function(){var e=!1,t=this
|
|
1179
|
+
t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},Ka.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput
|
|
1180
|
+
if(this.contextMenuPending||!t.state.focused||ze(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1
|
|
1181
|
+
var i=r.value
|
|
1182
|
+
if(i==n&&!t.somethingSelected())return!1
|
|
1183
|
+
if(a&&l>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1
|
|
1184
|
+
if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0)
|
|
1185
|
+
if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,u=Math.min(n.length,i.length);s<u&&n.charCodeAt(s)==i.charCodeAt(s);)++s
|
|
1186
|
+
return ei(t,(function(){Oa(t,i.slice(s),n.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ka.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ka.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ka.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea
|
|
1187
|
+
t.contextMenuPending&&t.contextMenuPending()
|
|
1188
|
+
var o=cn(r,e),u=n.scroller.scrollTop
|
|
1189
|
+
if(o&&!d){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&ti(r,Ji)(r.doc,Ti(o),K)
|
|
1190
|
+
var c,f=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect()
|
|
1191
|
+
if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(c=window.scrollY),n.input.focus(),s&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&l>=9&&m(),C){Ce(e)
|
|
1192
|
+
var g=function(){pe(window,"mouseup",g),setTimeout(v,20)}
|
|
1193
|
+
fe(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"")
|
|
1194
|
+
i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&l<9)&&m()
|
|
1195
|
+
var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?ti(r,lo)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())}
|
|
1196
|
+
n.detectingSelectAll=setTimeout(o,200)}}},Ka.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ka.prototype.setUneditable=function(){},Ka.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers
|
|
1197
|
+
function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=wa&&i(e,t,r)}:i)}e.defineOption=r,e.Init=wa,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Wi(e)}),!0),r("indentUnit",2,Wi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Di(e),Br(e),fn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first
|
|
1198
|
+
e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i)
|
|
1199
|
+
if(-1==o)break
|
|
1200
|
+
i=o+t.length,r.push(tt(n,o))}n++}))
|
|
1201
|
+
for(var i=r.length-1;i>=0;i--)go(e.doc,t,r[i],tt(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=wa&&e.refresh()})),r("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){ba(e),mi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Xo(t),i=r!=wa&&Xo(r)
|
|
1202
|
+
i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Sa,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=pi(t,e.options.lineNumbers),mi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ln(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Vn(e)}),!0),r("scrollbarStyle","native",(function(e){Un(e),Vn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pi(e.options.gutters,t),mi(e)}),!0),r("firstLineNumber",1,mi,!0),r("lineNumberFormatter",(function(e){return e}),mi,!0),r("showCursorWhenSelecting",!1,vn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(Tn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Ca),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,vn,!0),r("singleCursorHeightPerLine",!0,vn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Di,!0),r("addModeClass",!1,Di,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Di,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(La),function(e){var t=e.optionHandlers,r=e.helpers={}
|
|
1203
|
+
e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e]
|
|
1204
|
+
n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&ti(this,t[e])(this,r,i),ge(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:ri((function(t,r){var n=t.token?t:e.getMode(this.options,t)
|
|
1205
|
+
if(n.startState)throw new Error("Overlays may not be stateful.")
|
|
1206
|
+
!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++
|
|
1207
|
+
e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,fn(this)})),removeOverlay:ri((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec
|
|
1208
|
+
if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void fn(this)}})),indentLine:ri((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Je(this.doc,e)&&Ma(this,e,t,r)})),indentSelection:ri((function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i]
|
|
1209
|
+
if(o.empty())o.head.line>n&&(Ma(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Dn(t))
|
|
1210
|
+
else{var a=o.from(),l=o.to(),s=Math.max(n,a.line)
|
|
1211
|
+
n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1
|
|
1212
|
+
for(var u=s;u<n;++u)Ma(t,u,e)
|
|
1213
|
+
var c=t.doc.sel.ranges
|
|
1214
|
+
0==a.ch&&r.length==c.length&&c[i].from().ch>0&&Yi(t.doc,i,new Si(a,c[i].to()),K)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e)
|
|
1215
|
+
var t,r=ht(this,_e(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch
|
|
1216
|
+
if(0==o)t=r[2]
|
|
1217
|
+
else for(;;){var a=n+i>>1
|
|
1218
|
+
if((a?r[2*a-1]:0)>=o)i=a
|
|
1219
|
+
else{if(!(r[2*a+1]<o)){t=r[2*a+2]
|
|
1220
|
+
break}n=a+1}}var l=t?t.indexOf("overlay "):-1
|
|
1221
|
+
return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode
|
|
1222
|
+
return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[]
|
|
1223
|
+
if(!r.hasOwnProperty(t))return n
|
|
1224
|
+
var i=r[t],o=this.getModeAt(e)
|
|
1225
|
+
if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]])
|
|
1226
|
+
else if(o[t])for(var a=0;a<o[t].length;a++){var l=i[o[t][a]]
|
|
1227
|
+
l&&n.push(l)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name])
|
|
1228
|
+
for(var s=0;s<i._global.length;s++){var u=i._global[s]
|
|
1229
|
+
u.pred(o,this)&&-1==B(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc
|
|
1230
|
+
return pt(this,(e=lt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary()
|
|
1231
|
+
return _r(this,null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return qr(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Yr(this,(e=Ur(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ur(this,{top:e,left:0},t||"page").top,Qe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1
|
|
1232
|
+
if("number"==typeof e){var o=this.doc.first+this.doc.size-1
|
|
1233
|
+
e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=_e(this.doc,e)}else n=e
|
|
1234
|
+
return Gr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Gt(n):0)},defaultTextHeight:function(){return nn(this.display)},defaultCharWidth:function(){return on(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,l=this.display,s=(e=_r(this,st(this.doc,e))).bottom,u=e.left
|
|
1235
|
+
if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)s=e.top
|
|
1236
|
+
else if("above"==n||"near"==n){var c=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(s=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(null!=(a=On(o=this,{left:u,top:s,right:u+t.offsetWidth,bottom:s+t.offsetHeight})).scrollTop&&In(o,a.scrollTop),null!=a.scrollLeft&&Fn(o,a.scrollLeft))},triggerOnKeyDown:ri(ua),triggerOnKeyPress:ri(da),triggerOnKeyUp:ca,triggerOnMouseDown:ri(ga),execCommand:function(e){if(ea.hasOwnProperty(e))return ea[e].call(null,this)},triggerElectric:ri((function(e){Da(this,e)})),findPosH:function(e,t,r,n){var i=1
|
|
1237
|
+
t<0&&(i=-1,t=-t)
|
|
1238
|
+
for(var o=st(this.doc,e),a=0;a<t&&!(o=Ia(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:ri((function(e,t){var r=this
|
|
1239
|
+
this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Ia(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),U)})),deleteH:ri((function(e,t){var r=this.doc.sel,n=this.doc
|
|
1240
|
+
r.somethingSelected()?n.replaceSelection("",null,"+delete"):Yo(this,(function(r){var i=Ia(n,r.head,e,t,!1)
|
|
1241
|
+
return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n
|
|
1242
|
+
t<0&&(i=-1,t=-t)
|
|
1243
|
+
for(var a=st(this.doc,e),l=0;l<t;++l){var s=_r(this,a,"div")
|
|
1244
|
+
if(null==o?o=s.left:s.left=o,(a=Ea(this,s,i,r)).hitSide)break}return a},moveV:ri((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected()
|
|
1245
|
+
if(n.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to()
|
|
1246
|
+
var l=_r(r,a.head,"div")
|
|
1247
|
+
null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left)
|
|
1248
|
+
var s=Ea(r,l,e,t)
|
|
1249
|
+
return"page"==t&&a==n.sel.primary()&&Wn(r,qr(r,s,"div").top-l.top),s}),U),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=_e(this.doc,e.line).text,r=e.ch,n=e.ch
|
|
1250
|
+
if(t){var i=this.getHelper(e,"wordChars")
|
|
1251
|
+
"before"!=e.sticky&&n!=t.length||!r?++n:--r
|
|
1252
|
+
for(var o=t.charAt(r),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};r>0&&a(t.charAt(r-1));)--r
|
|
1253
|
+
for(;n<t.length&&a(t.charAt(n));)++n}return new Si(tt(e.line,r),tt(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ri((function(e,t){zn(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller
|
|
1254
|
+
return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Tr(this)-this.display.barHeight,width:e.scrollWidth-Tr(this)-this.display.barWidth,clientHeight:Nr(this),clientWidth:Mr(this)}},scrollIntoView:ri((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:tt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Pn(e),e.curOp.scrollToPos=t}(this,e):Hn(this,e.from,e.to,e.margin)})),setSize:ri((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}
|
|
1255
|
+
null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Rr(this)
|
|
1256
|
+
var i=this.display.viewFrom
|
|
1257
|
+
this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){hn(r,i,"widget")
|
|
1258
|
+
break}++i})),this.curOp.forceUpdate=!0,ge(this,"refresh",this)})),operation:function(e){return ei(this,e)},startOperation:function(){return _n(this)},endOperation:function(){return $n(this)},refresh:ri((function(){var e=this.display.cachedTextHeight
|
|
1259
|
+
fn(this),this.curOp.forceUpdate=!0,Br(this),zn(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==e||Math.abs(e-nn(this.display))>.5)&&un(this),ge(this,"refresh",this)})),swapDoc:ri((function(e){var t=this.doc
|
|
1260
|
+
return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ii(this,e),Br(this),this.display.input.reset(),zn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases
|
|
1261
|
+
return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(La)
|
|
1262
|
+
var Ga="iter insert remove copy getEditor constructor".split(" ")
|
|
1263
|
+
for(var Ua in Wo.prototype)Wo.prototype.hasOwnProperty(Ua)&&B(Ga,Ua)<0&&(La.prototype[Ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(Wo.prototype[Ua]))
|
|
1264
|
+
return be(Wo),La.inputStyles={textarea:Ka,contenteditable:Fa},La.defineMode=function(e){La.defaults.mode||"null"==e||(La.defaults.mode=e),Fe.apply(this,arguments)},La.defineMIME=function(e,t){Ee[e]=t},La.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),La.defineMIME("text/plain","null"),La.defineExtension=function(e,t){La.prototype[e]=t},La.defineDocExtension=function(e,t){Wo.prototype[e]=t},La.fromTextArea=function(e,t){if((t=t?E(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=D()
|
|
1265
|
+
t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=l.getValue()}var i
|
|
1266
|
+
if(e.form&&(fe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form
|
|
1267
|
+
i=o.submit
|
|
1268
|
+
try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none"
|
|
1269
|
+
var l=La((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t)
|
|
1270
|
+
return l},function(e){e.off=pe,e.on=fe,e.wheelEventPixels=xi,e.Doc=Wo,e.splitLines=De,e.countColumn=F,e.findColumn=q,e.isWordChar=ee,e.Pass=V,e.signal=ge,e.Line=_t,e.changeEnd=Mi,e.scrollbarModel=Gn,e.Pos=tt,e.cmpPos=rt,e.modes=Ie,e.mimeModes=Ee,e.resolveMode=Re,e.getMode=Be,e.modeExtensions=je,e.extendMode=Ve,e.copyState=Ke,e.startState=Ue,e.innerMode=Ge,e.commands=ea,e.keyMap=Vo,e.keyName=$o,e.isModifierKey=qo,e.lookupKey=Uo,e.normalizeKeyMap=Go,e.StringStream=qe,e.SharedTextMarker=Mo,e.TextMarker=Lo,e.LineWidget=ko,e.e_preventDefault=we,e.e_stopPropagation=xe,e.e_stop=Ce,e.addClass=z,e.contains=W,e.rmClass=T,e.keyNames=Fo}(La),La.version="5.48.2",La})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict"
|
|
1271
|
+
function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0
|
|
1272
|
+
return t}e.defineMode("css",(function(t,r){var n=r.inline
|
|
1273
|
+
r.propertyKeywords||(r=e.resolveMode("text/css"))
|
|
1274
|
+
var i,o,a=t.indentUnit,l=r.tokenHooks,s=r.documentTypes||{},u=r.mediaTypes||{},c=r.mediaFeatures||{},d=r.mediaValueKeywords||{},f=r.propertyKeywords||{},h=r.nonStandardPropertyKeywords||{},p=r.fontProperties||{},g=r.counterDescriptors||{},m=r.colorKeywords||{},v=r.valueKeywords||{},y=r.allowNested,b=r.lineComment,w=!0===r.supportsAtComponent
|
|
1275
|
+
function x(e,t){return i=t,e}function k(e,t){var r=e.next()
|
|
1276
|
+
if(l[r]){var n=l[r](e,t)
|
|
1277
|
+
if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),x("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?x(null,"compare"):'"'==r||"'"==r?(t.tokenize=C(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==r?(e.match(/^\s*\w*/),x("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),x("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?x(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?x(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function C(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1)
|
|
1278
|
+
break}i=!i&&"\\"==n}return(n==e||!i&&")"!=e)&&(r.tokenize=null),x("string","string")}}function S(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=C(")"),x(null,"(")}function L(e,t,r){this.type=e,this.indent=t,this.prev=r}function T(e,t,r,n){return e.context=new L(r,t.indentation()+(!1===n?0:a),e.context),r}function M(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,r){return W[r.context.type](e,t,r)}function A(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev
|
|
1279
|
+
return N(e,t,r)}function O(e){var t=e.current().toLowerCase()
|
|
1280
|
+
o=v.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var W={top:function(e,t,r){if("{"==e)return T(r,t,"block")
|
|
1281
|
+
if("}"==e&&r.context.prev)return M(r)
|
|
1282
|
+
if(w&&/@component/i.test(e))return T(r,t,"atComponentBlock")
|
|
1283
|
+
if(/^@(-moz-)?document$/i.test(e))return T(r,t,"documentTypes")
|
|
1284
|
+
if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(r,t,"atBlock")
|
|
1285
|
+
if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before"
|
|
1286
|
+
if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes"
|
|
1287
|
+
if(e&&"@"==e.charAt(0))return T(r,t,"at")
|
|
1288
|
+
if("hash"==e)o="builtin"
|
|
1289
|
+
else if("word"==e)o="tag"
|
|
1290
|
+
else{if("variable-definition"==e)return"maybeprop"
|
|
1291
|
+
if("interpolation"==e)return T(r,t,"interpolation")
|
|
1292
|
+
if(":"==e)return"pseudo"
|
|
1293
|
+
if(y&&"("==e)return T(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase()
|
|
1294
|
+
return f.hasOwnProperty(n)?(o="property","maybeprop"):h.hasOwnProperty(n)?(o="string-2","maybeprop"):y?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?W.top(e,t,r):(o="error","block")},maybeprop:function(e,t,r){return":"==e?T(r,t,"prop"):N(e,t,r)},prop:function(e,t,r){if(";"==e)return M(r)
|
|
1295
|
+
if("{"==e&&y)return T(r,t,"propBlock")
|
|
1296
|
+
if("}"==e||"{"==e)return A(e,t,r)
|
|
1297
|
+
if("("==e)return T(r,t,"parens")
|
|
1298
|
+
if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)O(t)
|
|
1299
|
+
else if("interpolation"==e)return T(r,t,"interpolation")}else o+=" error"
|
|
1300
|
+
return"prop"},propBlock:function(e,t,r){return"}"==e?M(r):"word"==e?(o="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?A(e,t,r):")"==e?M(r):"("==e?T(r,t,"parens"):"interpolation"==e?T(r,t,"interpolation"):("word"==e&&O(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(o="variable-3",r.context.type):N(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(o="tag",r.context.type):W.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return T(r,t,"atBlock_parens")
|
|
1301
|
+
if("}"==e||";"==e)return A(e,t,r)
|
|
1302
|
+
if("{"==e)return M(r)&&T(r,t,y?"block":"top")
|
|
1303
|
+
if("interpolation"==e)return T(r,t,"interpolation")
|
|
1304
|
+
if("word"==e){var n=t.current().toLowerCase()
|
|
1305
|
+
o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":u.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":f.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?"string-2":v.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?A(e,t,r):"{"==e?M(r)&&T(r,t,y?"block":"top",!1):("word"==e&&(o="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?M(r):"{"==e||"}"==e?A(e,t,r,2):W.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?T(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(o="variable","restricted_atBlock_before"):N(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,M(r)):"word"==e?(o="@font-face"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(o="variable","keyframes"):"{"==e?T(r,t,"top"):N(e,t,r)},at:function(e,t,r){return";"==e?M(r):"{"==e||"}"==e?A(e,t,r):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?M(r):"{"==e||";"==e?A(e,t,r):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}}
|
|
1306
|
+
return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new L(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null
|
|
1307
|
+
var r=(t.tokenize||k)(e,t)
|
|
1308
|
+
return r&&"object"==typeof r&&(i=r[1],r=r[0]),o=r,"comment"!=i&&(t.state=W[t.state](i,e,t)),o},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent
|
|
1309
|
+
return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-a)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}))
|
|
1310
|
+
var r=["domain","regexp","url","url-prefix"],n=t(r),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=t(a),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(s),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(f),p=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(m),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=t(y),w=r.concat(i).concat(a).concat(s).concat(c).concat(f).concat(m).concat(y)
|
|
1311
|
+
function x(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null
|
|
1312
|
+
break}n="*"==r}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:g,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x,x(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x,x(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x,x(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:g,colorKeywords:v,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x,x(e,t))}},name:"css",helperType:"gss"})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}((function(e){"use strict"
|
|
1313
|
+
var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},r={}
|
|
1314
|
+
function n(e,t){var n=e.match(function(e){return r[e]||(r[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t))
|
|
1315
|
+
return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}e.defineMode("htmlmixed",(function(r,a){var l=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),s={},u=a&&a.tags,c=a&&a.scriptTypes
|
|
1316
|
+
if(o(t,s),u&&o(u,s),c)for(var d=c.length-1;d>=0;d--)s.script.unshift(["type",c[d].matches,c[d].mode])
|
|
1317
|
+
function f(t,o){var a,u=l.token(t,o.htmlState),c=/\btag\b/.test(u)
|
|
1318
|
+
if(c&&!/[<>\s\/]/.test(t.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(a))o.inTag=a+" "
|
|
1319
|
+
else if(o.inTag&&c&&/>$/.test(t.current())){var d=/^([\S]+) (.*)/.exec(o.inTag)
|
|
1320
|
+
o.inTag=null
|
|
1321
|
+
var h=">"==t.current()&&function(e,t){for(var r=0;r<e.length;r++){var i=e[r]
|
|
1322
|
+
if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}(s[d[1]],d[2]),p=e.getMode(r,h),g=i(d[1],!0),m=i(d[1],!1)
|
|
1323
|
+
o.token=function(e,t){return e.match(g,!1)?(t.token=f,t.localState=t.localMode=null,null):function(e,t,r){var n=e.current(),i=n.search(t)
|
|
1324
|
+
return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}(e,m,t.localMode.token(e,t.localState))},o.localMode=p,o.localState=e.startState(p,l.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "))
|
|
1325
|
+
return u}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:e.startState(l)}},copyState:function(t){var r
|
|
1326
|
+
return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,n){return!t.localMode||/^\s*<\//.test(r)?l.indent(t.htmlState,r,n):t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict"
|
|
1327
|
+
e.defineMode("javascript",(function(t,r){var n,i,o=t.indentUnit,a=r.statementIndent,l=r.jsonld,s=r.json||l,u=r.typescript,c=r.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"}
|
|
1328
|
+
return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/
|
|
1329
|
+
function p(e,t,r){return n=e,i=r,t}function g(e,t){var r,n=e.next()
|
|
1330
|
+
if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,i=!1
|
|
1331
|
+
if(l&&"@"==e.peek()&&e.match(h))return t.tokenize=g,p("jsonld-keyword","meta")
|
|
1332
|
+
for(;null!=(n=e.next())&&(n!=r||i);)i=!i&&"\\"==n
|
|
1333
|
+
return i||(t.tokenize=g),p("string","string")}),t.tokenize(e,t)
|
|
1334
|
+
if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return p("number","number")
|
|
1335
|
+
if("."==n&&e.match(".."))return p("spread","meta")
|
|
1336
|
+
if(/[\[\]{}\(\),;\:\.]/.test(n))return p(n)
|
|
1337
|
+
if("="==n&&e.eat(">"))return p("=>","operator")
|
|
1338
|
+
if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return p("number","number")
|
|
1339
|
+
if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),p("number","number")
|
|
1340
|
+
if("/"==n)return e.eat("*")?(t.tokenize=m,m(e,t)):e.eat("/")?(e.skipToEnd(),p("comment","comment")):Xe(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return
|
|
1341
|
+
"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),p("regexp","string-2")):(e.eat("="),p("operator","operator",e.current()))
|
|
1342
|
+
if("`"==n)return t.tokenize=v,v(e,t)
|
|
1343
|
+
if("#"==n)return e.skipToEnd(),p("error","error")
|
|
1344
|
+
if(f.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),p("operator","operator",e.current())
|
|
1345
|
+
if(c.test(n)){e.eatWhile(c)
|
|
1346
|
+
var i=e.current()
|
|
1347
|
+
if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i]
|
|
1348
|
+
return p(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return p("async","keyword",i)}return p("variable","variable",i)}}function m(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=g
|
|
1349
|
+
break}n="*"==r}return p("comment","comment")}function v(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=g
|
|
1350
|
+
break}n=!n&&"\\"==r}return p("quasi","string-2",e.current())}var y="([{}])"
|
|
1351
|
+
function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null)
|
|
1352
|
+
var r=e.string.indexOf("=>",e.start)
|
|
1353
|
+
if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r))
|
|
1354
|
+
n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=y.indexOf(l)
|
|
1355
|
+
if(s>=0&&s<3){if(!i){++a
|
|
1356
|
+
break}if(0==--i){"("==l&&(o=!0)
|
|
1357
|
+
break}}else if(s>=3&&s<6)++i
|
|
1358
|
+
else if(c.test(l))o=!0
|
|
1359
|
+
else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return
|
|
1360
|
+
if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--
|
|
1361
|
+
break}}else if(o&&!i){++a
|
|
1362
|
+
break}}o&&!i&&(t.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0}
|
|
1363
|
+
function x(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function k(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0
|
|
1364
|
+
for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var C={state:null,column:null,marked:null,cc:null}
|
|
1365
|
+
function S(){for(var e=arguments.length-1;e>=0;e--)C.cc.push(arguments[e])}function L(){return S.apply(null,arguments),!0}function T(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0
|
|
1366
|
+
return!1}function M(e){var t=C.state
|
|
1367
|
+
if(C.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=N(e,t.context)
|
|
1368
|
+
if(null!=n)return void(t.context=n)}else if(!T(e,t.localVars))return void(t.localVars=new W(e,t.localVars))
|
|
1369
|
+
r.globalVars&&!T(e,t.globalVars)&&(t.globalVars=new W(e,t.globalVars))}function N(e,t){if(t){if(t.block){var r=N(e,t.prev)
|
|
1370
|
+
return r?r==t.prev?t:new O(r,t.vars,!0):null}return T(e,t.vars)?t:new O(t.prev,new W(e,t.vars),!1)}return null}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function O(e,t,r){this.prev=e,this.vars=t,this.block=r}function W(e,t){this.name=e,this.next=t}var D=new W("this",new W("arguments",null))
|
|
1371
|
+
function z(){C.state.context=new O(C.state.context,C.state.localVars,!1),C.state.localVars=D}function P(){C.state.context=new O(C.state.context,C.state.localVars,!0),C.state.localVars=null}function H(){C.state.localVars=C.state.context.vars,C.state.context=C.state.context.prev}function I(e,t){var r=function(){var r=C.state,n=r.indented
|
|
1372
|
+
if("stat"==r.lexical.type)n=r.lexical.indented
|
|
1373
|
+
else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented
|
|
1374
|
+
r.lexical=new x(n,C.stream.column(),e,null,r.lexical,t)}
|
|
1375
|
+
return r.lex=!0,r}function E(){var e=C.state
|
|
1376
|
+
e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function F(e){return function t(r){return r==e?L():";"==e||"}"==r||")"==r||"]"==r?S():L(t)}}function R(e,t){return"var"==e?L(I("vardef",t),we,F(";"),E):"keyword a"==e?L(I("form"),K,R,E):"keyword b"==e?L(I("form"),R,E):"keyword d"==e?C.stream.match(/^\s*$/,!1)?L():L(I("stat"),U,F(";"),E):"debugger"==e?L(F(";")):"{"==e?L(I("}"),P,le,E,H):";"==e?L():"if"==e?("else"==C.state.lexical.info&&C.state.cc[C.state.cc.length-1]==E&&C.state.cc.pop()(),L(I("form"),K,R,E,Te)):"function"==e?L(Oe):"for"==e?L(I("form"),Me,R,E):"class"==e||u&&"interface"==t?(C.marked="keyword",L(I("form","class"==e?e:t),He,E)):"variable"==e?u&&"declare"==t?(C.marked="keyword",L(R)):u&&("module"==t||"enum"==t||"type"==t)&&C.stream.match(/^\s*\w/,!1)?(C.marked="keyword","enum"==t?L(_e):"type"==t?L(De,F("operator"),fe,F(";")):L(I("form"),xe,F("{"),I("}"),le,E,E)):u&&"namespace"==t?(C.marked="keyword",L(I("form"),j,R,E)):u&&"abstract"==t?(C.marked="keyword",L(R)):L(I("stat"),ee):"switch"==e?L(I("form"),K,F("{"),I("}","switch"),P,le,E,E,H):"case"==e?L(j,F(":")):"default"==e?L(F(":")):"catch"==e?L(I("form"),z,B,R,E,H):"export"==e?L(I("stat"),Re,E):"import"==e?L(I("stat"),je,E):"async"==e?L(R):"@"==t?L(j,R):S(I("stat"),j,F(";"),E)}function B(e){if("("==e)return L(ze,F(")"))}function j(e,t){return G(e,t,!1)}function V(e,t){return G(e,t,!0)}function K(e){return"("!=e?S():L(I(")"),j,F(")"),E)}function G(e,t,r){if(C.state.fatArrowAt==C.stream.start){var n=r?Z:Y
|
|
1377
|
+
if("("==e)return L(z,I(")"),oe(ze,")"),E,F("=>"),n,H)
|
|
1378
|
+
if("variable"==e)return S(z,xe,F("=>"),n,H)}var i=r?_:q
|
|
1379
|
+
return w.hasOwnProperty(e)?L(i):"function"==e?L(Oe,i):"class"==e||u&&"interface"==t?(C.marked="keyword",L(I("form"),Pe,E)):"keyword c"==e||"async"==e?L(r?V:j):"("==e?L(I(")"),U,F(")"),E,i):"operator"==e||"spread"==e?L(r?V:j):"["==e?L(I("]"),qe,E,i):"{"==e?ae(re,"}",null,i):"quasi"==e?S($,i):"new"==e?L(function(e){return function(t){return"."==t?L(e?J:Q):"variable"==t&&u?L(ve,e?_:q):S(e?V:j)}}(r)):"import"==e?L(j):L()}function U(e){return e.match(/[;\}\)\],]/)?S():S(j)}function q(e,t){return","==e?L(j):_(e,t,!1)}function _(e,t,r){var n=0==r?q:_,i=0==r?j:V
|
|
1380
|
+
return"=>"==e?L(z,r?Z:Y,H):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?L(n):u&&"<"==t&&C.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?L(I(">"),oe(fe,">"),E,n):"?"==t?L(j,F(":"),i):L(i):"quasi"==e?S($,n):";"!=e?"("==e?ae(V,")","call",n):"."==e?L(te,n):"["==e?L(I("]"),U,F("]"),E,n):u&&"as"==t?(C.marked="keyword",L(fe,n)):"regexp"==e?(C.state.lastType=C.marked="operator",C.stream.backUp(C.stream.pos-C.stream.start-1),L(i)):void 0:void 0}function $(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?L($):L(j,X)}function X(e){if("}"==e)return C.marked="string-2",C.state.tokenize=v,L($)}function Y(e){return b(C.stream,C.state),S("{"==e?R:j)}function Z(e){return b(C.stream,C.state),S("{"==e?R:V)}function Q(e,t){if("target"==t)return C.marked="keyword",L(q)}function J(e,t){if("target"==t)return C.marked="keyword",L(_)}function ee(e){return":"==e?L(E,R):S(q,F(";"),E)}function te(e){if("variable"==e)return C.marked="property",L()}function re(e,t){return"async"==e?(C.marked="property",L(re)):"variable"==e||"keyword"==C.style?(C.marked="property","get"==t||"set"==t?L(ne):(u&&C.state.fatArrowAt==C.stream.start&&(r=C.stream.match(/^\s*:\s*/,!1))&&(C.state.fatArrowAt=C.stream.pos+r[0].length),L(ie))):"number"==e||"string"==e?(C.marked=l?"property":C.style+" property",L(ie)):"jsonld-keyword"==e?L(ie):u&&A(t)?(C.marked="keyword",L(re)):"["==e?L(j,se,F("]"),ie):"spread"==e?L(V,ie):"*"==t?(C.marked="keyword",L(re)):":"==e?S(ie):void 0
|
|
1381
|
+
var r}function ne(e){return"variable"!=e?S(ie):(C.marked="property",L(Oe))}function ie(e){return":"==e?L(V):"("==e?S(Oe):void 0}function oe(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=C.state.lexical
|
|
1382
|
+
return"call"==a.info&&(a.pos=(a.pos||0)+1),L((function(r,n){return r==t||n==t?S():S(e)}),n)}return i==t||o==t?L():r&&r.indexOf(";")>-1?S(e):L(F(t))}return function(r,i){return r==t||i==t?L():S(e,n)}}function ae(e,t,r){for(var n=3;n<arguments.length;n++)C.cc.push(arguments[n])
|
|
1383
|
+
return L(I(t,r),oe(e,t),E)}function le(e){return"}"==e?L():S(R,le)}function se(e,t){if(u){if(":"==e)return L(fe)
|
|
1384
|
+
if("?"==t)return L(se)}}function ue(e,t){if(u&&(":"==e||"in"==t))return L(fe)}function ce(e){if(u&&":"==e)return C.stream.match(/^\s*\w+\s+is\b/,!1)?L(j,de,fe):L(fe)}function de(e,t){if("is"==t)return C.marked="keyword",L()}function fe(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(C.marked="keyword",L("typeof"==t?V:fe)):"variable"==e||"void"==t?(C.marked="type",L(me)):"|"==t||"&"==t?L(fe):"string"==e||"number"==e||"atom"==e?L(me):"["==e?L(I("]"),oe(fe,"]",","),E,me):"{"==e?L(I("}"),oe(pe,"}",",;"),E,me):"("==e?L(oe(ge,")"),he,me):"<"==e?L(oe(fe,">"),fe):void 0}function he(e){if("=>"==e)return L(fe)}function pe(e,t){return"variable"==e||"keyword"==C.style?(C.marked="property",L(pe)):"?"==t||"number"==e||"string"==e?L(pe):":"==e?L(fe):"["==e?L(F("variable"),ue,F("]"),pe):"("==e?S(We,pe):void 0}function ge(e,t){return"variable"==e&&C.stream.match(/^\s*[?:]/,!1)||"?"==t?L(ge):":"==e?L(fe):"spread"==e?L(ge):S(fe)}function me(e,t){return"<"==t?L(I(">"),oe(fe,">"),E,me):"|"==t||"."==e||"&"==t?L(fe):"["==e?L(fe,F("]"),me):"extends"==t||"implements"==t?(C.marked="keyword",L(fe)):"?"==t?L(fe,F(":"),fe):void 0}function ve(e,t){if("<"==t)return L(I(">"),oe(fe,">"),E,me)}function ye(){return S(fe,be)}function be(e,t){if("="==t)return L(fe)}function we(e,t){return"enum"==t?(C.marked="keyword",L(_e)):S(xe,se,Se,Le)}function xe(e,t){return u&&A(t)?(C.marked="keyword",L(xe)):"variable"==e?(M(t),L()):"spread"==e?L(xe):"["==e?ae(Ce,"]"):"{"==e?ae(ke,"}"):void 0}function ke(e,t){return"variable"!=e||C.stream.match(/^\s*:/,!1)?("variable"==e&&(C.marked="property"),"spread"==e?L(xe):"}"==e?S():"["==e?L(j,F("]"),F(":"),ke):L(F(":"),xe,Se)):(M(t),L(Se))}function Ce(){return S(xe,Se)}function Se(e,t){if("="==t)return L(V)}function Le(e){if(","==e)return L(we)}function Te(e,t){if("keyword b"==e&&"else"==t)return L(I("form","else"),R,E)}function Me(e,t){return"await"==t?L(Me):"("==e?L(I(")"),Ne,E):void 0}function Ne(e){return"var"==e?L(we,Ae):"variable"==e?L(Ae):S(Ae)}function Ae(e,t){return")"==e?L():";"==e?L(Ae):"in"==t||"of"==t?(C.marked="keyword",L(j,Ae)):S(j,Ae)}function Oe(e,t){return"*"==t?(C.marked="keyword",L(Oe)):"variable"==e?(M(t),L(Oe)):"("==e?L(z,I(")"),oe(ze,")"),E,ce,R,H):u&&"<"==t?L(I(">"),oe(ye,">"),E,Oe):void 0}function We(e,t){return"*"==t?(C.marked="keyword",L(We)):"variable"==e?(M(t),L(We)):"("==e?L(z,I(")"),oe(ze,")"),E,ce,H):u&&"<"==t?L(I(">"),oe(ye,">"),E,We):void 0}function De(e,t){return"keyword"==e||"variable"==e?(C.marked="type",L(De)):"<"==t?L(I(">"),oe(ye,">"),E):void 0}function ze(e,t){return"@"==t&&L(j,ze),"spread"==e?L(ze):u&&A(t)?(C.marked="keyword",L(ze)):u&&"this"==e?L(se,Se):S(xe,se,Se)}function Pe(e,t){return"variable"==e?He(e,t):Ie(e,t)}function He(e,t){if("variable"==e)return M(t),L(Ie)}function Ie(e,t){return"<"==t?L(I(">"),oe(ye,">"),E,Ie):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(C.marked="keyword"),L(u?fe:j,Ie)):"{"==e?L(I("}"),Ee,E):void 0}function Ee(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&A(t))&&C.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(C.marked="keyword",L(Ee)):"variable"==e||"keyword"==C.style?(C.marked="property",L(u?Fe:Oe,Ee)):"number"==e||"string"==e?L(u?Fe:Oe,Ee):"["==e?L(j,se,F("]"),u?Fe:Oe,Ee):"*"==t?(C.marked="keyword",L(Ee)):u&&"("==e?S(We,Ee):";"==e||","==e?L(Ee):"}"==e?L():"@"==t?L(j,Ee):void 0}function Fe(e,t){if("?"==t)return L(Fe)
|
|
1385
|
+
if(":"==e)return L(fe,Se)
|
|
1386
|
+
if("="==t)return L(V)
|
|
1387
|
+
var r=C.state.lexical.prev
|
|
1388
|
+
return S(r&&"interface"==r.info?We:Oe)}function Re(e,t){return"*"==t?(C.marked="keyword",L(Ue,F(";"))):"default"==t?(C.marked="keyword",L(j,F(";"))):"{"==e?L(oe(Be,"}"),Ue,F(";")):S(R)}function Be(e,t){return"as"==t?(C.marked="keyword",L(F("variable"))):"variable"==e?S(V,Be):void 0}function je(e){return"string"==e?L():"("==e?S(j):S(Ve,Ke,Ue)}function Ve(e,t){return"{"==e?ae(Ve,"}"):("variable"==e&&M(t),"*"==t&&(C.marked="keyword"),L(Ge))}function Ke(e){if(","==e)return L(Ve,Ke)}function Ge(e,t){if("as"==t)return C.marked="keyword",L(Ve)}function Ue(e,t){if("from"==t)return C.marked="keyword",L(j)}function qe(e){return"]"==e?L():S(oe(V,"]"))}function _e(){return S(I("form"),xe,F("{"),I("}"),oe($e,"}"),E,E)}function $e(){return S(xe,Se)}function Xe(e,t,r){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return H.lex=!0,E.lex=!0,{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new x((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new O(null,null,!1),indented:e||0}
|
|
1389
|
+
return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=m&&e.eatSpace())return null
|
|
1390
|
+
var r=t.tokenize(e,t)
|
|
1391
|
+
return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",function(e,t,r,n,i){var o=e.cc
|
|
1392
|
+
for(C.state=e,C.stream=i,C.marked=null,C.cc=o,C.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?j:R)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()()
|
|
1393
|
+
return C.marked?C.marked:"variable"==r&&k(e,n)?"variable-2":t}}(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==m)return e.Pass
|
|
1394
|
+
if(t.tokenize!=g)return 0
|
|
1395
|
+
var i,l=n&&n.charAt(0),s=t.lexical
|
|
1396
|
+
if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u]
|
|
1397
|
+
if(c==E)s=s.prev
|
|
1398
|
+
else if(c!=Te)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(i=t.cc[t.cc.length-1])&&(i==q||i==_)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev
|
|
1399
|
+
a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev)
|
|
1400
|
+
var d=s.type,h=l==d
|
|
1401
|
+
return"vardef"==d?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==d&&"{"==l?s.indented:"form"==d?s.indented+o:"stat"==d?s.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?a||o:0):"switch"!=s.info||h||0==r.doubleIndentSwitch?s.align?s.column+(h?0:1):s.indented+(h?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:Xe,skipExpression:function(e){var t=e.cc[e.cc.length-1]
|
|
1402
|
+
t!=j&&t!=V||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict"
|
|
1403
|
+
var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1}
|
|
1404
|
+
e.defineMode("xml",(function(n,i){var o,a,l=n.indentUnit,s={},u=i.htmlMode?t:r
|
|
1405
|
+
for(var c in u)s[c]=u[c]
|
|
1406
|
+
for(var c in i)s[c]=i[c]
|
|
1407
|
+
function d(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next()
|
|
1408
|
+
return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(h("atom","]]>")):null:e.match("--")?r(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(p(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var r,n,i=e.next()
|
|
1409
|
+
if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket"
|
|
1410
|
+
if("="==i)return o="equals",null
|
|
1411
|
+
if("<"==i){t.tokenize=d,t.state=y,t.tagName=t.tagStart=null
|
|
1412
|
+
var a=t.tokenize(e,t)
|
|
1413
|
+
return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(r=i,n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=f
|
|
1414
|
+
break}return"string"},n.isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d
|
|
1415
|
+
break}r.next()}return e}}function p(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=p(e+1),r.tokenize(t,r)
|
|
1416
|
+
if(">"==n){if(1==e){r.tokenize=d
|
|
1417
|
+
break}return r.tokenize=p(e-1),r.tokenize(t,r)}}return"meta"}}function g(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var r;;){if(!e.context)return
|
|
1418
|
+
if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(r)||!s.contextGrabbers[r].hasOwnProperty(t))return
|
|
1419
|
+
m(e)}}function y(e,t,r){return"openTag"==e?(r.tagStart=t.column(),b):"closeTag"==e?w:y}function b(e,t,r){return"word"==e?(r.tagName=t.current(),a="tag",C):s.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,r)):(a="error",b)}function w(e,t,r){if("word"==e){var n=t.current()
|
|
1420
|
+
return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(r.context.tagName)&&m(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(a="tag",x):(a="tag error",k)}return s.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,t,r)):(a="error",k)}function x(e,t,r){return"endTag"!=e?(a="error",x):(m(r),y)}function k(e,t,r){return a="error",x(e,0,r)}function C(e,t,r){if("word"==e)return a="attribute",S
|
|
1421
|
+
if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart
|
|
1422
|
+
return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(n)?v(r,n):(v(r,n),r.context=new g(r,n,i==r.indented)),y}return a="error",C}function S(e,t,r){return"equals"==e?L:(s.allowMissing||(a="error"),C(e,0,r))}function L(e,t,r){return"string"==e?T:"word"==e&&s.allowUnquoted?(a="string",C):(a="error",C(e,0,r))}function T(e,t,r){return"string"==e?T:C(e,0,r)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:y,indented:e||0,tagName:null,tagStart:null,context:null}
|
|
1423
|
+
return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null
|
|
1424
|
+
o=null
|
|
1425
|
+
var r=t.tokenize(e,t)
|
|
1426
|
+
return(r||o)&&"comment"!=r&&(a=null,t.state=t.state(o||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(t,r,n){var i=t.context
|
|
1427
|
+
if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l
|
|
1428
|
+
if(i&&i.noIndent)return e.Pass
|
|
1429
|
+
if(t.tokenize!=f&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0
|
|
1430
|
+
if(t.tagName)return!1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1)
|
|
1431
|
+
if(s.alignCDATA&&/<!\[CDATA\[/.test(r))return 0
|
|
1432
|
+
var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r)
|
|
1433
|
+
if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev
|
|
1434
|
+
break}if(!s.implicitlyClosed.hasOwnProperty(i.tagName))break
|
|
1435
|
+
i=i.prev}else if(o)for(;i;){var a=s.contextGrabbers[i.tagName]
|
|
1436
|
+
if(!a||!a.hasOwnProperty(o[2]))break
|
|
1437
|
+
i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev
|
|
1438
|
+
return i?i.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==L&&(e.state=C)}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}))
|
|
1439
|
+
|
|
1440
|
+
//# sourceMappingURL=codemirror-31d641cdd0cb3388688402609608cb10.map
|