diff --git a/public/assets/font-awesome-4.6.3/css/font-awesome.min.css b/public/assets/font-awesome-4.6.3/css/font-awesome.min.css deleted file mode 100644 index 9b27f8ea8..000000000 --- a/public/assets/font-awesome-4.6.3/css/font-awesome.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.6.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/public/assets/font-awesome-4.6.3/fonts/FontAwesome.otf b/public/assets/font-awesome-4.6.3/fonts/FontAwesome.otf deleted file mode 100644 index d4de13e83..000000000 Binary files a/public/assets/font-awesome-4.6.3/fonts/FontAwesome.otf and /dev/null differ diff --git a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.eot b/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.eot deleted file mode 100644 index c7b00d2ba..000000000 Binary files a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.svg b/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.svg deleted file mode 100644 index 8b66187fe..000000000 --- a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,685 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf b/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf deleted file mode 100644 index f221e50a2..000000000 Binary files a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff b/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff deleted file mode 100644 index 6e7483cf6..000000000 Binary files a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 b/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 7eb74fd12..000000000 Binary files a/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/public/assets/octicons-4.3.0/octicons.eot b/public/assets/octicons-4.3.0/octicons.eot deleted file mode 100755 index b4c7a989a..000000000 Binary files a/public/assets/octicons-4.3.0/octicons.eot and /dev/null differ diff --git a/public/assets/octicons-4.3.0/octicons.min.css b/public/assets/octicons-4.3.0/octicons.min.css deleted file mode 100755 index a000669c9..000000000 --- a/public/assets/octicons-4.3.0/octicons.min.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Octicons;src:url(octicons.eot?ef21c39f0ca9b1b5116e5eb7ac5eabe6);src:url(octicons.eot?#iefix) format("embedded-opentype"),url(octicons.woff2?ef21c39f0ca9b1b5116e5eb7ac5eabe6) format("woff2"),url(octicons.woff?ef21c39f0ca9b1b5116e5eb7ac5eabe6) format("woff"),url(octicons.ttf?ef21c39f0ca9b1b5116e5eb7ac5eabe6) format("truetype"),url(octicons.svg?ef21c39f0ca9b1b5116e5eb7ac5eabe6#octicons) format("svg");font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 Octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-ms-user-select:none;user-select:none;speak:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:"\f02d"}.octicon-arrow-down:before{content:"\f03f"}.octicon-arrow-left:before{content:"\f040"}.octicon-arrow-right:before{content:"\f03e"}.octicon-arrow-small-down:before{content:"\f0a0"}.octicon-arrow-small-left:before{content:"\f0a1"}.octicon-arrow-small-right:before{content:"\f071"}.octicon-arrow-small-up:before{content:"\f09f"}.octicon-arrow-up:before{content:"\f03d"}.octicon-beaker:before{content:"\f0dd"}.octicon-bell:before{content:"\f0de"}.octicon-bold:before{content:"\f0e2"}.octicon-book:before{content:"\f007"}.octicon-bookmark:before{content:"\f07b"}.octicon-briefcase:before{content:"\f0d3"}.octicon-broadcast:before{content:"\f048"}.octicon-browser:before{content:"\f0c5"}.octicon-bug:before{content:"\f091"}.octicon-calendar:before{content:"\f068"}.octicon-check:before{content:"\f03a"}.octicon-checklist:before{content:"\f076"}.octicon-chevron-down:before{content:"\f0a3"}.octicon-chevron-left:before{content:"\f0a4"}.octicon-chevron-right:before{content:"\f078"}.octicon-chevron-up:before{content:"\f0a2"}.octicon-circle-slash:before{content:"\f084"}.octicon-circuit-board:before{content:"\f0d6"}.octicon-clippy:before{content:"\f035"}.octicon-clock:before{content:"\f046"}.octicon-cloud-download:before{content:"\f00b"}.octicon-cloud-upload:before{content:"\f00c"}.octicon-code:before{content:"\f05f"}.octicon-comment-discussion:before{content:"\f04f"}.octicon-comment:before{content:"\f02b"}.octicon-credit-card:before{content:"\f045"}.octicon-dash:before{content:"\f0ca"}.octicon-dashboard:before{content:"\f07d"}.octicon-database:before{content:"\f096"}.octicon-desktop-download:before{content:"\f0dc"}.octicon-device-camera-video:before{content:"\f057"}.octicon-device-camera:before{content:"\f056"}.octicon-device-desktop:before{content:"\f27c"}.octicon-device-mobile:before{content:"\f038"}.octicon-diff-added:before{content:"\f06b"}.octicon-diff-ignored:before{content:"\f099"}.octicon-diff-modified:before{content:"\f06d"}.octicon-diff-removed:before{content:"\f06c"}.octicon-diff-renamed:before{content:"\f06e"}.octicon-diff:before{content:"\f04d"}.octicon-ellipses:before{content:"\f101"}.octicon-ellipsis:before{content:"\f09a"}.octicon-eye:before{content:"\f04e"}.octicon-file-binary:before{content:"\f094"}.octicon-file-code:before{content:"\f010"}.octicon-file-directory:before{content:"\f016"}.octicon-file-media:before{content:"\f012"}.octicon-file-pdf:before{content:"\f014"}.octicon-file-submodule:before{content:"\f017"}.octicon-file-symlink-directory:before{content:"\f0b1"}.octicon-file-symlink-file:before{content:"\f0b0"}.octicon-file-text:before{content:"\f011"}.octicon-file-zip:before{content:"\f013"}.octicon-file:before{content:"\f102"}.octicon-flame:before{content:"\f0d2"}.octicon-fold:before{content:"\f0cc"}.octicon-gear:before{content:"\f02f"}.octicon-gift:before{content:"\f042"}.octicon-gist-secret:before{content:"\f08c"}.octicon-gist:before{content:"\f00e"}.octicon-git-branch:before{content:"\f020"}.octicon-git-commit:before{content:"\f01f"}.octicon-git-compare:before{content:"\f0ac"}.octicon-git-merge:before{content:"\f023"}.octicon-git-pull-request:before{content:"\f009"}.octicon-globe:before{content:"\f0b6"}.octicon-grabber:before{content:"\f103"}.octicon-graph:before{content:"\f043"}.octicon-heart:before{content:"\2665"}.octicon-history:before{content:"\f07e"}.octicon-home:before{content:"\f08d"}.octicon-horizontal-rule:before{content:"\f070"}.octicon-hubot:before{content:"\f09d"}.octicon-inbox:before{content:"\f0cf"}.octicon-info:before{content:"\f059"}.octicon-issue-closed:before{content:"\f028"}.octicon-issue-opened:before{content:"\f026"}.octicon-issue-reopened:before{content:"\f027"}.octicon-italic:before{content:"\f0e4"}.octicon-jersey:before{content:"\f019"}.octicon-key:before{content:"\f049"}.octicon-keyboard:before{content:"\f00d"}.octicon-law:before{content:"\f0d8"}.octicon-light-bulb:before{content:"\f000"}.octicon-link-external:before{content:"\f07f"}.octicon-link:before{content:"\f05c"}.octicon-list-ordered:before{content:"\f062"}.octicon-list-unordered:before{content:"\f061"}.octicon-location:before{content:"\f060"}.octicon-lock:before{content:"\f06a"}.octicon-logo-gist:before{content:"\f0ad"}.octicon-logo-github:before{content:"\f092"}.octicon-mail-read:before{content:"\f03c"}.octicon-mail-reply:before{content:"\f051"}.octicon-mail:before{content:"\f03b"}.octicon-mark-github:before{content:"\f00a"}.octicon-markdown:before{content:"\f0c9"}.octicon-megaphone:before{content:"\f077"}.octicon-mention:before{content:"\f0be"}.octicon-milestone:before{content:"\f075"}.octicon-mirror:before{content:"\f024"}.octicon-mortar-board:before{content:"\f0d7"}.octicon-mute:before{content:"\f080"}.octicon-no-newline:before{content:"\f09c"}.octicon-octoface:before{content:"\f008"}.octicon-organization:before{content:"\f037"}.octicon-package:before{content:"\f0c4"}.octicon-paintcan:before{content:"\f0d1"}.octicon-pencil:before{content:"\f058"}.octicon-person:before{content:"\f018"}.octicon-pin:before{content:"\f041"}.octicon-plug:before{content:"\f0d4"}.octicon-plus-small:before{content:"\f104"}.octicon-plus:before{content:"\f05d"}.octicon-primitive-dot:before{content:"\f052"}.octicon-primitive-square:before{content:"\f053"}.octicon-pulse:before{content:"\f085"}.octicon-question:before{content:"\f02c"}.octicon-quote:before{content:"\f063"}.octicon-radio-tower:before{content:"\f030"}.octicon-reply:before{content:"\f105"}.octicon-repo-clone:before{content:"\f04c"}.octicon-repo-force-push:before{content:"\f04a"}.octicon-repo-forked:before{content:"\f002"}.octicon-repo-pull:before{content:"\f006"}.octicon-repo-push:before{content:"\f005"}.octicon-repo:before{content:"\f001"}.octicon-rocket:before{content:"\f033"}.octicon-rss:before{content:"\f034"}.octicon-ruby:before{content:"\f047"}.octicon-search:before{content:"\f02e"}.octicon-server:before{content:"\f097"}.octicon-settings:before{content:"\f07c"}.octicon-shield:before{content:"\f0e1"}.octicon-sign-in:before{content:"\f036"}.octicon-sign-out:before{content:"\f032"}.octicon-smiley:before{content:"\f0e7"}.octicon-squirrel:before{content:"\f0b2"}.octicon-star:before{content:"\f02a"}.octicon-stop:before{content:"\f08f"}.octicon-sync:before{content:"\f087"}.octicon-tag:before{content:"\f015"}.octicon-tasklist:before{content:"\f0e5"}.octicon-telescope:before{content:"\f088"}.octicon-terminal:before{content:"\f0c8"}.octicon-text-size:before{content:"\f0e3"}.octicon-three-bars:before{content:"\f05e"}.octicon-thumbsdown:before{content:"\f0db"}.octicon-thumbsup:before{content:"\f0da"}.octicon-tools:before{content:"\f031"}.octicon-trashcan:before{content:"\f0d0"}.octicon-triangle-down:before{content:"\f05b"}.octicon-triangle-left:before{content:"\f044"}.octicon-triangle-right:before{content:"\f05a"}.octicon-triangle-up:before{content:"\f0aa"}.octicon-unfold:before{content:"\f039"}.octicon-unmute:before{content:"\f0ba"}.octicon-unverified:before{content:"\f0e8"}.octicon-verified:before{content:"\f0e6"}.octicon-versions:before{content:"\f064"}.octicon-watch:before{content:"\f0e0"}.octicon-x:before{content:"\f081"}.octicon-zap:before{content:"\26a1"} \ No newline at end of file diff --git a/public/assets/octicons-4.3.0/octicons.svg b/public/assets/octicons-4.3.0/octicons.svg deleted file mode 100755 index 41cbd3f1f..000000000 --- a/public/assets/octicons-4.3.0/octicons.svg +++ /dev/null @@ -1,429 +0,0 @@ - - - - -Created by FontForge 20150913 at Mon Jul 11 12:02:11 2016 - By Aaron Shekey - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/octicons-4.3.0/octicons.ttf b/public/assets/octicons-4.3.0/octicons.ttf deleted file mode 100755 index ff0dda184..000000000 Binary files a/public/assets/octicons-4.3.0/octicons.ttf and /dev/null differ diff --git a/public/assets/octicons-4.3.0/octicons.woff b/public/assets/octicons-4.3.0/octicons.woff deleted file mode 100755 index 01aa43d77..000000000 Binary files a/public/assets/octicons-4.3.0/octicons.woff and /dev/null differ diff --git a/public/assets/octicons-4.3.0/octicons.woff2 b/public/assets/octicons-4.3.0/octicons.woff2 deleted file mode 100755 index 69e7b2a40..000000000 Binary files a/public/assets/octicons-4.3.0/octicons.woff2 and /dev/null differ diff --git a/public/css/semantic-2.2.1.min.css b/public/css/semantic-2.2.1.min.css deleted file mode 100755 index 6f913e14a..000000000 --- a/public/css/semantic-2.2.1.min.css +++ /dev/null @@ -1,11 +0,0 @@ - /* - * # Semantic UI - 2.2.1 - * https://github.com/Semantic-Org/Semantic-UI - * http://www.semantic-ui.com/ - * - * Copyright 2014 Contributors - * Released under the MIT license - * http://opensource.org/licenses/MIT - * - */ -*,:after,:before{box-sizing:inherit}html{box-sizing:border-box;font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}input[type=text],input[type=email],input[type=search],input[type=password]{-webkit-appearance:none;-moz-appearance:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0;color:#4183C4;text-decoration:none}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}dfn{font-style:italic}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,html{height:100%}html{font-size:14px}body{margin:0;padding:0;overflow-x:hidden;min-width:320px;background:#FFF;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:14px;line-height:1.4285em;color:rgba(0,0,0,.87);font-smoothing:antialiased}h1,h2,h3,h4,h5{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;line-height:1.2857em;margin:calc(2rem - .14285em) 0 1rem;font-weight:700;padding:0}h1{min-height:1rem;font-size:2rem}h2{font-size:1.714rem}h3{font-size:1.28rem}h4{font-size:1.071rem}h5{font-size:1rem}h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,p:first-child{margin-top:0}h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,p:last-child{margin-bottom:0}p{margin:0 0 1em;line-height:1.4285em}a:hover{color:#1e70bf;text-decoration:none}::-webkit-selection{background-color:#CCE2FF;color:rgba(0,0,0,.87)}::-moz-selection{background-color:#CCE2FF;color:rgba(0,0,0,.87)}::selection{background-color:#CCE2FF;color:rgba(0,0,0,.87)}input::-webkit-selection,textarea::-webkit-selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}input::-moz-selection,textarea::-moz-selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}input::selection,textarea::selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}.ui.button{cursor:pointer;display:inline-block;min-height:1em;outline:0;border:none;vertical-align:baseline;background:#E0E1E2;color:rgba(0,0,0,.6);font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;margin:0 .25em 0 0;padding:.78571429em 1.5em;text-transform:none;text-shadow:none;font-weight:700;line-height:1em;font-style:normal;text-align:center;text-decoration:none;border-radius:.28571429rem;box-shadow:0 0 0 1px transparent inset,0 0 0 0 rgba(34,36,38,.15) inset;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;will-change:'';-webkit-tap-highlight-color:transparent}.ui.button:hover{background-color:#CACBCD;background-image:none;box-shadow:0 0 0 1px transparent inset,0 0 0 0 rgba(34,36,38,.15) inset;color:rgba(0,0,0,.8)}.ui.button:hover .icon{opacity:.85}.ui.button:focus{background-color:#CACBCD;color:rgba(0,0,0,.8);background-image:''!important;box-shadow:''!important}.ui.button:focus .icon{opacity:.85}.ui.active.button:active,.ui.button:active{background-color:#BABBBC;background-image:'';color:rgba(0,0,0,.9);box-shadow:0 0 0 1px transparent inset,none}.ui.active.button{background-color:#C0C1C2;background-image:none;box-shadow:0 0 0 1px transparent inset;color:rgba(0,0,0,.95)}.ui.active.button:hover{background-color:#C0C1C2;background-image:none;color:rgba(0,0,0,.95)}.ui.active.button:active{background-color:#C0C1C2;background-image:none}.ui.loading.loading.loading.loading.loading.loading.button{position:relative;cursor:default;text-shadow:none!important;color:transparent!important;opacity:1;pointer-events:auto;-webkit-transition:all 0s linear,opacity .1s ease;transition:all 0s linear,opacity .1s ease}.ui.loading.button:before{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;border-radius:500rem;border:.2em solid rgba(0,0,0,.15)}.ui.loading.button:after{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;-webkit-animation:button-spin .6s linear;animation:button-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#FFF transparent transparent;border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent}.ui.labeled.icon.loading.button .icon{background-color:transparent;box-shadow:none}@-webkit-keyframes button-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes button-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.basic.loading.button:not(.inverted):before{border-color:rgba(0,0,0,.1)}.ui.basic.loading.button:not(.inverted):after{border-top-color:#767676}.ui.button:disabled,.ui.buttons .disabled.button,.ui.disabled.active.button,.ui.disabled.button,.ui.disabled.button:hover{cursor:default;opacity:.45!important;background-image:none!important;box-shadow:none!important;pointer-events:none!important}.ui.basic.buttons .ui.disabled.button{border-color:rgba(34,36,38,.5)}.ui.animated.button{position:relative;overflow:hidden;padding-right:0!important;vertical-align:middle;z-index:1}.ui.animated.button .content{will-change:transform,opacity}.ui.animated.button .visible.content{position:relative;margin-right:1.5em;left:auto;right:0}.ui.animated.button .hidden.content{position:absolute;width:100%;top:50%;left:auto;right:-100%;margin-top:-.5em}.ui.animated.button .hidden.content,.ui.animated.button .visible.content{-webkit-transition:right .3s ease 0s;transition:right .3s ease 0s}.ui.animated.button:focus .visible.content,.ui.animated.button:hover .visible.content{left:auto;right:200%}.ui.animated.button:focus .hidden.content,.ui.animated.button:hover .hidden.content{left:auto;right:0}.ui.vertical.animated.button .hidden.content,.ui.vertical.animated.button .visible.content{-webkit-transition:top .3s ease,-webkit-transform .3s ease;transition:top .3s ease,-webkit-transform .3s ease;transition:top .3s ease,transform .3s ease;transition:top .3s ease,transform .3s ease,-webkit-transform .3s ease}.ui.vertical.animated.button .visible.content{-webkit-transform:translateY(0);transform:translateY(0);right:auto}.ui.vertical.animated.button .hidden.content{top:-50%;left:0;right:auto}.ui.vertical.animated.button:focus .visible.content,.ui.vertical.animated.button:hover .visible.content{-webkit-transform:translateY(200%);transform:translateY(200%);right:auto}.ui.vertical.animated.button:focus .hidden.content,.ui.vertical.animated.button:hover .hidden.content{top:50%;right:auto}.ui.fade.animated.button .hidden.content,.ui.fade.animated.button .visible.content{-webkit-transition:opacity .3s ease,-webkit-transform .3s ease;transition:opacity .3s ease,-webkit-transform .3s ease;transition:opacity .3s ease,transform .3s ease;transition:opacity .3s ease,transform .3s ease,-webkit-transform .3s ease}.ui.fade.animated.button .visible.content{left:auto;right:auto;opacity:1;-webkit-transform:scale(1);transform:scale(1)}.ui.fade.animated.button .hidden.content{opacity:0;left:0;right:auto;-webkit-transform:scale(1.5);transform:scale(1.5)}.ui.fade.animated.button:focus .visible.content,.ui.fade.animated.button:hover .visible.content{left:auto;right:auto;opacity:0;-webkit-transform:scale(.75);transform:scale(.75)}.ui.fade.animated.button:focus .hidden.content,.ui.fade.animated.button:hover .hidden.content{left:0;right:auto;opacity:1;-webkit-transform:scale(1);transform:scale(1)}.ui.inverted.button{box-shadow:0 0 0 2px #FFF inset!important;background:0 0;color:#FFF;text-shadow:none!important}.ui.inverted.buttons .button{margin:0 0 0 -2px}.ui.inverted.buttons .button:first-child{margin-left:0}.ui.inverted.vertical.buttons .button{margin:0 0 -2px}.ui.inverted.vertical.buttons .button:first-child{margin-top:0}.ui.inverted.button.active,.ui.inverted.button:focus,.ui.inverted.button:hover{background:#FFF;box-shadow:0 0 0 2px #FFF inset!important;color:rgba(0,0,0,.8)}.ui.inverted.button.active:focus{background:#DCDDDE;box-shadow:0 0 0 2px #DCDDDE inset!important;color:rgba(0,0,0,.8)}.ui.labeled.button:not(.icon){display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;background:0 0!important;padding:0!important;border:none!important;box-shadow:none!important}.ui.labeled.button>.button{margin:0}.ui.labeled.button>.label{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:0 0 0 -1px!important;padding:'';font-size:1em;border-color:rgba(34,36,38,.15)}.ui.labeled.button>.tag.label:before{width:1.85em;height:1.85em}.ui.labeled.button:not([class*="left labeled"])>.button{border-top-right-radius:0;border-bottom-right-radius:0}.ui.labeled.button:not([class*="left labeled"])>.label,.ui[class*="left labeled"].button>.button{border-top-left-radius:0;border-bottom-left-radius:0}.ui[class*="left labeled"].button>.label{border-top-right-radius:0;border-bottom-right-radius:0}.ui.facebook.button{background-color:#3B5998;color:#FFF;text-shadow:none;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.facebook.button:hover{background-color:#304d8a;color:#FFF;text-shadow:none}.ui.facebook.button:active{background-color:#2d4373;color:#FFF;text-shadow:none}.ui.twitter.button{background-color:#0084B4;color:#FFF;text-shadow:none;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.twitter.button:hover{background-color:#00719b;color:#FFF;text-shadow:none}.ui.twitter.button:active{background-color:#005f81;color:#FFF;text-shadow:none}.ui.google.plus.button{background-color:#DC4A38;color:#FFF;text-shadow:none;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.google.plus.button:hover{background-color:#de321d;color:#FFF;text-shadow:none}.ui.google.plus.button:active{background-color:#bf3322;color:#FFF;text-shadow:none}.ui.linkedin.button{background-color:#1F88BE;color:#FFF;text-shadow:none}.ui.linkedin.button:hover{background-color:#147baf;color:#FFF;text-shadow:none}.ui.linkedin.button:active{background-color:#186992;color:#FFF;text-shadow:none}.ui.youtube.button{background-color:#CC181E;color:#FFF;text-shadow:none;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.youtube.button:hover{background-color:#bd0d13;color:#FFF;text-shadow:none}.ui.youtube.button:active{background-color:#9e1317;color:#FFF;text-shadow:none}.ui.instagram.button{background-color:#49769C;color:#FFF;text-shadow:none;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.instagram.button:hover{background-color:#3d698e;color:#FFF;text-shadow:none}.ui.instagram.button:active{background-color:#395c79;color:#FFF;text-shadow:none}.ui.pinterest.button{background-color:#00ACED;color:#FFF;text-shadow:none;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.pinterest.button:hover{background-color:#0099d4;color:#FFF;text-shadow:none}.ui.pinterest.button:active{background-color:#0087ba;color:#FFF;text-shadow:none}.ui.vk.button{background-color:#4D7198;color:#FFF;background-image:none;box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.vk.button:hover{background-color:#41648a;color:#FFF}.ui.vk.button:active{background-color:#3c5876;color:#FFF}.ui.button>.icon:not(.button){height:.85714286em;opacity:.8;margin:0 .42857143em 0 -.21428571em;-webkit-transition:opacity .1s ease;transition:opacity .1s ease;vertical-align:'';color:''}.ui.button:not(.icon)>.icon:not(.button){margin:0 .42857143em 0 -.21428571em}.ui.button:not(.icon)>.right.icon:not(.button){margin:0 -.21428571em 0 .42857143em}.ui[class*="left floated"].button,.ui[class*="left floated"].buttons{float:left;margin-left:0;margin-right:.25em}.ui[class*="right floated"].button,.ui[class*="right floated"].buttons{float:right;margin-right:0;margin-left:.25em}.ui.compact.button,.ui.compact.buttons .button{padding:.58928571em 1.125em}.ui.compact.icon.button,.ui.compact.icon.buttons .button{padding:.58928571em}.ui.compact.labeled.icon.button,.ui.compact.labeled.icon.buttons .button{padding:.58928571em 3.69642857em}.ui.mini.button,.ui.mini.buttons .button,.ui.mini.buttons .or{font-size:.78571429rem}.ui.tiny.button,.ui.tiny.buttons .button,.ui.tiny.buttons .or{font-size:.85714286rem}.ui.small.button,.ui.small.buttons .button,.ui.small.buttons .or{font-size:.92857143rem}.ui.button,.ui.buttons .button,.ui.buttons .or{font-size:1rem}.ui.large.button,.ui.large.buttons .button,.ui.large.buttons .or{font-size:1.14285714rem}.ui.big.button,.ui.big.buttons .button,.ui.big.buttons .or{font-size:1.28571429rem}.ui.huge.button,.ui.huge.buttons .button,.ui.huge.buttons .or{font-size:1.42857143rem}.ui.massive.button,.ui.massive.buttons .button,.ui.massive.buttons .or{font-size:1.71428571rem}.ui.icon.button,.ui.icon.buttons .button{padding:.78571429em}.ui.icon.button>.icon,.ui.icon.buttons .button>.icon{opacity:.9;margin:0;vertical-align:top}.ui.basic.button,.ui.basic.buttons .button{background:0 0!important;color:rgba(0,0,0,.6)!important;font-weight:400;border-radius:.28571429rem;text-transform:none;text-shadow:none!important;box-shadow:0 0 0 1px rgba(34,36,38,.15) inset}.ui.basic.buttons{box-shadow:none;border:1px solid rgba(34,36,38,.15);border-radius:.28571429rem}.ui.basic.button:focus,.ui.basic.button:hover,.ui.basic.buttons .button:focus,.ui.basic.buttons .button:hover{background:#FFF!important;color:rgba(0,0,0,.8)!important;box-shadow:0 0 0 1px rgba(34,36,38,.35) inset,0 0 0 0 rgba(34,36,38,.15) inset}.ui.basic.button:active,.ui.basic.buttons .button:active{background:#F8F8F8!important;color:rgba(0,0,0,.9)!important;box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 1px 4px 0 rgba(34,36,38,.15) inset}.ui.basic.active.button,.ui.basic.buttons .active.button{background:rgba(0,0,0,.05)!important;box-shadow:''!important;color:rgba(0,0,0,.95)}.ui.basic.active.button:hover,.ui.basic.buttons .active.button:hover{background-color:rgba(0,0,0,.05)}.ui.basic.buttons .button:hover{box-shadow:0 0 0 1px rgba(34,36,38,.35) inset,0 0 0 0 rgba(34,36,38,.15) inset inset}.ui.basic.buttons .button:active{box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 1px 4px 0 rgba(34,36,38,.15) inset inset}.ui.basic.buttons .active.button{box-shadow:rgba(34,36,38,.35) inset}.ui.basic.inverted.button,.ui.basic.inverted.buttons .button{background-color:transparent!important;color:#F9FAFB!important;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important}.ui.basic.inverted.button:focus,.ui.basic.inverted.button:hover,.ui.basic.inverted.buttons .button:focus,.ui.basic.inverted.buttons .button:hover{color:#FFF!important;box-shadow:0 0 0 2px #fff inset!important}.ui.basic.inverted.button:active,.ui.basic.inverted.buttons .button:active{background-color:rgba(255,255,255,.08)!important;color:#FFF!important;box-shadow:0 0 0 2px rgba(255,255,255,.9) inset!important}.ui.basic.inverted.active.button,.ui.basic.inverted.buttons .active.button{background-color:rgba(255,255,255,.08);color:#FFF;text-shadow:none;box-shadow:0 0 0 2px rgba(255,255,255,.7) inset}.ui.basic.inverted.active.button:hover,.ui.basic.inverted.buttons .active.button:hover{background-color:rgba(255,255,255,.15);box-shadow:0 0 0 2px #fff inset!important}.ui.basic.buttons .button{border-radius:0;border-left:1px solid rgba(34,36,38,.15);box-shadow:none}.ui.basic.vertical.buttons .button{border-left:none;border-left-width:0;border-top:1px solid rgba(34,36,38,.15)}.ui.basic.vertical.buttons .button:first-child{border-top-width:0}.ui.labeled.icon.button,.ui.labeled.icon.buttons .button{position:relative;padding-left:4.07142857em!important;padding-right:1.5em!important}.ui.labeled.icon.button>.icon,.ui.labeled.icon.buttons>.button>.icon{position:absolute;height:100%;line-height:1;border-radius:0;border-top-left-radius:inherit;border-bottom-left-radius:inherit;text-align:center;margin:0;width:2.57142857em;background-color:rgba(0,0,0,.05);color:'';box-shadow:-1px 0 0 0 transparent inset;top:0;left:0}.ui[class*="right labeled"].icon.button{padding-right:4.07142857em!important;padding-left:1.5em!important}.ui[class*="right labeled"].icon.button>.icon{left:auto;right:0;border-radius:0;border-top-right-radius:inherit;border-bottom-right-radius:inherit;box-shadow:1px 0 0 0 transparent inset}.ui.labeled.icon.button>.icon:after,.ui.labeled.icon.button>.icon:before,.ui.labeled.icon.buttons>.button>.icon:after,.ui.labeled.icon.buttons>.button>.icon:before{display:block;position:absolute;width:100%;top:50%;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.ui.labeled.icon.buttons .button>.icon{border-radius:0}.ui.labeled.icon.buttons .button:first-child>.icon{border-top-left-radius:.28571429rem;border-bottom-left-radius:.28571429rem}.ui.labeled.icon.buttons .button:last-child>.icon{border-top-right-radius:.28571429rem;border-bottom-right-radius:.28571429rem}.ui.vertical.labeled.icon.buttons .button:first-child>.icon{border-radius:.28571429rem 0 0}.ui.vertical.labeled.icon.buttons .button:last-child>.icon{border-radius:0 0 0 .28571429rem}.ui.fluid[class*="left labeled"].icon.button,.ui.fluid[class*="right labeled"].icon.button{padding-left:1.5em!important;padding-right:1.5em!important}.ui.button.toggle.active,.ui.buttons .button.toggle.active,.ui.toggle.buttons .active.button{background-color:#21BA45!important;box-shadow:none!important;text-shadow:none;color:#FFF!important}.ui.button.toggle.active:hover{background-color:#16ab39!important;text-shadow:none;color:#FFF!important}.ui.circular.button{border-radius:10em}.ui.circular.button>.icon{width:1em;vertical-align:baseline}.ui.buttons .or{position:relative;width:.3em;height:2.57142857em;z-index:3}.ui.buttons .or:before{position:absolute;text-align:center;border-radius:500rem;content:'or';top:50%;left:50%;background-color:#FFF;text-shadow:none;margin-top:-.89285714em;margin-left:-.89285714em;width:1.78571429em;height:1.78571429em;line-height:1.78571429em;color:rgba(0,0,0,.4);font-style:normal;font-weight:700;box-shadow:0 0 0 1px transparent inset}.ui.buttons .or[data-text]:before{content:attr(data-text)}.ui.fluid.buttons .or{width:0!important}.ui.fluid.buttons .or:after{display:none}.ui.attached.button{position:relative;display:block;margin:0;border-radius:0;box-shadow:0 0 0 1px rgba(34,36,38,.15)!important}.ui.attached.top.button{border-radius:.28571429rem .28571429rem 0 0}.ui.attached.bottom.button{border-radius:0 0 .28571429rem .28571429rem}.ui.left.attached.button{display:inline-block;border-left:none;text-align:right;padding-right:.75em;border-radius:.28571429rem 0 0 .28571429rem}.ui.right.attached.button{display:inline-block;text-align:left;padding-left:.75em;border-radius:0 .28571429rem .28571429rem 0}.ui.attached.buttons{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-radius:0;width:auto!important;z-index:2;margin-left:-1px;margin-right:-1px}.ui.attached.buttons .button{margin:0}.ui.attached.buttons .button:first-child,.ui.attached.buttons .button:last-child{border-radius:0}.ui[class*="top attached"].buttons{margin-bottom:-1px;border-radius:.28571429rem .28571429rem 0 0}.ui[class*="top attached"].buttons .button:first-child{border-radius:.28571429rem 0 0}.ui[class*="top attached"].buttons .button:last-child{border-radius:0 .28571429rem 0 0}.ui[class*="bottom attached"].buttons{margin-top:-1px;border-radius:0 0 .28571429rem .28571429rem}.ui[class*="bottom attached"].buttons .button:first-child{border-radius:0 0 0 .28571429rem}.ui[class*="bottom attached"].buttons .button:last-child{border-radius:0 0 .28571429rem}.ui[class*="left attached"].buttons{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin-right:0;margin-left:-1px;border-radius:0 .28571429rem .28571429rem 0}.ui[class*="left attached"].buttons .button:first-child{margin-left:-1px;border-radius:0 .28571429rem 0 0}.ui[class*="left attached"].buttons .button:last-child{margin-left:-1px;border-radius:0 0 .28571429rem}.ui[class*="right attached"].buttons{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin-left:0;margin-right:-1px;border-radius:.28571429rem 0 0 .28571429rem}.ui[class*="right attached"].buttons .button:first-child{margin-left:-1px;border-radius:.28571429rem 0 0}.ui[class*="right attached"].buttons .button:last-child{margin-left:-1px;border-radius:0 0 0 .28571429rem}.ui.fluid.button,.ui.fluid.buttons{width:100%}.ui.fluid.button{display:block}.ui.two.buttons{width:100%}.ui.two.buttons>.button{width:50%}.ui.three.buttons{width:100%}.ui.three.buttons>.button{width:33.333%}.ui.four.buttons{width:100%}.ui.four.buttons>.button{width:25%}.ui.five.buttons{width:100%}.ui.five.buttons>.button{width:20%}.ui.six.buttons{width:100%}.ui.six.buttons>.button{width:16.666%}.ui.seven.buttons{width:100%}.ui.seven.buttons>.button{width:14.285%}.ui.eight.buttons{width:100%}.ui.eight.buttons>.button{width:12.5%}.ui.nine.buttons{width:100%}.ui.nine.buttons>.button{width:11.11%}.ui.ten.buttons{width:100%}.ui.ten.buttons>.button{width:10%}.ui.eleven.buttons{width:100%}.ui.eleven.buttons>.button{width:9.09%}.ui.twelve.buttons{width:100%}.ui.twelve.buttons>.button{width:8.3333%}.ui.fluid.vertical.buttons,.ui.fluid.vertical.buttons>.button{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:auto}.ui.two.vertical.buttons>.button{height:50%}.ui.three.vertical.buttons>.button{height:33.333%}.ui.four.vertical.buttons>.button{height:25%}.ui.five.vertical.buttons>.button{height:20%}.ui.six.vertical.buttons>.button{height:16.666%}.ui.seven.vertical.buttons>.button{height:14.285%}.ui.eight.vertical.buttons>.button{height:12.5%}.ui.nine.vertical.buttons>.button{height:11.11%}.ui.ten.vertical.buttons>.button{height:10%}.ui.eleven.vertical.buttons>.button{height:9.09%}.ui.twelve.vertical.buttons>.button{height:8.3333%}.ui.black.button,.ui.black.buttons .button{background-color:#1B1C1D;color:#FFF;text-shadow:none;background-image:none}.ui.black.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.black.button:hover,.ui.black.buttons .button:hover{background-color:#27292a;color:#FFF;text-shadow:none}.ui.black.button:focus,.ui.black.buttons .button:focus{background-color:#2f3032;color:#FFF;text-shadow:none}.ui.black.button:active,.ui.black.buttons .button:active{background-color:#343637;color:#FFF;text-shadow:none}.ui.black.active.button,.ui.black.button .active.button:active,.ui.black.buttons .active.button,.ui.black.buttons .active.button:active{background-color:#0f0f10;color:#FFF;text-shadow:none}.ui.basic.black.button,.ui.basic.black.buttons .button{box-shadow:0 0 0 1px #1B1C1D inset!important;color:#1B1C1D!important}.ui.basic.black.button:hover,.ui.basic.black.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #27292a inset!important;color:#27292a!important}.ui.basic.black.button:focus,.ui.basic.black.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #2f3032 inset!important;color:#27292a!important}.ui.basic.black.active.button,.ui.basic.black.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #0f0f10 inset!important;color:#343637!important}.ui.basic.black.button:active,.ui.basic.black.buttons .button:active{box-shadow:0 0 0 1px #343637 inset!important;color:#343637!important}.ui.buttons:not(.vertical)>.basic.black.button:not(:first-child){margin-left:-1px}.ui.inverted.black.button,.ui.inverted.black.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #D4D4D5 inset!important;color:#FFF}.ui.inverted.black.button.active,.ui.inverted.black.button:active,.ui.inverted.black.button:focus,.ui.inverted.black.button:hover,.ui.inverted.black.buttons .button.active,.ui.inverted.black.buttons .button:active,.ui.inverted.black.buttons .button:focus,.ui.inverted.black.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.black.active.button,.ui.inverted.black.button:active,.ui.inverted.black.button:focus,.ui.inverted.black.button:hover,.ui.inverted.black.buttons .active.button,.ui.inverted.black.buttons .button:active,.ui.inverted.black.buttons .button:focus,.ui.inverted.black.buttons .button:hover{background-color:#000}.ui.inverted.black.basic.button,.ui.inverted.black.basic.buttons .button,.ui.inverted.black.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.black.basic.button:hover,.ui.inverted.black.basic.buttons .button:hover,.ui.inverted.black.buttons .basic.button:hover{box-shadow:0 0 0 2px #000 inset!important;color:#FFF!important}.ui.inverted.black.basic.button:focus,.ui.inverted.black.basic.buttons .button:focus{box-shadow:0 0 0 2px #000 inset!important;color:#545454!important}.ui.inverted.black.basic.active.button,.ui.inverted.black.basic.button:active,.ui.inverted.black.basic.buttons .active.button,.ui.inverted.black.basic.buttons .button:active,.ui.inverted.black.buttons .basic.active.button,.ui.inverted.black.buttons .basic.button:active{box-shadow:0 0 0 2px #000 inset!important;color:#FFF!important}.ui.grey.button,.ui.grey.buttons .button{background-color:#767676;color:#FFF;text-shadow:none;background-image:none}.ui.grey.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.grey.button:hover,.ui.grey.buttons .button:hover{background-color:#838383;color:#FFF;text-shadow:none}.ui.grey.button:focus,.ui.grey.buttons .button:focus{background-color:#8a8a8a;color:#FFF;text-shadow:none}.ui.grey.button:active,.ui.grey.buttons .button:active{background-color:#909090;color:#FFF;text-shadow:none}.ui.grey.active.button,.ui.grey.button .active.button:active,.ui.grey.buttons .active.button,.ui.grey.buttons .active.button:active{background-color:#696969;color:#FFF;text-shadow:none}.ui.basic.grey.button,.ui.basic.grey.buttons .button{box-shadow:0 0 0 1px #767676 inset!important;color:#767676!important}.ui.basic.grey.button:hover,.ui.basic.grey.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #838383 inset!important;color:#838383!important}.ui.basic.grey.button:focus,.ui.basic.grey.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #8a8a8a inset!important;color:#838383!important}.ui.basic.grey.active.button,.ui.basic.grey.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #696969 inset!important;color:#909090!important}.ui.basic.grey.button:active,.ui.basic.grey.buttons .button:active{box-shadow:0 0 0 1px #909090 inset!important;color:#909090!important}.ui.buttons:not(.vertical)>.basic.grey.button:not(:first-child){margin-left:-1px}.ui.inverted.grey.button,.ui.inverted.grey.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #D4D4D5 inset!important;color:#FFF}.ui.inverted.grey.button.active,.ui.inverted.grey.button:active,.ui.inverted.grey.button:focus,.ui.inverted.grey.button:hover,.ui.inverted.grey.buttons .button.active,.ui.inverted.grey.buttons .button:active,.ui.inverted.grey.buttons .button:focus,.ui.inverted.grey.buttons .button:hover{box-shadow:none!important;color:rgba(0,0,0,.6)}.ui.inverted.grey.button:hover,.ui.inverted.grey.buttons .button:hover{background-color:#cfd0d2}.ui.inverted.grey.button:focus,.ui.inverted.grey.buttons .button:focus{background-color:#c7c9cb}.ui.inverted.grey.active.button,.ui.inverted.grey.buttons .active.button{background-color:#cfd0d2}.ui.inverted.grey.button:active,.ui.inverted.grey.buttons .button:active{background-color:#c2c4c5}.ui.inverted.grey.basic.button,.ui.inverted.grey.basic.buttons .button,.ui.inverted.grey.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.grey.basic.button:hover,.ui.inverted.grey.basic.buttons .button:hover,.ui.inverted.grey.buttons .basic.button:hover{box-shadow:0 0 0 2px #cfd0d2 inset!important;color:#FFF!important}.ui.inverted.grey.basic.button:focus,.ui.inverted.grey.basic.buttons .button:focus{box-shadow:0 0 0 2px #c7c9cb inset!important;color:#DCDDDE!important}.ui.inverted.grey.basic.active.button,.ui.inverted.grey.basic.buttons .active.button,.ui.inverted.grey.buttons .basic.active.button{box-shadow:0 0 0 2px #cfd0d2 inset!important;color:#FFF!important}.ui.inverted.grey.basic.button:active,.ui.inverted.grey.basic.buttons .button:active,.ui.inverted.grey.buttons .basic.button:active{box-shadow:0 0 0 2px #c2c4c5 inset!important;color:#FFF!important}.ui.brown.button,.ui.brown.buttons .button{background-color:#A5673F;color:#FFF;text-shadow:none;background-image:none}.ui.brown.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.brown.button:hover,.ui.brown.buttons .button:hover{background-color:#975b33;color:#FFF;text-shadow:none}.ui.brown.button:focus,.ui.brown.buttons .button:focus{background-color:#90532b;color:#FFF;text-shadow:none}.ui.brown.button:active,.ui.brown.buttons .button:active{background-color:#805031;color:#FFF;text-shadow:none}.ui.brown.active.button,.ui.brown.button .active.button:active,.ui.brown.buttons .active.button,.ui.brown.buttons .active.button:active{background-color:#995a31;color:#FFF;text-shadow:none}.ui.basic.brown.button,.ui.basic.brown.buttons .button{box-shadow:0 0 0 1px #A5673F inset!important;color:#A5673F!important}.ui.basic.brown.button:hover,.ui.basic.brown.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #975b33 inset!important;color:#975b33!important}.ui.basic.brown.button:focus,.ui.basic.brown.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #90532b inset!important;color:#975b33!important}.ui.basic.brown.active.button,.ui.basic.brown.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #995a31 inset!important;color:#805031!important}.ui.basic.brown.button:active,.ui.basic.brown.buttons .button:active{box-shadow:0 0 0 1px #805031 inset!important;color:#805031!important}.ui.buttons:not(.vertical)>.basic.brown.button:not(:first-child){margin-left:-1px}.ui.inverted.brown.button,.ui.inverted.brown.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #D67C1C inset!important;color:#D67C1C}.ui.inverted.brown.button.active,.ui.inverted.brown.button:active,.ui.inverted.brown.button:focus,.ui.inverted.brown.button:hover,.ui.inverted.brown.buttons .button.active,.ui.inverted.brown.buttons .button:active,.ui.inverted.brown.buttons .button:focus,.ui.inverted.brown.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.brown.button:hover,.ui.inverted.brown.buttons .button:hover{background-color:#c86f11}.ui.inverted.brown.button:focus,.ui.inverted.brown.buttons .button:focus{background-color:#c16808}.ui.inverted.brown.active.button,.ui.inverted.brown.buttons .active.button{background-color:#cc6f0d}.ui.inverted.brown.button:active,.ui.inverted.brown.buttons .button:active{background-color:#a96216}.ui.inverted.brown.basic.button,.ui.inverted.brown.basic.buttons .button,.ui.inverted.brown.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.brown.basic.button:hover,.ui.inverted.brown.basic.buttons .button:hover,.ui.inverted.brown.buttons .basic.button:hover{box-shadow:0 0 0 2px #c86f11 inset!important;color:#D67C1C!important}.ui.inverted.brown.basic.button:focus,.ui.inverted.brown.basic.buttons .button:focus{box-shadow:0 0 0 2px #c16808 inset!important;color:#D67C1C!important}.ui.inverted.brown.basic.active.button,.ui.inverted.brown.basic.buttons .active.button,.ui.inverted.brown.buttons .basic.active.button{box-shadow:0 0 0 2px #cc6f0d inset!important;color:#D67C1C!important}.ui.inverted.brown.basic.button:active,.ui.inverted.brown.basic.buttons .button:active,.ui.inverted.brown.buttons .basic.button:active{box-shadow:0 0 0 2px #a96216 inset!important;color:#D67C1C!important}.ui.blue.button,.ui.blue.buttons .button{background-color:#2185D0;color:#FFF;text-shadow:none;background-image:none}.ui.blue.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.blue.button:hover,.ui.blue.buttons .button:hover{background-color:#1678c2;color:#FFF;text-shadow:none}.ui.blue.button:focus,.ui.blue.buttons .button:focus{background-color:#0d71bb;color:#FFF;text-shadow:none}.ui.blue.button:active,.ui.blue.buttons .button:active{background-color:#1a69a4;color:#FFF;text-shadow:none}.ui.blue.active.button,.ui.blue.button .active.button:active,.ui.blue.buttons .active.button,.ui.blue.buttons .active.button:active{background-color:#1279c6;color:#FFF;text-shadow:none}.ui.basic.blue.button,.ui.basic.blue.buttons .button{box-shadow:0 0 0 1px #2185D0 inset!important;color:#2185D0!important}.ui.basic.blue.button:hover,.ui.basic.blue.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #1678c2 inset!important;color:#1678c2!important}.ui.basic.blue.button:focus,.ui.basic.blue.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #0d71bb inset!important;color:#1678c2!important}.ui.basic.blue.active.button,.ui.basic.blue.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #1279c6 inset!important;color:#1a69a4!important}.ui.basic.blue.button:active,.ui.basic.blue.buttons .button:active{box-shadow:0 0 0 1px #1a69a4 inset!important;color:#1a69a4!important}.ui.buttons:not(.vertical)>.basic.blue.button:not(:first-child){margin-left:-1px}.ui.inverted.blue.button,.ui.inverted.blue.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #54C8FF inset!important;color:#54C8FF}.ui.inverted.blue.button.active,.ui.inverted.blue.button:active,.ui.inverted.blue.button:focus,.ui.inverted.blue.button:hover,.ui.inverted.blue.buttons .button.active,.ui.inverted.blue.buttons .button:active,.ui.inverted.blue.buttons .button:focus,.ui.inverted.blue.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.blue.button:hover,.ui.inverted.blue.buttons .button:hover{background-color:#3ac0ff}.ui.inverted.blue.button:focus,.ui.inverted.blue.buttons .button:focus{background-color:#2bbbff}.ui.inverted.blue.active.button,.ui.inverted.blue.buttons .active.button{background-color:#3ac0ff}.ui.inverted.blue.button:active,.ui.inverted.blue.buttons .button:active{background-color:#21b8ff}.ui.inverted.blue.basic.button,.ui.inverted.blue.basic.buttons .button,.ui.inverted.blue.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.blue.basic.button:hover,.ui.inverted.blue.basic.buttons .button:hover,.ui.inverted.blue.buttons .basic.button:hover{box-shadow:0 0 0 2px #3ac0ff inset!important;color:#54C8FF!important}.ui.inverted.blue.basic.button:focus,.ui.inverted.blue.basic.buttons .button:focus{box-shadow:0 0 0 2px #2bbbff inset!important;color:#54C8FF!important}.ui.inverted.blue.basic.active.button,.ui.inverted.blue.basic.buttons .active.button,.ui.inverted.blue.buttons .basic.active.button{box-shadow:0 0 0 2px #3ac0ff inset!important;color:#54C8FF!important}.ui.inverted.blue.basic.button:active,.ui.inverted.blue.basic.buttons .button:active,.ui.inverted.blue.buttons .basic.button:active{box-shadow:0 0 0 2px #21b8ff inset!important;color:#54C8FF!important}.ui.green.button,.ui.green.buttons .button{background-color:#21BA45;color:#FFF;text-shadow:none;background-image:none}.ui.green.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.green.button:hover,.ui.green.buttons .button:hover{background-color:#16ab39;color:#FFF;text-shadow:none}.ui.green.button:focus,.ui.green.buttons .button:focus{background-color:#0ea432;color:#FFF;text-shadow:none}.ui.green.button:active,.ui.green.buttons .button:active{background-color:#198f35;color:#FFF;text-shadow:none}.ui.green.active.button,.ui.green.button .active.button:active,.ui.green.buttons .active.button,.ui.green.buttons .active.button:active{background-color:#13ae38;color:#FFF;text-shadow:none}.ui.basic.green.button,.ui.basic.green.buttons .button{box-shadow:0 0 0 1px #21BA45 inset!important;color:#21BA45!important}.ui.basic.green.button:hover,.ui.basic.green.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #16ab39 inset!important;color:#16ab39!important}.ui.basic.green.button:focus,.ui.basic.green.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #0ea432 inset!important;color:#16ab39!important}.ui.basic.green.active.button,.ui.basic.green.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #13ae38 inset!important;color:#198f35!important}.ui.basic.green.button:active,.ui.basic.green.buttons .button:active{box-shadow:0 0 0 1px #198f35 inset!important;color:#198f35!important}.ui.buttons:not(.vertical)>.basic.green.button:not(:first-child){margin-left:-1px}.ui.inverted.green.button,.ui.inverted.green.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #2ECC40 inset!important;color:#2ECC40}.ui.inverted.green.button.active,.ui.inverted.green.button:active,.ui.inverted.green.button:focus,.ui.inverted.green.button:hover,.ui.inverted.green.buttons .button.active,.ui.inverted.green.buttons .button:active,.ui.inverted.green.buttons .button:focus,.ui.inverted.green.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.green.button:hover,.ui.inverted.green.buttons .button:hover{background-color:#22be34}.ui.inverted.green.button:focus,.ui.inverted.green.buttons .button:focus{background-color:#19b82b}.ui.inverted.green.active.button,.ui.inverted.green.buttons .active.button{background-color:#1fc231}.ui.inverted.green.button:active,.ui.inverted.green.buttons .button:active{background-color:#25a233}.ui.inverted.green.basic.button,.ui.inverted.green.basic.buttons .button,.ui.inverted.green.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.green.basic.button:hover,.ui.inverted.green.basic.buttons .button:hover,.ui.inverted.green.buttons .basic.button:hover{box-shadow:0 0 0 2px #22be34 inset!important;color:#2ECC40!important}.ui.inverted.green.basic.button:focus,.ui.inverted.green.basic.buttons .button:focus{box-shadow:0 0 0 2px #19b82b inset!important;color:#2ECC40!important}.ui.inverted.green.basic.active.button,.ui.inverted.green.basic.buttons .active.button,.ui.inverted.green.buttons .basic.active.button{box-shadow:0 0 0 2px #1fc231 inset!important;color:#2ECC40!important}.ui.inverted.green.basic.button:active,.ui.inverted.green.basic.buttons .button:active,.ui.inverted.green.buttons .basic.button:active{box-shadow:0 0 0 2px #25a233 inset!important;color:#2ECC40!important}.ui.orange.button,.ui.orange.buttons .button{background-color:#F2711C;color:#FFF;text-shadow:none;background-image:none}.ui.orange.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.orange.button:hover,.ui.orange.buttons .button:hover{background-color:#f26202;color:#FFF;text-shadow:none}.ui.orange.button:focus,.ui.orange.buttons .button:focus{background-color:#e55b00;color:#FFF;text-shadow:none}.ui.orange.button:active,.ui.orange.buttons .button:active{background-color:#cf590c;color:#FFF;text-shadow:none}.ui.orange.active.button,.ui.orange.button .active.button:active,.ui.orange.buttons .active.button,.ui.orange.buttons .active.button:active{background-color:#f56100;color:#FFF;text-shadow:none}.ui.basic.orange.button,.ui.basic.orange.buttons .button{box-shadow:0 0 0 1px #F2711C inset!important;color:#F2711C!important}.ui.basic.orange.button:hover,.ui.basic.orange.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #f26202 inset!important;color:#f26202!important}.ui.basic.orange.button:focus,.ui.basic.orange.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #e55b00 inset!important;color:#f26202!important}.ui.basic.orange.active.button,.ui.basic.orange.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #f56100 inset!important;color:#cf590c!important}.ui.basic.orange.button:active,.ui.basic.orange.buttons .button:active{box-shadow:0 0 0 1px #cf590c inset!important;color:#cf590c!important}.ui.buttons:not(.vertical)>.basic.orange.button:not(:first-child){margin-left:-1px}.ui.inverted.orange.button,.ui.inverted.orange.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #FF851B inset!important;color:#FF851B}.ui.inverted.orange.button.active,.ui.inverted.orange.button:active,.ui.inverted.orange.button:focus,.ui.inverted.orange.button:hover,.ui.inverted.orange.buttons .button.active,.ui.inverted.orange.buttons .button:active,.ui.inverted.orange.buttons .button:focus,.ui.inverted.orange.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.orange.button:hover,.ui.inverted.orange.buttons .button:hover{background-color:#ff7701}.ui.inverted.orange.button:focus,.ui.inverted.orange.buttons .button:focus{background-color:#f17000}.ui.inverted.orange.active.button,.ui.inverted.orange.buttons .active.button{background-color:#ff7701}.ui.inverted.orange.button:active,.ui.inverted.orange.buttons .button:active{background-color:#e76b00}.ui.inverted.orange.basic.button,.ui.inverted.orange.basic.buttons .button,.ui.inverted.orange.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.orange.basic.button:hover,.ui.inverted.orange.basic.buttons .button:hover,.ui.inverted.orange.buttons .basic.button:hover{box-shadow:0 0 0 2px #ff7701 inset!important;color:#FF851B!important}.ui.inverted.orange.basic.button:focus,.ui.inverted.orange.basic.buttons .button:focus{box-shadow:0 0 0 2px #f17000 inset!important;color:#FF851B!important}.ui.inverted.orange.basic.active.button,.ui.inverted.orange.basic.buttons .active.button,.ui.inverted.orange.buttons .basic.active.button{box-shadow:0 0 0 2px #ff7701 inset!important;color:#FF851B!important}.ui.inverted.orange.basic.button:active,.ui.inverted.orange.basic.buttons .button:active,.ui.inverted.orange.buttons .basic.button:active{box-shadow:0 0 0 2px #e76b00 inset!important;color:#FF851B!important}.ui.pink.button,.ui.pink.buttons .button{background-color:#E03997;color:#FFF;text-shadow:none;background-image:none}.ui.pink.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.pink.button:hover,.ui.pink.buttons .button:hover{background-color:#e61a8d;color:#FFF;text-shadow:none}.ui.pink.button:focus,.ui.pink.buttons .button:focus{background-color:#e10f85;color:#FFF;text-shadow:none}.ui.pink.button:active,.ui.pink.buttons .button:active{background-color:#c71f7e;color:#FFF;text-shadow:none}.ui.pink.active.button,.ui.pink.button .active.button:active,.ui.pink.buttons .active.button,.ui.pink.buttons .active.button:active{background-color:#ea158d;color:#FFF;text-shadow:none}.ui.basic.pink.button,.ui.basic.pink.buttons .button{box-shadow:0 0 0 1px #E03997 inset!important;color:#E03997!important}.ui.basic.pink.button:hover,.ui.basic.pink.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #e61a8d inset!important;color:#e61a8d!important}.ui.basic.pink.button:focus,.ui.basic.pink.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #e10f85 inset!important;color:#e61a8d!important}.ui.basic.pink.active.button,.ui.basic.pink.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #ea158d inset!important;color:#c71f7e!important}.ui.basic.pink.button:active,.ui.basic.pink.buttons .button:active{box-shadow:0 0 0 1px #c71f7e inset!important;color:#c71f7e!important}.ui.buttons:not(.vertical)>.basic.pink.button:not(:first-child){margin-left:-1px}.ui.inverted.pink.button,.ui.inverted.pink.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #FF8EDF inset!important;color:#FF8EDF}.ui.inverted.pink.button.active,.ui.inverted.pink.button:active,.ui.inverted.pink.button:focus,.ui.inverted.pink.button:hover,.ui.inverted.pink.buttons .button.active,.ui.inverted.pink.buttons .button:active,.ui.inverted.pink.buttons .button:focus,.ui.inverted.pink.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.pink.button:hover,.ui.inverted.pink.buttons .button:hover{background-color:#ff74d8}.ui.inverted.pink.button:focus,.ui.inverted.pink.buttons .button:focus{background-color:#ff65d3}.ui.inverted.pink.active.button,.ui.inverted.pink.buttons .active.button{background-color:#ff74d8}.ui.inverted.pink.button:active,.ui.inverted.pink.buttons .button:active{background-color:#ff5bd1}.ui.inverted.pink.basic.button,.ui.inverted.pink.basic.buttons .button,.ui.inverted.pink.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.pink.basic.button:hover,.ui.inverted.pink.basic.buttons .button:hover,.ui.inverted.pink.buttons .basic.button:hover{box-shadow:0 0 0 2px #ff74d8 inset!important;color:#FF8EDF!important}.ui.inverted.pink.basic.button:focus,.ui.inverted.pink.basic.buttons .button:focus{box-shadow:0 0 0 2px #ff65d3 inset!important;color:#FF8EDF!important}.ui.inverted.pink.basic.active.button,.ui.inverted.pink.basic.buttons .active.button,.ui.inverted.pink.buttons .basic.active.button{box-shadow:0 0 0 2px #ff74d8 inset!important;color:#FF8EDF!important}.ui.inverted.pink.basic.button:active,.ui.inverted.pink.basic.buttons .button:active,.ui.inverted.pink.buttons .basic.button:active{box-shadow:0 0 0 2px #ff5bd1 inset!important;color:#FF8EDF!important}.ui.violet.button,.ui.violet.buttons .button{background-color:#6435C9;color:#FFF;text-shadow:none;background-image:none}.ui.violet.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.violet.button:hover,.ui.violet.buttons .button:hover{background-color:#5829bb;color:#FFF;text-shadow:none}.ui.violet.button:focus,.ui.violet.buttons .button:focus{background-color:#4f20b5;color:#FFF;text-shadow:none}.ui.violet.button:active,.ui.violet.buttons .button:active{background-color:#502aa1;color:#FFF;text-shadow:none}.ui.violet.active.button,.ui.violet.button .active.button:active,.ui.violet.buttons .active.button,.ui.violet.buttons .active.button:active{background-color:#5626bf;color:#FFF;text-shadow:none}.ui.basic.violet.button,.ui.basic.violet.buttons .button{box-shadow:0 0 0 1px #6435C9 inset!important;color:#6435C9!important}.ui.basic.violet.button:hover,.ui.basic.violet.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #5829bb inset!important;color:#5829bb!important}.ui.basic.violet.button:focus,.ui.basic.violet.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #4f20b5 inset!important;color:#5829bb!important}.ui.basic.violet.active.button,.ui.basic.violet.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #5626bf inset!important;color:#502aa1!important}.ui.basic.violet.button:active,.ui.basic.violet.buttons .button:active{box-shadow:0 0 0 1px #502aa1 inset!important;color:#502aa1!important}.ui.buttons:not(.vertical)>.basic.violet.button:not(:first-child){margin-left:-1px}.ui.inverted.violet.button,.ui.inverted.violet.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #A291FB inset!important;color:#A291FB}.ui.inverted.violet.button.active,.ui.inverted.violet.button:active,.ui.inverted.violet.button:focus,.ui.inverted.violet.button:hover,.ui.inverted.violet.buttons .button.active,.ui.inverted.violet.buttons .button:active,.ui.inverted.violet.buttons .button:focus,.ui.inverted.violet.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.violet.button:hover,.ui.inverted.violet.buttons .button:hover{background-color:#8a73ff}.ui.inverted.violet.button:focus,.ui.inverted.violet.buttons .button:focus{background-color:#7d64ff}.ui.inverted.violet.active.button,.ui.inverted.violet.buttons .active.button{background-color:#8a73ff}.ui.inverted.violet.button:active,.ui.inverted.violet.buttons .button:active{background-color:#7860f9}.ui.inverted.violet.basic.button,.ui.inverted.violet.basic.buttons .button,.ui.inverted.violet.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.violet.basic.button:hover,.ui.inverted.violet.basic.buttons .button:hover,.ui.inverted.violet.buttons .basic.button:hover{box-shadow:0 0 0 2px #8a73ff inset!important;color:#A291FB!important}.ui.inverted.violet.basic.button:focus,.ui.inverted.violet.basic.buttons .button:focus{box-shadow:0 0 0 2px #7d64ff inset!important;color:#A291FB!important}.ui.inverted.violet.basic.active.button,.ui.inverted.violet.basic.buttons .active.button,.ui.inverted.violet.buttons .basic.active.button{box-shadow:0 0 0 2px #8a73ff inset!important;color:#A291FB!important}.ui.inverted.violet.basic.button:active,.ui.inverted.violet.basic.buttons .button:active,.ui.inverted.violet.buttons .basic.button:active{box-shadow:0 0 0 2px #7860f9 inset!important;color:#A291FB!important}.ui.purple.button,.ui.purple.buttons .button{background-color:#A333C8;color:#FFF;text-shadow:none;background-image:none}.ui.purple.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.purple.button:hover,.ui.purple.buttons .button:hover{background-color:#9627ba;color:#FFF;text-shadow:none}.ui.purple.button:focus,.ui.purple.buttons .button:focus{background-color:#8f1eb4;color:#FFF;text-shadow:none}.ui.purple.button:active,.ui.purple.buttons .button:active{background-color:#82299f;color:#FFF;text-shadow:none}.ui.purple.active.button,.ui.purple.button .active.button:active,.ui.purple.buttons .active.button,.ui.purple.buttons .active.button:active{background-color:#9724be;color:#FFF;text-shadow:none}.ui.basic.purple.button,.ui.basic.purple.buttons .button{box-shadow:0 0 0 1px #A333C8 inset!important;color:#A333C8!important}.ui.basic.purple.button:hover,.ui.basic.purple.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #9627ba inset!important;color:#9627ba!important}.ui.basic.purple.button:focus,.ui.basic.purple.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #8f1eb4 inset!important;color:#9627ba!important}.ui.basic.purple.active.button,.ui.basic.purple.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #9724be inset!important;color:#82299f!important}.ui.basic.purple.button:active,.ui.basic.purple.buttons .button:active{box-shadow:0 0 0 1px #82299f inset!important;color:#82299f!important}.ui.buttons:not(.vertical)>.basic.purple.button:not(:first-child){margin-left:-1px}.ui.inverted.purple.button,.ui.inverted.purple.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #DC73FF inset!important;color:#DC73FF}.ui.inverted.purple.button.active,.ui.inverted.purple.button:active,.ui.inverted.purple.button:focus,.ui.inverted.purple.button:hover,.ui.inverted.purple.buttons .button.active,.ui.inverted.purple.buttons .button:active,.ui.inverted.purple.buttons .button:focus,.ui.inverted.purple.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.purple.button:hover,.ui.inverted.purple.buttons .button:hover{background-color:#d65aff}.ui.inverted.purple.button:focus,.ui.inverted.purple.buttons .button:focus{background-color:#d24aff}.ui.inverted.purple.active.button,.ui.inverted.purple.buttons .active.button{background-color:#d65aff}.ui.inverted.purple.button:active,.ui.inverted.purple.buttons .button:active{background-color:#cf40ff}.ui.inverted.purple.basic.button,.ui.inverted.purple.basic.buttons .button,.ui.inverted.purple.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.purple.basic.button:hover,.ui.inverted.purple.basic.buttons .button:hover,.ui.inverted.purple.buttons .basic.button:hover{box-shadow:0 0 0 2px #d65aff inset!important;color:#DC73FF!important}.ui.inverted.purple.basic.button:focus,.ui.inverted.purple.basic.buttons .button:focus{box-shadow:0 0 0 2px #d24aff inset!important;color:#DC73FF!important}.ui.inverted.purple.basic.active.button,.ui.inverted.purple.basic.buttons .active.button,.ui.inverted.purple.buttons .basic.active.button{box-shadow:0 0 0 2px #d65aff inset!important;color:#DC73FF!important}.ui.inverted.purple.basic.button:active,.ui.inverted.purple.basic.buttons .button:active,.ui.inverted.purple.buttons .basic.button:active{box-shadow:0 0 0 2px #cf40ff inset!important;color:#DC73FF!important}.ui.red.button,.ui.red.buttons .button{background-color:#DB2828;color:#FFF;text-shadow:none;background-image:none}.ui.red.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.red.button:hover,.ui.red.buttons .button:hover{background-color:#d01919;color:#FFF;text-shadow:none}.ui.red.button:focus,.ui.red.buttons .button:focus{background-color:#ca1010;color:#FFF;text-shadow:none}.ui.red.button:active,.ui.red.buttons .button:active{background-color:#b21e1e;color:#FFF;text-shadow:none}.ui.red.active.button,.ui.red.button .active.button:active,.ui.red.buttons .active.button,.ui.red.buttons .active.button:active{background-color:#d41515;color:#FFF;text-shadow:none}.ui.basic.red.button,.ui.basic.red.buttons .button{box-shadow:0 0 0 1px #DB2828 inset!important;color:#DB2828!important}.ui.basic.red.button:hover,.ui.basic.red.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #d01919 inset!important;color:#d01919!important}.ui.basic.red.button:focus,.ui.basic.red.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #ca1010 inset!important;color:#d01919!important}.ui.basic.red.active.button,.ui.basic.red.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #d41515 inset!important;color:#b21e1e!important}.ui.basic.red.button:active,.ui.basic.red.buttons .button:active{box-shadow:0 0 0 1px #b21e1e inset!important;color:#b21e1e!important}.ui.buttons:not(.vertical)>.basic.red.button:not(:first-child){margin-left:-1px}.ui.inverted.red.button,.ui.inverted.red.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #FF695E inset!important;color:#FF695E}.ui.inverted.red.button.active,.ui.inverted.red.button:active,.ui.inverted.red.button:focus,.ui.inverted.red.button:hover,.ui.inverted.red.buttons .button.active,.ui.inverted.red.buttons .button:active,.ui.inverted.red.buttons .button:focus,.ui.inverted.red.buttons .button:hover{box-shadow:none!important;color:#FFF}.ui.inverted.red.button:hover,.ui.inverted.red.buttons .button:hover{background-color:#ff5144}.ui.inverted.red.button:focus,.ui.inverted.red.buttons .button:focus{background-color:#ff4335}.ui.inverted.red.active.button,.ui.inverted.red.buttons .active.button{background-color:#ff5144}.ui.inverted.red.button:active,.ui.inverted.red.buttons .button:active{background-color:#ff392b}.ui.inverted.red.basic.button,.ui.inverted.red.basic.buttons .button,.ui.inverted.red.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.red.basic.button:hover,.ui.inverted.red.basic.buttons .button:hover,.ui.inverted.red.buttons .basic.button:hover{box-shadow:0 0 0 2px #ff5144 inset!important;color:#FF695E!important}.ui.inverted.red.basic.button:focus,.ui.inverted.red.basic.buttons .button:focus{box-shadow:0 0 0 2px #ff4335 inset!important;color:#FF695E!important}.ui.inverted.red.basic.active.button,.ui.inverted.red.basic.buttons .active.button,.ui.inverted.red.buttons .basic.active.button{box-shadow:0 0 0 2px #ff5144 inset!important;color:#FF695E!important}.ui.inverted.red.basic.button:active,.ui.inverted.red.basic.buttons .button:active,.ui.inverted.red.buttons .basic.button:active{box-shadow:0 0 0 2px #ff392b inset!important;color:#FF695E!important}.ui.teal.button,.ui.teal.buttons .button{background-color:#00B5AD;color:#FFF;text-shadow:none;background-image:none}.ui.teal.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.teal.button:hover,.ui.teal.buttons .button:hover{background-color:#009c95;color:#FFF;text-shadow:none}.ui.teal.button:focus,.ui.teal.buttons .button:focus{background-color:#008c86;color:#FFF;text-shadow:none}.ui.teal.button:active,.ui.teal.buttons .button:active{background-color:#00827c;color:#FFF;text-shadow:none}.ui.teal.active.button,.ui.teal.button .active.button:active,.ui.teal.buttons .active.button,.ui.teal.buttons .active.button:active{background-color:#009c95;color:#FFF;text-shadow:none}.ui.basic.teal.button,.ui.basic.teal.buttons .button{box-shadow:0 0 0 1px #00B5AD inset!important;color:#00B5AD!important}.ui.basic.teal.button:hover,.ui.basic.teal.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #009c95 inset!important;color:#009c95!important}.ui.basic.teal.button:focus,.ui.basic.teal.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #008c86 inset!important;color:#009c95!important}.ui.basic.teal.active.button,.ui.basic.teal.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #009c95 inset!important;color:#00827c!important}.ui.basic.teal.button:active,.ui.basic.teal.buttons .button:active{box-shadow:0 0 0 1px #00827c inset!important;color:#00827c!important}.ui.buttons:not(.vertical)>.basic.teal.button:not(:first-child){margin-left:-1px}.ui.inverted.teal.button,.ui.inverted.teal.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #6DFFFF inset!important;color:#6DFFFF}.ui.inverted.teal.button.active,.ui.inverted.teal.button:active,.ui.inverted.teal.button:focus,.ui.inverted.teal.button:hover,.ui.inverted.teal.buttons .button.active,.ui.inverted.teal.buttons .button:active,.ui.inverted.teal.buttons .button:focus,.ui.inverted.teal.buttons .button:hover{box-shadow:none!important;color:rgba(0,0,0,.6)}.ui.inverted.teal.button:hover,.ui.inverted.teal.buttons .button:hover{background-color:#54ffff}.ui.inverted.teal.button:focus,.ui.inverted.teal.buttons .button:focus{background-color:#4ff}.ui.inverted.teal.active.button,.ui.inverted.teal.buttons .active.button{background-color:#54ffff}.ui.inverted.teal.button:active,.ui.inverted.teal.buttons .button:active{background-color:#3affff}.ui.inverted.teal.basic.button,.ui.inverted.teal.basic.buttons .button,.ui.inverted.teal.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.teal.basic.button:hover,.ui.inverted.teal.basic.buttons .button:hover,.ui.inverted.teal.buttons .basic.button:hover{box-shadow:0 0 0 2px #54ffff inset!important;color:#6DFFFF!important}.ui.inverted.teal.basic.button:focus,.ui.inverted.teal.basic.buttons .button:focus{box-shadow:0 0 0 2px #4ff inset!important;color:#6DFFFF!important}.ui.inverted.teal.basic.active.button,.ui.inverted.teal.basic.buttons .active.button,.ui.inverted.teal.buttons .basic.active.button{box-shadow:0 0 0 2px #54ffff inset!important;color:#6DFFFF!important}.ui.inverted.teal.basic.button:active,.ui.inverted.teal.basic.buttons .button:active,.ui.inverted.teal.buttons .basic.button:active{box-shadow:0 0 0 2px #3affff inset!important;color:#6DFFFF!important}.ui.olive.button,.ui.olive.buttons .button{background-color:#B5CC18;color:#FFF;text-shadow:none;background-image:none}.ui.olive.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.olive.button:hover,.ui.olive.buttons .button:hover{background-color:#a7bd0d;color:#FFF;text-shadow:none}.ui.olive.button:focus,.ui.olive.buttons .button:focus{background-color:#a0b605;color:#FFF;text-shadow:none}.ui.olive.button:active,.ui.olive.buttons .button:active{background-color:#8d9e13;color:#FFF;text-shadow:none}.ui.olive.active.button,.ui.olive.button .active.button:active,.ui.olive.buttons .active.button,.ui.olive.buttons .active.button:active{background-color:#aac109;color:#FFF;text-shadow:none}.ui.basic.olive.button,.ui.basic.olive.buttons .button{box-shadow:0 0 0 1px #B5CC18 inset!important;color:#B5CC18!important}.ui.basic.olive.button:hover,.ui.basic.olive.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #a7bd0d inset!important;color:#a7bd0d!important}.ui.basic.olive.button:focus,.ui.basic.olive.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #a0b605 inset!important;color:#a7bd0d!important}.ui.basic.olive.active.button,.ui.basic.olive.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #aac109 inset!important;color:#8d9e13!important}.ui.basic.olive.button:active,.ui.basic.olive.buttons .button:active{box-shadow:0 0 0 1px #8d9e13 inset!important;color:#8d9e13!important}.ui.buttons:not(.vertical)>.basic.olive.button:not(:first-child){margin-left:-1px}.ui.inverted.olive.button,.ui.inverted.olive.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #D9E778 inset!important;color:#D9E778}.ui.inverted.olive.button.active,.ui.inverted.olive.button:active,.ui.inverted.olive.button:focus,.ui.inverted.olive.button:hover,.ui.inverted.olive.buttons .button.active,.ui.inverted.olive.buttons .button:active,.ui.inverted.olive.buttons .button:focus,.ui.inverted.olive.buttons .button:hover{box-shadow:none!important;color:rgba(0,0,0,.6)}.ui.inverted.olive.button:hover,.ui.inverted.olive.buttons .button:hover{background-color:#d8ea5c}.ui.inverted.olive.button:focus,.ui.inverted.olive.buttons .button:focus{background-color:#daef47}.ui.inverted.olive.active.button,.ui.inverted.olive.buttons .active.button{background-color:#daed59}.ui.inverted.olive.button:active,.ui.inverted.olive.buttons .button:active{background-color:#cddf4d}.ui.inverted.olive.basic.button,.ui.inverted.olive.basic.buttons .button,.ui.inverted.olive.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.olive.basic.button:hover,.ui.inverted.olive.basic.buttons .button:hover,.ui.inverted.olive.buttons .basic.button:hover{box-shadow:0 0 0 2px #d8ea5c inset!important;color:#D9E778!important}.ui.inverted.olive.basic.button:focus,.ui.inverted.olive.basic.buttons .button:focus{box-shadow:0 0 0 2px #daef47 inset!important;color:#D9E778!important}.ui.inverted.olive.basic.active.button,.ui.inverted.olive.basic.buttons .active.button,.ui.inverted.olive.buttons .basic.active.button{box-shadow:0 0 0 2px #daed59 inset!important;color:#D9E778!important}.ui.inverted.olive.basic.button:active,.ui.inverted.olive.basic.buttons .button:active,.ui.inverted.olive.buttons .basic.button:active{box-shadow:0 0 0 2px #cddf4d inset!important;color:#D9E778!important}.ui.yellow.button,.ui.yellow.buttons .button{background-color:#FBBD08;color:#FFF;text-shadow:none;background-image:none}.ui.yellow.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.yellow.button:hover,.ui.yellow.buttons .button:hover{background-color:#eaae00;color:#FFF;text-shadow:none}.ui.yellow.button:focus,.ui.yellow.buttons .button:focus{background-color:#daa300;color:#FFF;text-shadow:none}.ui.yellow.button:active,.ui.yellow.buttons .button:active{background-color:#cd9903;color:#FFF;text-shadow:none}.ui.yellow.active.button,.ui.yellow.button .active.button:active,.ui.yellow.buttons .active.button,.ui.yellow.buttons .active.button:active{background-color:#eaae00;color:#FFF;text-shadow:none}.ui.basic.yellow.button,.ui.basic.yellow.buttons .button{box-shadow:0 0 0 1px #FBBD08 inset!important;color:#FBBD08!important}.ui.basic.yellow.button:hover,.ui.basic.yellow.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #eaae00 inset!important;color:#eaae00!important}.ui.basic.yellow.button:focus,.ui.basic.yellow.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #daa300 inset!important;color:#eaae00!important}.ui.basic.yellow.active.button,.ui.basic.yellow.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #eaae00 inset!important;color:#cd9903!important}.ui.basic.yellow.button:active,.ui.basic.yellow.buttons .button:active{box-shadow:0 0 0 1px #cd9903 inset!important;color:#cd9903!important}.ui.buttons:not(.vertical)>.basic.yellow.button:not(:first-child){margin-left:-1px}.ui.inverted.yellow.button,.ui.inverted.yellow.buttons .button{background-color:transparent;box-shadow:0 0 0 2px #FFE21F inset!important;color:#FFE21F}.ui.inverted.yellow.button.active,.ui.inverted.yellow.button:active,.ui.inverted.yellow.button:focus,.ui.inverted.yellow.button:hover,.ui.inverted.yellow.buttons .button.active,.ui.inverted.yellow.buttons .button:active,.ui.inverted.yellow.buttons .button:focus,.ui.inverted.yellow.buttons .button:hover{box-shadow:none!important;color:rgba(0,0,0,.6)}.ui.inverted.yellow.button:hover,.ui.inverted.yellow.buttons .button:hover{background-color:#ffdf05}.ui.inverted.yellow.button:focus,.ui.inverted.yellow.buttons .button:focus{background-color:#f5d500}.ui.inverted.yellow.active.button,.ui.inverted.yellow.buttons .active.button{background-color:#ffdf05}.ui.inverted.yellow.button:active,.ui.inverted.yellow.buttons .button:active{background-color:#ebcd00}.ui.inverted.yellow.basic.button,.ui.inverted.yellow.basic.buttons .button,.ui.inverted.yellow.buttons .basic.button{background-color:transparent;box-shadow:0 0 0 2px rgba(255,255,255,.5) inset!important;color:#FFF!important}.ui.inverted.yellow.basic.button:hover,.ui.inverted.yellow.basic.buttons .button:hover,.ui.inverted.yellow.buttons .basic.button:hover{box-shadow:0 0 0 2px #ffdf05 inset!important;color:#FFE21F!important}.ui.inverted.yellow.basic.button:focus,.ui.inverted.yellow.basic.buttons .button:focus{box-shadow:0 0 0 2px #f5d500 inset!important;color:#FFE21F!important}.ui.inverted.yellow.basic.active.button,.ui.inverted.yellow.basic.buttons .active.button,.ui.inverted.yellow.buttons .basic.active.button{box-shadow:0 0 0 2px #ffdf05 inset!important;color:#FFE21F!important}.ui.inverted.yellow.basic.button:active,.ui.inverted.yellow.basic.buttons .button:active,.ui.inverted.yellow.buttons .basic.button:active{box-shadow:0 0 0 2px #ebcd00 inset!important;color:#FFE21F!important}.ui.primary.button,.ui.primary.buttons .button{background-color:#2185D0;color:#FFF;text-shadow:none;background-image:none}.ui.primary.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.primary.button:hover,.ui.primary.buttons .button:hover{background-color:#1678c2;color:#FFF;text-shadow:none}.ui.primary.button:focus,.ui.primary.buttons .button:focus{background-color:#0d71bb;color:#FFF;text-shadow:none}.ui.primary.button:active,.ui.primary.buttons .button:active{background-color:#1a69a4;color:#FFF;text-shadow:none}.ui.primary.active.button,.ui.primary.button .active.button:active,.ui.primary.buttons .active.button,.ui.primary.buttons .active.button:active{background-color:#1279c6;color:#FFF;text-shadow:none}.ui.basic.primary.button,.ui.basic.primary.buttons .button{box-shadow:0 0 0 1px #2185D0 inset!important;color:#2185D0!important}.ui.basic.primary.button:hover,.ui.basic.primary.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #1678c2 inset!important;color:#1678c2!important}.ui.basic.primary.button:focus,.ui.basic.primary.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #0d71bb inset!important;color:#1678c2!important}.ui.basic.primary.active.button,.ui.basic.primary.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #1279c6 inset!important;color:#1a69a4!important}.ui.basic.primary.button:active,.ui.basic.primary.buttons .button:active{box-shadow:0 0 0 1px #1a69a4 inset!important;color:#1a69a4!important}.ui.secondary.button,.ui.secondary.buttons .button{background-color:#1B1C1D;color:#FFF;text-shadow:none;background-image:none}.ui.secondary.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.secondary.button:hover,.ui.secondary.buttons .button:hover{background-color:#27292a;color:#FFF;text-shadow:none}.ui.secondary.button:focus,.ui.secondary.buttons .button:focus{background-color:#2e3032;color:#FFF;text-shadow:none}.ui.secondary.button:active,.ui.secondary.buttons .button:active{background-color:#343637;color:#FFF;text-shadow:none}.ui.secondary.active.button,.ui.secondary.button .active.button:active,.ui.secondary.buttons .active.button,.ui.secondary.buttons .active.button:active{background-color:#27292a;color:#FFF;text-shadow:none}.ui.basic.secondary.button,.ui.basic.secondary.buttons .button{box-shadow:0 0 0 1px #1B1C1D inset!important;color:#1B1C1D!important}.ui.basic.secondary.button:hover,.ui.basic.secondary.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #27292a inset!important;color:#27292a!important}.ui.basic.secondary.button:focus,.ui.basic.secondary.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #2e3032 inset!important;color:#27292a!important}.ui.basic.secondary.active.button,.ui.basic.secondary.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #27292a inset!important;color:#343637!important}.ui.basic.secondary.button:active,.ui.basic.secondary.buttons .button:active{box-shadow:0 0 0 1px #343637 inset!important;color:#343637!important}.ui.positive.button,.ui.positive.buttons .button{background-color:#21BA45;color:#FFF;text-shadow:none;background-image:none}.ui.positive.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.positive.button:hover,.ui.positive.buttons .button:hover{background-color:#16ab39;color:#FFF;text-shadow:none}.ui.positive.button:focus,.ui.positive.buttons .button:focus{background-color:#0ea432;color:#FFF;text-shadow:none}.ui.positive.button:active,.ui.positive.buttons .button:active{background-color:#198f35;color:#FFF;text-shadow:none}.ui.positive.active.button,.ui.positive.button .active.button:active,.ui.positive.buttons .active.button,.ui.positive.buttons .active.button:active{background-color:#13ae38;color:#FFF;text-shadow:none}.ui.basic.positive.button,.ui.basic.positive.buttons .button{box-shadow:0 0 0 1px #21BA45 inset!important;color:#21BA45!important}.ui.basic.positive.button:hover,.ui.basic.positive.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #16ab39 inset!important;color:#16ab39!important}.ui.basic.positive.button:focus,.ui.basic.positive.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #0ea432 inset!important;color:#16ab39!important}.ui.basic.positive.active.button,.ui.basic.positive.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #13ae38 inset!important;color:#198f35!important}.ui.basic.positive.button:active,.ui.basic.positive.buttons .button:active{box-shadow:0 0 0 1px #198f35 inset!important;color:#198f35!important}.ui.negative.button,.ui.negative.buttons .button{background-color:#DB2828;color:#FFF;text-shadow:none;background-image:none}.ui.negative.button{box-shadow:0 0 0 0 rgba(34,36,38,.15) inset}.ui.negative.button:hover,.ui.negative.buttons .button:hover{background-color:#d01919;color:#FFF;text-shadow:none}.ui.negative.button:focus,.ui.negative.buttons .button:focus{background-color:#ca1010;color:#FFF;text-shadow:none}.ui.negative.button:active,.ui.negative.buttons .button:active{background-color:#b21e1e;color:#FFF;text-shadow:none}.ui.negative.active.button,.ui.negative.button .active.button:active,.ui.negative.buttons .active.button,.ui.negative.buttons .active.button:active{background-color:#d41515;color:#FFF;text-shadow:none}.ui.basic.negative.button,.ui.basic.negative.buttons .button{box-shadow:0 0 0 1px #DB2828 inset!important;color:#DB2828!important}.ui.basic.negative.button:hover,.ui.basic.negative.buttons .button:hover{background:0 0!important;box-shadow:0 0 0 1px #d01919 inset!important;color:#d01919!important}.ui.basic.negative.button:focus,.ui.basic.negative.buttons .button:focus{background:0 0!important;box-shadow:0 0 0 1px #ca1010 inset!important;color:#d01919!important}.ui.basic.negative.active.button,.ui.basic.negative.buttons .active.button{background:0 0!important;box-shadow:0 0 0 1px #d41515 inset!important;color:#b21e1e!important}.ui.basic.negative.button:active,.ui.basic.negative.buttons .button:active{box-shadow:0 0 0 1px #b21e1e inset!important;color:#b21e1e!important}.ui.buttons:not(.vertical)>.basic.primary.button:not(:first-child){margin-left:-1px}.ui.buttons{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;font-size:0;vertical-align:baseline;margin:0 .25em 0 0}.ui.buttons:not(.basic):not(.inverted){box-shadow:none}.ui.buttons:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui.buttons .button{-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;border-radius:0;margin:0}.ui.buttons:not(.basic):not(.inverted)>.button,.ui.buttons>.ui.button:not(.basic):not(.inverted){box-shadow:0 0 0 1px transparent inset,0 0 0 0 rgba(34,36,38,.15) inset}.ui.buttons .button:first-child{border-left:none;margin-left:0;border-top-left-radius:.28571429rem;border-bottom-left-radius:.28571429rem}.ui.buttons .button:last-child{border-top-right-radius:.28571429rem;border-bottom-right-radius:.28571429rem}.ui.vertical.buttons{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui.vertical.buttons .button{display:block;float:none;width:100%;margin:0;box-shadow:none}.ui.vertical.buttons .button:first-child,.ui.vertical.buttons .huge.button:first-child,.ui.vertical.buttons .massive.button:first-child,.ui.vertical.buttons .mini.button:first-child,.ui.vertical.buttons .small.button:first-child,.ui.vertical.buttons .tiny.button:first-child{border-radius:.28571429rem .28571429rem 0 0}.ui.vertical.buttons .button:last-child,.ui.vertical.buttons .gigantic.button:last-child,.ui.vertical.buttons .huge.button:last-child,.ui.vertical.buttons .massive.button:last-child,.ui.vertical.buttons .mini.button:last-child,.ui.vertical.buttons .small.button:last-child,.ui.vertical.buttons .tiny.button:last-child{margin-bottom:0;border-radius:0 0 .28571429rem .28571429rem}.ui.container{display:block;max-width:100%!important}@media only screen and (max-width:767px){.ui.container{width:auto!important;margin-left:1em!important;margin-right:1em!important}.ui.grid.container,.ui.relaxed.grid.container,.ui.very.relaxed.grid.container{width:auto!important}}@media only screen and (min-width:768px) and (max-width:991px){.ui.container{width:723px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(723px + 2rem)!important}.ui.relaxed.grid.container{width:calc(723px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(723px + 5rem)!important}}@media only screen and (min-width:992px) and (max-width:1199px){.ui.container{width:933px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(933px + 2rem)!important}.ui.relaxed.grid.container{width:calc(933px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(933px + 5rem)!important}}@media only screen and (min-width:1200px){.ui.container{width:1127px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(1127px + 2rem)!important}.ui.relaxed.grid.container{width:calc(1127px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(1127px + 5rem)!important}}.ui.text.container{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;max-width:700px!important;line-height:1.5;font-size:1.14285714rem}.ui.fluid.container{width:100%}.ui[class*="left aligned"].container{text-align:left}.ui[class*="center aligned"].container{text-align:center}.ui[class*="right aligned"].container{text-align:right}.ui.justified.container{text-align:justify;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.ui.divider{margin:1rem 0;line-height:1;height:0;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:rgba(0,0,0,.85);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;font-size:1rem}.ui.divider:not(.vertical):not(.horizontal){border-top:1px solid rgba(34,36,38,.15);border-bottom:1px solid rgba(255,255,255,.1)}.ui.grid>.column+.divider,.ui.grid>.row>.column+.divider{left:auto}.ui.horizontal.divider{display:table;white-space:nowrap;height:auto;margin:'';line-height:1;text-align:center}.ui.horizontal.divider:after,.ui.horizontal.divider:before{content:'';display:table-cell;position:relative;top:50%;width:50%;background-repeat:no-repeat;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC)}.ui.horizontal.divider:before{background-position:right 1em top 50%}.ui.horizontal.divider:after{background-position:left 1em top 50%}.ui.vertical.divider{position:absolute;z-index:2;top:50%;left:50%;margin:0;padding:0;width:auto;height:50%;line-height:0;text-align:center;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.ui.vertical.divider:after,.ui.vertical.divider:before{position:absolute;left:50%;content:'';z-index:3;border-left:1px solid rgba(34,36,38,.15);border-right:1px solid rgba(255,255,255,.1);width:0;height:calc(100% - 1rem)}.ui.vertical.divider:before{top:-100%}.ui.vertical.divider:after{top:auto;bottom:0}@media only screen and (max-width:767px){.ui.grid .stackable.row .ui.vertical.divider,.ui.stackable.grid .ui.vertical.divider{display:table;white-space:nowrap;height:auto;margin:'';overflow:hidden;line-height:1;text-align:center;position:static;top:0;left:0;-webkit-transform:none;transform:none}.ui.grid .stackable.row .ui.vertical.divider:after,.ui.grid .stackable.row .ui.vertical.divider:before,.ui.stackable.grid .ui.vertical.divider:after,.ui.stackable.grid .ui.vertical.divider:before{left:0;border-left:none;border-right:none;content:'';display:table-cell;position:relative;top:50%;width:50%;background-repeat:no-repeat;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC)}.ui.grid .stackable.row .ui.vertical.divider:before,.ui.stackable.grid .ui.vertical.divider:before{background-position:right 1em top 50%}.ui.grid .stackable.row .ui.vertical.divider:after,.ui.stackable.grid .ui.vertical.divider:after{background-position:left 1em top 50%}}.ui.divider>.icon{margin:0;font-size:1rem;height:1em;vertical-align:middle}.ui.hidden.divider{border-color:transparent!important}.ui.hidden.divider:after,.ui.hidden.divider:before{display:none}.ui.divider.inverted,.ui.horizontal.inverted.divider,.ui.vertical.inverted.divider{color:#FFF}.ui.divider.inverted,.ui.divider.inverted:after,.ui.divider.inverted:before{border-top-color:rgba(34,36,38,.15)!important;border-left-color:rgba(34,36,38,.15)!important;border-bottom-color:rgba(255,255,255,.15)!important;border-right-color:rgba(255,255,255,.15)!important}.ui.fitted.divider{margin:0}.ui.clearing.divider{clear:both}.ui.section.divider{margin-top:2rem;margin-bottom:2rem}i.flag:not(.icon){display:inline-block;width:16px;height:11px;line-height:11px;vertical-align:baseline;margin:0 .5em 0 0;text-decoration:inherit;speak:none;font-smoothing:antialiased;-webkit-backface-visibility:hidden;backface-visibility:hidden}i.flag:not(.icon):before{display:inline-block;content:'';background:url(themes/default/assets/images/flags.png) -108px -1976px no-repeat;width:16px;height:11px}i.flag.ad:before,i.flag.andorra:before{background-position:0 0}i.flag.ae:before,i.flag.uae:before,i.flag.united.arab.emirates:before{background-position:0 -26px}i.flag.af:before,i.flag.afghanistan:before{background-position:0 -52px}i.flag.ag:before,i.flag.antigua:before{background-position:0 -78px}i.flag.ai:before,i.flag.anguilla:before{background-position:0 -104px}i.flag.al:before,i.flag.albania:before{background-position:0 -130px}i.flag.am:before,i.flag.armenia:before{background-position:0 -156px}i.flag.an:before,i.flag.netherlands.antilles:before{background-position:0 -182px}i.flag.angola:before,i.flag.ao:before{background-position:0 -208px}i.flag.ar:before,i.flag.argentina:before{background-position:0 -234px}i.flag.american.samoa:before,i.flag.as:before{background-position:0 -260px}i.flag.at:before,i.flag.austria:before{background-position:0 -286px}i.flag.au:before,i.flag.australia:before{background-position:0 -312px}i.flag.aruba:before,i.flag.aw:before{background-position:0 -338px}i.flag.aland.islands:before,i.flag.ax:before{background-position:0 -364px}i.flag.az:before,i.flag.azerbaijan:before{background-position:0 -390px}i.flag.ba:before,i.flag.bosnia:before{background-position:0 -416px}i.flag.barbados:before,i.flag.bb:before{background-position:0 -442px}i.flag.bangladesh:before,i.flag.bd:before{background-position:0 -468px}i.flag.be:before,i.flag.belgium:before{background-position:0 -494px}i.flag.bf:before,i.flag.burkina.faso:before{background-position:0 -520px}i.flag.bg:before,i.flag.bulgaria:before{background-position:0 -546px}i.flag.bahrain:before,i.flag.bh:before{background-position:0 -572px}i.flag.bi:before,i.flag.burundi:before{background-position:0 -598px}i.flag.benin:before,i.flag.bj:before{background-position:0 -624px}i.flag.bermuda:before,i.flag.bm:before{background-position:0 -650px}i.flag.bn:before,i.flag.brunei:before{background-position:0 -676px}i.flag.bo:before,i.flag.bolivia:before{background-position:0 -702px}i.flag.br:before,i.flag.brazil:before{background-position:0 -728px}i.flag.bahamas:before,i.flag.bs:before{background-position:0 -754px}i.flag.bhutan:before,i.flag.bt:before{background-position:0 -780px}i.flag.bouvet.island:before,i.flag.bv:before{background-position:0 -806px}i.flag.botswana:before,i.flag.bw:before{background-position:0 -832px}i.flag.belarus:before,i.flag.by:before{background-position:0 -858px}i.flag.belize:before,i.flag.bz:before{background-position:0 -884px}i.flag.ca:before,i.flag.canada:before{background-position:0 -910px}i.flag.cc:before,i.flag.cocos.islands:before{background-position:0 -962px}i.flag.cd:before,i.flag.congo:before{background-position:0 -988px}i.flag.central.african.republic:before,i.flag.cf:before{background-position:0 -1014px}i.flag.cg:before,i.flag.congo.brazzaville:before{background-position:0 -1040px}i.flag.ch:before,i.flag.switzerland:before{background-position:0 -1066px}i.flag.ci:before,i.flag.cote.divoire:before{background-position:0 -1092px}i.flag.ck:before,i.flag.cook.islands:before{background-position:0 -1118px}i.flag.chile:before,i.flag.cl:before{background-position:0 -1144px}i.flag.cameroon:before,i.flag.cm:before{background-position:0 -1170px}i.flag.china:before,i.flag.cn:before{background-position:0 -1196px}i.flag.co:before,i.flag.colombia:before{background-position:0 -1222px}i.flag.costa.rica:before,i.flag.cr:before{background-position:0 -1248px}i.flag.cs:before,i.flag.serbia:before{background-position:0 -1274px}i.flag.cu:before,i.flag.cuba:before{background-position:0 -1300px}i.flag.cape.verde:before,i.flag.cv:before{background-position:0 -1326px}i.flag.christmas.island:before,i.flag.cx:before{background-position:0 -1352px}i.flag.cy:before,i.flag.cyprus:before{background-position:0 -1378px}i.flag.cz:before,i.flag.czech.republic:before{background-position:0 -1404px}i.flag.de:before,i.flag.germany:before{background-position:0 -1430px}i.flag.dj:before,i.flag.djibouti:before{background-position:0 -1456px}i.flag.denmark:before,i.flag.dk:before{background-position:0 -1482px}i.flag.dm:before,i.flag.dominica:before{background-position:0 -1508px}i.flag.do:before,i.flag.dominican.republic:before{background-position:0 -1534px}i.flag.algeria:before,i.flag.dz:before{background-position:0 -1560px}i.flag.ec:before,i.flag.ecuador:before{background-position:0 -1586px}i.flag.ee:before,i.flag.estonia:before{background-position:0 -1612px}i.flag.eg:before,i.flag.egypt:before{background-position:0 -1638px}i.flag.eh:before,i.flag.western.sahara:before{background-position:0 -1664px}i.flag.er:before,i.flag.eritrea:before{background-position:0 -1716px}i.flag.es:before,i.flag.spain:before{background-position:0 -1742px}i.flag.et:before,i.flag.ethiopia:before{background-position:0 -1768px}i.flag.eu:before,i.flag.european.union:before{background-position:0 -1794px}i.flag.fi:before,i.flag.finland:before{background-position:0 -1846px}i.flag.fiji:before,i.flag.fj:before{background-position:0 -1872px}i.flag.falkland.islands:before,i.flag.fk:before{background-position:0 -1898px}i.flag.fm:before,i.flag.micronesia:before{background-position:0 -1924px}i.flag.faroe.islands:before,i.flag.fo:before{background-position:0 -1950px}i.flag.fr:before,i.flag.france:before{background-position:0 -1976px}i.flag.ga:before,i.flag.gabon:before{background-position:-36px 0}i.flag.gb:before,i.flag.united.kingdom:before{background-position:-36px -26px}i.flag.gd:before,i.flag.grenada:before{background-position:-36px -52px}i.flag.ge:before,i.flag.georgia:before{background-position:-36px -78px}i.flag.french.guiana:before,i.flag.gf:before{background-position:-36px -104px}i.flag.gh:before,i.flag.ghana:before{background-position:-36px -130px}i.flag.gi:before,i.flag.gibraltar:before{background-position:-36px -156px}i.flag.gl:before,i.flag.greenland:before{background-position:-36px -182px}i.flag.gambia:before,i.flag.gm:before{background-position:-36px -208px}i.flag.gn:before,i.flag.guinea:before{background-position:-36px -234px}i.flag.gp:before,i.flag.guadeloupe:before{background-position:-36px -260px}i.flag.equatorial.guinea:before,i.flag.gq:before{background-position:-36px -286px}i.flag.gr:before,i.flag.greece:before{background-position:-36px -312px}i.flag.gs:before,i.flag.sandwich.islands:before{background-position:-36px -338px}i.flag.gt:before,i.flag.guatemala:before{background-position:-36px -364px}i.flag.gu:before,i.flag.guam:before{background-position:-36px -390px}i.flag.guinea-bissau:before,i.flag.gw:before{background-position:-36px -416px}i.flag.guyana:before,i.flag.gy:before{background-position:-36px -442px}i.flag.hk:before,i.flag.hong.kong:before{background-position:-36px -468px}i.flag.heard.island:before,i.flag.hm:before{background-position:-36px -494px}i.flag.hn:before,i.flag.honduras:before{background-position:-36px -520px}i.flag.croatia:before,i.flag.hr:before{background-position:-36px -546px}i.flag.haiti:before,i.flag.ht:before{background-position:-36px -572px}i.flag.hu:before,i.flag.hungary:before{background-position:-36px -598px}i.flag.id:before,i.flag.indonesia:before{background-position:-36px -624px}i.flag.ie:before,i.flag.ireland:before{background-position:-36px -650px}i.flag.il:before,i.flag.israel:before{background-position:-36px -676px}i.flag.in:before,i.flag.india:before{background-position:-36px -702px}i.flag.indian.ocean.territory:before,i.flag.io:before{background-position:-36px -728px}i.flag.iq:before,i.flag.iraq:before{background-position:-36px -754px}i.flag.ir:before,i.flag.iran:before{background-position:-36px -780px}i.flag.iceland:before,i.flag.is:before{background-position:-36px -806px}i.flag.it:before,i.flag.italy:before{background-position:-36px -832px}i.flag.jamaica:before,i.flag.jm:before{background-position:-36px -858px}i.flag.jo:before,i.flag.jordan:before{background-position:-36px -884px}i.flag.japan:before,i.flag.jp:before{background-position:-36px -910px}i.flag.ke:before,i.flag.kenya:before{background-position:-36px -936px}i.flag.kg:before,i.flag.kyrgyzstan:before{background-position:-36px -962px}i.flag.cambodia:before,i.flag.kh:before{background-position:-36px -988px}i.flag.ki:before,i.flag.kiribati:before{background-position:-36px -1014px}i.flag.comoros:before,i.flag.km:before{background-position:-36px -1040px}i.flag.kn:before,i.flag.saint.kitts.and.nevis:before{background-position:-36px -1066px}i.flag.kp:before,i.flag.north.korea:before{background-position:-36px -1092px}i.flag.kr:before,i.flag.south.korea:before{background-position:-36px -1118px}i.flag.kuwait:before,i.flag.kw:before{background-position:-36px -1144px}i.flag.cayman.islands:before,i.flag.ky:before{background-position:-36px -1170px}i.flag.kazakhstan:before,i.flag.kz:before{background-position:-36px -1196px}i.flag.la:before,i.flag.laos:before{background-position:-36px -1222px}i.flag.lb:before,i.flag.lebanon:before{background-position:-36px -1248px}i.flag.lc:before,i.flag.saint.lucia:before{background-position:-36px -1274px}i.flag.li:before,i.flag.liechtenstein:before{background-position:-36px -1300px}i.flag.lk:before,i.flag.sri.lanka:before{background-position:-36px -1326px}i.flag.liberia:before,i.flag.lr:before{background-position:-36px -1352px}i.flag.lesotho:before,i.flag.ls:before{background-position:-36px -1378px}i.flag.lithuania:before,i.flag.lt:before{background-position:-36px -1404px}i.flag.lu:before,i.flag.luxembourg:before{background-position:-36px -1430px}i.flag.latvia:before,i.flag.lv:before{background-position:-36px -1456px}i.flag.libya:before,i.flag.ly:before{background-position:-36px -1482px}i.flag.ma:before,i.flag.morocco:before{background-position:-36px -1508px}i.flag.mc:before,i.flag.monaco:before{background-position:-36px -1534px}i.flag.md:before,i.flag.moldova:before{background-position:-36px -1560px}i.flag.me:before,i.flag.montenegro:before{background-position:-36px -1586px}i.flag.madagascar:before,i.flag.mg:before{background-position:-36px -1613px}i.flag.marshall.islands:before,i.flag.mh:before{background-position:-36px -1639px}i.flag.macedonia:before,i.flag.mk:before{background-position:-36px -1665px}i.flag.mali:before,i.flag.ml:before{background-position:-36px -1691px}i.flag.burma:before,i.flag.mm:before,i.flag.myanmar:before{background-position:-36px -1717px}i.flag.mn:before,i.flag.mongolia:before{background-position:-36px -1743px}i.flag.macau:before,i.flag.mo:before{background-position:-36px -1769px}i.flag.mp:before,i.flag.northern.mariana.islands:before{background-position:-36px -1795px}i.flag.martinique:before,i.flag.mq:before{background-position:-36px -1821px}i.flag.mauritania:before,i.flag.mr:before{background-position:-36px -1847px}i.flag.montserrat:before,i.flag.ms:before{background-position:-36px -1873px}i.flag.malta:before,i.flag.mt:before{background-position:-36px -1899px}i.flag.mauritius:before,i.flag.mu:before{background-position:-36px -1925px}i.flag.maldives:before,i.flag.mv:before{background-position:-36px -1951px}i.flag.malawi:before,i.flag.mw:before{background-position:-36px -1977px}i.flag.mexico:before,i.flag.mx:before{background-position:-72px 0}i.flag.malaysia:before,i.flag.my:before{background-position:-72px -26px}i.flag.mozambique:before,i.flag.mz:before{background-position:-72px -52px}i.flag.na:before,i.flag.namibia:before{background-position:-72px -78px}i.flag.nc:before,i.flag.new.caledonia:before{background-position:-72px -104px}i.flag.ne:before,i.flag.niger:before{background-position:-72px -130px}i.flag.nf:before,i.flag.norfolk.island:before{background-position:-72px -156px}i.flag.ng:before,i.flag.nigeria:before{background-position:-72px -182px}i.flag.ni:before,i.flag.nicaragua:before{background-position:-72px -208px}i.flag.netherlands:before,i.flag.nl:before{background-position:-72px -234px}i.flag.no:before,i.flag.norway:before{background-position:-72px -260px}i.flag.nepal:before,i.flag.np:before{background-position:-72px -286px}i.flag.nauru:before,i.flag.nr:before{background-position:-72px -312px}i.flag.niue:before,i.flag.nu:before{background-position:-72px -338px}i.flag.new.zealand:before,i.flag.nz:before{background-position:-72px -364px}i.flag.om:before,i.flag.oman:before{background-position:-72px -390px}i.flag.pa:before,i.flag.panama:before{background-position:-72px -416px}i.flag.pe:before,i.flag.peru:before{background-position:-72px -442px}i.flag.french.polynesia:before,i.flag.pf:before{background-position:-72px -468px}i.flag.new.guinea:before,i.flag.pg:before{background-position:-72px -494px}i.flag.ph:before,i.flag.philippines:before{background-position:-72px -520px}i.flag.pakistan:before,i.flag.pk:before{background-position:-72px -546px}i.flag.pl:before,i.flag.poland:before{background-position:-72px -572px}i.flag.pm:before,i.flag.saint.pierre:before{background-position:-72px -598px}i.flag.pitcairn.islands:before,i.flag.pn:before{background-position:-72px -624px}i.flag.pr:before,i.flag.puerto.rico:before{background-position:-72px -650px}i.flag.palestine:before,i.flag.ps:before{background-position:-72px -676px}i.flag.portugal:before,i.flag.pt:before{background-position:-72px -702px}i.flag.palau:before,i.flag.pw:before{background-position:-72px -728px}i.flag.paraguay:before,i.flag.py:before{background-position:-72px -754px}i.flag.qa:before,i.flag.qatar:before{background-position:-72px -780px}i.flag.re:before,i.flag.reunion:before{background-position:-72px -806px}i.flag.ro:before,i.flag.romania:before{background-position:-72px -832px}i.flag.rs:before,i.flag.serbia:before{background-position:-72px -858px}i.flag.ru:before,i.flag.russia:before{background-position:-72px -884px}i.flag.rw:before,i.flag.rwanda:before{background-position:-72px -910px}i.flag.sa:before,i.flag.saudi.arabia:before{background-position:-72px -936px}i.flag.sb:before,i.flag.solomon.islands:before{background-position:-72px -962px}i.flag.sc:before,i.flag.seychelles:before{background-position:-72px -988px}i.flag.gb.sct:before,i.flag.scotland:before{background-position:-72px -1014px}i.flag.sd:before,i.flag.sudan:before{background-position:-72px -1040px}i.flag.se:before,i.flag.sweden:before{background-position:-72px -1066px}i.flag.sg:before,i.flag.singapore:before{background-position:-72px -1092px}i.flag.saint.helena:before,i.flag.sh:before{background-position:-72px -1118px}i.flag.si:before,i.flag.slovenia:before{background-position:-72px -1144px}i.flag.jan.mayen:before,i.flag.sj:before,i.flag.svalbard:before{background-position:-72px -1170px}i.flag.sk:before,i.flag.slovakia:before{background-position:-72px -1196px}i.flag.sierra.leone:before,i.flag.sl:before{background-position:-72px -1222px}i.flag.san.marino:before,i.flag.sm:before{background-position:-72px -1248px}i.flag.senegal:before,i.flag.sn:before{background-position:-72px -1274px}i.flag.so:before,i.flag.somalia:before{background-position:-72px -1300px}i.flag.sr:before,i.flag.suriname:before{background-position:-72px -1326px}i.flag.sao.tome:before,i.flag.st:before{background-position:-72px -1352px}i.flag.el.salvador:before,i.flag.sv:before{background-position:-72px -1378px}i.flag.sy:before,i.flag.syria:before{background-position:-72px -1404px}i.flag.swaziland:before,i.flag.sz:before{background-position:-72px -1430px}i.flag.caicos.islands:before,i.flag.tc:before{background-position:-72px -1456px}i.flag.chad:before,i.flag.td:before{background-position:-72px -1482px}i.flag.french.territories:before,i.flag.tf:before{background-position:-72px -1508px}i.flag.tg:before,i.flag.togo:before{background-position:-72px -1534px}i.flag.th:before,i.flag.thailand:before{background-position:-72px -1560px}i.flag.tajikistan:before,i.flag.tj:before{background-position:-72px -1586px}i.flag.tk:before,i.flag.tokelau:before{background-position:-72px -1612px}i.flag.timorleste:before,i.flag.tl:before{background-position:-72px -1638px}i.flag.tm:before,i.flag.turkmenistan:before{background-position:-72px -1664px}i.flag.tn:before,i.flag.tunisia:before{background-position:-72px -1690px}i.flag.to:before,i.flag.tonga:before{background-position:-72px -1716px}i.flag.tr:before,i.flag.turkey:before{background-position:-72px -1742px}i.flag.trinidad:before,i.flag.tt:before{background-position:-72px -1768px}i.flag.tuvalu:before,i.flag.tv:before{background-position:-72px -1794px}i.flag.taiwan:before,i.flag.tw:before{background-position:-72px -1820px}i.flag.tanzania:before,i.flag.tz:before{background-position:-72px -1846px}i.flag.ua:before,i.flag.ukraine:before{background-position:-72px -1872px}i.flag.ug:before,i.flag.uganda:before{background-position:-72px -1898px}i.flag.um:before,i.flag.us.minor.islands:before{background-position:-72px -1924px}i.flag.america:before,i.flag.united.states:before,i.flag.us:before{background-position:-72px -1950px}i.flag.uruguay:before,i.flag.uy:before{background-position:-72px -1976px}i.flag.uz:before,i.flag.uzbekistan:before{background-position:-108px 0}i.flag.va:before,i.flag.vatican.city:before{background-position:-108px -26px}i.flag.saint.vincent:before,i.flag.vc:before{background-position:-108px -52px}i.flag.ve:before,i.flag.venezuela:before{background-position:-108px -78px}i.flag.british.virgin.islands:before,i.flag.vg:before{background-position:-108px -104px}i.flag.us.virgin.islands:before,i.flag.vi:before{background-position:-108px -130px}i.flag.vietnam:before,i.flag.vn:before{background-position:-108px -156px}i.flag.vanuatu:before,i.flag.vu:before{background-position:-108px -182px}i.flag.gb.wls:before,i.flag.wales:before{background-position:-108px -208px}i.flag.wallis.and.futuna:before,i.flag.wf:before{background-position:-108px -234px}i.flag.samoa:before,i.flag.ws:before{background-position:-108px -260px}i.flag.ye:before,i.flag.yemen:before{background-position:-108px -286px}i.flag.mayotte:before,i.flag.yt:before{background-position:-108px -312px}i.flag.south.africa:before,i.flag.za:before{background-position:-108px -338px}i.flag.zambia:before,i.flag.zm:before{background-position:-108px -364px}i.flag.zimbabwe:before,i.flag.zw:before{background-position:-108px -390px}.ui.header{border:none;margin:calc(2rem - .14285em) 0 1rem;padding:0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-weight:700;line-height:1.2857em;text-transform:none;color:rgba(0,0,0,.87)}.ui.header:first-child{margin-top:-.14285em}.ui.header:last-child{margin-bottom:0}.ui.header .sub.header{display:block;font-weight:400;padding:0;margin:0;line-height:1.2em;color:rgba(0,0,0,.6)}.ui.header>.icon{display:table-cell;opacity:1;font-size:1.5em;padding-top:.14285em;vertical-align:middle}.ui.header .icon:only-child{display:inline-block;padding:0;margin-right:.75rem}.ui.header>.image,.ui.header>img{display:inline-block;margin-top:.14285em;width:2.5em;height:auto;vertical-align:middle}.ui.header>.image:only-child,.ui.header>img:only-child{margin-right:.75rem}.ui.header .content{display:inline-block;vertical-align:top}.ui.header>.image+.content,.ui.header>img+.content{padding-left:.75rem;vertical-align:middle}.ui.header>.icon+.content{padding-left:.75rem;display:table-cell;vertical-align:middle}.ui.header .ui.label{font-size:'';margin-left:.5rem;vertical-align:middle}.ui.header+p{margin-top:0}h1.ui.header{font-size:2rem}h2.ui.header{font-size:1.714rem}h3.ui.header{font-size:1.28rem}h4.ui.header{font-size:1.071rem}h5.ui.header{font-size:1rem}h1.ui.header .sub.header,h2.ui.header .sub.header{font-size:1.14285714rem}h3.ui.header .sub.header,h4.ui.header .sub.header{font-size:1rem}h5.ui.header .sub.header{font-size:.92857143rem}.ui.huge.header{min-height:1em;font-size:2em}.ui.large.header{font-size:1.714em}.ui.medium.header{font-size:1.28em}.ui.small.header{font-size:1.071em}.ui.tiny.header{font-size:1em}.ui.huge.header .sub.header,.ui.large.header .sub.header{font-size:1.14285714rem}.ui.header .sub.header,.ui.small.header .sub.header{font-size:1rem}.ui.tiny.header .sub.header{font-size:.92857143rem}.ui.small.sub.header{font-size:.78571429em}.ui.sub.header{padding:0;margin-bottom:.14285714rem;font-weight:700;text-transform:uppercase;color:'';font-size:.85714286em}.ui.large.sub.header{font-size:.92857143em}.ui.huge.sub.header{font-size:1em}.ui.icon.header{display:inline-block;text-align:center;margin:2rem 0 1rem}.ui.icon.header:after{content:'';display:block;height:0;clear:both;visibility:hidden}.ui.icon.header:first-child{margin-top:0}.ui.icon.header .icon{float:none;display:block;width:auto;height:auto;line-height:1;padding:0;font-size:3em;margin:0 auto .5rem;opacity:1}.ui.icon.header .content{display:block;padding:0}.ui.icon.header .circular.icon,.ui.icon.header .square.icon{font-size:2em}.ui.block.icon.header .icon{margin-bottom:0}.ui.icon.header.aligned{margin-left:auto;margin-right:auto;display:block}.ui.disabled.header{opacity:.45}.ui.inverted.header{color:#FFF}.ui.inverted.header .sub.header{color:rgba(255,255,255,.8)}.ui.inverted.attached.header{background:-webkit-linear-gradient(transparent,rgba(0,0,0,.05)) #545454;background:linear-gradient(transparent,rgba(0,0,0,.05)) #545454;box-shadow:none;border-color:transparent}.ui.inverted.block.header{background:-webkit-linear-gradient(transparent,rgba(0,0,0,.05)) #545454;background:linear-gradient(transparent,rgba(0,0,0,.05)) #545454;box-shadow:none;border-bottom:none}.ui.red.header{color:#DB2828!important}a.ui.red.header:hover{color:#d01919!important}.ui.red.dividing.header{border-bottom:2px solid #DB2828}.ui.inverted.red.header{color:#FF695E!important}a.ui.inverted.red.header:hover{color:#ff5144!important}.ui.orange.header{color:#F2711C!important}a.ui.orange.header:hover{color:#f26202!important}.ui.orange.dividing.header{border-bottom:2px solid #F2711C}.ui.inverted.orange.header{color:#FF851B!important}a.ui.inverted.orange.header:hover{color:#ff7701!important}.ui.olive.header{color:#B5CC18!important}a.ui.olive.header:hover{color:#a7bd0d!important}.ui.olive.dividing.header{border-bottom:2px solid #B5CC18}.ui.inverted.olive.header{color:#D9E778!important}a.ui.inverted.olive.header:hover{color:#d8ea5c!important}.ui.yellow.header{color:#FBBD08!important}a.ui.yellow.header:hover{color:#eaae00!important}.ui.yellow.dividing.header{border-bottom:2px solid #FBBD08}.ui.inverted.yellow.header{color:#FFE21F!important}a.ui.inverted.yellow.header:hover{color:#ffdf05!important}.ui.green.header{color:#21BA45!important}a.ui.green.header:hover{color:#16ab39!important}.ui.green.dividing.header{border-bottom:2px solid #21BA45}.ui.inverted.green.header{color:#2ECC40!important}a.ui.inverted.green.header:hover{color:#22be34!important}.ui.teal.header{color:#00B5AD!important}a.ui.teal.header:hover{color:#009c95!important}.ui.teal.dividing.header{border-bottom:2px solid #00B5AD}.ui.inverted.teal.header{color:#6DFFFF!important}a.ui.inverted.teal.header:hover{color:#54ffff!important}.ui.blue.header{color:#2185D0!important}a.ui.blue.header:hover{color:#1678c2!important}.ui.blue.dividing.header{border-bottom:2px solid #2185D0}.ui.inverted.blue.header{color:#54C8FF!important}a.ui.inverted.blue.header:hover{color:#3ac0ff!important}.ui.violet.header{color:#6435C9!important}a.ui.violet.header:hover{color:#5829bb!important}.ui.violet.dividing.header{border-bottom:2px solid #6435C9}.ui.inverted.violet.header{color:#A291FB!important}a.ui.inverted.violet.header:hover{color:#8a73ff!important}.ui.purple.header{color:#A333C8!important}a.ui.purple.header:hover{color:#9627ba!important}.ui.purple.dividing.header{border-bottom:2px solid #A333C8}.ui.inverted.purple.header{color:#DC73FF!important}a.ui.inverted.purple.header:hover{color:#d65aff!important}.ui.pink.header{color:#E03997!important}a.ui.pink.header:hover{color:#e61a8d!important}.ui.pink.dividing.header{border-bottom:2px solid #E03997}.ui.inverted.pink.header{color:#FF8EDF!important}a.ui.inverted.pink.header:hover{color:#ff74d8!important}.ui.brown.header{color:#A5673F!important}a.ui.brown.header:hover{color:#975b33!important}.ui.brown.dividing.header{border-bottom:2px solid #A5673F}.ui.inverted.brown.header{color:#D67C1C!important}a.ui.inverted.brown.header:hover{color:#c86f11!important}.ui.grey.header{color:#767676!important}a.ui.grey.header:hover{color:#838383!important}.ui.grey.dividing.header{border-bottom:2px solid #767676}.ui.inverted.grey.header{color:#DCDDDE!important}a.ui.inverted.grey.header:hover{color:#cfd0d2!important}.ui.left.aligned.header{text-align:left}.ui.right.aligned.header{text-align:right}.ui.center.aligned.header,.ui.centered.header{text-align:center}.ui.justified.header{text-align:justify}.ui.justified.header:after{display:inline-block;content:'';width:100%}.ui.floated.header,.ui[class*="left floated"].header{float:left;margin-top:0;margin-right:.5em}.ui[class*="right floated"].header{float:right;margin-top:0;margin-left:.5em}.ui.fitted.header{padding:0}.ui.dividing.header{padding-bottom:.21428571rem;border-bottom:1px solid rgba(34,36,38,.15)}.ui.dividing.header .sub.header{padding-bottom:.21428571rem}.ui.dividing.header .icon{margin-bottom:0}.ui.inverted.dividing.header{border-bottom-color:rgba(255,255,255,.1)}.ui.block.header{background:#F3F4F5;padding:.78571429rem 1rem;box-shadow:none;border:1px solid #D4D4D5;border-radius:.28571429rem}.ui.tiny.block.header{font-size:.85714286rem}.ui.small.block.header{font-size:.92857143rem}.ui.block.header:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){font-size:1rem}.ui.large.block.header{font-size:1.14285714rem}.ui.huge.block.header{font-size:1.42857143rem}.ui.attached.header{background:#FFF;padding:.78571429rem 1rem;margin-left:-1px;margin-right:-1px;box-shadow:none;border:1px solid #D4D4D5}.ui.attached.block.header{background:#F3F4F5}.ui.attached:not(.top):not(.bottom).header{margin-top:0;margin-bottom:0;border-top:none;border-radius:0}.ui.top.attached.header{margin-bottom:0;border-radius:.28571429rem .28571429rem 0 0}.ui.bottom.attached.header{margin-top:0;border-top:none;border-radius:0 0 .28571429rem .28571429rem}.ui.tiny.attached.header{font-size:.85714286em}.ui.small.attached.header{font-size:.92857143em}.ui.attached.header:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){font-size:1em}.ui.large.attached.header{font-size:1.14285714em}.ui.huge.attached.header{font-size:1.42857143em}.ui.header:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){font-size:1.28em}@font-face{font-family:Icons;src:url(themes/default/assets/fonts/icons.eot);src:url(themes/default/assets/fonts/icons.eot?#iefix) format('embedded-opentype'),url(themes/default/assets/fonts/icons.woff2) format('woff2'),url(themes/default/assets/fonts/icons.woff) format('woff'),url(themes/default/assets/fonts/icons.ttf) format('truetype'),url(themes/default/assets/fonts/icons.svg#icons) format('svg');font-style:normal;font-weight:400;font-variant:normal;text-decoration:inherit;text-transform:none}i.icon{display:inline-block;opacity:1;margin:0 .25rem 0 0;width:1.18em;height:1em;font-family:Icons;font-style:normal;font-weight:400;text-decoration:inherit;text-align:center;speak:none;font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-backface-visibility:hidden;backface-visibility:hidden}i.icon:before{background:0 0!important}i.icon.loading{height:1em;line-height:1;-webkit-animation:icon-loading 2s linear infinite;animation:icon-loading 2s linear infinite}@-webkit-keyframes icon-loading{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes icon-loading{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}i.emphasized.icon,i.icon.active,i.icon.hover{opacity:1!important}i.disabled.icon{opacity:.45!important}i.fitted.icon{width:auto;margin:0}i.link.icon{cursor:pointer;opacity:.8;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}i.link.icon:hover{opacity:1!important}i.circular.icon{border-radius:500em!important;line-height:1!important;padding:.5em!important;box-shadow:0 0 0 .1em rgba(0,0,0,.1) inset;width:2em!important;height:2em!important}i.circular.inverted.icon{border:none;box-shadow:none}i.flipped.icon,i.horizontally.flipped.icon{-webkit-transform:scale(-1,1);transform:scale(-1,1)}i.vertically.flipped.icon{-webkit-transform:scale(1,-1);transform:scale(1,-1)}i.clockwise.rotated.icon,i.right.rotated.icon,i.rotated.icon{-webkit-transform:rotate(90deg);transform:rotate(90deg)}i.counterclockwise.rotated.icon,i.left.rotated.icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}i.bordered.icon{line-height:1;vertical-align:baseline;width:2em;height:2em;padding:.5em .41em!important;box-shadow:0 0 0 .1em rgba(0,0,0,.1) inset}i.bordered.inverted.icon{border:none;box-shadow:none}i.inverted.bordered.icon,i.inverted.circular.icon{background-color:#1B1C1D!important;color:#FFF!important}i.inverted.icon{color:#FFF}i.red.icon{color:#DB2828!important}i.inverted.red.icon{color:#FF695E!important}i.inverted.bordered.red.icon,i.inverted.circular.red.icon{background-color:#DB2828!important;color:#FFF!important}i.orange.icon{color:#F2711C!important}i.inverted.orange.icon{color:#FF851B!important}i.inverted.bordered.orange.icon,i.inverted.circular.orange.icon{background-color:#F2711C!important;color:#FFF!important}i.yellow.icon{color:#FBBD08!important}i.inverted.yellow.icon{color:#FFE21F!important}i.inverted.bordered.yellow.icon,i.inverted.circular.yellow.icon{background-color:#FBBD08!important;color:#FFF!important}i.olive.icon{color:#B5CC18!important}i.inverted.olive.icon{color:#D9E778!important}i.inverted.bordered.olive.icon,i.inverted.circular.olive.icon{background-color:#B5CC18!important;color:#FFF!important}i.green.icon{color:#21BA45!important}i.inverted.green.icon{color:#2ECC40!important}i.inverted.bordered.green.icon,i.inverted.circular.green.icon{background-color:#21BA45!important;color:#FFF!important}i.teal.icon{color:#00B5AD!important}i.inverted.teal.icon{color:#6DFFFF!important}i.inverted.bordered.teal.icon,i.inverted.circular.teal.icon{background-color:#00B5AD!important;color:#FFF!important}i.blue.icon{color:#2185D0!important}i.inverted.blue.icon{color:#54C8FF!important}i.inverted.bordered.blue.icon,i.inverted.circular.blue.icon{background-color:#2185D0!important;color:#FFF!important}i.violet.icon{color:#6435C9!important}i.inverted.violet.icon{color:#A291FB!important}i.inverted.bordered.violet.icon,i.inverted.circular.violet.icon{background-color:#6435C9!important;color:#FFF!important}i.purple.icon{color:#A333C8!important}i.inverted.purple.icon{color:#DC73FF!important}i.inverted.bordered.purple.icon,i.inverted.circular.purple.icon{background-color:#A333C8!important;color:#FFF!important}i.pink.icon{color:#E03997!important}i.inverted.pink.icon{color:#FF8EDF!important}i.inverted.bordered.pink.icon,i.inverted.circular.pink.icon{background-color:#E03997!important;color:#FFF!important}i.brown.icon{color:#A5673F!important}i.inverted.brown.icon{color:#D67C1C!important}i.inverted.bordered.brown.icon,i.inverted.circular.brown.icon{background-color:#A5673F!important;color:#FFF!important}i.grey.icon{color:#767676!important}i.inverted.grey.icon{color:#DCDDDE!important}i.inverted.bordered.grey.icon,i.inverted.circular.grey.icon{background-color:#767676!important;color:#FFF!important}i.black.icon{color:#1B1C1D!important}i.inverted.black.icon{color:#545454!important}i.inverted.bordered.black.icon,i.inverted.circular.black.icon{background-color:#1B1C1D!important;color:#FFF!important}i.mini.icon,i.mini.icons{line-height:1;font-size:.4em}i.tiny.icon,i.tiny.icons{line-height:1;font-size:.5em}i.small.icon,i.small.icons{line-height:1;font-size:.75em}i.icon,i.icons{font-size:1em}i.large.icon,i.large.icons{line-height:1;vertical-align:middle;font-size:1.5em}i.big.icon,i.big.icons{line-height:1;vertical-align:middle;font-size:2em}i.huge.icon,i.huge.icons{line-height:1;vertical-align:middle;font-size:4em}i.massive.icon,i.massive.icons{line-height:1;vertical-align:middle;font-size:8em}i.icons{display:inline-block;position:relative;line-height:1}i.icons .icon{position:absolute;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);margin:0}i.icons .icon:first-child{position:static;width:auto;height:auto;vertical-align:top;-webkit-transform:none;transform:none;margin-right:.25rem}i.icons .corner.icon{top:auto;left:auto;right:0;bottom:0;-webkit-transform:none;transform:none;font-size:.45em;text-shadow:-1px -1px 0 #FFF,1px -1px 0 #FFF,-1px 1px 0 #FFF,1px 1px 0 #FFF}i.icons .inverted.corner.icon{text-shadow:-1px -1px 0 #1B1C1D,1px -1px 0 #1B1C1D,-1px 1px 0 #1B1C1D,1px 1px 0 #1B1C1D}i.icon.search:before{content:"\f002"}i.icon.mail.outline:before{content:"\f003"}i.icon.signal:before{content:"\f012"}i.icon.setting:before{content:"\f013"}i.icon.home:before{content:"\f015"}i.icon.inbox:before{content:"\f01c"}i.icon.browser:before{content:"\f022"}i.icon.tag:before{content:"\f02b"}i.icon.tags:before{content:"\f02c"}i.icon.image:before{content:"\f03e"}i.icon.calendar:before{content:"\f073"}i.icon.comment:before{content:"\f075"}i.icon.shop:before{content:"\f07a"}i.icon.privacy:before{content:"\f084"}i.icon.settings:before{content:"\f085"}i.icon.comments:before{content:"\f086"}i.icon.external:before{content:"\f08e"}i.icon.trophy:before{content:"\f091"}i.icon.payment:before{content:"\f09d"}i.icon.feed:before{content:"\f09e"}i.icon.alarm.outline:before{content:"\f0a2"}i.icon.tasks:before{content:"\f0ae"}i.icon.cloud:before{content:"\f0c2"}i.icon.lab:before{content:"\f0c3"}i.icon.mail:before{content:"\f0e0"}i.icon.dashboard:before{content:"\f0e4"}i.icon.comment.outline:before{content:"\f0e5"}i.icon.comments.outline:before{content:"\f0e6"}i.icon.sitemap:before{content:"\f0e8"}i.icon.idea:before{content:"\f0eb"}i.icon.alarm:before{content:"\f0f3"}i.icon.terminal:before{content:"\f120"}i.icon.code:before{content:"\f121"}i.icon.protect:before{content:"\f132"}i.icon.calendar.outline:before{content:"\f133"}i.icon.ticket:before{content:"\f145"}i.icon.external.square:before{content:"\f14c"}i.icon.bug:before{content:"\f188"}i.icon.mail.square:before{content:"\f199"}i.icon.history:before{content:"\f1da"}i.icon.options:before{content:"\f1de"}i.icon.text.telephone:before{content:"\f1e4"}i.icon.find:before{content:"\f1e5"}i.icon.wifi:before{content:"\f1eb"}i.icon.alarm.mute:before{content:"\f1f6"}i.icon.alarm.mute.outline:before{content:"\f1f7"}i.icon.copyright:before{content:"\f1f9"}i.icon.at:before{content:"\f1fa"}i.icon.eyedropper:before{content:"\f1fb"}i.icon.paint.brush:before{content:"\f1fc"}i.icon.heartbeat:before{content:"\f21e"}i.icon.mouse.pointer:before{content:"\f245"}i.icon.hourglass.empty:before{content:"\f250"}i.icon.hourglass.start:before{content:"\f251"}i.icon.hourglass.half:before{content:"\f252"}i.icon.hourglass.end:before{content:"\f253"}i.icon.hourglass.full:before{content:"\f254"}i.icon.hand.pointer:before{content:"\f25a"}i.icon.trademark:before{content:"\f25c"}i.icon.registered:before{content:"\f25d"}i.icon.creative.commons:before{content:"\f25e"}i.icon.add.to.calendar:before{content:"\f271"}i.icon.remove.from.calendar:before{content:"\f272"}i.icon.delete.calendar:before{content:"\f273"}i.icon.checked.calendar:before{content:"\f274"}i.icon.industry:before{content:"\f275"}i.icon.shopping.bag:before{content:"\f290"}i.icon.shopping.basket:before{content:"\f291"}i.icon.hashtag:before{content:"\f292"}i.icon.percent:before{content:"\f295"}i.icon.wait:before{content:"\f017"}i.icon.download:before{content:"\f019"}i.icon.repeat:before{content:"\f01e"}i.icon.refresh:before{content:"\f021"}i.icon.lock:before{content:"\f023"}i.icon.bookmark:before{content:"\f02e"}i.icon.print:before{content:"\f02f"}i.icon.write:before{content:"\f040"}i.icon.adjust:before{content:"\f042"}i.icon.theme:before{content:"\f043"}i.icon.edit:before{content:"\f044"}i.icon.external.share:before{content:"\f045"}i.icon.ban:before{content:"\f05e"}i.icon.mail.forward:before,i.icon.share:before{content:"\f064"}i.icon.expand:before{content:"\f065"}i.icon.compress:before{content:"\f066"}i.icon.unhide:before{content:"\f06e"}i.icon.hide:before{content:"\f070"}i.icon.random:before{content:"\f074"}i.icon.retweet:before{content:"\f079"}i.icon.sign.out:before{content:"\f08b"}i.icon.pin:before{content:"\f08d"}i.icon.sign.in:before{content:"\f090"}i.icon.upload:before{content:"\f093"}i.icon.call:before{content:"\f095"}i.icon.remove.bookmark:before{content:"\f097"}i.icon.call.square:before{content:"\f098"}i.icon.unlock:before{content:"\f09c"}i.icon.configure:before{content:"\f0ad"}i.icon.filter:before{content:"\f0b0"}i.icon.wizard:before{content:"\f0d0"}i.icon.undo:before{content:"\f0e2"}i.icon.exchange:before{content:"\f0ec"}i.icon.cloud.download:before{content:"\f0ed"}i.icon.cloud.upload:before{content:"\f0ee"}i.icon.reply:before{content:"\f112"}i.icon.reply.all:before{content:"\f122"}i.icon.erase:before{content:"\f12d"}i.icon.unlock.alternate:before{content:"\f13e"}i.icon.write.square:before{content:"\f14b"}i.icon.share.square:before{content:"\f14d"}i.icon.archive:before{content:"\f187"}i.icon.translate:before{content:"\f1ab"}i.icon.recycle:before{content:"\f1b8"}i.icon.send:before{content:"\f1d8"}i.icon.send.outline:before{content:"\f1d9"}i.icon.share.alternate:before{content:"\f1e0"}i.icon.share.alternate.square:before{content:"\f1e1"}i.icon.add.to.cart:before{content:"\f217"}i.icon.in.cart:before{content:"\f218"}i.icon.add.user:before{content:"\f234"}i.icon.remove.user:before{content:"\f235"}i.icon.object.group:before{content:"\f247"}i.icon.object.ungroup:before{content:"\f248"}i.icon.clone:before{content:"\f24d"}i.icon.talk.outline:before{content:"\f27b"}i.icon.help.circle:before{content:"\f059"}i.icon.info.circle:before{content:"\f05a"}i.icon.warning.circle:before{content:"\f06a"}i.icon.warning.sign:before{content:"\f071"}i.icon.announcement:before{content:"\f0a1"}i.icon.help:before{content:"\f128"}i.icon.info:before{content:"\f129"}i.icon.warning:before{content:"\f12a"}i.icon.birthday:before{content:"\f1fd"}i.icon.help.circle.outline:before{content:"\f29c"}i.icon.user:before{content:"\f007"}i.icon.users:before{content:"\f0c0"}i.icon.doctor:before{content:"\f0f0"}i.icon.handicap:before{content:"\f193"}i.icon.student:before{content:"\f19d"}i.icon.child:before{content:"\f1ae"}i.icon.spy:before{content:"\f21b"}i.icon.female:before{content:"\f182"}i.icon.male:before{content:"\f183"}i.icon.woman:before{content:"\f221"}i.icon.man:before{content:"\f222"}i.icon.non.binary.transgender:before{content:"\f223"}i.icon.intergender:before{content:"\f224"}i.icon.transgender:before{content:"\f225"}i.icon.lesbian:before{content:"\f226"}i.icon.gay:before{content:"\f227"}i.icon.heterosexual:before{content:"\f228"}i.icon.other.gender:before{content:"\f229"}i.icon.other.gender.vertical:before{content:"\f22a"}i.icon.other.gender.horizontal:before{content:"\f22b"}i.icon.neuter:before{content:"\f22c"}i.icon.genderless:before{content:"\f22d"}i.icon.universal.access:before{content:"\f29a"}i.icon.wheelchair:before{content:"\f29b"}i.icon.blind:before{content:"\f29d"}i.icon.audio.description:before{content:"\f29e"}i.icon.volume.control.phone:before{content:"\f2a0"}i.icon.braille:before{content:"\f2a1"}i.icon.asl:before{content:"\f2a3"}i.icon.assistive.listening.systems:before{content:"\f2a2"}i.icon.deafness:before{content:"\f2a4"}i.icon.sign.language:before{content:"\f2a7"}i.icon.low.vision:before{content:"\f2a8"}i.icon.block.layout:before{content:"\f009"}i.icon.grid.layout:before{content:"\f00a"}i.icon.list.layout:before{content:"\f00b"}i.icon.zoom:before{content:"\f00e"}i.icon.zoom.out:before{content:"\f010"}i.icon.resize.vertical:before{content:"\f07d"}i.icon.resize.horizontal:before{content:"\f07e"}i.icon.maximize:before{content:"\f0b2"}i.icon.crop:before{content:"\f125"}i.icon.cocktail:before{content:"\f000"}i.icon.road:before{content:"\f018"}i.icon.flag:before{content:"\f024"}i.icon.book:before{content:"\f02d"}i.icon.gift:before{content:"\f06b"}i.icon.leaf:before{content:"\f06c"}i.icon.fire:before{content:"\f06d"}i.icon.plane:before{content:"\f072"}i.icon.magnet:before{content:"\f076"}i.icon.lemon:before{content:"\f094"}i.icon.world:before{content:"\f0ac"}i.icon.travel:before{content:"\f0b1"}i.icon.shipping:before{content:"\f0d1"}i.icon.money:before{content:"\f0d6"}i.icon.legal:before{content:"\f0e3"}i.icon.lightning:before{content:"\f0e7"}i.icon.umbrella:before{content:"\f0e9"}i.icon.treatment:before{content:"\f0f1"}i.icon.suitcase:before{content:"\f0f2"}i.icon.bar:before{content:"\f0fc"}i.icon.flag.outline:before{content:"\f11d"}i.icon.flag.checkered:before{content:"\f11e"}i.icon.puzzle:before{content:"\f12e"}i.icon.fire.extinguisher:before{content:"\f134"}i.icon.rocket:before{content:"\f135"}i.icon.anchor:before{content:"\f13d"}i.icon.bullseye:before{content:"\f140"}i.icon.sun:before{content:"\f185"}i.icon.moon:before{content:"\f186"}i.icon.fax:before{content:"\f1ac"}i.icon.life.ring:before{content:"\f1cd"}i.icon.bomb:before{content:"\f1e2"}i.icon.soccer:before{content:"\f1e3"}i.icon.calculator:before{content:"\f1ec"}i.icon.diamond:before{content:"\f219"}i.icon.sticky.note:before{content:"\f249"}i.icon.sticky.note.outline:before{content:"\f24a"}i.icon.law:before{content:"\f24e"}i.icon.hand.peace:before{content:"\f25b"}i.icon.hand.rock:before{content:"\f255"}i.icon.hand.paper:before{content:"\f256"}i.icon.hand.scissors:before{content:"\f257"}i.icon.hand.lizard:before{content:"\f258"}i.icon.hand.spock:before{content:"\f259"}i.icon.tv:before{content:"\f26c"}i.icon.crosshairs:before{content:"\f05b"}i.icon.asterisk:before{content:"\f069"}i.icon.square.outline:before{content:"\f096"}i.icon.certificate:before{content:"\f0a3"}i.icon.square:before{content:"\f0c8"}i.icon.quote.left:before{content:"\f10d"}i.icon.quote.right:before{content:"\f10e"}i.icon.spinner:before{content:"\f110"}i.icon.circle:before{content:"\f111"}i.icon.ellipsis.horizontal:before{content:"\f141"}i.icon.ellipsis.vertical:before{content:"\f142"}i.icon.cube:before{content:"\f1b2"}i.icon.cubes:before{content:"\f1b3"}i.icon.circle.notched:before{content:"\f1ce"}i.icon.circle.thin:before{content:"\f1db"}i.icon.checkmark:before{content:"\f00c"}i.icon.remove:before{content:"\f00d"}i.icon.checkmark.box:before{content:"\f046"}i.icon.move:before{content:"\f047"}i.icon.add.circle:before{content:"\f055"}i.icon.minus.circle:before{content:"\f056"}i.icon.remove.circle:before{content:"\f057"}i.icon.check.circle:before{content:"\f058"}i.icon.remove.circle.outline:before{content:"\f05c"}i.icon.check.circle.outline:before{content:"\f05d"}i.icon.plus:before{content:"\f067"}i.icon.minus:before{content:"\f068"}i.icon.add.square:before{content:"\f0fe"}i.icon.radio:before{content:"\f10c"}i.icon.minus.square:before{content:"\f146"}i.icon.minus.square.outline:before{content:"\f147"}i.icon.check.square:before{content:"\f14a"}i.icon.selected.radio:before{content:"\f192"}i.icon.plus.square.outline:before{content:"\f196"}i.icon.toggle.off:before{content:"\f204"}i.icon.toggle.on:before{content:"\f205"}i.icon.film:before{content:"\f008"}i.icon.sound:before{content:"\f025"}i.icon.photo:before{content:"\f030"}i.icon.bar.chart:before{content:"\f080"}i.icon.camera.retro:before{content:"\f083"}i.icon.newspaper:before{content:"\f1ea"}i.icon.area.chart:before{content:"\f1fe"}i.icon.pie.chart:before{content:"\f200"}i.icon.line.chart:before{content:"\f201"}i.icon.arrow.circle.outline.down:before{content:"\f01a"}i.icon.arrow.circle.outline.up:before{content:"\f01b"}i.icon.chevron.left:before{content:"\f053"}i.icon.chevron.right:before{content:"\f054"}i.icon.arrow.left:before{content:"\f060"}i.icon.arrow.right:before{content:"\f061"}i.icon.arrow.up:before{content:"\f062"}i.icon.arrow.down:before{content:"\f063"}i.icon.chevron.up:before{content:"\f077"}i.icon.chevron.down:before{content:"\f078"}i.icon.pointing.right:before{content:"\f0a4"}i.icon.pointing.left:before{content:"\f0a5"}i.icon.pointing.up:before{content:"\f0a6"}i.icon.pointing.down:before{content:"\f0a7"}i.icon.arrow.circle.left:before{content:"\f0a8"}i.icon.arrow.circle.right:before{content:"\f0a9"}i.icon.arrow.circle.up:before{content:"\f0aa"}i.icon.arrow.circle.down:before{content:"\f0ab"}i.icon.caret.down:before{content:"\f0d7"}i.icon.caret.up:before{content:"\f0d8"}i.icon.caret.left:before{content:"\f0d9"}i.icon.caret.right:before{content:"\f0da"}i.icon.angle.double.left:before{content:"\f100"}i.icon.angle.double.right:before{content:"\f101"}i.icon.angle.double.up:before{content:"\f102"}i.icon.angle.double.down:before{content:"\f103"}i.icon.angle.left:before{content:"\f104"}i.icon.angle.right:before{content:"\f105"}i.icon.angle.up:before{content:"\f106"}i.icon.angle.down:before{content:"\f107"}i.icon.chevron.circle.left:before{content:"\f137"}i.icon.chevron.circle.right:before{content:"\f138"}i.icon.chevron.circle.up:before{content:"\f139"}i.icon.chevron.circle.down:before{content:"\f13a"}i.icon.toggle.down:before{content:"\f150"}i.icon.toggle.up:before{content:"\f151"}i.icon.toggle.right:before{content:"\f152"}i.icon.long.arrow.down:before{content:"\f175"}i.icon.long.arrow.up:before{content:"\f176"}i.icon.long.arrow.left:before{content:"\f177"}i.icon.long.arrow.right:before{content:"\f178"}i.icon.arrow.circle.outline.right:before{content:"\f18e"}i.icon.arrow.circle.outline.left:before{content:"\f190"}i.icon.toggle.left:before{content:"\f191"}i.icon.tablet:before{content:"\f10a"}i.icon.mobile:before{content:"\f10b"}i.icon.battery.full:before{content:"\f240"}i.icon.battery.high:before{content:"\f241"}i.icon.battery.medium:before{content:"\f242"}i.icon.battery.low:before{content:"\f243"}i.icon.battery.empty:before{content:"\f244"}i.icon.power:before{content:"\f011"}i.icon.trash.outline:before{content:"\f014"}i.icon.disk.outline:before{content:"\f0a0"}i.icon.desktop:before{content:"\f108"}i.icon.laptop:before{content:"\f109"}i.icon.game:before{content:"\f11b"}i.icon.keyboard:before{content:"\f11c"}i.icon.plug:before{content:"\f1e6"}i.icon.trash:before{content:"\f1f8"}i.icon.file.outline:before{content:"\f016"}i.icon.folder:before{content:"\f07b"}i.icon.folder.open:before{content:"\f07c"}i.icon.file.text.outline:before{content:"\f0f6"}i.icon.folder.outline:before{content:"\f114"}i.icon.folder.open.outline:before{content:"\f115"}i.icon.level.up:before{content:"\f148"}i.icon.level.down:before{content:"\f149"}i.icon.file:before{content:"\f15b"}i.icon.file.text:before{content:"\f15c"}i.icon.file.pdf.outline:before{content:"\f1c1"}i.icon.file.word.outline:before{content:"\f1c2"}i.icon.file.excel.outline:before{content:"\f1c3"}i.icon.file.powerpoint.outline:before{content:"\f1c4"}i.icon.file.image.outline:before{content:"\f1c5"}i.icon.file.archive.outline:before{content:"\f1c6"}i.icon.file.audio.outline:before{content:"\f1c7"}i.icon.file.video.outline:before{content:"\f1c8"}i.icon.file.code.outline:before{content:"\f1c9"}i.icon.qrcode:before{content:"\f029"}i.icon.barcode:before{content:"\f02a"}i.icon.rss:before{content:"\f09e"}i.icon.fork:before{content:"\f126"}i.icon.html5:before{content:"\f13b"}i.icon.css3:before{content:"\f13c"}i.icon.rss.square:before{content:"\f143"}i.icon.openid:before{content:"\f19b"}i.icon.database:before{content:"\f1c0"}i.icon.server:before{content:"\f233"}i.icon.usb:before{content:"\f287"}i.icon.bluetooth:before{content:"\f293"}i.icon.bluetooth.alternative:before{content:"\f294"}i.icon.heart:before{content:"\f004"}i.icon.star:before{content:"\f005"}i.icon.empty.star:before{content:"\f006"}i.icon.thumbs.outline.up:before{content:"\f087"}i.icon.thumbs.outline.down:before{content:"\f088"}i.icon.star.half:before{content:"\f089"}i.icon.empty.heart:before{content:"\f08a"}i.icon.smile:before{content:"\f118"}i.icon.frown:before{content:"\f119"}i.icon.meh:before{content:"\f11a"}i.icon.star.half.empty:before{content:"\f123"}i.icon.thumbs.up:before{content:"\f164"}i.icon.thumbs.down:before{content:"\f165"}i.icon.music:before{content:"\f001"}i.icon.video.play.outline:before{content:"\f01d"}i.icon.volume.off:before{content:"\f026"}i.icon.volume.down:before{content:"\f027"}i.icon.volume.up:before{content:"\f028"}i.icon.record:before{content:"\f03d"}i.icon.step.backward:before{content:"\f048"}i.icon.fast.backward:before{content:"\f049"}i.icon.backward:before{content:"\f04a"}i.icon.play:before{content:"\f04b"}i.icon.pause:before{content:"\f04c"}i.icon.stop:before{content:"\f04d"}i.icon.forward:before{content:"\f04e"}i.icon.fast.forward:before{content:"\f050"}i.icon.step.forward:before{content:"\f051"}i.icon.eject:before{content:"\f052"}i.icon.unmute:before{content:"\f130"}i.icon.mute:before{content:"\f131"}i.icon.video.play:before{content:"\f144"}i.icon.closed.captioning:before{content:"\f20a"}i.icon.pause.circle:before{content:"\f28b"}i.icon.pause.circle.outline:before{content:"\f28c"}i.icon.stop.circle:before{content:"\f28d"}i.icon.stop.circle.outline:before{content:"\f28e"}i.icon.marker:before{content:"\f041"}i.icon.coffee:before{content:"\f0f4"}i.icon.food:before{content:"\f0f5"}i.icon.building.outline:before{content:"\f0f7"}i.icon.hospital:before{content:"\f0f8"}i.icon.emergency:before{content:"\f0f9"}i.icon.first.aid:before{content:"\f0fa"}i.icon.military:before{content:"\f0fb"}i.icon.h:before{content:"\f0fd"}i.icon.location.arrow:before{content:"\f124"}i.icon.compass:before{content:"\f14e"}i.icon.space.shuttle:before{content:"\f197"}i.icon.university:before{content:"\f19c"}i.icon.building:before{content:"\f1ad"}i.icon.paw:before{content:"\f1b0"}i.icon.spoon:before{content:"\f1b1"}i.icon.car:before{content:"\f1b9"}i.icon.taxi:before{content:"\f1ba"}i.icon.tree:before{content:"\f1bb"}i.icon.bicycle:before{content:"\f206"}i.icon.bus:before{content:"\f207"}i.icon.ship:before{content:"\f21a"}i.icon.motorcycle:before{content:"\f21c"}i.icon.street.view:before{content:"\f21d"}i.icon.hotel:before{content:"\f236"}i.icon.train:before{content:"\f238"}i.icon.subway:before{content:"\f239"}i.icon.map.pin:before{content:"\f276"}i.icon.map.signs:before{content:"\f277"}i.icon.map.outline:before{content:"\f278"}i.icon.map:before{content:"\f279"}i.icon.table:before{content:"\f0ce"}i.icon.columns:before{content:"\f0db"}i.icon.sort:before{content:"\f0dc"}i.icon.sort.descending:before{content:"\f0dd"}i.icon.sort.ascending:before{content:"\f0de"}i.icon.sort.alphabet.ascending:before{content:"\f15d"}i.icon.sort.alphabet.descending:before{content:"\f15e"}i.icon.sort.content.ascending:before{content:"\f160"}i.icon.sort.content.descending:before{content:"\f161"}i.icon.sort.numeric.ascending:before{content:"\f162"}i.icon.sort.numeric.descending:before{content:"\f163"}i.icon.font:before{content:"\f031"}i.icon.bold:before{content:"\f032"}i.icon.italic:before{content:"\f033"}i.icon.text.height:before{content:"\f034"}i.icon.text.width:before{content:"\f035"}i.icon.align.left:before{content:"\f036"}i.icon.align.center:before{content:"\f037"}i.icon.align.right:before{content:"\f038"}i.icon.align.justify:before{content:"\f039"}i.icon.list:before{content:"\f03a"}i.icon.outdent:before{content:"\f03b"}i.icon.indent:before{content:"\f03c"}i.icon.cut:before{content:"\f0c4"}i.icon.copy:before{content:"\f0c5"}i.icon.attach:before{content:"\f0c6"}i.icon.save:before{content:"\f0c7"}i.icon.content:before{content:"\f0c9"}i.icon.unordered.list:before{content:"\f0ca"}i.icon.ordered.list:before{content:"\f0cb"}i.icon.strikethrough:before{content:"\f0cc"}i.icon.underline:before{content:"\f0cd"}i.icon.paste:before{content:"\f0ea"}i.icon.unlinkify:before{content:"\f127"}i.icon.superscript:before{content:"\f12b"}i.icon.subscript:before{content:"\f12c"}i.icon.header:before{content:"\f1dc"}i.icon.paragraph:before{content:"\f1dd"}i.icon.text.cursor:before{content:"\f246"}i.icon.euro:before{content:"\f153"}i.icon.pound:before{content:"\f154"}i.icon.dollar:before{content:"\f155"}i.icon.rupee:before{content:"\f156"}i.icon.yen:before{content:"\f157"}i.icon.ruble:before{content:"\f158"}i.icon.won:before{content:"\f159"}i.icon.bitcoin:before{content:"\f15a"}i.icon.lira:before{content:"\f195"}i.icon.shekel:before{content:"\f20b"}i.icon.paypal:before{content:"\f1ed"}i.icon.google.wallet:before{content:"\f1ee"}i.icon.visa:before{content:"\f1f0"}i.icon.mastercard:before{content:"\f1f1"}i.icon.discover:before{content:"\f1f2"}i.icon.american.express:before{content:"\f1f3"}i.icon.paypal.card:before{content:"\f1f4"}i.icon.stripe:before{content:"\f1f5"}i.icon.japan.credit.bureau:before{content:"\f24b"}i.icon.diners.club:before{content:"\f24c"}i.icon.credit.card.alternative:before{content:"\f283"}i.icon.twitter.square:before{content:"\f081"}i.icon.facebook.square:before{content:"\f082"}i.icon.linkedin.square:before{content:"\f08c"}i.icon.github.square:before{content:"\f092"}i.icon.twitter:before{content:"\f099"}i.icon.facebook.f:before{content:"\f09a"}i.icon.github:before{content:"\f09b"}i.icon.pinterest.square:before{content:"\f0d3"}i.icon.google.plus.square:before{content:"\f0d4"}i.icon.google.plus:before{content:"\f0d5"}i.icon.linkedin:before{content:"\f0e1"}i.icon.github.alternate:before{content:"\f113"}i.icon.maxcdn:before{content:"\f136"}i.icon.youtube.square:before{content:"\f166"}i.icon.youtube:before{content:"\f167"}i.icon.xing:before{content:"\f168"}i.icon.xing.square:before{content:"\f169"}i.icon.youtube.play:before{content:"\f16a"}i.icon.dropbox:before{content:"\f16b"}i.icon.stack.overflow:before{content:"\f16c"}i.icon.instagram:before{content:"\f16d"}i.icon.flickr:before{content:"\f16e"}i.icon.adn:before{content:"\f170"}i.icon.bitbucket:before{content:"\f171"}i.icon.bitbucket.square:before{content:"\f172"}i.icon.tumblr:before{content:"\f173"}i.icon.tumblr.square:before{content:"\f174"}i.icon.apple:before{content:"\f179"}i.icon.windows:before{content:"\f17a"}i.icon.android:before{content:"\f17b"}i.icon.linux:before{content:"\f17c"}i.icon.dribble:before{content:"\f17d"}i.icon.skype:before{content:"\f17e"}i.icon.foursquare:before{content:"\f180"}i.icon.trello:before{content:"\f181"}i.icon.gittip:before{content:"\f184"}i.icon.vk:before{content:"\f189"}i.icon.weibo:before{content:"\f18a"}i.icon.renren:before{content:"\f18b"}i.icon.pagelines:before{content:"\f18c"}i.icon.stack.exchange:before{content:"\f18d"}i.icon.vimeo.square:before{content:"\f194"}i.icon.slack:before{content:"\f198"}i.icon.wordpress:before{content:"\f19a"}i.icon.yahoo:before{content:"\f19e"}i.icon.google:before{content:"\f1a0"}i.icon.reddit:before{content:"\f1a1"}i.icon.reddit.square:before{content:"\f1a2"}i.icon.stumbleupon.circle:before{content:"\f1a3"}i.icon.stumbleupon:before{content:"\f1a4"}i.icon.delicious:before{content:"\f1a5"}i.icon.digg:before{content:"\f1a6"}i.icon.pied.piper:before{content:"\f1a7"}i.icon.pied.piper.alternate:before{content:"\f1a8"}i.icon.drupal:before{content:"\f1a9"}i.icon.joomla:before{content:"\f1aa"}i.icon.behance:before{content:"\f1b4"}i.icon.behance.square:before{content:"\f1b5"}i.icon.steam:before{content:"\f1b6"}i.icon.steam.square:before{content:"\f1b7"}i.icon.spotify:before{content:"\f1bc"}i.icon.deviantart:before{content:"\f1bd"}i.icon.soundcloud:before{content:"\f1be"}i.icon.vine:before{content:"\f1ca"}i.icon.codepen:before{content:"\f1cb"}i.icon.jsfiddle:before{content:"\f1cc"}i.icon.rebel:before{content:"\f1d0"}i.icon.empire:before{content:"\f1d1"}i.icon.git.square:before{content:"\f1d2"}i.icon.git:before{content:"\f1d3"}i.icon.hacker.news:before{content:"\f1d4"}i.icon.tencent.weibo:before{content:"\f1d5"}i.icon.qq:before{content:"\f1d6"}i.icon.wechat:before{content:"\f1d7"}i.icon.slideshare:before{content:"\f1e7"}i.icon.twitch:before{content:"\f1e8"}i.icon.yelp:before{content:"\f1e9"}i.icon.lastfm:before{content:"\f202"}i.icon.lastfm.square:before{content:"\f203"}i.icon.ioxhost:before{content:"\f208"}i.icon.angellist:before{content:"\f209"}i.icon.meanpath:before{content:"\f20c"}i.icon.buysellads:before{content:"\f20d"}i.icon.connectdevelop:before{content:"\f20e"}i.icon.dashcube:before{content:"\f210"}i.icon.forumbee:before{content:"\f211"}i.icon.leanpub:before{content:"\f212"}i.icon.sellsy:before{content:"\f213"}i.icon.shirtsinbulk:before{content:"\f214"}i.icon.simplybuilt:before{content:"\f215"}i.icon.skyatlas:before{content:"\f216"}i.icon.facebook:before{content:"\f230"}i.icon.pinterest:before{content:"\f231"}i.icon.whatsapp:before{content:"\f232"}i.icon.viacoin:before{content:"\f237"}i.icon.medium:before{content:"\f23a"}i.icon.y.combinator:before{content:"\f23b"}i.icon.optinmonster:before{content:"\f23c"}i.icon.opencart:before{content:"\f23d"}i.icon.expeditedssl:before{content:"\f23e"}i.icon.gg:before{content:"\f260"}i.icon.gg.circle:before{content:"\f261"}i.icon.tripadvisor:before{content:"\f262"}i.icon.odnoklassniki:before{content:"\f263"}i.icon.odnoklassniki.square:before{content:"\f264"}i.icon.pocket:before{content:"\f265"}i.icon.wikipedia:before{content:"\f266"}i.icon.safari:before{content:"\f267"}i.icon.chrome:before{content:"\f268"}i.icon.firefox:before{content:"\f269"}i.icon.opera:before{content:"\f26a"}i.icon.internet.explorer:before{content:"\f26b"}i.icon.contao:before{content:"\f26d"}i.icon.\35 00px:before{content:"\f26e"}i.icon.amazon:before{content:"\f270"}i.icon.houzz:before{content:"\f27c"}i.icon.vimeo:before{content:"\f27d"}i.icon.black.tie:before{content:"\f27e"}i.icon.fonticons:before{content:"\f280"}i.icon.reddit.alien:before{content:"\f281"}i.icon.microsoft.edge:before{content:"\f282"}i.icon.codiepie:before{content:"\f284"}i.icon.modx:before{content:"\f285"}i.icon.fort.awesome:before{content:"\f286"}i.icon.product.hunt:before{content:"\f288"}i.icon.mixcloud:before{content:"\f289"}i.icon.scribd:before{content:"\f28a"}i.icon.gitlab:before{content:"\f296"}i.icon.wpbeginner:before{content:"\f297"}i.icon.wpforms:before{content:"\f298"}i.icon.envira.gallery:before{content:"\f299"}i.icon.glide:before{content:"\f2a5"}i.icon.glide.g:before{content:"\f2a6"}i.icon.viadeo:before{content:"\f2a9"}i.icon.viadeo.square:before{content:"\f2aa"}i.icon.snapchat:before{content:"\f2ab"}i.icon.snapchat.ghost:before{content:"\f2ac"}i.icon.snapchat.square:before{content:"\f2ad"}i.icon.pied.piper.hat:before{content:"\f2ae"}i.icon.first.order:before{content:"\f2b0"}i.icon.yoast:before{content:"\f2b1"}i.icon.themeisle:before{content:"\f2b2"}i.icon.google.plus.circle:before{content:"\f2b3"}i.icon.font.awesome:before{content:"\f2b4"}i.icon.like:before{content:"\f004"}i.icon.favorite:before{content:"\f005"}i.icon.video:before{content:"\f008"}i.icon.check:before{content:"\f00c"}i.icon.cancel:before,i.icon.close:before,i.icon.delete:before,i.icon.x:before{content:"\f00d"}i.icon.magnify:before,i.icon.zoom.in:before{content:"\f00e"}i.icon.shutdown:before{content:"\f011"}i.icon.clock:before,i.icon.time:before{content:"\f017"}i.icon.play.circle.outline:before{content:"\f01d"}i.icon.headphone:before{content:"\f025"}i.icon.camera:before{content:"\f030"}i.icon.video.camera:before{content:"\f03d"}i.icon.picture:before{content:"\f03e"}i.icon.compose:before,i.icon.pencil:before{content:"\f040"}i.icon.point:before{content:"\f041"}i.icon.tint:before{content:"\f043"}i.icon.signup:before{content:"\f044"}i.icon.plus.circle:before{content:"\f055"}i.icon.question.circle:before{content:"\f059"}i.icon.dont:before{content:"\f05e"}i.icon.minimize:before{content:"\f066"}i.icon.add:before{content:"\f067"}i.icon.attention:before,i.icon.exclamation.circle:before{content:"\f06a"}i.icon.eye:before{content:"\f06e"}i.icon.exclamation.triangle:before{content:"\f071"}i.icon.shuffle:before{content:"\f074"}i.icon.chat:before,i.icon.talk:before{content:"\f075"}i.icon.cart:before,i.icon.shopping.cart:before{content:"\f07a"}i.icon.bar.graph:before{content:"\f080"}i.icon.key:before{content:"\f084"}i.icon.cogs:before{content:"\f085"}i.icon.discussions:before{content:"\f086"}i.icon.like.outline:before{content:"\f087"}i.icon.dislike.outline:before{content:"\f088"}i.icon.heart.outline:before{content:"\f08a"}i.icon.log.out:before{content:"\f08b"}i.icon.thumb.tack:before{content:"\f08d"}i.icon.winner:before{content:"\f091"}i.icon.phone:before{content:"\f095"}i.icon.bookmark.outline:before{content:"\f097"}i.icon.phone.square:before{content:"\f098"}i.icon.credit.card:before{content:"\f09d"}i.icon.hdd.outline:before{content:"\f0a0"}i.icon.bullhorn:before{content:"\f0a1"}i.icon.bell.outline:before{content:"\f0a2"}i.icon.hand.outline.right:before{content:"\f0a4"}i.icon.hand.outline.left:before{content:"\f0a5"}i.icon.hand.outline.up:before{content:"\f0a6"}i.icon.hand.outline.down:before{content:"\f0a7"}i.icon.globe:before{content:"\f0ac"}i.icon.wrench:before{content:"\f0ad"}i.icon.briefcase:before{content:"\f0b1"}i.icon.group:before{content:"\f0c0"}i.icon.chain:before,i.icon.linkify:before{content:"\f0c1"}i.icon.flask:before{content:"\f0c3"}i.icon.bars:before,i.icon.sidebar:before{content:"\f0c9"}i.icon.list.ul:before{content:"\f0ca"}i.icon.list.ol:before,i.icon.numbered.list:before{content:"\f0cb"}i.icon.magic:before{content:"\f0d0"}i.icon.truck:before{content:"\f0d1"}i.icon.currency:before{content:"\f0d6"}i.icon.dropdown:before,i.icon.triangle.down:before{content:"\f0d7"}i.icon.triangle.up:before{content:"\f0d8"}i.icon.triangle.left:before{content:"\f0d9"}i.icon.triangle.right:before{content:"\f0da"}i.icon.envelope:before{content:"\f0e0"}i.icon.conversation:before{content:"\f0e6"}i.icon.rain:before{content:"\f0e9"}i.icon.clipboard:before{content:"\f0ea"}i.icon.lightbulb:before{content:"\f0eb"}i.icon.bell:before{content:"\f0f3"}i.icon.ambulance:before{content:"\f0f9"}i.icon.medkit:before{content:"\f0fa"}i.icon.fighter.jet:before{content:"\f0fb"}i.icon.beer:before{content:"\f0fc"}i.icon.plus.square:before{content:"\f0fe"}i.icon.computer:before{content:"\f108"}i.icon.gamepad:before{content:"\f11b"}i.icon.star.half.full:before{content:"\f123"}i.icon.broken.chain:before{content:"\f127"}i.icon.question:before{content:"\f128"}i.icon.exclamation:before{content:"\f12a"}i.icon.eraser:before{content:"\f12d"}i.icon.microphone:before{content:"\f130"}i.icon.microphone.slash:before{content:"\f131"}i.icon.shield:before{content:"\f132"}i.icon.target:before{content:"\f140"}i.icon.play.circle:before{content:"\f144"}i.icon.pencil.square:before{content:"\f14b"}i.icon.eur:before{content:"\f153"}i.icon.gbp:before{content:"\f154"}i.icon.usd:before{content:"\f155"}i.icon.inr:before{content:"\f156"}i.icon.cny:before,i.icon.jpy:before,i.icon.rmb:before{content:"\f157"}i.icon.rouble:before,i.icon.rub:before{content:"\f158"}i.icon.krw:before{content:"\f159"}i.icon.btc:before{content:"\f15a"}i.icon.gratipay:before{content:"\f184"}i.icon.zip:before{content:"\f187"}i.icon.dot.circle.outline:before{content:"\f192"}i.icon.try:before{content:"\f195"}i.icon.graduation:before{content:"\f19d"}i.icon.circle.outline:before{content:"\f1db"}i.icon.sliders:before{content:"\f1de"}i.icon.weixin:before{content:"\f1d7"}i.icon.teletype:before,i.icon.tty:before{content:"\f1e4"}i.icon.binoculars:before{content:"\f1e5"}i.icon.power.cord:before{content:"\f1e6"}i.icon.wi-fi:before{content:"\f1eb"}i.icon.visa.card:before{content:"\f1f0"}i.icon.mastercard.card:before{content:"\f1f1"}i.icon.discover.card:before{content:"\f1f2"}i.icon.american.express.card:before,i.icon.amex:before{content:"\f1f3"}i.icon.stripe.card:before{content:"\f1f5"}i.icon.bell.slash:before{content:"\f1f6"}i.icon.bell.slash.outline:before{content:"\f1f7"}i.icon.area.graph:before{content:"\f1fe"}i.icon.pie.graph:before{content:"\f200"}i.icon.line.graph:before{content:"\f201"}i.icon.cc:before{content:"\f20a"}i.icon.ils:before,i.icon.sheqel:before{content:"\f20b"}i.icon.plus.cart:before{content:"\f217"}i.icon.arrow.down.cart:before{content:"\f218"}i.icon.detective:before{content:"\f21b"}i.icon.venus:before{content:"\f221"}i.icon.mars:before{content:"\f222"}i.icon.mercury:before{content:"\f223"}i.icon.intersex:before{content:"\f224"}i.icon.female.homosexual:before,i.icon.venus.double:before{content:"\f226"}i.icon.male.homosexual:before,i.icon.mars.double:before{content:"\f227"}i.icon.venus.mars:before{content:"\f228"}i.icon.mars.alternate:before,i.icon.mars.stroke:before{content:"\f229"}i.icon.mars.stroke.vertical:before,i.icon.mars.vertical:before{content:"\f22a"}i.icon.mars.horizontal:before,i.icon.mars.stroke.horizontal:before{content:"\f22b"}i.icon.asexual:before{content:"\f22d"}i.icon.facebook.official:before{content:"\f230"}i.icon.user.plus:before{content:"\f234"}i.icon.user.cancel:before,i.icon.user.close:before,i.icon.user.delete:before,i.icon.user.times:before,i.icon.user.x:before{content:"\f235"}i.icon.bed:before{content:"\f236"}i.icon.yc:before,i.icon.ycombinator:before{content:"\f23b"}i.icon.battery.four:before{content:"\f240"}i.icon.battery.three.quarters:before,i.icon.battery.three:before{content:"\f241"}i.icon.battery.half:before,i.icon.battery.two:before{content:"\f242"}i.icon.battery.one:before,i.icon.battery.quarter:before{content:"\f243"}i.icon.battery.zero:before{content:"\f244"}i.icon.i.cursor:before{content:"\f246"}i.icon.japan.credit.bureau.card:before,i.icon.jcb:before{content:"\f24b"}i.icon.diners.club.card:before{content:"\f24c"}i.icon.balance:before{content:"\f24e"}i.icon.hourglass.outline:before,i.icon.hourglass.zero:before{content:"\f250"}i.icon.hourglass.one:before{content:"\f251"}i.icon.hourglass.two:before{content:"\f252"}i.icon.hourglass.three:before{content:"\f253"}i.icon.hourglass.four:before{content:"\f254"}i.icon.grab{content:"\f255"}i.icon.hand.victory:before{content:"\f25b"}i.icon.tm:before{content:"\f25c"}i.icon.r.circle:before{content:"\f25d"}i.icon.television{content:"\f26c"}i.icon.five.hundred.pixels:before{content:"\f26e"}i.icon.calendar.plus:before{content:"\f271"}i.icon.calendar.minus:before{content:"\f272"}i.icon.calendar.times:before{content:"\f273"}i.icon.calendar.check:before{content:"\f274"}i.icon.factory:before{content:"\f275"}i.icon.commenting:before{content:"\f27a"}i.icon.commenting.outline:before{content:"\f27b"}i.icon.edge:before,i.icon.ms.edge:before{content:"\f282"}i.icon.wordpress.beginner:before{content:"\f297"}i.icon.wordpress.forms:before{content:"\f298"}i.icon.envira:before{content:"\f299"}i.icon.question.circle.outline:before{content:"\f29c"}i.icon.ald:before,i.icon.als:before,i.icon.assistive.listening.devices:before{content:"\f2a2"}i.icon.asl.interpreting:before{content:"\f2a3"}i.icon.deaf:before{content:"\f2a4"}i.icon.american.sign.language.interpreting:before{content:"\f2a3"}i.icon.hard.of.hearing:before{content:"\f2a4"}i.icon.signing:before{content:"\f2a7"}i.icon.new.pied.piper:before{content:"\f2ae"}i.icon.theme.isle:before{content:"\f2b2"}i.icon.google.plus.official:before{content:"\f2b3"}i.icon.fa:before{content:"\f2b4"}.ui.image{position:relative;display:inline-block;vertical-align:middle;max-width:100%;background-color:transparent}img.ui.image{display:block}.ui.image img,.ui.image svg{display:block;max-width:100%;height:auto}.ui.hidden.image,.ui.hidden.images{display:none}.ui.hidden.transition.image,.ui.hidden.transition.images{display:block;visibility:hidden}.ui.disabled.image,.ui.disabled.images{cursor:default;opacity:.45}.ui.inline.image,.ui.inline.image img,.ui.inline.image svg{display:inline-block}.ui.top.aligned.image,.ui.top.aligned.image img,.ui.top.aligned.image svg,.ui.top.aligned.images .image{display:inline-block;vertical-align:top}.ui.middle.aligned.image,.ui.middle.aligned.image img,.ui.middle.aligned.image svg,.ui.middle.aligned.images .image{display:inline-block;vertical-align:middle}.ui.bottom.aligned.image,.ui.bottom.aligned.image img,.ui.bottom.aligned.image svg,.ui.bottom.aligned.images .image{display:inline-block;vertical-align:bottom}.ui.rounded.image,.ui.rounded.image>*,.ui.rounded.images .image,.ui.rounded.images .image>*{border-radius:.3125em}.ui.bordered.image img,.ui.bordered.image svg,.ui.bordered.images .image,.ui.bordered.images img,.ui.bordered.images svg,img.ui.bordered.image{border:1px solid rgba(0,0,0,.1)}.ui.circular.image,.ui.circular.images{overflow:hidden}.ui.circular.image,.ui.circular.image>*,.ui.circular.images .image,.ui.circular.images .image>*{border-radius:500rem}.ui.fluid.image,.ui.fluid.image img,.ui.fluid.image svg,.ui.fluid.images,.ui.fluid.images img,.ui.fluid.images svg{display:block;width:100%;height:auto}.ui.avatar.image,.ui.avatar.image img,.ui.avatar.image svg,.ui.avatar.images .image,.ui.avatar.images img,.ui.avatar.images svg{margin-right:.25em;display:inline-block;width:2em;height:2em;border-radius:500rem}.ui.spaced.image{display:inline-block!important;margin-left:.5em;margin-right:.5em}.ui[class*="left spaced"].image{margin-left:.5em;margin-right:0}.ui[class*="right spaced"].image{margin-left:0;margin-right:.5em}.ui.floated.image,.ui.floated.images{float:left;margin-right:1em;margin-bottom:1em}.ui.right.floated.image,.ui.right.floated.images{float:right;margin-right:0;margin-bottom:1em;margin-left:1em}.ui.floated.image:last-child,.ui.floated.images:last-child{margin-bottom:0}.ui.centered.image,.ui.centered.images{margin-left:auto;margin-right:auto}.ui.mini.image,.ui.mini.images .image,.ui.mini.images img,.ui.mini.images svg{width:35px;height:auto;font-size:.78571429rem}.ui.tiny.image,.ui.tiny.images .image,.ui.tiny.images img,.ui.tiny.images svg{width:80px;height:auto;font-size:.85714286rem}.ui.small.image,.ui.small.images .image,.ui.small.images img,.ui.small.images svg{width:150px;height:auto;font-size:.92857143rem}.ui.medium.image,.ui.medium.images .image,.ui.medium.images img,.ui.medium.images svg{width:300px;height:auto;font-size:1rem}.ui.large.image,.ui.large.images .image,.ui.large.images img,.ui.large.images svg{width:450px;height:auto;font-size:1.14285714rem}.ui.big.image,.ui.big.images .image,.ui.big.images img,.ui.big.images svg{width:600px;height:auto;font-size:1.28571429rem}.ui.huge.image,.ui.huge.images .image,.ui.huge.images img,.ui.huge.images svg{width:800px;height:auto;font-size:1.42857143rem}.ui.massive.image,.ui.massive.images .image,.ui.massive.images img,.ui.massive.images svg{width:960px;height:auto;font-size:1.71428571rem}.ui.images{font-size:0;margin:0 -.25rem}.ui.images .image,.ui.images img,.ui.images svg{display:inline-block;margin:0 .25rem .5rem}.ui.input{position:relative;font-weight:400;font-style:normal;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:rgba(0,0,0,.87)}.ui.input input{margin:0;max-width:100%;-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;outline:0;-webkit-tap-highlight-color:rgba(255,255,255,0);text-align:left;line-height:1.2142em;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;padding:.67861429em 1em;background:#FFF;border:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87);border-radius:.28571429rem;-webkit-transition:box-shadow .1s ease,border-color .1s ease;transition:box-shadow .1s ease,border-color .1s ease;box-shadow:none}.ui.input input::-webkit-input-placeholder{color:rgba(191,191,191,.87)}.ui.input input::-moz-placeholder{color:rgba(191,191,191,.87)}.ui.input input:-ms-input-placeholder{color:rgba(191,191,191,.87)}.ui.disabled.input,.ui.input input[disabled]{opacity:.45}.ui.disabled.input input,.ui.input input[disabled]{pointer-events:none}.ui.input input:active,.ui.input.down input{border-color:rgba(0,0,0,.3);background:#FAFAFA;color:rgba(0,0,0,.87);box-shadow:none}.ui.loading.loading.input>i.icon:before{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.loading.loading.input>i.icon:after{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;-webkit-animation:button-spin .6s linear;animation:button-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 transparent transparent;border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent}.ui.input input:focus,.ui.input.focus input{border-color:#85B7D9;background:#FFF;color:rgba(0,0,0,.8);box-shadow:none}.ui.input input:focus::-webkit-input-placeholder,.ui.input.focus input::-webkit-input-placeholder{color:rgba(115,115,115,.87)}.ui.input input:focus::-moz-placeholder,.ui.input.focus input::-moz-placeholder{color:rgba(115,115,115,.87)}.ui.input input:focus:-ms-input-placeholder,.ui.input.focus input:-ms-input-placeholder{color:rgba(115,115,115,.87)}.ui.input.error input{background-color:#FFF6F6;border-color:#E0B4B4;color:#9F3A38;box-shadow:none}.ui.input.error input::-webkit-input-placeholder{color:#e7bdbc}.ui.input.error input::-moz-placeholder{color:#e7bdbc}.ui.input.error input:-ms-input-placeholder{color:#e7bdbc!important}.ui.input.error input:focus::-webkit-input-placeholder{color:#da9796}.ui.input.error input:focus::-moz-placeholder{color:#da9796}.ui.input.error input:focus:-ms-input-placeholder{color:#da9796!important}.ui.transparent.input input{border-color:transparent!important;background-color:transparent!important;padding:0!important;box-shadow:none!important}.ui.transparent.icon.input>i.icon{width:1.1em}.ui.transparent.icon.input>input{padding-left:0!important;padding-right:2em!important}.ui.transparent[class*="left icon"].input>input{padding-left:2em!important;padding-right:0!important}.ui.transparent.inverted.input{color:#FFF}.ui.transparent.inverted.input input{color:inherit}.ui.transparent.inverted.input input::-webkit-input-placeholder{color:rgba(255,255,255,.5)}.ui.transparent.inverted.input input::-moz-placeholder{color:rgba(255,255,255,.5)}.ui.transparent.inverted.input input:-ms-input-placeholder{color:rgba(255,255,255,.5)}.ui.icon.input>i.icon{cursor:default;position:absolute;line-height:1;text-align:center;top:0;right:0;margin:0;height:100%;width:2.67142857em;opacity:.5;border-radius:0 .28571429rem .28571429rem 0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.ui.icon.input>i.icon:not(.link){pointer-events:none}.ui.icon.input input{padding-right:2.67142857em!important}.ui.icon.input>i.icon:after,.ui.icon.input>i.icon:before{left:0;position:absolute;text-align:center;top:50%;width:100%;margin-top:-.5em}.ui.icon.input>i.link.icon{cursor:pointer}.ui.icon.input>i.circular.icon{top:.35em;right:.5em}.ui[class*="left icon"].input>i.icon{right:auto;left:1px;border-radius:.28571429rem 0 0 .28571429rem}.ui[class*="left icon"].input>i.circular.icon{right:auto;left:.5em}.ui[class*="left icon"].input>input{padding-left:2.67142857em!important;padding-right:1em!important}.ui.icon.input>input:focus~i.icon{opacity:1}.ui.labeled.input>.label{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;margin:0;font-size:1em}.ui.labeled.input>.label:not(.corner){padding-top:.78571429em;padding-bottom:.78571429em}.ui.labeled.input:not([class*="corner labeled"]) .label:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ui.labeled.input:not([class*="corner labeled"]) .label:first-child+input{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:transparent}.ui.labeled.input:not([class*="corner labeled"]) .label:first-child+input:focus{border-left-color:#85B7D9}.ui[class*="right labeled"].input input{border-top-right-radius:0!important;border-bottom-right-radius:0!important;border-right-color:transparent!important}.ui[class*="right labeled"].input input+.label{border-top-left-radius:0;border-bottom-left-radius:0}.ui[class*="right labeled"].input input:focus{border-right-color:#85B7D9!important}.ui.labeled.input .corner.label{top:1px;right:1px;font-size:.64285714em;border-radius:0 .28571429rem 0 0}.ui[class*="corner labeled"]:not([class*="left corner labeled"]).labeled.input input{padding-right:2.5em!important}.ui[class*="corner labeled"].icon.input:not([class*="left corner labeled"])>input{padding-right:3.25em!important}.ui[class*="corner labeled"].icon.input:not([class*="left corner labeled"])>.icon{margin-right:1.25em}.ui[class*="left corner labeled"].labeled.input input{padding-left:2.5em!important}.ui[class*="left corner labeled"].icon.input>input{padding-left:3.25em!important}.ui[class*="left corner labeled"].icon.input>.icon{margin-left:1.25em}.ui.input>.ui.corner.label{top:1px;right:1px}.ui.input>.ui.left.corner.label{right:auto;left:1px}.ui.action.input>.button,.ui.action.input>.buttons{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.ui.action.input>.button,.ui.action.input>.buttons>.button{padding-top:.78571429em;padding-bottom:.78571429em;margin:0}.ui.action.input:not([class*="left action"])>input{border-top-right-radius:0!important;border-bottom-right-radius:0!important;border-right-color:transparent!important}.ui.action.input:not([class*="left action"])>.button:not(:first-child),.ui.action.input:not([class*="left action"])>.buttons:not(:first-child)>.button,.ui.action.input:not([class*="left action"])>.dropdown:not(:first-child){border-radius:0}.ui.action.input:not([class*="left action"])>.button:last-child,.ui.action.input:not([class*="left action"])>.buttons:last-child>.button,.ui.action.input:not([class*="left action"])>.dropdown:last-child{border-radius:0 .28571429rem .28571429rem 0}.ui.action.input:not([class*="left action"]) input:focus{border-right-color:#85B7D9!important}.ui[class*="left action"].input>input{border-top-left-radius:0!important;border-bottom-left-radius:0!important;border-left-color:transparent!important}.ui[class*="left action"].input>.button,.ui[class*="left action"].input>.buttons>.button,.ui[class*="left action"].input>.dropdown{border-radius:0}.ui[class*="left action"].input>.button:first-child,.ui[class*="left action"].input>.buttons:first-child>.button,.ui[class*="left action"].input>.dropdown:first-child{border-radius:.28571429rem 0 0 .28571429rem}.ui[class*="left action"].input>input:focus{border-left-color:#85B7D9!important}.ui.inverted.input input{border:none}.ui.fluid.input{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ui.fluid.input>input{width:0!important}.ui.mini.input{font-size:.78571429em}.ui.small.input{font-size:.92857143em}.ui.input{font-size:1em}.ui.large.input{font-size:1.14285714em}.ui.big.input{font-size:1.28571429em}.ui.huge.input{font-size:1.42857143em}.ui.massive.input{font-size:1.71428571em}.ui.label{display:inline-block;line-height:1;vertical-align:baseline;margin:0 .14285714em;background-color:#E8E8E8;background-image:none;padding:.5833em .833em;color:rgba(0,0,0,.6);text-transform:none;font-weight:700;border:0 solid transparent;border-radius:.28571429rem;-webkit-transition:background .1s ease;transition:background .1s ease}.ui.label:first-child{margin-left:0}.ui.label:last-child{margin-right:0}a.ui.label{cursor:pointer}.ui.label>a{cursor:pointer;color:inherit;opacity:.5;-webkit-transition:.1s opacity ease;transition:.1s opacity ease}.ui.label>a:hover{opacity:1}.ui.label>img{width:auto!important;vertical-align:middle;height:2.1666em!important}.ui.label>.icon{width:auto;margin:0 .75em 0 0}.ui.label>.detail{display:inline-block;vertical-align:top;font-weight:700;margin-left:1em;opacity:.8}.ui.label>.detail .icon{margin:0 .25em 0 0}.ui.label>.close.icon,.ui.label>.delete.icon{cursor:pointer;margin-right:0;margin-left:.5em;font-size:.92857143em;opacity:.5;-webkit-transition:background .1s ease;transition:background .1s ease}.ui.label>.delete.icon:hover{opacity:1}.ui.labels>.label{margin:0 .5em .5em 0}.ui.header>.ui.label{margin-top:-.29165em}.ui.attached.segment>.ui.top.left.attached.label,.ui.bottom.attached.segment>.ui.top.left.attached.label{border-top-left-radius:0}.ui.attached.segment>.ui.top.right.attached.label,.ui.bottom.attached.segment>.ui.top.right.attached.label{border-top-right-radius:0}.ui.top.attached.segment>.ui.bottom.left.attached.label{border-bottom-left-radius:0}.ui.top.attached.segment>.ui.bottom.right.attached.label{border-bottom-right-radius:0}.ui.top.attached.label+[class*="right floated"]+*,.ui.top.attached.label:first-child+:not(.attached){margin-top:2rem!important}.ui.bottom.attached.label:first-child~:last-child:not(.attached){margin-top:0;margin-bottom:2rem!important}.ui.image.label{width:auto!important;margin-top:0;margin-bottom:0;max-width:9999px;vertical-align:baseline;text-transform:none;background:#E8E8E8;padding:.5833em .833em .5833em .5em;border-radius:.28571429rem;box-shadow:none}.ui.image.label img{display:inline-block;vertical-align:top;height:2.1666em;margin:-.5833em .5em -.5833em -.5em;border-radius:.28571429rem 0 0 .28571429rem}.ui.image.label .detail{background:rgba(0,0,0,.1);margin:-.5833em -.833em -.5833em .5em;padding:.5833em .833em;border-radius:0 .28571429rem .28571429rem 0}.ui.tag.label,.ui.tag.labels .label{margin-left:1em;position:relative;padding-left:1.5em;padding-right:1.5em;border-radius:0 .28571429rem .28571429rem 0;-webkit-transition:none;transition:none}.ui.tag.label:before,.ui.tag.labels .label:before{position:absolute;-webkit-transform:translateY(-50%) translateX(50%) rotate(-45deg);transform:translateY(-50%) translateX(50%) rotate(-45deg);top:50%;right:100%;content:'';background-color:inherit;background-image:none;width:1.56em;height:1.56em;-webkit-transition:none;transition:none}.ui.tag.label:after,.ui.tag.labels .label:after{position:absolute;content:'';top:50%;left:-.25em;margin-top:-.25em;background-color:#FFF!important;width:.5em;height:.5em;box-shadow:0 -1px 1px 0 rgba(0,0,0,.3);border-radius:500rem}.ui.corner.label{position:absolute;top:0;right:0;margin:0;padding:0;text-align:center;border-color:#E8E8E8;width:4em;height:4em;z-index:1;-webkit-transition:border-color .1s ease;transition:border-color .1s ease;background-color:transparent!important}.ui.corner.label:after{position:absolute;content:"";right:0;top:0;z-index:-1;width:0;height:0;background-color:transparent!important;border-top:0 solid transparent;border-right:4em solid transparent;border-bottom:4em solid transparent;border-left:0 solid transparent;border-right-color:inherit;-webkit-transition:border-color .1s ease;transition:border-color .1s ease}.ui.corner.label .icon{cursor:default;position:relative;top:.64285714em;left:.78571429em;font-size:1.14285714em;margin:0}.ui.left.corner.label,.ui.left.corner.label:after{right:auto;left:0}.ui.left.corner.label:after{border-top:4em solid transparent;border-right:4em solid transparent;border-bottom:0 solid transparent;border-left:0 solid transparent;border-top-color:inherit}.ui.left.corner.label .icon{left:-.78571429em}.ui.segment>.ui.corner.label{top:-1px;right:-1px}.ui.segment>.ui.left.corner.label{right:auto;left:-1px}.ui.ribbon.label{position:relative;margin:0;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;border-radius:0 .28571429rem .28571429rem 0;border-color:rgba(0,0,0,.15)}.ui.ribbon.label:after{position:absolute;content:'';top:100%;left:0;background-color:transparent!important;border-style:solid;border-width:0 1.2em 1.2em 0;border-color:transparent;border-right-color:inherit;width:0;height:0}.ui.ribbon.label{left:calc(-1rem - 1.2em);margin-right:-1.2em;padding-left:calc(1rem + 1.2em);padding-right:1.2em}.ui[class*="right ribbon"].label{left:calc(100% + 1rem + 1.2em);padding-left:1.2em;padding-right:calc(1rem + 1.2em);text-align:left;-webkit-transform:translateX(-100%);transform:translateX(-100%);border-radius:.28571429rem 0 0 .28571429rem}.ui[class*="right ribbon"].label:after{left:auto;right:0;border-style:solid;border-width:1.2em 1.2em 0 0;border-color:transparent;border-top-color:inherit}.ui.card .image>.ribbon.label,.ui.image>.ribbon.label{position:absolute;top:1rem}.ui.card .image>.ui.ribbon.label,.ui.image>.ui.ribbon.label{left:calc(.05rem - 1.2em)}.ui.card .image>.ui[class*="right ribbon"].label,.ui.image>.ui[class*="right ribbon"].label{left:calc(100% + -.05rem + 1.2em);padding-left:.833em}.ui.table td>.ui.ribbon.label{left:calc(-.78571429em - 1.2em)}.ui.table td>.ui[class*="right ribbon"].label{left:calc(100% + .78571429em + 1.2em);padding-left:.833em}.ui.attached.label,.ui[class*="top attached"].label{width:100%;position:absolute;margin:0;top:0;left:0;padding:.75em 1em;border-radius:.21428571rem .21428571rem 0 0}.ui[class*="bottom attached"].label{top:auto;bottom:0;border-radius:0 0 .21428571rem .21428571rem}.ui[class*="top left attached"].label{width:auto;margin-top:0!important;border-radius:.21428571rem 0 .28571429rem}.ui[class*="top right attached"].label{width:auto;left:auto;right:0;border-radius:0 .21428571rem 0 .28571429rem}.ui[class*="bottom left attached"].label{width:auto;top:auto;bottom:0;border-radius:0 .28571429rem 0 .21428571rem}.ui[class*="bottom right attached"].label{top:auto;bottom:0;left:auto;right:0;width:auto;border-radius:.28571429rem 0 .21428571rem}.ui.label.disabled{opacity:.5}a.ui.label:hover,a.ui.labels .label:hover{background-color:#E0E0E0;border-color:#E0E0E0;background-image:none;color:rgba(0,0,0,.8)}.ui.labels a.label:hover:before,a.ui.label:hover:before{color:rgba(0,0,0,.8)}.ui.active.label{background-color:#D0D0D0;border-color:#D0D0D0;background-image:none;color:rgba(0,0,0,.95)}.ui.active.label:before{background-color:#D0D0D0;background-image:none;color:rgba(0,0,0,.95)}a.ui.active.label:hover,a.ui.labels .active.label:hover{background-color:#C8C8C8;border-color:#C8C8C8;background-image:none;color:rgba(0,0,0,.95)}.ui.labels a.active.label:ActiveHover:before,a.ui.active.label:ActiveHover:before{background-color:#C8C8C8;background-image:none;color:rgba(0,0,0,.95)}.ui.label.visible,.ui.labels.visible .label{display:inline-block!important}.ui.label.hidden,.ui.labels.hidden .label{display:none!important}.ui.red.label,.ui.red.labels .label{background-color:#DB2828!important;border-color:#DB2828!important;color:#FFF!important}.ui.red.labels .label:hover,a.ui.red.label:hover{background-color:#d01919!important;border-color:#d01919!important;color:#FFF!important}.ui.red.corner.label,.ui.red.corner.label:hover{background-color:transparent!important}.ui.red.ribbon.label{border-color:#b21e1e!important}.ui.basic.red.label{background-color:#FFF!important;color:#DB2828!important;border-color:#DB2828!important}.ui.basic.red.labels a.label:hover,a.ui.basic.red.label:hover{background-color:#FFF!important;color:#d01919!important;border-color:#d01919!important}.ui.orange.label,.ui.orange.labels .label{background-color:#F2711C!important;border-color:#F2711C!important;color:#FFF!important}.ui.orange.labels .label:hover,a.ui.orange.label:hover{background-color:#f26202!important;border-color:#f26202!important;color:#FFF!important}.ui.orange.corner.label,.ui.orange.corner.label:hover{background-color:transparent!important}.ui.orange.ribbon.label{border-color:#cf590c!important}.ui.basic.orange.label{background-color:#FFF!important;color:#F2711C!important;border-color:#F2711C!important}.ui.basic.orange.labels a.label:hover,a.ui.basic.orange.label:hover{background-color:#FFF!important;color:#f26202!important;border-color:#f26202!important}.ui.yellow.label,.ui.yellow.labels .label{background-color:#FBBD08!important;border-color:#FBBD08!important;color:#FFF!important}.ui.yellow.labels .label:hover,a.ui.yellow.label:hover{background-color:#eaae00!important;border-color:#eaae00!important;color:#FFF!important}.ui.yellow.corner.label,.ui.yellow.corner.label:hover{background-color:transparent!important}.ui.yellow.ribbon.label{border-color:#cd9903!important}.ui.basic.yellow.label{background-color:#FFF!important;color:#FBBD08!important;border-color:#FBBD08!important}.ui.basic.yellow.labels a.label:hover,a.ui.basic.yellow.label:hover{background-color:#FFF!important;color:#eaae00!important;border-color:#eaae00!important}.ui.olive.label,.ui.olive.labels .label{background-color:#B5CC18!important;border-color:#B5CC18!important;color:#FFF!important}.ui.olive.labels .label:hover,a.ui.olive.label:hover{background-color:#a7bd0d!important;border-color:#a7bd0d!important;color:#FFF!important}.ui.olive.corner.label,.ui.olive.corner.label:hover{background-color:transparent!important}.ui.olive.ribbon.label{border-color:#198f35!important}.ui.basic.olive.label{background-color:#FFF!important;color:#B5CC18!important;border-color:#B5CC18!important}.ui.basic.olive.labels a.label:hover,a.ui.basic.olive.label:hover{background-color:#FFF!important;color:#a7bd0d!important;border-color:#a7bd0d!important}.ui.green.label,.ui.green.labels .label{background-color:#21BA45!important;border-color:#21BA45!important;color:#FFF!important}.ui.green.labels .label:hover,a.ui.green.label:hover{background-color:#16ab39!important;border-color:#16ab39!important;color:#FFF!important}.ui.green.corner.label,.ui.green.corner.label:hover{background-color:transparent!important}.ui.green.ribbon.label{border-color:#198f35!important}.ui.basic.green.label{background-color:#FFF!important;color:#21BA45!important;border-color:#21BA45!important}.ui.basic.green.labels a.label:hover,a.ui.basic.green.label:hover{background-color:#FFF!important;color:#16ab39!important;border-color:#16ab39!important}.ui.teal.label,.ui.teal.labels .label{background-color:#00B5AD!important;border-color:#00B5AD!important;color:#FFF!important}.ui.teal.labels .label:hover,a.ui.teal.label:hover{background-color:#009c95!important;border-color:#009c95!important;color:#FFF!important}.ui.teal.corner.label,.ui.teal.corner.label:hover{background-color:transparent!important}.ui.teal.ribbon.label{border-color:#00827c!important}.ui.basic.teal.label{background-color:#FFF!important;color:#00B5AD!important;border-color:#00B5AD!important}.ui.basic.teal.labels a.label:hover,a.ui.basic.teal.label:hover{background-color:#FFF!important;color:#009c95!important;border-color:#009c95!important}.ui.blue.label,.ui.blue.labels .label{background-color:#2185D0!important;border-color:#2185D0!important;color:#FFF!important}.ui.blue.labels .label:hover,a.ui.blue.label:hover{background-color:#1678c2!important;border-color:#1678c2!important;color:#FFF!important}.ui.blue.corner.label,.ui.blue.corner.label:hover{background-color:transparent!important}.ui.blue.ribbon.label{border-color:#1a69a4!important}.ui.basic.blue.label{background-color:#FFF!important;color:#2185D0!important;border-color:#2185D0!important}.ui.basic.blue.labels a.label:hover,a.ui.basic.blue.label:hover{background-color:#FFF!important;color:#1678c2!important;border-color:#1678c2!important}.ui.violet.label,.ui.violet.labels .label{background-color:#6435C9!important;border-color:#6435C9!important;color:#FFF!important}.ui.violet.labels .label:hover,a.ui.violet.label:hover{background-color:#5829bb!important;border-color:#5829bb!important;color:#FFF!important}.ui.violet.corner.label,.ui.violet.corner.label:hover{background-color:transparent!important}.ui.violet.ribbon.label{border-color:#502aa1!important}.ui.basic.violet.label{background-color:#FFF!important;color:#6435C9!important;border-color:#6435C9!important}.ui.basic.violet.labels a.label:hover,a.ui.basic.violet.label:hover{background-color:#FFF!important;color:#5829bb!important;border-color:#5829bb!important}.ui.purple.label,.ui.purple.labels .label{background-color:#A333C8!important;border-color:#A333C8!important;color:#FFF!important}.ui.purple.labels .label:hover,a.ui.purple.label:hover{background-color:#9627ba!important;border-color:#9627ba!important;color:#FFF!important}.ui.purple.corner.label,.ui.purple.corner.label:hover{background-color:transparent!important}.ui.purple.ribbon.label{border-color:#82299f!important}.ui.basic.purple.label{background-color:#FFF!important;color:#A333C8!important;border-color:#A333C8!important}.ui.basic.purple.labels a.label:hover,a.ui.basic.purple.label:hover{background-color:#FFF!important;color:#9627ba!important;border-color:#9627ba!important}.ui.pink.label,.ui.pink.labels .label{background-color:#E03997!important;border-color:#E03997!important;color:#FFF!important}.ui.pink.labels .label:hover,a.ui.pink.label:hover{background-color:#e61a8d!important;border-color:#e61a8d!important;color:#FFF!important}.ui.pink.corner.label,.ui.pink.corner.label:hover{background-color:transparent!important}.ui.pink.ribbon.label{border-color:#c71f7e!important}.ui.basic.pink.label{background-color:#FFF!important;color:#E03997!important;border-color:#E03997!important}.ui.basic.pink.labels a.label:hover,a.ui.basic.pink.label:hover{background-color:#FFF!important;color:#e61a8d!important;border-color:#e61a8d!important}.ui.brown.label,.ui.brown.labels .label{background-color:#A5673F!important;border-color:#A5673F!important;color:#FFF!important}.ui.brown.labels .label:hover,a.ui.brown.label:hover{background-color:#975b33!important;border-color:#975b33!important;color:#FFF!important}.ui.brown.corner.label,.ui.brown.corner.label:hover{background-color:transparent!important}.ui.brown.ribbon.label{border-color:#805031!important}.ui.basic.brown.label{background-color:#FFF!important;color:#A5673F!important;border-color:#A5673F!important}.ui.basic.brown.labels a.label:hover,a.ui.basic.brown.label:hover{background-color:#FFF!important;color:#975b33!important;border-color:#975b33!important}.ui.grey.label,.ui.grey.labels .label{background-color:#767676!important;border-color:#767676!important;color:#FFF!important}.ui.grey.labels .label:hover,a.ui.grey.label:hover{background-color:#838383!important;border-color:#838383!important;color:#FFF!important}.ui.grey.corner.label,.ui.grey.corner.label:hover{background-color:transparent!important}.ui.grey.ribbon.label{border-color:#805031!important}.ui.basic.grey.label{background-color:#FFF!important;color:#767676!important;border-color:#767676!important}.ui.basic.grey.labels a.label:hover,a.ui.basic.grey.label:hover{background-color:#FFF!important;color:#838383!important;border-color:#838383!important}.ui.black.label,.ui.black.labels .label{background-color:#1B1C1D!important;border-color:#1B1C1D!important;color:#FFF!important}.ui.black.labels .label:hover,a.ui.black.label:hover{background-color:#27292a!important;border-color:#27292a!important;color:#FFF!important}.ui.black.corner.label,.ui.black.corner.label:hover{background-color:transparent!important}.ui.black.ribbon.label{border-color:#805031!important}.ui.basic.black.label{background-color:#FFF!important;color:#1B1C1D!important;border-color:#1B1C1D!important}.ui.basic.black.labels a.label:hover,a.ui.basic.black.label:hover{background-color:#FFF!important;color:#27292a!important;border-color:#27292a!important}.ui.basic.label{background:#FFF;border:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87);box-shadow:none}a.ui.basic.label:hover{text-decoration:none;background:#FFF;color:#1e70bf;box-shadow:1px solid rgba(34,36,38,.15);box-shadow:none}.ui.basic.pointing.label:before{border-color:inherit}.ui.fluid.labels>.label,.ui.label.fluid{width:100%;box-sizing:border-box}.ui.inverted.label,.ui.inverted.labels .label{color:rgba(255,255,255,.9)!important}.ui.horizontal.label,.ui.horizontal.labels .label{margin:0 .5em 0 0;padding:.4em .833em;min-width:3em;text-align:center}.ui.circular.label,.ui.circular.labels .label{min-width:2em;min-height:2em;padding:.5em!important;line-height:1em;text-align:center;border-radius:500rem}.ui.empty.circular.label,.ui.empty.circular.labels .label{min-width:0;min-height:0;overflow:hidden;width:.5em;height:.5em;vertical-align:baseline}.ui.pointing.label{position:relative}.ui.attached.pointing.label{position:absolute}.ui.pointing.label:before{background-color:inherit;border-style:solid;border-color:inherit;position:absolute;content:'';-webkit-transform:rotate(45deg);transform:rotate(45deg);background-image:none;z-index:2;width:.6666em;height:.6666em;-webkit-transition:background .1s ease;transition:background .1s ease}.ui.pointing.label,.ui[class*="pointing above"].label{margin-top:1em}.ui.pointing.label:before,.ui[class*="pointing above"].label:before{border-width:1px 0 0 1px;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);top:0;left:50%}.ui[class*="bottom pointing"].label,.ui[class*="pointing below"].label{margin-top:0;margin-bottom:1em}.ui[class*="bottom pointing"].label:before,.ui[class*="pointing below"].label:before{border-width:0 1px 1px 0;right:auto;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);top:100%;left:50%}.ui[class*="left pointing"].label{margin-top:0;margin-left:.6666em}.ui[class*="left pointing"].label:before{border-width:0 0 1px 1px;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);bottom:auto;right:auto;top:50%;left:0}.ui[class*="right pointing"].label{margin-top:0;margin-right:.6666em}.ui[class*="right pointing"].label:before{border-width:1px 1px 0 0;-webkit-transform:translateX(50%) translateY(-50%) rotate(45deg);transform:translateX(50%) translateY(-50%) rotate(45deg);top:50%;right:0;bottom:auto;left:auto}.ui.basic.pointing.label:before,.ui.basic[class*="pointing above"].label:before{margin-top:-1px}.ui.basic[class*="bottom pointing"].label:before,.ui.basic[class*="pointing below"].label:before{bottom:auto;top:100%;margin-top:1px}.ui.basic[class*="left pointing"].label:before{top:50%;left:-1px}.ui.basic[class*="right pointing"].label:before{top:50%;right:-1px}.ui.floating.label{position:absolute;z-index:100;top:-1em;left:100%;margin:0 0 0 -1.5em!important}.ui.mini.label,.ui.mini.labels .label{font-size:.64285714rem}.ui.tiny.label,.ui.tiny.labels .label{font-size:.71428571rem}.ui.small.label,.ui.small.labels .label{font-size:.78571429rem}.ui.label,.ui.labels .label{font-size:.85714286rem}.ui.large.label,.ui.large.labels .label{font-size:1rem}.ui.big.label,.ui.big.labels .label{font-size:1.28571429rem}.ui.huge.label,.ui.huge.labels .label{font-size:1.42857143rem}.ui.massive.label,.ui.massive.labels .label{font-size:1.71428571rem}.ui.list,ol.ui.list,ul.ui.list{list-style-type:none;margin:1em 0;padding:0}.ui.list:first-child,ol.ui.list:first-child,ul.ui.list:first-child{margin-top:0;padding-top:0}.ui.list:last-child,ol.ui.list:last-child,ul.ui.list:last-child{margin-bottom:0;padding-bottom:0}.ui.list .list>.item,.ui.list>.item,ol.ui.list li,ul.ui.list li{display:list-item;table-layout:fixed;list-style-type:none;list-style-position:outside;padding:.21428571em 0;line-height:1.14285714em}.ui.list>.item:after,.ui.list>.list>.item,ol.ui.list>li:first-child:after,ul.ui.list>li:first-child:after{content:'';display:block;height:0;clear:both;visibility:hidden}.ui.list .list>.item:first-child,.ui.list>.item:first-child,ol.ui.list li:first-child,ul.ui.list li:first-child{padding-top:0}.ui.list .list>.item:last-child,.ui.list>.item:last-child,ol.ui.list li:last-child,ul.ui.list li:last-child{padding-bottom:0}.ui.list .list,ol.ui.list ol,ul.ui.list ul{clear:both;margin:0;padding:.75em 0 .25em .5em}.ui.list .list>.item,ol.ui.list ol li,ul.ui.list ul li{padding:.14285714em 0;line-height:inherit}.ui.list .list>.item>i.icon,.ui.list>.item>i.icon{display:table-cell;margin:0;padding-top:.07142857em;padding-right:.28571429em;vertical-align:top;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.list .list>.item>i.icon:only-child,.ui.list>.item>i.icon:only-child{display:inline-block;vertical-align:top}.ui.list .list>.item>.image,.ui.list>.item>.image{display:table-cell;background-color:transparent;margin:0;vertical-align:top}.ui.list .list>.item>.image:not(:only-child):not(img),.ui.list>.item>.image:not(:only-child):not(img){padding-right:.5em}.ui.list .list>.item>.image img,.ui.list>.item>.image img{vertical-align:top}.ui.list .list>.item>.image:only-child,.ui.list .list>.item>img.image,.ui.list>.item>.image:only-child,.ui.list>.item>img.image{display:inline-block}.ui.list .list>.item>.content,.ui.list>.item>.content{line-height:1.14285714em}.ui.list .list>.item>.icon+.content,.ui.list .list>.item>.image+.content,.ui.list>.item>.icon+.content,.ui.list>.item>.image+.content{display:table-cell;padding:0 0 0 .5em;vertical-align:top}.ui.list .list>.item>img.image+.content,.ui.list>.item>img.image+.content{display:inline-block}.ui.list .list>.item>.content>.list,.ui.list>.item>.content>.list{margin-left:0;padding-left:0}.ui.list .list>.item .header,.ui.list>.item .header{display:block;margin:0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-weight:700;color:rgba(0,0,0,.87)}.ui.list .list>.item .description,.ui.list>.item .description{display:block;color:rgba(0,0,0,.7)}.ui.list .list>.item a,.ui.list>.item a{cursor:pointer}.ui.list .list>a.item,.ui.list>a.item{cursor:pointer;color:#4183C4}.ui.list .list>a.item:hover,.ui.list>a.item:hover{color:#1e70bf}.ui.list .list>a.item i.icon,.ui.list>a.item i.icon{color:rgba(0,0,0,.4)}.ui.list .list>.item a.header,.ui.list>.item a.header{cursor:pointer;color:#4183C4!important}.ui.list .list>.item a.header:hover,.ui.list>.item a.header:hover{color:#1e70bf!important}.ui[class*="left floated"].list{float:left}.ui[class*="right floated"].list{float:right}.ui.list .list>.item [class*="left floated"],.ui.list>.item [class*="left floated"]{float:left;margin:0 1em 0 0}.ui.list .list>.item [class*="right floated"],.ui.list>.item [class*="right floated"]{float:right;margin:0 0 0 1em}.ui.menu .ui.list .list>.item,.ui.menu .ui.list>.item{display:list-item;table-layout:fixed;background-color:transparent;list-style-type:none;list-style-position:outside;padding:.21428571em 0;line-height:1.14285714em}.ui.menu .ui.list .list>.item:before,.ui.menu .ui.list>.item:before{border:none;background:0 0}.ui.menu .ui.list .list>.item:first-child,.ui.menu .ui.list>.item:first-child{padding-top:0}.ui.menu .ui.list .list>.item:last-child,.ui.menu .ui.list>.item:last-child{padding-bottom:0}.ui.horizontal.list{display:inline-block;font-size:0}.ui.horizontal.list>.item{display:inline-block;margin-left:1em;font-size:1rem}.ui.horizontal.list:not(.celled)>.item:first-child{margin-left:0!important;padding-left:0!important}.ui.horizontal.list .list{padding-left:0;padding-bottom:0}.ui.horizontal.list .list>.item>.content,.ui.horizontal.list .list>.item>.icon,.ui.horizontal.list .list>.item>.image,.ui.horizontal.list>.item>.content,.ui.horizontal.list>.item>.icon,.ui.horizontal.list>.item>.image{vertical-align:middle}.ui.horizontal.list>.item:first-child,.ui.horizontal.list>.item:last-child{padding-top:.21428571em;padding-bottom:.21428571em}.ui.horizontal.list>.item>i.icon{margin:0;padding:0 .25em 0 0}.ui.horizontal.list>.item>.icon,.ui.horizontal.list>.item>.icon+.content{float:none;display:inline-block}.ui.list .list>.disabled.item,.ui.list>.disabled.item{pointer-events:none;color:rgba(40,40,40,.3)!important}.ui.inverted.list .list>.disabled.item,.ui.inverted.list>.disabled.item{color:rgba(225,225,225,.3)!important}.ui.list .list>a.item:hover .icon,.ui.list>a.item:hover .icon{color:rgba(0,0,0,.87)}.ui.inverted.list .list>a.item>.icon,.ui.inverted.list>a.item>.icon{color:rgba(255,255,255,.7)}.ui.inverted.list .list>.item .header,.ui.inverted.list>.item .header{color:rgba(255,255,255,.9)}.ui.inverted.list .list>.item .description,.ui.inverted.list>.item .description{color:rgba(255,255,255,.7)}.ui.inverted.list .list>a.item,.ui.inverted.list>a.item{cursor:pointer;color:rgba(255,255,255,.9)}.ui.inverted.list .list>a.item:hover,.ui.inverted.list>a.item:hover{color:#1e70bf}.ui.inverted.list .item a:not(.ui){color:rgba(255,255,255,.9)!important}.ui.inverted.list .item a:not(.ui):hover{color:#1e70bf!important}.ui.list [class*="top aligned"],.ui.list[class*="top aligned"] .content,.ui.list[class*="top aligned"] .image{vertical-align:top!important}.ui.list [class*="middle aligned"],.ui.list[class*="middle aligned"] .content,.ui.list[class*="middle aligned"] .image{vertical-align:middle!important}.ui.list [class*="bottom aligned"],.ui.list[class*="bottom aligned"] .content,.ui.list[class*="bottom aligned"] .image{vertical-align:bottom!important}.ui.link.list .item,.ui.link.list .item a:not(.ui),.ui.link.list a.item{color:rgba(0,0,0,.4);-webkit-transition:.1s color ease;transition:.1s color ease}.ui.link.list .item a:not(.ui):hover,.ui.link.list a.item:hover{color:rgba(0,0,0,.8)}.ui.link.list .item a:not(.ui):active,.ui.link.list a.item:active{color:rgba(0,0,0,.9)}.ui.link.list .active.item,.ui.link.list .active.item a:not(.ui){color:rgba(0,0,0,.95)}.ui.inverted.link.list .item,.ui.inverted.link.list .item a:not(.ui),.ui.inverted.link.list a.item{color:rgba(255,255,255,.5)}.ui.inverted.link.list .active.item a:not(.ui),.ui.inverted.link.list .item a:not(.ui):active,.ui.inverted.link.list .item a:not(.ui):hover,.ui.inverted.link.list a.active.item,.ui.inverted.link.list a.item:active,.ui.inverted.link.list a.item:hover{color:#fff}.ui.selection.list .list>.item,.ui.selection.list>.item{cursor:pointer;background:0 0;padding:.5em;margin:0;color:rgba(0,0,0,.4);border-radius:.5em;-webkit-transition:.1s color ease,.1s padding-left ease,.1s background-color ease;transition:.1s color ease,.1s padding-left ease,.1s background-color ease}.ui.selection.list .list>.item:last-child,.ui.selection.list>.item:last-child{margin-bottom:0}.ui.selection.list.list>.item:hover,.ui.selection.list>.item:hover{background:rgba(0,0,0,.03);color:rgba(0,0,0,.8)}.ui.selection.list .list>.item:active,.ui.selection.list>.item:active{background:rgba(0,0,0,.05);color:rgba(0,0,0,.9)}.ui.selection.list .list>.item.active,.ui.selection.list>.item.active{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95)}.ui.inverted.selection.list>.item{background:0 0;color:rgba(255,255,255,.5)}.ui.inverted.selection.list>.item:hover{background:rgba(255,255,255,.02);color:#fff}.ui.inverted.selection.list>.item.active,.ui.inverted.selection.list>.item:active{background:rgba(255,255,255,.08);color:#fff}.ui.celled.selection.list .list>.item,.ui.celled.selection.list>.item,.ui.divided.selection.list .list>.item,.ui.divided.selection.list>.item{border-radius:0}.ui.animated.list>.item{-webkit-transition:.25s color ease .1s,.25s padding-left ease .1s,.25s background-color ease .1s;transition:.25s color ease .1s,.25s padding-left ease .1s,.25s background-color ease .1s}.ui.animated.list:not(.horizontal)>.item:hover{padding-left:1em}.ui.fitted.list:not(.selection) .list>.item,.ui.fitted.list:not(.selection)>.item{padding-left:0;padding-right:0}.ui.fitted.selection.list .list>.item,.ui.fitted.selection.list>.item{margin-left:-.5em;margin-right:-.5em}.ui.bulleted.list,ul.ui.list{margin-left:1.25rem}.ui.bulleted.list .list>.item,.ui.bulleted.list>.item,ul.ui.list li{position:relative}.ui.bulleted.list .list>.item:before,.ui.bulleted.list>.item:before,ul.ui.list li:before{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;position:absolute;top:auto;left:auto;font-weight:400;margin-left:-1.25rem;content:'•';opacity:1;color:inherit;vertical-align:top}.ui.bulleted.list .list>a.item:before,.ui.bulleted.list>a.item:before,ul.ui.list li:before{color:rgba(0,0,0,.87)}.ui.bulleted.list .list,ul.ui.list ul{padding-left:1.25rem}.ui.horizontal.bulleted.list,ul.ui.horizontal.bulleted.list{margin-left:0}.ui.horizontal.bulleted.list>.item,ul.ui.horizontal.bulleted.list li{margin-left:1.75rem}.ui.horizontal.bulleted.list>.item:first-child,ul.ui.horizontal.bulleted.list li:first-child{margin-left:0}.ui.horizontal.bulleted.list>.item::before,ul.ui.horizontal.bulleted.list li::before{color:rgba(0,0,0,.87)}.ui.horizontal.bulleted.list>.item:first-child::before,ul.ui.horizontal.bulleted.list li:first-child::before{display:none}.ui.ordered.list,.ui.ordered.list .list,ol.ui.list,ol.ui.list ol{counter-reset:ordered;margin-left:1.25rem;list-style-type:none}.ui.ordered.list .list>.item,.ui.ordered.list>.item,ol.ui.list li{list-style-type:none;position:relative}.ui.ordered.list .list>.item:before,.ui.ordered.list>.item:before,ol.ui.list li:before{position:absolute;top:auto;left:auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;margin-left:-1.25rem;counter-increment:ordered;content:counters(ordered,".") " ";text-align:right;color:rgba(0,0,0,.87);vertical-align:middle;opacity:.8}.ui.ordered.inverted.list .list>.item:before,.ui.ordered.inverted.list>.item:before,ol.ui.inverted.list li:before{color:rgba(255,255,255,.7)}.ui.ordered.list>.item[data-value],.ui.ordered.list>.list>.item[data-value]{content:attr(data-value)}ol.ui.list li[value]:before{content:attr(value)}.ui.ordered.list .list,ol.ui.list ol{margin-left:1em}.ui.ordered.list .list>.item:before,ol.ui.list ol li:before{margin-left:-2em}.ui.ordered.horizontal.list,ol.ui.horizontal.list{margin-left:0}.ui.ordered.horizontal.list .list>.item:before,.ui.ordered.horizontal.list>.item:before,ol.ui.horizontal.list li:before{position:static;margin:0 .5em 0 0}.ui.divided.list>.item{border-top:1px solid rgba(34,36,38,.15)}.ui.divided.list .item .list>.item,.ui.divided.list .list>.item,.ui.divided.list .list>.item:first-child,.ui.divided.list>.item:first-child{border-top:none}.ui.divided.list:not(.horizontal) .list>.item:first-child{border-top-width:1px}.ui.divided.bulleted.list .list,.ui.divided.bulleted.list:not(.horizontal){margin-left:0;padding-left:0}.ui.divided.bulleted.list>.item:not(.horizontal){padding-left:1.25rem}.ui.divided.ordered.list{margin-left:0}.ui.divided.ordered.list .list>.item,.ui.divided.ordered.list>.item{padding-left:1.25rem}.ui.divided.ordered.list .item .list{margin-left:0;margin-right:0;padding-bottom:.21428571em}.ui.divided.ordered.list .item .list>.item{padding-left:1em}.ui.divided.selection.list .list>.item,.ui.divided.selection.list>.item{margin:0;border-radius:0}.ui.divided.horizontal.list{margin-left:0}.ui.divided.horizontal.list>.item:not(:first-child){padding-left:.5em}.ui.divided.horizontal.list>.item:not(:last-child){padding-right:.5em}.ui.divided.horizontal.list>.item{border-top:none;border-left:1px solid rgba(34,36,38,.15);margin:0;line-height:.6}.ui.horizontal.divided.list>.item:first-child{border-left:none}.ui.divided.inverted.horizontal.list>.item,.ui.divided.inverted.list>.item,.ui.divided.inverted.list>.list{border-color:rgba(255,255,255,.1)}.ui.celled.list>.item,.ui.celled.list>.list{border-top:1px solid rgba(34,36,38,.15);padding-left:.5em;padding-right:.5em}.ui.celled.list>.item:last-child{border-bottom:1px solid rgba(34,36,38,.15)}.ui.celled.list>.item:first-child,.ui.celled.list>.item:last-child{padding-top:.21428571em;padding-bottom:.21428571em}.ui.celled.list .item .list>.item{border-width:0}.ui.celled.list .list>.item:first-child{border-top-width:0}.ui.celled.bulleted.list{margin-left:0}.ui.celled.bulleted.list .list>.item,.ui.celled.bulleted.list>.item{padding-left:1.25rem}.ui.celled.bulleted.list .item .list{margin-left:-1.25rem;margin-right:-1.25rem;padding-bottom:.21428571em}.ui.celled.ordered.list{margin-left:0}.ui.celled.ordered.list .list>.item,.ui.celled.ordered.list>.item{padding-left:1.25rem}.ui.celled.ordered.list .item .list{margin-left:0;margin-right:0;padding-bottom:.21428571em}.ui.celled.ordered.list .list>.item{padding-left:1em}.ui.horizontal.celled.list{margin-left:0}.ui.horizontal.celled.list .list>.item,.ui.horizontal.celled.list>.item{border-top:none;border-left:1px solid rgba(34,36,38,.15);margin:0;padding-left:.5em;padding-right:.5em;line-height:.6}.ui.horizontal.celled.list .list>.item:last-child,.ui.horizontal.celled.list>.item:last-child{border-bottom:none;border-right:1px solid rgba(34,36,38,.15)}.ui.celled.inverted.horizontal.list .list>.item,.ui.celled.inverted.horizontal.list>.item,.ui.celled.inverted.list>.item,.ui.celled.inverted.list>.list{border-color:1px solid rgba(255,255,255,.1)}.ui.relaxed.list:not(.horizontal)>.item:not(:first-child){padding-top:.42857143em}.ui.relaxed.list:not(.horizontal)>.item:not(:last-child){padding-bottom:.42857143em}.ui.horizontal.relaxed.list .list>.item:not(:first-child),.ui.horizontal.relaxed.list>.item:not(:first-child){padding-left:1rem}.ui.horizontal.relaxed.list .list>.item:not(:last-child),.ui.horizontal.relaxed.list>.item:not(:last-child){padding-right:1rem}.ui[class*="very relaxed"].list:not(.horizontal)>.item:not(:first-child){padding-top:.85714286em}.ui[class*="very relaxed"].list:not(.horizontal)>.item:not(:last-child){padding-bottom:.85714286em}.ui.horizontal[class*="very relaxed"].list .list>.item:not(:first-child),.ui.horizontal[class*="very relaxed"].list>.item:not(:first-child){padding-left:1.5rem}.ui.horizontal[class*="very relaxed"].list .list>.item:not(:last-child),.ui.horizontal[class*="very relaxed"].list>.item:not(:last-child){padding-right:1.5rem}.ui.mini.list{font-size:.78571429em}.ui.tiny.list{font-size:.85714286em}.ui.small.list{font-size:.92857143em}.ui.list{font-size:1em}.ui.large.list{font-size:1.14285714em}.ui.big.list{font-size:1.28571429em}.ui.huge.list{font-size:1.42857143em}.ui.massive.list{font-size:1.71428571em}.ui.mini.horizontal.list .list>.item,.ui.mini.horizontal.list>.item{font-size:.78571429rem}.ui.tiny.horizontal.list .list>.item,.ui.tiny.horizontal.list>.item{font-size:.85714286rem}.ui.small.horizontal.list .list>.item,.ui.small.horizontal.list>.item{font-size:.92857143rem}.ui.horizontal.list .list>.item,.ui.horizontal.list>.item{font-size:1rem}.ui.large.horizontal.list .list>.item,.ui.large.horizontal.list>.item{font-size:1.14285714rem}.ui.big.horizontal.list .list>.item,.ui.big.horizontal.list>.item{font-size:1.28571429rem}.ui.huge.horizontal.list .list>.item,.ui.huge.horizontal.list>.item{font-size:1.42857143rem}.ui.massive.horizontal.list .list>.item,.ui.massive.horizontal.list>.item{font-size:1.71428571rem}.ui.loader{display:none;position:absolute;top:50%;left:50%;margin:0;text-align:center;z-index:1000;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.ui.loader:before{position:absolute;content:'';top:0;left:50%;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.loader:after{position:absolute;content:'';top:0;left:50%;-webkit-animation:loader .6s linear;animation:loader .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 transparent transparent;border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent}@-webkit-keyframes loader{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loader{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.mini.loader:after,.ui.mini.loader:before{width:1rem;height:1rem;margin:0 0 0 -.5rem}.ui.tiny.loader:after,.ui.tiny.loader:before{width:1.14285714rem;height:1.14285714rem;margin:0 0 0 -.57142857rem}.ui.small.loader:after,.ui.small.loader:before{width:1.71428571rem;height:1.71428571rem;margin:0 0 0 -.85714286rem}.ui.loader:after,.ui.loader:before{width:2.28571429rem;height:2.28571429rem;margin:0 0 0 -1.14285714rem}.ui.large.loader:after,.ui.large.loader:before{width:3.42857143rem;height:3.42857143rem;margin:0 0 0 -1.71428571rem}.ui.big.loader:after,.ui.big.loader:before{width:3.71428571rem;height:3.71428571rem;margin:0 0 0 -1.85714286rem}.ui.huge.loader:after,.ui.huge.loader:before{width:4.14285714rem;height:4.14285714rem;margin:0 0 0 -2.07142857rem}.ui.massive.loader:after,.ui.massive.loader:before{width:4.57142857rem;height:4.57142857rem;margin:0 0 0 -2.28571429rem}.ui.dimmer .loader{display:block}.ui.dimmer .ui.loader{color:rgba(255,255,255,.9)}.ui.dimmer .ui.loader:before{border-color:rgba(255,255,255,.15)}.ui.dimmer .ui.loader:after{border-color:#FFF transparent transparent}.ui.inverted.dimmer .ui.loader{color:rgba(0,0,0,.87)}.ui.inverted.dimmer .ui.loader:before{border-color:rgba(0,0,0,.1)}.ui.inverted.dimmer .ui.loader:after{border-color:#767676 transparent transparent}.ui.text.loader{width:auto!important;height:auto!important;text-align:center;font-style:normal}.ui.indeterminate.loader:after{-webkit-animation-direction:reverse;animation-direction:reverse;-webkit-animation-duration:1.2s;animation-duration:1.2s}.ui.loader.active,.ui.loader.visible{display:block}.ui.loader.disabled,.ui.loader.hidden{display:none}.ui.inverted.dimmer .ui.mini.loader,.ui.mini.loader{width:1rem;height:1rem;font-size:.78571429em}.ui.inverted.dimmer .ui.tiny.loader,.ui.tiny.loader{width:1.14285714rem;height:1.14285714rem;font-size:.85714286em}.ui.inverted.dimmer .ui.small.loader,.ui.small.loader{width:1.71428571rem;height:1.71428571rem;font-size:.92857143em}.ui.inverted.dimmer .ui.loader,.ui.loader{width:2.28571429rem;height:2.28571429rem;font-size:1em}.ui.inverted.dimmer .ui.large.loader,.ui.large.loader{width:3.42857143rem;height:3.42857143rem;font-size:1.14285714em}.ui.big.loader,.ui.inverted.dimmer .ui.big.loader{width:3.71428571rem;height:3.71428571rem;font-size:1.28571429em}.ui.huge.loader,.ui.inverted.dimmer .ui.huge.loader{width:4.14285714rem;height:4.14285714rem;font-size:1.42857143em}.ui.inverted.dimmer .ui.massive.loader,.ui.massive.loader{width:4.57142857rem;height:4.57142857rem;font-size:1.71428571em}.ui.mini.text.loader{min-width:1rem;padding-top:1.78571429rem}.ui.tiny.text.loader{min-width:1.14285714rem;padding-top:1.92857143rem}.ui.small.text.loader{min-width:1.71428571rem;padding-top:2.5rem}.ui.text.loader{min-width:2.28571429rem;padding-top:3.07142857rem}.ui.large.text.loader{min-width:3.42857143rem;padding-top:4.21428571rem}.ui.big.text.loader{min-width:3.71428571rem;padding-top:4.5rem}.ui.huge.text.loader{min-width:4.14285714rem;padding-top:4.92857143rem}.ui.massive.text.loader{min-width:4.57142857rem;padding-top:5.35714286rem}.ui.inverted.loader{color:rgba(255,255,255,.9)}.ui.inverted.loader:before{border-color:rgba(255,255,255,.15)}.ui.inverted.loader:after{border-top-color:#FFF}.ui.inline.loader{position:relative;vertical-align:middle;margin:0;left:0;top:0;-webkit-transform:none;transform:none}.ui.inline.loader.active,.ui.inline.loader.visible{display:inline-block}.ui.centered.inline.loader.active,.ui.centered.inline.loader.visible{display:block;margin-left:auto;margin-right:auto}.ui.rail{position:absolute;top:0;width:300px;height:100%}.ui.left.rail{left:auto;right:100%;padding:0 2rem 0 0;margin:0 2rem 0 0}.ui.right.rail{left:100%;right:auto;padding:0 0 0 2rem;margin:0 0 0 2rem}.ui.left.internal.rail{left:0;right:auto;padding:0 0 0 2rem;margin:0 0 0 2rem}.ui.right.internal.rail{left:auto;right:0;padding:0 2rem 0 0;margin:0 2rem 0 0}.ui.dividing.rail{width:302.5px}.ui.left.dividing.rail{padding:0 2.5rem 0 0;margin:0 2.5rem 0 0;border-right:1px solid rgba(34,36,38,.15)}.ui.right.dividing.rail{border-left:1px solid rgba(34,36,38,.15);padding:0 0 0 2.5rem;margin:0 0 0 2.5rem}.ui.close.rail{width:calc(300px + 1em)}.ui.close.left.rail{padding:0 1em 0 0;margin:0 1em 0 0}.ui.close.right.rail{padding:0 0 0 1em;margin:0 0 0 1em}.ui.very.close.rail{width:calc(300px + .5em)}.ui.very.close.left.rail{padding:0 .5em 0 0;margin:0 .5em 0 0}.ui.very.close.right.rail{padding:0 0 0 .5em;margin:0 0 0 .5em}.ui.attached.left.rail,.ui.attached.right.rail{padding:0;margin:0}.ui.mini.rail{font-size:.78571429rem}.ui.tiny.rail{font-size:.85714286rem}.ui.small.rail{font-size:.92857143rem}.ui.rail{font-size:1rem}.ui.large.rail{font-size:1.14285714rem}.ui.big.rail{font-size:1.28571429rem}.ui.huge.rail{font-size:1.42857143rem}.ui.massive.rail{font-size:1.71428571rem}.ui.reveal{display:inherit;position:relative!important;font-size:0!important}.ui.reveal>.visible.content{position:absolute!important;top:0!important;left:0!important;z-index:3!important;-webkit-transition:all .5s ease .1s;transition:all .5s ease .1s}.ui.reveal>.hidden.content{position:relative!important;z-index:2!important}.ui.active.reveal .visible.content,.ui.reveal:hover .visible.content{z-index:4!important}.ui.slide.reveal{position:relative!important;overflow:hidden!important;white-space:nowrap}.ui.slide.reveal>.content{display:block;width:100%;float:left;margin:0;-webkit-transition:-webkit-transform .5s ease .1s;transition:-webkit-transform .5s ease .1s;transition:transform .5s ease .1s;transition:transform .5s ease .1s,-webkit-transform .5s ease .1s}.ui.slide.reveal>.visible.content{position:relative!important}.ui.slide.reveal>.hidden.content{position:absolute!important;left:0!important;width:100%!important;-webkit-transform:translateX(100%)!important;transform:translateX(100%)!important}.ui.slide.active.reveal>.visible.content,.ui.slide.reveal:hover>.visible.content{-webkit-transform:translateX(-100%)!important;transform:translateX(-100%)!important}.ui.slide.active.reveal>.hidden.content,.ui.slide.reveal:hover>.hidden.content,.ui.slide.right.reveal>.visible.content{-webkit-transform:translateX(0)!important;transform:translateX(0)!important}.ui.slide.right.reveal>.hidden.content{-webkit-transform:translateX(-100%)!important;transform:translateX(-100%)!important}.ui.slide.right.active.reveal>.visible.content,.ui.slide.right.reveal:hover>.visible.content{-webkit-transform:translateX(100%)!important;transform:translateX(100%)!important}.ui.slide.right.active.reveal>.hidden.content,.ui.slide.right.reveal:hover>.hidden.content{-webkit-transform:translateX(0)!important;transform:translateX(0)!important}.ui.slide.up.reveal>.hidden.content{-webkit-transform:translateY(100%)!important;transform:translateY(100%)!important}.ui.slide.up.active.reveal>.visible.content,.ui.slide.up.reveal:hover>.visible.content{-webkit-transform:translateY(-100%)!important;transform:translateY(-100%)!important}.ui.slide.up.active.reveal>.hidden.content,.ui.slide.up.reveal:hover>.hidden.content{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}.ui.slide.down.reveal>.hidden.content{-webkit-transform:translateY(-100%)!important;transform:translateY(-100%)!important}.ui.slide.down.active.reveal>.visible.content,.ui.slide.down.reveal:hover>.visible.content{-webkit-transform:translateY(100%)!important;transform:translateY(100%)!important}.ui.slide.down.active.reveal>.hidden.content,.ui.slide.down.reveal:hover>.hidden.content{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}.ui.fade.reveal>.visible.content{opacity:1}.ui.fade.active.reveal>.visible.content,.ui.fade.reveal:hover>.visible.content{opacity:0}.ui.move.reveal{position:relative!important;overflow:hidden!important;white-space:nowrap}.ui.move.reveal>.content{display:block;float:left;margin:0;-webkit-transition:-webkit-transform .5s cubic-bezier(.175,.885,.32,1) .1s;transition:-webkit-transform .5s cubic-bezier(.175,.885,.32,1) .1s;transition:transform .5s cubic-bezier(.175,.885,.32,1) .1s;transition:transform .5s cubic-bezier(.175,.885,.32,1) .1s,-webkit-transform .5s cubic-bezier(.175,.885,.32,1) .1s}.ui.move.reveal>.visible.content{position:relative!important}.ui.move.reveal>.hidden.content{position:absolute!important;left:0!important;width:100%!important}.ui.move.active.reveal>.visible.content,.ui.move.reveal:hover>.visible.content{-webkit-transform:translateX(-100%)!important;transform:translateX(-100%)!important}.ui.move.right.active.reveal>.visible.content,.ui.move.right.reveal:hover>.visible.content{-webkit-transform:translateX(100%)!important;transform:translateX(100%)!important}.ui.move.up.active.reveal>.visible.content,.ui.move.up.reveal:hover>.visible.content{-webkit-transform:translateY(-100%)!important;transform:translateY(-100%)!important}.ui.move.down.active.reveal>.visible.content,.ui.move.down.reveal:hover>.visible.content{-webkit-transform:translateY(100%)!important;transform:translateY(100%)!important}.ui.rotate.reveal>.visible.content{-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transform:rotate(0);transform:rotate(0)}.ui.rotate.reveal>.visible.content,.ui.rotate.right.reveal>.visible.content{-webkit-transform-origin:bottom right;transform-origin:bottom right}.ui.rotate.active.reveal>.visible.content,.ui.rotate.reveal:hover>.visible.content,.ui.rotate.right.active.reveal>.visible.content,.ui.rotate.right.reveal:hover>.visible.content{-webkit-transform:rotate(110deg);transform:rotate(110deg)}.ui.rotate.left.reveal>.visible.content{-webkit-transform-origin:bottom left;transform-origin:bottom left}.ui.rotate.left.active.reveal>.visible.content,.ui.rotate.left.reveal:hover>.visible.content{-webkit-transform:rotate(-110deg);transform:rotate(-110deg)}.ui.disabled.reveal:hover>.visible.visible.content{position:static!important;display:block!important;opacity:1!important;top:0!important;left:0!important;right:auto!important;bottom:auto!important;-webkit-transform:none!important;transform:none!important}.ui.disabled.reveal:hover>.hidden.hidden.content{display:none!important}.ui.visible.reveal{overflow:visible}.ui.instant.reveal>.content{-webkit-transition-delay:0s!important;transition-delay:0s!important}.ui.reveal>.content{font-size:1rem!important}.ui.segment{position:relative;background:#FFF;box-shadow:0 1px 2px 0 rgba(34,36,38,.15);margin:1rem 0;padding:1em;border-radius:.28571429rem;border:1px solid rgba(34,36,38,.15)}.ui.segment:first-child{margin-top:0}.ui.segment:last-child{margin-bottom:0}.ui.vertical.segment{margin:0;padding-left:0;padding-right:0;background:none;border-radius:0;box-shadow:none;border:none;border-bottom:1px solid rgba(34,36,38,.15)}.ui.vertical.segment:last-child{border-bottom:none}.ui.inverted.segment>.ui.header{color:#FFF}.ui[class*="bottom attached"].segment>[class*="top attached"].label{border-top-left-radius:0;border-top-right-radius:0}.ui[class*="top attached"].segment>[class*="bottom attached"].label{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui.attached.segment:not(.top):not(.bottom)>[class*="top attached"].label{border-top-left-radius:0;border-top-right-radius:0}.ui.attached.segment:not(.top):not(.bottom)>[class*="bottom attached"].label{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui.grid>.row>.ui.segment.column,.ui.grid>.ui.segment.column,.ui.page.grid.segment{padding-top:2em;padding-bottom:2em}.ui.grid.segment{margin:1rem 0;border-radius:.28571429rem}.ui.basic.table.segment{background:#FFF;border:1px solid rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15)}.ui[class*="very basic"].table.segment{padding:1em}.ui.piled.segment,.ui.piled.segments{margin:3em 0;box-shadow:'';z-index:auto}.ui.piled.segment:first-child{margin-top:0}.ui.piled.segment:last-child{margin-bottom:0}.ui.piled.segment:after,.ui.piled.segment:before,.ui.piled.segments:after,.ui.piled.segments:before{background-color:#FFF;visibility:visible;content:'';display:block;height:100%;left:0;position:absolute;width:100%;border:1px solid rgba(34,36,38,.15);box-shadow:''}.ui.piled.segment:before,.ui.piled.segments:before{-webkit-transform:rotate(-1.2deg);transform:rotate(-1.2deg);top:0;z-index:-2}.ui.piled.segment:after,.ui.piled.segments:after{-webkit-transform:rotate(1.2deg);transform:rotate(1.2deg);top:0;z-index:-1}.ui[class*="top attached"].piled.segment{margin-top:3em;margin-bottom:0}.ui.piled.segment[class*="top attached"]:first-child{margin-top:0}.ui.piled.segment[class*="bottom attached"]{margin-top:0;margin-bottom:3em}.ui.piled.segment[class*="bottom attached"]:last-child{margin-bottom:0}.ui.stacked.segment{padding-bottom:1.4em}.ui.stacked.segment:after,.ui.stacked.segment:before,.ui.stacked.segments:after,.ui.stacked.segments:before{content:'';position:absolute;bottom:-3px;left:0;border-top:1px solid rgba(34,36,38,.15);background:rgba(0,0,0,.03);width:100%;height:6px;visibility:visible}.ui.stacked.segment:before,.ui.stacked.segments:before{display:none}.ui.tall.stacked.segment:before,.ui.tall.stacked.segments:before{display:block;bottom:0}.ui.stacked.inverted.segment:after,.ui.stacked.inverted.segment:before,.ui.stacked.inverted.segments:after,.ui.stacked.inverted.segments:before{background-color:rgba(0,0,0,.03);border-top:1px solid rgba(34,36,38,.35)}.ui.padded.segment{padding:1.5em}.ui[class*="very padded"].segment{padding:3em}.ui.compact.segment{display:table}.ui.compact.segments{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex}.ui.compact.segments .segment,.ui.segments .compact.segment{display:block;-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto}.ui.circular.segment{display:table-cell;padding:2em;text-align:center;vertical-align:middle;border-radius:500em}.ui.raised.segment,.ui.raised.segments{box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15)}.ui.segments{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:relative;margin:1rem 0;border:1px solid rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15);border-radius:.28571429rem}.ui.segments:first-child{margin-top:0}.ui.segments:last-child{margin-bottom:0}.ui.segments>.segment{top:0;bottom:0;border-radius:0;margin:0;width:auto;box-shadow:none;border:none;border-top:1px solid rgba(34,36,38,.15)}.ui.segments:not(.horizontal)>.segment:first-child{border-top:none;margin-top:0;bottom:0;margin-bottom:0;top:0;border-radius:.28571429rem .28571429rem 0 0}.ui.segments:not(.horizontal)>.segment:last-child{top:0;bottom:0;margin-top:0;margin-bottom:0;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;border-radius:0 0 .28571429rem .28571429rem}.ui.segments:not(.horizontal)>.segment:only-child{border-radius:.28571429rem}.ui.segments>.ui.segments{border-top:1px solid rgba(34,36,38,.15);margin:1rem}.ui.segments>.segments:first-child{border-top:none}.ui.segments>.segment+.segments:not(.horizontal){margin-top:0}.ui.horizontal.segments{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;padding:0;background-color:#FFF;box-shadow:0 1px 2px 0 rgba(34,36,38,.15);margin:1rem 0;border-radius:.28571429rem;border:1px solid rgba(34,36,38,.15)}.ui.segments>.horizontal.segments{margin:0;background-color:transparent;border-radius:0;border:none;box-shadow:none;border-top:1px solid rgba(34,36,38,.15)}.ui.horizontal.segments>.segment{-webkit-box-flex:1;-webkit-flex:1 1 auto;flex:1 1 auto;-ms-flex:1 1 0px;margin:0;min-width:0;background-color:transparent;border-radius:0;border:none;box-shadow:none;border-left:1px solid rgba(34,36,38,.15)}.ui.segments>.horizontal.segments:first-child{border-top:none}.ui.horizontal.segments>.segment:first-child{border-left:none}.ui.disabled.segment{opacity:.45;color:rgba(40,40,40,.3)}.ui.loading.segment{position:relative;cursor:default;point-events:none;text-shadow:none!important;color:transparent!important;-webkit-transition:all 0s linear;transition:all 0s linear}.ui.loading.segment:before{position:absolute;content:'';top:0;left:0;background:rgba(255,255,255,.8);width:100%;height:100%;border-radius:.28571429rem;z-index:100}.ui.loading.segment:after{position:absolute;content:'';top:50%;left:50%;margin:-1.5em 0 0 -1.5em;width:3em;height:3em;-webkit-animation:segment-spin .6s linear;animation:segment-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 rgba(0,0,0,.1) rgba(0,0,0,.1);border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent;visibility:visible;z-index:101}@-webkit-keyframes segment-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes segment-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.basic.segment{background:none;box-shadow:none;border:none;border-radius:0}.ui.clearing.segment:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui.red.segment:not(.inverted){border-top:2px solid #DB2828}.ui.inverted.red.segment{background-color:#DB2828!important;color:#FFF!important}.ui.orange.segment:not(.inverted){border-top:2px solid #F2711C}.ui.inverted.orange.segment{background-color:#F2711C!important;color:#FFF!important}.ui.yellow.segment:not(.inverted){border-top:2px solid #FBBD08}.ui.inverted.yellow.segment{background-color:#FBBD08!important;color:#FFF!important}.ui.olive.segment:not(.inverted){border-top:2px solid #B5CC18}.ui.inverted.olive.segment{background-color:#B5CC18!important;color:#FFF!important}.ui.green.segment:not(.inverted){border-top:2px solid #21BA45}.ui.inverted.green.segment{background-color:#21BA45!important;color:#FFF!important}.ui.teal.segment:not(.inverted){border-top:2px solid #00B5AD}.ui.inverted.teal.segment{background-color:#00B5AD!important;color:#FFF!important}.ui.blue.segment:not(.inverted){border-top:2px solid #2185D0}.ui.inverted.blue.segment{background-color:#2185D0!important;color:#FFF!important}.ui.violet.segment:not(.inverted){border-top:2px solid #6435C9}.ui.inverted.violet.segment{background-color:#6435C9!important;color:#FFF!important}.ui.purple.segment:not(.inverted){border-top:2px solid #A333C8}.ui.inverted.purple.segment{background-color:#A333C8!important;color:#FFF!important}.ui.pink.segment:not(.inverted){border-top:2px solid #E03997}.ui.inverted.pink.segment{background-color:#E03997!important;color:#FFF!important}.ui.brown.segment:not(.inverted){border-top:2px solid #A5673F}.ui.inverted.brown.segment{background-color:#A5673F!important;color:#FFF!important}.ui.grey.segment:not(.inverted){border-top:2px solid #767676}.ui.inverted.grey.segment{background-color:#767676!important;color:#FFF!important}.ui.black.segment:not(.inverted){border-top:2px solid #1B1C1D}.ui.inverted.black.segment{background-color:#1B1C1D!important;color:#FFF!important}.ui[class*="left aligned"].segment{text-align:left}.ui[class*="right aligned"].segment{text-align:right}.ui[class*="center aligned"].segment{text-align:center}.ui.floated.segment,.ui[class*="left floated"].segment{float:left;margin-right:1em}.ui[class*="right floated"].segment{float:right;margin-left:1em}.ui.inverted.segment{border:none;box-shadow:none}.ui.inverted.segment,.ui.primary.inverted.segment{background:#1B1C1D;color:rgba(255,255,255,.9)}.ui.inverted.segment .segment{color:rgba(0,0,0,.87)}.ui.inverted.segment .inverted.segment{color:rgba(255,255,255,.9)}.ui.inverted.attached.segment{border-color:#555}.ui.secondary.segment{background:#F3F4F5;color:rgba(0,0,0,.6)}.ui.secondary.inverted.segment{background:-webkit-linear-gradient(rgba(255,255,255,.2) 0,rgba(255,255,255,.2) 100%) #4c4f52;background:linear-gradient(rgba(255,255,255,.2) 0,rgba(255,255,255,.2) 100%) #4c4f52;color:rgba(255,255,255,.8)}.ui.tertiary.segment{background:#DCDDDE;color:rgba(0,0,0,.6)}.ui.tertiary.inverted.segment{background:-webkit-linear-gradient(rgba(255,255,255,.35) 0,rgba(255,255,255,.35) 100%) #717579;background:linear-gradient(rgba(255,255,255,.35) 0,rgba(255,255,255,.35) 100%) #717579;color:rgba(255,255,255,.8)}.ui.attached.segment{top:0;bottom:0;border-radius:0;margin:0 -1px;width:calc(100% + 2px);max-width:calc(100% + 2px);box-shadow:none;border:1px solid #D4D4D5}.ui.attached:not(.message)+.ui.attached.segment:not(.top){border-top:none}.ui[class*="top attached"].segment{bottom:0;margin-bottom:0;top:0;margin-top:1rem;border-radius:.28571429rem .28571429rem 0 0}.ui.segment[class*="top attached"]:first-child{margin-top:0}.ui.segment[class*="bottom attached"]{bottom:0;margin-top:0;top:0;margin-bottom:1rem;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;border-radius:0 0 .28571429rem .28571429rem}.ui.segment[class*="bottom attached"]:last-child{margin-bottom:0}.ui.mini.segment,.ui.mini.segments .segment{font-size:.78571429rem}.ui.tiny.segment,.ui.tiny.segments .segment{font-size:.85714286rem}.ui.small.segment,.ui.small.segments .segment{font-size:.92857143rem}.ui.segment,.ui.segments .segment{font-size:1rem}.ui.large.segment,.ui.large.segments .segment{font-size:1.14285714rem}.ui.big.segment,.ui.big.segments .segment{font-size:1.28571429rem}.ui.huge.segment,.ui.huge.segments .segment{font-size:1.42857143rem}.ui.massive.segment,.ui.massive.segments .segment{font-size:1.71428571rem}.ui.steps{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;margin:1em 0;background:0 0;box-shadow:none;line-height:1.14285714em;border-radius:.28571429rem;border:1px solid rgba(34,36,38,.15)}.ui.steps:first-child{margin-top:0}.ui.steps:last-child{margin-bottom:0}.ui.steps .step{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;vertical-align:middle;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:1.14285714em 2em;background:#FFF;color:rgba(0,0,0,.87);box-shadow:none;border-radius:0;border:none;border-right:1px solid rgba(34,36,38,.15);-webkit-transition:background-color .1s ease,opacity .1s ease,color .1s ease,box-shadow .1s ease;transition:background-color .1s ease,opacity .1s ease,color .1s ease,box-shadow .1s ease}.ui.steps .step:after{position:absolute;z-index:2;content:'';top:50%;right:0;border:solid;background-color:#FFF;width:1.14285714em;height:1.14285714em;border-color:rgba(34,36,38,.15);border-width:0 1px 1px 0;-webkit-transition:background-color .1s ease,opacity .1s ease,color .1s ease,box-shadow .1s ease;transition:background-color .1s ease,opacity .1s ease,color .1s ease,box-shadow .1s ease;-webkit-transform:translateY(-50%) translateX(50%) rotate(-45deg);transform:translateY(-50%) translateX(50%) rotate(-45deg)}.ui.steps .step:first-child{padding-left:2em;border-radius:.28571429rem 0 0 .28571429rem}.ui.steps .step:last-child{border-radius:0 .28571429rem .28571429rem 0;border-right:none;margin-right:0}.ui.steps .step:only-child{border-radius:.28571429rem}.ui.steps .step .title{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1.14285714em;font-weight:700}.ui.steps .step>.title{width:100%}.ui.steps .step .description{font-weight:400;font-size:.92857143em;color:rgba(0,0,0,.87)}.ui.steps .step>.description{width:100%}.ui.steps .step .title~.description{margin-top:.25em}.ui.steps .step>.icon{line-height:1;font-size:2.5em;margin:0 1rem 0 0}.ui.steps .step>.icon,.ui.steps .step>.icon~.content{display:block;-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-self:middle;-ms-flex-item-align:middle;align-self:middle}.ui.steps .step>.icon~.content{-webkit-box-flex:1 0 auto;-webkit-flex-grow:1 0 auto;-ms-flex-positive:1 0 auto;flex-grow:1 0 auto}.ui.steps:not(.vertical) .step>.icon{width:auto}.ui.steps .link.step,.ui.steps a.step{cursor:pointer}.ui.ordered.steps{counter-reset:ordered}.ui.ordered.steps .step:before{display:block;position:static;text-align:center;content:counters(ordered,".");-webkit-align-self:middle;-ms-flex-item-align:middle;align-self:middle;margin-right:1rem;font-size:2.5em;counter-increment:ordered;font-family:inherit;font-weight:700}.ui.ordered.steps .step>*{display:block;-webkit-align-self:middle;-ms-flex-item-align:middle;align-self:middle}.ui.vertical.steps{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;overflow:visible}.ui.vertical.steps .step{-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;border-radius:0;padding:1.14285714em 2em;border-right:none;border-bottom:1px solid rgba(34,36,38,.15)}.ui.vertical.steps .step:first-child{padding:1.14285714em 2em;border-radius:.28571429rem .28571429rem 0 0}.ui.vertical.steps .step:last-child{border-bottom:none;border-radius:0 0 .28571429rem .28571429rem}.ui.vertical.steps .step:only-child{border-radius:.28571429rem}.ui.vertical.steps .step:after{top:50%;right:0;border-width:0 1px 1px 0;display:none}.ui.vertical.steps .active.step:after{display:block}.ui.vertical.steps .step:last-child:after{display:none}.ui.vertical.steps .active.step:last-child:after{display:block}@media only screen and (max-width:767px){.ui.steps{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;overflow:visible;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui.steps .step{width:100%!important;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;border-radius:0;padding:1.14285714em 2em}.ui.steps .step:first-child{padding:1.14285714em 2em;border-radius:.28571429rem .28571429rem 0 0}.ui.steps .step:last-child{border-radius:0 0 .28571429rem .28571429rem}.ui.steps .step:after{display:none!important}.ui.steps .step .content{text-align:center}.ui.ordered.steps .step:before,.ui.steps .step>.icon{margin:0 0 1rem}}.ui.steps .link.step:hover,.ui.steps .link.step:hover::after,.ui.steps a.step:hover,.ui.steps a.step:hover::after{background:#F9FAFB;color:rgba(0,0,0,.8)}.ui.steps .link.step:active,.ui.steps .link.step:active::after,.ui.steps a.step:active,.ui.steps a.step:active::after{background:#F3F4F5;color:rgba(0,0,0,.9)}.ui.steps .step.active{cursor:auto;background:#F3F4F5}.ui.steps .step.active:after{background:#F3F4F5}.ui.steps .step.active .title{color:#4183C4}.ui.ordered.steps .step.active:before,.ui.steps .active.step .icon{color:rgba(0,0,0,.85)}.ui.steps .active.step:after,.ui.steps .step:after{display:block}.ui.steps .active.step:last-child:after,.ui.steps .step:last-child:after{display:none}.ui.steps .link.active.step:hover,.ui.steps .link.active.step:hover::after,.ui.steps a.active.step:hover,.ui.steps a.active.step:hover::after{cursor:pointer;background:#DCDDDE;color:rgba(0,0,0,.87)}.ui.ordered.steps .step.completed:before,.ui.steps .step.completed>.icon:before{color:#21BA45;font-family:Step;content:'\e800'}.ui.steps .disabled.step{cursor:auto;background:#FFF;pointer-events:none}.ui.steps .disabled.step,.ui.steps .disabled.step .description,.ui.steps .disabled.step .title{color:rgba(40,40,40,.3)}.ui.steps .disabled.step:after{background:#FFF}@media only screen and (max-width:991px){.ui[class*="tablet stackable"].steps{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;overflow:visible;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui[class*="tablet stackable"].steps .step{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;border-radius:0;padding:1.14285714em 2em}.ui[class*="tablet stackable"].steps .step:first-child{padding:1.14285714em 2em;border-radius:.28571429rem .28571429rem 0 0}.ui[class*="tablet stackable"].steps .step:last-child{border-radius:0 0 .28571429rem .28571429rem}.ui[class*="tablet stackable"].steps .step:after{display:none!important}.ui[class*="tablet stackable"].steps .step .content{text-align:center}.ui[class*="tablet stackable"].ordered.steps .step:before,.ui[class*="tablet stackable"].steps .step>.icon{margin:0 0 1rem}}.ui.fluid.steps{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%}.ui.attached.steps{width:calc(100% + 2px)!important;margin:0 -1px;max-width:calc(100% + 2px);border-radius:.28571429rem .28571429rem 0 0}.ui.attached.steps .step:first-child{border-radius:.28571429rem 0 0}.ui.attached.steps .step:last-child{border-radius:0 .28571429rem 0 0}.ui.bottom.attached.steps{margin:0 -1px;border-radius:0 0 .28571429rem .28571429rem}.ui.bottom.attached.steps .step:first-child{border-radius:0 0 0 .28571429rem}.ui.bottom.attached.steps .step:last-child{border-radius:0 0 .28571429rem}.ui.eight.steps,.ui.five.steps,.ui.four.steps,.ui.one.steps,.ui.seven.steps,.ui.six.steps,.ui.three.steps,.ui.two.steps{width:100%}.ui.eight.steps>.step,.ui.five.steps>.step,.ui.four.steps>.step,.ui.one.steps>.step,.ui.seven.steps>.step,.ui.six.steps>.step,.ui.three.steps>.step,.ui.two.steps>.step{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.ui.one.steps>.step{width:100%}.ui.two.steps>.step{width:50%}.ui.three.steps>.step{width:33.333%}.ui.four.steps>.step{width:25%}.ui.five.steps>.step{width:20%}.ui.six.steps>.step{width:16.666%}.ui.seven.steps>.step{width:14.285%}.ui.eight.steps>.step{width:12.5%}.ui.mini.step,.ui.mini.steps .step{font-size:.78571429rem}.ui.tiny.step,.ui.tiny.steps .step{font-size:.85714286rem}.ui.small.step,.ui.small.steps .step{font-size:.92857143rem}.ui.step,.ui.steps .step{font-size:1rem}.ui.large.step,.ui.large.steps .step{font-size:1.14285714rem}.ui.big.step,.ui.big.steps .step{font-size:1.28571429rem}.ui.huge.step,.ui.huge.steps .step{font-size:1.42857143rem}.ui.massive.step,.ui.massive.steps .step{font-size:1.71428571rem}@font-face{font-family:Step;src:url(data:application/x-font-ttf;charset=utf-8;;base64,AAEAAAAOAIAAAwBgT1MvMj3hSQEAAADsAAAAVmNtYXDQEhm3AAABRAAAAUpjdnQgBkn/lAAABuwAAAAcZnBnbYoKeDsAAAcIAAAJkWdhc3AAAAAQAAAG5AAAAAhnbHlm32cEdgAAApAAAAC2aGVhZAErPHsAAANIAAAANmhoZWEHUwNNAAADgAAAACRobXR4CykAAAAAA6QAAAAMbG9jYQA4AFsAAAOwAAAACG1heHAApgm8AAADuAAAACBuYW1lzJ0aHAAAA9gAAALNcG9zdK69QJgAAAaoAAAAO3ByZXCSoZr/AAAQnAAAAFYAAQO4AZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6ADoAQNS/2oAWgMLAE8AAAABAAAAAAAAAAAAAwAAAAMAAAAcAAEAAAAAAEQAAwABAAAAHAAEACgAAAAGAAQAAQACAADoAf//AAAAAOgA//8AABgBAAEAAAAAAAAAAAEGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAADpAKYABUAHEAZDwEAAQFCAAIBAmoAAQABagAAAGEUFxQDEisBFAcBBiInASY0PwE2Mh8BATYyHwEWA6QP/iAQLBD+6g8PTBAsEKQBbhAsEEwPAhYWEP4gDw8BFhAsEEwQEKUBbxAQTBAAAAH//f+xA18DCwAMABJADwABAQpDAAAACwBEFRMCESsBFA4BIi4CPgEyHgEDWXLG6MhuBnq89Lp+AV51xHR0xOrEdHTEAAAAAAEAAAABAADDeRpdXw889QALA+gAAAAAzzWYjQAAAADPNWBN//3/sQOkAwsAAAAIAAIAAAAAAAAAAQAAA1L/agBaA+gAAP/3A6QAAQAAAAAAAAAAAAAAAAAAAAMD6AAAA+gAAANZAAAAAAAAADgAWwABAAAAAwAWAAEAAAAAAAIABgATAG4AAAAtCZEAAAAAAAAAEgDeAAEAAAAAAAAANQAAAAEAAAAAAAEACAA1AAEAAAAAAAIABwA9AAEAAAAAAAMACABEAAEAAAAAAAQACABMAAEAAAAAAAUACwBUAAEAAAAAAAYACABfAAEAAAAAAAoAKwBnAAEAAAAAAAsAEwCSAAMAAQQJAAAAagClAAMAAQQJAAEAEAEPAAMAAQQJAAIADgEfAAMAAQQJAAMAEAEtAAMAAQQJAAQAEAE9AAMAAQQJAAUAFgFNAAMAAQQJAAYAEAFjAAMAAQQJAAoAVgFzAAMAAQQJAAsAJgHJQ29weXJpZ2h0IChDKSAyMDE0IGJ5IG9yaWdpbmFsIGF1dGhvcnMgQCBmb250ZWxsby5jb21mb250ZWxsb1JlZ3VsYXJmb250ZWxsb2ZvbnRlbGxvVmVyc2lvbiAxLjBmb250ZWxsb0dlbmVyYXRlZCBieSBzdmcydHRmIGZyb20gRm9udGVsbG8gcHJvamVjdC5odHRwOi8vZm9udGVsbG8uY29tAEMAbwBwAHkAcgBpAGcAaAB0ACAAKABDACkAIAAyADAAMQA0ACAAYgB5ACAAbwByAGkAZwBpAG4AYQBsACAAYQB1AHQAaABvAHIAcwAgAEAAIABmAG8AbgB0AGUAbABsAG8ALgBjAG8AbQBmAG8AbgB0AGUAbABsAG8AUgBlAGcAdQBsAGEAcgBmAG8AbgB0AGUAbABsAG8AZgBvAG4AdABlAGwAbABvAFYAZQByAHMAaQBvAG4AIAAxAC4AMABmAG8AbgB0AGUAbABsAG8ARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAQIBAwljaGVja21hcmsGY2lyY2xlAAAAAAEAAf//AA8AAAAAAAAAAAAAAAAAAAAAADIAMgML/7EDC/+xsAAssCBgZi2wASwgZCCwwFCwBCZasARFW1ghIyEbilggsFBQWCGwQFkbILA4UFghsDhZWSCwCkVhZLAoUFghsApFILAwUFghsDBZGyCwwFBYIGYgiophILAKUFhgGyCwIFBYIbAKYBsgsDZQWCGwNmAbYFlZWRuwACtZWSOwAFBYZVlZLbACLCBFILAEJWFkILAFQ1BYsAUjQrAGI0IbISFZsAFgLbADLCMhIyEgZLEFYkIgsAYjQrIKAAIqISCwBkMgiiCKsAArsTAFJYpRWGBQG2FSWVgjWSEgsEBTWLAAKxshsEBZI7AAUFhlWS2wBCywB0MrsgACAENgQi2wBSywByNCIyCwACNCYbCAYrABYLAEKi2wBiwgIEUgsAJFY7ABRWJgRLABYC2wBywgIEUgsAArI7ECBCVgIEWKI2EgZCCwIFBYIbAAG7AwUFiwIBuwQFlZI7AAUFhlWbADJSNhRESwAWAtsAgssQUFRbABYUQtsAkssAFgICCwCUNKsABQWCCwCSNCWbAKQ0qwAFJYILAKI0JZLbAKLCC4BABiILgEAGOKI2GwC0NgIIpgILALI0IjLbALLEtUWLEHAURZJLANZSN4LbAMLEtRWEtTWLEHAURZGyFZJLATZSN4LbANLLEADENVWLEMDEOwAWFCsAorWbAAQ7ACJUKxCQIlQrEKAiVCsAEWIyCwAyVQWLEBAENgsAQlQoqKIIojYbAJKiEjsAFhIIojYbAJKiEbsQEAQ2CwAiVCsAIlYbAJKiFZsAlDR7AKQ0dgsIBiILACRWOwAUViYLEAABMjRLABQ7AAPrIBAQFDYEItsA4ssQAFRVRYALAMI0IgYLABYbUNDQEACwBCQopgsQ0FK7BtKxsiWS2wDyyxAA4rLbAQLLEBDistsBEssQIOKy2wEiyxAw4rLbATLLEEDistsBQssQUOKy2wFSyxBg4rLbAWLLEHDistsBcssQgOKy2wGCyxCQ4rLbAZLLAIK7EABUVUWACwDCNCIGCwAWG1DQ0BAAsAQkKKYLENBSuwbSsbIlktsBossQAZKy2wGyyxARkrLbAcLLECGSstsB0ssQMZKy2wHiyxBBkrLbAfLLEFGSstsCAssQYZKy2wISyxBxkrLbAiLLEIGSstsCMssQkZKy2wJCwgPLABYC2wJSwgYLANYCBDI7ABYEOwAiVhsAFgsCQqIS2wJiywJSuwJSotsCcsICBHICCwAkVjsAFFYmAjYTgjIIpVWCBHICCwAkVjsAFFYmAjYTgbIVktsCgssQAFRVRYALABFrAnKrABFTAbIlktsCkssAgrsQAFRVRYALABFrAnKrABFTAbIlktsCosIDWwAWAtsCssALADRWOwAUVisAArsAJFY7ABRWKwACuwABa0AAAAAABEPiM4sSoBFSotsCwsIDwgRyCwAkVjsAFFYmCwAENhOC2wLSwuFzwtsC4sIDwgRyCwAkVjsAFFYmCwAENhsAFDYzgtsC8ssQIAFiUgLiBHsAAjQrACJUmKikcjRyNhIFhiGyFZsAEjQrIuAQEVFCotsDAssAAWsAQlsAQlRyNHI2GwBkUrZYouIyAgPIo4LbAxLLAAFrAEJbAEJSAuRyNHI2EgsAQjQrAGRSsgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjILAIQyCKI0cjRyNhI0ZgsARDsIBiYCCwACsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsIBiYSMgILAEJiNGYTgbI7AIQ0awAiWwCENHI0cjYWAgsARDsIBiYCMgsAArI7AEQ2CwACuwBSVhsAUlsIBisAQmYSCwBCVgZCOwAyVgZFBYIRsjIVkjICCwBCYjRmE4WS2wMiywABYgICCwBSYgLkcjRyNhIzw4LbAzLLAAFiCwCCNCICAgRiNHsAArI2E4LbA0LLAAFrADJbACJUcjRyNhsABUWC4gPCMhG7ACJbACJUcjRyNhILAFJbAEJUcjRyNhsAYlsAUlSbACJWGwAUVjIyBYYhshWWOwAUViYCMuIyAgPIo4IyFZLbA1LLAAFiCwCEMgLkcjRyNhIGCwIGBmsIBiIyAgPIo4LbA2LCMgLkawAiVGUlggPFkusSYBFCstsDcsIyAuRrACJUZQWCA8WS6xJgEUKy2wOCwjIC5GsAIlRlJYIDxZIyAuRrACJUZQWCA8WS6xJgEUKy2wOSywMCsjIC5GsAIlRlJYIDxZLrEmARQrLbA6LLAxK4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrEmARQrsARDLrAmKy2wOyywABawBCWwBCYgLkcjRyNhsAZFKyMgPCAuIzixJgEUKy2wPCyxCAQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAGRSsgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwgGJgILAAKyCKimEgsAJDYGQjsANDYWRQWLACQ2EbsANDYFmwAyWwgGJhsAIlRmE4IyA8IzgbISAgRiNHsAArI2E4IVmxJgEUKy2wPSywMCsusSYBFCstsD4ssDErISMgIDywBCNCIzixJgEUK7AEQy6wJistsD8ssAAVIEewACNCsgABARUUEy6wLCotsEAssAAVIEewACNCsgABARUUEy6wLCotsEEssQABFBOwLSotsEIssC8qLbBDLLAAFkUjIC4gRoojYTixJgEUKy2wRCywCCNCsEMrLbBFLLIAADwrLbBGLLIAATwrLbBHLLIBADwrLbBILLIBATwrLbBJLLIAAD0rLbBKLLIAAT0rLbBLLLIBAD0rLbBMLLIBAT0rLbBNLLIAADkrLbBOLLIAATkrLbBPLLIBADkrLbBQLLIBATkrLbBRLLIAADsrLbBSLLIAATsrLbBTLLIBADsrLbBULLIBATsrLbBVLLIAAD4rLbBWLLIAAT4rLbBXLLIBAD4rLbBYLLIBAT4rLbBZLLIAADorLbBaLLIAATorLbBbLLIBADorLbBcLLIBATorLbBdLLAyKy6xJgEUKy2wXiywMiuwNistsF8ssDIrsDcrLbBgLLAAFrAyK7A4Ky2wYSywMysusSYBFCstsGIssDMrsDYrLbBjLLAzK7A3Ky2wZCywMyuwOCstsGUssDQrLrEmARQrLbBmLLA0K7A2Ky2wZyywNCuwNystsGgssDQrsDgrLbBpLLA1Ky6xJgEUKy2waiywNSuwNistsGsssDUrsDcrLbBsLLA1K7A4Ky2wbSwrsAhlsAMkUHiwARUwLQAAAEu4AMhSWLEBAY5ZuQgACABjILABI0SwAyNwsgQoCUVSRLIKAgcqsQYBRLEkAYhRWLBAiFixBgNEsSYBiFFYuAQAiFixBgFEWVlZWbgB/4WwBI2xBQBEAAA=) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAoUAA4AAAAAEPQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEQAAABWPeFJAWNtYXAAAAGIAAAAOgAAAUrQEhm3Y3Z0IAAAAcQAAAAUAAAAHAZJ/5RmcGdtAAAB2AAABPkAAAmRigp4O2dhc3AAAAbUAAAACAAAAAgAAAAQZ2x5ZgAABtwAAACuAAAAtt9nBHZoZWFkAAAHjAAAADUAAAA2ASs8e2hoZWEAAAfEAAAAIAAAACQHUwNNaG10eAAAB+QAAAAMAAAADAspAABsb2NhAAAH8AAAAAgAAAAIADgAW21heHAAAAf4AAAAIAAAACAApgm8bmFtZQAACBgAAAF3AAACzcydGhxwb3N0AAAJkAAAACoAAAA7rr1AmHByZXAAAAm8AAAAVgAAAFaSoZr/eJxjYGTewTiBgZWBg6mKaQ8DA0MPhGZ8wGDIyMTAwMTAysyAFQSkuaYwOLxgeMHIHPQ/iyGKmZvBHyjMCJIDAPe9C2B4nGNgYGBmgGAZBkYGEHAB8hjBfBYGDSDNBqQZGZgYGF4w/v8PUvCCAURLMELVAwEjG8OIBwBk5AavAAB4nGNgQANGDEbM3P83gjAAELQD4XicnVXZdtNWFJU8ZHASOmSgoA7X3DhQ68qEKRgwaSrFdiEdHAitBB2kDHTkncc+62uOQrtWH/m07n09JLR0rbYsls++R1tn2DrnRhwjKn0aiGvUoZKXA6msPZZK90lc13Uvj5UMBnFdthJPSZuonSRKat3sUC7xWOsqWSdYJ+PlIFZPVZ5noAziFB5lSUQbRBuplyZJ4onjJ4kWZxAfJUkgJaMQp9LIUEI1GsRS1aFM6dCr1xNx00DKRqMedVhU90PFJ8c1p9SsA0YqVznCFevVRr4bpwMve5DEOsGzrYcxHnisfpQqkIqR6cg/dkpOlIaBVHHUoVbi6DCTX/eRTCrNQKaMYkWl7oG43f102xYxPXQ6vi5KlUaqurnOKJrt0fGogygP2cbppNzQ2fbw5RlTVKtdcbPtQGYNXErJbHSfRAAdJlLj6QFONZwCqRn1R8XZ588BEslclKo8VTKHegOZMzt7cTHtbiersnCknwcyb3Z2452HQ6dXh3/R+hdM4cxHj+Jifj5C+lBqfiJOJKVGWMzyp4YfcVcgQrkxiAsXyuBThDl0RdrZZl3jtTH2hs/5SqlhPQna6KP4fgr9TiQrHGdRo/VInM1j13Wt3GdQS7W7Fzsyr0OVIu7vCwuuM+eEYZ4WC1VfnvneBTT/Bohn/EDeNIVL+5YpSrRvm6JMu2iKCu0SVKVdNsUU7YoppmnPmmKG9h1TzNKeMzLj/8vc55H7HN7xkJv2XeSmfQ+5ad9HbtoPkJtWITdtHblpLyA3rUZu2lWjOnYEGgZpF1IVQdA0svph3Fab9UDWjDR8aWDyLmLI+upER521tcofxX914gsHcmmip7siF5viLq/bFj483e6rj5pG3bDV+MaR8jAeRnocmtBZ+c3hv+1N3S6a7jKqMugBFUwKwABl7UAC0zrbCaT1mqf48gdgXIZ4zkpDtVSfO4am7+V5X/exOfG+x+3GLrdcd3kJWdYNcmP28N9SZKrrH+UtrVQnR6wrJ49VaxhDKrwour6SlHu0tRu/KKmy8l6U1srnk5CbPYMbQlu27mGwI0xpyiUeXlOlKD3UUo6yQyxvKco84JSLC1qGxLgOdQ9qa8TpoXoYGwshhqG0vRBwSCldFd+0ynfxHqtr2Oj4xRXh6XpyEhGf4ir7UfBU10b96A7avGbdMoMpVaqn+4xPsa/b9lFZaaSOsxe3VAfXNOsaORXTT+Rr4HRvOGjdAz1UfDRBI1U1x+jGKGM0ljXl3wR0MVZ+w2jVYvs93E+dpFWsuUuY7JsT9+C0u/0q+7WcW0bW/dcGvW3kip8jMb8tCvw7B2K3ZA3UO5OBGAvIWdAYxhYmdxiug23EbfY/Jqf/34aFRXJXOxq7eerD1ZNRJXfZ8rjLTXZZ16M2R9VOGvsIjS0PN+bY4XIstsRgQbb+wf8x7gF3aVEC4NDIZZiI2nShnurh6h6rsW04VxIBds2x43QAegAuQd8cu9bzCYD13CPnLsB9cgh2yCH4lByCz8i5BfA5OQRfkEMwIIdgl5w7AA/IIXhIDsEeOQSPyNkE+JIcgq/IIYjJIUjIuQ3wmByCJ+QQfE0OwTdGrk5k/pYH2QD6zqKbQKmdGhzaOGRGrk3Y+zxY9oFFZB9aROqRkesT6lMeLPV7i0j9wSJSfzRyY0L9iQdL/dkiUn+xiNRnxpeZIymvDp7zjg7+BJfqrV4AAAAAAQAB//8AD3icY2BkAALmJUwzGEQZZBwk+RkZGBmdGJgYmbIYgMwsoGSiiLgIs5A2owg7I5uSOqOaiT2jmZE8I5gQY17C/09BQEfg3yt+fh8gvYQxD0j68DOJiQn8U+DnZxQDcQUEljLmCwBpBgbG/3//b2SOZ+Zm4GEQcuAH2sblDLSEm8FFVJhJEGgLH6OSHpMdo5EcI3Nk0bEXJ/LYqvZ82VXHGFd6pKTkyCsQwQAAq+QkqAAAeJxjYGRgYADiw5VSsfH8Nl8ZuJlfAEUYzpvO6IXQCb7///7fyLyEmRvI5WBgAokCAFb/DJAAAAB4nGNgZGBgDvqfxRDF/IKB4f935iUMQBEUwAwAi5YFpgPoAAAD6AAAA1kAAAAAAAAAOABbAAEAAAADABYAAQAAAAAAAgAGABMAbgAAAC0JkQAAAAB4nHWQy2rCQBSG//HSi0JbWui2sypKabxgN4IgWHTTbqS4LTHGJBIzMhkFX6Pv0IfpS/RZ+puMpShNmMx3vjlz5mQAXOMbAvnzxJGzwBmjnAs4Rc9ykf7Zcon8YrmMKt4sn9C/W67gAYHlKm7wwQqidM5ogU/LAlfi0nIBF+LOcpH+0XKJ3LNcxq14tXxC71muYCJSy1Xci6+BWm11FIRG1gZ12W62OnK6lYoqStxYumsTKp3KvpyrxPhxrBxPLfc89oN17Op9uJ8nvk4jlciW09yrkZ/42jX+bFc93QRtY+ZyrtVSDm2GXGm18D3jhMasuo3G3/MwgMIKW2hEvKoQBhI12jrnNppooUOaMkMyM8+KkMBFTONizR1htpIy7nPMGSW0PjNisgOP3+WRH5MC7o9ZRR+tHsYT0u6MKPOSfTns7jBrREqyTDezs9/eU2x4WpvWcNeuS511JTE8qCF5H7u1BY1H72S3Ymi7aPD95/9+AN1fhEsAeJxjYGKAAC4G7ICZgYGRiZGZMzkjNTk7N7Eomy05syg5J5WBAQBE1QZBAABLuADIUlixAQGOWbkIAAgAYyCwASNEsAMjcLIEKAlFUkSyCgIHKrEGAUSxJAGIUViwQIhYsQYDRLEmAYhRWLgEAIhYsQYBRFlZWVm4Af+FsASNsQUARAAA) format('woff')}.ui.breadcrumb{line-height:1;display:inline-block;margin:0;vertical-align:middle}.ui.breadcrumb:first-child{margin-top:0}.ui.breadcrumb:last-child{margin-bottom:0}.ui.breadcrumb .divider{display:inline-block;opacity:.7;margin:0 .21428571rem;font-size:.92857143em;color:rgba(0,0,0,.4);vertical-align:baseline}.ui.breadcrumb a{color:#4183C4}.ui.breadcrumb a:hover{color:#1e70bf}.ui.breadcrumb .icon.divider{font-size:.85714286em;vertical-align:baseline}.ui.breadcrumb a.section{cursor:pointer}.ui.breadcrumb .section{display:inline-block;margin:0;padding:0}.ui.breadcrumb.segment{display:inline-block;padding:.78571429em 1em}.ui.breadcrumb .active.section{font-weight:700}.ui.mini.breadcrumb{font-size:.78571429rem}.ui.tiny.breadcrumb{font-size:.85714286rem}.ui.small.breadcrumb{font-size:.92857143rem}.ui.breadcrumb{font-size:1rem}.ui.large.breadcrumb{font-size:1.14285714rem}.ui.big.breadcrumb{font-size:1.28571429rem}.ui.huge.breadcrumb{font-size:1.42857143rem}.ui.massive.breadcrumb{font-size:1.71428571rem}.ui.form{position:relative;max-width:100%}.ui.form>p{margin:1em 0}.ui.form .field{clear:both;margin:0 0 1em}.ui.form .field:last-child,.ui.form .fields:last-child .field{margin-bottom:0}.ui.form .fields .field{clear:both;margin:0}.ui.form .field>label{display:block;margin:0 0 .28571429rem;color:rgba(0,0,0,.87);font-size:.92857143em;font-weight:700;text-transform:none}.ui.form input:not([type]),.ui.form input[type=text],.ui.form input[type=email],.ui.form input[type=search],.ui.form input[type=password],.ui.form input[type=date],.ui.form input[type=datetime-local],.ui.form input[type=tel],.ui.form input[type=time],.ui.form input[type=url],.ui.form input[type=number],.ui.form textarea{width:100%;vertical-align:top}.ui.form ::-webkit-datetime-edit,.ui.form ::-webkit-inner-spin-button{height:1.2142em}.ui.form input:not([type]),.ui.form input[type=text],.ui.form input[type=email],.ui.form input[type=search],.ui.form input[type=password],.ui.form input[type=date],.ui.form input[type=datetime-local],.ui.form input[type=tel],.ui.form input[type=time],.ui.form input[type=url],.ui.form input[type=number]{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;margin:0;outline:0;-webkit-appearance:none;tap-highlight-color:rgba(255,255,255,0);line-height:1.2142em;padding:.67861429em 1em;font-size:1em;background:#FFF;border:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87);border-radius:.28571429rem;box-shadow:0 0 0 0 transparent inset;-webkit-transition:color .1s ease,border-color .1s ease;transition:color .1s ease,border-color .1s ease}.ui.form textarea{margin:0;-webkit-appearance:none;tap-highlight-color:rgba(255,255,255,0);padding:.78571429em 1em;background:#FFF;border:1px solid rgba(34,36,38,.15);outline:0;color:rgba(0,0,0,.87);border-radius:.28571429rem;box-shadow:0 0 0 0 transparent inset;-webkit-transition:color .1s ease,border-color .1s ease;transition:color .1s ease,border-color .1s ease;font-size:1em;line-height:1.2857;resize:vertical}.ui.form textarea:not([rows]){height:12em;min-height:8em;max-height:24em}.ui.form input[type=checkbox],.ui.form textarea{vertical-align:top}.ui.form input.attached{width:auto}.ui.form select{display:block;height:auto;width:100%;background:#FFF;border:1px solid rgba(34,36,38,.15);border-radius:.28571429rem;box-shadow:0 0 0 0 transparent inset;padding:.62em 1em;color:rgba(0,0,0,.87);-webkit-transition:color .1s ease,border-color .1s ease;transition:color .1s ease,border-color .1s ease}.ui.form .field>.selection.dropdown{width:100%}.ui.form .field>.selection.dropdown>.dropdown.icon{float:right}.ui.form .inline.field>.selection.dropdown,.ui.form .inline.fields .field>.selection.dropdown{width:auto}.ui.form .inline.field>.selection.dropdown>.dropdown.icon,.ui.form .inline.fields .field>.selection.dropdown>.dropdown.icon{float:none}.ui.form .field .ui.input,.ui.form .fields .field .ui.input,.ui.form .wide.field .ui.input{width:100%}.ui.form .inline.field:not(.wide) .ui.input,.ui.form .inline.fields .field:not(.wide) .ui.input{width:auto;vertical-align:middle}.ui.form .field .ui.input input,.ui.form .fields .field .ui.input input{width:auto}.ui.form .eight.fields .ui.input input,.ui.form .five.fields .ui.input input,.ui.form .four.fields .ui.input input,.ui.form .nine.fields .ui.input input,.ui.form .seven.fields .ui.input input,.ui.form .six.fields .ui.input input,.ui.form .ten.fields .ui.input input,.ui.form .three.fields .ui.input input,.ui.form .two.fields .ui.input input,.ui.form .wide.field .ui.input input{-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;width:0}.ui.form .error.message,.ui.form .success.message,.ui.form .warning.message{display:none}.ui.form .message:first-child{margin-top:0}.ui.form .field .prompt.label{white-space:normal;background:#FFF!important;border:1px solid #E0B4B4!important;color:#9F3A38!important}.ui.form .inline.field .prompt,.ui.form .inline.fields .field .prompt{vertical-align:top;margin:-.25em 0 -.5em .5em}.ui.form .inline.field .prompt:before,.ui.form .inline.fields .field .prompt:before{border-width:0 0 1px 1px;bottom:auto;right:auto;top:50%;left:0}.ui.form .field.field input:-webkit-autofill{box-shadow:0 0 0 100px ivory inset!important;border-color:#E5DFA1!important}.ui.form .field.field input:-webkit-autofill:focus{box-shadow:0 0 0 100px ivory inset!important;border-color:#D5C315!important}.ui.form .error.error input:-webkit-autofill{box-shadow:0 0 0 100px #FFFAF0 inset!important;border-color:#E0B4B4!important}.ui.form ::-webkit-input-placeholder{color:rgba(191,191,191,.87)}.ui.form :-ms-input-placeholder{color:rgba(191,191,191,.87)}.ui.form ::-moz-placeholder{color:rgba(191,191,191,.87)}.ui.form :focus::-webkit-input-placeholder{color:rgba(115,115,115,.87)}.ui.form :focus:-ms-input-placeholder{color:rgba(115,115,115,.87)}.ui.form :focus::-moz-placeholder{color:rgba(115,115,115,.87)}.ui.form .error ::-webkit-input-placeholder{color:#e7bdbc}.ui.form .error :-ms-input-placeholder{color:#e7bdbc!important}.ui.form .error ::-moz-placeholder{color:#e7bdbc}.ui.form .error :focus::-webkit-input-placeholder{color:#da9796}.ui.form .error :focus:-ms-input-placeholder{color:#da9796!important}.ui.form .error :focus::-moz-placeholder{color:#da9796}.ui.form input:not([type]):focus,.ui.form input[type=text]:focus,.ui.form input[type=email]:focus,.ui.form input[type=search]:focus,.ui.form input[type=password]:focus,.ui.form input[type=date]:focus,.ui.form input[type=datetime-local]:focus,.ui.form input[type=tel]:focus,.ui.form input[type=time]:focus,.ui.form input[type=url]:focus,.ui.form input[type=number]:focus{color:rgba(0,0,0,.95);border-color:#85B7D9;border-radius:.28571429rem;background:#FFF;box-shadow:0 0 0 0 rgba(34,36,38,.35) inset}.ui.form textarea:focus{color:rgba(0,0,0,.95);border-color:#85B7D9;border-radius:.28571429rem;background:#FFF;box-shadow:0 0 0 0 rgba(34,36,38,.35) inset;-webkit-appearance:none}.ui.form.success .success.message:not(:empty){display:block}.ui.form.success .compact.success.message:not(:empty){display:inline-block}.ui.form.success .icon.success.message:not(:empty){display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ui.form.warning .warning.message:not(:empty){display:block}.ui.form.warning .compact.warning.message:not(:empty){display:inline-block}.ui.form.warning .icon.warning.message:not(:empty){display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ui.form.error .error.message:not(:empty){display:block}.ui.form.error .compact.error.message:not(:empty){display:inline-block}.ui.form.error .icon.error.message:not(:empty){display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ui.form .field.error .input,.ui.form .field.error label,.ui.form .fields.error .field .input,.ui.form .fields.error .field label{color:#9F3A38}.ui.form .field.error .corner.label,.ui.form .fields.error .field .corner.label{border-color:#9F3A38;color:#FFF}.ui.form .field.error input:not([type]),.ui.form .field.error input[type=text],.ui.form .field.error input[type=email],.ui.form .field.error input[type=search],.ui.form .field.error input[type=password],.ui.form .field.error input[type=date],.ui.form .field.error input[type=datetime-local],.ui.form .field.error input[type=tel],.ui.form .field.error input[type=time],.ui.form .field.error input[type=url],.ui.form .field.error input[type=number],.ui.form .field.error select,.ui.form .field.error textarea,.ui.form .fields.error .field input:not([type]),.ui.form .fields.error .field input[type=text],.ui.form .fields.error .field input[type=email],.ui.form .fields.error .field input[type=search],.ui.form .fields.error .field input[type=password],.ui.form .fields.error .field input[type=date],.ui.form .fields.error .field input[type=datetime-local],.ui.form .fields.error .field input[type=tel],.ui.form .fields.error .field input[type=time],.ui.form .fields.error .field input[type=url],.ui.form .fields.error .field input[type=number],.ui.form .fields.error .field select,.ui.form .fields.error .field textarea{background:#FFF6F6;border-color:#E0B4B4;color:#9F3A38;border-radius:'';box-shadow:none}.ui.form .field.error input:not([type]):focus,.ui.form .field.error input[type=text]:focus,.ui.form .field.error input[type=email]:focus,.ui.form .field.error input[type=search]:focus,.ui.form .field.error input[type=password]:focus,.ui.form .field.error input[type=date]:focus,.ui.form .field.error input[type=datetime-local]:focus,.ui.form .field.error input[type=tel]:focus,.ui.form .field.error input[type=time]:focus,.ui.form .field.error input[type=url]:focus,.ui.form .field.error input[type=number]:focus,.ui.form .field.error select:focus,.ui.form .field.error textarea:focus{background:#FFF6F6;border-color:#E0B4B4;color:#9F3A38;-webkit-appearance:none;box-shadow:none}.ui.form .field.error select{-webkit-appearance:menulist-button}.ui.form .field.error .ui.dropdown,.ui.form .field.error .ui.dropdown .item,.ui.form .field.error .ui.dropdown .text,.ui.form .fields.error .field .ui.dropdown,.ui.form .fields.error .field .ui.dropdown .item{background:#FFF6F6;color:#9F3A38}.ui.form .field.error .ui.dropdown,.ui.form .field.error .ui.dropdown:hover,.ui.form .fields.error .field .ui.dropdown,.ui.form .fields.error .field .ui.dropdown:hover{border-color:#E0B4B4!important}.ui.form .field.error .ui.dropdown:hover .menu,.ui.form .fields.error .field .ui.dropdown:hover .menu{border-color:#E0B4B4}.ui.form .field.error .ui.multiple.selection.dropdown>.label,.ui.form .fields.error .field .ui.multiple.selection.dropdown>.label{background-color:#EACBCB;color:#9F3A38}.ui.form .field.error .ui.dropdown .menu .item:hover,.ui.form .field.error .ui.dropdown .menu .selected.item,.ui.form .fields.error .field .ui.dropdown .menu .item:hover,.ui.form .fields.error .field .ui.dropdown .menu .selected.item{background-color:#FBE7E7}.ui.form .field.error .ui.dropdown .menu .active.item,.ui.form .fields.error .field .ui.dropdown .menu .active.item{background-color:#FDCFCF!important}.ui.form .field.error .checkbox:not(.toggle):not(.slider) .box,.ui.form .field.error .checkbox:not(.toggle):not(.slider) label,.ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) .box,.ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) label{color:#9F3A38}.ui.form .field.error .checkbox:not(.toggle):not(.slider) .box:before,.ui.form .field.error .checkbox:not(.toggle):not(.slider) label:before,.ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) .box:before,.ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) label:before{background:#FFF6F6;border-color:#E0B4B4}.ui.form .field.error .checkbox .box:after,.ui.form .field.error .checkbox label:after,.ui.form .fields.error .field .checkbox .box:after,.ui.form .fields.error .field .checkbox label:after{color:#9F3A38}.ui.form .disabled.field,.ui.form .disabled.fields .field,.ui.form .field :disabled{pointer-events:none;opacity:.45}.ui.form .field.disabled label{opacity:.45}.ui.form .field.disabled :disabled{opacity:1}.ui.loading.form{position:relative;cursor:default;point-events:none}.ui.loading.form:before{position:absolute;content:'';top:0;left:0;background:rgba(255,255,255,.8);width:100%;height:100%;z-index:100}.ui.loading.form:after{position:absolute;content:'';top:50%;left:50%;margin:-1.5em 0 0 -1.5em;width:3em;height:3em;-webkit-animation:form-spin .6s linear;animation:form-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 rgba(0,0,0,.1) rgba(0,0,0,.1);border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent;visibility:visible;z-index:101}@-webkit-keyframes form-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes form-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.form .required.field>.checkbox:after,.ui.form .required.field>label:after,.ui.form .required.fields.grouped>label:after,.ui.form .required.fields:not(.grouped)>.field>.checkbox:after,.ui.form .required.fields:not(.grouped)>.field>label:after{margin:-.2em 0 0 .2em;content:'*';color:#DB2828}.ui.form .required.field>label:after,.ui.form .required.fields.grouped>label:after,.ui.form .required.fields:not(.grouped)>.field>label:after{display:inline-block;vertical-align:top}.ui.form .required.field>.checkbox:after,.ui.form .required.fields:not(.grouped)>.field>.checkbox:after{position:absolute;top:0;left:100%}.ui.form .inverted.segment .ui.checkbox .box,.ui.form .inverted.segment .ui.checkbox label,.ui.form .inverted.segment label,.ui.inverted.form .inline.field>label,.ui.inverted.form .inline.field>p,.ui.inverted.form .inline.fields .field>label,.ui.inverted.form .inline.fields .field>p,.ui.inverted.form .inline.fields>label,.ui.inverted.form .ui.checkbox .box,.ui.inverted.form .ui.checkbox label,.ui.inverted.form label{color:rgba(255,255,255,.9)}.ui.inverted.form input:not([type]),.ui.inverted.form input[type=text],.ui.inverted.form input[type=email],.ui.inverted.form input[type=search],.ui.inverted.form input[type=password],.ui.inverted.form input[type=date],.ui.inverted.form input[type=datetime-local],.ui.inverted.form input[type=tel],.ui.inverted.form input[type=time],.ui.inverted.form input[type=url],.ui.inverted.form input[type=number]{background:#FFF;border-color:rgba(255,255,255,.1);color:rgba(0,0,0,.87);box-shadow:none}.ui.form .grouped.fields{display:block;margin:0 0 1em}.ui.form .grouped.fields:last-child{margin-bottom:0}.ui.form .grouped.fields>label{margin:0 0 .28571429rem;color:rgba(0,0,0,.87);font-size:.92857143em;font-weight:700;text-transform:none}.ui.form .grouped.fields .field,.ui.form .grouped.inline.fields .field{display:block;margin:.5em 0;padding:0}.ui.form .fields{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin:0 -.5em 1em}.ui.form .fields>.field{-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;padding-left:.5em;padding-right:.5em}.ui.form .fields>.field:first-child{border-left:none;box-shadow:none}.ui.form .two.fields>.field,.ui.form .two.fields>.fields{width:50%}.ui.form .three.fields>.field,.ui.form .three.fields>.fields{width:33.33333333%}.ui.form .four.fields>.field,.ui.form .four.fields>.fields{width:25%}.ui.form .five.fields>.field,.ui.form .five.fields>.fields{width:20%}.ui.form .six.fields>.field,.ui.form .six.fields>.fields{width:16.66666667%}.ui.form .seven.fields>.field,.ui.form .seven.fields>.fields{width:14.28571429%}.ui.form .eight.fields>.field,.ui.form .eight.fields>.fields{width:12.5%}.ui.form .nine.fields>.field,.ui.form .nine.fields>.fields{width:11.11111111%}.ui.form .ten.fields>.field,.ui.form .ten.fields>.fields{width:10%}@media only screen and (max-width:767px){.ui.form .fields{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ui.form .eight.fields>.field,.ui.form .eight.fields>.fields,.ui.form .five.fields>.field,.ui.form .five.fields>.fields,.ui.form .four.fields>.field,.ui.form .four.fields>.fields,.ui.form .nine.fields>.field,.ui.form .nine.fields>.fields,.ui.form .seven.fields>.field,.ui.form .seven.fields>.fields,.ui.form .six.fields>.field,.ui.form .six.fields>.fields,.ui.form .ten.fields>.field,.ui.form .ten.fields>.fields,.ui.form .three.fields>.field,.ui.form .three.fields>.fields,.ui.form .two.fields>.field,.ui.form .two.fields>.fields,.ui.form [class*="equal width"].fields>.field,.ui[class*="equal width"].form .fields>.field{width:100%!important;margin:0 0 1em}}.ui.form .fields .wide.field{width:6.25%;padding-left:.5em;padding-right:.5em}.ui.form .one.wide.field{width:6.25%!important}.ui.form .two.wide.field{width:12.5%!important}.ui.form .three.wide.field{width:18.75%!important}.ui.form .four.wide.field{width:25%!important}.ui.form .five.wide.field{width:31.25%!important}.ui.form .six.wide.field{width:37.5%!important}.ui.form .seven.wide.field{width:43.75%!important}.ui.form .eight.wide.field{width:50%!important}.ui.form .nine.wide.field{width:56.25%!important}.ui.form .ten.wide.field{width:62.5%!important}.ui.form .eleven.wide.field{width:68.75%!important}.ui.form .twelve.wide.field{width:75%!important}.ui.form .thirteen.wide.field{width:81.25%!important}.ui.form .fourteen.wide.field{width:87.5%!important}.ui.form .fifteen.wide.field{width:93.75%!important}.ui.form .sixteen.wide.field{width:100%!important}@media only screen and (max-width:767px){.ui.form .fields>.eight.wide.field,.ui.form .fields>.eleven.wide.field,.ui.form .fields>.fifteen.wide.field,.ui.form .fields>.five.wide.field,.ui.form .fields>.four.wide.field,.ui.form .fields>.fourteen.wide.field,.ui.form .fields>.nine.wide.field,.ui.form .fields>.seven.wide.field,.ui.form .fields>.six.wide.field,.ui.form .fields>.sixteen.wide.field,.ui.form .fields>.ten.wide.field,.ui.form .fields>.thirteen.wide.field,.ui.form .fields>.three.wide.field,.ui.form .fields>.twelve.wide.field,.ui.form .fields>.two.wide.field,.ui.form .five.fields>.field,.ui.form .five.fields>.fields,.ui.form .four.fields>.field,.ui.form .four.fields>.fields,.ui.form .three.fields>.field,.ui.form .three.fields>.fields,.ui.form .two.fields>.field,.ui.form .two.fields>.fields{width:100%!important}.ui.form .fields{margin-bottom:0}}.ui.form [class*="equal width"].fields>.field,.ui[class*="equal width"].form .fields>.field{width:100%;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.ui.form .inline.fields{margin:0 0 1em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center}.ui.form .inline.fields .field{margin:0;padding:0 1em 0 0}.ui.form .inline.field>label,.ui.form .inline.field>p,.ui.form .inline.fields .field>label,.ui.form .inline.fields .field>p,.ui.form .inline.fields>label{display:inline-block;width:auto;margin-top:0;margin-bottom:0;vertical-align:baseline;font-size:.92857143em;font-weight:700;color:rgba(0,0,0,.87);text-transform:none}.ui.form .inline.fields>label{margin:.035714em 1em 0 0}.ui.form .inline.field>input,.ui.form .inline.field>select,.ui.form .inline.fields .field>input,.ui.form .inline.fields .field>select{display:inline-block;width:auto;margin-top:0;margin-bottom:0;vertical-align:middle;font-size:1em}.ui.form .inline.field>:first-child,.ui.form .inline.fields .field>:first-child{margin:0 .85714286em 0 0}.ui.form .inline.field>:only-child,.ui.form .inline.fields .field>:only-child{margin:0}.ui.form .inline.fields .wide.field{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.ui.form .inline.fields .wide.field>input,.ui.form .inline.fields .wide.field>select{width:100%}.ui.mini.form{font-size:.78571429rem}.ui.tiny.form{font-size:.85714286rem}.ui.small.form{font-size:.92857143rem}.ui.form{font-size:1rem}.ui.large.form{font-size:1.14285714rem}.ui.big.form{font-size:1.28571429rem}.ui.huge.form{font-size:1.42857143rem}.ui.massive.form{font-size:1.71428571rem}.ui.grid{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;padding:0;margin:-1rem}.ui.relaxed.grid{margin-left:-1.5rem;margin-right:-1.5rem}.ui[class*="very relaxed"].grid{margin-left:-2.5rem;margin-right:-2.5rem}.ui.grid+.grid{margin-top:1rem}.ui.grid>.column:not(.row),.ui.grid>.row>.column{position:relative;display:inline-block;width:6.25%;padding-left:1rem;padding-right:1rem;vertical-align:top}.ui.grid>*{padding-left:1rem;padding-right:1rem}.ui.grid>.row{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:inherit;-webkit-justify-content:inherit;-ms-flex-pack:inherit;justify-content:inherit;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%!important;padding:1rem 0}.ui.grid>.column:not(.row){padding-top:1rem;padding-bottom:1rem}.ui.grid>.row>.column{margin-top:0;margin-bottom:0}.ui.grid>.row>.column>img,.ui.grid>.row>img{max-width:100%}.ui.grid>.ui.grid:first-child{margin-top:0}.ui.grid>.ui.grid:last-child{margin-bottom:0}.ui.aligned.grid .column>.segment:not(.compact):not(.attached),.ui.grid .aligned.row>.column>.segment:not(.compact):not(.attached){width:100%}.ui.grid .row+.ui.divider{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;margin:1rem}.ui.grid .column+.ui.vertical.divider{height:calc(50% - 1rem)}.ui.grid>.column:last-child>.horizontal.segment,.ui.grid>.row>.column:last-child>.horizontal.segment{box-shadow:none}@media only screen and (max-width:767px){.ui.page.grid{width:auto;padding-left:0;padding-right:0;margin-left:0;margin-right:0}}@media only screen and (min-width:768px) and (max-width:991px){.ui.page.grid{width:auto;margin-left:0;margin-right:0;padding-left:2em;padding-right:2em}}@media only screen and (min-width:992px) and (max-width:1199px){.ui.page.grid{width:auto;margin-left:0;margin-right:0;padding-left:3%;padding-right:3%}}@media only screen and (min-width:1200px) and (max-width:1919px){.ui.page.grid{width:auto;margin-left:0;margin-right:0;padding-left:15%;padding-right:15%}}@media only screen and (min-width:1920px){.ui.page.grid{width:auto;margin-left:0;margin-right:0;padding-left:23%;padding-right:23%}}.ui.grid>.column:only-child,.ui.grid>.row>.column:only-child,.ui[class*="one column"].grid>.column:not(.row),.ui[class*="one column"].grid>.row>.column{width:100%}.ui[class*="two column"].grid>.column:not(.row),.ui[class*="two column"].grid>.row>.column{width:50%}.ui[class*="three column"].grid>.column:not(.row),.ui[class*="three column"].grid>.row>.column{width:33.33333333%}.ui[class*="four column"].grid>.column:not(.row),.ui[class*="four column"].grid>.row>.column{width:25%}.ui[class*="five column"].grid>.column:not(.row),.ui[class*="five column"].grid>.row>.column{width:20%}.ui[class*="six column"].grid>.column:not(.row),.ui[class*="six column"].grid>.row>.column{width:16.66666667%}.ui[class*="seven column"].grid>.column:not(.row),.ui[class*="seven column"].grid>.row>.column{width:14.28571429%}.ui[class*="eight column"].grid>.column:not(.row),.ui[class*="eight column"].grid>.row>.column{width:12.5%}.ui[class*="nine column"].grid>.column:not(.row),.ui[class*="nine column"].grid>.row>.column{width:11.11111111%}.ui[class*="ten column"].grid>.column:not(.row),.ui[class*="ten column"].grid>.row>.column{width:10%}.ui[class*="eleven column"].grid>.column:not(.row),.ui[class*="eleven column"].grid>.row>.column{width:9.09090909%}.ui[class*="twelve column"].grid>.column:not(.row),.ui[class*="twelve column"].grid>.row>.column{width:8.33333333%}.ui[class*="thirteen column"].grid>.column:not(.row),.ui[class*="thirteen column"].grid>.row>.column{width:7.69230769%}.ui[class*="fourteen column"].grid>.column:not(.row),.ui[class*="fourteen column"].grid>.row>.column{width:7.14285714%}.ui[class*="fifteen column"].grid>.column:not(.row),.ui[class*="fifteen column"].grid>.row>.column{width:6.66666667%}.ui[class*="sixteen column"].grid>.column:not(.row),.ui[class*="sixteen column"].grid>.row>.column{width:6.25%}.ui.grid>[class*="one column"].row>.column{width:100%!important}.ui.grid>[class*="two column"].row>.column{width:50%!important}.ui.grid>[class*="three column"].row>.column{width:33.33333333%!important}.ui.grid>[class*="four column"].row>.column{width:25%!important}.ui.grid>[class*="five column"].row>.column{width:20%!important}.ui.grid>[class*="six column"].row>.column{width:16.66666667%!important}.ui.grid>[class*="seven column"].row>.column{width:14.28571429%!important}.ui.grid>[class*="eight column"].row>.column{width:12.5%!important}.ui.grid>[class*="nine column"].row>.column{width:11.11111111%!important}.ui.grid>[class*="ten column"].row>.column{width:10%!important}.ui.grid>[class*="eleven column"].row>.column{width:9.09090909%!important}.ui.grid>[class*="twelve column"].row>.column{width:8.33333333%!important}.ui.grid>[class*="thirteen column"].row>.column{width:7.69230769%!important}.ui.grid>[class*="fourteen column"].row>.column{width:7.14285714%!important}.ui.grid>[class*="fifteen column"].row>.column{width:6.66666667%!important}.ui.grid>[class*="sixteen column"].row>.column{width:6.25%!important}.ui.celled.page.grid{box-shadow:none}.ui.column.grid>[class*="one wide"].column,.ui.grid>.column.row>[class*="one wide"].column,.ui.grid>.row>[class*="one wide"].column,.ui.grid>[class*="one wide"].column{width:6.25%!important}.ui.column.grid>[class*="two wide"].column,.ui.grid>.column.row>[class*="two wide"].column,.ui.grid>.row>[class*="two wide"].column,.ui.grid>[class*="two wide"].column{width:12.5%!important}.ui.column.grid>[class*="three wide"].column,.ui.grid>.column.row>[class*="three wide"].column,.ui.grid>.row>[class*="three wide"].column,.ui.grid>[class*="three wide"].column{width:18.75%!important}.ui.column.grid>[class*="four wide"].column,.ui.grid>.column.row>[class*="four wide"].column,.ui.grid>.row>[class*="four wide"].column,.ui.grid>[class*="four wide"].column{width:25%!important}.ui.column.grid>[class*="five wide"].column,.ui.grid>.column.row>[class*="five wide"].column,.ui.grid>.row>[class*="five wide"].column,.ui.grid>[class*="five wide"].column{width:31.25%!important}.ui.column.grid>[class*="six wide"].column,.ui.grid>.column.row>[class*="six wide"].column,.ui.grid>.row>[class*="six wide"].column,.ui.grid>[class*="six wide"].column{width:37.5%!important}.ui.column.grid>[class*="seven wide"].column,.ui.grid>.column.row>[class*="seven wide"].column,.ui.grid>.row>[class*="seven wide"].column,.ui.grid>[class*="seven wide"].column{width:43.75%!important}.ui.column.grid>[class*="eight wide"].column,.ui.grid>.column.row>[class*="eight wide"].column,.ui.grid>.row>[class*="eight wide"].column,.ui.grid>[class*="eight wide"].column{width:50%!important}.ui.column.grid>[class*="nine wide"].column,.ui.grid>.column.row>[class*="nine wide"].column,.ui.grid>.row>[class*="nine wide"].column,.ui.grid>[class*="nine wide"].column{width:56.25%!important}.ui.column.grid>[class*="ten wide"].column,.ui.grid>.column.row>[class*="ten wide"].column,.ui.grid>.row>[class*="ten wide"].column,.ui.grid>[class*="ten wide"].column{width:62.5%!important}.ui.column.grid>[class*="eleven wide"].column,.ui.grid>.column.row>[class*="eleven wide"].column,.ui.grid>.row>[class*="eleven wide"].column,.ui.grid>[class*="eleven wide"].column{width:68.75%!important}.ui.column.grid>[class*="twelve wide"].column,.ui.grid>.column.row>[class*="twelve wide"].column,.ui.grid>.row>[class*="twelve wide"].column,.ui.grid>[class*="twelve wide"].column{width:75%!important}.ui.column.grid>[class*="thirteen wide"].column,.ui.grid>.column.row>[class*="thirteen wide"].column,.ui.grid>.row>[class*="thirteen wide"].column,.ui.grid>[class*="thirteen wide"].column{width:81.25%!important}.ui.column.grid>[class*="fourteen wide"].column,.ui.grid>.column.row>[class*="fourteen wide"].column,.ui.grid>.row>[class*="fourteen wide"].column,.ui.grid>[class*="fourteen wide"].column{width:87.5%!important}.ui.column.grid>[class*="fifteen wide"].column,.ui.grid>.column.row>[class*="fifteen wide"].column,.ui.grid>.row>[class*="fifteen wide"].column,.ui.grid>[class*="fifteen wide"].column{width:93.75%!important}.ui.column.grid>[class*="sixteen wide"].column,.ui.grid>.column.row>[class*="sixteen wide"].column,.ui.grid>.row>[class*="sixteen wide"].column,.ui.grid>[class*="sixteen wide"].column{width:100%!important}@media only screen and (min-width:320px) and (max-width:767px){.ui.column.grid>[class*="one wide mobile"].column,.ui.grid>.column.row>[class*="one wide mobile"].column,.ui.grid>.row>[class*="one wide mobile"].column,.ui.grid>[class*="one wide mobile"].column{width:6.25%!important}.ui.column.grid>[class*="two wide mobile"].column,.ui.grid>.column.row>[class*="two wide mobile"].column,.ui.grid>.row>[class*="two wide mobile"].column,.ui.grid>[class*="two wide mobile"].column{width:12.5%!important}.ui.column.grid>[class*="three wide mobile"].column,.ui.grid>.column.row>[class*="three wide mobile"].column,.ui.grid>.row>[class*="three wide mobile"].column,.ui.grid>[class*="three wide mobile"].column{width:18.75%!important}.ui.column.grid>[class*="four wide mobile"].column,.ui.grid>.column.row>[class*="four wide mobile"].column,.ui.grid>.row>[class*="four wide mobile"].column,.ui.grid>[class*="four wide mobile"].column{width:25%!important}.ui.column.grid>[class*="five wide mobile"].column,.ui.grid>.column.row>[class*="five wide mobile"].column,.ui.grid>.row>[class*="five wide mobile"].column,.ui.grid>[class*="five wide mobile"].column{width:31.25%!important}.ui.column.grid>[class*="six wide mobile"].column,.ui.grid>.column.row>[class*="six wide mobile"].column,.ui.grid>.row>[class*="six wide mobile"].column,.ui.grid>[class*="six wide mobile"].column{width:37.5%!important}.ui.column.grid>[class*="seven wide mobile"].column,.ui.grid>.column.row>[class*="seven wide mobile"].column,.ui.grid>.row>[class*="seven wide mobile"].column,.ui.grid>[class*="seven wide mobile"].column{width:43.75%!important}.ui.column.grid>[class*="eight wide mobile"].column,.ui.grid>.column.row>[class*="eight wide mobile"].column,.ui.grid>.row>[class*="eight wide mobile"].column,.ui.grid>[class*="eight wide mobile"].column{width:50%!important}.ui.column.grid>[class*="nine wide mobile"].column,.ui.grid>.column.row>[class*="nine wide mobile"].column,.ui.grid>.row>[class*="nine wide mobile"].column,.ui.grid>[class*="nine wide mobile"].column{width:56.25%!important}.ui.column.grid>[class*="ten wide mobile"].column,.ui.grid>.column.row>[class*="ten wide mobile"].column,.ui.grid>.row>[class*="ten wide mobile"].column,.ui.grid>[class*="ten wide mobile"].column{width:62.5%!important}.ui.column.grid>[class*="eleven wide mobile"].column,.ui.grid>.column.row>[class*="eleven wide mobile"].column,.ui.grid>.row>[class*="eleven wide mobile"].column,.ui.grid>[class*="eleven wide mobile"].column{width:68.75%!important}.ui.column.grid>[class*="twelve wide mobile"].column,.ui.grid>.column.row>[class*="twelve wide mobile"].column,.ui.grid>.row>[class*="twelve wide mobile"].column,.ui.grid>[class*="twelve wide mobile"].column{width:75%!important}.ui.column.grid>[class*="thirteen wide mobile"].column,.ui.grid>.column.row>[class*="thirteen wide mobile"].column,.ui.grid>.row>[class*="thirteen wide mobile"].column,.ui.grid>[class*="thirteen wide mobile"].column{width:81.25%!important}.ui.column.grid>[class*="fourteen wide mobile"].column,.ui.grid>.column.row>[class*="fourteen wide mobile"].column,.ui.grid>.row>[class*="fourteen wide mobile"].column,.ui.grid>[class*="fourteen wide mobile"].column{width:87.5%!important}.ui.column.grid>[class*="fifteen wide mobile"].column,.ui.grid>.column.row>[class*="fifteen wide mobile"].column,.ui.grid>.row>[class*="fifteen wide mobile"].column,.ui.grid>[class*="fifteen wide mobile"].column{width:93.75%!important}.ui.column.grid>[class*="sixteen wide mobile"].column,.ui.grid>.column.row>[class*="sixteen wide mobile"].column,.ui.grid>.row>[class*="sixteen wide mobile"].column,.ui.grid>[class*="sixteen wide mobile"].column{width:100%!important}}@media only screen and (min-width:768px) and (max-width:991px){.ui.column.grid>[class*="one wide tablet"].column,.ui.grid>.column.row>[class*="one wide tablet"].column,.ui.grid>.row>[class*="one wide tablet"].column,.ui.grid>[class*="one wide tablet"].column{width:6.25%!important}.ui.column.grid>[class*="two wide tablet"].column,.ui.grid>.column.row>[class*="two wide tablet"].column,.ui.grid>.row>[class*="two wide tablet"].column,.ui.grid>[class*="two wide tablet"].column{width:12.5%!important}.ui.column.grid>[class*="three wide tablet"].column,.ui.grid>.column.row>[class*="three wide tablet"].column,.ui.grid>.row>[class*="three wide tablet"].column,.ui.grid>[class*="three wide tablet"].column{width:18.75%!important}.ui.column.grid>[class*="four wide tablet"].column,.ui.grid>.column.row>[class*="four wide tablet"].column,.ui.grid>.row>[class*="four wide tablet"].column,.ui.grid>[class*="four wide tablet"].column{width:25%!important}.ui.column.grid>[class*="five wide tablet"].column,.ui.grid>.column.row>[class*="five wide tablet"].column,.ui.grid>.row>[class*="five wide tablet"].column,.ui.grid>[class*="five wide tablet"].column{width:31.25%!important}.ui.column.grid>[class*="six wide tablet"].column,.ui.grid>.column.row>[class*="six wide tablet"].column,.ui.grid>.row>[class*="six wide tablet"].column,.ui.grid>[class*="six wide tablet"].column{width:37.5%!important}.ui.column.grid>[class*="seven wide tablet"].column,.ui.grid>.column.row>[class*="seven wide tablet"].column,.ui.grid>.row>[class*="seven wide tablet"].column,.ui.grid>[class*="seven wide tablet"].column{width:43.75%!important}.ui.column.grid>[class*="eight wide tablet"].column,.ui.grid>.column.row>[class*="eight wide tablet"].column,.ui.grid>.row>[class*="eight wide tablet"].column,.ui.grid>[class*="eight wide tablet"].column{width:50%!important}.ui.column.grid>[class*="nine wide tablet"].column,.ui.grid>.column.row>[class*="nine wide tablet"].column,.ui.grid>.row>[class*="nine wide tablet"].column,.ui.grid>[class*="nine wide tablet"].column{width:56.25%!important}.ui.column.grid>[class*="ten wide tablet"].column,.ui.grid>.column.row>[class*="ten wide tablet"].column,.ui.grid>.row>[class*="ten wide tablet"].column,.ui.grid>[class*="ten wide tablet"].column{width:62.5%!important}.ui.column.grid>[class*="eleven wide tablet"].column,.ui.grid>.column.row>[class*="eleven wide tablet"].column,.ui.grid>.row>[class*="eleven wide tablet"].column,.ui.grid>[class*="eleven wide tablet"].column{width:68.75%!important}.ui.column.grid>[class*="twelve wide tablet"].column,.ui.grid>.column.row>[class*="twelve wide tablet"].column,.ui.grid>.row>[class*="twelve wide tablet"].column,.ui.grid>[class*="twelve wide tablet"].column{width:75%!important}.ui.column.grid>[class*="thirteen wide tablet"].column,.ui.grid>.column.row>[class*="thirteen wide tablet"].column,.ui.grid>.row>[class*="thirteen wide tablet"].column,.ui.grid>[class*="thirteen wide tablet"].column{width:81.25%!important}.ui.column.grid>[class*="fourteen wide tablet"].column,.ui.grid>.column.row>[class*="fourteen wide tablet"].column,.ui.grid>.row>[class*="fourteen wide tablet"].column,.ui.grid>[class*="fourteen wide tablet"].column{width:87.5%!important}.ui.column.grid>[class*="fifteen wide tablet"].column,.ui.grid>.column.row>[class*="fifteen wide tablet"].column,.ui.grid>.row>[class*="fifteen wide tablet"].column,.ui.grid>[class*="fifteen wide tablet"].column{width:93.75%!important}.ui.column.grid>[class*="sixteen wide tablet"].column,.ui.grid>.column.row>[class*="sixteen wide tablet"].column,.ui.grid>.row>[class*="sixteen wide tablet"].column,.ui.grid>[class*="sixteen wide tablet"].column{width:100%!important}}@media only screen and (min-width:992px){.ui.column.grid>[class*="one wide computer"].column,.ui.grid>.column.row>[class*="one wide computer"].column,.ui.grid>.row>[class*="one wide computer"].column,.ui.grid>[class*="one wide computer"].column{width:6.25%!important}.ui.column.grid>[class*="two wide computer"].column,.ui.grid>.column.row>[class*="two wide computer"].column,.ui.grid>.row>[class*="two wide computer"].column,.ui.grid>[class*="two wide computer"].column{width:12.5%!important}.ui.column.grid>[class*="three wide computer"].column,.ui.grid>.column.row>[class*="three wide computer"].column,.ui.grid>.row>[class*="three wide computer"].column,.ui.grid>[class*="three wide computer"].column{width:18.75%!important}.ui.column.grid>[class*="four wide computer"].column,.ui.grid>.column.row>[class*="four wide computer"].column,.ui.grid>.row>[class*="four wide computer"].column,.ui.grid>[class*="four wide computer"].column{width:25%!important}.ui.column.grid>[class*="five wide computer"].column,.ui.grid>.column.row>[class*="five wide computer"].column,.ui.grid>.row>[class*="five wide computer"].column,.ui.grid>[class*="five wide computer"].column{width:31.25%!important}.ui.column.grid>[class*="six wide computer"].column,.ui.grid>.column.row>[class*="six wide computer"].column,.ui.grid>.row>[class*="six wide computer"].column,.ui.grid>[class*="six wide computer"].column{width:37.5%!important}.ui.column.grid>[class*="seven wide computer"].column,.ui.grid>.column.row>[class*="seven wide computer"].column,.ui.grid>.row>[class*="seven wide computer"].column,.ui.grid>[class*="seven wide computer"].column{width:43.75%!important}.ui.column.grid>[class*="eight wide computer"].column,.ui.grid>.column.row>[class*="eight wide computer"].column,.ui.grid>.row>[class*="eight wide computer"].column,.ui.grid>[class*="eight wide computer"].column{width:50%!important}.ui.column.grid>[class*="nine wide computer"].column,.ui.grid>.column.row>[class*="nine wide computer"].column,.ui.grid>.row>[class*="nine wide computer"].column,.ui.grid>[class*="nine wide computer"].column{width:56.25%!important}.ui.column.grid>[class*="ten wide computer"].column,.ui.grid>.column.row>[class*="ten wide computer"].column,.ui.grid>.row>[class*="ten wide computer"].column,.ui.grid>[class*="ten wide computer"].column{width:62.5%!important}.ui.column.grid>[class*="eleven wide computer"].column,.ui.grid>.column.row>[class*="eleven wide computer"].column,.ui.grid>.row>[class*="eleven wide computer"].column,.ui.grid>[class*="eleven wide computer"].column{width:68.75%!important}.ui.column.grid>[class*="twelve wide computer"].column,.ui.grid>.column.row>[class*="twelve wide computer"].column,.ui.grid>.row>[class*="twelve wide computer"].column,.ui.grid>[class*="twelve wide computer"].column{width:75%!important}.ui.column.grid>[class*="thirteen wide computer"].column,.ui.grid>.column.row>[class*="thirteen wide computer"].column,.ui.grid>.row>[class*="thirteen wide computer"].column,.ui.grid>[class*="thirteen wide computer"].column{width:81.25%!important}.ui.column.grid>[class*="fourteen wide computer"].column,.ui.grid>.column.row>[class*="fourteen wide computer"].column,.ui.grid>.row>[class*="fourteen wide computer"].column,.ui.grid>[class*="fourteen wide computer"].column{width:87.5%!important}.ui.column.grid>[class*="fifteen wide computer"].column,.ui.grid>.column.row>[class*="fifteen wide computer"].column,.ui.grid>.row>[class*="fifteen wide computer"].column,.ui.grid>[class*="fifteen wide computer"].column{width:93.75%!important}.ui.column.grid>[class*="sixteen wide computer"].column,.ui.grid>.column.row>[class*="sixteen wide computer"].column,.ui.grid>.row>[class*="sixteen wide computer"].column,.ui.grid>[class*="sixteen wide computer"].column{width:100%!important}}@media only screen and (min-width:1200px) and (max-width:1919px){.ui.column.grid>[class*="one wide large screen"].column,.ui.grid>.column.row>[class*="one wide large screen"].column,.ui.grid>.row>[class*="one wide large screen"].column,.ui.grid>[class*="one wide large screen"].column{width:6.25%!important}.ui.column.grid>[class*="two wide large screen"].column,.ui.grid>.column.row>[class*="two wide large screen"].column,.ui.grid>.row>[class*="two wide large screen"].column,.ui.grid>[class*="two wide large screen"].column{width:12.5%!important}.ui.column.grid>[class*="three wide large screen"].column,.ui.grid>.column.row>[class*="three wide large screen"].column,.ui.grid>.row>[class*="three wide large screen"].column,.ui.grid>[class*="three wide large screen"].column{width:18.75%!important}.ui.column.grid>[class*="four wide large screen"].column,.ui.grid>.column.row>[class*="four wide large screen"].column,.ui.grid>.row>[class*="four wide large screen"].column,.ui.grid>[class*="four wide large screen"].column{width:25%!important}.ui.column.grid>[class*="five wide large screen"].column,.ui.grid>.column.row>[class*="five wide large screen"].column,.ui.grid>.row>[class*="five wide large screen"].column,.ui.grid>[class*="five wide large screen"].column{width:31.25%!important}.ui.column.grid>[class*="six wide large screen"].column,.ui.grid>.column.row>[class*="six wide large screen"].column,.ui.grid>.row>[class*="six wide large screen"].column,.ui.grid>[class*="six wide large screen"].column{width:37.5%!important}.ui.column.grid>[class*="seven wide large screen"].column,.ui.grid>.column.row>[class*="seven wide large screen"].column,.ui.grid>.row>[class*="seven wide large screen"].column,.ui.grid>[class*="seven wide large screen"].column{width:43.75%!important}.ui.column.grid>[class*="eight wide large screen"].column,.ui.grid>.column.row>[class*="eight wide large screen"].column,.ui.grid>.row>[class*="eight wide large screen"].column,.ui.grid>[class*="eight wide large screen"].column{width:50%!important}.ui.column.grid>[class*="nine wide large screen"].column,.ui.grid>.column.row>[class*="nine wide large screen"].column,.ui.grid>.row>[class*="nine wide large screen"].column,.ui.grid>[class*="nine wide large screen"].column{width:56.25%!important}.ui.column.grid>[class*="ten wide large screen"].column,.ui.grid>.column.row>[class*="ten wide large screen"].column,.ui.grid>.row>[class*="ten wide large screen"].column,.ui.grid>[class*="ten wide large screen"].column{width:62.5%!important}.ui.column.grid>[class*="eleven wide large screen"].column,.ui.grid>.column.row>[class*="eleven wide large screen"].column,.ui.grid>.row>[class*="eleven wide large screen"].column,.ui.grid>[class*="eleven wide large screen"].column{width:68.75%!important}.ui.column.grid>[class*="twelve wide large screen"].column,.ui.grid>.column.row>[class*="twelve wide large screen"].column,.ui.grid>.row>[class*="twelve wide large screen"].column,.ui.grid>[class*="twelve wide large screen"].column{width:75%!important}.ui.column.grid>[class*="thirteen wide large screen"].column,.ui.grid>.column.row>[class*="thirteen wide large screen"].column,.ui.grid>.row>[class*="thirteen wide large screen"].column,.ui.grid>[class*="thirteen wide large screen"].column{width:81.25%!important}.ui.column.grid>[class*="fourteen wide large screen"].column,.ui.grid>.column.row>[class*="fourteen wide large screen"].column,.ui.grid>.row>[class*="fourteen wide large screen"].column,.ui.grid>[class*="fourteen wide large screen"].column{width:87.5%!important}.ui.column.grid>[class*="fifteen wide large screen"].column,.ui.grid>.column.row>[class*="fifteen wide large screen"].column,.ui.grid>.row>[class*="fifteen wide large screen"].column,.ui.grid>[class*="fifteen wide large screen"].column{width:93.75%!important}.ui.column.grid>[class*="sixteen wide large screen"].column,.ui.grid>.column.row>[class*="sixteen wide large screen"].column,.ui.grid>.row>[class*="sixteen wide large screen"].column,.ui.grid>[class*="sixteen wide large screen"].column{width:100%!important}}@media only screen and (min-width:1920px){.ui.column.grid>[class*="one wide widescreen"].column,.ui.grid>.column.row>[class*="one wide widescreen"].column,.ui.grid>.row>[class*="one wide widescreen"].column,.ui.grid>[class*="one wide widescreen"].column{width:6.25%!important}.ui.column.grid>[class*="two wide widescreen"].column,.ui.grid>.column.row>[class*="two wide widescreen"].column,.ui.grid>.row>[class*="two wide widescreen"].column,.ui.grid>[class*="two wide widescreen"].column{width:12.5%!important}.ui.column.grid>[class*="three wide widescreen"].column,.ui.grid>.column.row>[class*="three wide widescreen"].column,.ui.grid>.row>[class*="three wide widescreen"].column,.ui.grid>[class*="three wide widescreen"].column{width:18.75%!important}.ui.column.grid>[class*="four wide widescreen"].column,.ui.grid>.column.row>[class*="four wide widescreen"].column,.ui.grid>.row>[class*="four wide widescreen"].column,.ui.grid>[class*="four wide widescreen"].column{width:25%!important}.ui.column.grid>[class*="five wide widescreen"].column,.ui.grid>.column.row>[class*="five wide widescreen"].column,.ui.grid>.row>[class*="five wide widescreen"].column,.ui.grid>[class*="five wide widescreen"].column{width:31.25%!important}.ui.column.grid>[class*="six wide widescreen"].column,.ui.grid>.column.row>[class*="six wide widescreen"].column,.ui.grid>.row>[class*="six wide widescreen"].column,.ui.grid>[class*="six wide widescreen"].column{width:37.5%!important}.ui.column.grid>[class*="seven wide widescreen"].column,.ui.grid>.column.row>[class*="seven wide widescreen"].column,.ui.grid>.row>[class*="seven wide widescreen"].column,.ui.grid>[class*="seven wide widescreen"].column{width:43.75%!important}.ui.column.grid>[class*="eight wide widescreen"].column,.ui.grid>.column.row>[class*="eight wide widescreen"].column,.ui.grid>.row>[class*="eight wide widescreen"].column,.ui.grid>[class*="eight wide widescreen"].column{width:50%!important}.ui.column.grid>[class*="nine wide widescreen"].column,.ui.grid>.column.row>[class*="nine wide widescreen"].column,.ui.grid>.row>[class*="nine wide widescreen"].column,.ui.grid>[class*="nine wide widescreen"].column{width:56.25%!important}.ui.column.grid>[class*="ten wide widescreen"].column,.ui.grid>.column.row>[class*="ten wide widescreen"].column,.ui.grid>.row>[class*="ten wide widescreen"].column,.ui.grid>[class*="ten wide widescreen"].column{width:62.5%!important}.ui.column.grid>[class*="eleven wide widescreen"].column,.ui.grid>.column.row>[class*="eleven wide widescreen"].column,.ui.grid>.row>[class*="eleven wide widescreen"].column,.ui.grid>[class*="eleven wide widescreen"].column{width:68.75%!important}.ui.column.grid>[class*="twelve wide widescreen"].column,.ui.grid>.column.row>[class*="twelve wide widescreen"].column,.ui.grid>.row>[class*="twelve wide widescreen"].column,.ui.grid>[class*="twelve wide widescreen"].column{width:75%!important}.ui.column.grid>[class*="thirteen wide widescreen"].column,.ui.grid>.column.row>[class*="thirteen wide widescreen"].column,.ui.grid>.row>[class*="thirteen wide widescreen"].column,.ui.grid>[class*="thirteen wide widescreen"].column{width:81.25%!important}.ui.column.grid>[class*="fourteen wide widescreen"].column,.ui.grid>.column.row>[class*="fourteen wide widescreen"].column,.ui.grid>.row>[class*="fourteen wide widescreen"].column,.ui.grid>[class*="fourteen wide widescreen"].column{width:87.5%!important}.ui.column.grid>[class*="fifteen wide widescreen"].column,.ui.grid>.column.row>[class*="fifteen wide widescreen"].column,.ui.grid>.row>[class*="fifteen wide widescreen"].column,.ui.grid>[class*="fifteen wide widescreen"].column{width:93.75%!important}.ui.column.grid>[class*="sixteen wide widescreen"].column,.ui.grid>.column.row>[class*="sixteen wide widescreen"].column,.ui.grid>.row>[class*="sixteen wide widescreen"].column,.ui.grid>[class*="sixteen wide widescreen"].column{width:100%!important}}.ui.centered.grid,.ui.centered.grid>.row,.ui.grid>.centered.row{text-align:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.ui.centered.grid>.column:not(.aligned):not(:justified):not(.row),.ui.centered.grid>.row>.column:not(.aligned):not(:justified),.ui.grid .centered.row>.column:not(.aligned):not(:justified){text-align:left}.ui.grid>.centered.column,.ui.grid>.row>.centered.column{display:block;margin-left:auto;margin-right:auto}.ui.grid>.relaxed.row>.column,.ui.relaxed.grid>.column:not(.row),.ui.relaxed.grid>.row>.column{padding-left:1.5rem;padding-right:1.5rem}.ui.grid>[class*="very relaxed"].row>.column,.ui[class*="very relaxed"].grid>.column:not(.row),.ui[class*="very relaxed"].grid>.row>.column{padding-left:2.5rem;padding-right:2.5rem}.ui.grid .relaxed.row+.ui.divider,.ui.relaxed.grid .row+.ui.divider{margin-left:1.5rem;margin-right:1.5rem}.ui.grid [class*="very relaxed"].row+.ui.divider,.ui[class*="very relaxed"].grid .row+.ui.divider{margin-left:2.5rem;margin-right:2.5rem}.ui.padded.grid:not(.vertically):not(.horizontally){margin:0!important}[class*="horizontally padded"].ui.grid{margin-left:0!important;margin-right:0!important}[class*="vertically padded"].ui.grid{margin-top:0!important;margin-bottom:0!important}.ui.grid [class*="left floated"].column{margin-right:auto}.ui.grid [class*="right floated"].column{margin-left:auto}.ui.divided.grid:not([class*="vertically divided"])>.column:not(.row),.ui.divided.grid:not([class*="vertically divided"])>.row>.column{box-shadow:-1px 0 0 0 rgba(34,36,38,.15)}.ui[class*="vertically divided"].grid>.column:not(.row),.ui[class*="vertically divided"].grid>.row>.column{margin-top:1rem;margin-bottom:1rem;padding-top:0;padding-bottom:0}.ui[class*="vertically divided"].grid>.row{margin-top:0;margin-bottom:0;position:relative}.ui.divided.grid:not([class*="vertically divided"])>.column:first-child,.ui.divided.grid:not([class*="vertically divided"])>.row>.column:first-child{box-shadow:none}.ui[class*="vertically divided"].grid>.row:first-child>.column{margin-top:0}.ui.grid>.divided.row>.column{box-shadow:-1px 0 0 0 rgba(34,36,38,.15)}.ui.grid>.divided.row>.column:first-child{box-shadow:none}.ui[class*="vertically divided"].grid>.row:before{position:absolute;content:"";top:0;left:0;width:calc(100% - 2rem);height:1px;margin:0 1rem;box-shadow:0 -1px 0 0 rgba(34,36,38,.15)}.ui.padded.divided.grid:not(.vertically):not(.horizontally),[class*="horizontally padded"].ui.divided.grid{width:100%}.ui[class*="vertically divided"].grid>.row:first-child:before{box-shadow:none}.ui.inverted.divided.grid:not([class*="vertically divided"])>.column:not(.row),.ui.inverted.divided.grid:not([class*="vertically divided"])>.row>.column{box-shadow:-1px 0 0 0 rgba(255,255,255,.1)}.ui.inverted.divided.grid:not([class*="vertically divided"])>.column:not(.row):first-child,.ui.inverted.divided.grid:not([class*="vertically divided"])>.row>.column:first-child{box-shadow:none}.ui.inverted[class*="vertically divided"].grid>.row:before{box-shadow:0 -1px 0 0 rgba(255,255,255,.1)}.ui.relaxed[class*="vertically divided"].grid>.row:before{margin-left:1.5rem;margin-right:1.5rem;width:calc(100% - 3rem)}.ui[class*="very relaxed"][class*="vertically divided"].grid>.row:before{margin-left:5rem;margin-right:5rem;width:calc(100% - 5rem)}.ui.celled.grid{width:100%;margin:1em 0;box-shadow:0 0 0 1px #D4D4D5}.ui.celled.grid>.row{width:100%!important;margin:0;padding:0;box-shadow:0 -1px 0 0 #D4D4D5}.ui.celled.grid>.column:not(.row),.ui.celled.grid>.row>.column{box-shadow:-1px 0 0 0 #D4D4D5;padding:1em}.ui.celled.grid>.column:first-child,.ui.celled.grid>.row>.column:first-child{box-shadow:none}.ui.relaxed.celled.grid>.column:not(.row),.ui.relaxed.celled.grid>.row>.column{padding:1.5em}.ui[class*="very relaxed"].celled.grid>.column:not(.row),.ui[class*="very relaxed"].celled.grid>.row>.column{padding:2em}.ui[class*="internally celled"].grid{box-shadow:none;margin:0}.ui[class*="internally celled"].grid>.row:first-child,.ui[class*="internally celled"].grid>.row>.column:first-child{box-shadow:none}.ui.grid>.row>[class*="top aligned"].column,.ui.grid>[class*="top aligned"].column:not(.row),.ui.grid>[class*="top aligned"].row>.column,.ui[class*="top aligned"].grid>.column:not(.row),.ui[class*="top aligned"].grid>.row>.column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;vertical-align:top;-webkit-align-self:flex-start!important;-ms-flex-item-align:start!important;align-self:flex-start!important}.ui.grid>.row>[class*="middle aligned"].column,.ui.grid>[class*="middle aligned"].column:not(.row),.ui.grid>[class*="middle aligned"].row>.column,.ui[class*="middle aligned"].grid>.column:not(.row),.ui[class*="middle aligned"].grid>.row>.column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;vertical-align:middle;-webkit-align-self:center!important;-ms-flex-item-align:center!important;align-self:center!important}.ui.grid>.row>[class*="bottom aligned"].column,.ui.grid>[class*="bottom aligned"].column:not(.row),.ui.grid>[class*="bottom aligned"].row>.column,.ui[class*="bottom aligned"].grid>.column:not(.row),.ui[class*="bottom aligned"].grid>.row>.column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;vertical-align:bottom;-webkit-align-self:flex-end!important;-ms-flex-item-align:end!important;align-self:flex-end!important}.ui.grid>.row>.stretched.column,.ui.grid>.stretched.column:not(.row),.ui.grid>.stretched.row>.column,.ui.stretched.grid>.column,.ui.stretched.grid>.row>.column{display:-webkit-inline-box!important;display:-webkit-inline-flex!important;display:-ms-inline-flexbox!important;display:inline-flex!important;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui.grid>.row>.stretched.column>*,.ui.grid>.stretched.column:not(.row)>*,.ui.grid>.stretched.row>.column>*,.ui.stretched.grid>.column>*,.ui.stretched.grid>.row>.column>*{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.ui.grid>.row>[class*="left aligned"].column,.ui.grid>[class*="left aligned"].column.column,.ui.grid>[class*="left aligned"].row>.column,.ui[class*="left aligned"].grid>.column,.ui[class*="left aligned"].grid>.row>.column{text-align:left;-webkit-align-self:inherit;-ms-flex-item-align:inherit;align-self:inherit}.ui.grid>.row>[class*="center aligned"].column,.ui.grid>[class*="center aligned"].column.column,.ui.grid>[class*="center aligned"].row>.column,.ui[class*="center aligned"].grid>.column,.ui[class*="center aligned"].grid>.row>.column{text-align:center;-webkit-align-self:inherit;-ms-flex-item-align:inherit;align-self:inherit}.ui[class*="center aligned"].grid{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.ui.grid>.row>[class*="right aligned"].column,.ui.grid>[class*="right aligned"].column.column,.ui.grid>[class*="right aligned"].row>.column,.ui[class*="right aligned"].grid>.column,.ui[class*="right aligned"].grid>.row>.column{text-align:right;-webkit-align-self:inherit;-ms-flex-item-align:inherit;align-self:inherit}.ui.grid>.justified.column.column,.ui.grid>.justified.row>.column,.ui.grid>.row>.justified.column,.ui.justified.grid>.column,.ui.justified.grid>.row>.column{text-align:justify;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.ui.grid>.row>.black.column,.ui.grid>.row>.blue.column,.ui.grid>.row>.brown.column,.ui.grid>.row>.green.column,.ui.grid>.row>.grey.column,.ui.grid>.row>.olive.column,.ui.grid>.row>.orange.column,.ui.grid>.row>.pink.column,.ui.grid>.row>.purple.column,.ui.grid>.row>.red.column,.ui.grid>.row>.teal.column,.ui.grid>.row>.violet.column,.ui.grid>.row>.yellow.column{margin-top:-1rem;margin-bottom:-1rem;padding-top:1rem;padding-bottom:1rem}.ui.grid>.red.column,.ui.grid>.red.row,.ui.grid>.row>.red.column{background-color:#DB2828!important;color:#FFF}.ui.grid>.orange.column,.ui.grid>.orange.row,.ui.grid>.row>.orange.column{background-color:#F2711C!important;color:#FFF}.ui.grid>.row>.yellow.column,.ui.grid>.yellow.column,.ui.grid>.yellow.row{background-color:#FBBD08!important;color:#FFF}.ui.grid>.olive.column,.ui.grid>.olive.row,.ui.grid>.row>.olive.column{background-color:#B5CC18!important;color:#FFF}.ui.grid>.green.column,.ui.grid>.green.row,.ui.grid>.row>.green.column{background-color:#21BA45!important;color:#FFF}.ui.grid>.row>.teal.column,.ui.grid>.teal.column,.ui.grid>.teal.row{background-color:#00B5AD!important;color:#FFF}.ui.grid>.blue.column,.ui.grid>.blue.row,.ui.grid>.row>.blue.column{background-color:#2185D0!important;color:#FFF}.ui.grid>.row>.violet.column,.ui.grid>.violet.column,.ui.grid>.violet.row{background-color:#6435C9!important;color:#FFF}.ui.grid>.purple.column,.ui.grid>.purple.row,.ui.grid>.row>.purple.column{background-color:#A333C8!important;color:#FFF}.ui.grid>.pink.column,.ui.grid>.pink.row,.ui.grid>.row>.pink.column{background-color:#E03997!important;color:#FFF}.ui.grid>.brown.column,.ui.grid>.brown.row,.ui.grid>.row>.brown.column{background-color:#A5673F!important;color:#FFF}.ui.grid>.grey.column,.ui.grid>.grey.row,.ui.grid>.row>.grey.column{background-color:#767676!important;color:#FFF}.ui.grid>.black.column,.ui.grid>.black.row,.ui.grid>.row>.black.column{background-color:#1B1C1D!important;color:#FFF}.ui.grid>[class*="equal width"].row>.column,.ui[class*="equal width"].grid>.column:not(.row),.ui[class*="equal width"].grid>.row>.column{display:inline-block;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.ui.grid>[class*="equal width"].row>.wide.column,.ui[class*="equal width"].grid>.row>.wide.column,.ui[class*="equal width"].grid>.wide.column{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0}@media only screen and (max-width:767px){.ui.grid>[class*="mobile reversed"].row,.ui[class*="mobile reversed"].grid,.ui[class*="mobile reversed"].grid>.row{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ui.stackable[class*="mobile reversed"],.ui[class*="mobile vertically reversed"].grid{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"])>.column:first-child,.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"])>.row>.column:first-child{box-shadow:-1px 0 0 0 rgba(34,36,38,.15)}.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"])>.column:last-child,.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"])>.row>.column:last-child{box-shadow:none}.ui.grid[class*="vertically divided"][class*="mobile vertically reversed"]>.row:first-child:before{box-shadow:0 -1px 0 0 rgba(34,36,38,.15)}.ui.grid[class*="vertically divided"][class*="mobile vertically reversed"]>.row:last-child:before{box-shadow:none}.ui[class*="mobile reversed"].celled.grid>.row>.column:first-child{box-shadow:-1px 0 0 0 #D4D4D5}.ui[class*="mobile reversed"].celled.grid>.row>.column:last-child{box-shadow:none}}@media only screen and (min-width:768px) and (max-width:991px){.ui.grid>[class*="tablet reversed"].row,.ui[class*="tablet reversed"].grid,.ui[class*="tablet reversed"].grid>.row{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ui[class*="tablet vertically reversed"].grid{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"])>.column:first-child,.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"])>.row>.column:first-child{box-shadow:-1px 0 0 0 rgba(34,36,38,.15)}.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"])>.column:last-child,.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"])>.row>.column:last-child{box-shadow:none}.ui.grid[class*="vertically divided"][class*="tablet vertically reversed"]>.row:first-child:before{box-shadow:0 -1px 0 0 rgba(34,36,38,.15)}.ui.grid[class*="vertically divided"][class*="tablet vertically reversed"]>.row:last-child:before{box-shadow:none}.ui[class*="tablet reversed"].celled.grid>.row>.column:first-child{box-shadow:-1px 0 0 0 #D4D4D5}.ui[class*="tablet reversed"].celled.grid>.row>.column:last-child{box-shadow:none}}@media only screen and (min-width:992px){.ui.grid>[class*="computer reversed"].row,.ui[class*="computer reversed"].grid,.ui[class*="computer reversed"].grid>.row{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ui[class*="computer vertically reversed"].grid{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"])>.column:first-child,.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"])>.row>.column:first-child{box-shadow:-1px 0 0 0 rgba(34,36,38,.15)}.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"])>.column:last-child,.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"])>.row>.column:last-child{box-shadow:none}.ui.grid[class*="vertically divided"][class*="computer vertically reversed"]>.row:first-child:before{box-shadow:0 -1px 0 0 rgba(34,36,38,.15)}.ui.grid[class*="vertically divided"][class*="computer vertically reversed"]>.row:last-child:before{box-shadow:none}.ui[class*="computer reversed"].celled.grid>.row>.column:first-child{box-shadow:-1px 0 0 0 #D4D4D5}.ui[class*="computer reversed"].celled.grid>.row>.column:last-child{box-shadow:none}}@media only screen and (min-width:768px) and (max-width:991px){.ui.doubling.grid{width:auto}.ui.doubling.grid>.row,.ui.grid>.doubling.row{margin:0!important;padding:0!important}.ui.doubling.grid>.row>.column,.ui.grid>.doubling.row>.column{display:inline-block!important;padding-top:1rem!important;padding-bottom:1rem!important;box-shadow:none!important;margin:0}.ui.grid>[class*="two column"].doubling.row.row>.column,.ui[class*="two column"].doubling.grid>.column:not(.row),.ui[class*="two column"].doubling.grid>.row>.column{width:100%!important}.ui.grid>[class*="three column"].doubling.row.row>.column,.ui.grid>[class*="four column"].doubling.row.row>.column,.ui[class*="three column"].doubling.grid>.column:not(.row),.ui[class*="three column"].doubling.grid>.row>.column,.ui[class*="four column"].doubling.grid>.column:not(.row),.ui[class*="four column"].doubling.grid>.row>.column{width:50%!important}.ui.grid>[class*="five column"].doubling.row.row>.column,.ui.grid>[class*="six column"].doubling.row.row>.column,.ui.grid>[class*="seven column"].doubling.row.row>.column,.ui[class*="five column"].doubling.grid>.column:not(.row),.ui[class*="five column"].doubling.grid>.row>.column,.ui[class*="six column"].doubling.grid>.column:not(.row),.ui[class*="six column"].doubling.grid>.row>.column,.ui[class*="seven column"].doubling.grid>.column:not(.row),.ui[class*="seven column"].doubling.grid>.row>.column{width:33.33333333%!important}.ui.grid>[class*="eight column"].doubling.row.row>.column,.ui.grid>[class*="nine column"].doubling.row.row>.column,.ui[class*="eight column"].doubling.grid>.column:not(.row),.ui[class*="eight column"].doubling.grid>.row>.column,.ui[class*="nine column"].doubling.grid>.column:not(.row),.ui[class*="nine column"].doubling.grid>.row>.column{width:25%!important}.ui.grid>[class*="ten column"].doubling.row.row>.column,.ui.grid>[class*="eleven column"].doubling.row.row>.column,.ui[class*="ten column"].doubling.grid>.column:not(.row),.ui[class*="ten column"].doubling.grid>.row>.column,.ui[class*="eleven column"].doubling.grid>.column:not(.row),.ui[class*="eleven column"].doubling.grid>.row>.column{width:20%!important}.ui.grid>[class*="twelve column"].doubling.row.row>.column,.ui.grid>[class*="thirteen column"].doubling.row.row>.column,.ui[class*="twelve column"].doubling.grid>.column:not(.row),.ui[class*="twelve column"].doubling.grid>.row>.column,.ui[class*="thirteen column"].doubling.grid>.column:not(.row),.ui[class*="thirteen column"].doubling.grid>.row>.column{width:16.66666667%!important}.ui.grid>[class*="fourteen column"].doubling.row.row>.column,.ui.grid>[class*="fifteen column"].doubling.row.row>.column,.ui[class*="fourteen column"].doubling.grid>.column:not(.row),.ui[class*="fourteen column"].doubling.grid>.row>.column,.ui[class*="fifteen column"].doubling.grid>.column:not(.row),.ui[class*="fifteen column"].doubling.grid>.row>.column{width:14.28571429%!important}.ui.grid>[class*="sixteen column"].doubling.row.row>.column,.ui[class*="sixteen column"].doubling.grid>.column:not(.row),.ui[class*="sixteen column"].doubling.grid>.row>.column{width:12.5%!important}.ui.grid.grid.grid>.row>[class*="computer only"].column:not(.tablet),.ui.grid.grid.grid>.row>[class*="large screen only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="mobile only"].column:not(.tablet),.ui.grid.grid.grid>[class*="computer only"].column:not(.tablet),.ui.grid.grid.grid>[class*="computer only"].row:not(.tablet),.ui.grid.grid.grid>[class*="large screen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="large screen only"].row:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].row:not(.mobile),.ui.grid.grid.grid>[class*="mobile only"].column:not(.tablet),.ui.grid.grid.grid>[class*="mobile only"].row:not(.tablet),.ui[class*="computer only"].grid.grid.grid:not(.tablet),.ui[class*="large screen only"].grid.grid.grid:not(.mobile),.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),.ui[class*="mobile only"].grid.grid.grid:not(.tablet){display:none!important}}@media only screen and (max-width:767px){.ui.doubling.grid>.row,.ui.grid>.doubling.row{margin:0!important;padding:0!important}.ui.doubling.grid>.row>.column,.ui.grid>.doubling.row>.column{padding-top:1rem!important;padding-bottom:1rem!important;margin:0!important;box-shadow:none!important}.ui.grid>[class*="two column"].doubling:not(.stackable).row.row>.column,.ui[class*="two column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="two column"].doubling:not(.stackable).grid>.row>.column{width:100%!important}.ui.grid>[class*="three column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="four column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="five column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="six column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="seven column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="eight column"].doubling:not(.stackable).row.row>.column,.ui[class*="three column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="three column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="four column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="four column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="five column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="five column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="six column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="six column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="seven column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="seven column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="eight column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="eight column"].doubling:not(.stackable).grid>.row>.column{width:50%!important}.ui.grid>[class*="nine column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="ten column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="eleven column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="twelve column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="thirteen column"].doubling:not(.stackable).row.row>.column,.ui[class*="nine column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="nine column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="ten column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="ten column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="eleven column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="eleven column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="twelve column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="twelve column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="thirteen column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="thirteen column"].doubling:not(.stackable).grid>.row>.column{width:33.33333333%!important}.ui.grid>[class*="fourteen column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="fifteen column"].doubling:not(.stackable).row.row>.column,.ui.grid>[class*="sixteen column"].doubling:not(.stackable).row.row>.column,.ui[class*="fourteen column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="fourteen column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="fifteen column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="fifteen column"].doubling:not(.stackable).grid>.row>.column,.ui[class*="sixteen column"].doubling:not(.stackable).grid>.column:not(.row),.ui[class*="sixteen column"].doubling:not(.stackable).grid>.row>.column{width:25%!important}.ui.stackable.grid{width:auto;margin-left:0!important;margin-right:0!important}.ui.grid>.stackable.stackable.row>.column,.ui.stackable.grid>.column.grid>.column,.ui.stackable.grid>.column.row>.column,.ui.stackable.grid>.column:not(.row),.ui.stackable.grid>.row>.column,.ui.stackable.grid>.row>.wide.column,.ui.stackable.grid>.wide.column{width:100%!important;margin:0!important;box-shadow:none!important;padding:1rem!important}.ui.stackable.grid:not(.vertically)>.row{margin:0;padding:0}.ui.container>.ui.stackable.grid>.column,.ui.container>.ui.stackable.grid>.row>.column{padding-left:0!important;padding-right:0!important}.ui.grid .ui.stackable.grid,.ui.segment:not(.vertical) .ui.stackable.page.grid{margin-left:-1rem!important;margin-right:-1rem!important}.ui.stackable.celled.grid>.column:not(.row):first-child,.ui.stackable.celled.grid>.row:first-child>.column:first-child,.ui.stackable.divided.grid>.column:not(.row):first-child,.ui.stackable.divided.grid>.row:first-child>.column:first-child{border-top:none!important}.ui.inverted.stackable.celled.grid>.column:not(.row),.ui.inverted.stackable.celled.grid>.row>.column,.ui.inverted.stackable.divided.grid>.column:not(.row),.ui.inverted.stackable.divided.grid>.row>.column{border-top:1px solid rgba(255,255,255,.1)}.ui.stackable.celled.grid>.column:not(.row),.ui.stackable.celled.grid>.row>.column,.ui.stackable.divided:not(.vertically).grid>.column:not(.row),.ui.stackable.divided:not(.vertically).grid>.row>.column{border-top:1px solid rgba(34,36,38,.15);box-shadow:none!important;padding-top:2rem!important;padding-bottom:2rem!important}.ui.stackable.celled.grid>.row{box-shadow:none!important}.ui.stackable.divided:not(.vertically).grid>.column:not(.row),.ui.stackable.divided:not(.vertically).grid>.row>.column{padding-left:0!important;padding-right:0!important}.ui.grid.grid.grid>.row>[class*="tablet only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="computer only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="large screen only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="tablet only"].column:not(.mobile),.ui.grid.grid.grid>[class*="tablet only"].row:not(.mobile),.ui.grid.grid.grid>[class*="computer only"].column:not(.mobile),.ui.grid.grid.grid>[class*="computer only"].row:not(.mobile),.ui.grid.grid.grid>[class*="large screen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="large screen only"].row:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].row:not(.mobile),.ui[class*="tablet only"].grid.grid.grid:not(.mobile),.ui[class*="computer only"].grid.grid.grid:not(.mobile),.ui[class*="large screen only"].grid.grid.grid:not(.mobile),.ui[class*="widescreen only"].grid.grid.grid:not(.mobile){display:none!important}}@media only screen and (min-width:992px) and (max-width:1199px){.ui.grid.grid.grid>.row>[class*="tablet only"].column:not(.computer),.ui.grid.grid.grid>.row>[class*="large screen only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="mobile only"].column:not(.computer),.ui.grid.grid.grid>[class*="tablet only"].column:not(.computer),.ui.grid.grid.grid>[class*="tablet only"].row:not(.computer),.ui.grid.grid.grid>[class*="large screen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="large screen only"].row:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].row:not(.mobile),.ui.grid.grid.grid>[class*="mobile only"].column:not(.computer),.ui.grid.grid.grid>[class*="mobile only"].row:not(.computer),.ui[class*="tablet only"].grid.grid.grid:not(.computer),.ui[class*="large screen only"].grid.grid.grid:not(.mobile),.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),.ui[class*="mobile only"].grid.grid.grid:not(.computer){display:none!important}}@media only screen and (min-width:1200px) and (max-width:1919px){.ui.grid.grid.grid>.row>[class*="tablet only"].column:not(.computer),.ui.grid.grid.grid>.row>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>.row>[class*="mobile only"].column:not(.computer),.ui.grid.grid.grid>[class*="tablet only"].column:not(.computer),.ui.grid.grid.grid>[class*="tablet only"].row:not(.computer),.ui.grid.grid.grid>[class*="widescreen only"].column:not(.mobile),.ui.grid.grid.grid>[class*="widescreen only"].row:not(.mobile),.ui.grid.grid.grid>[class*="mobile only"].column:not(.computer),.ui.grid.grid.grid>[class*="mobile only"].row:not(.computer),.ui[class*="tablet only"].grid.grid.grid:not(.computer),.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),.ui[class*="mobile only"].grid.grid.grid:not(.computer){display:none!important}}@media only screen and (min-width:1920px){.ui.grid.grid.grid>.row>[class*="tablet only"].column:not(.computer),.ui.grid.grid.grid>.row>[class*="mobile only"].column:not(.computer),.ui.grid.grid.grid>[class*="tablet only"].column:not(.computer),.ui.grid.grid.grid>[class*="tablet only"].row:not(.computer),.ui.grid.grid.grid>[class*="mobile only"].column:not(.computer),.ui.grid.grid.grid>[class*="mobile only"].row:not(.computer),.ui[class*="tablet only"].grid.grid.grid:not(.computer),.ui[class*="mobile only"].grid.grid.grid:not(.computer){display:none!important}}.ui.menu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:1rem 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;background:#FFF;font-weight:400;border:1px solid rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15);border-radius:.28571429rem;min-height:2.85714286em}.ui.menu:after{content:'';display:block;height:0;clear:both;visibility:hidden}.ui.menu:first-child{margin-top:0}.ui.menu:last-child{margin-bottom:0}.ui.menu .menu{margin:0}.ui.menu:not(.vertical)>.menu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ui.menu:not(.vertical) .item{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.ui.menu .item{position:relative;vertical-align:middle;line-height:1;text-decoration:none;-webkit-tap-highlight-color:transparent;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:0 0;padding:.92857143em 1.14285714em;text-transform:none;color:rgba(0,0,0,.87);font-weight:400;-webkit-transition:background .1s ease,box-shadow .1s ease,color .1s ease;transition:background .1s ease,box-shadow .1s ease,color .1s ease}.ui.menu>.item:first-child{border-radius:.28571429rem 0 0 .28571429rem}.ui.menu .item:before{position:absolute;content:'';top:0;right:0;height:100%;width:1px;background:rgba(34,36,38,.1)}.ui.menu .item>a:not(.ui),.ui.menu .item>p:only-child,.ui.menu .text.item>*{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;line-height:1.3}.ui.menu .item>p:first-child{margin-top:0}.ui.menu .item>p:last-child{margin-bottom:0}.ui.menu .item>i.icon{opacity:.9;float:none;margin:0 .35714286em 0 0}.ui.menu:not(.vertical) .item>.button{position:relative;top:0;margin:-.5em 0;padding-bottom:.78571429em;padding-top:.78571429em;font-size:1em}.ui.menu>.container,.ui.menu>.grid{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:inherit;-webkit-align-items:inherit;-ms-flex-align:inherit;align-items:inherit;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:inherit;-ms-flex-direction:inherit;flex-direction:inherit}.ui.menu .item>.input{width:100%}.ui.menu:not(.vertical) .item>.input{position:relative;top:0;margin:-.5em 0}.ui.menu .item>.input input{font-size:1em;padding-top:.57142857em;padding-bottom:.57142857em}.ui.menu .header.item,.ui.vertical.menu .header.item{margin:0;background:0 0;text-transform:normal;font-weight:700}.ui.vertical.menu .item>.header:not(.ui){margin:0 0 .5em;font-size:1em;font-weight:700}.ui.menu .ui.popup{display:none}.ui.menu .ui.visible.popup{display:block}.ui.menu .item>i.dropdown.icon{padding:0;float:right;margin:0 0 0 1em}.ui.menu .dropdown.item .menu{left:0;min-width:calc(100% - 1px);border-radius:0 0 .28571429rem .28571429rem;background:#FFF;margin:0;box-shadow:0 1px 3px 0 rgba(0,0,0,.08);-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-webkit-flex-direction:column!important;-ms-flex-direction:column!important;flex-direction:column!important}.ui.menu .ui.dropdown .menu>.item{margin:0;text-align:left;font-size:1em!important;padding:.78571429em 1.14285714em!important;background:0 0!important;color:rgba(0,0,0,.87)!important;text-transform:none!important;font-weight:400!important;box-shadow:none!important;-webkit-transition:none!important;transition:none!important}.ui.menu .ui.dropdown .menu>.item:hover,.ui.menu .ui.dropdown .menu>.selected.item{background:rgba(0,0,0,.05)!important;color:rgba(0,0,0,.95)!important}.ui.menu .ui.dropdown .menu>.active.item{background:rgba(0,0,0,.03)!important;font-weight:700!important;color:rgba(0,0,0,.95)!important}.ui.menu .ui.dropdown.item .menu .item:not(.filtered){display:block}.ui.menu .ui.dropdown .menu>.item .icon:not(.dropdown){display:inline-block;font-size:1em!important;float:none;margin:0 .75em 0 0}.ui.secondary.menu .dropdown.item>.menu,.ui.text.menu .dropdown.item>.menu{border-radius:.28571429rem;margin-top:.35714286em}.ui.menu .pointing.dropdown.item .menu{margin-top:.75em}.ui.inverted.menu .search.dropdown.item>.search,.ui.inverted.menu .search.dropdown.item>.text{color:rgba(255,255,255,.9)}.ui.vertical.menu .dropdown.item>.icon{float:right;content:"\f0da";margin-left:1em}.ui.vertical.menu .dropdown.item .menu{top:0!important;left:100%;min-width:0;margin:0;box-shadow:0 1px 3px 0 rgba(0,0,0,.08);border-radius:0 .28571429rem .28571429rem}.ui.vertical.menu .active.dropdown.item{border-top-right-radius:0;border-bottom-right-radius:0}.ui.vertical.menu .dropdown.active.item{box-shadow:none}.ui.item.menu .dropdown .menu .item{width:100%}.ui.menu .item>.label{background:#999;color:#FFF;margin-left:1em;padding:.3em .78571429em}.ui.vertical.menu .item>.label{background:#999;color:#FFF;margin-top:-.15em;margin-bottom:-.15em;padding:.3em .78571429em;float:right;text-align:center}.ui.menu .item>.floating.label{padding:.3em .78571429em}.ui.menu .item>img:not(.ui){display:inline-block;vertical-align:middle;margin:-.3em 0;width:2.5em}.ui.vertical.menu .item>img:not(.ui):only-child{display:block;max-width:100%;width:auto}.ui.vertical.sidebar.menu>.item:first-child:before{display:block!important}.ui.vertical.sidebar.menu>.item::before{top:auto;bottom:0}@media only screen and (max-width:767px){.ui.menu>.ui.container{width:100%!important;margin-left:0!important;margin-right:0!important}}@media only screen and (min-width:768px){.ui.menu:not(.secondary):not(.text):not(.tabular):not(.borderless)>.container>.item:not(.right):not(.borderless):first-child{border-left:1px solid rgba(34,36,38,.1)}}.ui.link.menu .item:hover,.ui.menu .dropdown.item:hover,.ui.menu .link.item:hover,.ui.menu a.item:hover{cursor:pointer;background:rgba(0,0,0,.03);color:rgba(0,0,0,.95)}.ui.link.menu .item:active,.ui.menu .link.item:active,.ui.menu a.item:active{background:rgba(0,0,0,.03);color:rgba(0,0,0,.95)}.ui.menu .active.item{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95);font-weight:400;box-shadow:none}.ui.menu .active.item>i.icon{opacity:1}.ui.menu .active.item:hover,.ui.vertical.menu .active.item:hover{background-color:rgba(0,0,0,.05);color:rgba(0,0,0,.95)}.ui.menu .item.disabled,.ui.menu .item.disabled:hover{cursor:default;background-color:transparent!important;color:rgba(40,40,40,.3)}.ui.menu:not(.vertical) .left.item,.ui.menu:not(.vertical) .left.menu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-right:auto!important}.ui.menu:not(.vertical) .right.item,.ui.menu:not(.vertical) .right.menu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:auto!important}.ui.menu .right.item::before,.ui.menu .right.menu>.item::before{right:auto;left:0}.ui.vertical.menu{display:block;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;background:#FFF;box-shadow:0 1px 2px 0 rgba(34,36,38,.15)}.ui.vertical.menu .item{display:block;background:0 0;border-top:none;border-right:none}.ui.vertical.menu>.item:first-child{border-radius:.28571429rem .28571429rem 0 0}.ui.vertical.menu>.item:last-child{border-radius:0 0 .28571429rem .28571429rem}.ui.vertical.menu .item>i.icon{width:1.18em;float:right;margin:0 0 0 .5em}.ui.vertical.menu .item>.label+i.icon{float:none;margin:0 .5em 0 0}.ui.vertical.menu .item:before{position:absolute;content:'';top:0;left:0;width:100%;height:1px;background:rgba(34,36,38,.1)}.ui.vertical.menu .item:first-child:before{display:none!important}.ui.vertical.menu .item>.menu{margin:.5em -1.14285714em 0}.ui.vertical.menu .menu .item{background:0 0;padding:.5em 1.33333333em;font-size:.85714286em;color:rgba(0,0,0,.5)}.ui.vertical.menu .item .menu .link.item:hover,.ui.vertical.menu .item .menu a.item:hover{color:rgba(0,0,0,.85)}.ui.vertical.menu .menu .item:before{display:none}.ui.vertical.menu .active.item{background:rgba(0,0,0,.05);border-radius:0;box-shadow:none}.ui.vertical.menu>.active.item:first-child{border-radius:.28571429rem .28571429rem 0 0}.ui.vertical.menu>.active.item:last-child{border-radius:0 0 .28571429rem .28571429rem}.ui.vertical.menu>.active.item:only-child{border-radius:.28571429rem}.ui.vertical.menu .active.item .menu .active.item{border-left:none}.ui.vertical.menu .item .menu .active.item{background-color:transparent;font-weight:700;color:rgba(0,0,0,.95)}.ui.tabular.menu{border-radius:0;box-shadow:none!important;border:none;background:none;border-bottom:1px solid #D4D4D5}.ui.tabular.fluid.menu{width:calc(100% + 2px)!important}.ui.tabular.menu .item{background:0 0;border-bottom:none;border-left:1px solid transparent;border-right:1px solid transparent;border-top:2px solid transparent;padding:.92857143em 1.42857143em;color:rgba(0,0,0,.87)}.ui.tabular.menu .item:before{display:none}.ui.tabular.menu .item:hover{background-color:transparent;color:rgba(0,0,0,.8)}.ui.tabular.menu .active.item{background:#FFF;color:rgba(0,0,0,.95);border-top-width:1px;border-color:#D4D4D5;font-weight:700;margin-bottom:-1px;box-shadow:none;border-radius:.28571429rem .28571429rem 0 0!important}.ui.tabular.menu+.attached:not(.top).segment,.ui.tabular.menu+.attached:not(.top).segment+.attached:not(.top).segment{border-top:none;margin-left:0;margin-top:0;margin-right:0;width:100%}.top.attached.segment+.ui.bottom.tabular.menu{position:relative;width:calc(100% + 2px);left:-1px}.ui.bottom.tabular.menu{background:none;border-radius:0;box-shadow:none!important;border-bottom:none;border-top:1px solid #D4D4D5}.ui.bottom.tabular.menu .item{background:0 0;border-left:1px solid transparent;border-right:1px solid transparent;border-bottom:1px solid transparent;border-top:none}.ui.bottom.tabular.menu .active.item{background:#FFF;color:rgba(0,0,0,.95);border-color:#D4D4D5;margin:-1px 0 0;border-radius:0 0 .28571429rem .28571429rem!important}.ui.vertical.tabular.menu{background:none;border-radius:0;box-shadow:none!important;border-bottom:none;border-right:1px solid #D4D4D5}.ui.vertical.tabular.menu .item{background:0 0;border-left:1px solid transparent;border-bottom:1px solid transparent;border-top:1px solid transparent;border-right:none}.ui.vertical.tabular.menu .active.item{background:#FFF;color:rgba(0,0,0,.95);border-color:#D4D4D5;margin:0 -1px 0 0;border-radius:.28571429rem 0 0 .28571429rem!important}.ui.vertical.right.tabular.menu{background:none;border-radius:0;box-shadow:none!important;border-bottom:none;border-right:none;border-left:1px solid #D4D4D5}.ui.vertical.right.tabular.menu .item{background:0 0;border-right:1px solid transparent;border-bottom:1px solid transparent;border-top:1px solid transparent;border-left:none}.ui.vertical.right.tabular.menu .active.item{background:#FFF;color:rgba(0,0,0,.95);border-color:#D4D4D5;margin:0 0 0 -1px;border-radius:0 .28571429rem .28571429rem 0!important}.ui.tabular.menu .active.dropdown.item{margin-bottom:0;border-left:1px solid transparent;border-right:1px solid transparent;border-top:2px solid transparent;border-bottom:none}.ui.pagination.menu{margin:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.ui.pagination.menu .item:last-child{border-radius:0 .28571429rem .28571429rem 0}.ui.pagination.menu .item:last-child:before{display:none}.ui.pagination.menu .item{min-width:3em;text-align:center}.ui.pagination.menu .icon.item i.icon{vertical-align:top}.ui.pagination.menu .active.item{border-top:none;padding-top:.92857143em;background-color:rgba(0,0,0,.05);color:rgba(0,0,0,.95);box-shadow:none}.ui.secondary.menu{background:0 0;margin-left:-.35714286em;margin-right:-.35714286em;border-radius:0;border:none;box-shadow:none}.ui.secondary.menu .item{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;box-shadow:none;border:none;padding:.78571429em .92857143em;margin:0 .35714286em;background:0 0;-webkit-transition:color .1s ease;transition:color .1s ease;border-radius:.28571429rem}.ui.secondary.menu .item:before{display:none!important}.ui.secondary.menu .header.item{border-radius:0;border-right:none;background:none}.ui.secondary.menu .item>img:not(.ui){margin:0}.ui.secondary.menu .dropdown.item:hover,.ui.secondary.menu .link.item:hover,.ui.secondary.menu a.item:hover{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95)}.ui.secondary.menu .active.item{box-shadow:none;background:rgba(0,0,0,.05);color:rgba(0,0,0,.95);border-radius:.28571429rem}.ui.secondary.menu .active.item:hover{box-shadow:none;background:rgba(0,0,0,.05);color:rgba(0,0,0,.95)}.ui.secondary.inverted.menu .link.item,.ui.secondary.inverted.menu a.item{color:rgba(255,255,255,.7)!important}.ui.secondary.inverted.menu .dropdown.item:hover,.ui.secondary.inverted.menu .link.item:hover,.ui.secondary.inverted.menu a.item:hover{background:rgba(255,255,255,.08);color:#fff!important}.ui.secondary.inverted.menu .active.item{background:rgba(255,255,255,.15);color:#fff!important}.ui.secondary.item.menu{margin-left:0;margin-right:0}.ui.secondary.item.menu .item:last-child{margin-right:0}.ui.secondary.attached.menu{box-shadow:none}.ui.vertical.secondary.menu .item:not(.dropdown)>.menu{margin:0 -.92857143em}.ui.vertical.secondary.menu .item:not(.dropdown)>.menu>.item{margin:0;padding:.5em 1.33333333em}.ui.secondary.vertical.menu>.item{border:none;margin:0 0 .35714286em;border-radius:.28571429rem!important}.ui.secondary.vertical.menu>.header.item{border-radius:0}.ui.secondary.inverted.menu,.ui.vertical.secondary.menu .item>.menu .item{background-color:transparent}.ui.secondary.pointing.menu{margin-left:0;margin-right:0;border-bottom:2px solid rgba(34,36,38,.15)}.ui.secondary.pointing.menu .item{border-bottom-color:transparent;border-bottom-style:solid;border-radius:0;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;margin:0 0 -2px;padding:.85714286em 1.14285714em;border-bottom-width:2px;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.secondary.pointing.menu .header.item{color:rgba(0,0,0,.85)!important}.ui.secondary.pointing.menu .text.item{box-shadow:none!important}.ui.secondary.pointing.menu .item:after{display:none}.ui.secondary.pointing.menu .dropdown.item:hover,.ui.secondary.pointing.menu .link.item:hover,.ui.secondary.pointing.menu a.item:hover{background-color:transparent;color:rgba(0,0,0,.87)}.ui.secondary.pointing.menu .dropdown.item:active,.ui.secondary.pointing.menu .link.item:active,.ui.secondary.pointing.menu a.item:active{background-color:transparent;border-color:rgba(34,36,38,.15)}.ui.secondary.pointing.menu .active.item{background-color:transparent;box-shadow:none;border-color:#1B1C1D;font-weight:700;color:rgba(0,0,0,.95)}.ui.secondary.pointing.menu .active.item:hover{border-color:#1B1C1D;color:rgba(0,0,0,.95)}.ui.secondary.pointing.menu .active.dropdown.item{border-color:transparent}.ui.secondary.vertical.pointing.menu{border-bottom-width:0;border-right-width:2px;border-right-style:solid;border-right-color:rgba(34,36,38,.15)}.ui.secondary.vertical.pointing.menu .item{border-bottom:none;border-right-style:solid;border-right-color:transparent;border-radius:0!important;margin:0 -2px 0 0;border-right-width:2px}.ui.secondary.vertical.pointing.menu .active.item{border-color:#1B1C1D}.ui.secondary.inverted.pointing.menu{border-width:2px;border-color:rgba(34,36,38,.15)}.ui.secondary.inverted.pointing.menu .item{color:rgba(255,255,255,.9)}.ui.secondary.inverted.pointing.menu .header.item{color:#FFF!important}.ui.secondary.inverted.pointing.menu .link.item:hover,.ui.secondary.inverted.pointing.menu a.item:hover{color:rgba(0,0,0,.95)}.ui.secondary.inverted.pointing.menu .active.item{border-color:#FFF;color:#fff}.ui.text.menu{background:none;border-radius:0;box-shadow:none;border:none;margin:1em -.5em}.ui.text.menu .item{border-radius:0;box-shadow:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;margin:0;padding:.35714286em .5em;font-weight:400;color:rgba(0,0,0,.6);-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.ui.text.menu .item:before,.ui.text.menu .menu .item:before{display:none!important}.ui.text.menu .header.item{background-color:transparent;opacity:1;color:rgba(0,0,0,.85);font-size:.92857143em;text-transform:uppercase;font-weight:700}.ui.text.item.menu .item,.ui.text.menu .item>img:not(.ui){margin:0}.ui.vertical.text.menu{margin:1em 0}.ui.vertical.text.menu:first-child{margin-top:0}.ui.vertical.text.menu:last-child{margin-bottom:0}.ui.vertical.text.menu .item{margin:.57142857em 0;padding-left:0;padding-right:0}.ui.vertical.text.menu .item>i.icon{float:none;margin:0 .35714286em 0 0}.ui.vertical.text.menu .header.item{margin:.57142857em 0 .71428571em}.ui.vertical.text.menu .item:not(.dropdown)>.menu{margin:0}.ui.vertical.text.menu .item:not(.dropdown)>.menu>.item{margin:0;padding:.5em 0}.ui.text.menu .item:hover{opacity:1;background-color:transparent}.ui.text.menu .active.item{background-color:transparent;border:none;box-shadow:none;font-weight:400;color:rgba(0,0,0,.95)}.ui.text.menu .active.item:hover{background-color:transparent}.ui.text.attached.menu,.ui.text.pointing.menu .active.item:after{box-shadow:none}.ui.inverted.text.menu,.ui.inverted.text.menu .active.item,.ui.inverted.text.menu .item,.ui.inverted.text.menu .item:hover{background-color:transparent!important}.ui.fluid.text.menu{margin-left:0;margin-right:0}.ui.vertical.icon.menu{display:inline-block;width:auto}.ui.icon.menu .item{height:auto;text-align:center;color:#1B1C1D}.ui.icon.menu .item>.icon:not(.dropdown){margin:0;opacity:1}.ui.icon.menu .icon:before{opacity:1}.ui.menu .icon.item>.icon{width:auto;margin:0 auto}.ui.vertical.icon.menu .item>.icon:not(.dropdown){display:block;opacity:1;margin:0 auto;float:none}.ui.inverted.icon.menu .item{color:#FFF}.ui.labeled.icon.menu{text-align:center}.ui.labeled.icon.menu .item{min-width:6em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui.labeled.icon.menu .item>.icon:not(.dropdown){height:1em;display:block;font-size:1.71428571em!important;margin:0 auto .5rem!important}.ui.fluid.labeled.icon.menu>.item{min-width:0}@media only screen and (max-width:767px){.ui.stackable.menu{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui.stackable.menu .item{width:100%!important}.ui.stackable.menu .item:before{position:absolute;content:'';top:auto;bottom:0;left:0;width:100%;height:1px;background:rgba(34,36,38,.1)}.ui.stackable.menu .left.item,.ui.stackable.menu .left.menu{margin-right:0!important}.ui.stackable.menu .right.item,.ui.stackable.menu .right.menu{margin-left:0!important}}.ui.menu .red.active.item,.ui.red.menu .active.item{border-color:#DB2828!important;color:#DB2828!important}.ui.menu .orange.active.item,.ui.orange.menu .active.item{border-color:#F2711C!important;color:#F2711C!important}.ui.menu .yellow.active.item,.ui.yellow.menu .active.item{border-color:#FBBD08!important;color:#FBBD08!important}.ui.menu .olive.active.item,.ui.olive.menu .active.item{border-color:#B5CC18!important;color:#B5CC18!important}.ui.green.menu .active.item,.ui.menu .green.active.item{border-color:#21BA45!important;color:#21BA45!important}.ui.menu .teal.active.item,.ui.teal.menu .active.item{border-color:#00B5AD!important;color:#00B5AD!important}.ui.blue.menu .active.item,.ui.menu .blue.active.item{border-color:#2185D0!important;color:#2185D0!important}.ui.menu .violet.active.item,.ui.violet.menu .active.item{border-color:#6435C9!important;color:#6435C9!important}.ui.menu .purple.active.item,.ui.purple.menu .active.item{border-color:#A333C8!important;color:#A333C8!important}.ui.menu .pink.active.item,.ui.pink.menu .active.item{border-color:#E03997!important;color:#E03997!important}.ui.brown.menu .active.item,.ui.menu .brown.active.item{border-color:#A5673F!important;color:#A5673F!important}.ui.grey.menu .active.item,.ui.menu .grey.active.item{border-color:#767676!important;color:#767676!important}.ui.inverted.menu{border:0 solid transparent;background:#1B1C1D;box-shadow:none}.ui.inverted.menu .item,.ui.inverted.menu .item>a:not(.ui){background:0 0;color:rgba(255,255,255,.9)}.ui.inverted.menu .item.menu{background:0 0}.ui.inverted.menu .item:before,.ui.vertical.inverted.menu .item:before{background:rgba(255,255,255,.08)}.ui.vertical.inverted.menu .menu .item,.ui.vertical.inverted.menu .menu .item a:not(.ui){color:rgba(255,255,255,.5)}.ui.inverted.menu .header.item{margin:0;background:0 0;box-shadow:none}.ui.inverted.menu .item.disabled,.ui.inverted.menu .item.disabled:hover{color:rgba(225,225,225,.3)}.ui.inverted.menu .dropdown.item:hover,.ui.inverted.menu .link.item:hover,.ui.inverted.menu a.item:hover,.ui.link.inverted.menu .item:hover{background:rgba(255,255,255,.08);color:#fff}.ui.vertical.inverted.menu .item .menu .link.item:hover,.ui.vertical.inverted.menu .item .menu a.item:hover{background:0 0;color:#fff}.ui.inverted.menu .link.item:active,.ui.inverted.menu a.item:active{background:rgba(255,255,255,.08);color:#fff}.ui.inverted.menu .active.item{background:rgba(255,255,255,.15);color:#fff!important}.ui.inverted.vertical.menu .item .menu .active.item{background:0 0;color:#FFF}.ui.inverted.pointing.menu .active.item:after{background:#3D3E3F!important;margin:0!important;box-shadow:none!important;border:none!important}.ui.inverted.menu .active.item:hover{background:rgba(255,255,255,.15);color:#FFF!important}.ui.inverted.pointing.menu .active.item:hover:after{background:#3D3E3F!important}.ui.floated.menu{float:left;margin:0 .5rem 0 0}.ui.floated.menu .item:last-child:before{display:none}.ui.right.floated.menu{float:right;margin:0 0 0 .5rem}.ui.inverted.menu .red.active.item,.ui.inverted.red.menu{background-color:#DB2828}.ui.inverted.red.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.red.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .orange.active.item,.ui.inverted.orange.menu{background-color:#F2711C}.ui.inverted.orange.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.orange.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .yellow.active.item,.ui.inverted.yellow.menu{background-color:#FBBD08}.ui.inverted.yellow.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.yellow.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .olive.active.item,.ui.inverted.olive.menu{background-color:#B5CC18}.ui.inverted.olive.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.olive.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.green.menu,.ui.inverted.menu .green.active.item{background-color:#21BA45}.ui.inverted.green.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.green.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .teal.active.item,.ui.inverted.teal.menu{background-color:#00B5AD}.ui.inverted.teal.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.teal.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.blue.menu,.ui.inverted.menu .blue.active.item{background-color:#2185D0}.ui.inverted.blue.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.blue.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .violet.active.item,.ui.inverted.violet.menu{background-color:#6435C9}.ui.inverted.violet.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.violet.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .purple.active.item,.ui.inverted.purple.menu{background-color:#A333C8}.ui.inverted.purple.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.purple.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.menu .pink.active.item,.ui.inverted.pink.menu{background-color:#E03997}.ui.inverted.pink.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.pink.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.brown.menu,.ui.inverted.menu .brown.active.item{background-color:#A5673F}.ui.inverted.brown.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.brown.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.inverted.grey.menu,.ui.inverted.menu .grey.active.item{background-color:#767676}.ui.inverted.grey.menu .item:before{background-color:rgba(34,36,38,.1)}.ui.inverted.grey.menu .active.item{background-color:rgba(0,0,0,.1)!important}.ui.fitted.menu .item,.ui.fitted.menu .item .menu .item,.ui.menu .fitted.item{padding:0}.ui.horizontally.fitted.menu .item,.ui.horizontally.fitted.menu .item .menu .item,.ui.menu .horizontally.fitted.item{padding-top:.92857143em;padding-bottom:.92857143em}.ui.menu .vertically.fitted.item,.ui.vertically.fitted.menu .item,.ui.vertically.fitted.menu .item .menu .item{padding-left:1.14285714em;padding-right:1.14285714em}.ui.borderless.menu .item .menu .item:before,.ui.borderless.menu .item:before,.ui.menu .borderless.item:before{background:0 0!important}.ui.compact.menu{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin:0;vertical-align:middle}.ui.compact.vertical.menu{display:inline-block;width:auto!important}.ui.compact.menu .item:last-child{border-radius:0 .28571429rem .28571429rem 0}.ui.compact.menu .item:last-child:before{display:none}.ui.compact.vertical.menu .item:last-child::before{display:block}.ui.menu.fluid,.ui.vertical.menu.fluid{width:100%!important}.ui.item.menu,.ui.item.menu .item{width:100%;padding-left:0!important;padding-right:0!important;margin-left:0!important;margin-right:0!important;text-align:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.ui.item.menu .item:last-child:before{display:none}.ui.menu.two.item .item{width:50%}.ui.menu.three.item .item{width:33.333%}.ui.menu.four.item .item{width:25%}.ui.menu.five.item .item{width:20%}.ui.menu.six.item .item{width:16.666%}.ui.menu.seven.item .item{width:14.285%}.ui.menu.eight.item .item{width:12.5%}.ui.menu.nine.item .item{width:11.11%}.ui.menu.ten.item .item{width:10%}.ui.menu.eleven.item .item{width:9.09%}.ui.menu.twelve.item .item{width:8.333%}.ui.menu.fixed{position:fixed;z-index:101;margin:0;width:100%}.ui.menu.fixed,.ui.menu.fixed .item:first-child,.ui.menu.fixed .item:last-child{border-radius:0!important}.ui.fixed.menu,.ui[class*="top fixed"].menu{top:0;left:0;right:auto;bottom:auto}.ui[class*="top fixed"].menu{border-top:none;border-left:none;border-right:none}.ui[class*="right fixed"].menu{border-top:none;border-bottom:none;border-right:none;top:0;right:0;left:auto;bottom:auto;width:auto;height:100%}.ui[class*="bottom fixed"].menu{border-bottom:none;border-left:none;border-right:none;bottom:0;left:0;top:auto;right:auto}.ui[class*="left fixed"].menu{border-top:none;border-bottom:none;border-left:none;top:0;left:0;right:auto;bottom:auto;width:auto;height:100%}.ui.fixed.menu+.ui.grid{padding-top:2.75rem}.ui.pointing.menu .item:after{visibility:hidden;position:absolute;content:'';top:100%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);background:0 0;margin:.5px 0 0;width:.57142857em;height:.57142857em;border:none;border-bottom:1px solid #D4D4D5;border-right:1px solid #D4D4D5;z-index:2;-webkit-transition:background .1s ease;transition:background .1s ease}.ui.vertical.pointing.menu .item:after{position:absolute;top:50%;right:0;bottom:auto;left:auto;-webkit-transform:translateX(50%) translateY(-50%) rotate(45deg);transform:translateX(50%) translateY(-50%) rotate(45deg);margin:0 -.5px 0 0;border:none;border-top:1px solid #D4D4D5;border-right:1px solid #D4D4D5}.ui.pointing.menu .active.item:after{visibility:visible}.ui.pointing.menu .active.dropdown.item:after{visibility:hidden}.ui.pointing.menu .active.item .menu .active.item:after,.ui.pointing.menu .dropdown.active.item:after{display:none}.ui.pointing.menu .active.item:after,.ui.pointing.menu .active.item:hover:after,.ui.vertical.pointing.menu .active.item:after,.ui.vertical.pointing.menu .active.item:hover:after{background-color:#F2F2F2}.ui.vertical.pointing.menu .menu .active.item:after{background-color:#FFF}.ui.attached.menu{top:0;bottom:0;border-radius:0;margin:0 -1px;width:calc(100% + 2px);max-width:calc(100% + 2px);box-shadow:none}.ui.attached+.ui.attached.menu:not(.top){border-top:none}.ui[class*="top attached"].menu{bottom:0;margin-bottom:0;top:0;margin-top:1rem;border-radius:.28571429rem .28571429rem 0 0}.ui.menu[class*="top attached"]:first-child{margin-top:0}.ui[class*="bottom attached"].menu{bottom:0;margin-top:0;top:0;margin-bottom:1rem;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;border-radius:0 0 .28571429rem .28571429rem}.ui[class*="bottom attached"].menu:last-child{margin-bottom:0}.ui.top.attached.menu>.item:first-child{border-radius:.28571429rem 0 0}.ui.bottom.attached.menu>.item:first-child{border-radius:0 0 0 .28571429rem}.ui.attached.menu:not(.tabular){border:1px solid #D4D4D5}.ui.attached.inverted.menu{border:none}.ui.attached.tabular.menu{margin-left:0;margin-right:0;width:100%}.ui.mini.menu{font-size:.78571429rem}.ui.mini.vertical.menu{width:9rem}.ui.tiny.menu{font-size:.85714286rem}.ui.tiny.vertical.menu{width:11rem}.ui.small.menu{font-size:.92857143rem}.ui.small.vertical.menu{width:13rem}.ui.menu{font-size:1rem}.ui.vertical.menu{width:15rem}.ui.large.menu{font-size:1.07142857rem}.ui.large.vertical.menu{width:18rem}.ui.huge.menu{font-size:1.14285714rem}.ui.huge.vertical.menu{width:20rem}.ui.big.menu{font-size:1.21428571rem}.ui.big.vertical.menu{width:22rem}.ui.massive.menu{font-size:1.28571429rem}.ui.massive.vertical.menu{width:25rem}.ui.message{position:relative;min-height:1em;margin:1em 0;background:#F8F8F9;padding:1em 1.5em;line-height:1.4285em;color:rgba(0,0,0,.87);-webkit-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;border-radius:.28571429rem;box-shadow:0 0 0 1px rgba(34,36,38,.22) inset,0 0 0 0 transparent}.ui.message:first-child{margin-top:0}.ui.message:last-child{margin-bottom:0}.ui.message .header{display:block;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-weight:700;margin:-.14285em 0 0}.ui.message .header:not(.ui){font-size:1.14285714em}.ui.message p{opacity:.85;margin:.75em 0}.ui.message p:first-child{margin-top:0}.ui.message p:last-child{margin-bottom:0}.ui.message .header+p{margin-top:.25em}.ui.message .list:not(.ui){text-align:left;padding:0;opacity:.85;list-style-position:inside;margin:.5em 0 0}.ui.message .list:not(.ui):first-child{margin-top:0}.ui.message .list:not(.ui):last-child{margin-bottom:0}.ui.message .list:not(.ui) li{position:relative;list-style-type:none;margin:0 0 .3em 1em;padding:0}.ui.message .list:not(.ui) li:before{position:absolute;content:'•';left:-1em;height:100%;vertical-align:baseline}.ui.message .list:not(.ui) li:last-child{margin-bottom:0}.ui.message>.icon{margin-right:.6em}.ui.message>.close.icon{cursor:pointer;position:absolute;margin:0;top:.78575em;right:.5em;opacity:.7;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.ui.message>.close.icon:hover{opacity:1}.ui.message>:first-child{margin-top:0}.ui.message>:last-child{margin-bottom:0}.ui.dropdown .menu>.message{margin:0 -1px}.ui.visible.visible.visible.visible.message{display:block}.ui.icon.visible.visible.visible.visible.message{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ui.hidden.hidden.hidden.hidden.message{display:none}.ui.compact.message{display:inline-block}.ui.attached.message{margin-bottom:-1px;border-radius:.28571429rem .28571429rem 0 0;box-shadow:0 0 0 1px rgba(34,36,38,.15) inset;margin-left:-1px;margin-right:-1px}.ui.attached+.ui.attached.message:not(.top):not(.bottom){margin-top:-1px;border-radius:0}.ui.bottom.attached.message{margin-top:-1px;border-radius:0 0 .28571429rem .28571429rem;box-shadow:0 0 0 1px rgba(34,36,38,.15) inset,0 1px 2px 0 rgba(34,36,38,.15)}.ui.bottom.attached.message:not(:last-child){margin-bottom:1em}.ui.attached.icon.message{width:auto}.ui.icon.message{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.ui.icon.message>.icon:not(.close){display:block;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;line-height:1;vertical-align:middle;font-size:3em;opacity:.8}.ui.icon.message>.content{display:block;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;vertical-align:middle}.ui.icon.message .icon:not(.close)+.content{padding-left:0}.ui.icon.message .circular.icon{width:1em}.ui.floating.message{box-shadow:0 0 0 1px rgba(34,36,38,.22) inset,0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15)}.ui.positive.message{background-color:#FCFFF5;color:#2C662D}.ui.attached.positive.message,.ui.positive.message{box-shadow:0 0 0 1px #A3C293 inset,0 0 0 0 transparent}.ui.positive.message .header{color:#1A531B}.ui.negative.message{background-color:#FFF6F6;color:#9F3A38}.ui.attached.negative.message,.ui.negative.message{box-shadow:0 0 0 1px #E0B4B4 inset,0 0 0 0 transparent}.ui.negative.message .header{color:#912D2B}.ui.info.message{background-color:#F8FFFF;color:#276F86}.ui.attached.info.message,.ui.info.message{box-shadow:0 0 0 1px #A9D5DE inset,0 0 0 0 transparent}.ui.info.message .header{color:#0E566C}.ui.warning.message{background-color:#FFFAF3;color:#573A08}.ui.attached.warning.message,.ui.warning.message{box-shadow:0 0 0 1px #C9BA9B inset,0 0 0 0 transparent}.ui.warning.message .header{color:#794B02}.ui.error.message{background-color:#FFF6F6;color:#9F3A38}.ui.attached.error.message,.ui.error.message{box-shadow:0 0 0 1px #E0B4B4 inset,0 0 0 0 transparent}.ui.error.message .header{color:#912D2B}.ui.success.message{background-color:#FCFFF5;color:#2C662D}.ui.attached.success.message,.ui.success.message{box-shadow:0 0 0 1px #A3C293 inset,0 0 0 0 transparent}.ui.success.message .header{color:#1A531B}.ui.black.message,.ui.inverted.message{background-color:#1B1C1D;color:rgba(255,255,255,.9)}.ui.red.message{background-color:#FFE8E6;color:#DB2828;box-shadow:0 0 0 1px #DB2828 inset,0 0 0 0 transparent}.ui.red.message .header{color:#c82121}.ui.orange.message{background-color:#FFEDDE;color:#F2711C;box-shadow:0 0 0 1px #F2711C inset,0 0 0 0 transparent}.ui.orange.message .header{color:#e7640d}.ui.yellow.message{background-color:#FFF8DB;color:#B58105;box-shadow:0 0 0 1px #B58105 inset,0 0 0 0 transparent}.ui.yellow.message .header{color:#9c6f04}.ui.olive.message{background-color:#FBFDEF;color:#8ABC1E;box-shadow:0 0 0 1px #8ABC1E inset,0 0 0 0 transparent}.ui.olive.message .header{color:#7aa61a}.ui.green.message{background-color:#E5F9E7;color:#1EBC30;box-shadow:0 0 0 1px #1EBC30 inset,0 0 0 0 transparent}.ui.green.message .header{color:#1aa62a}.ui.teal.message{background-color:#E1F7F7;color:#10A3A3;box-shadow:0 0 0 1px #10A3A3 inset,0 0 0 0 transparent}.ui.teal.message .header{color:#0e8c8c}.ui.blue.message{background-color:#DFF0FF;color:#2185D0;box-shadow:0 0 0 1px #2185D0 inset,0 0 0 0 transparent}.ui.blue.message .header{color:#1e77ba}.ui.violet.message{background-color:#EAE7FF;color:#6435C9;box-shadow:0 0 0 1px #6435C9 inset,0 0 0 0 transparent}.ui.violet.message .header{color:#5a30b5}.ui.purple.message{background-color:#F6E7FF;color:#A333C8;box-shadow:0 0 0 1px #A333C8 inset,0 0 0 0 transparent}.ui.purple.message .header{color:#922eb4}.ui.pink.message{background-color:#FFE3FB;color:#E03997;box-shadow:0 0 0 1px #E03997 inset,0 0 0 0 transparent}.ui.pink.message .header{color:#dd238b}.ui.brown.message{background-color:#F1E2D3;color:#A5673F;box-shadow:0 0 0 1px #A5673F inset,0 0 0 0 transparent}.ui.brown.message .header{color:#935b38}.ui.mini.message{font-size:.78571429em}.ui.tiny.message{font-size:.85714286em}.ui.small.message{font-size:.92857143em}.ui.message{font-size:1em}.ui.large.message{font-size:1.14285714em}.ui.big.message{font-size:1.28571429em}.ui.huge.message{font-size:1.42857143em}.ui.massive.message{font-size:1.71428571em}.ui.table{width:100%;background:#FFF;margin:1em 0;border:1px solid rgba(34,36,38,.15);box-shadow:none;border-radius:.28571429rem;text-align:left;color:rgba(0,0,0,.87);border-collapse:separate;border-spacing:0}.ui.table:first-child{margin-top:0}.ui.table:last-child{margin-bottom:0}.ui.table td,.ui.table th{-webkit-transition:background .1s ease,color .1s ease;transition:background .1s ease,color .1s ease}.ui.table thead{box-shadow:none}.ui.table thead th{cursor:auto;background:#F9FAFB;text-align:inherit;color:rgba(0,0,0,.87);padding:.92857143em .78571429em;vertical-align:inherit;font-style:none;font-weight:700;text-transform:none;border-bottom:1px solid rgba(34,36,38,.1);border-left:none}.ui.table thead tr>th:first-child{border-left:none}.ui.table thead tr:first-child>th:first-child{border-radius:.28571429rem 0 0}.ui.table thead tr:first-child>th:last-child{border-radius:0 .28571429rem 0 0}.ui.table thead tr:first-child>th:only-child{border-radius:.28571429rem .28571429rem 0 0}.ui.table tfoot{box-shadow:none}.ui.table tfoot th{cursor:auto;border-top:1px solid rgba(34,36,38,.15);background:#F9FAFB;text-align:inherit;color:rgba(0,0,0,.87);padding:.78571429em;vertical-align:middle;font-style:normal;font-weight:400;text-transform:none}.ui.table tfoot tr>th:first-child{border-left:none}.ui.table tfoot tr:first-child>th:first-child{border-radius:0 0 0 .28571429rem}.ui.table tfoot tr:first-child>th:last-child{border-radius:0 0 .28571429rem}.ui.table tfoot tr:first-child>th:only-child{border-radius:0 0 .28571429rem .28571429rem}.ui.table tr td{border-top:1px solid rgba(34,36,38,.1)}.ui.table tr:first-child td{border-top:none}.ui.table td{padding:.78571429em;text-align:inherit}.ui.table>.icon{vertical-align:baseline}.ui.table>.icon:only-child{margin:0}.ui.table.segment{padding:0}.ui.table.segment:after{display:none}.ui.table.segment.stacked:after{display:block}@media only screen and (max-width:767px){.ui.table:not(.unstackable){width:100%;padding:0}.ui.table:not(.unstackable) tbody,.ui.table:not(.unstackable) tr,.ui.table:not(.unstackable) tr>td,.ui.table:not(.unstackable) tr>th{width:auto!important;display:block!important}.ui.table:not(.unstackable) tfoot,.ui.table:not(.unstackable) thead{display:block}.ui.table:not(.unstackable) tr{padding-top:1em;padding-bottom:1em;box-shadow:0 -1px 0 0 rgba(0,0,0,.1) inset!important}.ui.table:not(.unstackable) tr>td,.ui.table:not(.unstackable) tr>th{background:0 0;border:none!important;padding:.25em .75em!important;box-shadow:none!important}.ui.table:not(.unstackable) td:first-child,.ui.table:not(.unstackable) th:first-child{font-weight:700}.ui.definition.table:not(.unstackable) thead th:first-child{box-shadow:none!important}}.ui.table td .image,.ui.table td .image img,.ui.table th .image,.ui.table th .image img{max-width:none}.ui.structured.table{border-collapse:collapse}.ui.structured.table thead th{border-left:none;border-right:none}.ui.structured.sortable.table thead th{border-left:1px solid rgba(34,36,38,.15);border-right:1px solid rgba(34,36,38,.15)}.ui.structured.basic.table th{border-left:none;border-right:none}.ui.structured.celled.table tr td,.ui.structured.celled.table tr th{border-left:1px solid rgba(34,36,38,.1);border-right:1px solid rgba(34,36,38,.1)}.ui.definition.table thead:not(.full-width) th:first-child{pointer-events:none;background:0 0;font-weight:400;color:rgba(0,0,0,.4);box-shadow:-1px -1px 0 1px #FFF}.ui.definition.table tfoot:not(.full-width) th:first-child{pointer-events:none;background:0 0;font-weight:rgba(0,0,0,.4);color:normal;box-shadow:1px 1px 0 1px #FFF}.ui.celled.definition.table thead:not(.full-width) th:first-child{box-shadow:0 -1px 0 1px #FFF}.ui.celled.definition.table tfoot:not(.full-width) th:first-child{box-shadow:0 1px 0 1px #FFF}.ui.definition.table tr td.definition,.ui.definition.table tr td:first-child:not(.ignored){background:rgba(0,0,0,.03);font-weight:700;color:rgba(0,0,0,.95);text-transform:'';box-shadow:'';text-align:'';font-size:1em;padding-left:'';padding-right:''}.ui.definition.table td:nth-child(2),.ui.definition.table tfoot:not(.full-width) th:nth-child(2),.ui.definition.table thead:not(.full-width) th:nth-child(2){border-left:1px solid rgba(34,36,38,.15)}.ui.table td.positive,.ui.table tr.positive{box-shadow:0 0 0 #A3C293 inset;background:#FCFFF5!important;color:#2C662D!important}.ui.table td.negative,.ui.table tr.negative{box-shadow:0 0 0 #E0B4B4 inset;background:#FFF6F6!important;color:#9F3A38!important}.ui.table td.error,.ui.table tr.error{box-shadow:0 0 0 #E0B4B4 inset;background:#FFF6F6!important;color:#9F3A38!important}.ui.table td.warning,.ui.table tr.warning{box-shadow:0 0 0 #C9BA9B inset;background:#FFFAF3!important;color:#573A08!important}.ui.table td.active,.ui.table tr.active{box-shadow:0 0 0 rgba(0,0,0,.87) inset;background:#E0E0E0!important;color:rgba(0,0,0,.87)!important}.ui.table tr td.disabled,.ui.table tr.disabled td,.ui.table tr.disabled:hover,.ui.table tr:hover td.disabled{pointer-events:none;color:rgba(40,40,40,.3)}@media only screen and (max-width:991px){.ui[class*="tablet stackable"].table,.ui[class*="tablet stackable"].table tbody,.ui[class*="tablet stackable"].table tr,.ui[class*="tablet stackable"].table tr>td,.ui[class*="tablet stackable"].table tr>th{width:100%!important;display:block!important}.ui[class*="tablet stackable"].table{padding:0}.ui[class*="tablet stackable"].table tfoot,.ui[class*="tablet stackable"].table thead{display:block}.ui[class*="tablet stackable"].table tr{padding-top:1em;padding-bottom:1em;box-shadow:0 -1px 0 0 rgba(0,0,0,.1) inset!important}.ui[class*="tablet stackable"].table tr>td,.ui[class*="tablet stackable"].table tr>th{background:0 0;border:none!important;padding:.25em .75em;box-shadow:none!important}.ui.definition[class*="tablet stackable"].table thead th:first-child{box-shadow:none!important}}.ui.table [class*="left aligned"],.ui.table[class*="left aligned"]{text-align:left}.ui.table [class*="center aligned"],.ui.table[class*="center aligned"]{text-align:center}.ui.table [class*="right aligned"],.ui.table[class*="right aligned"]{text-align:right}.ui.table [class*="top aligned"],.ui.table[class*="top aligned"]{vertical-align:top}.ui.table [class*="middle aligned"],.ui.table[class*="middle aligned"]{vertical-align:middle}.ui.table [class*="bottom aligned"],.ui.table[class*="bottom aligned"]{vertical-align:bottom}.ui.table td.collapsing,.ui.table th.collapsing{width:1px;white-space:nowrap}.ui.fixed.table{table-layout:fixed}.ui.fixed.table td,.ui.fixed.table th{overflow:hidden;text-overflow:ellipsis}.ui.selectable.table tbody tr:hover,.ui.table tbody tr td.selectable:hover{background:rgba(0,0,0,.05)!important;color:rgba(0,0,0,.95)!important}.ui.inverted.table tbody tr td.selectable:hover,.ui.selectable.inverted.table tbody tr:hover{background:rgba(255,255,255,.08)!important;color:#fff!important}.ui.table tbody tr td.selectable{padding:0}.ui.table tbody tr td.selectable>a:not(.ui){display:block;color:inherit;padding:.78571429em}.ui.selectable.table tr.error:hover,.ui.selectable.table tr:hover td.error,.ui.table tr td.selectable.error:hover{background:#ffe7e7!important;color:#943634!important}.ui.selectable.table tr.warning:hover,.ui.selectable.table tr:hover td.warning,.ui.table tr td.selectable.warning:hover{background:#fff4e4!important;color:#493107!important}.ui.selectable.table tr.active:hover,.ui.selectable.table tr:hover td.active,.ui.table tr td.selectable.active:hover{background:#E0E0E0!important;color:rgba(0,0,0,.87)!important}.ui.selectable.table tr.positive:hover,.ui.selectable.table tr:hover td.positive,.ui.table tr td.selectable.positive:hover{background:#f7ffe6!important;color:#275b28!important}.ui.selectable.table tr.negative:hover,.ui.selectable.table tr:hover td.negative,.ui.table tr td.selectable.negative:hover{background:#ffe7e7!important;color:#943634!important}.ui.attached.table{top:0;bottom:0;border-radius:0;margin:0 -1px;width:calc(100% + 2px);max-width:calc(100% + 2px);box-shadow:none;border:1px solid #D4D4D5}.ui.attached+.ui.attached.table:not(.top){border-top:none}.ui[class*="top attached"].table{bottom:0;margin-bottom:0;top:0;margin-top:1em;border-radius:.28571429rem .28571429rem 0 0}.ui.table[class*="top attached"]:first-child{margin-top:0}.ui[class*="bottom attached"].table{bottom:0;margin-top:0;top:0;margin-bottom:1em;box-shadow:none,none;border-radius:0 0 .28571429rem .28571429rem}.ui[class*="bottom attached"].table:last-child{margin-bottom:0}.ui.striped.table tbody tr:nth-child(2n),.ui.striped.table>tr:nth-child(2n){background-color:rgba(0,0,50,.02)}.ui.inverted.striped.table tbody tr:nth-child(2n),.ui.inverted.striped.table>tr:nth-child(2n){background-color:rgba(255,255,255,.05)}.ui.striped.selectable.selectable.selectable.table tbody tr.active:hover{background:#EFEFEF!important;color:rgba(0,0,0,.95)!important}.ui.table [class*="single line"],.ui.table[class*="single line"]{white-space:nowrap}.ui.red.table{border-top:.2em solid #DB2828}.ui.inverted.red.table{background-color:#DB2828!important;color:#FFF!important}.ui.orange.table{border-top:.2em solid #F2711C}.ui.inverted.orange.table{background-color:#F2711C!important;color:#FFF!important}.ui.yellow.table{border-top:.2em solid #FBBD08}.ui.inverted.yellow.table{background-color:#FBBD08!important;color:#FFF!important}.ui.olive.table{border-top:.2em solid #B5CC18}.ui.inverted.olive.table{background-color:#B5CC18!important;color:#FFF!important}.ui.green.table{border-top:.2em solid #21BA45}.ui.inverted.green.table{background-color:#21BA45!important;color:#FFF!important}.ui.teal.table{border-top:.2em solid #00B5AD}.ui.inverted.teal.table{background-color:#00B5AD!important;color:#FFF!important}.ui.blue.table{border-top:.2em solid #2185D0}.ui.inverted.blue.table{background-color:#2185D0!important;color:#FFF!important}.ui.violet.table{border-top:.2em solid #6435C9}.ui.inverted.violet.table{background-color:#6435C9!important;color:#FFF!important}.ui.purple.table{border-top:.2em solid #A333C8}.ui.inverted.purple.table{background-color:#A333C8!important;color:#FFF!important}.ui.pink.table{border-top:.2em solid #E03997}.ui.inverted.pink.table{background-color:#E03997!important;color:#FFF!important}.ui.brown.table{border-top:.2em solid #A5673F}.ui.inverted.brown.table{background-color:#A5673F!important;color:#FFF!important}.ui.grey.table{border-top:.2em solid #767676}.ui.inverted.grey.table{background-color:#767676!important;color:#FFF!important}.ui.black.table{border-top:.2em solid #1B1C1D}.ui.inverted.black.table{background-color:#1B1C1D!important;color:#FFF!important}.ui.one.column.table td{width:100%}.ui.two.column.table td{width:50%}.ui.three.column.table td{width:33.33333333%}.ui.four.column.table td{width:25%}.ui.five.column.table td{width:20%}.ui.six.column.table td{width:16.66666667%}.ui.seven.column.table td{width:14.28571429%}.ui.eight.column.table td{width:12.5%}.ui.nine.column.table td{width:11.11111111%}.ui.ten.column.table td{width:10%}.ui.eleven.column.table td{width:9.09090909%}.ui.twelve.column.table td{width:8.33333333%}.ui.thirteen.column.table td{width:7.69230769%}.ui.fourteen.column.table td{width:7.14285714%}.ui.fifteen.column.table td{width:6.66666667%}.ui.sixteen.column.table td,.ui.table td.one.wide,.ui.table th.one.wide{width:6.25%}.ui.table td.two.wide,.ui.table th.two.wide{width:12.5%}.ui.table td.three.wide,.ui.table th.three.wide{width:18.75%}.ui.table td.four.wide,.ui.table th.four.wide{width:25%}.ui.table td.five.wide,.ui.table th.five.wide{width:31.25%}.ui.table td.six.wide,.ui.table th.six.wide{width:37.5%}.ui.table td.seven.wide,.ui.table th.seven.wide{width:43.75%}.ui.table td.eight.wide,.ui.table th.eight.wide{width:50%}.ui.table td.nine.wide,.ui.table th.nine.wide{width:56.25%}.ui.table td.ten.wide,.ui.table th.ten.wide{width:62.5%}.ui.table td.eleven.wide,.ui.table th.eleven.wide{width:68.75%}.ui.table td.twelve.wide,.ui.table th.twelve.wide{width:75%}.ui.table td.thirteen.wide,.ui.table th.thirteen.wide{width:81.25%}.ui.table td.fourteen.wide,.ui.table th.fourteen.wide{width:87.5%}.ui.table td.fifteen.wide,.ui.table th.fifteen.wide{width:93.75%}.ui.table td.sixteen.wide,.ui.table th.sixteen.wide{width:100%}.ui.sortable.table thead th{cursor:pointer;white-space:nowrap;border-left:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87)}.ui.sortable.table thead th:first-child{border-left:none}.ui.sortable.table thead th.sorted,.ui.sortable.table thead th.sorted:hover{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui.sortable.table thead th:after{display:none;font-style:normal;font-weight:400;text-decoration:inherit;content:'';height:1em;width:auto;opacity:.8;margin:0 0 0 .5em;font-family:Icons}.ui.sortable.table thead th.ascending:after{content:'\f0d8'}.ui.sortable.table thead th.descending:after{content:'\f0d7'}.ui.sortable.table th.disabled:hover{cursor:auto;color:rgba(40,40,40,.3)}.ui.sortable.table thead th:hover{background:rgba(0,0,0,.05);color:rgba(0,0,0,.8)}.ui.sortable.table thead th.sorted{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95)}.ui.sortable.table thead th.sorted:after{display:inline-block}.ui.sortable.table thead th.sorted:hover{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95)}.ui.inverted.sortable.table thead th.sorted{background:-webkit-linear-gradient(transparent,rgba(0,0,0,.05)) rgba(255,255,255,.15);background:linear-gradient(transparent,rgba(0,0,0,.05)) rgba(255,255,255,.15);color:#fff}.ui.inverted.sortable.table thead th:hover{background:-webkit-linear-gradient(transparent,rgba(0,0,0,.05)) rgba(255,255,255,.08);background:linear-gradient(transparent,rgba(0,0,0,.05)) rgba(255,255,255,.08);color:#fff}.ui.inverted.sortable.table thead th{border-left-color:transparent;border-right-color:transparent}.ui.inverted.table{background:#333;color:rgba(255,255,255,.9);border:none}.ui.inverted.table th{background-color:rgba(0,0,0,.15);border-color:rgba(255,255,255,.1)!important;color:rgba(255,255,255,.9)}.ui.inverted.table tr td{border-color:rgba(255,255,255,.1)!important}.ui.inverted.table tr td.disabled,.ui.inverted.table tr.disabled td,.ui.inverted.table tr.disabled:hover td,.ui.inverted.table tr:hover td.disabled{pointer-events:none;color:rgba(225,225,225,.3)}.ui.inverted.definition.table tfoot:not(.full-width) th:first-child,.ui.inverted.definition.table thead:not(.full-width) th:first-child{background:#FFF}.ui.inverted.definition.table tr td:first-child{background:rgba(255,255,255,.02);color:#fff}.ui.collapsing.table{width:auto}.ui.basic.table{background:0 0;border:1px solid rgba(34,36,38,.15);box-shadow:none}.ui.basic.table tfoot,.ui.basic.table thead{box-shadow:none}.ui.basic.table th{background:0 0;border-left:none}.ui.basic.table tbody tr{border-bottom:1px solid rgba(0,0,0,.1)}.ui.basic.table td{background:0 0}.ui.basic.striped.table tbody tr:nth-child(2n){background-color:rgba(0,0,0,.05)!important}.ui[class*="very basic"].table{border:none}.ui[class*="very basic"].table:not(.sortable):not(.striped) td,.ui[class*="very basic"].table:not(.sortable):not(.striped) th{padding:''}.ui[class*="very basic"].table:not(.sortable):not(.striped) td:first-child,.ui[class*="very basic"].table:not(.sortable):not(.striped) th:first-child{padding-left:0}.ui[class*="very basic"].table:not(.sortable):not(.striped) td:last-child,.ui[class*="very basic"].table:not(.sortable):not(.striped) th:last-child{padding-right:0}.ui[class*="very basic"].table:not(.sortable):not(.striped) thead tr:first-child th{padding-top:0}.ui.celled.table tr td,.ui.celled.table tr th{border-left:1px solid rgba(34,36,38,.1)}.ui.celled.table tr td:first-child,.ui.celled.table tr th:first-child{border-left:none}.ui.padded.table th{padding-left:1em;padding-right:1em}.ui.padded.table td,.ui.padded.table th{padding:1em}.ui[class*="very padded"].table th{padding-left:1.5em;padding-right:1.5em}.ui[class*="very padded"].table td{padding:1.5em}.ui.compact.table th{padding-left:.7em;padding-right:.7em}.ui.compact.table td{padding:.5em .7em}.ui[class*="very compact"].table th{padding-left:.6em;padding-right:.6em}.ui[class*="very compact"].table td{padding:.4em .6em}.ui.small.table{font-size:.9em}.ui.table{font-size:1em}.ui.large.table{font-size:1.1em}.ui.ad{display:block;overflow:hidden;margin:1em 0}.ui.ad:first-child,.ui.ad:last-child{margin:0}.ui.ad iframe{margin:0;padding:0;border:none;overflow:hidden}.ui.leaderboard.ad{width:728px;height:90px}.ui[class*="medium rectangle"].ad{width:300px;height:250px}.ui[class*="large rectangle"].ad{width:336px;height:280px}.ui[class*="half page"].ad{width:300px;height:600px}.ui.square.ad{width:250px;height:250px}.ui[class*="small square"].ad{width:200px;height:200px}.ui[class*="small rectangle"].ad{width:180px;height:150px}.ui[class*="vertical rectangle"].ad{width:240px;height:400px}.ui.button.ad{width:120px;height:90px}.ui[class*="square button"].ad{width:125px;height:125px}.ui[class*="small button"].ad{width:120px;height:60px}.ui.skyscraper.ad{width:120px;height:600px}.ui[class*="wide skyscraper"].ad{width:160px}.ui.banner.ad{width:468px;height:60px}.ui[class*="vertical banner"].ad{width:120px;height:240px}.ui[class*="top banner"].ad{width:930px;height:180px}.ui[class*="half banner"].ad{width:234px;height:60px}.ui[class*="large leaderboard"].ad{width:970px;height:90px}.ui.billboard.ad{width:970px;height:250px}.ui.panorama.ad{width:980px;height:120px}.ui.netboard.ad{width:580px;height:400px}.ui[class*="large mobile banner"].ad{width:320px;height:100px}.ui[class*="mobile leaderboard"].ad{width:320px;height:50px}.ui.mobile.ad{display:none}@media only screen and (max-width:767px){.ui.mobile.ad{display:block}}.ui.centered.ad{margin-left:auto;margin-right:auto}.ui.test.ad{position:relative;background:#545454}.ui.test.ad:after{position:absolute;top:50%;left:50%;width:100%;text-align:center;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);content:'Ad';color:#FFF;font-size:1em;font-weight:700}.ui.mobile.test.ad:after{font-size:.85714286em}.ui.test.ad[data-text]:after{content:attr(data-text)}.ui.card,.ui.cards>.card{max-width:100%;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:290px;min-height:0;background:#FFF;padding:0;border:none;border-radius:.28571429rem;box-shadow:0 1px 3px 0 #D4D4D5,0 0 0 1px #D4D4D5;-webkit-transition:box-shadow .1s ease,-webkit-transform .1s ease;transition:box-shadow .1s ease,-webkit-transform .1s ease;transition:box-shadow .1s ease,transform .1s ease;transition:box-shadow .1s ease,transform .1s ease,-webkit-transform .1s ease;z-index:''}.ui.card{margin:1em 0}.ui.card a,.ui.cards>.card a{cursor:pointer}.ui.card:first-child{margin-top:0}.ui.card:last-child{margin-bottom:0}.ui.cards{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:-.875em -.5em;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ui.cards>.card{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:.875em .5em;float:none}.ui.card:after,.ui.cards:after{display:block;content:' ';height:0;clear:both;overflow:hidden;visibility:hidden}.ui.cards~.ui.cards{margin-top:.875em}.ui.card>:first-child,.ui.cards>.card>:first-child{border-radius:.28571429rem .28571429rem 0 0!important;border-top:none!important}.ui.card>:last-child,.ui.cards>.card>:last-child{border-radius:0 0 .28571429rem .28571429rem!important}.ui.card>:only-child,.ui.cards>.card>:only-child{border-radius:.28571429rem!important}.ui.card>.image,.ui.cards>.card>.image{position:relative;display:block;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;padding:0;background:rgba(0,0,0,.05)}.ui.card>.image>img,.ui.cards>.card>.image>img{display:block;width:100%;height:auto;border-radius:inherit}.ui.card>.image:not(.ui)>img,.ui.cards>.card>.image:not(.ui)>img{border:none}.ui.card>.content,.ui.cards>.card>.content{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;border:none;border-top:1px solid rgba(34,36,38,.1);background:0 0;margin:0;padding:1em;box-shadow:none;font-size:1em;border-radius:0}.ui.card>.content:after,.ui.cards>.card>.content:after{display:block;content:' ';height:0;clear:both;overflow:hidden;visibility:hidden}.ui.card>.content>.header,.ui.cards>.card>.content>.header{display:block;margin:'';font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;color:rgba(0,0,0,.85)}.ui.card>.content>.header:not(.ui),.ui.cards>.card>.content>.header:not(.ui){font-weight:700;font-size:1.28571429em;margin-top:-.21425em;line-height:1.2857em}.ui.card>.content>.header+.description,.ui.card>.content>.meta+.description,.ui.cards>.card>.content>.header+.description,.ui.cards>.card>.content>.meta+.description{margin-top:.5em}.ui.card [class*="left floated"],.ui.cards>.card [class*="left floated"]{float:left}.ui.card [class*="right floated"],.ui.cards>.card [class*="right floated"]{float:right}.ui.card [class*="left aligned"],.ui.cards>.card [class*="left aligned"]{text-align:left}.ui.card [class*="center aligned"],.ui.cards>.card [class*="center aligned"]{text-align:center}.ui.card [class*="right aligned"],.ui.cards>.card [class*="right aligned"]{text-align:right}.ui.card .content img,.ui.cards>.card .content img{display:inline-block;vertical-align:middle;width:''}.ui.card .avatar img,.ui.card img.avatar,.ui.cards>.card .avatar img,.ui.cards>.card img.avatar{width:2em;height:2em;border-radius:500rem}.ui.card>.content>.description,.ui.cards>.card>.content>.description{clear:both;color:rgba(0,0,0,.68)}.ui.card>.content p,.ui.cards>.card>.content p{margin:0 0 .5em}.ui.card>.content p:last-child,.ui.cards>.card>.content p:last-child{margin-bottom:0}.ui.card .meta,.ui.cards>.card .meta{font-size:1em;color:rgba(0,0,0,.4)}.ui.card .meta *,.ui.cards>.card .meta *{margin-right:.3em}.ui.card .meta :last-child,.ui.cards>.card .meta :last-child{margin-right:0}.ui.card .meta [class*="right floated"],.ui.cards>.card .meta [class*="right floated"]{margin-right:0;margin-left:.3em}.ui.card>.content a:not(.ui),.ui.cards>.card>.content a:not(.ui){color:'';-webkit-transition:color .1s ease;transition:color .1s ease}.ui.card>.content a:not(.ui):hover,.ui.cards>.card>.content a:not(.ui):hover{color:''}.ui.card>.content>a.header,.ui.cards>.card>.content>a.header{color:rgba(0,0,0,.85)}.ui.card>.content>a.header:hover,.ui.cards>.card>.content>a.header:hover{color:#1e70bf}.ui.card .meta>a:not(.ui),.ui.cards>.card .meta>a:not(.ui){color:rgba(0,0,0,.4)}.ui.card .meta>a:not(.ui):hover,.ui.cards>.card .meta>a:not(.ui):hover{color:rgba(0,0,0,.87)}.ui.card>.button,.ui.card>.buttons,.ui.cards>.card>.button,.ui.cards>.card>.buttons{margin:0 -1px;width:calc(100% + 2px)}.ui.card .dimmer,.ui.cards>.card .dimmer{background-color:'';z-index:10}.ui.card>.content .star.icon,.ui.cards>.card>.content .star.icon{cursor:pointer;opacity:.75;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.card>.content .star.icon:hover,.ui.cards>.card>.content .star.icon:hover{opacity:1;color:#FFB70A}.ui.card>.content .active.star.icon,.ui.cards>.card>.content .active.star.icon{color:#FFE623}.ui.card>.content .like.icon,.ui.cards>.card>.content .like.icon{cursor:pointer;opacity:.75;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.card>.content .like.icon:hover,.ui.cards>.card>.content .like.icon:hover{opacity:1;color:#FF2733}.ui.card>.content .active.like.icon,.ui.cards>.card>.content .active.like.icon{color:#FF2733}.ui.card>.extra,.ui.cards>.card>.extra{max-width:100%;min-height:0!important;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;border-top:1px solid rgba(0,0,0,.05)!important;position:static;background:0 0;width:auto;margin:0;padding:.75em 1em;top:0;left:0;color:rgba(0,0,0,.4);box-shadow:none;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.card>.extra a:not(.ui),.ui.cards>.card>.extra a:not(.ui){color:rgba(0,0,0,.4)}.ui.card>.extra a:not(.ui):hover,.ui.cards>.card>.extra a:not(.ui):hover{color:#1e70bf}.ui.link.cards .raised.card:hover,.ui.link.raised.card:hover,.ui.raised.cards a.card:hover,a.ui.raised.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 4px 0 rgba(34,36,38,.15),0 2px 10px 0 rgba(34,36,38,.25)}.ui.raised.card,.ui.raised.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15)}.ui.centered.cards{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.ui.centered.card{margin-left:auto;margin-right:auto}.ui.fluid.card{width:100%;max-width:9999px}.ui.cards a.card,.ui.link.card,.ui.link.cards .card,a.ui.card{-webkit-transform:none;transform:none}.ui.cards a.card:hover,.ui.link.card:hover,.ui.link.cards .card:hover,a.ui.card:hover{cursor:pointer;z-index:5;background:#FFF;border:none;box-shadow:0 1px 3px 0 #BCBDBD,0 0 0 1px #D4D4D5;-webkit-transform:translateY(-3px);transform:translateY(-3px)}.ui.cards>.red.card,.ui.red.card,.ui.red.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #DB2828,0 1px 3px 0 #D4D4D5}.ui.cards>.red.card:hover,.ui.red.card:hover,.ui.red.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #d01919,0 1px 3px 0 #BCBDBD}.ui.cards>.orange.card,.ui.orange.card,.ui.orange.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #F2711C,0 1px 3px 0 #D4D4D5}.ui.cards>.orange.card:hover,.ui.orange.card:hover,.ui.orange.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #f26202,0 1px 3px 0 #BCBDBD}.ui.cards>.yellow.card,.ui.yellow.card,.ui.yellow.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #FBBD08,0 1px 3px 0 #D4D4D5}.ui.cards>.yellow.card:hover,.ui.yellow.card:hover,.ui.yellow.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #eaae00,0 1px 3px 0 #BCBDBD}.ui.cards>.olive.card,.ui.olive.card,.ui.olive.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #B5CC18,0 1px 3px 0 #D4D4D5}.ui.cards>.olive.card:hover,.ui.olive.card:hover,.ui.olive.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #a7bd0d,0 1px 3px 0 #BCBDBD}.ui.cards>.green.card,.ui.green.card,.ui.green.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #21BA45,0 1px 3px 0 #D4D4D5}.ui.cards>.green.card:hover,.ui.green.card:hover,.ui.green.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #16ab39,0 1px 3px 0 #BCBDBD}.ui.cards>.teal.card,.ui.teal.card,.ui.teal.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #00B5AD,0 1px 3px 0 #D4D4D5}.ui.cards>.teal.card:hover,.ui.teal.card:hover,.ui.teal.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #009c95,0 1px 3px 0 #BCBDBD}.ui.blue.card,.ui.blue.cards>.card,.ui.cards>.blue.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #2185D0,0 1px 3px 0 #D4D4D5}.ui.blue.card:hover,.ui.blue.cards>.card:hover,.ui.cards>.blue.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #1678c2,0 1px 3px 0 #BCBDBD}.ui.cards>.violet.card,.ui.violet.card,.ui.violet.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #6435C9,0 1px 3px 0 #D4D4D5}.ui.cards>.violet.card:hover,.ui.violet.card:hover,.ui.violet.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #5829bb,0 1px 3px 0 #BCBDBD}.ui.cards>.purple.card,.ui.purple.card,.ui.purple.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #A333C8,0 1px 3px 0 #D4D4D5}.ui.cards>.purple.card:hover,.ui.purple.card:hover,.ui.purple.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #9627ba,0 1px 3px 0 #BCBDBD}.ui.cards>.pink.card,.ui.pink.card,.ui.pink.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #E03997,0 1px 3px 0 #D4D4D5}.ui.cards>.pink.card:hover,.ui.pink.card:hover,.ui.pink.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #e61a8d,0 1px 3px 0 #BCBDBD}.ui.brown.card,.ui.brown.cards>.card,.ui.cards>.brown.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #A5673F,0 1px 3px 0 #D4D4D5}.ui.brown.card:hover,.ui.brown.cards>.card:hover,.ui.cards>.brown.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #975b33,0 1px 3px 0 #BCBDBD}.ui.cards>.grey.card,.ui.grey.card,.ui.grey.cards>.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #767676,0 1px 3px 0 #D4D4D5}.ui.cards>.grey.card:hover,.ui.grey.card:hover,.ui.grey.cards>.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #838383,0 1px 3px 0 #BCBDBD}.ui.black.card,.ui.black.cards>.card,.ui.cards>.black.card{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #1B1C1D,0 1px 3px 0 #D4D4D5}.ui.black.card:hover,.ui.black.cards>.card:hover,.ui.cards>.black.card:hover{box-shadow:0 0 0 1px #D4D4D5,0 2px 0 0 #27292a,0 1px 3px 0 #BCBDBD}.ui.one.cards{margin-left:0;margin-right:0}.ui.one.cards>.card{width:100%}.ui.two.cards{margin-left:-1em;margin-right:-1em}.ui.two.cards>.card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.three.cards{margin-left:-1em;margin-right:-1em}.ui.three.cards>.card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}.ui.four.cards{margin-left:-.75em;margin-right:-.75em}.ui.four.cards>.card{width:calc(25% - 1.5em);margin-left:.75em;margin-right:.75em}.ui.five.cards{margin-left:-.75em;margin-right:-.75em}.ui.five.cards>.card{width:calc(20% - 1.5em);margin-left:.75em;margin-right:.75em}.ui.six.cards{margin-left:-.75em;margin-right:-.75em}.ui.six.cards>.card{width:calc(16.66666667% - 1.5em);margin-left:.75em;margin-right:.75em}.ui.seven.cards{margin-left:-.5em;margin-right:-.5em}.ui.seven.cards>.card{width:calc(14.28571429% - 1em);margin-left:.5em;margin-right:.5em}.ui.eight.cards{margin-left:-.5em;margin-right:-.5em}.ui.eight.cards>.card{width:calc(12.5% - 1em);margin-left:.5em;margin-right:.5em;font-size:11px}.ui.nine.cards{margin-left:-.5em;margin-right:-.5em}.ui.nine.cards>.card{width:calc(11.11111111% - 1em);margin-left:.5em;margin-right:.5em;font-size:10px}.ui.ten.cards{margin-left:-.5em;margin-right:-.5em}.ui.ten.cards>.card{width:calc(10% - 1em);margin-left:.5em;margin-right:.5em}@media only screen and (max-width:767px){.ui.two.doubling.cards{margin-left:0;margin-right:0}.ui.two.doubling.cards .card{width:100%;margin-left:0;margin-right:0}.ui.three.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.three.doubling.cards .card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.four.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.four.doubling.cards .card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.five.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.five.doubling.cards .card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.six.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.six.doubling.cards .card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.seven.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.seven.doubling.cards .card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}.ui.eight.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.eight.doubling.cards .card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}.ui.nine.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.nine.doubling.cards .card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}.ui.ten.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.ten.doubling.cards .card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}}@media only screen and (min-width:768px) and (max-width:991px){.ui.two.doubling.cards{margin-left:0;margin-right:0}.ui.two.doubling.cards .card{width:100%;margin-left:0;margin-right:0}.ui.three.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.three.doubling.cards .card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.four.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.four.doubling.cards .card{width:calc(50% - 2em);margin-left:1em;margin-right:1em}.ui.five.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.five.doubling.cards .card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}.ui.six.doubling.cards{margin-left:-1em;margin-right:-1em}.ui.six.doubling.cards .card{width:calc(33.33333333% - 2em);margin-left:1em;margin-right:1em}.ui.eight.doubling.cards{margin-left:-.75em;margin-right:-.75em}.ui.eight.doubling.cards .card{width:calc(25% - 1.5em);margin-left:.75em;margin-right:.75em}.ui.nine.doubling.cards{margin-left:-.75em;margin-right:-.75em}.ui.nine.doubling.cards .card{width:calc(25% - 1.5em);margin-left:.75em;margin-right:.75em}.ui.ten.doubling.cards{margin-left:-.75em;margin-right:-.75em}.ui.ten.doubling.cards .card{width:calc(20% - 1.5em);margin-left:.75em;margin-right:.75em}}@media only screen and (max-width:767px){.ui.stackable.cards{display:block!important}.ui.stackable.cards .card:first-child{margin-top:0!important}.ui.stackable.cards>.card{display:block!important;height:auto!important;margin:1em;padding:0!important;width:calc(100% - 2em)!important}}.ui.cards>.card{font-size:1em}.ui.comments{margin:1.5em 0;max-width:650px}.ui.comments:first-child{margin-top:0}.ui.comments:last-child{margin-bottom:0}.ui.comments .comment{position:relative;background:0 0;margin:.5em 0 0;padding:.5em 0 0;border:none;border-top:none;line-height:1.2}.ui.comments .comment:first-child{margin-top:0;padding-top:0}.ui.comments .comment .comments{margin:0 0 .5em .5em;padding:1em 0 1em 1em}.ui.comments .comment .comments:before{position:absolute;top:0;left:0}.ui.comments .comment .comments .comment{border:none;border-top:none;background:0 0}.ui.comments .comment .avatar{display:block;width:2.5em;height:auto;float:left;margin:.2em 0 0}.ui.comments .comment .avatar img,.ui.comments .comment img.avatar{display:block;margin:0 auto;width:100%;height:100%;border-radius:.25rem}.ui.comments .comment>.content{display:block}.ui.comments .comment>.avatar~.content{margin-left:3.5em}.ui.comments .comment .author{font-size:1em;color:rgba(0,0,0,.87);font-weight:700}.ui.comments .comment a.author{cursor:pointer}.ui.comments .comment a.author:hover{color:#1e70bf}.ui.comments .comment .metadata{display:inline-block;margin-left:.5em;color:rgba(0,0,0,.4);font-size:.875em}.ui.comments .comment .metadata>*{display:inline-block;margin:0 .5em 0 0}.ui.comments .comment .metadata>:last-child{margin-right:0}.ui.comments .comment .text{margin:.25em 0 .5em;font-size:1em;word-wrap:break-word;color:rgba(0,0,0,.87);line-height:1.3}.ui.comments .comment .actions{font-size:.875em}.ui.comments .comment .actions a{cursor:pointer;display:inline-block;margin:0 .75em 0 0;color:rgba(0,0,0,.4)}.ui.comments .comment .actions a:last-child{margin-right:0}.ui.comments .comment .actions a.active,.ui.comments .comment .actions a:hover{color:rgba(0,0,0,.8)}.ui.comments>.reply.form{margin-top:1em}.ui.comments .comment .reply.form{width:100%;margin-top:1em}.ui.comments .reply.form textarea{font-size:1em;height:12em}.ui.collapsed.comments,.ui.comments .collapsed.comment,.ui.comments .collapsed.comments{display:none}.ui.threaded.comments .comment .comments{margin:-1.5em 0 -1em 1.25em;padding:3em 0 2em 2.25em;box-shadow:-1px 0 0 rgba(34,36,38,.15)}.ui.minimal.comments .comment .actions{opacity:0;position:absolute;top:0;right:0;left:auto;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;-webkit-transition-delay:.1s;transition-delay:.1s}.ui.minimal.comments .comment>.content:hover>.actions{opacity:1}.ui.small.comments{font-size:.9em}.ui.comments{font-size:1em}.ui.large.comments{font-size:1.1em}.ui.huge.comments{font-size:1.2em}.ui.feed{margin:1em 0}.ui.feed:first-child{margin-top:0}.ui.feed:last-child{margin-bottom:0}.ui.feed>.event{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:100%;padding:.21428571rem 0;margin:0;background:0 0;border-top:none}.ui.feed>.event:first-child{border-top:0;padding-top:0}.ui.feed>.event:last-child{padding-bottom:0}.ui.feed>.event>.label{display:block;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:2.5em;height:auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;text-align:left}.ui.feed>.event>.label .icon{opacity:1;font-size:1.5em;width:100%;padding:.25em;background:0 0;border:none;border-radius:none;color:rgba(0,0,0,.6)}.ui.feed>.event>.label img{width:100%;height:auto;border-radius:500rem}.ui.feed>.event>.label+.content{margin:.5em 0 .35714286em 1.14285714em}.ui.feed>.event>.content{display:block;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;text-align:left;word-wrap:break-word}.ui.feed>.event:last-child>.content{padding-bottom:0}.ui.feed>.event>.content a{cursor:pointer}.ui.feed>.event>.content .date{margin:-.5rem 0 0;padding:0;font-weight:400;font-size:1em;font-style:normal;color:rgba(0,0,0,.4)}.ui.feed>.event>.content .summary{margin:0;font-size:1em;font-weight:700;color:rgba(0,0,0,.87)}.ui.feed>.event>.content .summary img{display:inline-block;width:auto;height:10em;margin:-.25em .25em 0 0;border-radius:.25em;vertical-align:middle}.ui.feed>.event>.content .user{display:inline-block;font-weight:700;margin-right:0;vertical-align:baseline}.ui.feed>.event>.content .user img{margin:-.25em .25em 0 0;width:auto;height:10em;vertical-align:middle}.ui.feed>.event>.content .summary>.date{display:inline-block;float:none;font-weight:400;font-size:.85714286em;font-style:normal;margin:0 0 0 .5em;padding:0;color:rgba(0,0,0,.4)}.ui.feed>.event>.content .extra{margin:.5em 0 0;background:0 0;padding:0;color:rgba(0,0,0,.87)}.ui.feed>.event>.content .extra.images img{display:inline-block;margin:0 .25em 0 0;width:6em}.ui.feed>.event>.content .extra.text{padding:0;border-left:none;font-size:1em;max-width:500px;line-height:1.4285em}.ui.feed>.event>.content .meta{display:inline-block;font-size:.85714286em;margin:.5em 0 0;background:0 0;border:none;border-radius:0;box-shadow:none;padding:0;color:rgba(0,0,0,.6)}.ui.feed>.event>.content .meta>*{position:relative;margin-left:.75em}.ui.feed>.event>.content .meta>:after{content:'';color:rgba(0,0,0,.2);top:0;left:-1em;opacity:1;position:absolute;vertical-align:top}.ui.feed>.event>.content .meta .like{color:'';-webkit-transition:.2s color ease;transition:.2s color ease}.ui.feed>.event>.content .meta .like:hover .icon{color:#FF2733}.ui.feed>.event>.content .meta .active.like .icon{color:#EF404A}.ui.feed>.event>.content .meta>:first-child{margin-left:0}.ui.feed>.event>.content .meta>:first-child::after{display:none}.ui.feed>.event>.content .meta a,.ui.feed>.event>.content .meta>.icon{cursor:pointer;opacity:1;color:rgba(0,0,0,.5);-webkit-transition:color .1s ease;transition:color .1s ease}.ui.feed>.event>.content .meta a:hover,.ui.feed>.event>.content .meta a:hover .icon,.ui.feed>.event>.content .meta>.icon:hover{color:rgba(0,0,0,.95)}.ui.small.feed{font-size:.92857143rem}.ui.feed{font-size:1rem}.ui.large.feed{font-size:1.14285714rem}.ui.items>.item{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:1em 0;width:100%;min-height:0;background:0 0;padding:0;border:none;border-radius:0;box-shadow:none;-webkit-transition:box-shadow .1s ease;transition:box-shadow .1s ease;z-index:''}.ui.items>.item a{cursor:pointer}.ui.items{margin:1.5em 0}.ui.items:first-child{margin-top:0!important}.ui.items:last-child{margin-bottom:0!important}.ui.items>.item:after{display:block;content:' ';height:0;clear:both;overflow:hidden;visibility:hidden}.ui.items>.item:first-child{margin-top:0}.ui.items>.item:last-child{margin-bottom:0}.ui.items>.item>.image{position:relative;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;display:block;float:none;margin:0;padding:0;max-height:'';-webkit-align-self:top;-ms-flex-item-align:top;align-self:top}.ui.items>.item>.image>img{display:block;width:100%;height:auto;border-radius:.125rem;border:none}.ui.items>.item>.image:only-child>img{border-radius:0}.ui.items>.item>.content{display:block;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;background:0 0;margin:0;padding:0;box-shadow:none;font-size:1em;border:none;border-radius:0}.ui.items>.item>.content:after{display:block;content:' ';height:0;clear:both;overflow:hidden;visibility:hidden}.ui.items>.item>.image+.content{min-width:0;width:auto;display:block;margin-left:0;-webkit-align-self:top;-ms-flex-item-align:top;align-self:top;padding-left:1.5em}.ui.items>.item>.content>.header{display:inline-block;margin:-.21425em 0 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-weight:700;color:rgba(0,0,0,.85)}.ui.items>.item>.content>.header:not(.ui){font-size:1.28571429em}.ui.items>.item [class*="left floated"]{float:left}.ui.items>.item [class*="right floated"]{float:right}.ui.items>.item .content img{-webkit-align-self:middle;-ms-flex-item-align:middle;align-self:middle;width:''}.ui.items>.item .avatar img,.ui.items>.item img.avatar{width:'';height:'';border-radius:500rem}.ui.items>.item>.content>.description{margin-top:.6em;max-width:auto;font-size:1em;line-height:1.4285em;color:rgba(0,0,0,.87)}.ui.items>.item>.content p{margin:0 0 .5em}.ui.items>.item>.content p:last-child{margin-bottom:0}.ui.items>.item .meta{margin:.5em 0;font-size:1em;line-height:1em;color:rgba(0,0,0,.6)}.ui.items>.item .meta *{margin-right:.3em}.ui.items>.item .meta :last-child{margin-right:0}.ui.items>.item .meta [class*="right floated"]{margin-right:0;margin-left:.3em}.ui.items>.item>.content a:not(.ui){color:'';-webkit-transition:color .1s ease;transition:color .1s ease}.ui.items>.item>.content a:not(.ui):hover{color:''}.ui.items>.item>.content>a.header{color:rgba(0,0,0,.85)}.ui.items>.item>.content>a.header:hover{color:#1e70bf}.ui.items>.item .meta>a:not(.ui){color:rgba(0,0,0,.4)}.ui.items>.item .meta>a:not(.ui):hover{color:rgba(0,0,0,.87)}.ui.items>.item>.content .favorite.icon{cursor:pointer;opacity:.75;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.items>.item>.content .favorite.icon:hover{opacity:1;color:#FFB70A}.ui.items>.item>.content .active.favorite.icon{color:#FFE623}.ui.items>.item>.content .like.icon{cursor:pointer;opacity:.75;-webkit-transition:color .1s ease;transition:color .1s ease}.ui.items>.item>.content .like.icon:hover{opacity:1;color:#FF2733}.ui.items>.item>.content .active.like.icon{color:#FF2733}.ui.items>.item .extra{display:block;position:relative;background:0 0;margin:.5rem 0 0;width:100%;padding:0;top:0;left:0;color:rgba(0,0,0,.4);box-shadow:none;-webkit-transition:color .1s ease;transition:color .1s ease;border-top:none}.ui.items>.item .extra>*{margin:.25rem .5rem .25rem 0}.ui.items>.item .extra>[class*="right floated"]{margin:.25rem 0 .25rem .5rem}.ui.items>.item .extra:after{display:block;content:' ';height:0;clear:both;overflow:hidden;visibility:hidden}.ui.items>.item>.image:not(.ui){width:175px}@media only screen and (min-width:768px) and (max-width:991px){.ui.items>.item{margin:1em 0}.ui.items>.item>.image:not(.ui){width:150px}.ui.items>.item>.image+.content{display:block;padding:0 0 0 1em}}@media only screen and (max-width:767px){.ui.items>.item{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin:2em 0}.ui.items>.item>.image{display:block;margin-left:auto;margin-right:auto}.ui.items>.item>.image,.ui.items>.item>.image>img{max-width:100%!important;width:auto!important;max-height:250px!important}.ui.items>.item>.image+.content{display:block;padding:1.5em 0 0}}.ui.items>.item>.image+[class*="top aligned"].content{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.ui.items>.item>.image+[class*="middle aligned"].content{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.ui.items>.item>.image+[class*="bottom aligned"].content{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.ui.relaxed.items>.item{margin:1.5em 0}.ui[class*="very relaxed"].items>.item{margin:2em 0}.ui.divided.items>.item{border-top:1px solid rgba(34,36,38,.15);margin:0;padding:1em 0}.ui.divided.items>.item:first-child{border-top:none;margin-top:0!important;padding-top:0!important}.ui.divided.items>.item:last-child{margin-bottom:0!important;padding-bottom:0!important}.ui.relaxed.divided.items>.item{margin:0;padding:1.5em 0}.ui[class*="very relaxed"].divided.items>.item{margin:0;padding:2em 0}.ui.items a.item:hover,.ui.link.items>.item:hover{cursor:pointer}.ui.items a.item:hover .content .header,.ui.link.items>.item:hover .content .header{color:#1e70bf}.ui.items>.item{font-size:1em}.ui.statistic{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin:1em 0;max-width:auto}.ui.statistic+.ui.statistic{margin:0 0 0 1.5em}.ui.statistic:first-child{margin-top:0}.ui.statistic:last-child{margin-bottom:0}.ui.statistics{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ui.statistics>.statistic{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin:0 1.5em 2em;max-width:auto}.ui.statistics{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:1em -1.5em -2em}.ui.statistics:after{display:block;content:' ';height:0;clear:both;overflow:hidden;visibility:hidden}.ui.statistics:first-child{margin-top:0}.ui.statistics:last-child{margin-bottom:0}.ui.statistic>.value,.ui.statistics .statistic>.value{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-weight:400;line-height:1em;color:#1B1C1D;text-transform:uppercase;text-align:center}.ui.statistic>.label,.ui.statistics .statistic>.label{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1em;font-weight:700;color:rgba(0,0,0,.87);text-transform:uppercase;text-align:center}.ui.statistic>.label~.value,.ui.statistic>.value~.label,.ui.statistics .statistic>.label~.value,.ui.statistics .statistic>.value~.label{margin-top:0}.ui.statistic>.value .icon,.ui.statistics .statistic>.value .icon{opacity:1;width:auto;margin:0}.ui.statistic>.text.value,.ui.statistics .statistic>.text.value{line-height:1em;min-height:2em;font-weight:700;text-align:center}.ui.statistic>.text.value+.label,.ui.statistics .statistic>.text.value+.label{text-align:center}.ui.statistic>.value img,.ui.statistics .statistic>.value img{max-height:3rem;vertical-align:baseline}.ui.ten.statistics{margin:0 0 -2em}.ui.ten.statistics .statistic{min-width:10%;margin:0 0 2em}.ui.nine.statistics{margin:0 0 -2em}.ui.nine.statistics .statistic{min-width:11.11111111%;margin:0 0 2em}.ui.eight.statistics{margin:0 0 -2em}.ui.eight.statistics .statistic{min-width:12.5%;margin:0 0 2em}.ui.seven.statistics{margin:0 0 -2em}.ui.seven.statistics .statistic{min-width:14.28571429%;margin:0 0 2em}.ui.six.statistics{margin:0 0 -2em}.ui.six.statistics .statistic{min-width:16.66666667%;margin:0 0 2em}.ui.five.statistics{margin:0 0 -2em}.ui.five.statistics .statistic{min-width:20%;margin:0 0 2em}.ui.four.statistics{margin:0 0 -2em}.ui.four.statistics .statistic{min-width:25%;margin:0 0 2em}.ui.three.statistics{margin:0 0 -2em}.ui.three.statistics .statistic{min-width:33.33333333%;margin:0 0 2em}.ui.two.statistics{margin:0 0 -2em}.ui.two.statistics .statistic{min-width:50%;margin:0 0 2em}.ui.one.statistics{margin:0 0 -2em}.ui.one.statistics .statistic{min-width:100%;margin:0 0 2em}.ui.horizontal.statistic{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center}.ui.horizontal.statistics{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin:0;max-width:none}.ui.horizontal.statistics .statistic{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;max-width:none;margin:1em 0}.ui.horizontal.statistic>.text.value,.ui.horizontal.statistics>.statistic>.text.value{min-height:0!important}.ui.horizontal.statistic>.value .icon,.ui.horizontal.statistics .statistic>.value .icon{width:1.18em}.ui.horizontal.statistic>.label,.ui.horizontal.statistics .statistic>.label{display:inline-block;vertical-align:middle;margin:0 0 0 .75em}.ui.red.statistic>.value,.ui.red.statistics .statistic>.value,.ui.statistics .red.statistic>.value{color:#DB2828}.ui.orange.statistic>.value,.ui.orange.statistics .statistic>.value,.ui.statistics .orange.statistic>.value{color:#F2711C}.ui.statistics .yellow.statistic>.value,.ui.yellow.statistic>.value,.ui.yellow.statistics .statistic>.value{color:#FBBD08}.ui.olive.statistic>.value,.ui.olive.statistics .statistic>.value,.ui.statistics .olive.statistic>.value{color:#B5CC18}.ui.green.statistic>.value,.ui.green.statistics .statistic>.value,.ui.statistics .green.statistic>.value{color:#21BA45}.ui.statistics .teal.statistic>.value,.ui.teal.statistic>.value,.ui.teal.statistics .statistic>.value{color:#00B5AD}.ui.blue.statistic>.value,.ui.blue.statistics .statistic>.value,.ui.statistics .blue.statistic>.value{color:#2185D0}.ui.statistics .violet.statistic>.value,.ui.violet.statistic>.value,.ui.violet.statistics .statistic>.value{color:#6435C9}.ui.purple.statistic>.value,.ui.purple.statistics .statistic>.value,.ui.statistics .purple.statistic>.value{color:#A333C8}.ui.pink.statistic>.value,.ui.pink.statistics .statistic>.value,.ui.statistics .pink.statistic>.value{color:#E03997}.ui.brown.statistic>.value,.ui.brown.statistics .statistic>.value,.ui.statistics .brown.statistic>.value{color:#A5673F}.ui.grey.statistic>.value,.ui.grey.statistics .statistic>.value,.ui.statistics .grey.statistic>.value{color:#767676}.ui.inverted.statistic .value,.ui.inverted.statistics .statistic>.value{color:#FFF}.ui.inverted.statistic .label,.ui.inverted.statistics .statistic>.label{color:rgba(255,255,255,.9)}.ui.inverted.red.statistic>.value,.ui.inverted.red.statistics .statistic>.value,.ui.statistics .inverted.red.statistic>.value{color:#FF695E}.ui.inverted.orange.statistic>.value,.ui.inverted.orange.statistics .statistic>.value,.ui.statistics .inverted.orange.statistic>.value{color:#FF851B}.ui.inverted.yellow.statistic>.value,.ui.inverted.yellow.statistics .statistic>.value,.ui.statistics .inverted.yellow.statistic>.value{color:#FFE21F}.ui.inverted.olive.statistic>.value,.ui.inverted.olive.statistics .statistic>.value,.ui.statistics .inverted.olive.statistic>.value{color:#D9E778}.ui.inverted.green.statistic>.value,.ui.inverted.green.statistics .statistic>.value,.ui.statistics .inverted.green.statistic>.value{color:#2ECC40}.ui.inverted.teal.statistic>.value,.ui.inverted.teal.statistics .statistic>.value,.ui.statistics .inverted.teal.statistic>.value{color:#6DFFFF}.ui.inverted.blue.statistic>.value,.ui.inverted.blue.statistics .statistic>.value,.ui.statistics .inverted.blue.statistic>.value{color:#54C8FF}.ui.inverted.violet.statistic>.value,.ui.inverted.violet.statistics .statistic>.value,.ui.statistics .inverted.violet.statistic>.value{color:#A291FB}.ui.inverted.purple.statistic>.value,.ui.inverted.purple.statistics .statistic>.value,.ui.statistics .inverted.purple.statistic>.value{color:#DC73FF}.ui.inverted.pink.statistic>.value,.ui.inverted.pink.statistics .statistic>.value,.ui.statistics .inverted.pink.statistic>.value{color:#FF8EDF}.ui.inverted.brown.statistic>.value,.ui.inverted.brown.statistics .statistic>.value,.ui.statistics .inverted.brown.statistic>.value{color:#D67C1C}.ui.inverted.grey.statistic>.value,.ui.inverted.grey.statistics .statistic>.value,.ui.statistics .inverted.grey.statistic>.value{color:#DCDDDE}.ui[class*="left floated"].statistic{float:left;margin:0 2em 1em 0}.ui[class*="right floated"].statistic{float:right;margin:0 0 1em 2em}.ui.floated.statistic:last-child{margin-bottom:0}.ui.mini.horizontal.statistic>.value,.ui.mini.horizontal.statistics .statistic>.value,.ui.mini.statistic>.value,.ui.mini.statistics .statistic>.value{font-size:1.5rem!important}.ui.mini.statistic>.text.value,.ui.mini.statistics .statistic>.text.value{font-size:1rem!important}.ui.tiny.horizontal.statistic>.value,.ui.tiny.horizontal.statistics .statistic>.value,.ui.tiny.statistic>.value,.ui.tiny.statistics .statistic>.value{font-size:2rem!important}.ui.tiny.statistic>.text.value,.ui.tiny.statistics .statistic>.text.value{font-size:1rem!important}.ui.small.statistic>.value,.ui.small.statistics .statistic>.value{font-size:3rem!important}.ui.small.horizontal.statistic>.value,.ui.small.horizontal.statistics .statistic>.value{font-size:2rem!important}.ui.small.statistic>.text.value,.ui.small.statistics .statistic>.text.value{font-size:1rem!important}.ui.statistic>.value,.ui.statistics .statistic>.value{font-size:4rem!important}.ui.horizontal.statistic>.value,.ui.horizontal.statistics .statistic>.value{display:inline-block;vertical-align:middle;font-size:3rem!important}.ui.statistic>.text.value,.ui.statistics .statistic>.text.value{font-size:2rem!important}.ui.large.statistic>.value,.ui.large.statistics .statistic>.value{font-size:5rem!important}.ui.large.horizontal.statistic>.value,.ui.large.horizontal.statistics .statistic>.value{font-size:4rem!important}.ui.large.statistic>.text.value,.ui.large.statistics .statistic>.text.value{font-size:2.5rem!important}.ui.huge.statistic>.value,.ui.huge.statistics .statistic>.value{font-size:6rem!important}.ui.huge.horizontal.statistic>.value,.ui.huge.horizontal.statistics .statistic>.value{font-size:5rem!important}.ui.huge.statistic>.text.value,.ui.huge.statistics .statistic>.text.value{font-size:2.5rem!important}.ui.accordion,.ui.accordion .accordion{max-width:100%}.ui.accordion .accordion{margin:1em 0 0;padding:0}.ui.accordion .accordion .title,.ui.accordion .title{cursor:pointer}.ui.accordion .title:not(.ui){padding:.5em 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1em;color:rgba(0,0,0,.87)}.ui.accordion .accordion .title~.content,.ui.accordion .title~.content{display:none}.ui.accordion:not(.styled) .accordion .title~.content:not(.ui),.ui.accordion:not(.styled) .title~.content:not(.ui){margin:'';padding:.5em 0 1em}.ui.accordion:not(.styled) .title~.content:not(.ui):last-child{padding-bottom:0}.ui.accordion .accordion .title .dropdown.icon,.ui.accordion .title .dropdown.icon{display:inline-block;float:none;opacity:1;width:1.25em;height:1em;margin:0 .25rem 0 0;padding:0;font-size:1em;-webkit-transition:opacity .1s ease,-webkit-transform .1s ease;transition:opacity .1s ease,-webkit-transform .1s ease;transition:transform .1s ease,opacity .1s ease;transition:transform .1s ease,opacity .1s ease,-webkit-transform .1s ease;vertical-align:baseline;-webkit-transform:none;transform:none}.ui.accordion.menu .item .title{display:block;padding:0}.ui.accordion.menu .item .title>.dropdown.icon{float:right;margin:.21425em 0 0 1em;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.ui.accordion .ui.header .dropdown.icon{font-size:1em;margin:0 .25rem 0 0}.ui.accordion .accordion .active.title .dropdown.icon,.ui.accordion .active.title .dropdown.icon,.ui.accordion.menu .item .active.title>.dropdown.icon{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ui.styled.accordion{width:600px}.ui.styled.accordion,.ui.styled.accordion .accordion{border-radius:.28571429rem;background:#FFF;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),0 0 0 1px rgba(34,36,38,.15)}.ui.styled.accordion .accordion .title,.ui.styled.accordion .title{margin:0;padding:.75em 1em;color:rgba(0,0,0,.4);font-weight:700;border-top:1px solid rgba(34,36,38,.15);-webkit-transition:background .1s ease,color .1s ease;transition:background .1s ease,color .1s ease}.ui.styled.accordion .accordion .title:first-child,.ui.styled.accordion>.title:first-child{border-top:none}.ui.styled.accordion .accordion .content,.ui.styled.accordion .content{margin:0;padding:.5em 1em 1.5em}.ui.styled.accordion .accordion .content{padding:.5em 1em 1.5em}.ui.styled.accordion .accordion .active.title,.ui.styled.accordion .accordion .title:hover,.ui.styled.accordion .active.title,.ui.styled.accordion .title:hover{background:0 0;color:rgba(0,0,0,.87)}.ui.styled.accordion .accordion .active.title,.ui.styled.accordion .active.title{background:0 0;color:rgba(0,0,0,.95)}.ui.accordion .accordion .active.content,.ui.accordion .active.content{display:block}.ui.fluid.accordion,.ui.fluid.accordion .accordion{width:100%}.ui.inverted.accordion .title:not(.ui){color:rgba(255,255,255,.9)}@font-face{font-family:Accordion;src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfOIKAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zryj6HgAAAFwAAAAyGhlYWT/0IhHAAACOAAAADZoaGVhApkB5wAAAnAAAAAkaG10eAJuABIAAAKUAAAAGGxvY2EAjABWAAACrAAAAA5tYXhwAAgAFgAAArwAAAAgbmFtZfC1n04AAALcAAABPHBvc3QAAwAAAAAEGAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQASAEkAtwFuABMAADc0PwE2FzYXFh0BFAcGJwYvASY1EgaABQgHBQYGBQcIBYAG2wcGfwcBAQcECf8IBAcBAQd/BgYAAAAAAQAAAEkApQFuABMAADcRNDc2MzIfARYVFA8BBiMiJyY1AAUGBwgFgAYGgAUIBwYFWwEACAUGBoAFCAcFgAYGBQcAAAABAAAAAQAAqWYls18PPPUACwIAAAAAAM/9o+4AAAAAz/2j7gAAAAAAtwFuAAAACAACAAAAAAAAAAEAAAHg/+AAAAIAAAAAAAC3AAEAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAQAAAAC3ABIAtwAAAAAAAAAKABQAHgBCAGQAAAABAAAABgAUAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAASwAAoAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAS0AAAEtFpovuE9TLzIAAAIkAAAAYAAAAGAIIweQY21hcAAAAoQAAABMAAAATA984gpnYXNwAAAC0AAAAAgAAAAIAAAAEGhlYWQAAALYAAAANgAAADb/0IhHaGhlYQAAAxAAAAAkAAAAJAKZAedobXR4AAADNAAAABgAAAAYAm4AEm1heHAAAANMAAAABgAAAAYABlAAbmFtZQAAA1QAAAE8AAABPPC1n05wb3N0AAAEkAAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLa/iU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAABJBIABwEBBw0PERQZHnJhdGluZ3JhdGluZ3UwdTF1MjB1RjBEOXVGMERBAAACAYkABAAGAQEEBwoNVp38lA78lA78lA77lA773Z33bxWLkI2Qj44I9xT3FAWOj5CNkIuQi4+JjoePiI2Gi4YIi/uUBYuGiYeHiIiHh4mGi4aLho2Ijwj7FPcUBYeOiY+LkAgO+92L5hWL95QFi5CNkI6Oj4+PjZCLkIuQiY6HCPcU+xQFj4iNhouGi4aJh4eICPsU+xQFiIeGiYaLhouHjYePiI6Jj4uQCA74lBT4lBWLDAoAAAAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAADfYOJZfDzz1AAsCAAAAAADP/aPuAAAAAM/9o+4AAAAAALcBbgAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAAtwABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAAAtwASALcAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');font-weight:400;font-style:normal}.ui.accordion .accordion .title .dropdown.icon,.ui.accordion .title .dropdown.icon{font-family:Accordion;line-height:1;-webkit-backface-visibility:hidden;backface-visibility:hidden;font-weight:400;font-style:normal;text-align:center}.ui.accordion .accordion .title .dropdown.icon:before,.ui.accordion .title .dropdown.icon:before{content:'\f0da'}.ui.checkbox{position:relative;display:inline-block;-webkit-backface-visibility:hidden;backface-visibility:hidden;outline:0;vertical-align:baseline;font-style:normal;min-height:17px;font-size:1rem;line-height:17px;min-width:17px}.ui.checkbox input[type=checkbox],.ui.checkbox input[type=radio]{cursor:pointer;position:absolute;top:0;left:0;opacity:0!important;outline:0;z-index:3;width:17px;height:17px}.ui.checkbox .box,.ui.checkbox label{cursor:auto;position:relative;display:block;padding-left:1.85714em;outline:0;font-size:1em}.ui.checkbox .box:before,.ui.checkbox label:before{position:absolute;top:0;left:0;width:17px;height:17px;content:'';background:#FFF;border-radius:.21428571rem;-webkit-transition:border .1s ease,opacity .1s ease,box-shadow .1s ease,-webkit-transform .1s ease;transition:border .1s ease,opacity .1s ease,box-shadow .1s ease,-webkit-transform .1s ease;transition:border .1s ease,opacity .1s ease,transform .1s ease,box-shadow .1s ease;transition:border .1s ease,opacity .1s ease,transform .1s ease,box-shadow .1s ease,-webkit-transform .1s ease;border:1px solid #D4D4D5}.ui.checkbox .box:after,.ui.checkbox label:after{position:absolute;font-size:14px;top:0;left:0;width:17px;height:17px;text-align:center;opacity:0;color:rgba(0,0,0,.87);-webkit-transition:border .1s ease,opacity .1s ease,box-shadow .1s ease,-webkit-transform .1s ease;transition:border .1s ease,opacity .1s ease,box-shadow .1s ease,-webkit-transform .1s ease;transition:border .1s ease,opacity .1s ease,transform .1s ease,box-shadow .1s ease;transition:border .1s ease,opacity .1s ease,transform .1s ease,box-shadow .1s ease,-webkit-transform .1s ease;font-family:Checkbox}.ui.checkbox label,.ui.checkbox+label{color:rgba(0,0,0,.87);-webkit-transition:color .1s ease;transition:color .1s ease}.ui.checkbox+label{vertical-align:middle}.ui.checkbox .box:hover::before,.ui.checkbox label:hover::before{background:#FFF;border-color:rgba(34,36,38,.35)}.ui.checkbox label:hover,.ui.checkbox+label:hover{color:rgba(0,0,0,.8)}.ui.checkbox .box:active::before,.ui.checkbox label:active::before{background:#F9FAFB;border-color:rgba(34,36,38,.35)}.ui.checkbox .box:active::after,.ui.checkbox input:active~label,.ui.checkbox label:active::after{color:rgba(0,0,0,.95)}.ui.checkbox input:focus~.box:before,.ui.checkbox input:focus~label:before{background:#FFF;border-color:#96C8DA}.ui.checkbox input:focus~.box:after,.ui.checkbox input:focus~label,.ui.checkbox input:focus~label:after{color:rgba(0,0,0,.95)}.ui.checkbox input:checked~.box:before,.ui.checkbox input:checked~label:before{background:#FFF;border-color:rgba(34,36,38,.35)}.ui.checkbox input:checked~.box:after,.ui.checkbox input:checked~label:after{opacity:1;color:rgba(0,0,0,.95)}.ui.checkbox input:not([type=radio]):indeterminate~.box:before,.ui.checkbox input:not([type=radio]):indeterminate~label:before{background:#FFF;border-color:rgba(34,36,38,.35)}.ui.checkbox input:not([type=radio]):indeterminate~.box:after,.ui.checkbox input:not([type=radio]):indeterminate~label:after{opacity:1;color:rgba(0,0,0,.95)}.ui.checkbox input:checked:focus~.box:before,.ui.checkbox input:checked:focus~label:before,.ui.checkbox input:not([type=radio]):indeterminate:focus~.box:before,.ui.checkbox input:not([type=radio]):indeterminate:focus~label:before{background:#FFF;border-color:#96C8DA}.ui.checkbox input:checked:focus~.box:after,.ui.checkbox input:checked:focus~label:after,.ui.checkbox input:not([type=radio]):indeterminate:focus~.box:after,.ui.checkbox input:not([type=radio]):indeterminate:focus~label:after{color:rgba(0,0,0,.95)}.ui.read-only.checkbox,.ui.read-only.checkbox label{cursor:default}.ui.checkbox input[disabled]~.box:after,.ui.checkbox input[disabled]~label,.ui.disabled.checkbox .box:after,.ui.disabled.checkbox label{cursor:default!important;opacity:.5;color:#000}.ui.checkbox input.hidden{z-index:-1}.ui.checkbox input.hidden+label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui.radio.checkbox{min-height:15px}.ui.radio.checkbox .box,.ui.radio.checkbox label{padding-left:1.85714em}.ui.radio.checkbox .box:before,.ui.radio.checkbox label:before{content:'';-webkit-transform:none;transform:none;width:15px;height:15px;border-radius:500rem;top:1px;left:0}.ui.radio.checkbox .box:after,.ui.radio.checkbox label:after{border:none;content:''!important;line-height:15px;top:1px;left:0;width:15px;height:15px;border-radius:500rem;-webkit-transform:scale(.46666667);transform:scale(.46666667);background-color:rgba(0,0,0,.87)}.ui.radio.checkbox input:focus~.box:before,.ui.radio.checkbox input:focus~label:before{background-color:#FFF}.ui.radio.checkbox input:focus~.box:after,.ui.radio.checkbox input:focus~label:after{background-color:rgba(0,0,0,.95)}.ui.radio.checkbox input:indeterminate~.box:after,.ui.radio.checkbox input:indeterminate~label:after{opacity:0}.ui.radio.checkbox input:checked~.box:before,.ui.radio.checkbox input:checked~label:before{background-color:#FFF}.ui.radio.checkbox input:checked~.box:after,.ui.radio.checkbox input:checked~label:after{background-color:rgba(0,0,0,.95)}.ui.radio.checkbox input:focus:checked~.box:before,.ui.radio.checkbox input:focus:checked~label:before{background-color:#FFF}.ui.radio.checkbox input:focus:checked~.box:after,.ui.radio.checkbox input:focus:checked~label:after{background-color:rgba(0,0,0,.95)}.ui.slider.checkbox{min-height:1.25rem}.ui.slider.checkbox input{width:3.5rem;height:1.25rem}.ui.slider.checkbox .box,.ui.slider.checkbox label{padding-left:4.5rem;line-height:1rem;color:rgba(0,0,0,.4)}.ui.slider.checkbox .box:before,.ui.slider.checkbox label:before{display:block;position:absolute;content:'';border:none!important;left:0;z-index:1;top:.4rem;background-color:rgba(0,0,0,.05);width:3.5rem;height:.21428571rem;-webkit-transform:none;transform:none;border-radius:500rem;-webkit-transition:background .3s ease;transition:background .3s ease}.ui.slider.checkbox .box:after,.ui.slider.checkbox label:after{background:-webkit-linear-gradient(transparent,rgba(0,0,0,.05)) #FFF;background:linear-gradient(transparent,rgba(0,0,0,.05)) #FFF;position:absolute;content:''!important;opacity:1;z-index:2;border:none;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),0 0 0 1px rgba(34,36,38,.15) inset;width:1.5rem;height:1.5rem;top:-.25rem;left:0;-webkit-transform:none;transform:none;border-radius:500rem;-webkit-transition:left .3s ease;transition:left .3s ease}.ui.slider.checkbox input:focus~.box:before,.ui.slider.checkbox input:focus~label:before{background-color:rgba(0,0,0,.15);border:none}.ui.slider.checkbox .box:hover,.ui.slider.checkbox label:hover{color:rgba(0,0,0,.8)}.ui.slider.checkbox .box:hover::before,.ui.slider.checkbox label:hover::before{background:rgba(0,0,0,.15)}.ui.slider.checkbox input:checked~.box,.ui.slider.checkbox input:checked~label{color:rgba(0,0,0,.95)!important}.ui.slider.checkbox input:checked~.box:before,.ui.slider.checkbox input:checked~label:before{background-color:#545454!important}.ui.slider.checkbox input:checked~.box:after,.ui.slider.checkbox input:checked~label:after{left:2rem}.ui.slider.checkbox input:focus:checked~.box,.ui.slider.checkbox input:focus:checked~label{color:rgba(0,0,0,.95)!important}.ui.slider.checkbox input:focus:checked~.box:before,.ui.slider.checkbox input:focus:checked~label:before{background-color:#000!important}.ui.toggle.checkbox{min-height:1.5rem}.ui.toggle.checkbox input{width:3.5rem;height:1.5rem}.ui.toggle.checkbox .box,.ui.toggle.checkbox label{min-height:1.5rem;padding-left:4.5rem;color:rgba(0,0,0,.87)}.ui.toggle.checkbox label{padding-top:.15em}.ui.toggle.checkbox .box:before,.ui.toggle.checkbox label:before{display:block;position:absolute;content:'';z-index:1;-webkit-transform:none;transform:none;border:none;top:0;background:rgba(0,0,0,.05);width:3.5rem;height:1.5rem;border-radius:500rem}.ui.toggle.checkbox .box:after,.ui.toggle.checkbox label:after{background:-webkit-linear-gradient(transparent,rgba(0,0,0,.05)) #FFF;background:linear-gradient(transparent,rgba(0,0,0,.05)) #FFF;position:absolute;content:''!important;opacity:1;z-index:2;border:none;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),0 0 0 1px rgba(34,36,38,.15) inset;width:1.5rem;height:1.5rem;top:0;left:0;border-radius:500rem;-webkit-transition:background .3s ease,left .3s ease;transition:background .3s ease,left .3s ease}.ui.toggle.checkbox input~.box:after,.ui.toggle.checkbox input~label:after{left:-.05rem}.ui.toggle.checkbox .box:hover::before,.ui.toggle.checkbox input:focus~.box:before,.ui.toggle.checkbox input:focus~label:before,.ui.toggle.checkbox label:hover::before{background-color:rgba(0,0,0,.15);border:none}.ui.toggle.checkbox input:checked~.box,.ui.toggle.checkbox input:checked~label{color:rgba(0,0,0,.95)!important}.ui.toggle.checkbox input:checked~.box:before,.ui.toggle.checkbox input:checked~label:before{background-color:#2185D0!important}.ui.toggle.checkbox input:checked~.box:after,.ui.toggle.checkbox input:checked~label:after{left:2.15rem}.ui.toggle.checkbox input:focus:checked~.box,.ui.toggle.checkbox input:focus:checked~label{color:rgba(0,0,0,.95)!important}.ui.toggle.checkbox input:focus:checked~.box:before,.ui.toggle.checkbox input:focus:checked~label:before{background-color:#0d71bb!important}.ui.fitted.checkbox .box,.ui.fitted.checkbox label{padding-left:0!important}.ui.fitted.slider.checkbox,.ui.fitted.toggle.checkbox{width:3.5rem}@font-face{font-family:Checkbox;src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBD8AAAC8AAAAYGNtYXAYVtCJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zn4huwUAAAF4AAABYGhlYWQGPe1ZAAAC2AAAADZoaGVhB30DyAAAAxAAAAAkaG10eBBKAEUAAAM0AAAAHGxvY2EAmgESAAADUAAAABBtYXhwAAkALwAAA2AAAAAgbmFtZSC8IugAAAOAAAABknBvc3QAAwAAAAAFFAAAACAAAwMTAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADoAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6AL//f//AAAAAAAg6AD//f//AAH/4xgEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAEUAUQO7AvgAGgAAARQHAQYjIicBJjU0PwE2MzIfAQE2MzIfARYVA7sQ/hQQFhcQ/uMQEE4QFxcQqAF2EBcXEE4QAnMWEP4UEBABHRAXFhBOEBCoAXcQEE4QFwAAAAABAAABbgMlAkkAFAAAARUUBwYjISInJj0BNDc2MyEyFxYVAyUQEBf9SRcQEBAQFwK3FxAQAhJtFxAQEBAXbRcQEBAQFwAAAAABAAAASQMlA24ALAAAARUUBwYrARUUBwYrASInJj0BIyInJj0BNDc2OwE1NDc2OwEyFxYdATMyFxYVAyUQEBfuEBAXbhYQEO4XEBAQEBfuEBAWbhcQEO4XEBACEm0XEBDuFxAQEBAX7hAQF20XEBDuFxAQEBAX7hAQFwAAAQAAAAIAAHRSzT9fDzz1AAsEAAAAAADRsdR3AAAAANGx1HcAAAAAA7sDbgAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADuwABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABFAyUAAAMlAAAAAAAAAAoAFAAeAE4AcgCwAAEAAAAHAC0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAIAAAAAQAAAAAAAgAHAGkAAQAAAAAAAwAIADkAAQAAAAAABAAIAH4AAQAAAAAABQALABgAAQAAAAAABgAIAFEAAQAAAAAACgAaAJYAAwABBAkAAQAQAAgAAwABBAkAAgAOAHAAAwABBAkAAwAQAEEAAwABBAkABAAQAIYAAwABBAkABQAWACMAAwABBAkABgAQAFkAAwABBAkACgA0ALBDaGVja2JveABDAGgAZQBjAGsAYgBvAHhWZXJzaW9uIDIuMABWAGUAcgBzAGkAbwBuACAAMgAuADBDaGVja2JveABDAGgAZQBjAGsAYgBvAHhDaGVja2JveABDAGgAZQBjAGsAYgBvAHhSZWd1bGFyAFIAZQBnAHUAbABhAHJDaGVja2JveABDAGgAZQBjAGsAYgBvAHhGb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype')}.ui.checkbox input:checked~.box:after,.ui.checkbox input:checked~label:after{content:'\e800'}.ui.checkbox input:indeterminate~.box:after,.ui.checkbox input:indeterminate~label:after{font-size:12px;content:'\e801'}.dimmable:not(.body){position:relative}.ui.dimmer{display:none;position:absolute;top:0!important;left:0!important;width:100%;height:100%;text-align:center;vertical-align:middle;background-color:rgba(0,0,0,.85);opacity:0;line-height:1;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-transition:background-color .5s linear;transition:background-color .5s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:opacity;z-index:1000}.ui.dimmer>.content{width:100%;height:100%;display:table;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ui.dimmer>.content>*{display:table-cell;vertical-align:middle;color:#FFF}.ui.segment>.ui.dimmer{border-radius:inherit!important}.animating.dimmable:not(body),.dimmed.dimmable:not(body){overflow:hidden}.dimmed.dimmable>.ui.animating.dimmer,.dimmed.dimmable>.ui.visible.dimmer,.ui.active.dimmer{display:block;opacity:1}.ui.disabled.dimmer{width:0!important;height:0!important}.ui.page.dimmer{position:fixed;-webkit-transform-style:'';transform-style:'';-webkit-perspective:2000px;perspective:2000px;-webkit-transform-origin:center center;transform-origin:center center}body.animating.in.dimmable,body.dimmed.dimmable{overflow:hidden}body.dimmable>.dimmer{position:fixed}.blurring.dimmable>:not(.dimmer){-webkit-filter:blur(0) grayscale(0);filter:blur(0) grayscale(0);-webkit-transition:.8s filter ease;transition:.8s filter ease}.blurring.dimmed.dimmable>:not(.dimmer){-webkit-filter:blur(5px) grayscale(.7);filter:blur(5px) grayscale(.7)}.blurring.dimmable>.dimmer{background-color:rgba(0,0,0,.6)}.blurring.dimmable>.inverted.dimmer{background-color:rgba(255,255,255,.6)}.ui.dimmer>.top.aligned.content>*{vertical-align:top}.ui.dimmer>.bottom.aligned.content>*{vertical-align:bottom}.ui.inverted.dimmer{background-color:rgba(255,255,255,.85)}.ui.inverted.dimmer>.content>*{color:#FFF}.ui.simple.dimmer{display:block;overflow:hidden;opacity:1;width:0;height:0%;z-index:-100;background-color:rgba(0,0,0,0)}.dimmed.dimmable>.ui.simple.dimmer{overflow:visible;opacity:1;width:100%;height:100%;background-color:rgba(0,0,0,.85);z-index:1}.ui.simple.inverted.dimmer{background-color:rgba(255,255,255,0)}.dimmed.dimmable>.ui.simple.inverted.dimmer{background-color:rgba(255,255,255,.85)}.ui.dropdown{cursor:pointer;position:relative;display:inline-block;outline:0;text-align:left;-webkit-transition:box-shadow .1s ease,width .1s ease;transition:box-shadow .1s ease,width .1s ease;-webkit-tap-highlight-color:transparent}.ui.dropdown .menu{cursor:auto;position:absolute;display:none;outline:0;top:100%;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;margin:0;padding:0;background:#FFF;font-size:1em;text-shadow:none;text-align:left;box-shadow:0 2px 3px 0 rgba(34,36,38,.15);border:1px solid rgba(34,36,38,.15);border-radius:.28571429rem;-webkit-transition:opacity .1s ease;transition:opacity .1s ease;z-index:11;will-change:transform,opacity}.ui.dropdown .menu>*{white-space:nowrap}.ui.dropdown>input:not(.search):first-child,.ui.dropdown>select{display:none!important}.ui.dropdown>.dropdown.icon{position:relative;font-size:.85714286em;margin:0 0 0 1em}.ui.dropdown .menu>.item .dropdown.icon{width:auto;float:right;margin:0 0 0 1em}.ui.dropdown .menu>.item .dropdown.icon+.text{margin-right:1em}.ui.dropdown>.text{display:inline-block;-webkit-transition:none;transition:none}.ui.dropdown .menu>.item{position:relative;cursor:pointer;display:block;border:none;height:auto;text-align:left;border-top:none;line-height:1em;color:rgba(0,0,0,.87);padding:.78571429rem 1.14285714rem!important;font-size:1rem;text-transform:none;font-weight:400;box-shadow:none;-webkit-touch-callout:none}.ui.dropdown .menu>.item:first-child{border-top-width:0}.ui.dropdown .menu .item>[class*="right floated"],.ui.dropdown>.text>[class*="right floated"]{float:right!important;margin-right:0!important;margin-left:1em!important}.ui.dropdown .menu .item>[class*="left floated"],.ui.dropdown>.text>[class*="left floated"]{float:left!important;margin-left:0!important;margin-right:1em!important}.ui.dropdown .menu .item>.flag.floated,.ui.dropdown .menu .item>.icon.floated,.ui.dropdown .menu .item>.image.floated,.ui.dropdown .menu .item>img.floated{margin-top:0}.ui.dropdown .menu>.header{margin:1rem 0 .75rem;padding:0 1.14285714rem;color:rgba(0,0,0,.85);font-size:.78571429em;font-weight:700;text-transform:uppercase}.ui.dropdown .menu>.divider{border-top:1px solid rgba(34,36,38,.1);height:0;margin:.5em 0}.ui.dropdown .menu>.input{width:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:1.14285714rem .78571429rem;min-width:10rem}.ui.dropdown .menu>.header+.input{margin-top:0}.ui.dropdown .menu>.input:not(.transparent) input{padding:.5em 1em}.ui.dropdown .menu>.input:not(.transparent) .button,.ui.dropdown .menu>.input:not(.transparent) .icon,.ui.dropdown .menu>.input:not(.transparent) .label{padding-top:.5em;padding-bottom:.5em}.ui.dropdown .menu>.item>.description,.ui.dropdown>.text>.description{float:right;margin:0 0 0 1em;color:rgba(0,0,0,.4)}.ui.dropdown .menu>.message{padding:.78571429rem 1.14285714rem;font-weight:400}.ui.dropdown .menu>.message:not(.ui){color:rgba(0,0,0,.4)}.ui.dropdown .menu .menu{top:0!important;left:100%!important;right:auto!important;margin:0 0 0 -.5em!important;border-radius:.28571429rem!important;z-index:21!important}.ui.dropdown .menu .menu:after{display:none}.ui.dropdown .menu>.item>.flag,.ui.dropdown .menu>.item>.icon,.ui.dropdown .menu>.item>.image,.ui.dropdown .menu>.item>.label,.ui.dropdown .menu>.item>img,.ui.dropdown>.text>.flag,.ui.dropdown>.text>.icon,.ui.dropdown>.text>.image,.ui.dropdown>.text>.label,.ui.dropdown>.text>img{margin-top:0;margin-left:0;float:none;margin-right:.78571429rem}.ui.dropdown .menu>.item>.image,.ui.dropdown .menu>.item>img,.ui.dropdown>.text>.image,.ui.dropdown>.text>img{display:inline-block;vertical-align:middle;width:auto;max-height:2em}.ui.dropdown .ui.menu>.item:before,.ui.menu .ui.dropdown .menu>.item:before{display:none}.ui.menu .ui.dropdown .menu .active.item{border-left:none}.ui.buttons>.ui.dropdown:last-child .menu,.ui.menu .right.dropdown.item .menu,.ui.menu .right.menu .dropdown:last-child .menu{left:auto;right:0}.ui.label.dropdown .menu{min-width:100%}.ui.dropdown.icon.button>.dropdown.icon{margin:0}.ui.button.dropdown .menu{min-width:100%}.ui.selection.dropdown{cursor:pointer;word-wrap:break-word;line-height:1em;white-space:normal;outline:0;-webkit-transform:rotateZ(0);transform:rotateZ(0);min-width:14em;min-height:2.7142em;background:#FFF;display:inline-block;padding:.78571429em 2.1em .78571429em 1em;color:rgba(0,0,0,.87);box-shadow:none;border:1px solid rgba(34,36,38,.15);border-radius:.28571429rem;-webkit-transition:box-shadow .1s ease,width .1s ease;transition:box-shadow .1s ease,width .1s ease}.ui.selection.dropdown.active,.ui.selection.dropdown.visible{z-index:10}select.ui.dropdown{height:38px;padding:.5em;border:1px solid rgba(34,36,38,.15);visibility:visible}.ui.selection.dropdown>.delete.icon,.ui.selection.dropdown>.dropdown.icon,.ui.selection.dropdown>.search.icon{cursor:pointer;position:absolute;width:auto;height:auto;line-height:1.2142em;top:.78571429em;right:1em;z-index:3;margin:-.78571429em;padding:.78571429em;opacity:.8;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.ui.compact.selection.dropdown{min-width:0}.ui.selection.dropdown .menu{overflow-x:hidden;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-overflow-scrolling:touch;border-top-width:0!important;outline:0;margin:0 -1px;min-width:calc(100% + 2px);width:calc(100% + 2px);border-radius:0 0 .28571429rem .28571429rem;box-shadow:0 2px 3px 0 rgba(34,36,38,.15);-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.ui.selection.dropdown .menu:after,.ui.selection.dropdown .menu:before{display:none}.ui.selection.dropdown .menu>.message{padding:.78571429rem 1.14285714rem}@media only screen and (max-width:767px){.ui.selection.dropdown .menu{max-height:8.01428571rem}}@media only screen and (min-width:768px){.ui.selection.dropdown .menu{max-height:10.68571429rem}}@media only screen and (min-width:992px){.ui.selection.dropdown .menu{max-height:16.02857143rem}}@media only screen and (min-width:1920px){.ui.selection.dropdown .menu{max-height:21.37142857rem}}.ui.selection.dropdown .menu>.item{border-top:1px solid #FAFAFA;padding:.78571429rem 1.14285714rem!important;white-space:normal;word-wrap:normal}.ui.selection.dropdown .menu>.hidden.addition.item{display:none}.ui.selection.dropdown:hover{border-color:rgba(34,36,38,.35);box-shadow:none}.ui.selection.active.dropdown,.ui.selection.active.dropdown .menu{border-color:#96C8DA;box-shadow:0 2px 3px 0 rgba(34,36,38,.15)}.ui.selection.dropdown:focus{border-color:#96C8DA;box-shadow:none}.ui.selection.dropdown:focus .menu{border-color:#96C8DA;box-shadow:0 2px 3px 0 rgba(34,36,38,.15)}.ui.selection.visible.dropdown>.text:not(.default){font-weight:400;color:rgba(0,0,0,.8)}.ui.selection.active.dropdown:hover,.ui.selection.active.dropdown:hover .menu{border-color:#96C8DA;box-shadow:0 2px 3px 0 rgba(34,36,38,.15)}.ui.active.selection.dropdown>.dropdown.icon,.ui.visible.selection.dropdown>.dropdown.icon{opacity:1;z-index:3}.ui.active.selection.dropdown{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.ui.active.empty.selection.dropdown{border-radius:.28571429rem!important;box-shadow:none!important}.ui.active.empty.selection.dropdown .menu{border:none!important;box-shadow:none!important}.ui.search.dropdown{min-width:''}.ui.search.dropdown>input.search{background:none!important;border:none!important;box-shadow:none!important;cursor:pointer;top:0;left:0;width:100%;outline:0;-webkit-tap-highlight-color:rgba(255,255,255,0);padding:inherit;position:absolute;z-index:2}.ui.search.dropdown>.text{cursor:text;position:relative;left:1px;z-index:3}.ui.search.selection.dropdown>input.search{line-height:1.2142em;padding:.67861429em 2.1em .67861429em 1em}.ui.search.selection.dropdown>span.sizer{line-height:1.2142em;padding:.67861429em 2.1em .67861429em 1em;display:none;white-space:pre}.ui.search.dropdown.active>input.search,.ui.search.dropdown.visible>input.search{cursor:auto}.ui.search.dropdown.active>.text,.ui.search.dropdown.visible>.text{pointer-events:none}.ui.active.search.dropdown input.search:focus+.text .flag,.ui.active.search.dropdown input.search:focus+.text .icon{opacity:.45}.ui.active.search.dropdown input.search:focus+.text{color:rgba(115,115,115,.87)!important}.ui.search.dropdown .menu{overflow-x:hidden;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-overflow-scrolling:touch}@media only screen and (max-width:767px){.ui.search.dropdown .menu{max-height:8.01428571rem}}@media only screen and (min-width:768px){.ui.search.dropdown .menu{max-height:10.68571429rem}}@media only screen and (min-width:992px){.ui.search.dropdown .menu{max-height:16.02857143rem}}@media only screen and (min-width:1920px){.ui.search.dropdown .menu{max-height:21.37142857rem}}.ui.multiple.dropdown{padding:.22620476em 2.1em .22620476em .35714286em}.ui.multiple.dropdown .menu{cursor:auto}.ui.multiple.search.dropdown,.ui.multiple.search.dropdown>input.search{cursor:text}.ui.multiple.dropdown>.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;vertical-align:top;white-space:normal;font-size:1em;padding:.35714286em .78571429em;margin:.14285714rem .28571429rem .14285714rem 0;box-shadow:0 0 0 1px rgba(34,36,38,.15) inset}.ui.multiple.dropdown .dropdown.icon{margin:'';padding:''}.ui.multiple.dropdown>.text{position:static;padding:0;max-width:100%;margin:.45240952em 0 .45240952em .64285714em;line-height:1.21428571em}.ui.multiple.dropdown>.label~input.search{margin-left:.14285714em!important}.ui.multiple.dropdown>.label~.text{display:none}.ui.multiple.search.dropdown>.text{display:inline-block;position:absolute;top:0;left:0;padding:inherit;margin:.45240952em 0 .45240952em .64285714em;line-height:1.21428571em}.ui.multiple.search.dropdown>.label~.text{display:none}.ui.multiple.search.dropdown>input.search{position:static;padding:0;max-width:100%;margin:.45240952em 0 .45240952em .64285714em;width:2.2em;line-height:1.21428571em}.ui.inline.dropdown{cursor:pointer;display:inline-block;color:inherit}.ui.inline.dropdown .dropdown.icon{margin:0 .5em 0 .21428571em;vertical-align:baseline}.ui.inline.dropdown>.text{font-weight:700}.ui.inline.dropdown .menu{cursor:auto;margin-top:.21428571em;border-radius:.28571429rem}.ui.dropdown .menu .active.item{background:0 0;font-weight:700;color:rgba(0,0,0,.95);box-shadow:none;z-index:12}.ui.dropdown .menu>.item:hover{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95);z-index:13}.ui.loading.dropdown>i.icon{height:1em!important;padding:1.14285714em 1.07142857em!important}.ui.loading.dropdown>i.icon:before{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.loading.dropdown>i.icon:after{position:absolute;content:'';top:50%;left:50%;box-shadow:0 0 0 1px transparent;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;-webkit-animation:dropdown-spin .6s linear;animation:dropdown-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 transparent transparent;border-style:solid;border-width:.2em}.ui.loading.dropdown.button>i.icon:after,.ui.loading.dropdown.button>i.icon:before{display:none}@-webkit-keyframes dropdown-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes dropdown-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.default.dropdown:not(.button)>.text,.ui.dropdown:not(.button)>.default.text{color:rgba(191,191,191,.87)}.ui.default.dropdown:not(.button)>input:focus+.text,.ui.dropdown:not(.button)>input:focus+.default.text{color:rgba(115,115,115,.87)}.ui.loading.dropdown>.text{-webkit-transition:none;transition:none}.ui.dropdown .loading.menu{display:block;visibility:hidden;z-index:-1}.ui.dropdown .menu .selected.item,.ui.dropdown.selected{background:rgba(0,0,0,.03);color:rgba(0,0,0,.95)}.ui.dropdown>.filtered.text{visibility:hidden}.ui.dropdown .filtered.item{display:none!important}.ui.dropdown.error,.ui.dropdown.error>.default.text,.ui.dropdown.error>.text{color:#9F3A38}.ui.selection.dropdown.error{background:#FFF6F6;border-color:#E0B4B4}.ui.dropdown.error>.menu,.ui.dropdown.error>.menu .menu,.ui.selection.dropdown.error:hover{border-color:#E0B4B4}.ui.dropdown.error>.menu>.item{color:#9F3A38}.ui.multiple.selection.error.dropdown>.label{border-color:#E0B4B4}.ui.dropdown.error>.menu>.item:hover{background-color:#FFF2F2}.ui.dropdown.error>.menu .active.item{background-color:#FDCFCF}.ui.disabled.dropdown,.ui.dropdown .menu>.disabled.item{cursor:default;pointer-events:none;opacity:.45}.ui.dropdown .menu{left:0}.ui.dropdown .menu .right.menu,.ui.dropdown .right.menu>.menu{left:100%!important;right:auto!important;border-radius:.28571429rem!important}.ui.dropdown .menu .left.menu,.ui.dropdown>.left.menu .menu{left:auto!important;right:100%!important;border-radius:.28571429rem!important}.ui.dropdown .item .left.dropdown.icon,.ui.dropdown .left.menu .item .dropdown.icon{width:auto;float:left;margin:0 .78571429rem 0 0}.ui.dropdown .item .left.dropdown.icon+.text,.ui.dropdown .left.menu .item .dropdown.icon+.text{margin-left:1em}.ui.upward.dropdown>.menu{top:auto;bottom:100%;box-shadow:0 0 3px 0 rgba(0,0,0,.08);border-radius:.28571429rem .28571429rem 0 0}.ui.dropdown .upward.menu{top:auto!important;bottom:0!important}.ui.simple.upward.active.dropdown,.ui.simple.upward.dropdown:hover{border-radius:.28571429rem .28571429rem 0 0!important}.ui.upward.dropdown.button:not(.pointing):not(.floating).active{border-radius:.28571429rem .28571429rem 0 0}.ui.upward.selection.dropdown .menu{border-top-width:1px!important;border-bottom-width:0!important;box-shadow:0 -2px 3px 0 rgba(0,0,0,.08)}.ui.upward.selection.dropdown:hover{box-shadow:0 0 2px 0 rgba(0,0,0,.05)}.ui.active.upward.selection.dropdown{border-radius:0 0 .28571429rem .28571429rem!important}.ui.upward.selection.dropdown.visible{box-shadow:0 0 3px 0 rgba(0,0,0,.08);border-radius:0 0 .28571429rem .28571429rem!important}.ui.upward.active.selection.dropdown:hover{box-shadow:0 0 3px 0 rgba(0,0,0,.05)}.ui.upward.active.selection.dropdown:hover .menu{box-shadow:0 -2px 3px 0 rgba(0,0,0,.08)}.ui.dropdown .scrolling.menu,.ui.scrolling.dropdown .menu{overflow-x:hidden;overflow-y:auto}.ui.scrolling.dropdown .menu{overflow-x:hidden;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-overflow-scrolling:touch;min-width:100%!important;width:auto!important}.ui.dropdown .scrolling.menu{position:static;overflow-y:auto;border:none;box-shadow:none!important;border-radius:0!important;margin:0!important;min-width:100%!important;width:auto!important;border-top:1px solid rgba(34,36,38,.15)}.ui.dropdown .scrolling.menu>.item.item.item,.ui.scrolling.dropdown .menu .item.item.item{border-top:none;padding-right:calc(1.14285714rem + 17px)!important}.ui.dropdown .scrolling.menu .item:first-child,.ui.scrolling.dropdown .menu .item:first-child{border-top:none}.ui.dropdown>.animating.menu .scrolling.menu,.ui.dropdown>.visible.menu .scrolling.menu{display:block}@media all and (-ms-high-contrast:none){.ui.dropdown .scrolling.menu,.ui.scrolling.dropdown .menu{min-width:calc(100% - 17px)}}@media only screen and (max-width:767px){.ui.dropdown .scrolling.menu,.ui.scrolling.dropdown .menu{max-height:10.28571429rem}}.ui.simple.dropdown .menu:after,.ui.simple.dropdown .menu:before{display:none}.ui.simple.dropdown .menu{position:absolute;display:block;overflow:hidden;top:-9999px!important;opacity:0;width:0;height:0;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.ui.simple.active.dropdown,.ui.simple.dropdown:hover{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.ui.simple.active.dropdown>.menu,.ui.simple.dropdown:hover>.menu{overflow:visible;width:auto;height:auto;top:100%!important;opacity:1}.ui.simple.dropdown:hover>.menu>.item:hover>.menu,.ui.simple.dropdown>.menu>.item:active>.menu{overflow:visible;width:auto;height:auto;top:0!important;left:100%!important;opacity:1}.ui.simple.disabled.dropdown:hover .menu{display:none;height:0;width:0;overflow:hidden}.ui.simple.visible.dropdown>.menu{display:block}.ui.fluid.dropdown{display:block;width:100%;min-width:0}.ui.fluid.dropdown>.dropdown.icon{float:right}.ui.floating.dropdown .menu{left:0;right:auto;box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15)!important;border-radius:.28571429rem!important}.ui.floating.dropdown>.menu{margin-top:.5em!important;border-radius:.28571429rem!important}.ui.pointing.dropdown>.menu{top:100%;margin-top:.78571429rem;border-radius:.28571429rem}.ui.pointing.dropdown>.menu:after{display:block;position:absolute;pointer-events:none;content:'';visibility:visible;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:.5em;height:.5em;box-shadow:-1px -1px 0 1px rgba(34,36,38,.15);background:#FFF;z-index:2;top:-.25em;left:50%;margin:0 0 0 -.25em}.ui.top.left.pointing.dropdown>.menu{top:100%;bottom:auto;left:0;right:auto;margin:1em 0 0}.ui.top.left.pointing.dropdown>.menu:after{top:-.25em;left:1em;right:auto;margin:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ui.top.right.pointing.dropdown>.menu{top:100%;bottom:auto;right:0;left:auto;margin:1em 0 0}.ui.top.right.pointing.dropdown>.menu:after{top:-.25em;left:auto;right:1em;margin:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ui.left.pointing.dropdown>.menu{top:0;left:100%;right:auto;margin:0 0 0 1em}.ui.left.pointing.dropdown>.menu:after{top:1em;left:-.25em;margin:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.ui.right.pointing.dropdown>.menu{top:0;left:auto;right:100%;margin:0 1em 0 0}.ui.right.pointing.dropdown>.menu:after{top:1em;left:auto;right:-.25em;margin:0;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ui.bottom.pointing.dropdown>.menu{top:auto;bottom:100%;left:0;right:auto;margin:0 0 1em}.ui.bottom.pointing.dropdown>.menu:after{top:auto;bottom:-.25em;right:auto;margin:0;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.ui.bottom.pointing.dropdown>.menu .menu{top:auto!important;bottom:0!important}.ui.bottom.left.pointing.dropdown>.menu{left:0;right:auto}.ui.bottom.left.pointing.dropdown>.menu:after{left:1em;right:auto}.ui.bottom.right.pointing.dropdown>.menu{right:0;left:auto}.ui.bottom.right.pointing.dropdown>.menu:after{left:auto;right:1em}.ui.upward.pointing.dropdown>.menu,.ui.upward.top.pointing.dropdown>.menu{top:auto;bottom:100%;margin:0 0 .78571429rem;border-radius:.28571429rem}.ui.upward.pointing.dropdown>.menu:after,.ui.upward.top.pointing.dropdown>.menu:after{top:100%;bottom:auto;box-shadow:1px 1px 0 1px rgba(34,36,38,.15);margin:-.25em 0 0}@font-face{font-family:Dropdown;src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfuIIAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zjo82LgAAAFwAAABVGhlYWQAQ88bAAACxAAAADZoaGVhAwcB6QAAAvwAAAAkaG10eAS4ABIAAAMgAAAAIGxvY2EBNgDeAAADQAAAABJtYXhwAAoAFgAAA1QAAAAgbmFtZVcZpu4AAAN0AAABRXBvc3QAAwAAAAAEvAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDX//3//wAB/+MPLQADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAIABJQElABMAABM0NzY3BTYXFhUUDwEGJwYvASY1AAUGBwEACAUGBoAFCAcGgAUBEgcGBQEBAQcECQYHfwYBAQZ/BwYAAQAAAG4BJQESABMAADc0PwE2MzIfARYVFAcGIyEiJyY1AAWABgcIBYAGBgUI/wAHBgWABwaABQWABgcHBgUFBgcAAAABABIASQC3AW4AEwAANzQ/ATYXNhcWHQEUBwYnBi8BJjUSBoAFCAcFBgYFBwgFgAbbBwZ/BwEBBwQJ/wgEBwEBB38GBgAAAAABAAAASQClAW4AEwAANxE0NzYzMh8BFhUUDwEGIyInJjUABQYHCAWABgaABQgHBgVbAQAIBQYGgAUIBwWABgYFBwAAAAEAAAABAADZuaKOXw889QALAgAAAAAA0ABHWAAAAADQAEdYAAAAAAElAW4AAAAIAAIAAAAAAAAAAQAAAeD/4AAAAgAAAAAAASUAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAASUAAAElAAAAtwASALcAAAAAAAAACgAUAB4AQgBkAIgAqgAAAAEAAAAIABQAAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAOAAAAAQAAAAAAAgAOAEcAAQAAAAAAAwAOACQAAQAAAAAABAAOAFUAAQAAAAAABQAWAA4AAQAAAAAABgAHADIAAQAAAAAACgA0AGMAAwABBAkAAQAOAAAAAwABBAkAAgAOAEcAAwABBAkAAwAOACQAAwABBAkABAAOAFUAAwABBAkABQAWAA4AAwABBAkABgAOADkAAwABBAkACgA0AGMAaQBjAG8AbQBvAG8AbgBWAGUAcgBzAGkAbwBuACAAMQAuADAAaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AbgBSAGUAZwB1AGwAYQByAGkAYwBvAG0AbwBvAG4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAAVwAAoAAAAABSgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAdkAAAHZLDXE/09TLzIAAALQAAAAYAAAAGAIIweQY21hcAAAAzAAAABMAAAATA9+4ghnYXNwAAADfAAAAAgAAAAIAAAAEGhlYWQAAAOEAAAANgAAADYAQ88baGhlYQAAA7wAAAAkAAAAJAMHAelobXR4AAAD4AAAACAAAAAgBLgAEm1heHAAAAQAAAAABgAAAAYACFAAbmFtZQAABAgAAAFFAAABRVcZpu5wb3N0AAAFUAAAACAAAAAgAAMAAAEABAQAAQEBCGljb21vb24AAQIAAQA6+BwC+BsD+BgEHgoAGVP/i4seCgAZU/+LiwwHi2v4lPh0BR0AAACIDx0AAACNER0AAAAJHQAAAdASAAkBAQgPERMWGyAlKmljb21vb25pY29tb29udTB1MXUyMHVGMEQ3dUYwRDh1RjBEOXVGMERBAAACAYkABgAIAgABAAQABwAKAA0AVgCfAOgBL/yUDvyUDvyUDvuUDvtvi/emFYuQjZCOjo+Pj42Qiwj3lIsFkIuQiY6Hj4iNhouGi4aJh4eHCPsU+xQFiIiGiYaLhouHjYeOCPsU9xQFiI+Jj4uQCA77b4v3FBWLkI2Pjo8I9xT3FAWPjo+NkIuQi5CJjogI9xT7FAWPh42Hi4aLhomHh4eIiIaJhosI+5SLBYaLh42HjoiPiY+LkAgO+92d928Vi5CNkI+OCPcU9xQFjo+QjZCLkIuPiY6Hj4iNhouGCIv7lAWLhomHh4iIh4eJhouGi4aNiI8I+xT3FAWHjomPi5AIDvvdi+YVi/eUBYuQjZCOjo+Pj42Qi5CLkImOhwj3FPsUBY+IjYaLhouGiYeHiAj7FPsUBYiHhomGi4aLh42Hj4iOiY+LkAgO+JQU+JQViwwKAAAAAAMCAAGQAAUAAAFMAWYAAABHAUwBZgAAAPUAGQCEAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8NoB4P/g/+AB4AAgAAAAAQAAAAAAAAAAAAAAIAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABAA4AAAACgAIAAIAAgABACDw2v/9//8AAAAAACDw1//9//8AAf/jDy0AAwABAAAAAAAAAAAAAAABAAH//wAPAAEAAAABAAA5emozXw889QALAgAAAAAA0ABHWAAAAADQAEdYAAAAAAElAW4AAAAIAAIAAAAAAAAAAQAAAeD/4AAAAgAAAAAAASUAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAASUAAAElAAAAtwASALcAAAAAUAAACAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIADgBHAAEAAAAAAAMADgAkAAEAAAAAAAQADgBVAAEAAAAAAAUAFgAOAAEAAAAAAAYABwAyAAEAAAAAAAoANABjAAMAAQQJAAEADgAAAAMAAQQJAAIADgBHAAMAAQQJAAMADgAkAAMAAQQJAAQADgBVAAMAAQQJAAUAFgAOAAMAAQQJAAYADgA5AAMAAQQJAAoANABjAGkAYwBvAG0AbwBvAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG4AUgBlAGcAdQBsAGEAcgBpAGMAbwBtAG8AbwBuAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');font-weight:400;font-style:normal}.ui.dropdown>.dropdown.icon{font-family:Dropdown;line-height:1;height:1em;-webkit-backface-visibility:hidden;backface-visibility:hidden;font-weight:400;font-style:normal;text-align:center;width:auto}.ui.dropdown>.dropdown.icon:before{content:'\f0d7'}.ui.dropdown .menu .item .dropdown.icon:before{content:'\f0da'}.ui.dropdown .item .left.dropdown.icon:before,.ui.dropdown .left.menu .item .dropdown.icon:before{content:"\f0d9"}.ui.vertical.menu .dropdown.item>.dropdown.icon:before{content:"\f0da"}.ui.embed{position:relative;max-width:100%;height:0;overflow:hidden;background:#DCDDDE;padding-bottom:56.25%}.ui.embed embed,.ui.embed iframe,.ui.embed object{position:absolute;border:none;width:100%;height:100%;top:0;left:0;margin:0;padding:0}.ui.embed>.embed{display:none}.ui.embed>.placeholder{position:absolute;cursor:pointer;top:0;left:0;display:block;width:100%;height:100%;background-color:radial-gradient(transparent 45%,rgba(0,0,0,.3))}.ui.embed>.icon{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2}.ui.embed>.icon:after{position:absolute;top:0;left:0;width:100%;height:100%;z-index:3;content:'';background:-webkit-radial-gradient(transparent 45%,rgba(0,0,0,.3));background:radial-gradient(transparent 45%,rgba(0,0,0,.3));opacity:.5;-webkit-transition:opacity .5s ease;transition:opacity .5s ease}.ui.embed>.icon:before{position:absolute;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);color:#FFF;font-size:6rem;text-shadow:0 2px 10px rgba(34,36,38,.2);-webkit-transition:opacity .5s ease,color .5s ease;transition:opacity .5s ease,color .5s ease;z-index:10}.ui.embed .icon:hover:after{background:-webkit-radial-gradient(transparent 45%,rgba(0,0,0,.3));background:radial-gradient(transparent 45%,rgba(0,0,0,.3));opacity:1}.ui.embed .icon:hover:before{color:#FFF}.ui.active.embed>.icon,.ui.active.embed>.placeholder{display:none}.ui.active.embed>.embed{display:block}.ui.square.embed{padding-bottom:100%}.ui[class*="4:3"].embed{padding-bottom:75%}.ui[class*="16:9"].embed{padding-bottom:56.25%}.ui[class*="21:9"].embed{padding-bottom:42.85714286%}.ui.modal{display:none;position:fixed;z-index:1001;top:50%;left:50%;text-align:left;background:#FFF;border:none;box-shadow:1px 3px 3px 0 rgba(0,0,0,.2),1px 3px 15px 2px rgba(0,0,0,.2);-webkit-transform-origin:50% 25%;transform-origin:50% 25%;border-radius:.28571429rem;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;will-change:top,left,margin,transform,opacity}.ui.modal>.icon:first-child+*,.ui.modal>:first-child:not(.icon){border-top-left-radius:.28571429rem;border-top-right-radius:.28571429rem}.ui.modal>:last-child{border-bottom-left-radius:.28571429rem;border-bottom-right-radius:.28571429rem}.ui.modal>.close{cursor:pointer;position:absolute;top:-2.5rem;right:-2.5rem;z-index:1;opacity:.8;font-size:1.25em;color:#FFF;width:2.25rem;height:2.25rem;padding:.625rem 0 0}.ui.modal>.close:hover{opacity:1}.ui.modal>.header{display:block;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;background:#FFF;margin:0;padding:1.25rem 1.5rem;box-shadow:none;color:rgba(0,0,0,.85);border-bottom:1px solid rgba(34,36,38,.15)}.ui.modal>.header:not(.ui){font-size:1.42857143rem;line-height:1.2857em;font-weight:700}.ui.modal>.content{display:block;width:100%;font-size:1em;line-height:1.4;padding:1.5rem;background:#FFF}.ui.modal>.image.content{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.ui.modal>.content>.image{display:block;-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;width:'';-webkit-align-self:top;-ms-flex-item-align:top;align-self:top}.ui.modal>[class*="top aligned"]{-webkit-align-self:top;-ms-flex-item-align:top;align-self:top}.ui.modal>[class*="middle aligned"]{-webkit-align-self:middle;-ms-flex-item-align:middle;align-self:middle}.ui.modal>[class*=stretched]{-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch}.ui.modal>.content>.description{display:block;-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;min-width:0;-webkit-align-self:top;-ms-flex-item-align:top;align-self:top}.ui.modal>.content>.icon+.description,.ui.modal>.content>.image+.description{-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;min-width:'';width:auto;padding-left:2em}.ui.modal>.content>.image>i.icon{margin:0;opacity:1;width:auto;line-height:1;font-size:8rem}.ui.modal>.actions{background:#F9FAFB;padding:1rem;border-top:1px solid rgba(34,36,38,.15);text-align:right}.ui.modal .actions>.button{margin-left:.75em}@media only screen and (max-width:767px){.ui.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.dropdown .scrolling.menu,.ui.scrolling.dropdown .menu{max-height:15.42857143rem}.ui.modal{width:88%;margin:0 0 0 -44%}}@media only screen and (min-width:992px){.ui.dropdown .scrolling.menu,.ui.scrolling.dropdown .menu{max-height:20.57142857rem}.ui.modal{width:850px;margin:0 0 0 -425px}}@media only screen and (min-width:1200px){.ui.modal{width:900px;margin:0 0 0 -450px}}@media only screen and (min-width:1920px){.ui.dropdown .scrolling.menu,.ui.scrolling.dropdown .menu{max-height:20.57142857rem}.ui.modal{width:950px;margin:0 0 0 -475px}}@media only screen and (max-width:991px){.ui.modal>.header{padding-right:2.25rem}.ui.modal>.close{top:1.0535rem;right:1rem;color:rgba(0,0,0,.87)}}@media only screen and (max-width:767px){.ui.modal>.header{padding:.75rem 2.25rem .75rem 1rem!important}.ui.modal>.content{display:block;padding:1rem!important}.ui.modal>.close{top:.5rem!important;right:.5rem!important}.ui.modal .image.content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.ui.modal .content>.image{display:block;max-width:100%;margin:0 auto!important;text-align:center;padding:0 0 1rem!important}.ui.modal>.content>.image>i.icon{font-size:5rem;text-align:center}.ui.modal .content>.description{display:block;width:100%!important;margin:0!important;padding:1rem 0!important;box-shadow:none}.ui.modal>.actions{padding:1rem 1rem 0!important}.ui.modal .actions>.button,.ui.modal .actions>.buttons{margin-bottom:1rem}}.ui.inverted.dimmer>.ui.modal{box-shadow:1px 3px 10px 2px rgba(0,0,0,.2)}.ui.basic.modal{background-color:transparent;border:none;border-radius:0;box-shadow:none!important;color:#FFF}.ui.basic.modal>.actions,.ui.basic.modal>.content,.ui.basic.modal>.header{background-color:transparent}.ui.basic.modal>.header{color:#FFF}.ui.basic.modal>.close{top:1rem;right:1.5rem}.ui.inverted.dimmer>.basic.modal{color:rgba(0,0,0,.87)}.ui.inverted.dimmer>.ui.basic.modal>.header{color:rgba(0,0,0,.85)}.ui.active.modal{display:block}.scrolling.dimmable.dimmed{overflow:hidden}.scrolling.dimmable.dimmed>.dimmer{overflow:auto;-webkit-overflow-scrolling:touch}.scrolling.dimmable>.dimmer{position:fixed}.modals.dimmer .ui.scrolling.modal{position:static!important;margin:3.5rem auto!important}.scrolling.undetached.dimmable.dimmed{overflow:auto;-webkit-overflow-scrolling:touch}.scrolling.undetached.dimmable.dimmed>.dimmer{overflow:hidden}.scrolling.undetached.dimmable .ui.scrolling.modal{position:absolute;left:50%;margin-top:3.5rem!important}.undetached.dimmable.dimmed>.pusher{z-index:auto}@media only screen and (max-width:991px){.ui.basic.modal>.close{color:#FFF}.modals.dimmer .ui.scrolling.modal{margin-top:1rem!important;margin-bottom:1rem!important}}.ui.fullscreen.modal{width:95%!important;left:2.5%!important;margin:1em auto}.ui.fullscreen.scrolling.modal{left:0!important}.ui.fullscreen.modal>.header{padding-right:2.25rem}.ui.fullscreen.modal>.close{top:1.0535rem;right:1rem;color:rgba(0,0,0,.87)}.ui.modal{font-size:1rem}.ui.small.modal>.header:not(.ui){font-size:1.3em}@media only screen and (max-width:767px){.ui.small.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.small.modal{width:70.4%;margin:0 0 0 -35.2%}}@media only screen and (min-width:992px){.ui.small.modal{width:680px;margin:0 0 0 -340px}}@media only screen and (min-width:1200px){.ui.small.modal{width:720px;margin:0 0 0 -360px}}@media only screen and (min-width:1920px){.ui.small.modal{width:760px;margin:0 0 0 -380px}}.ui.large.modal>.header{font-size:1.6em}@media only screen and (max-width:767px){.ui.large.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.large.modal{width:88%;margin:0 0 0 -44%}}@media only screen and (min-width:992px){.ui.large.modal{width:1020px;margin:0 0 0 -510px}}@media only screen and (min-width:1200px){.ui.large.modal{width:1080px;margin:0 0 0 -540px}}@media only screen and (min-width:1920px){.ui.large.modal{width:1140px;margin:0 0 0 -570px}}.ui.nag{display:none;opacity:.95;position:relative;top:0;left:0;z-index:999;min-height:0;width:100%;margin:0;padding:.75em 1em;background:#555;box-shadow:0 1px 2px 0 rgba(0,0,0,.2);font-size:1rem;text-align:center;color:rgba(0,0,0,.87);border-radius:0 0 .28571429rem .28571429rem;-webkit-transition:.2s background ease;transition:.2s background ease}a.ui.nag{cursor:pointer}.ui.nag>.title{display:inline-block;margin:0 .5em;color:#FFF}.ui.nag>.close.icon{cursor:pointer;opacity:.4;position:absolute;top:50%;right:1em;font-size:1em;margin:-.5em 0 0;color:#FFF;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}.ui.nag:hover{background:#555;opacity:1}.ui.nag .close:hover{opacity:1}.ui.overlay.nag{position:absolute;display:block}.ui.fixed.nag{position:fixed}.ui.bottom.nag,.ui.bottom.nags{border-radius:.28571429rem .28571429rem 0 0;top:auto;bottom:0}.ui.inverted.nag,.ui.inverted.nags .nag{background-color:#F3F4F5;color:rgba(0,0,0,.85)}.ui.inverted.nag .close,.ui.inverted.nag .title,.ui.inverted.nags .nag .close,.ui.inverted.nags .nag .title{color:rgba(0,0,0,.4)}.ui.nags .nag{border-radius:0!important}.ui.nags .nag:last-child{border-radius:0 0 .28571429rem .28571429rem}.ui.bottom.nags .nag:last-child{border-radius:.28571429rem .28571429rem 0 0}.ui.popup{display:none;position:absolute;top:0;right:0;min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;z-index:1900;border:1px solid #D4D4D5;line-height:1.4285em;max-width:250px;background:#FFF;padding:.833em 1em;font-weight:400;font-style:normal;color:rgba(0,0,0,.87);border-radius:.28571429rem;box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15)}.ui.popup>.header{padding:0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1.14285714em;line-height:1.2;font-weight:700}.ui.popup>.header+.content{padding-top:.5em}.ui.popup:before{position:absolute;content:'';width:.71428571em;height:.71428571em;background:#FFF;-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:2;box-shadow:1px 1px 0 0 #bababc}[data-tooltip]{position:relative}[data-tooltip]:not([data-position]):before{top:auto;right:auto;bottom:100%;left:50%;background:#FFF;margin-left:-.07142857rem;margin-bottom:.14285714rem}[data-tooltip]:not([data-position]):after{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:100%;margin-bottom:.5em}[data-tooltip]:after,[data-tooltip]:before{pointer-events:none;visibility:hidden}[data-tooltip]:before{position:absolute;content:'';font-size:1rem;width:.71428571em;height:.71428571em;background:#FFF;z-index:2;box-shadow:1px 1px 0 0 #bababc;opacity:0;-webkit-transform:rotate(45deg) scale(0)!important;transform:rotate(45deg) scale(0)!important;-webkit-transform-origin:center top;transform-origin:center top;-webkit-transition:all .1s ease;transition:all .1s ease}[data-tooltip]:after{content:attr(data-tooltip);position:absolute;text-transform:none;text-align:left;white-space:nowrap;font-size:1rem;border:1px solid #D4D4D5;line-height:1.4285em;max-width:none;background:#FFF;padding:.833em 1em;font-weight:400;font-style:normal;color:rgba(0,0,0,.87);border-radius:.28571429rem;box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);z-index:1;opacity:1;-webkit-transform-origin:center bottom;transform-origin:center bottom;-webkit-transition:all .1s ease;transition:all .1s ease}[data-tooltip]:hover:after,[data-tooltip]:hover:before{visibility:visible;pointer-events:auto}[data-tooltip]:hover:before{-webkit-transform:rotate(45deg) scale(1)!important;transform:rotate(45deg) scale(1)!important;opacity:1}[data-tooltip]:after,[data-tooltip][data-position="top center"]:after,[data-tooltip][data-position="bottom center"]:after{-webkit-transform:translateX(-50%) scale(0)!important;transform:translateX(-50%) scale(0)!important}[data-tooltip]:hover:after,[data-tooltip][data-position="bottom center"]:hover:after{-webkit-transform:translateX(-50%) scale(1)!important;transform:translateX(-50%) scale(1)!important}[data-tooltip][data-position="left center"]:after,[data-tooltip][data-position="right center"]:after{-webkit-transform:translateY(-50%) scale(0)!important;transform:translateY(-50%) scale(0)!important}[data-tooltip][data-position="left center"]:hover:after,[data-tooltip][data-position="right center"]:hover:after{-webkit-transform:translateY(-50%) scale(1)!important;transform:translateY(-50%) scale(1)!important}[data-tooltip][data-position="top left"]:after,[data-tooltip][data-position="top right"]:after,[data-tooltip][data-position="bottom left"]:after,[data-tooltip][data-position="bottom right"]:after{-webkit-transform:scale(0)!important;transform:scale(0)!important}[data-tooltip][data-position="top left"]:hover:after,[data-tooltip][data-position="top right"]:hover:after,[data-tooltip][data-position="bottom left"]:hover:after,[data-tooltip][data-position="bottom right"]:hover:after{-webkit-transform:scale(1)!important;transform:scale(1)!important}[data-tooltip][data-inverted]:before{box-shadow:none!important;background:#1B1C1D}[data-tooltip][data-inverted]:after{background:#1B1C1D;color:#FFF;border:none;box-shadow:none}[data-tooltip][data-inverted]:after .header{background-color:none;color:#FFF}[data-position="top center"][data-tooltip]:after{top:auto;right:auto;left:50%;bottom:100%;-webkit-transform:translateX(-50%);transform:translateX(-50%);margin-bottom:.5em}[data-position="top center"][data-tooltip]:before{top:auto;right:auto;bottom:100%;left:50%;background:#FFF;margin-left:-.07142857rem;margin-bottom:.14285714rem}[data-position="top left"][data-tooltip]:after{top:auto;right:auto;left:0;bottom:100%;margin-bottom:.5em}[data-position="top left"][data-tooltip]:before{top:auto;right:auto;bottom:100%;left:1em;margin-left:-.07142857rem;margin-bottom:.14285714rem}[data-position="top right"][data-tooltip]:after{top:auto;left:auto;right:0;bottom:100%;margin-bottom:.5em}[data-position="top right"][data-tooltip]:before{top:auto;left:auto;bottom:100%;right:1em;margin-left:-.07142857rem;margin-bottom:.14285714rem}[data-position="bottom center"][data-tooltip]:after{bottom:auto;right:auto;left:50%;top:100%;-webkit-transform:translateX(-50%);transform:translateX(-50%);margin-top:.5em}[data-position="bottom center"][data-tooltip]:before{bottom:auto;right:auto;top:100%;left:50%;margin-left:-.07142857rem;margin-top:.14285714rem}[data-position="bottom left"][data-tooltip]:after{left:0;top:100%;margin-top:.5em}[data-position="bottom left"][data-tooltip]:before{bottom:auto;right:auto;top:100%;left:1em;margin-left:-.07142857rem;margin-top:.14285714rem}[data-position="bottom right"][data-tooltip]:after{right:0;top:100%;margin-top:.5em}[data-position="bottom right"][data-tooltip]:before{bottom:auto;left:auto;top:100%;right:1em;margin-left:-.14285714rem;margin-top:.07142857rem}[data-position="left center"][data-tooltip]:after{right:100%;top:50%;margin-right:.5em;-webkit-transform:translateY(-50%);transform:translateY(-50%)}[data-position="right center"][data-tooltip]:after{left:100%;top:50%;margin-left:.5em;-webkit-transform:translateY(-50%);transform:translateY(-50%)}[data-position~=bottom][data-tooltip]:before{background:#FFF;box-shadow:-1px -1px 0 0 #bababc;-webkit-transform-origin:center bottom;transform-origin:center bottom}[data-position="left center"][data-tooltip]:before{right:100%;top:50%;margin-top:-.14285714rem;margin-right:-.07142857rem;background:#FFF;box-shadow:1px -1px 0 0 #bababc}[data-position="right center"][data-tooltip]:before{left:100%;top:50%;margin-top:-.07142857rem;margin-left:.14285714rem;background:#FFF;box-shadow:-1px 1px 0 0 #bababc}[data-position~=top][data-tooltip]:before{background:#FFF}[data-inverted][data-position~=bottom][data-tooltip]:before{background:#1B1C1D;box-shadow:-1px -1px 0 0 #bababc}[data-inverted][data-position="left center"][data-tooltip]:before{background:#1B1C1D;box-shadow:1px -1px 0 0 #bababc}[data-inverted][data-position="right center"][data-tooltip]:before{background:#1B1C1D;box-shadow:-1px 1px 0 0 #bababc}[data-inverted][data-position~=top][data-tooltip]:before{background:#1B1C1D}[data-position~=bottom][data-tooltip]:after{-webkit-transform-origin:center top;transform-origin:center top}[data-position="left center"][data-tooltip]:before{-webkit-transform-origin:top center;transform-origin:top center}[data-position="left center"][data-tooltip]:after,[data-position="right center"][data-tooltip]:before{-webkit-transform-origin:right center;transform-origin:right center}[data-position="right center"][data-tooltip]:after{-webkit-transform-origin:left center;transform-origin:left center}.ui.popup{margin:0}.ui.top.popup{margin:0 0 .71428571em}.ui.top.left.popup{-webkit-transform-origin:left bottom;transform-origin:left bottom}.ui.top.center.popup{-webkit-transform-origin:center bottom;transform-origin:center bottom}.ui.top.right.popup{-webkit-transform-origin:right bottom;transform-origin:right bottom}.ui.left.center.popup{margin:0 .71428571em 0 0;-webkit-transform-origin:right 50%;transform-origin:right 50%}.ui.right.center.popup{margin:0 0 0 .71428571em;-webkit-transform-origin:left 50%;transform-origin:left 50%}.ui.bottom.popup{margin:.71428571em 0 0}.ui.bottom.left.popup{-webkit-transform-origin:left top;transform-origin:left top}.ui.bottom.center.popup{-webkit-transform-origin:center top;transform-origin:center top}.ui.bottom.right.popup{-webkit-transform-origin:right top;transform-origin:right top;margin-right:0}.ui.bottom.center.popup:before{margin-left:-.30714286em;top:-.30714286em;left:50%;right:auto;bottom:auto;box-shadow:-1px -1px 0 0 #bababc}.ui.bottom.left.popup{margin-left:0}.ui.bottom.left.popup:before{top:-.30714286em;left:1em;right:auto;bottom:auto;margin-left:0;box-shadow:-1px -1px 0 0 #bababc}.ui.bottom.right.popup:before{top:-.30714286em;right:1em;bottom:auto;left:auto;margin-left:0;box-shadow:-1px -1px 0 0 #bababc}.ui.top.center.popup:before{top:auto;right:auto;bottom:-.30714286em;left:50%;margin-left:-.30714286em}.ui.top.left.popup{margin-left:0}.ui.top.left.popup:before{bottom:-.30714286em;left:1em;top:auto;right:auto;margin-left:0}.ui.top.right.popup{margin-right:0}.ui.top.right.popup:before{bottom:-.30714286em;right:1em;top:auto;left:auto;margin-left:0}.ui.left.center.popup:before{top:50%;right:-.30714286em;bottom:auto;left:auto;margin-top:-.30714286em;box-shadow:1px -1px 0 0 #bababc}.ui.right.center.popup:before{top:50%;left:-.30714286em;bottom:auto;right:auto;margin-top:-.30714286em;box-shadow:-1px 1px 0 0 #bababc}.ui.bottom.popup:before,.ui.left.center.popup:before,.ui.right.center.popup:before,.ui.top.popup:before{background:#FFF}.ui.inverted.bottom.popup:before,.ui.inverted.left.center.popup:before,.ui.inverted.right.center.popup:before,.ui.inverted.top.popup:before{background:#1B1C1D}.ui.popup>.ui.grid:not(.padded){width:calc(100% + 1.75rem);margin:-.7rem -.875rem}.ui.loading.popup{display:block;visibility:hidden;z-index:-1}.ui.animating.popup,.ui.visible.popup{display:block}.ui.visible.popup{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.ui.basic.popup:before{display:none}.ui.wide.popup{max-width:350px}.ui[class*="very wide"].popup{max-width:550px}@media only screen and (max-width:767px){.ui.wide.popup,.ui[class*="very wide"].popup{max-width:250px}}.ui.fluid.popup{width:100%;max-width:none}.ui.inverted.popup{background:#1B1C1D;color:#FFF;border:none;box-shadow:none}.ui.inverted.popup .header{background-color:none;color:#FFF}.ui.inverted.popup:before{background-color:#1B1C1D;box-shadow:none!important}.ui.flowing.popup{max-width:none}.ui.mini.popup{font-size:.78571429rem}.ui.tiny.popup{font-size:.85714286rem}.ui.small.popup{font-size:.92857143rem}.ui.popup{font-size:1rem}.ui.large.popup{font-size:1.14285714rem}.ui.huge.popup{font-size:1.42857143rem}.ui.progress{position:relative;display:block;max-width:100%;border:none;margin:1em 0 2.5em;box-shadow:none;background:rgba(0,0,0,.1);padding:0;border-radius:.28571429rem}.ui.progress:first-child{margin:0 0 2.5em}.ui.progress:last-child{margin:0 0 1.5em}.ui.progress .bar{display:block;line-height:1;position:relative;width:0;min-width:2em;background:#888;border-radius:.28571429rem;-webkit-transition:width .1s ease,background-color .1s ease;transition:width .1s ease,background-color .1s ease}.ui.progress .bar>.progress{white-space:nowrap;position:absolute;width:auto;font-size:.92857143em;top:50%;right:.5em;left:auto;bottom:auto;color:rgba(255,255,255,.7);text-shadow:none;margin-top:-.5em;font-weight:700;text-align:left}.ui.progress>.label{position:absolute;width:100%;font-size:1em;top:100%;right:auto;left:0;bottom:auto;color:rgba(0,0,0,.87);font-weight:700;text-shadow:none;margin-top:.2em;text-align:center;-webkit-transition:color .4s ease;transition:color .4s ease}.ui.indicating.progress[data-percent^="1"] .bar,.ui.indicating.progress[data-percent^="2"] .bar{background-color:#D95C5C}.ui.indicating.progress[data-percent^="3"] .bar{background-color:#EFBC72}.ui.indicating.progress[data-percent^="4"] .bar,.ui.indicating.progress[data-percent^="5"] .bar{background-color:#E6BB48}.ui.indicating.progress[data-percent^="6"] .bar{background-color:#DDC928}.ui.indicating.progress[data-percent^="7"] .bar,.ui.indicating.progress[data-percent^="8"] .bar{background-color:#B4D95C}.ui.indicating.progress[data-percent^="9"] .bar,.ui.indicating.progress[data-percent^="100"] .bar{background-color:#66DA81}.ui.indicating.progress[data-percent^="1"] .label,.ui.indicating.progress[data-percent^="2"] .label,.ui.indicating.progress[data-percent^="3"] .label,.ui.indicating.progress[data-percent^="4"] .label,.ui.indicating.progress[data-percent^="5"] .label,.ui.indicating.progress[data-percent^="6"] .label,.ui.indicating.progress[data-percent^="7"] .label,.ui.indicating.progress[data-percent^="8"] .label,.ui.indicating.progress[data-percent^="9"] .label,.ui.indicating.progress[data-percent^="100"] .label{color:rgba(0,0,0,.87)}.ui.indicating.progress[data-percent="1"] .bar,.ui.indicating.progress[data-percent="2"] .bar,.ui.indicating.progress[data-percent="3"] .bar,.ui.indicating.progress[data-percent="4"] .bar,.ui.indicating.progress[data-percent="5"] .bar,.ui.indicating.progress[data-percent="6"] .bar,.ui.indicating.progress[data-percent="7"] .bar,.ui.indicating.progress[data-percent="8"] .bar,.ui.indicating.progress[data-percent="9"] .bar{background-color:#D95C5C}.ui.indicating.progress[data-percent="1"] .label,.ui.indicating.progress[data-percent="2"] .label,.ui.indicating.progress[data-percent="3"] .label,.ui.indicating.progress[data-percent="4"] .label,.ui.indicating.progress[data-percent="5"] .label,.ui.indicating.progress[data-percent="6"] .label,.ui.indicating.progress[data-percent="7"] .label,.ui.indicating.progress[data-percent="8"] .label,.ui.indicating.progress[data-percent="9"] .label{color:rgba(0,0,0,.87)}.ui.indicating.progress.success .label{color:#1A531B}.ui.progress.success .bar{background-color:#21BA45!important}.ui.progress.success .bar,.ui.progress.success .bar::after{-webkit-animation:none!important;animation:none!important}.ui.progress.success>.label{color:#1A531B}.ui.progress.warning .bar{background-color:#F2C037!important}.ui.progress.warning .bar,.ui.progress.warning .bar::after{-webkit-animation:none!important;animation:none!important}.ui.progress.warning>.label{color:#794B02}.ui.progress.error .bar{background-color:#DB2828!important}.ui.progress.error .bar,.ui.progress.error .bar::after{-webkit-animation:none!important;animation:none!important}.ui.progress.error>.label{color:#912D2B}.ui.active.progress .bar{position:relative;min-width:2em}.ui.active.progress .bar::after{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#FFF;border-radius:.28571429rem;-webkit-animation:progress-active 2s ease infinite;animation:progress-active 2s ease infinite}@-webkit-keyframes progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@keyframes progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}.ui.disabled.progress{opacity:.35}.ui.disabled.progress .bar,.ui.disabled.progress .bar::after{-webkit-animation:none!important;animation:none!important}.ui.inverted.progress{background:rgba(255,255,255,.08);border:none}.ui.inverted.progress .bar{background:#888}.ui.inverted.progress .bar>.progress{color:#F9FAFB}.ui.inverted.progress>.label{color:#FFF}.ui.inverted.progress.success>.label{color:#21BA45}.ui.inverted.progress.warning>.label{color:#F2C037}.ui.inverted.progress.error>.label{color:#DB2828}.ui.progress.attached{background:0 0;position:relative;border:none;margin:0}.ui.progress.attached,.ui.progress.attached .bar{display:block;height:.2rem;padding:0;overflow:hidden;border-radius:0 0 .28571429rem .28571429rem}.ui.progress.attached .bar{border-radius:0}.ui.progress.top.attached,.ui.progress.top.attached .bar{top:0;border-radius:.28571429rem .28571429rem 0 0}.ui.progress.top.attached .bar{border-radius:0}.ui.card>.ui.attached.progress,.ui.segment>.ui.attached.progress{position:absolute;top:auto;left:0;bottom:100%;width:100%}.ui.card>.ui.bottom.attached.progress,.ui.segment>.ui.bottom.attached.progress{top:100%;bottom:auto}.ui.red.progress .bar{background-color:#DB2828}.ui.red.inverted.progress .bar{background-color:#FF695E}.ui.orange.progress .bar{background-color:#F2711C}.ui.orange.inverted.progress .bar{background-color:#FF851B}.ui.yellow.progress .bar{background-color:#FBBD08}.ui.yellow.inverted.progress .bar{background-color:#FFE21F}.ui.olive.progress .bar{background-color:#B5CC18}.ui.olive.inverted.progress .bar{background-color:#D9E778}.ui.green.progress .bar{background-color:#21BA45}.ui.green.inverted.progress .bar{background-color:#2ECC40}.ui.teal.progress .bar{background-color:#00B5AD}.ui.teal.inverted.progress .bar{background-color:#6DFFFF}.ui.blue.progress .bar{background-color:#2185D0}.ui.blue.inverted.progress .bar{background-color:#54C8FF}.ui.violet.progress .bar{background-color:#6435C9}.ui.violet.inverted.progress .bar{background-color:#A291FB}.ui.purple.progress .bar{background-color:#A333C8}.ui.purple.inverted.progress .bar{background-color:#DC73FF}.ui.pink.progress .bar{background-color:#E03997}.ui.pink.inverted.progress .bar{background-color:#FF8EDF}.ui.brown.progress .bar{background-color:#A5673F}.ui.brown.inverted.progress .bar{background-color:#D67C1C}.ui.grey.progress .bar{background-color:#767676}.ui.grey.inverted.progress .bar{background-color:#DCDDDE}.ui.black.progress .bar{background-color:#1B1C1D}.ui.black.inverted.progress .bar{background-color:#545454}.ui.tiny.progress{font-size:.85714286rem}.ui.tiny.progress .bar{height:.5em}.ui.small.progress{font-size:.92857143rem}.ui.small.progress .bar{height:1em}.ui.progress{font-size:1rem}.ui.progress .bar{height:1.75em}.ui.large.progress{font-size:1.14285714rem}.ui.large.progress .bar{height:2.5em}.ui.big.progress{font-size:1.28571429rem}.ui.big.progress .bar{height:3.5em}.ui.rating:last-child{margin-right:0}.ui.rating .icon{padding:0;margin:0;-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;cursor:pointer;width:1.25em;height:auto;-webkit-transition:opacity .1s ease,background .1s ease,text-shadow .1s ease,color .1s ease;transition:opacity .1s ease,background .1s ease,text-shadow .1s ease,color .1s ease;background:0 0;color:rgba(0,0,0,.15);font-family:Rating;line-height:1;-webkit-backface-visibility:hidden;backface-visibility:hidden;font-weight:400;font-style:normal;text-align:center}.ui.rating .active.icon{background:0 0;color:rgba(0,0,0,.85)}.ui.rating .icon.selected,.ui.rating .icon.selected.active{background:0 0;color:rgba(0,0,0,.87)}.ui.star.rating .icon{width:1.25em;height:auto;background:0 0;color:rgba(0,0,0,.15);text-shadow:none}.ui.star.rating .active.icon{background:0 0!important;color:#FFE623!important;text-shadow:0 -1px 0 #DDC507,-1px 0 0 #DDC507,0 1px 0 #DDC507,1px 0 0 #DDC507!important}.ui.star.rating .icon.selected,.ui.star.rating .icon.selected.active{background:0 0!important;color:#FC0!important;text-shadow:0 -1px 0 #E6A200,-1px 0 0 #E6A200,0 1px 0 #E6A200,1px 0 0 #E6A200!important}.ui.heart.rating .icon{width:1.4em;height:auto;background:0 0;color:rgba(0,0,0,.15);text-shadow:none!important}.ui.heart.rating .active.icon{background:0 0!important;color:#FF6D75!important;text-shadow:0 -1px 0 #CD0707,-1px 0 0 #CD0707,0 1px 0 #CD0707,1px 0 0 #CD0707!important}.ui.heart.rating .icon.selected,.ui.heart.rating .icon.selected.active{background:0 0!important;color:#FF3000!important;text-shadow:0 -1px 0 #AA0101,-1px 0 0 #AA0101,0 1px 0 #AA0101,1px 0 0 #AA0101!important}.ui.disabled.rating .icon{cursor:default}.ui.rating .icon.selected,.ui.rating.selected .active.icon,.ui.rating.selected .icon.selected{opacity:1}.ui.mini.rating{font-size:.78571429rem}.ui.tiny.rating{font-size:.85714286rem}.ui.small.rating{font-size:.92857143rem}.ui.rating{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;white-space:nowrap;vertical-align:baseline;font-size:1rem}.ui.large.rating{font-size:1.14285714rem}.ui.huge.rating{font-size:1.42857143rem}.ui.massive.rating{font-size:2rem}@font-face{font-family:Rating;src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjCBsAAAC8AAAAYGNtYXCj2pm8AAABHAAAAKRnYXNwAAAAEAAAAcAAAAAIZ2x5ZlJbXMYAAAHIAAARnGhlYWQBGAe5AAATZAAAADZoaGVhA+IB/QAAE5wAAAAkaG10eCzgAEMAABPAAAAAcGxvY2EwXCxOAAAUMAAAADptYXhwACIAnAAAFGwAAAAgbmFtZfC1n04AABSMAAABPHBvc3QAAwAAAAAVyAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADxZQHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEAJAAAAAgACAABAAAAAEAIOYF8AbwDfAj8C7wbvBw8Irwl/Cc8SPxZf/9//8AAAAAACDmAPAE8AzwI/Au8G7wcPCH8JfwnPEj8WT//f//AAH/4xoEEAYQAQ/sD+IPow+iD4wPgA98DvYOtgADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAPAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAIAAP/tAgAB0wAKABUAAAEvAQ8BFwc3Fyc3BQc3Jz8BHwEHFycCALFPT7GAHp6eHoD/AHAWW304OH1bFnABGRqgoBp8sFNTsHyyOnxYEnFxElh8OgAAAAACAAD/7QIAAdMACgASAAABLwEPARcHNxcnNwUxER8BBxcnAgCxT0+xgB6enh6A/wA4fVsWcAEZGqCgGnywU1OwfLIBHXESWHw6AAAAAQAA/+0CAAHTAAoAAAEvAQ8BFwc3Fyc3AgCxT0+xgB6enh6AARkaoKAafLBTU7B8AAAAAAEAAAAAAgABwAArAAABFA4CBzEHDgMjIi4CLwEuAzU0PgIzMh4CFz4DMzIeAhUCAAcMEgugBgwMDAYGDAwMBqALEgwHFyg2HhAfGxkKChkbHxAeNigXAS0QHxsZCqAGCwkGBQkLBqAKGRsfEB42KBcHDBILCxIMBxcoNh4AAAAAAgAAAAACAAHAACsAWAAAATQuAiMiDgIHLgMjIg4CFRQeAhcxFx4DMzI+Aj8BPgM1DwEiFCIGMTAmIjQjJy4DNTQ+AjMyHgIfATc+AzMyHgIVFA4CBwIAFyg2HhAfGxkKChkbHxAeNigXBwwSC6AGDAwMBgYMDAwGoAsSDAdbogEBAQEBAaIGCgcEDRceEQkREA4GLy8GDhARCREeFw0EBwoGAS0eNigXBwwSCwsSDAcXKDYeEB8bGQqgBgsJBgUJCwagChkbHxA+ogEBAQGiBg4QEQkRHhcNBAcKBjQ0BgoHBA0XHhEJERAOBgABAAAAAAIAAcAAMQAAARQOAgcxBw4DIyIuAi8BLgM1ND4CMzIeAhcHFwc3Jzc+AzMyHgIVAgAHDBILoAYMDAwGBgwMDAagCxIMBxcoNh4KFRMSCC9wQLBwJwUJCgkFHjYoFwEtEB8bGQqgBgsJBgUJCwagChkbHxAeNigXAwUIBUtAoMBAOwECAQEXKDYeAAABAAAAAAIAAbcAKgAAEzQ3NjMyFxYXFhcWFzY3Njc2NzYzMhcWFRQPAQYjIi8BJicmJyYnJicmNQAkJUARExIQEAsMCgoMCxAQEhMRQCUkQbIGBwcGsgMFBQsKCQkGBwExPyMkBgYLCgkKCgoKCQoLBgYkIz8/QawFBawCBgUNDg4OFRQTAAAAAQAAAA0B2wHSACYAABM0PwI2FzYfAhYVFA8BFxQVFAcGByYvAQcGByYnJjU0PwEnJjUAEI9BBQkIBkCPEAdoGQMDBgUGgIEGBQYDAwEYaAcBIwsCFoEMAQEMgRYCCwYIZJABBQUFAwEBAkVFAgEBAwUFAwOQZAkFAAAAAAIAAAANAdsB0gAkAC4AABM0PwI2FzYfAhYVFA8BFxQVFAcmLwEHBgcmJyY1ND8BJyY1HwEHNxcnNy8BBwAQj0EFCQgGQI8QB2gZDAUGgIEGBQYDAwEYaAc/WBVsaxRXeDY2ASMLAhaBDAEBDIEWAgsGCGSQAQUNAQECRUUCAQEDBQUDA5BkCQURVXg4OHhVEW5uAAABACMAKQHdAXwAGgAANzQ/ATYXNh8BNzYXNh8BFhUUDwEGByYvASY1IwgmCAwLCFS8CAsMCCYICPUIDAsIjgjSCwkmCQEBCVS7CQEBCSYJCg0H9gcBAQePBwwAAAEAHwAfAXMBcwAsAAA3ND8BJyY1ND8BNjMyHwE3NjMyHwEWFRQPARcWFRQPAQYjIi8BBwYjIi8BJjUfCFRUCAgnCAwLCFRUCAwLCCcICFRUCAgnCAsMCFRUCAsMCCcIYgsIVFQIDAsIJwgIVFQICCcICwwIVFQICwwIJwgIVFQICCcIDAAAAAACAAAAJQFJAbcAHwArAAA3NTQ3NjsBNTQ3NjMyFxYdATMyFxYdARQHBiMhIicmNTczNTQnJiMiBwYdAQAICAsKJSY1NCYmCQsICAgIC/7tCwgIW5MWFR4fFRZApQsICDc0JiYmJjQ3CAgLpQsICAgIC8A3HhYVFRYeNwAAAQAAAAcBbgG3ACEAADcRNDc2NzYzITIXFhcWFREUBwYHBiMiLwEHBiMiJyYnJjUABgUKBgYBLAYGCgUGBgUKBQcOCn5+Cg4GBgoFBicBcAoICAMDAwMICAr+kAoICAQCCXl5CQIECAgKAAAAAwAAACUCAAFuABgAMQBKAAA3NDc2NzYzMhcWFxYVFAcGBwYjIicmJyY1MxYXFjMyNzY3JicWFRQHBiMiJyY1NDcGBzcUFxYzMjc2NTQ3NjMyNzY1NCcmIyIHBhUABihDREtLREMoBgYoQ0RLS0RDKAYlJjk5Q0M5OSYrQREmJTU1JSYRQSuEBAQGBgQEEREZBgQEBAQGJBkayQoKQSgoKChBCgoKCkEoJycoQQoKOiMjIyM6RCEeIjUmJSUmNSIeIUQlBgQEBAQGGBIRBAQGBgQEGhojAAAABQAAAAkCAAGJACwAOABRAGgAcAAANzQ3Njc2MzIXNzYzMhcWFxYXFhcWFxYVFDEGBwYPAQYjIicmNTQ3JicmJyY1MxYXNyYnJjU0NwYHNxQXFjMyNzY1NDc2MzI3NjU0JyYjIgcGFRc3Njc2NyYnNxYXFhcWFRQHBgcGBwYjPwEWFRQHBgcABitBQU0ZGhADBQEEBAUFBAUEBQEEHjw8Hg4DBQQiBQ0pIyIZBiUvSxYZDg4RQSuEBAQGBgQEEREZBgQEBAQGJBkaVxU9MzQiIDASGxkZEAYGCxQrODk/LlACFxYlyQsJQycnBRwEAgEDAwIDAwIBAwUCNmxsNhkFFAMFBBUTHh8nCQtKISgSHBsfIh4hRCUGBAQEBAYYEhEEBAYGBAQaGiPJJQUiIjYzISASGhkbCgoKChIXMRsbUZANCyghIA8AAAMAAAAAAbcB2wA5AEoAlAAANzU0NzY7ATY3Njc2NzY3Njc2MzIXFhcWFRQHMzIXFhUUBxYVFAcUFRQHFgcGKwEiJyYnJisBIicmNTcUFxYzMjc2NTQnJiMiBwYVFzMyFxYXFhcWFxYXFhcWOwEyNTQnNjc2NTQnNjU0JyYnNjc2NTQnJisBNDc2NTQnJiMGBwYHBgcGBwYHBgcGBwYHBgcGBwYrARUACwoQTgodEQ4GBAMFBgwLDxgTEwoKDjMdFhYOAgoRARkZKCUbGxsjIQZSEAoLJQUFCAcGBQUGBwgFBUkJBAUFBAQHBwMDBwcCPCUjNwIJBQUFDwMDBAkGBgsLDmUODgoJGwgDAwYFDAYQAQUGAwQGBgYFBgUGBgQJSbcPCwsGJhUPCBERExMMCgkJFBQhGxwWFR4ZFQoKFhMGBh0WKBcXBgcMDAoLDxIHBQYGBQcIBQYGBQgSAQEBAQICAQEDAgEULwgIBQoLCgsJDhQHCQkEAQ0NCg8LCxAdHREcDQ4IEBETEw0GFAEHBwUECAgFBQUFAgO3AAADAAD/2wG3AbcAPABNAJkAADc1NDc2OwEyNzY3NjsBMhcWBxUWFRQVFhUUBxYVFAcGKwEWFRQHBgcGIyInJicmJyYnJicmJyYnIyInJjU3FBcWMzI3NjU0JyYjIgcGFRczMhcWFxYXFhcWFxYXFhcWFxYXFhcWFzI3NjU0JyY1MzI3NjU0JyYjNjc2NTQnNjU0JyYnNjU0JyYrASIHIgcGBwYHBgcGIwYrARUACwoQUgYhJRsbHiAoGRkBEQoCDhYWHTMOCgoTExgPCwoFBgIBBAMFDhEdCk4QCgslBQUIBwYFBQYHCAUFSQkEBgYFBgUGBgYEAwYFARAGDAUGAwMIGwkKDg5lDgsLBgYJBAMDDwUFBQkCDg4ZJSU8AgcHAwMHBwQEBQUECbe3DwsKDAwHBhcWJwIWHQYGExYKChUZHhYVHRoiExQJCgsJDg4MDAwNBg4WJQcLCw+kBwUGBgUHCAUGBgUIpAMCBQYFBQcIBAUHBwITBwwTExERBw0OHBEdHRALCw8KDQ0FCQkHFA4JCwoLCgUICBgMCxUDAgEBAgMBAQG3AAAAAQAAAA0A7gHSABQAABM0PwI2FxEHBgcmJyY1ND8BJyY1ABCPQQUJgQYFBgMDARhoBwEjCwIWgQwB/oNFAgEBAwUFAwOQZAkFAAAAAAIAAAAAAgABtwAqAFkAABM0NzYzMhcWFxYXFhc2NzY3Njc2MzIXFhUUDwEGIyIvASYnJicmJyYnJjUzFB8BNzY1NCcmJyYnJicmIyIHBgcGBwYHBiMiJyYnJicmJyYjIgcGBwYHBgcGFQAkJUARExIQEAsMCgoMCxAQEhMRQCUkQbIGBwcGsgMFBQsKCQkGByU1pqY1BgYJCg4NDg0PDhIRDg8KCgcFCQkFBwoKDw4REg4PDQ4NDgoJBgYBMT8jJAYGCwoJCgoKCgkKCwYGJCM/P0GsBQWsAgYFDQ4ODhUUEzA1oJ82MBcSEgoLBgcCAgcHCwsKCQgHBwgJCgsLBwcCAgcGCwoSEhcAAAACAAAABwFuAbcAIQAoAAA3ETQ3Njc2MyEyFxYXFhURFAcGBwYjIi8BBwYjIicmJyY1PwEfAREhEQAGBQoGBgEsBgYKBQYGBQoFBw4Kfn4KDgYGCgUGJZIZef7cJwFwCggIAwMDAwgICv6QCggIBAIJeXkJAgQICAoIjRl0AWP+nQAAAAABAAAAJQHbAbcAMgAANzU0NzY7ATU0NzYzMhcWHQEUBwYrASInJj0BNCcmIyIHBh0BMzIXFh0BFAcGIyEiJyY1AAgIC8AmJjQ1JiUFBQgSCAUFFhUfHhUWHAsICAgIC/7tCwgIQKULCAg3NSUmJiU1SQgFBgYFCEkeFhUVFh43CAgLpQsICAgICwAAAAIAAQANAdsB0gAiAC0AABM2PwI2MzIfAhYXFg8BFxYHBiMiLwEHBiMiJyY/AScmNx8CLwE/AS8CEwEDDJBABggJBUGODgIDCmcYAgQCCAMIf4IFBgYEAgEZaQgC7hBbEgINSnkILgEBJggCFYILC4IVAggICWWPCgUFA0REAwUFCo9lCQipCTBmEw1HEhFc/u0AAAADAAAAAAHJAbcAFAAlAHkAADc1NDc2OwEyFxYdARQHBisBIicmNTcUFxYzMjc2NTQnJiMiBwYVFzU0NzYzNjc2NzY3Njc2NzY3Njc2NzY3NjMyFxYXFhcWFxYXFhUUFRQHBgcGBxQHBgcGBzMyFxYVFAcWFRYHFgcGBxYHBgcjIicmJyYnJiciJyY1AAUGB1MHBQYGBQdTBwYFJQUFCAcGBQUGBwgFBWQFBQgGDw8OFAkFBAQBAQMCAQIEBAYFBw4KCgcHBQQCAwEBAgMDAgYCAgIBAU8XEBAQBQEOBQUECwMREiYlExYXDAwWJAoHBQY3twcGBQUGB7cIBQUFBQgkBwYFBQYHCAUGBgUIJLcHBQYBEBATGQkFCQgGBQwLBgcICQUGAwMFBAcHBgYICQQEBwsLCwYGCgIDBAMCBBEQFhkSDAoVEhAREAsgFBUBBAUEBAcMAQUFCAAAAAADAAD/2wHJAZIAFAAlAHkAADcUFxYXNxY3Nj0BNCcmBycGBwYdATc0NzY3FhcWFRQHBicGJyY1FzU0NzY3Fjc2NzY3NjcXNhcWBxYXFgcWBxQHFhUUBwYHJxYXFhcWFRYXFhcWFRQVFAcGBwYHBgcGBwYnBicmJyYnJicmJyYnJicmJyYnJiciJyY1AAUGB1MHBQYGBQdTBwYFJQUFCAcGBQUGBwgFBWQGBQcKJBYMDBcWEyUmEhEDCwQFBQ4BBRAQEBdPAQECAgIGAgMDAgEBAwIEBQcHCgoOBwUGBAQCAQIDAQEEBAUJFA4PDwYIBQWlBwYFAQEBBwQJtQkEBwEBAQUGB7eTBwYEAQEEBgcJBAYBAQYECZS4BwYEAgENBwUCBgMBAQEXEyEJEhAREBcIDhAaFhEPAQEFAgQCBQELBQcKDAkIBAUHCgUGBwgDBgIEAQEHBQkIBwUMCwcECgcGCRoREQ8CBgQIAAAAAQAAAAEAAJth57dfDzz1AAsCAAAAAADP/GODAAAAAM/8Y4MAAP/bAgAB2wAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAACAAABAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAEAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAdwAAAHcAAACAAAjAZMAHwFJAAABbgAAAgAAAAIAAAACAAAAAgAAAAEAAAACAAAAAW4AAAHcAAAB3AABAdwAAAHcAAAAAAAAAAoAFAAeAEoAcACKAMoBQAGIAcwCCgJUAoICxgMEAzoDpgRKBRgF7AYSBpgG2gcgB2oIGAjOAAAAAQAAABwAmgAFAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAwAAAABAAAAAAACAA4AQAABAAAAAAADAAwAIgABAAAAAAAEAAwATgABAAAAAAAFABYADAABAAAAAAAGAAYALgABAAAAAAAKADQAWgADAAEECQABAAwAAAADAAEECQACAA4AQAADAAEECQADAAwAIgADAAEECQAEAAwATgADAAEECQAFABYADAADAAEECQAGAAwANAADAAEECQAKADQAWgByAGEAdABpAG4AZwBWAGUAcgBzAGkAbwBuACAAMQAuADAAcgBhAHQAaQBuAGdyYXRpbmcAcgBhAHQAaQBuAGcAUgBlAGcAdQBsAGEAcgByAGEAdABpAG4AZwBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AABcUAAoAAAAAFswAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAEuEAABLho6TvIE9TLzIAABPYAAAAYAAAAGAIIwgbY21hcAAAFDgAAACkAAAApKPAMbxnYXNwAAAU3AAAAAgAAAAIAAAAEGhlYWQAABTkAAAANgAAADYBGAe5aGhlYQAAFRwAAAAkAAAAJAPiAf1obXR4AAAVQAAAAHAAAABwLOAAQ21heHAAABWwAAAABgAAAAYAHFAAbmFtZQAAFbgAAAE8AAABPPC1n05wb3N0AAAW9AAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLZviU+HQFHQAAAP0PHQAAAQIRHQAAAAkdAAAS2BIAHQEBBw0PERQZHiMoLTI3PEFGS1BVWl9kaW5zeH2Ch4xyYXRpbmdyYXRpbmd1MHUxdTIwdUU2MDB1RTYwMXVFNjAydUU2MDN1RTYwNHVFNjA1dUYwMDR1RjAwNXVGMDA2dUYwMEN1RjAwRHVGMDIzdUYwMkV1RjA2RXVGMDcwdUYwODd1RjA4OHVGMDg5dUYwOEF1RjA5N3VGMDlDdUYxMjN1RjE2NHVGMTY1AAACAYkAGgAcAgABAAQABwAKAA0AVgCWAL0BAgGMAeQCbwLwA4cD5QR0BQMFdgZgB8MJkQtxC7oM2Q1jDggOmRAYEZr8lA78lA78lA77lA74lPetFftFpTz3NDz7NPtFcfcU+xBt+0T3Mt73Mjht90T3FPcQBfuU+0YV+wRRofcQMOP3EZ3D9wXD+wX3EXkwM6H7EPsExQUO+JT3rRX7RaU89zQ8+zT7RXH3FPsQbftE9zLe9zI4bfdE9xT3EAX7lPtGFYuLi/exw/sF9xF5MDOh+xD7BMUFDviU960V+0WlPPc0PPs0+0Vx9xT7EG37RPcy3vcyOG33RPcU9xAFDviU98EVi2B4ZG5wCIuL+zT7NAV7e3t7e4t7i3ube5sI+zT3NAVupniyi7aL3M3N3Iu2i7J4pm6mqLKetovci81JizoIDviU98EVi9xJzTqLYItkeHBucKhknmCLOotJSYs6i2CeZKhwCIuL9zT7NAWbe5t7m4ubi5ubm5sI9zT3NAWopp6yi7YIME0V+zb7NgWKioqKiouKi4qMiowI+zb3NgV6m4Ghi6OLubCwuYuji6GBm3oIule6vwWbnKGVo4u5i7Bmi12Lc4F1ensIDviU98EVi2B4ZG5wCIuL+zT7NAV7e3t7e4t7i3ube5sI+zT3NAVupniyi7aL3M3N3Iuni6WDoX4IXED3BEtL+zT3RPdU+wTLssYFl46YjZiL3IvNSYs6CA6L98UVi7WXrKOio6Otl7aLlouXiZiHl4eWhZaEloSUhZKFk4SShZKEkpKSkZOSkpGUkZaSCJaSlpGXj5iPl42Wi7aLrX+jc6N0l2qLYYthdWBgYAj7RvtABYeIh4mGi4aLh42Hjgj7RvdABYmNiY2Hj4iOhpGDlISUhZWFlIWVhpaHmYaYiZiLmAgOZ4v3txWLkpCPlo0I9yOgzPcWBY6SkI+Ri5CLkIePhAjL+xb3I3YFlomQh4uEi4aJh4aGCCMmpPsjBYuKi4mLiIuHioiJiImIiIqHi4iLh4yHjQj7FM/7FUcFh4mHioiLh4uIjImOiY6KjouPi4yLjYyOCKP3IyPwBYaQiZCLjwgOZ4v3txWLkpCPlo0I9yOgzPcWBY6SkI+Ri5CLkIePhAjL+xb3I3YFlomQh4uEi4aJh4aGCCMmpPsjBYuKi4mLiIuCh4aDi4iLh4yHjQj7FM/7FUcFh4mHioiLh4uIjImOiY6KjouPi4yLjYyOCKP3IyPwBYaQiZCLjwjKeRXjN3b7DfcAxPZSd/cN4t/7DJ1V9wFV+wEFDq73ZhWLk42RkZEIsbIFkZCRjpOLkouSiJCGCN8291D3UAWQkJKOkouTi5GIkYYIsWQFkYaNhIuEi4OJhYWFCPuJ+4kFhYWFiYOLhIuEjYaRCPsi9yIFhZCJkouSCA77AartFYuSjpKQkAjf3zffBYaQiJKLk4uSjpKQkAiysgWRkJGOk4uSi5KIkIYI3zff3wWQkJKOk4uSi5KIkIYIsmQFkIaOhIuEi4OIhIaGCDc33zcFkIaOhIuEi4OIhYaFCGRkBYaGhIiEi4OLhI6GkAg33zc3BYaGhIiEi4OLhY6FkAhksgWGkYiRi5MIDvtLi8sVi/c5BYuSjpKQkJCQko6SiwiVi4vCBYuul6mkpKSkqpiui66LqX6kcqRymG2LaAiLVJSLBZKLkoiQhpCGjoSLhAiL+zkFi4OIhYaGhoWEiYSLCPuniwWEi4SNhpGGkIiRi5MI5vdUFfcni4vCBYufhJx8mn2ZepJ3i3aLeoR9fX18g3qLdwiLVAUO+yaLshWL+AQFi5GNkY+RjpCQj5KNj42PjI+LCPfAiwWPi4+Kj4mRiZCHj4aPhY2Fi4UIi/wEBYuEiYWHhoeGhoeFiIiKhoqHi4GLhI6EkQj7EvcN+xL7DQWEhYOIgouHi4eLh42EjoaPiJCHkImRi5IIDov3XRWLko2Rj5Kltq+vuKW4pbuZvYu9i7t9uHG4ca9npWCPhI2Fi4SLhYmEh4RxYGdoXnAIXnFbflmLWYtbmF6lXqZnrnG2h5KJkouRCLCLFaRkq2yxdLF0tH+4i7iLtJexorGiq6qksm64Z61goZZ3kXaLdItnfm1ycnJybX9oiwhoi22XcqRypH6pi6+LopGglp9gdWdpbl4I9xiwFYuHjIiOiI6IjoqPi4+LjoyOjo2OjY6Lj4ubkJmXl5eWmZGbi4+LjoyOjo2OjY6LjwiLj4mOiY6IjYiNh4tzi3eCenp6eoJ3i3MIDov3XRWLko2Sj5GouK+utqW3pbqYvouci5yJnIgIm6cFjY6NjI+LjIuNi42JjYqOio+JjomOiY6KjomOiY6JjoqNioyKjomMiYuHi4qLiouLCHdnbVVjQ2NDbVV3Zwh9cgWJiIiJiIuJi36SdJiIjYmOi46LjY+UlJlvl3KcdJ90oHeie6WHkYmSi5IIsIsVqlq0Z711CKGzBXqXfpqCnoKdhp6LoIuikaCWn2B1Z2luXgj3GLAVi4eMiI6IjoiOio+Lj4uOjI6OjY6NjouPi5uQmZeXl5aZkZuLj4uOjI6OjY6NjouPCIuPiY6JjoiNiI2Hi3OLd4J6enp6gneLcwji+10VoLAFtI+wmK2hrqKnqKKvdq1wp2uhCJ2rBZ1/nHycepx6mHqWeY+EjYWLhIuEiYWHhIR/gH1+fG9qaXJmeWV5Y4Jhiwi53BXb9yQFjIKMg4uEi3CDc3x1fHV3fHOBCA6L1BWL90sFi5WPlJKSkpKTj5aLCNmLBZKPmJqepJaZlZeVlY+Qj5ONl42WjpeOmI+YkZWTk5OSk46Vi5uLmYiYhZiFlIGSfgiSfo55i3WLeYd5gXgIvosFn4uchJl8mn2Seot3i3qGfIJ9jYSLhYuEi3yIfoR+i4eLh4uHi3eGen99i3CDdnt8CHt8dYNwiwhmiwV5i3mNeY95kHeRc5N1k36Ph4sIOYsFgIuDjoSShJKHlIuVCLCdFYuGjIePiI+Hj4mQi5CLj42Pj46OjY+LkIuQiZCIjoePh42Gi4aLh4mHh4eIioaLhgjUeRWUiwWNi46Lj4qOi4+KjYqOi4+Kj4mQio6KjYqNio+Kj4mQio6KjIqzfquEpIsIrosFr4uemouri5CKkYqQkY6QkI6SjpKNkouSi5KJkoiRlZWQlouYi5CKkImRiZGJj4iOCJGMkI+PlI+UjZKLkouViJODk4SSgo+CiwgmiwWLlpCalJ6UnpCbi5aLnoiYhJSFlH+QeYuGhoeDiYCJf4h/h3+IfoWBg4KHh4SCgH4Ii4qIiYiGh4aIh4mIiIiIh4eGh4aHh4eHiIiHiIeHiIiHiIeKh4mIioiLCIKLi/tLBQ6L90sVi/dLBYuVj5OSk5KSk46WiwjdiwWPi5iPoZOkk6CRnZCdj56Nn4sIq4sFpougg5x8m3yTd4txCIuJBZd8kHuLd4uHi4eLh5J+jn6LfIuEi4SJhZR9kHyLeot3hHp8fH19eoR3iwhYiwWVeI95i3mLdIh6hH6EfoKBfoV+hX2He4uBi4OPg5KFkYaTh5SHlYiTipOKk4qTiJMIiZSIkYiPgZSBl4CaeKR+moSPCD2LBYCLg4+EkoSSh5SLlQiw9zgVi4aMh4+Ij4ePiZCLkIuPjY+Pjo6Nj4uQi5CJkIiOh4+HjYaLhouHiYeHh4iKhouGCNT7OBWUiwWOi46Kj4mPio+IjoiPh4+IjoePiI+Hj4aPho6HjoiNiI6Hj4aOho6Ii4qWfpKDj4YIk4ORgY5+j36OgI1/jYCPg5CGnYuXj5GUkpSOmYuei5aGmoKfgp6GmouWCPCLBZSLlI+SkpOTjpOLlYuSiZKHlIeUho+Fi46PjY+NkY2RjJCLkIuYhpaBlY6RjZKLkgiLkomSiJKIkoaQhY6MkIyRi5CLm4aXgpOBkn6Pe4sIZosFcotrhGN9iouIioaJh4qHiomKiYqIioaKh4mHioiKiYuHioiLh4qIi4mLCIKLi/tLBQ77lIv3txWLkpCPlo0I9yOgzPcWBY6SkI+RiwiL/BL7FUcFh4mHioiLh4uIjImOiY6KjouPi4yLjYyOCKP3IyPwBYaQiZCLjwgOi/fFFYu1l6yjoqOjrZe2i5aLl4mYh5eHloWWhJaElIWShZOEkoWShJKSkpGTkpKRlJGWkgiWkpaRl4+Yj5eNlou2i61/o3OjdJdqi2GLYXVgYGAI+0b7QAWHiIeJhouGi4eNh44I+0b3QAWJjYmNh4+IjoaRg5SElIWVhZSFlYaWh5mGmImYi5gIsIsVi2ucaa9oCPc6+zT3OvczBa+vnK2Lq4ubiZiHl4eXhpSFkoSSg5GCj4KQgo2CjYONgYuBi4KLgIl/hoCGgIWChAiBg4OFhISEhYaFhoaIhoaJhYuFi4aNiJCGkIaRhJGEkoORgZOCkoCRgJB/kICNgosIgYuBi4OJgomCiYKGgoeDhYSEhYSGgod/h3+Jfot7CA77JouyFYv4BAWLkY2Rj5GOkJCPko2PjY+Mj4sI98CLBY+Lj4qPiZGJkIePho+FjYWLhQiL/AQFi4SJhYeGh4aGh4WIiIqGioeLgYuEjoSRCPsS9w37EvsNBYSFg4iCi4eLh4uHjYSOho+IkIeQiZGLkgiwkxX3JvchpHL3DfsIi/f3+7iLi/v3BQ5ni8sVi/c5BYuSjpKQkJCQko6Siwj3VIuLwgWLrpippKSkpKmYrouvi6l+pHKkcpdti2gIi0IFi4aKhoeIh4eHiYaLCHmLBYaLh42Hj4eOipCLkAiL1AWLn4OcfZp9mXqSdot3i3qEfX18fIR6i3cIi1SniwWSi5KIkIaQho6Ei4QIi/s5BYuDiIWGhoaFhImEiwj7p4sFhIuEjYaRhpCIkYuTCA5njPe6FYyQkI6UjQj3I6DM9xYFj5KPj5GLkIuQh4+ECMv7FvcjdgWUiZCIjYaNhoiFhYUIIyak+yMFjIWKhomHiYiIiYaLiIuHjIeNCPsUz/sVRwWHiYeKiIuHi4eNiY6Jj4uQjJEIo/cjI/AFhZGJkY2QCPeB+z0VnILlW3rxiJ6ZmNTS+wydgpxe54v7pwUOZ4vCFYv3SwWLkI2Pjo+Pjo+NkIsI3osFkIuPiY6Ij4eNh4uGCIv7SwWLhomHh4eIh4eKhosIOIsFhouHjIePiI+Jj4uQCLCvFYuGjIePh46IkImQi5CLj42Pjo6PjY+LkIuQiZCIjoePh42Gi4aLhomIh4eIioaLhgjvZxWL90sFi5CNj46Oj4+PjZCLj4ySkJWWlZaVl5SXmJuVl5GRjo6OkI6RjZCNkIyPjI6MkY2TCIySjJGMj4yPjZCOkY6RjpCPjo6Pj42Qi5SLk4qSiZKJkYiPiJCIjoiPho6GjYeMhwiNh4yGjIaMhYuHi4iLiIuHi4eLg4uEiYSJhImFiYeJh4mFh4WLioqJiomJiIqJiokIi4qKiIqJCNqLBZqLmIWWgJaAkH+LfIt6hn2Af46DjYSLhIt9h36Cf4+Bi3+HgImAhYKEhI12hnmAfgh/fXiDcosIZosFfot+jHyOfI5/joOOg41/j32Qc5N8j4SMhouHjYiOh4+Jj4uQCA5ni/c5FYuGjYaOiI+Hj4mQiwjeiwWQi4+Njo+Pjo2Qi5AIi/dKBYuQiZCHjoiPh42Giwg4iwWGi4eJh4eIiImGi4YIi/tKBbD3JhWLkIyPj4+OjpCNkIuQi4+Jj4iOh42Hi4aLhomHiIeHh4eKhouGi4aMiI+Hj4qPi5AI7/snFYv3SwWLkI2Qj46Oj4+NkIuSi5qPo5OZkJePk46TjZeOmo6ajpiMmIsIsIsFpIueg5d9ln6Qeol1koSRgo2Aj4CLgIeAlH+Pfot9i4WJhIiCloCQfIt7i3yFfoGACICAfoZ8iwg8iwWMiIyJi4mMiYyJjYmMiIyKi4mPhI2GjYeNh42GjYOMhIyEi4SLhouHi4iLiYuGioYIioWKhomHioeJh4iGh4eIh4aIh4iFiISJhImDioKLhouHjYiPh4+Ij4iRiJGJkIqPCIqPipGKkomTipGKj4qOiZCJkYiQiJCIjoWSgZZ+nIKXgZaBloGWhJGHi4aLh42HjwiIjomQi48IDviUFPiUFYsMCgAAAAADAgABkAAFAAABTAFmAAAARwFMAWYAAAD1ABkAhAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAEAAAPFlAeD/4P/gAeAAIAAAAAEAAAAAAAAAAAAAACAAAAAAAAIAAAADAAAAFAADAAEAAAAUAAQAkAAAACAAIAAEAAAAAQAg5gXwBvAN8CPwLvBu8HDwivCX8JzxI/Fl//3//wAAAAAAIOYA8ATwDPAj8C7wbvBw8Ifwl/Cc8SPxZP/9//8AAf/jGgQQBhABD+wP4g+jD6IPjA+AD3wO9g62AAMAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAAJrVlLJfDzz1AAsCAAAAAADP/GODAAAAAM/8Y4MAAP/bAgAB2wAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAACAAABAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAEAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAdwAAAHcAAACAAAjAZMAHwFJAAABbgAAAgAAAAIAAAACAAAAAgAAAAEAAAACAAAAAW4AAAHcAAAB3AABAdwAAAHcAAAAAFAAABwAAAAAAA4ArgABAAAAAAABAAwAAAABAAAAAAACAA4AQAABAAAAAAADAAwAIgABAAAAAAAEAAwATgABAAAAAAAFABYADAABAAAAAAAGAAYALgABAAAAAAAKADQAWgADAAEECQABAAwAAAADAAEECQACAA4AQAADAAEECQADAAwAIgADAAEECQAEAAwATgADAAEECQAFABYADAADAAEECQAGAAwANAADAAEECQAKADQAWgByAGEAdABpAG4AZwBWAGUAcgBzAGkAbwBuACAAMQAuADAAcgBhAHQAaQBuAGdyYXRpbmcAcgBhAHQAaQBuAGcAUgBlAGcAdQBsAGEAcgByAGEAdABpAG4AZwBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');font-weight:400;font-style:normal}.ui.rating .active.icon:before,.ui.rating .icon:before,.ui.star.rating .active.icon:before,.ui.star.rating .icon:before{content:'\f005'}.ui.star.rating .partial.icon:before{content:'\f006'}.ui.star.rating .partial.icon{content:'\f005'}.ui.heart.rating .active.icon:before,.ui.heart.rating .icon:before{content:'\f004'}.ui.search{position:relative}.ui.search>.prompt{margin:0;outline:0;-webkit-appearance:none;-webkit-tap-highlight-color:rgba(255,255,255,0);text-shadow:none;font-style:normal;font-weight:400;line-height:1.2142em;padding:.67861429em 1em;font-size:1em;background:#FFF;border:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87);box-shadow:0 0 0 0 transparent inset;-webkit-transition:background-color .1s ease,color .1s ease,box-shadow .1s ease,border-color .1s ease;transition:background-color .1s ease,color .1s ease,box-shadow .1s ease,border-color .1s ease}.ui.search .prompt{border-radius:500rem}.ui.search .prompt~.search.icon{cursor:pointer}.ui.search>.results{display:none;position:absolute;top:100%;left:0;-webkit-transform-origin:center top;transform-origin:center top;white-space:normal;background:#FFF;margin-top:.5em;width:18em;border-radius:.28571429rem;box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);border:1px solid #D4D4D5;z-index:998}.ui.search>.results>:first-child{border-radius:.28571429rem .28571429rem 0 0}.ui.search>.results>:last-child{border-radius:0 0 .28571429rem .28571429rem}.ui.search>.results .result{cursor:pointer;display:block;overflow:hidden;font-size:1em;padding:.85714286em 1.14285714em;color:rgba(0,0,0,.87);line-height:1.33;border-bottom:1px solid rgba(34,36,38,.1)}.ui.search>.results .result:last-child{border-bottom:none!important}.ui.search>.results .result .image{float:right;overflow:hidden;background:0 0;width:5em;height:3em;border-radius:.25em}.ui.search>.results .result .image img{display:block;width:auto;height:100%}.ui.search>.results .result .image+.content{margin:0 6em 0 0}.ui.search>.results .result .title{margin:-.14285em 0 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-weight:700;font-size:1em;color:rgba(0,0,0,.85)}.ui.search>.results .result .description{margin-top:0;font-size:.92857143em;color:rgba(0,0,0,.4)}.ui.search>.results .result .price{float:right;color:#21BA45}.ui.search>.results>.message{padding:1em}.ui.search>.results>.message .header{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1rem;font-weight:700;color:rgba(0,0,0,.87)}.ui.search>.results>.message .description{margin-top:.25rem;font-size:1em;color:rgba(0,0,0,.87)}.ui.search>.results>.action{display:block;border-top:none;background:#F3F4F5;padding:.92857143em 1em;color:rgba(0,0,0,.87);font-weight:700;text-align:center}.ui.search>.prompt:focus{border-color:rgba(34,36,38,.35);background:#FFF;color:rgba(0,0,0,.95)}.ui.loading.search .input>i.icon:before{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.loading.search .input>i.icon:after{position:absolute;content:'';top:50%;left:50%;margin:-.64285714em 0 0 -.64285714em;width:1.28571429em;height:1.28571429em;-webkit-animation:button-spin .6s linear;animation:button-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 transparent transparent;border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent}.ui.category.search>.results .category .result:hover,.ui.search>.results .result:hover{background:#F9FAFB}.ui.search .action:hover{background:#E0E0E0}.ui.category.search>.results .category.active{background:#F3F4F5}.ui.category.search>.results .category.active>.name{color:rgba(0,0,0,.87)}.ui.category.search>.results .category .result.active,.ui.search>.results .result.active{position:relative;border-left-color:rgba(34,36,38,.1);background:#F3F4F5;box-shadow:none}.ui.search>.results .result.active .description,.ui.search>.results .result.active .title{color:rgba(0,0,0,.85)}.ui.search.selection .prompt{border-radius:.28571429rem}.ui.search.selection>.icon.input>.remove.icon{pointer-events:none;position:absolute;left:auto;opacity:0;color:'';top:0;right:0;-webkit-transition:color .1s ease,opacity .1s ease;transition:color .1s ease,opacity .1s ease}.ui.search.selection>.icon.input>.active.remove.icon{cursor:pointer;opacity:.8;pointer-events:auto}.ui.search.selection>.icon.input:not([class*="left icon"])>.icon~.remove.icon{right:1.85714em}.ui.search.selection>.icon.input>.remove.icon:hover{opacity:1;color:#DB2828}.ui.category.search .results{width:28em}.ui.category.search>.results .category{background:#F3F4F5;box-shadow:none;border-bottom:1px solid rgba(34,36,38,.1);-webkit-transition:background .1s ease,border-color .1s ease;transition:background .1s ease,border-color .1s ease}.ui.category.search>.results .category:last-child{border-bottom:none}.ui.category.search>.results .category:first-child .name+.result{border-radius:0 .28571429rem 0 0}.ui.category.search>.results .category .result{background:#FFF;margin-left:100px;border-left:1px solid rgba(34,36,38,.15);border-bottom:1px solid rgba(34,36,38,.1);-webkit-transition:background .1s ease,border-color .1s ease;transition:background .1s ease,border-color .1s ease;padding:.85714286em 1.14285714em}.ui.category.search>.results .category:last-child .result:last-child{border-radius:0 0 .28571429rem;border-bottom:none}.ui.category.search>.results .category>.name{width:100px;background:0 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1em;float:1em;float:left;padding:.4em 1em;font-weight:700;color:rgba(0,0,0,.4)}.ui[class*="left aligned"].search>.results{right:auto;left:0}.ui[class*="right aligned"].search>.results{right:0;left:auto}.ui.fluid.search .results{width:100%}.ui.mini.search{font-size:.78571429em}.ui.small.search{font-size:.92857143em}.ui.search{font-size:1em}.ui.large.search{font-size:1.14285714em}.ui.big.search{font-size:1.28571429em}.ui.huge.search{font-size:1.42857143em}.ui.massive.search{font-size:1.71428571em}.ui.shape{position:relative;vertical-align:top;display:inline-block;-webkit-perspective:2000px;perspective:2000px;-webkit-transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out}.ui.shape .sides{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.ui.shape .side{opacity:1;width:100%;margin:0!important;-webkit-backface-visibility:hidden;backface-visibility:hidden;display:none}.ui.shape .side *{-webkit-backface-visibility:visible!important;backface-visibility:visible!important}.ui.cube.shape .side{min-width:15em;height:15em;padding:2em;background-color:#E6E6E6;color:rgba(0,0,0,.87);box-shadow:0 0 2px rgba(0,0,0,.3)}.ui.cube.shape .side>.content{width:100%;height:100%;display:table;text-align:center;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ui.cube.shape .side>.content>div{display:table-cell;vertical-align:middle;font-size:2em}.ui.text.shape.animating .sides{position:static}.ui.text.shape .side{white-space:nowrap}.ui.text.shape .side>*{white-space:normal}.ui.loading.shape{position:absolute;top:-9999px;left:-9999px}.ui.shape .animating.side{position:absolute;top:0;left:0;display:block;z-index:100}.ui.shape .hidden.side{opacity:.6}.ui.shape.animating .sides{position:absolute;-webkit-transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out}.ui.shape.animating .side{-webkit-transition:opacity .6s ease-in-out;transition:opacity .6s ease-in-out}.ui.shape .active.side{display:block}.ui.sidebar{position:fixed;top:0;left:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:none;transition:none;will-change:transform;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;-webkit-overflow-scrolling:touch;height:100%!important;max-height:100%;border-radius:0!important;margin:0!important;overflow-y:auto!important;z-index:102}.ui.sidebar>*{-webkit-backface-visibility:hidden;backface-visibility:hidden}.ui.left.sidebar{right:auto;left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.ui.right.sidebar{right:0!important;left:auto!important;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.ui.bottom.sidebar,.ui.top.sidebar{width:100%!important;height:auto!important}.ui.top.sidebar{top:0!important;bottom:auto!important;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.ui.bottom.sidebar{top:auto!important;bottom:0!important;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.pushable{height:100%;overflow-x:hidden;padding:0!important}body.pushable{background:#545454!important}.pushable:not(body){-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.pushable:not(body)>.fixed,.pushable:not(body)>.pusher:after,.pushable:not(body)>.ui.sidebar{position:absolute}.pushable>.fixed{position:fixed;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease;will-change:transform;z-index:101}body.pushable>.pusher{background:#FFF}.pushable>.pusher{position:relative;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;min-height:100%;-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease;z-index:2;background:inherit}.pushable>.pusher:after{position:fixed;top:0;right:0;content:'';background-color:rgba(0,0,0,.4);overflow:hidden;opacity:0;-webkit-transition:opacity .5s;transition:opacity .5s;will-change:opacity;z-index:1000}.ui.sidebar.menu .item{border-radius:0!important}.pushable>.pusher.dimmed:after{width:100%!important;height:100%!important;opacity:1!important}.ui.animating.sidebar{visibility:visible}.ui.visible.sidebar{visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ui.bottom.visible.sidebar,.ui.left.visible.sidebar,.ui.right.visible.sidebar,.ui.top.visible.sidebar{box-shadow:0 0 20px rgba(34,36,38,.15)}.ui.visible.left.sidebar~.fixed,.ui.visible.left.sidebar~.pusher{-webkit-transform:translate3d(260px,0,0);transform:translate3d(260px,0,0)}.ui.visible.right.sidebar~.fixed,.ui.visible.right.sidebar~.pusher{-webkit-transform:translate3d(-260px,0,0);transform:translate3d(-260px,0,0)}.ui.visible.top.sidebar~.fixed,.ui.visible.top.sidebar~.pusher{-webkit-transform:translate3d(0,36px,0);transform:translate3d(0,36px,0)}.ui.visible.bottom.sidebar~.fixed,.ui.visible.bottom.sidebar~.pusher{-webkit-transform:translate3d(0,-36px,0);transform:translate3d(0,-36px,0)}.ui.visible.left.sidebar~.ui.visible.right.sidebar~.fixed,.ui.visible.left.sidebar~.ui.visible.right.sidebar~.pusher,.ui.visible.right.sidebar~.ui.visible.left.sidebar~.fixed,.ui.visible.right.sidebar~.ui.visible.left.sidebar~.pusher{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}html.ios{overflow-x:hidden;-webkit-overflow-scrolling:touch}html.ios,html.ios body{height:initial!important}.ui.thin.left.sidebar,.ui.thin.right.sidebar{width:150px}.ui[class*="very thin"].left.sidebar,.ui[class*="very thin"].right.sidebar{width:60px}.ui.left.sidebar,.ui.right.sidebar{width:260px}.ui.wide.left.sidebar,.ui.wide.right.sidebar{width:350px}.ui[class*="very wide"].left.sidebar,.ui[class*="very wide"].right.sidebar{width:475px}.ui.visible.thin.left.sidebar~.fixed,.ui.visible.thin.left.sidebar~.pusher{-webkit-transform:translate3d(150px,0,0);transform:translate3d(150px,0,0)}.ui.visible[class*="very thin"].left.sidebar~.fixed,.ui.visible[class*="very thin"].left.sidebar~.pusher{-webkit-transform:translate3d(60px,0,0);transform:translate3d(60px,0,0)}.ui.visible.wide.left.sidebar~.fixed,.ui.visible.wide.left.sidebar~.pusher{-webkit-transform:translate3d(350px,0,0);transform:translate3d(350px,0,0)}.ui.visible[class*="very wide"].left.sidebar~.fixed,.ui.visible[class*="very wide"].left.sidebar~.pusher{-webkit-transform:translate3d(475px,0,0);transform:translate3d(475px,0,0)}.ui.visible.thin.right.sidebar~.fixed,.ui.visible.thin.right.sidebar~.pusher{-webkit-transform:translate3d(-150px,0,0);transform:translate3d(-150px,0,0)}.ui.visible[class*="very thin"].right.sidebar~.fixed,.ui.visible[class*="very thin"].right.sidebar~.pusher{-webkit-transform:translate3d(-60px,0,0);transform:translate3d(-60px,0,0)}.ui.visible.wide.right.sidebar~.fixed,.ui.visible.wide.right.sidebar~.pusher{-webkit-transform:translate3d(-350px,0,0);transform:translate3d(-350px,0,0)}.ui.visible[class*="very wide"].right.sidebar~.fixed,.ui.visible[class*="very wide"].right.sidebar~.pusher{-webkit-transform:translate3d(-475px,0,0);transform:translate3d(-475px,0,0)}.ui.overlay.sidebar{z-index:102}.ui.left.overlay.sidebar{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.ui.right.overlay.sidebar{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.ui.top.overlay.sidebar{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.ui.bottom.overlay.sidebar{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.animating.ui.overlay.sidebar,.ui.visible.overlay.sidebar{-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease}.ui.visible.bottom.overlay.sidebar,.ui.visible.left.overlay.sidebar,.ui.visible.right.overlay.sidebar,.ui.visible.top.overlay.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ui.visible.overlay.sidebar~.fixed,.ui.visible.overlay.sidebar~.pusher{-webkit-transform:none!important;transform:none!important}.ui.push.sidebar{-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease;z-index:102}.ui.left.push.sidebar{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.ui.right.push.sidebar{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.ui.top.push.sidebar{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.ui.bottom.push.sidebar{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.ui.visible.push.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ui.uncover.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);z-index:1}.ui.visible.uncover.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease}.ui.slide.along.sidebar{z-index:1}.ui.left.slide.along.sidebar{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.ui.right.slide.along.sidebar{-webkit-transform:translate3d(50%,0,0);transform:translate3d(50%,0,0)}.ui.top.slide.along.sidebar{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.ui.bottom.slide.along.sidebar{-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}.ui.animating.slide.along.sidebar{-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease}.ui.visible.slide.along.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ui.slide.out.sidebar{z-index:1}.ui.left.slide.out.sidebar{-webkit-transform:translate3d(50%,0,0);transform:translate3d(50%,0,0)}.ui.right.slide.out.sidebar{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.ui.top.slide.out.sidebar{-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}.ui.bottom.slide.out.sidebar{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.ui.animating.slide.out.sidebar{-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease}.ui.visible.slide.out.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ui.scale.down.sidebar{-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease;z-index:102}.ui.left.scale.down.sidebar{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.ui.right.scale.down.sidebar{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.ui.top.scale.down.sidebar{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.ui.bottom.scale.down.sidebar{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.ui.scale.down.left.sidebar~.pusher{-webkit-transform-origin:75% 50%;transform-origin:75% 50%}.ui.scale.down.right.sidebar~.pusher{-webkit-transform-origin:25% 50%;transform-origin:25% 50%}.ui.scale.down.top.sidebar~.pusher{-webkit-transform-origin:50% 75%;transform-origin:50% 75%}.ui.scale.down.bottom.sidebar~.pusher{-webkit-transform-origin:50% 25%;transform-origin:50% 25%}.ui.animating.scale.down>.visible.ui.sidebar{-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease}.ui.animating.scale.down.sidebar~.pusher,.ui.visible.scale.down.sidebar~.pusher{display:block!important;width:100%;height:100%;overflow:hidden!important}.ui.visible.scale.down.sidebar{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ui.visible.scale.down.sidebar~.pusher{-webkit-transform:scale(.75);transform:scale(.75)}.ui.sticky{position:static;-webkit-transition:none;transition:none;z-index:800}.ui.sticky.bound{position:absolute;left:auto;right:auto}.ui.sticky.fixed{position:fixed;left:auto;right:auto}.ui.sticky.bound.top,.ui.sticky.fixed.top{top:0;bottom:auto}.ui.sticky.bound.bottom,.ui.sticky.fixed.bottom{top:auto;bottom:0}.ui.native.sticky{position:-webkit-sticky;position:-moz-sticky;position:-ms-sticky;position:-o-sticky;position:sticky}.ui.tab{display:none}.ui.tab.active,.ui.tab.open{display:block}.ui.tab.loading{position:relative;overflow:hidden;display:block;min-height:250px}.ui.tab.loading *{position:relative!important;left:-10000px!important}.ui.tab.loading.segment:before,.ui.tab.loading:before{position:absolute;content:'';top:100px;left:50%;margin:-1.25em 0 0 -1.25em;width:2.5em;height:2.5em;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.tab.loading.segment:after,.ui.tab.loading:after{position:absolute;content:'';top:100px;left:50%;margin:-1.25em 0 0 -1.25em;width:2.5em;height:2.5em;-webkit-animation:button-spin .6s linear;animation:button-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 transparent transparent;border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent}.transition{-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:ease;animation-timing-function:ease;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animating.transition{-webkit-backface-visibility:hidden;backface-visibility:hidden;visibility:visible!important}.loading.transition{position:absolute;top:-99999px;left:-99999px}.hidden.transition{display:none;visibility:hidden}.visible.transition{display:block!important;visibility:visible!important}.disabled.transition{-webkit-animation-play-state:paused;animation-play-state:paused}.looping.transition{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.transition.browse{-webkit-animation-duration:.5s;animation-duration:.5s}.transition.browse.in{-webkit-animation-name:browseIn;animation-name:browseIn}.transition.browse.left.out,.transition.browse.out{-webkit-animation-name:browseOutLeft;animation-name:browseOutLeft}.transition.browse.right.out{-webkit-animation-name:browseOutRight;animation-name:browseOutRight}@-webkit-keyframes browseIn{0%{-webkit-transform:scale(.8) translateZ(0);transform:scale(.8) translateZ(0);z-index:-1}10%{-webkit-transform:scale(.8) translateZ(0);transform:scale(.8) translateZ(0);z-index:-1;opacity:.7}80%{-webkit-transform:scale(1.05) translateZ(0);transform:scale(1.05) translateZ(0);opacity:1;z-index:999}100%{-webkit-transform:scale(1) translateZ(0);transform:scale(1) translateZ(0);z-index:999}}@keyframes browseIn{0%{-webkit-transform:scale(.8) translateZ(0);transform:scale(.8) translateZ(0);z-index:-1}10%{-webkit-transform:scale(.8) translateZ(0);transform:scale(.8) translateZ(0);z-index:-1;opacity:.7}80%{-webkit-transform:scale(1.05) translateZ(0);transform:scale(1.05) translateZ(0);opacity:1;z-index:999}100%{-webkit-transform:scale(1) translateZ(0);transform:scale(1) translateZ(0);z-index:999}}@-webkit-keyframes browseOutLeft{0%{z-index:999;-webkit-transform:translateX(0) rotateY(0) rotateX(0);transform:translateX(0) rotateY(0) rotateX(0)}50%{z-index:-1;-webkit-transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:-1;-webkit-transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);opacity:0}}@keyframes browseOutLeft{0%{z-index:999;-webkit-transform:translateX(0) rotateY(0) rotateX(0);transform:translateX(0) rotateY(0) rotateX(0)}50%{z-index:-1;-webkit-transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(-105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:-1;-webkit-transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);opacity:0}}@-webkit-keyframes browseOutRight{0%{z-index:999;-webkit-transform:translateX(0) rotateY(0) rotateX(0);transform:translateX(0) rotateY(0) rotateX(0)}50%{z-index:1;-webkit-transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:1;-webkit-transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);opacity:0}}@keyframes browseOutRight{0%{z-index:999;-webkit-transform:translateX(0) rotateY(0) rotateX(0);transform:translateX(0) rotateY(0) rotateX(0)}50%{z-index:1;-webkit-transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px);transform:translateX(105%) rotateY(35deg) rotateX(10deg) translateZ(-10px)}80%{opacity:1}100%{z-index:1;-webkit-transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);transform:translateX(0) rotateY(0) rotateX(0) translateZ(-10px);opacity:0}}.drop.transition{-webkit-transform-origin:top center;transform-origin:top center;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-timing-function:cubic-bezier(.34,1.61,.7,1);animation-timing-function:cubic-bezier(.34,1.61,.7,1)}.drop.transition.in{-webkit-animation-name:dropIn;animation-name:dropIn}.drop.transition.out{-webkit-animation-name:dropOut;animation-name:dropOut}@-webkit-keyframes dropIn{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes dropIn{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes dropOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes dropOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}.transition.fade.in{-webkit-animation-name:fadeIn;animation-name:fadeIn}.transition[class*="fade up"].in{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}.transition[class*="fade down"].in{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}.transition[class*="fade left"].in{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}.transition[class*="fade right"].in{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}.transition.fade.out{-webkit-animation-name:fadeOut;animation-name:fadeOut}.transition[class*="fade up"].out{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}.transition[class*="fade down"].out{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}.transition[class*="fade left"].out{-webkit-animation-name:fadeOutLeft;animation-name:fadeOutLeft}.transition[class*="fade right"].out{-webkit-animation-name:fadeOutRight;animation-name:fadeOutRight}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(10%);transform:translateX(10%)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(10%);transform:translateX(10%)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(-10%);transform:translateX(-10%)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(-10%);transform:translateX(-10%)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(5%);transform:translateY(5%)}}@keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(5%);transform:translateY(5%)}}@-webkit-keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-5%);transform:translateY(-5%)}}@keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-5%);transform:translateY(-5%)}}@-webkit-keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(5%);transform:translateX(5%)}}@keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(5%);transform:translateX(5%)}}@-webkit-keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-5%);transform:translateX(-5%)}}@keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-5%);transform:translateX(-5%)}}.flip.transition.in,.flip.transition.out{-webkit-animation-duration:.6s;animation-duration:.6s}.horizontal.flip.transition.in{-webkit-animation-name:horizontalFlipIn;animation-name:horizontalFlipIn}.horizontal.flip.transition.out{-webkit-animation-name:horizontalFlipOut;animation-name:horizontalFlipOut}.vertical.flip.transition.in{-webkit-animation-name:verticalFlipIn;animation-name:verticalFlipIn}.vertical.flip.transition.out{-webkit-animation-name:verticalFlipOut;animation-name:verticalFlipOut}@-webkit-keyframes horizontalFlipIn{0%{-webkit-transform:perspective(2000px) rotateY(-90deg);transform:perspective(2000px) rotateY(-90deg);opacity:0}100%{-webkit-transform:perspective(2000px) rotateY(0);transform:perspective(2000px) rotateY(0);opacity:1}}@keyframes horizontalFlipIn{0%{-webkit-transform:perspective(2000px) rotateY(-90deg);transform:perspective(2000px) rotateY(-90deg);opacity:0}100%{-webkit-transform:perspective(2000px) rotateY(0);transform:perspective(2000px) rotateY(0);opacity:1}}@-webkit-keyframes verticalFlipIn{0%{-webkit-transform:perspective(2000px) rotateX(-90deg);transform:perspective(2000px) rotateX(-90deg);opacity:0}100%{-webkit-transform:perspective(2000px) rotateX(0);transform:perspective(2000px) rotateX(0);opacity:1}}@keyframes verticalFlipIn{0%{-webkit-transform:perspective(2000px) rotateX(-90deg);transform:perspective(2000px) rotateX(-90deg);opacity:0}100%{-webkit-transform:perspective(2000px) rotateX(0);transform:perspective(2000px) rotateX(0);opacity:1}}@-webkit-keyframes horizontalFlipOut{0%{-webkit-transform:perspective(2000px) rotateY(0);transform:perspective(2000px) rotateY(0);opacity:1}100%{-webkit-transform:perspective(2000px) rotateY(90deg);transform:perspective(2000px) rotateY(90deg);opacity:0}}@keyframes horizontalFlipOut{0%{-webkit-transform:perspective(2000px) rotateY(0);transform:perspective(2000px) rotateY(0);opacity:1}100%{-webkit-transform:perspective(2000px) rotateY(90deg);transform:perspective(2000px) rotateY(90deg);opacity:0}}@-webkit-keyframes verticalFlipOut{0%{-webkit-transform:perspective(2000px) rotateX(0);transform:perspective(2000px) rotateX(0);opacity:1}100%{-webkit-transform:perspective(2000px) rotateX(-90deg);transform:perspective(2000px) rotateX(-90deg);opacity:0}}@keyframes verticalFlipOut{0%{-webkit-transform:perspective(2000px) rotateX(0);transform:perspective(2000px) rotateX(0);opacity:1}100%{-webkit-transform:perspective(2000px) rotateX(-90deg);transform:perspective(2000px) rotateX(-90deg);opacity:0}}.scale.transition.in{-webkit-animation-name:scaleIn;animation-name:scaleIn}.scale.transition.out{-webkit-animation-name:scaleOut;animation-name:scaleOut}@-webkit-keyframes scaleIn{0%{opacity:0;-webkit-transform:scale(.8);transform:scale(.8)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleIn{0%{opacity:0;-webkit-transform:scale(.8);transform:scale(.8)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes scaleOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}@keyframes scaleOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}.transition.fly{-webkit-animation-duration:.6s;animation-duration:.6s;-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}.transition.fly.in{-webkit-animation-name:flyIn;animation-name:flyIn}.transition[class*="fly up"].in{-webkit-animation-name:flyInUp;animation-name:flyInUp}.transition[class*="fly down"].in{-webkit-animation-name:flyInDown;animation-name:flyInDown}.transition[class*="fly left"].in{-webkit-animation-name:flyInLeft;animation-name:flyInLeft}.transition[class*="fly right"].in{-webkit-animation-name:flyInRight;animation-name:flyInRight}.transition.fly.out{-webkit-animation-name:flyOut;animation-name:flyOut}.transition[class*="fly up"].out{-webkit-animation-name:flyOutUp;animation-name:flyOutUp}.transition[class*="fly down"].out{-webkit-animation-name:flyOutDown;animation-name:flyOutDown}.transition[class*="fly left"].out{-webkit-animation-name:flyOutLeft;animation-name:flyOutLeft}.transition[class*="fly right"].out{-webkit-animation-name:flyOutRight;animation-name:flyOutRight}@-webkit-keyframes flyIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@keyframes flyIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@-webkit-keyframes flyInUp{0%{opacity:0;-webkit-transform:translate3d(0,1500px,0);transform:translate3d(0,1500px,0)}60%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}75%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}90%{-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0)}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes flyInUp{0%{opacity:0;-webkit-transform:translate3d(0,1500px,0);transform:translate3d(0,1500px,0)}60%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}75%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}90%{-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0)}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes flyInDown{0%{opacity:0;-webkit-transform:translate3d(0,-1500px,0);transform:translate3d(0,-1500px,0)}60%{opacity:1;-webkit-transform:translate3d(0,25px,0);transform:translate3d(0,25px,0)}75%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}90%{-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}100%{-webkit-transform:none;transform:none}}@keyframes flyInDown{0%{opacity:0;-webkit-transform:translate3d(0,-1500px,0);transform:translate3d(0,-1500px,0)}60%{opacity:1;-webkit-transform:translate3d(0,25px,0);transform:translate3d(0,25px,0)}75%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}90%{-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}100%{-webkit-transform:none;transform:none}}@-webkit-keyframes flyInLeft{0%{opacity:0;-webkit-transform:translate3d(1500px,0,0);transform:translate3d(1500px,0,0)}60%{opacity:1;-webkit-transform:translate3d(-25px,0,0);transform:translate3d(-25px,0,0)}75%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}90%{-webkit-transform:translate3d(-5px,0,0);transform:translate3d(-5px,0,0)}100%{-webkit-transform:none;transform:none}}@keyframes flyInLeft{0%{opacity:0;-webkit-transform:translate3d(1500px,0,0);transform:translate3d(1500px,0,0)}60%{opacity:1;-webkit-transform:translate3d(-25px,0,0);transform:translate3d(-25px,0,0)}75%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}90%{-webkit-transform:translate3d(-5px,0,0);transform:translate3d(-5px,0,0)}100%{-webkit-transform:none;transform:none}}@-webkit-keyframes flyInRight{0%{opacity:0;-webkit-transform:translate3d(-1500px,0,0);transform:translate3d(-1500px,0,0)}60%{opacity:1;-webkit-transform:translate3d(25px,0,0);transform:translate3d(25px,0,0)}75%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}90%{-webkit-transform:translate3d(5px,0,0);transform:translate3d(5px,0,0)}100%{-webkit-transform:none;transform:none}}@keyframes flyInRight{0%{opacity:0;-webkit-transform:translate3d(-1500px,0,0);transform:translate3d(-1500px,0,0)}60%{opacity:1;-webkit-transform:translate3d(25px,0,0);transform:translate3d(25px,0,0)}75%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}90%{-webkit-transform:translate3d(5px,0,0);transform:translate3d(5px,0,0)}100%{-webkit-transform:none;transform:none}}@-webkit-keyframes flyOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}100%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@keyframes flyOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}100%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@-webkit-keyframes flyOutUp{20%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}100%{opacity:0;-webkit-transform:translate3d(0,2000px,0);transform:translate3d(0,2000px,0)}}@keyframes flyOutUp{20%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}100%{opacity:0;-webkit-transform:translate3d(0,2000px,0);transform:translate3d(0,2000px,0)}}@-webkit-keyframes flyOutDown{20%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}100%{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}}@keyframes flyOutDown{20%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}100%{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}}@-webkit-keyframes flyOutRight{20%{opacity:1;-webkit-transform:translate3d(20px,0,0);transform:translate3d(20px,0,0)}100%{opacity:0;-webkit-transform:translate3d(-2000px,0,0);transform:translate3d(-2000px,0,0)}}@keyframes flyOutRight{20%{opacity:1;-webkit-transform:translate3d(20px,0,0);transform:translate3d(20px,0,0)}100%{opacity:0;-webkit-transform:translate3d(-2000px,0,0);transform:translate3d(-2000px,0,0)}}@-webkit-keyframes flyOutLeft{20%{opacity:1;-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}100%{opacity:0;-webkit-transform:translate3d(2000px,0,0);transform:translate3d(2000px,0,0)}}@keyframes flyOutLeft{20%{opacity:1;-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}100%{opacity:0;-webkit-transform:translate3d(2000px,0,0);transform:translate3d(2000px,0,0)}}.transition.slide.in,.transition[class*="slide down"].in{-webkit-animation-name:slideInY;animation-name:slideInY;-webkit-transform-origin:top center;transform-origin:top center}.transition[class*="slide up"].in{-webkit-animation-name:slideInY;animation-name:slideInY;-webkit-transform-origin:bottom center;transform-origin:bottom center}.transition[class*="slide left"].in{-webkit-animation-name:slideInX;animation-name:slideInX;-webkit-transform-origin:center right;transform-origin:center right}.transition[class*="slide right"].in{-webkit-animation-name:slideInX;animation-name:slideInX;-webkit-transform-origin:center left;transform-origin:center left}.transition.slide.out,.transition[class*="slide down"].out{-webkit-animation-name:slideOutY;animation-name:slideOutY;-webkit-transform-origin:top center;transform-origin:top center}.transition[class*="slide up"].out{-webkit-animation-name:slideOutY;animation-name:slideOutY;-webkit-transform-origin:bottom center;transform-origin:bottom center}.transition[class*="slide left"].out{-webkit-animation-name:slideOutX;animation-name:slideOutX;-webkit-transform-origin:center right;transform-origin:center right}.transition[class*="slide right"].out{-webkit-animation-name:slideOutX;animation-name:slideOutX;-webkit-transform-origin:center left;transform-origin:center left}@-webkit-keyframes slideInY{0%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes slideInY{0%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes slideInX{0%{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}100%{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes slideInX{0%{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}100%{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes slideOutY{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}}@keyframes slideOutY{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}}@-webkit-keyframes slideOutX{0%{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}}@keyframes slideOutX{0%{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}}.transition.swing{-webkit-animation-duration:.8s;animation-duration:.8s}.transition[class*="swing down"].in{-webkit-animation-name:swingInX;animation-name:swingInX;-webkit-transform-origin:top center;transform-origin:top center}.transition[class*="swing up"].in{-webkit-animation-name:swingInX;animation-name:swingInX;-webkit-transform-origin:bottom center;transform-origin:bottom center}.transition[class*="swing left"].in{-webkit-animation-name:swingInY;animation-name:swingInY;-webkit-transform-origin:center right;transform-origin:center right}.transition[class*="swing right"].in{-webkit-animation-name:swingInY;animation-name:swingInY;-webkit-transform-origin:center left;transform-origin:center left}.transition.swing.out,.transition[class*="swing down"].out{-webkit-animation-name:swingOutX;animation-name:swingOutX;-webkit-transform-origin:top center;transform-origin:top center}.transition[class*="swing up"].out{-webkit-animation-name:swingOutX;animation-name:swingOutX;-webkit-transform-origin:bottom center;transform-origin:bottom center}.transition[class*="swing left"].out{-webkit-animation-name:swingOutY;animation-name:swingOutY;-webkit-transform-origin:center right;transform-origin:center right}.transition[class*="swing right"].out{-webkit-animation-name:swingOutY;animation-name:swingOutY;-webkit-transform-origin:center left;transform-origin:center left}@-webkit-keyframes swingInX{0%{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(1000px) rotateX(-30deg);transform:perspective(1000px) rotateX(-30deg);opacity:1}60%{-webkit-transform:perspective(1000px) rotateX(15deg);transform:perspective(1000px) rotateX(15deg)}80%{-webkit-transform:perspective(1000px) rotateX(-7.5deg);transform:perspective(1000px) rotateX(-7.5deg)}100%{-webkit-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0)}}@keyframes swingInX{0%{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(1000px) rotateX(-30deg);transform:perspective(1000px) rotateX(-30deg);opacity:1}60%{-webkit-transform:perspective(1000px) rotateX(15deg);transform:perspective(1000px) rotateX(15deg)}80%{-webkit-transform:perspective(1000px) rotateX(-7.5deg);transform:perspective(1000px) rotateX(-7.5deg)}100%{-webkit-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0)}}@-webkit-keyframes swingInY{0%{-webkit-transform:perspective(1000px) rotateY(-90deg);transform:perspective(1000px) rotateY(-90deg);opacity:0}40%{-webkit-transform:perspective(1000px) rotateY(30deg);transform:perspective(1000px) rotateY(30deg);opacity:1}60%{-webkit-transform:perspective(1000px) rotateY(-17.5deg);transform:perspective(1000px) rotateY(-17.5deg)}80%{-webkit-transform:perspective(1000px) rotateY(7.5deg);transform:perspective(1000px) rotateY(7.5deg)}100%{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0)}}@keyframes swingInY{0%{-webkit-transform:perspective(1000px) rotateY(-90deg);transform:perspective(1000px) rotateY(-90deg);opacity:0}40%{-webkit-transform:perspective(1000px) rotateY(30deg);transform:perspective(1000px) rotateY(30deg);opacity:1}60%{-webkit-transform:perspective(1000px) rotateY(-17.5deg);transform:perspective(1000px) rotateY(-17.5deg)}80%{-webkit-transform:perspective(1000px) rotateY(7.5deg);transform:perspective(1000px) rotateY(7.5deg)}100%{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0)}}@-webkit-keyframes swingOutX{0%{-webkit-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0)}40%{-webkit-transform:perspective(1000px) rotateX(-7.5deg);transform:perspective(1000px) rotateX(-7.5deg)}60%{-webkit-transform:perspective(1000px) rotateX(17.5deg);transform:perspective(1000px) rotateX(17.5deg)}80%{-webkit-transform:perspective(1000px) rotateX(-30deg);transform:perspective(1000px) rotateX(-30deg);opacity:1}100%{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}}@keyframes swingOutX{0%{-webkit-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0)}40%{-webkit-transform:perspective(1000px) rotateX(-7.5deg);transform:perspective(1000px) rotateX(-7.5deg)}60%{-webkit-transform:perspective(1000px) rotateX(17.5deg);transform:perspective(1000px) rotateX(17.5deg)}80%{-webkit-transform:perspective(1000px) rotateX(-30deg);transform:perspective(1000px) rotateX(-30deg);opacity:1}100%{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}}@-webkit-keyframes swingOutY{0%{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0)}40%{-webkit-transform:perspective(1000px) rotateY(7.5deg);transform:perspective(1000px) rotateY(7.5deg)}60%{-webkit-transform:perspective(1000px) rotateY(-10deg);transform:perspective(1000px) rotateY(-10deg)}80%{-webkit-transform:perspective(1000px) rotateY(30deg);transform:perspective(1000px) rotateY(30deg);opacity:1}100%{-webkit-transform:perspective(1000px) rotateY(-90deg);transform:perspective(1000px) rotateY(-90deg);opacity:0}}@keyframes swingOutY{0%{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0)}40%{-webkit-transform:perspective(1000px) rotateY(7.5deg);transform:perspective(1000px) rotateY(7.5deg)}60%{-webkit-transform:perspective(1000px) rotateY(-10deg);transform:perspective(1000px) rotateY(-10deg)}80%{-webkit-transform:perspective(1000px) rotateY(30deg);transform:perspective(1000px) rotateY(30deg);opacity:1}100%{-webkit-transform:perspective(1000px) rotateY(-90deg);transform:perspective(1000px) rotateY(-90deg);opacity:0}}.flash.transition{-webkit-animation-duration:750ms;animation-duration:750ms;-webkit-animation-name:flash;animation-name:flash}.shake.transition{-webkit-animation-duration:750ms;animation-duration:750ms;-webkit-animation-name:shake;animation-name:shake}.bounce.transition{-webkit-animation-duration:750ms;animation-duration:750ms;-webkit-animation-name:bounce;animation-name:bounce}.tada.transition{-webkit-animation-duration:750ms;animation-duration:750ms;-webkit-animation-name:tada;animation-name:tada}.pulse.transition{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-name:pulse;animation-name:pulse}.jiggle.transition{-webkit-animation-duration:750ms;animation-duration:750ms;-webkit-animation-name:jiggle;animation-name:jiggle}@-webkit-keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@-webkit-keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@-webkit-keyframes tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(.9) rotate(-3deg);transform:scale(.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg);transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg);transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0);transform:scale(1) rotate(0)}}@keyframes tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(.9) rotate(-3deg);transform:scale(.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg);transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg);transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0);transform:scale(1) rotate(0)}}@-webkit-keyframes pulse{0%,100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.9);transform:scale(.9);opacity:.7}}@keyframes pulse{0%,100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.9);transform:scale(.9);opacity:.7}}@-webkit-keyframes jiggle{0%,100%{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}30%{-webkit-transform:scale3d(1.25,.75,1);transform:scale3d(1.25,.75,1)}40%{-webkit-transform:scale3d(.75,1.25,1);transform:scale3d(.75,1.25,1)}50%{-webkit-transform:scale3d(1.15,.85,1);transform:scale3d(1.15,.85,1)}65%{-webkit-transform:scale3d(.95,1.05,1);transform:scale3d(.95,1.05,1)}75%{-webkit-transform:scale3d(1.05,.95,1);transform:scale3d(1.05,.95,1)}}@keyframes jiggle{0%,100%{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}30%{-webkit-transform:scale3d(1.25,.75,1);transform:scale3d(1.25,.75,1)}40%{-webkit-transform:scale3d(.75,1.25,1);transform:scale3d(.75,1.25,1)}50%{-webkit-transform:scale3d(1.15,.85,1);transform:scale3d(1.15,.85,1)}65%{-webkit-transform:scale3d(.95,1.05,1);transform:scale3d(.95,1.05,1)}75%{-webkit-transform:scale3d(1.05,.95,1);transform:scale3d(1.05,.95,1)}} \ No newline at end of file diff --git a/public/img/emoji/+1.png b/public/img/emoji/+1.png deleted file mode 100644 index 81786c1d8..000000000 Binary files a/public/img/emoji/+1.png and /dev/null differ diff --git a/public/img/emoji/-1.png b/public/img/emoji/-1.png deleted file mode 100644 index 41c6b825d..000000000 Binary files a/public/img/emoji/-1.png and /dev/null differ diff --git a/public/img/emoji/100.png b/public/img/emoji/100.png deleted file mode 100644 index ca3bb9bcf..000000000 Binary files a/public/img/emoji/100.png and /dev/null differ diff --git a/public/img/emoji/1234.png b/public/img/emoji/1234.png deleted file mode 100644 index c47c2e1f9..000000000 Binary files a/public/img/emoji/1234.png and /dev/null differ diff --git a/public/img/emoji/8ball.png b/public/img/emoji/8ball.png deleted file mode 100644 index c2c710d45..000000000 Binary files a/public/img/emoji/8ball.png and /dev/null differ diff --git a/public/img/emoji/a.png b/public/img/emoji/a.png deleted file mode 100644 index 09ff6d6f1..000000000 Binary files a/public/img/emoji/a.png and /dev/null differ diff --git a/public/img/emoji/ab.png b/public/img/emoji/ab.png deleted file mode 100644 index 2a5222047..000000000 Binary files a/public/img/emoji/ab.png and /dev/null differ diff --git a/public/img/emoji/abc.png b/public/img/emoji/abc.png deleted file mode 100644 index 505d40a15..000000000 Binary files a/public/img/emoji/abc.png and /dev/null differ diff --git a/public/img/emoji/abcd.png b/public/img/emoji/abcd.png deleted file mode 100644 index 5218470b6..000000000 Binary files a/public/img/emoji/abcd.png and /dev/null differ diff --git a/public/img/emoji/accept.png b/public/img/emoji/accept.png deleted file mode 100644 index 2d2009031..000000000 Binary files a/public/img/emoji/accept.png and /dev/null differ diff --git a/public/img/emoji/aerial_tramway.png b/public/img/emoji/aerial_tramway.png deleted file mode 100644 index 38f6dfe23..000000000 Binary files a/public/img/emoji/aerial_tramway.png and /dev/null differ diff --git a/public/img/emoji/airplane.png b/public/img/emoji/airplane.png deleted file mode 100644 index 8407cb675..000000000 Binary files a/public/img/emoji/airplane.png and /dev/null differ diff --git a/public/img/emoji/alarm_clock.png b/public/img/emoji/alarm_clock.png deleted file mode 100644 index 86ca8c8ed..000000000 Binary files a/public/img/emoji/alarm_clock.png and /dev/null differ diff --git a/public/img/emoji/alien.png b/public/img/emoji/alien.png deleted file mode 100644 index 416de47be..000000000 Binary files a/public/img/emoji/alien.png and /dev/null differ diff --git a/public/img/emoji/ambulance.png b/public/img/emoji/ambulance.png deleted file mode 100644 index b740f45db..000000000 Binary files a/public/img/emoji/ambulance.png and /dev/null differ diff --git a/public/img/emoji/anchor.png b/public/img/emoji/anchor.png deleted file mode 100644 index 0c5192e64..000000000 Binary files a/public/img/emoji/anchor.png and /dev/null differ diff --git a/public/img/emoji/angel.png b/public/img/emoji/angel.png deleted file mode 100644 index da52c310c..000000000 Binary files a/public/img/emoji/angel.png and /dev/null differ diff --git a/public/img/emoji/anger.png b/public/img/emoji/anger.png deleted file mode 100644 index 6fb4dca18..000000000 Binary files a/public/img/emoji/anger.png and /dev/null differ diff --git a/public/img/emoji/angry.png b/public/img/emoji/angry.png deleted file mode 100644 index f95bfa897..000000000 Binary files a/public/img/emoji/angry.png and /dev/null differ diff --git a/public/img/emoji/anguished.png b/public/img/emoji/anguished.png deleted file mode 100644 index c62594726..000000000 Binary files a/public/img/emoji/anguished.png and /dev/null differ diff --git a/public/img/emoji/ant.png b/public/img/emoji/ant.png deleted file mode 100644 index b92d1cc14..000000000 Binary files a/public/img/emoji/ant.png and /dev/null differ diff --git a/public/img/emoji/apple.png b/public/img/emoji/apple.png deleted file mode 100644 index 08aa17b95..000000000 Binary files a/public/img/emoji/apple.png and /dev/null differ diff --git a/public/img/emoji/aquarius.png b/public/img/emoji/aquarius.png deleted file mode 100644 index cbff66edc..000000000 Binary files a/public/img/emoji/aquarius.png and /dev/null differ diff --git a/public/img/emoji/aries.png b/public/img/emoji/aries.png deleted file mode 100644 index aab5e8809..000000000 Binary files a/public/img/emoji/aries.png and /dev/null differ diff --git a/public/img/emoji/arrow_backward.png b/public/img/emoji/arrow_backward.png deleted file mode 100644 index 088621834..000000000 Binary files a/public/img/emoji/arrow_backward.png and /dev/null differ diff --git a/public/img/emoji/arrow_double_down.png b/public/img/emoji/arrow_double_down.png deleted file mode 100644 index 2ecbebcda..000000000 Binary files a/public/img/emoji/arrow_double_down.png and /dev/null differ diff --git a/public/img/emoji/arrow_double_up.png b/public/img/emoji/arrow_double_up.png deleted file mode 100644 index 2bd6659b1..000000000 Binary files a/public/img/emoji/arrow_double_up.png and /dev/null differ diff --git a/public/img/emoji/arrow_down.png b/public/img/emoji/arrow_down.png deleted file mode 100644 index e6702f02b..000000000 Binary files a/public/img/emoji/arrow_down.png and /dev/null differ diff --git a/public/img/emoji/arrow_down_small.png b/public/img/emoji/arrow_down_small.png deleted file mode 100644 index 22d383a92..000000000 Binary files a/public/img/emoji/arrow_down_small.png and /dev/null differ diff --git a/public/img/emoji/arrow_forward.png b/public/img/emoji/arrow_forward.png deleted file mode 100644 index fbfe711b6..000000000 Binary files a/public/img/emoji/arrow_forward.png and /dev/null differ diff --git a/public/img/emoji/arrow_heading_down.png b/public/img/emoji/arrow_heading_down.png deleted file mode 100644 index 56dd3b9d3..000000000 Binary files a/public/img/emoji/arrow_heading_down.png and /dev/null differ diff --git a/public/img/emoji/arrow_heading_up.png b/public/img/emoji/arrow_heading_up.png deleted file mode 100644 index c8f670a1e..000000000 Binary files a/public/img/emoji/arrow_heading_up.png and /dev/null differ diff --git a/public/img/emoji/arrow_left.png b/public/img/emoji/arrow_left.png deleted file mode 100644 index d64ac619c..000000000 Binary files a/public/img/emoji/arrow_left.png and /dev/null differ diff --git a/public/img/emoji/arrow_lower_left.png b/public/img/emoji/arrow_lower_left.png deleted file mode 100644 index 55fb03c41..000000000 Binary files a/public/img/emoji/arrow_lower_left.png and /dev/null differ diff --git a/public/img/emoji/arrow_lower_right.png b/public/img/emoji/arrow_lower_right.png deleted file mode 100644 index da8fb8294..000000000 Binary files a/public/img/emoji/arrow_lower_right.png and /dev/null differ diff --git a/public/img/emoji/arrow_right.png b/public/img/emoji/arrow_right.png deleted file mode 100644 index 6d483b514..000000000 Binary files a/public/img/emoji/arrow_right.png and /dev/null differ diff --git a/public/img/emoji/arrow_right_hook.png b/public/img/emoji/arrow_right_hook.png deleted file mode 100644 index 8b4ea6e17..000000000 Binary files a/public/img/emoji/arrow_right_hook.png and /dev/null differ diff --git a/public/img/emoji/arrow_up.png b/public/img/emoji/arrow_up.png deleted file mode 100644 index b5b0688d3..000000000 Binary files a/public/img/emoji/arrow_up.png and /dev/null differ diff --git a/public/img/emoji/arrow_up_down.png b/public/img/emoji/arrow_up_down.png deleted file mode 100644 index be423de78..000000000 Binary files a/public/img/emoji/arrow_up_down.png and /dev/null differ diff --git a/public/img/emoji/arrow_up_small.png b/public/img/emoji/arrow_up_small.png deleted file mode 100644 index 3f40bfb89..000000000 Binary files a/public/img/emoji/arrow_up_small.png and /dev/null differ diff --git a/public/img/emoji/arrow_upper_left.png b/public/img/emoji/arrow_upper_left.png deleted file mode 100644 index 2950ae2f9..000000000 Binary files a/public/img/emoji/arrow_upper_left.png and /dev/null differ diff --git a/public/img/emoji/arrow_upper_right.png b/public/img/emoji/arrow_upper_right.png deleted file mode 100644 index e23790ba1..000000000 Binary files a/public/img/emoji/arrow_upper_right.png and /dev/null differ diff --git a/public/img/emoji/arrows_clockwise.png b/public/img/emoji/arrows_clockwise.png deleted file mode 100644 index 5f84d7e72..000000000 Binary files a/public/img/emoji/arrows_clockwise.png and /dev/null differ diff --git a/public/img/emoji/arrows_counterclockwise.png b/public/img/emoji/arrows_counterclockwise.png deleted file mode 100644 index 3e06f5b3c..000000000 Binary files a/public/img/emoji/arrows_counterclockwise.png and /dev/null differ diff --git a/public/img/emoji/art.png b/public/img/emoji/art.png deleted file mode 100644 index d45212b03..000000000 Binary files a/public/img/emoji/art.png and /dev/null differ diff --git a/public/img/emoji/articulated_lorry.png b/public/img/emoji/articulated_lorry.png deleted file mode 100644 index 81ec1f917..000000000 Binary files a/public/img/emoji/articulated_lorry.png and /dev/null differ diff --git a/public/img/emoji/astonished.png b/public/img/emoji/astonished.png deleted file mode 100644 index 858a83484..000000000 Binary files a/public/img/emoji/astonished.png and /dev/null differ diff --git a/public/img/emoji/atm.png b/public/img/emoji/atm.png deleted file mode 100644 index c2846e792..000000000 Binary files a/public/img/emoji/atm.png and /dev/null differ diff --git a/public/img/emoji/b.png b/public/img/emoji/b.png deleted file mode 100644 index 8742b3d2e..000000000 Binary files a/public/img/emoji/b.png and /dev/null differ diff --git a/public/img/emoji/baby.png b/public/img/emoji/baby.png deleted file mode 100644 index 3b29da40b..000000000 Binary files a/public/img/emoji/baby.png and /dev/null differ diff --git a/public/img/emoji/baby_bottle.png b/public/img/emoji/baby_bottle.png deleted file mode 100644 index 1b2cfe5e3..000000000 Binary files a/public/img/emoji/baby_bottle.png and /dev/null differ diff --git a/public/img/emoji/baby_chick.png b/public/img/emoji/baby_chick.png deleted file mode 100644 index 9be8d2930..000000000 Binary files a/public/img/emoji/baby_chick.png and /dev/null differ diff --git a/public/img/emoji/baby_symbol.png b/public/img/emoji/baby_symbol.png deleted file mode 100644 index 2e58725cf..000000000 Binary files a/public/img/emoji/baby_symbol.png and /dev/null differ diff --git a/public/img/emoji/back.png b/public/img/emoji/back.png deleted file mode 100644 index 5851ddca4..000000000 Binary files a/public/img/emoji/back.png and /dev/null differ diff --git a/public/img/emoji/baggage_claim.png b/public/img/emoji/baggage_claim.png deleted file mode 100644 index 59ae044a4..000000000 Binary files a/public/img/emoji/baggage_claim.png and /dev/null differ diff --git a/public/img/emoji/balloon.png b/public/img/emoji/balloon.png deleted file mode 100644 index 034489702..000000000 Binary files a/public/img/emoji/balloon.png and /dev/null differ diff --git a/public/img/emoji/ballot_box_with_check.png b/public/img/emoji/ballot_box_with_check.png deleted file mode 100644 index f07a466c7..000000000 Binary files a/public/img/emoji/ballot_box_with_check.png and /dev/null differ diff --git a/public/img/emoji/bamboo.png b/public/img/emoji/bamboo.png deleted file mode 100644 index fc858d0fc..000000000 Binary files a/public/img/emoji/bamboo.png and /dev/null differ diff --git a/public/img/emoji/banana.png b/public/img/emoji/banana.png deleted file mode 100644 index a0563afb9..000000000 Binary files a/public/img/emoji/banana.png and /dev/null differ diff --git a/public/img/emoji/bangbang.png b/public/img/emoji/bangbang.png deleted file mode 100644 index 7270f0afe..000000000 Binary files a/public/img/emoji/bangbang.png and /dev/null differ diff --git a/public/img/emoji/bank.png b/public/img/emoji/bank.png deleted file mode 100644 index 1faa8777e..000000000 Binary files a/public/img/emoji/bank.png and /dev/null differ diff --git a/public/img/emoji/bar_chart.png b/public/img/emoji/bar_chart.png deleted file mode 100644 index 09d7301c4..000000000 Binary files a/public/img/emoji/bar_chart.png and /dev/null differ diff --git a/public/img/emoji/barber.png b/public/img/emoji/barber.png deleted file mode 100644 index a10cb2322..000000000 Binary files a/public/img/emoji/barber.png and /dev/null differ diff --git a/public/img/emoji/baseball.png b/public/img/emoji/baseball.png deleted file mode 100644 index da004e2ea..000000000 Binary files a/public/img/emoji/baseball.png and /dev/null differ diff --git a/public/img/emoji/basketball.png b/public/img/emoji/basketball.png deleted file mode 100644 index ef694bec4..000000000 Binary files a/public/img/emoji/basketball.png and /dev/null differ diff --git a/public/img/emoji/bath.png b/public/img/emoji/bath.png deleted file mode 100644 index 8f75d1d24..000000000 Binary files a/public/img/emoji/bath.png and /dev/null differ diff --git a/public/img/emoji/bathtub.png b/public/img/emoji/bathtub.png deleted file mode 100644 index 1c3f844ab..000000000 Binary files a/public/img/emoji/bathtub.png and /dev/null differ diff --git a/public/img/emoji/battery.png b/public/img/emoji/battery.png deleted file mode 100644 index aa7eedce4..000000000 Binary files a/public/img/emoji/battery.png and /dev/null differ diff --git a/public/img/emoji/bear.png b/public/img/emoji/bear.png deleted file mode 100644 index f5afe920e..000000000 Binary files a/public/img/emoji/bear.png and /dev/null differ diff --git a/public/img/emoji/bee.png b/public/img/emoji/bee.png deleted file mode 100644 index f53733953..000000000 Binary files a/public/img/emoji/bee.png and /dev/null differ diff --git a/public/img/emoji/beer.png b/public/img/emoji/beer.png deleted file mode 100644 index cd78bed74..000000000 Binary files a/public/img/emoji/beer.png and /dev/null differ diff --git a/public/img/emoji/beers.png b/public/img/emoji/beers.png deleted file mode 100644 index cc5e4ab5a..000000000 Binary files a/public/img/emoji/beers.png and /dev/null differ diff --git a/public/img/emoji/beetle.png b/public/img/emoji/beetle.png deleted file mode 100644 index 222577ca7..000000000 Binary files a/public/img/emoji/beetle.png and /dev/null differ diff --git a/public/img/emoji/beginner.png b/public/img/emoji/beginner.png deleted file mode 100644 index 1f022d175..000000000 Binary files a/public/img/emoji/beginner.png and /dev/null differ diff --git a/public/img/emoji/bell.png b/public/img/emoji/bell.png deleted file mode 100644 index 69acceb28..000000000 Binary files a/public/img/emoji/bell.png and /dev/null differ diff --git a/public/img/emoji/bento.png b/public/img/emoji/bento.png deleted file mode 100644 index d6801124a..000000000 Binary files a/public/img/emoji/bento.png and /dev/null differ diff --git a/public/img/emoji/bicyclist.png b/public/img/emoji/bicyclist.png deleted file mode 100644 index cbbd7c386..000000000 Binary files a/public/img/emoji/bicyclist.png and /dev/null differ diff --git a/public/img/emoji/bike.png b/public/img/emoji/bike.png deleted file mode 100644 index 657386027..000000000 Binary files a/public/img/emoji/bike.png and /dev/null differ diff --git a/public/img/emoji/bikini.png b/public/img/emoji/bikini.png deleted file mode 100644 index 4ff63b40f..000000000 Binary files a/public/img/emoji/bikini.png and /dev/null differ diff --git a/public/img/emoji/bird.png b/public/img/emoji/bird.png deleted file mode 100644 index e6be8c027..000000000 Binary files a/public/img/emoji/bird.png and /dev/null differ diff --git a/public/img/emoji/birthday.png b/public/img/emoji/birthday.png deleted file mode 100644 index 36e8edcbe..000000000 Binary files a/public/img/emoji/birthday.png and /dev/null differ diff --git a/public/img/emoji/black_circle.png b/public/img/emoji/black_circle.png deleted file mode 100644 index e46f9df61..000000000 Binary files a/public/img/emoji/black_circle.png and /dev/null differ diff --git a/public/img/emoji/black_joker.png b/public/img/emoji/black_joker.png deleted file mode 100644 index 4c78f3614..000000000 Binary files a/public/img/emoji/black_joker.png and /dev/null differ diff --git a/public/img/emoji/black_medium_small_square.png b/public/img/emoji/black_medium_small_square.png deleted file mode 100644 index 9ac79989b..000000000 Binary files a/public/img/emoji/black_medium_small_square.png and /dev/null differ diff --git a/public/img/emoji/black_medium_square.png b/public/img/emoji/black_medium_square.png deleted file mode 100644 index 2f61dc235..000000000 Binary files a/public/img/emoji/black_medium_square.png and /dev/null differ diff --git a/public/img/emoji/black_nib.png b/public/img/emoji/black_nib.png deleted file mode 100644 index 29f6994c1..000000000 Binary files a/public/img/emoji/black_nib.png and /dev/null differ diff --git a/public/img/emoji/black_small_square.png b/public/img/emoji/black_small_square.png deleted file mode 100644 index a247751ec..000000000 Binary files a/public/img/emoji/black_small_square.png and /dev/null differ diff --git a/public/img/emoji/black_square.png b/public/img/emoji/black_square.png deleted file mode 100644 index 71da10de8..000000000 Binary files a/public/img/emoji/black_square.png and /dev/null differ diff --git a/public/img/emoji/black_square_button.png b/public/img/emoji/black_square_button.png deleted file mode 100644 index f2597e956..000000000 Binary files a/public/img/emoji/black_square_button.png and /dev/null differ diff --git a/public/img/emoji/blossom.png b/public/img/emoji/blossom.png deleted file mode 100644 index 55a97353b..000000000 Binary files a/public/img/emoji/blossom.png and /dev/null differ diff --git a/public/img/emoji/blowfish.png b/public/img/emoji/blowfish.png deleted file mode 100644 index d3ad46585..000000000 Binary files a/public/img/emoji/blowfish.png and /dev/null differ diff --git a/public/img/emoji/blue_book.png b/public/img/emoji/blue_book.png deleted file mode 100644 index e2b9e8c79..000000000 Binary files a/public/img/emoji/blue_book.png and /dev/null differ diff --git a/public/img/emoji/blue_car.png b/public/img/emoji/blue_car.png deleted file mode 100644 index 978291e08..000000000 Binary files a/public/img/emoji/blue_car.png and /dev/null differ diff --git a/public/img/emoji/blue_heart.png b/public/img/emoji/blue_heart.png deleted file mode 100644 index baa29b31b..000000000 Binary files a/public/img/emoji/blue_heart.png and /dev/null differ diff --git a/public/img/emoji/blush.png b/public/img/emoji/blush.png deleted file mode 100644 index 3a95eb61a..000000000 Binary files a/public/img/emoji/blush.png and /dev/null differ diff --git a/public/img/emoji/boar.png b/public/img/emoji/boar.png deleted file mode 100644 index 8196ad4a1..000000000 Binary files a/public/img/emoji/boar.png and /dev/null differ diff --git a/public/img/emoji/boat.png b/public/img/emoji/boat.png deleted file mode 100644 index ff656dc62..000000000 Binary files a/public/img/emoji/boat.png and /dev/null differ diff --git a/public/img/emoji/bomb.png b/public/img/emoji/bomb.png deleted file mode 100644 index 3289787dc..000000000 Binary files a/public/img/emoji/bomb.png and /dev/null differ diff --git a/public/img/emoji/book.png b/public/img/emoji/book.png deleted file mode 100644 index 8b698415c..000000000 Binary files a/public/img/emoji/book.png and /dev/null differ diff --git a/public/img/emoji/bookmark.png b/public/img/emoji/bookmark.png deleted file mode 100644 index 6fc4ed902..000000000 Binary files a/public/img/emoji/bookmark.png and /dev/null differ diff --git a/public/img/emoji/bookmark_tabs.png b/public/img/emoji/bookmark_tabs.png deleted file mode 100644 index 83782ff0c..000000000 Binary files a/public/img/emoji/bookmark_tabs.png and /dev/null differ diff --git a/public/img/emoji/books.png b/public/img/emoji/books.png deleted file mode 100644 index dca06a1ad..000000000 Binary files a/public/img/emoji/books.png and /dev/null differ diff --git a/public/img/emoji/boom.png b/public/img/emoji/boom.png deleted file mode 100644 index 9d5bd0401..000000000 Binary files a/public/img/emoji/boom.png and /dev/null differ diff --git a/public/img/emoji/boot.png b/public/img/emoji/boot.png deleted file mode 100644 index 58d0fdbcd..000000000 Binary files a/public/img/emoji/boot.png and /dev/null differ diff --git a/public/img/emoji/bouquet.png b/public/img/emoji/bouquet.png deleted file mode 100644 index ce637832e..000000000 Binary files a/public/img/emoji/bouquet.png and /dev/null differ diff --git a/public/img/emoji/bow.png b/public/img/emoji/bow.png deleted file mode 100644 index 024cb6104..000000000 Binary files a/public/img/emoji/bow.png and /dev/null differ diff --git a/public/img/emoji/bowling.png b/public/img/emoji/bowling.png deleted file mode 100644 index 13d8ece2e..000000000 Binary files a/public/img/emoji/bowling.png and /dev/null differ diff --git a/public/img/emoji/bowtie.png b/public/img/emoji/bowtie.png deleted file mode 100644 index 28ff0c787..000000000 Binary files a/public/img/emoji/bowtie.png and /dev/null differ diff --git a/public/img/emoji/boy.png b/public/img/emoji/boy.png deleted file mode 100644 index f79f1f298..000000000 Binary files a/public/img/emoji/boy.png and /dev/null differ diff --git a/public/img/emoji/bread.png b/public/img/emoji/bread.png deleted file mode 100644 index 7e7c63753..000000000 Binary files a/public/img/emoji/bread.png and /dev/null differ diff --git a/public/img/emoji/bride_with_veil.png b/public/img/emoji/bride_with_veil.png deleted file mode 100644 index dd0b0cfda..000000000 Binary files a/public/img/emoji/bride_with_veil.png and /dev/null differ diff --git a/public/img/emoji/bridge_at_night.png b/public/img/emoji/bridge_at_night.png deleted file mode 100644 index 495b06c3d..000000000 Binary files a/public/img/emoji/bridge_at_night.png and /dev/null differ diff --git a/public/img/emoji/briefcase.png b/public/img/emoji/briefcase.png deleted file mode 100644 index 46e82b001..000000000 Binary files a/public/img/emoji/briefcase.png and /dev/null differ diff --git a/public/img/emoji/broken_heart.png b/public/img/emoji/broken_heart.png deleted file mode 100644 index a1bc850ec..000000000 Binary files a/public/img/emoji/broken_heart.png and /dev/null differ diff --git a/public/img/emoji/bug.png b/public/img/emoji/bug.png deleted file mode 100644 index c2eaf7a70..000000000 Binary files a/public/img/emoji/bug.png and /dev/null differ diff --git a/public/img/emoji/bulb.png b/public/img/emoji/bulb.png deleted file mode 100644 index 23afca1c7..000000000 Binary files a/public/img/emoji/bulb.png and /dev/null differ diff --git a/public/img/emoji/bullettrain_front.png b/public/img/emoji/bullettrain_front.png deleted file mode 100644 index 16651acff..000000000 Binary files a/public/img/emoji/bullettrain_front.png and /dev/null differ diff --git a/public/img/emoji/bullettrain_side.png b/public/img/emoji/bullettrain_side.png deleted file mode 100644 index 8eca36845..000000000 Binary files a/public/img/emoji/bullettrain_side.png and /dev/null differ diff --git a/public/img/emoji/bus.png b/public/img/emoji/bus.png deleted file mode 100644 index 823aa39e4..000000000 Binary files a/public/img/emoji/bus.png and /dev/null differ diff --git a/public/img/emoji/busstop.png b/public/img/emoji/busstop.png deleted file mode 100644 index 94894847b..000000000 Binary files a/public/img/emoji/busstop.png and /dev/null differ diff --git a/public/img/emoji/bust_in_silhouette.png b/public/img/emoji/bust_in_silhouette.png deleted file mode 100644 index dd7defe28..000000000 Binary files a/public/img/emoji/bust_in_silhouette.png and /dev/null differ diff --git a/public/img/emoji/busts_in_silhouette.png b/public/img/emoji/busts_in_silhouette.png deleted file mode 100644 index 1f3aabcff..000000000 Binary files a/public/img/emoji/busts_in_silhouette.png and /dev/null differ diff --git a/public/img/emoji/cactus.png b/public/img/emoji/cactus.png deleted file mode 100644 index 5a2c3cc72..000000000 Binary files a/public/img/emoji/cactus.png and /dev/null differ diff --git a/public/img/emoji/cake.png b/public/img/emoji/cake.png deleted file mode 100644 index efeb9b4b2..000000000 Binary files a/public/img/emoji/cake.png and /dev/null differ diff --git a/public/img/emoji/calendar.png b/public/img/emoji/calendar.png deleted file mode 100644 index 900b868bb..000000000 Binary files a/public/img/emoji/calendar.png and /dev/null differ diff --git a/public/img/emoji/calling.png b/public/img/emoji/calling.png deleted file mode 100644 index 837897f26..000000000 Binary files a/public/img/emoji/calling.png and /dev/null differ diff --git a/public/img/emoji/camel.png b/public/img/emoji/camel.png deleted file mode 100644 index 496c186ae..000000000 Binary files a/public/img/emoji/camel.png and /dev/null differ diff --git a/public/img/emoji/camera.png b/public/img/emoji/camera.png deleted file mode 100644 index 397d03b39..000000000 Binary files a/public/img/emoji/camera.png and /dev/null differ diff --git a/public/img/emoji/cancer.png b/public/img/emoji/cancer.png deleted file mode 100644 index ea43a4a2a..000000000 Binary files a/public/img/emoji/cancer.png and /dev/null differ diff --git a/public/img/emoji/candy.png b/public/img/emoji/candy.png deleted file mode 100644 index 33722f236..000000000 Binary files a/public/img/emoji/candy.png and /dev/null differ diff --git a/public/img/emoji/capital_abcd.png b/public/img/emoji/capital_abcd.png deleted file mode 100644 index ffc0cba4b..000000000 Binary files a/public/img/emoji/capital_abcd.png and /dev/null differ diff --git a/public/img/emoji/capricorn.png b/public/img/emoji/capricorn.png deleted file mode 100644 index f2044e789..000000000 Binary files a/public/img/emoji/capricorn.png and /dev/null differ diff --git a/public/img/emoji/car.png b/public/img/emoji/car.png deleted file mode 100644 index d70a2f062..000000000 Binary files a/public/img/emoji/car.png and /dev/null differ diff --git a/public/img/emoji/card_index.png b/public/img/emoji/card_index.png deleted file mode 100644 index 374e94e9e..000000000 Binary files a/public/img/emoji/card_index.png and /dev/null differ diff --git a/public/img/emoji/carousel_horse.png b/public/img/emoji/carousel_horse.png deleted file mode 100644 index 765d2c0a8..000000000 Binary files a/public/img/emoji/carousel_horse.png and /dev/null differ diff --git a/public/img/emoji/cat.png b/public/img/emoji/cat.png deleted file mode 100644 index 09b9ef79a..000000000 Binary files a/public/img/emoji/cat.png and /dev/null differ diff --git a/public/img/emoji/cat2.png b/public/img/emoji/cat2.png deleted file mode 100644 index 6dbc4c71e..000000000 Binary files a/public/img/emoji/cat2.png and /dev/null differ diff --git a/public/img/emoji/cd.png b/public/img/emoji/cd.png deleted file mode 100644 index baff835c4..000000000 Binary files a/public/img/emoji/cd.png and /dev/null differ diff --git a/public/img/emoji/chart.png b/public/img/emoji/chart.png deleted file mode 100644 index ac2c4bb09..000000000 Binary files a/public/img/emoji/chart.png and /dev/null differ diff --git a/public/img/emoji/chart_with_downwards_trend.png b/public/img/emoji/chart_with_downwards_trend.png deleted file mode 100644 index cb0d2a113..000000000 Binary files a/public/img/emoji/chart_with_downwards_trend.png and /dev/null differ diff --git a/public/img/emoji/chart_with_upwards_trend.png b/public/img/emoji/chart_with_upwards_trend.png deleted file mode 100644 index 7c66745c9..000000000 Binary files a/public/img/emoji/chart_with_upwards_trend.png and /dev/null differ diff --git a/public/img/emoji/checkered_flag.png b/public/img/emoji/checkered_flag.png deleted file mode 100644 index ead4a68dd..000000000 Binary files a/public/img/emoji/checkered_flag.png and /dev/null differ diff --git a/public/img/emoji/cherries.png b/public/img/emoji/cherries.png deleted file mode 100644 index 8d3e044f2..000000000 Binary files a/public/img/emoji/cherries.png and /dev/null differ diff --git a/public/img/emoji/cherry_blossom.png b/public/img/emoji/cherry_blossom.png deleted file mode 100644 index e03155499..000000000 Binary files a/public/img/emoji/cherry_blossom.png and /dev/null differ diff --git a/public/img/emoji/chestnut.png b/public/img/emoji/chestnut.png deleted file mode 100644 index 066fb6bf6..000000000 Binary files a/public/img/emoji/chestnut.png and /dev/null differ diff --git a/public/img/emoji/chicken.png b/public/img/emoji/chicken.png deleted file mode 100644 index 6d25c0ef4..000000000 Binary files a/public/img/emoji/chicken.png and /dev/null differ diff --git a/public/img/emoji/children_crossing.png b/public/img/emoji/children_crossing.png deleted file mode 100644 index b0302ae62..000000000 Binary files a/public/img/emoji/children_crossing.png and /dev/null differ diff --git a/public/img/emoji/chocolate_bar.png b/public/img/emoji/chocolate_bar.png deleted file mode 100644 index c7ec19d07..000000000 Binary files a/public/img/emoji/chocolate_bar.png and /dev/null differ diff --git a/public/img/emoji/christmas_tree.png b/public/img/emoji/christmas_tree.png deleted file mode 100644 index d813b9593..000000000 Binary files a/public/img/emoji/christmas_tree.png and /dev/null differ diff --git a/public/img/emoji/church.png b/public/img/emoji/church.png deleted file mode 100644 index 4c07c6b9e..000000000 Binary files a/public/img/emoji/church.png and /dev/null differ diff --git a/public/img/emoji/cinema.png b/public/img/emoji/cinema.png deleted file mode 100644 index a990ccf99..000000000 Binary files a/public/img/emoji/cinema.png and /dev/null differ diff --git a/public/img/emoji/circus_tent.png b/public/img/emoji/circus_tent.png deleted file mode 100644 index 4af8719aa..000000000 Binary files a/public/img/emoji/circus_tent.png and /dev/null differ diff --git a/public/img/emoji/city_sunrise.png b/public/img/emoji/city_sunrise.png deleted file mode 100644 index 91ca2a40b..000000000 Binary files a/public/img/emoji/city_sunrise.png and /dev/null differ diff --git a/public/img/emoji/city_sunset.png b/public/img/emoji/city_sunset.png deleted file mode 100644 index 7cb178a2c..000000000 Binary files a/public/img/emoji/city_sunset.png and /dev/null differ diff --git a/public/img/emoji/cl.png b/public/img/emoji/cl.png deleted file mode 100644 index 15ac67525..000000000 Binary files a/public/img/emoji/cl.png and /dev/null differ diff --git a/public/img/emoji/clap.png b/public/img/emoji/clap.png deleted file mode 100644 index d01c982a7..000000000 Binary files a/public/img/emoji/clap.png and /dev/null differ diff --git a/public/img/emoji/clapper.png b/public/img/emoji/clapper.png deleted file mode 100644 index 4e1dc111d..000000000 Binary files a/public/img/emoji/clapper.png and /dev/null differ diff --git a/public/img/emoji/clipboard.png b/public/img/emoji/clipboard.png deleted file mode 100644 index e2c74e6df..000000000 Binary files a/public/img/emoji/clipboard.png and /dev/null differ diff --git a/public/img/emoji/clock1.png b/public/img/emoji/clock1.png deleted file mode 100644 index 9174d4e0b..000000000 Binary files a/public/img/emoji/clock1.png and /dev/null differ diff --git a/public/img/emoji/clock10.png b/public/img/emoji/clock10.png deleted file mode 100644 index 39f590d69..000000000 Binary files a/public/img/emoji/clock10.png and /dev/null differ diff --git a/public/img/emoji/clock1030.png b/public/img/emoji/clock1030.png deleted file mode 100644 index 0483b3059..000000000 Binary files a/public/img/emoji/clock1030.png and /dev/null differ diff --git a/public/img/emoji/clock11.png b/public/img/emoji/clock11.png deleted file mode 100644 index ddb53fada..000000000 Binary files a/public/img/emoji/clock11.png and /dev/null differ diff --git a/public/img/emoji/clock1130.png b/public/img/emoji/clock1130.png deleted file mode 100644 index 415999ec8..000000000 Binary files a/public/img/emoji/clock1130.png and /dev/null differ diff --git a/public/img/emoji/clock12.png b/public/img/emoji/clock12.png deleted file mode 100644 index 87b132878..000000000 Binary files a/public/img/emoji/clock12.png and /dev/null differ diff --git a/public/img/emoji/clock1230.png b/public/img/emoji/clock1230.png deleted file mode 100644 index a6527154d..000000000 Binary files a/public/img/emoji/clock1230.png and /dev/null differ diff --git a/public/img/emoji/clock130.png b/public/img/emoji/clock130.png deleted file mode 100644 index 90ea5b914..000000000 Binary files a/public/img/emoji/clock130.png and /dev/null differ diff --git a/public/img/emoji/clock2.png b/public/img/emoji/clock2.png deleted file mode 100644 index 65b3b3af0..000000000 Binary files a/public/img/emoji/clock2.png and /dev/null differ diff --git a/public/img/emoji/clock230.png b/public/img/emoji/clock230.png deleted file mode 100644 index f12c6912a..000000000 Binary files a/public/img/emoji/clock230.png and /dev/null differ diff --git a/public/img/emoji/clock3.png b/public/img/emoji/clock3.png deleted file mode 100644 index 3e44d64e2..000000000 Binary files a/public/img/emoji/clock3.png and /dev/null differ diff --git a/public/img/emoji/clock330.png b/public/img/emoji/clock330.png deleted file mode 100644 index 1dc9628ea..000000000 Binary files a/public/img/emoji/clock330.png and /dev/null differ diff --git a/public/img/emoji/clock4.png b/public/img/emoji/clock4.png deleted file mode 100644 index 948ed1a38..000000000 Binary files a/public/img/emoji/clock4.png and /dev/null differ diff --git a/public/img/emoji/clock430.png b/public/img/emoji/clock430.png deleted file mode 100644 index 5d6b16a2d..000000000 Binary files a/public/img/emoji/clock430.png and /dev/null differ diff --git a/public/img/emoji/clock5.png b/public/img/emoji/clock5.png deleted file mode 100644 index b010b4f8a..000000000 Binary files a/public/img/emoji/clock5.png and /dev/null differ diff --git a/public/img/emoji/clock530.png b/public/img/emoji/clock530.png deleted file mode 100644 index e08d4ad2b..000000000 Binary files a/public/img/emoji/clock530.png and /dev/null differ diff --git a/public/img/emoji/clock6.png b/public/img/emoji/clock6.png deleted file mode 100644 index 76bf8cf18..000000000 Binary files a/public/img/emoji/clock6.png and /dev/null differ diff --git a/public/img/emoji/clock630.png b/public/img/emoji/clock630.png deleted file mode 100644 index 46f0681f1..000000000 Binary files a/public/img/emoji/clock630.png and /dev/null differ diff --git a/public/img/emoji/clock7.png b/public/img/emoji/clock7.png deleted file mode 100644 index d48f645d8..000000000 Binary files a/public/img/emoji/clock7.png and /dev/null differ diff --git a/public/img/emoji/clock730.png b/public/img/emoji/clock730.png deleted file mode 100644 index f2807de2f..000000000 Binary files a/public/img/emoji/clock730.png and /dev/null differ diff --git a/public/img/emoji/clock8.png b/public/img/emoji/clock8.png deleted file mode 100644 index 74c770d89..000000000 Binary files a/public/img/emoji/clock8.png and /dev/null differ diff --git a/public/img/emoji/clock830.png b/public/img/emoji/clock830.png deleted file mode 100644 index f58f3dadd..000000000 Binary files a/public/img/emoji/clock830.png and /dev/null differ diff --git a/public/img/emoji/clock9.png b/public/img/emoji/clock9.png deleted file mode 100644 index f009d14ac..000000000 Binary files a/public/img/emoji/clock9.png and /dev/null differ diff --git a/public/img/emoji/clock930.png b/public/img/emoji/clock930.png deleted file mode 100644 index fd3522142..000000000 Binary files a/public/img/emoji/clock930.png and /dev/null differ diff --git a/public/img/emoji/closed_book.png b/public/img/emoji/closed_book.png deleted file mode 100644 index 484029c5e..000000000 Binary files a/public/img/emoji/closed_book.png and /dev/null differ diff --git a/public/img/emoji/closed_lock_with_key.png b/public/img/emoji/closed_lock_with_key.png deleted file mode 100644 index e6fdf6cb2..000000000 Binary files a/public/img/emoji/closed_lock_with_key.png and /dev/null differ diff --git a/public/img/emoji/closed_umbrella.png b/public/img/emoji/closed_umbrella.png deleted file mode 100644 index 0b719f086..000000000 Binary files a/public/img/emoji/closed_umbrella.png and /dev/null differ diff --git a/public/img/emoji/cloud.png b/public/img/emoji/cloud.png deleted file mode 100644 index b31c08c0b..000000000 Binary files a/public/img/emoji/cloud.png and /dev/null differ diff --git a/public/img/emoji/clubs.png b/public/img/emoji/clubs.png deleted file mode 100644 index bfab53656..000000000 Binary files a/public/img/emoji/clubs.png and /dev/null differ diff --git a/public/img/emoji/cn.png b/public/img/emoji/cn.png deleted file mode 100644 index b30dcc53d..000000000 Binary files a/public/img/emoji/cn.png and /dev/null differ diff --git a/public/img/emoji/cocktail.png b/public/img/emoji/cocktail.png deleted file mode 100644 index 28b45ea51..000000000 Binary files a/public/img/emoji/cocktail.png and /dev/null differ diff --git a/public/img/emoji/coffee.png b/public/img/emoji/coffee.png deleted file mode 100644 index 57e1adcb0..000000000 Binary files a/public/img/emoji/coffee.png and /dev/null differ diff --git a/public/img/emoji/cold_sweat.png b/public/img/emoji/cold_sweat.png deleted file mode 100644 index b9e39bc60..000000000 Binary files a/public/img/emoji/cold_sweat.png and /dev/null differ diff --git a/public/img/emoji/collision.png b/public/img/emoji/collision.png deleted file mode 100644 index 9d5bd0401..000000000 Binary files a/public/img/emoji/collision.png and /dev/null differ diff --git a/public/img/emoji/computer.png b/public/img/emoji/computer.png deleted file mode 100644 index d4d268762..000000000 Binary files a/public/img/emoji/computer.png and /dev/null differ diff --git a/public/img/emoji/confetti_ball.png b/public/img/emoji/confetti_ball.png deleted file mode 100644 index bd293e3d8..000000000 Binary files a/public/img/emoji/confetti_ball.png and /dev/null differ diff --git a/public/img/emoji/confounded.png b/public/img/emoji/confounded.png deleted file mode 100644 index 762c3766a..000000000 Binary files a/public/img/emoji/confounded.png and /dev/null differ diff --git a/public/img/emoji/confused.png b/public/img/emoji/confused.png deleted file mode 100644 index 8dc494db0..000000000 Binary files a/public/img/emoji/confused.png and /dev/null differ diff --git a/public/img/emoji/congratulations.png b/public/img/emoji/congratulations.png deleted file mode 100644 index 85814e33c..000000000 Binary files a/public/img/emoji/congratulations.png and /dev/null differ diff --git a/public/img/emoji/construction.png b/public/img/emoji/construction.png deleted file mode 100644 index 523e9f10b..000000000 Binary files a/public/img/emoji/construction.png and /dev/null differ diff --git a/public/img/emoji/construction_worker.png b/public/img/emoji/construction_worker.png deleted file mode 100644 index 4d6486047..000000000 Binary files a/public/img/emoji/construction_worker.png and /dev/null differ diff --git a/public/img/emoji/convenience_store.png b/public/img/emoji/convenience_store.png deleted file mode 100644 index 671696c2d..000000000 Binary files a/public/img/emoji/convenience_store.png and /dev/null differ diff --git a/public/img/emoji/cookie.png b/public/img/emoji/cookie.png deleted file mode 100644 index 653edb258..000000000 Binary files a/public/img/emoji/cookie.png and /dev/null differ diff --git a/public/img/emoji/cool.png b/public/img/emoji/cool.png deleted file mode 100644 index 937dcd792..000000000 Binary files a/public/img/emoji/cool.png and /dev/null differ diff --git a/public/img/emoji/cop.png b/public/img/emoji/cop.png deleted file mode 100644 index 43a5a84f8..000000000 Binary files a/public/img/emoji/cop.png and /dev/null differ diff --git a/public/img/emoji/copyright.png b/public/img/emoji/copyright.png deleted file mode 100644 index 38493c33f..000000000 Binary files a/public/img/emoji/copyright.png and /dev/null differ diff --git a/public/img/emoji/corn.png b/public/img/emoji/corn.png deleted file mode 100644 index fe5d8b128..000000000 Binary files a/public/img/emoji/corn.png and /dev/null differ diff --git a/public/img/emoji/couple.png b/public/img/emoji/couple.png deleted file mode 100644 index 9e51f40e1..000000000 Binary files a/public/img/emoji/couple.png and /dev/null differ diff --git a/public/img/emoji/couple_with_heart.png b/public/img/emoji/couple_with_heart.png deleted file mode 100644 index c503f40a9..000000000 Binary files a/public/img/emoji/couple_with_heart.png and /dev/null differ diff --git a/public/img/emoji/couplekiss.png b/public/img/emoji/couplekiss.png deleted file mode 100644 index d02790822..000000000 Binary files a/public/img/emoji/couplekiss.png and /dev/null differ diff --git a/public/img/emoji/cow.png b/public/img/emoji/cow.png deleted file mode 100644 index 12e1ab6c0..000000000 Binary files a/public/img/emoji/cow.png and /dev/null differ diff --git a/public/img/emoji/cow2.png b/public/img/emoji/cow2.png deleted file mode 100644 index 594c92155..000000000 Binary files a/public/img/emoji/cow2.png and /dev/null differ diff --git a/public/img/emoji/credit_card.png b/public/img/emoji/credit_card.png deleted file mode 100644 index be1c1dd30..000000000 Binary files a/public/img/emoji/credit_card.png and /dev/null differ diff --git a/public/img/emoji/crescent_moon.png b/public/img/emoji/crescent_moon.png deleted file mode 100644 index afdb450d1..000000000 Binary files a/public/img/emoji/crescent_moon.png and /dev/null differ diff --git a/public/img/emoji/crocodile.png b/public/img/emoji/crocodile.png deleted file mode 100644 index 7435d5ab3..000000000 Binary files a/public/img/emoji/crocodile.png and /dev/null differ diff --git a/public/img/emoji/crossed_flags.png b/public/img/emoji/crossed_flags.png deleted file mode 100644 index 2397bcd0f..000000000 Binary files a/public/img/emoji/crossed_flags.png and /dev/null differ diff --git a/public/img/emoji/crown.png b/public/img/emoji/crown.png deleted file mode 100644 index 39da1d528..000000000 Binary files a/public/img/emoji/crown.png and /dev/null differ diff --git a/public/img/emoji/cry.png b/public/img/emoji/cry.png deleted file mode 100644 index 6d0d9afd2..000000000 Binary files a/public/img/emoji/cry.png and /dev/null differ diff --git a/public/img/emoji/crying_cat_face.png b/public/img/emoji/crying_cat_face.png deleted file mode 100644 index 42d4c27ca..000000000 Binary files a/public/img/emoji/crying_cat_face.png and /dev/null differ diff --git a/public/img/emoji/crystal_ball.png b/public/img/emoji/crystal_ball.png deleted file mode 100644 index 6d2c6c42d..000000000 Binary files a/public/img/emoji/crystal_ball.png and /dev/null differ diff --git a/public/img/emoji/cupid.png b/public/img/emoji/cupid.png deleted file mode 100644 index 498728476..000000000 Binary files a/public/img/emoji/cupid.png and /dev/null differ diff --git a/public/img/emoji/curly_loop.png b/public/img/emoji/curly_loop.png deleted file mode 100644 index 7dd841d00..000000000 Binary files a/public/img/emoji/curly_loop.png and /dev/null differ diff --git a/public/img/emoji/currency_exchange.png b/public/img/emoji/currency_exchange.png deleted file mode 100644 index 6ebebe70a..000000000 Binary files a/public/img/emoji/currency_exchange.png and /dev/null differ diff --git a/public/img/emoji/curry.png b/public/img/emoji/curry.png deleted file mode 100644 index 7983c706a..000000000 Binary files a/public/img/emoji/curry.png and /dev/null differ diff --git a/public/img/emoji/custard.png b/public/img/emoji/custard.png deleted file mode 100644 index 9f843b4c1..000000000 Binary files a/public/img/emoji/custard.png and /dev/null differ diff --git a/public/img/emoji/customs.png b/public/img/emoji/customs.png deleted file mode 100644 index 92691e311..000000000 Binary files a/public/img/emoji/customs.png and /dev/null differ diff --git a/public/img/emoji/cyclone.png b/public/img/emoji/cyclone.png deleted file mode 100644 index 5fd2e4512..000000000 Binary files a/public/img/emoji/cyclone.png and /dev/null differ diff --git a/public/img/emoji/dancer.png b/public/img/emoji/dancer.png deleted file mode 100644 index 7a7bf59f1..000000000 Binary files a/public/img/emoji/dancer.png and /dev/null differ diff --git a/public/img/emoji/dancers.png b/public/img/emoji/dancers.png deleted file mode 100644 index 2dfb451a7..000000000 Binary files a/public/img/emoji/dancers.png and /dev/null differ diff --git a/public/img/emoji/dango.png b/public/img/emoji/dango.png deleted file mode 100644 index 2d042aebe..000000000 Binary files a/public/img/emoji/dango.png and /dev/null differ diff --git a/public/img/emoji/dart.png b/public/img/emoji/dart.png deleted file mode 100644 index 5f16864cb..000000000 Binary files a/public/img/emoji/dart.png and /dev/null differ diff --git a/public/img/emoji/dash.png b/public/img/emoji/dash.png deleted file mode 100644 index dc2c0a8f4..000000000 Binary files a/public/img/emoji/dash.png and /dev/null differ diff --git a/public/img/emoji/date.png b/public/img/emoji/date.png deleted file mode 100644 index 6ad2efa5f..000000000 Binary files a/public/img/emoji/date.png and /dev/null differ diff --git a/public/img/emoji/de.png b/public/img/emoji/de.png deleted file mode 100644 index 16a28548c..000000000 Binary files a/public/img/emoji/de.png and /dev/null differ diff --git a/public/img/emoji/deciduous_tree.png b/public/img/emoji/deciduous_tree.png deleted file mode 100644 index 3fdf8c007..000000000 Binary files a/public/img/emoji/deciduous_tree.png and /dev/null differ diff --git a/public/img/emoji/department_store.png b/public/img/emoji/department_store.png deleted file mode 100644 index 68d959c50..000000000 Binary files a/public/img/emoji/department_store.png and /dev/null differ diff --git a/public/img/emoji/diamond_shape_with_a_dot_inside.png b/public/img/emoji/diamond_shape_with_a_dot_inside.png deleted file mode 100644 index dfd1098b3..000000000 Binary files a/public/img/emoji/diamond_shape_with_a_dot_inside.png and /dev/null differ diff --git a/public/img/emoji/diamonds.png b/public/img/emoji/diamonds.png deleted file mode 100644 index fe0827758..000000000 Binary files a/public/img/emoji/diamonds.png and /dev/null differ diff --git a/public/img/emoji/disappointed.png b/public/img/emoji/disappointed.png deleted file mode 100644 index 825520087..000000000 Binary files a/public/img/emoji/disappointed.png and /dev/null differ diff --git a/public/img/emoji/disappointed_relieved.png b/public/img/emoji/disappointed_relieved.png deleted file mode 100644 index fa5f9e7f9..000000000 Binary files a/public/img/emoji/disappointed_relieved.png and /dev/null differ diff --git a/public/img/emoji/dizzy.png b/public/img/emoji/dizzy.png deleted file mode 100644 index 3702b6131..000000000 Binary files a/public/img/emoji/dizzy.png and /dev/null differ diff --git a/public/img/emoji/dizzy_face.png b/public/img/emoji/dizzy_face.png deleted file mode 100644 index 8001d6ff8..000000000 Binary files a/public/img/emoji/dizzy_face.png and /dev/null differ diff --git a/public/img/emoji/do_not_litter.png b/public/img/emoji/do_not_litter.png deleted file mode 100644 index 38c7ae7af..000000000 Binary files a/public/img/emoji/do_not_litter.png and /dev/null differ diff --git a/public/img/emoji/dog.png b/public/img/emoji/dog.png deleted file mode 100644 index 389a02bf2..000000000 Binary files a/public/img/emoji/dog.png and /dev/null differ diff --git a/public/img/emoji/dog2.png b/public/img/emoji/dog2.png deleted file mode 100644 index c7f6a24ac..000000000 Binary files a/public/img/emoji/dog2.png and /dev/null differ diff --git a/public/img/emoji/dollar.png b/public/img/emoji/dollar.png deleted file mode 100644 index 63de88495..000000000 Binary files a/public/img/emoji/dollar.png and /dev/null differ diff --git a/public/img/emoji/dolls.png b/public/img/emoji/dolls.png deleted file mode 100644 index 47ce33900..000000000 Binary files a/public/img/emoji/dolls.png and /dev/null differ diff --git a/public/img/emoji/dolphin.png b/public/img/emoji/dolphin.png deleted file mode 100644 index 9326077a9..000000000 Binary files a/public/img/emoji/dolphin.png and /dev/null differ diff --git a/public/img/emoji/donut.png b/public/img/emoji/donut.png deleted file mode 100644 index ccf869129..000000000 Binary files a/public/img/emoji/donut.png and /dev/null differ diff --git a/public/img/emoji/door.png b/public/img/emoji/door.png deleted file mode 100644 index 83c819ae4..000000000 Binary files a/public/img/emoji/door.png and /dev/null differ diff --git a/public/img/emoji/doughnut.png b/public/img/emoji/doughnut.png deleted file mode 100644 index ccf869129..000000000 Binary files a/public/img/emoji/doughnut.png and /dev/null differ diff --git a/public/img/emoji/dragon.png b/public/img/emoji/dragon.png deleted file mode 100644 index 88d4784b8..000000000 Binary files a/public/img/emoji/dragon.png and /dev/null differ diff --git a/public/img/emoji/dragon_face.png b/public/img/emoji/dragon_face.png deleted file mode 100644 index e5e556bd1..000000000 Binary files a/public/img/emoji/dragon_face.png and /dev/null differ diff --git a/public/img/emoji/dress.png b/public/img/emoji/dress.png deleted file mode 100644 index 6434e2e2f..000000000 Binary files a/public/img/emoji/dress.png and /dev/null differ diff --git a/public/img/emoji/dromedary_camel.png b/public/img/emoji/dromedary_camel.png deleted file mode 100644 index c8c7b9ffa..000000000 Binary files a/public/img/emoji/dromedary_camel.png and /dev/null differ diff --git a/public/img/emoji/droplet.png b/public/img/emoji/droplet.png deleted file mode 100644 index cae7f4951..000000000 Binary files a/public/img/emoji/droplet.png and /dev/null differ diff --git a/public/img/emoji/dvd.png b/public/img/emoji/dvd.png deleted file mode 100644 index 363c83d01..000000000 Binary files a/public/img/emoji/dvd.png and /dev/null differ diff --git a/public/img/emoji/e-mail.png b/public/img/emoji/e-mail.png deleted file mode 100644 index 176a8e1e8..000000000 Binary files a/public/img/emoji/e-mail.png and /dev/null differ diff --git a/public/img/emoji/ear.png b/public/img/emoji/ear.png deleted file mode 100644 index 2bbbf10c9..000000000 Binary files a/public/img/emoji/ear.png and /dev/null differ diff --git a/public/img/emoji/ear_of_rice.png b/public/img/emoji/ear_of_rice.png deleted file mode 100644 index a9bba5c2c..000000000 Binary files a/public/img/emoji/ear_of_rice.png and /dev/null differ diff --git a/public/img/emoji/earth_africa.png b/public/img/emoji/earth_africa.png deleted file mode 100644 index 44ce5ecb6..000000000 Binary files a/public/img/emoji/earth_africa.png and /dev/null differ diff --git a/public/img/emoji/earth_americas.png b/public/img/emoji/earth_americas.png deleted file mode 100644 index 97d717671..000000000 Binary files a/public/img/emoji/earth_americas.png and /dev/null differ diff --git a/public/img/emoji/earth_asia.png b/public/img/emoji/earth_asia.png deleted file mode 100644 index 95ec357ca..000000000 Binary files a/public/img/emoji/earth_asia.png and /dev/null differ diff --git a/public/img/emoji/egg.png b/public/img/emoji/egg.png deleted file mode 100644 index c3de6ae4e..000000000 Binary files a/public/img/emoji/egg.png and /dev/null differ diff --git a/public/img/emoji/eggplant.png b/public/img/emoji/eggplant.png deleted file mode 100644 index 66f25fce4..000000000 Binary files a/public/img/emoji/eggplant.png and /dev/null differ diff --git a/public/img/emoji/eight.png b/public/img/emoji/eight.png deleted file mode 100644 index 7bdb42232..000000000 Binary files a/public/img/emoji/eight.png and /dev/null differ diff --git a/public/img/emoji/eight_pointed_black_star.png b/public/img/emoji/eight_pointed_black_star.png deleted file mode 100644 index 2420a7768..000000000 Binary files a/public/img/emoji/eight_pointed_black_star.png and /dev/null differ diff --git a/public/img/emoji/eight_spoked_asterisk.png b/public/img/emoji/eight_spoked_asterisk.png deleted file mode 100644 index 946a20333..000000000 Binary files a/public/img/emoji/eight_spoked_asterisk.png and /dev/null differ diff --git a/public/img/emoji/electric_plug.png b/public/img/emoji/electric_plug.png deleted file mode 100644 index 2837bab4f..000000000 Binary files a/public/img/emoji/electric_plug.png and /dev/null differ diff --git a/public/img/emoji/elephant.png b/public/img/emoji/elephant.png deleted file mode 100644 index 5ca04570e..000000000 Binary files a/public/img/emoji/elephant.png and /dev/null differ diff --git a/public/img/emoji/email.png b/public/img/emoji/email.png deleted file mode 100644 index 0e01fd5f0..000000000 Binary files a/public/img/emoji/email.png and /dev/null differ diff --git a/public/img/emoji/end.png b/public/img/emoji/end.png deleted file mode 100644 index 61a4399ad..000000000 Binary files a/public/img/emoji/end.png and /dev/null differ diff --git a/public/img/emoji/envelope.png b/public/img/emoji/envelope.png deleted file mode 100644 index 3631861bb..000000000 Binary files a/public/img/emoji/envelope.png and /dev/null differ diff --git a/public/img/emoji/es.png b/public/img/emoji/es.png deleted file mode 100644 index 71b30bff3..000000000 Binary files a/public/img/emoji/es.png and /dev/null differ diff --git a/public/img/emoji/euro.png b/public/img/emoji/euro.png deleted file mode 100644 index 1c5904b71..000000000 Binary files a/public/img/emoji/euro.png and /dev/null differ diff --git a/public/img/emoji/european_castle.png b/public/img/emoji/european_castle.png deleted file mode 100644 index 8229b8a8a..000000000 Binary files a/public/img/emoji/european_castle.png and /dev/null differ diff --git a/public/img/emoji/european_post_office.png b/public/img/emoji/european_post_office.png deleted file mode 100644 index 0f65b1453..000000000 Binary files a/public/img/emoji/european_post_office.png and /dev/null differ diff --git a/public/img/emoji/evergreen_tree.png b/public/img/emoji/evergreen_tree.png deleted file mode 100644 index ae8ad1037..000000000 Binary files a/public/img/emoji/evergreen_tree.png and /dev/null differ diff --git a/public/img/emoji/exclamation.png b/public/img/emoji/exclamation.png deleted file mode 100644 index 77bbdeabc..000000000 Binary files a/public/img/emoji/exclamation.png and /dev/null differ diff --git a/public/img/emoji/expressionless.png b/public/img/emoji/expressionless.png deleted file mode 100644 index 913ff4e2f..000000000 Binary files a/public/img/emoji/expressionless.png and /dev/null differ diff --git a/public/img/emoji/eyeglasses.png b/public/img/emoji/eyeglasses.png deleted file mode 100644 index a3cf75a27..000000000 Binary files a/public/img/emoji/eyeglasses.png and /dev/null differ diff --git a/public/img/emoji/eyes.png b/public/img/emoji/eyes.png deleted file mode 100644 index 1ac24a615..000000000 Binary files a/public/img/emoji/eyes.png and /dev/null differ diff --git a/public/img/emoji/facepunch.png b/public/img/emoji/facepunch.png deleted file mode 100644 index 277047b7c..000000000 Binary files a/public/img/emoji/facepunch.png and /dev/null differ diff --git a/public/img/emoji/factory.png b/public/img/emoji/factory.png deleted file mode 100644 index 640463479..000000000 Binary files a/public/img/emoji/factory.png and /dev/null differ diff --git a/public/img/emoji/fallen_leaf.png b/public/img/emoji/fallen_leaf.png deleted file mode 100644 index d49f9c175..000000000 Binary files a/public/img/emoji/fallen_leaf.png and /dev/null differ diff --git a/public/img/emoji/family.png b/public/img/emoji/family.png deleted file mode 100644 index b4b365f3a..000000000 Binary files a/public/img/emoji/family.png and /dev/null differ diff --git a/public/img/emoji/fast_forward.png b/public/img/emoji/fast_forward.png deleted file mode 100644 index 8830e146e..000000000 Binary files a/public/img/emoji/fast_forward.png and /dev/null differ diff --git a/public/img/emoji/fax.png b/public/img/emoji/fax.png deleted file mode 100644 index 62be2c958..000000000 Binary files a/public/img/emoji/fax.png and /dev/null differ diff --git a/public/img/emoji/fearful.png b/public/img/emoji/fearful.png deleted file mode 100644 index 513fce47b..000000000 Binary files a/public/img/emoji/fearful.png and /dev/null differ diff --git a/public/img/emoji/feelsgood.png b/public/img/emoji/feelsgood.png deleted file mode 100644 index 361f969bc..000000000 Binary files a/public/img/emoji/feelsgood.png and /dev/null differ diff --git a/public/img/emoji/feet.png b/public/img/emoji/feet.png deleted file mode 100644 index 1b0147b1d..000000000 Binary files a/public/img/emoji/feet.png and /dev/null differ diff --git a/public/img/emoji/ferris_wheel.png b/public/img/emoji/ferris_wheel.png deleted file mode 100644 index 54a1dcfa1..000000000 Binary files a/public/img/emoji/ferris_wheel.png and /dev/null differ diff --git a/public/img/emoji/file_folder.png b/public/img/emoji/file_folder.png deleted file mode 100644 index 4d8bebf8a..000000000 Binary files a/public/img/emoji/file_folder.png and /dev/null differ diff --git a/public/img/emoji/finnadie.png b/public/img/emoji/finnadie.png deleted file mode 100644 index bfc5a0d93..000000000 Binary files a/public/img/emoji/finnadie.png and /dev/null differ diff --git a/public/img/emoji/fire.png b/public/img/emoji/fire.png deleted file mode 100644 index f2a3149bb..000000000 Binary files a/public/img/emoji/fire.png and /dev/null differ diff --git a/public/img/emoji/fire_engine.png b/public/img/emoji/fire_engine.png deleted file mode 100644 index 9e6c59c99..000000000 Binary files a/public/img/emoji/fire_engine.png and /dev/null differ diff --git a/public/img/emoji/fireworks.png b/public/img/emoji/fireworks.png deleted file mode 100644 index b4eccd577..000000000 Binary files a/public/img/emoji/fireworks.png and /dev/null differ diff --git a/public/img/emoji/first_quarter_moon.png b/public/img/emoji/first_quarter_moon.png deleted file mode 100644 index f38c23693..000000000 Binary files a/public/img/emoji/first_quarter_moon.png and /dev/null differ diff --git a/public/img/emoji/first_quarter_moon_with_face.png b/public/img/emoji/first_quarter_moon_with_face.png deleted file mode 100644 index 85ae2ce72..000000000 Binary files a/public/img/emoji/first_quarter_moon_with_face.png and /dev/null differ diff --git a/public/img/emoji/fish.png b/public/img/emoji/fish.png deleted file mode 100644 index 90bdda2c9..000000000 Binary files a/public/img/emoji/fish.png and /dev/null differ diff --git a/public/img/emoji/fish_cake.png b/public/img/emoji/fish_cake.png deleted file mode 100644 index a8f22614d..000000000 Binary files a/public/img/emoji/fish_cake.png and /dev/null differ diff --git a/public/img/emoji/fishing_pole_and_fish.png b/public/img/emoji/fishing_pole_and_fish.png deleted file mode 100644 index d84609c3b..000000000 Binary files a/public/img/emoji/fishing_pole_and_fish.png and /dev/null differ diff --git a/public/img/emoji/fist.png b/public/img/emoji/fist.png deleted file mode 100644 index ecc8874c2..000000000 Binary files a/public/img/emoji/fist.png and /dev/null differ diff --git a/public/img/emoji/five.png b/public/img/emoji/five.png deleted file mode 100644 index 794321aa2..000000000 Binary files a/public/img/emoji/five.png and /dev/null differ diff --git a/public/img/emoji/flags.png b/public/img/emoji/flags.png deleted file mode 100644 index 540164e84..000000000 Binary files a/public/img/emoji/flags.png and /dev/null differ diff --git a/public/img/emoji/flashlight.png b/public/img/emoji/flashlight.png deleted file mode 100644 index 215940aa8..000000000 Binary files a/public/img/emoji/flashlight.png and /dev/null differ diff --git a/public/img/emoji/floppy_disk.png b/public/img/emoji/floppy_disk.png deleted file mode 100644 index 4ad56315a..000000000 Binary files a/public/img/emoji/floppy_disk.png and /dev/null differ diff --git a/public/img/emoji/flower_playing_cards.png b/public/img/emoji/flower_playing_cards.png deleted file mode 100644 index cc46a6a1f..000000000 Binary files a/public/img/emoji/flower_playing_cards.png and /dev/null differ diff --git a/public/img/emoji/flushed.png b/public/img/emoji/flushed.png deleted file mode 100644 index 74b78c9c0..000000000 Binary files a/public/img/emoji/flushed.png and /dev/null differ diff --git a/public/img/emoji/foggy.png b/public/img/emoji/foggy.png deleted file mode 100644 index 3c7b8b04b..000000000 Binary files a/public/img/emoji/foggy.png and /dev/null differ diff --git a/public/img/emoji/football.png b/public/img/emoji/football.png deleted file mode 100644 index 0e4e168fa..000000000 Binary files a/public/img/emoji/football.png and /dev/null differ diff --git a/public/img/emoji/fork_and_knife.png b/public/img/emoji/fork_and_knife.png deleted file mode 100644 index 8ba4bc653..000000000 Binary files a/public/img/emoji/fork_and_knife.png and /dev/null differ diff --git a/public/img/emoji/fountain.png b/public/img/emoji/fountain.png deleted file mode 100644 index da126e648..000000000 Binary files a/public/img/emoji/fountain.png and /dev/null differ diff --git a/public/img/emoji/four.png b/public/img/emoji/four.png deleted file mode 100644 index 14782ba23..000000000 Binary files a/public/img/emoji/four.png and /dev/null differ diff --git a/public/img/emoji/four_leaf_clover.png b/public/img/emoji/four_leaf_clover.png deleted file mode 100644 index f2014bea4..000000000 Binary files a/public/img/emoji/four_leaf_clover.png and /dev/null differ diff --git a/public/img/emoji/fr.png b/public/img/emoji/fr.png deleted file mode 100644 index 6311c9115..000000000 Binary files a/public/img/emoji/fr.png and /dev/null differ diff --git a/public/img/emoji/free.png b/public/img/emoji/free.png deleted file mode 100644 index c886cf249..000000000 Binary files a/public/img/emoji/free.png and /dev/null differ diff --git a/public/img/emoji/fried_shrimp.png b/public/img/emoji/fried_shrimp.png deleted file mode 100644 index c8c284bf1..000000000 Binary files a/public/img/emoji/fried_shrimp.png and /dev/null differ diff --git a/public/img/emoji/fries.png b/public/img/emoji/fries.png deleted file mode 100644 index cfef66966..000000000 Binary files a/public/img/emoji/fries.png and /dev/null differ diff --git a/public/img/emoji/frog.png b/public/img/emoji/frog.png deleted file mode 100644 index cfe11b18f..000000000 Binary files a/public/img/emoji/frog.png and /dev/null differ diff --git a/public/img/emoji/frowning.png b/public/img/emoji/frowning.png deleted file mode 100644 index 487b77016..000000000 Binary files a/public/img/emoji/frowning.png and /dev/null differ diff --git a/public/img/emoji/fu.png b/public/img/emoji/fu.png deleted file mode 100644 index 61a3fee8d..000000000 Binary files a/public/img/emoji/fu.png and /dev/null differ diff --git a/public/img/emoji/fuelpump.png b/public/img/emoji/fuelpump.png deleted file mode 100644 index 54c29aeb1..000000000 Binary files a/public/img/emoji/fuelpump.png and /dev/null differ diff --git a/public/img/emoji/full_moon.png b/public/img/emoji/full_moon.png deleted file mode 100644 index 8ff657a25..000000000 Binary files a/public/img/emoji/full_moon.png and /dev/null differ diff --git a/public/img/emoji/full_moon_with_face.png b/public/img/emoji/full_moon_with_face.png deleted file mode 100644 index d42b3f0fb..000000000 Binary files a/public/img/emoji/full_moon_with_face.png and /dev/null differ diff --git a/public/img/emoji/game_die.png b/public/img/emoji/game_die.png deleted file mode 100644 index cff2bd8b7..000000000 Binary files a/public/img/emoji/game_die.png and /dev/null differ diff --git a/public/img/emoji/gb.png b/public/img/emoji/gb.png deleted file mode 100644 index 2a62c7a08..000000000 Binary files a/public/img/emoji/gb.png and /dev/null differ diff --git a/public/img/emoji/gem.png b/public/img/emoji/gem.png deleted file mode 100644 index 8a5d8dad5..000000000 Binary files a/public/img/emoji/gem.png and /dev/null differ diff --git a/public/img/emoji/gemini.png b/public/img/emoji/gemini.png deleted file mode 100644 index d926f6e88..000000000 Binary files a/public/img/emoji/gemini.png and /dev/null differ diff --git a/public/img/emoji/ghost.png b/public/img/emoji/ghost.png deleted file mode 100644 index 671dd0c9e..000000000 Binary files a/public/img/emoji/ghost.png and /dev/null differ diff --git a/public/img/emoji/gift.png b/public/img/emoji/gift.png deleted file mode 100644 index 552cfdc2b..000000000 Binary files a/public/img/emoji/gift.png and /dev/null differ diff --git a/public/img/emoji/gift_heart.png b/public/img/emoji/gift_heart.png deleted file mode 100644 index f31c26a3f..000000000 Binary files a/public/img/emoji/gift_heart.png and /dev/null differ diff --git a/public/img/emoji/girl.png b/public/img/emoji/girl.png deleted file mode 100644 index ea4126941..000000000 Binary files a/public/img/emoji/girl.png and /dev/null differ diff --git a/public/img/emoji/globe_with_meridians.png b/public/img/emoji/globe_with_meridians.png deleted file mode 100644 index b19864667..000000000 Binary files a/public/img/emoji/globe_with_meridians.png and /dev/null differ diff --git a/public/img/emoji/goat.png b/public/img/emoji/goat.png deleted file mode 100644 index 4be9cf304..000000000 Binary files a/public/img/emoji/goat.png and /dev/null differ diff --git a/public/img/emoji/goberserk.png b/public/img/emoji/goberserk.png deleted file mode 100644 index 59a742aaa..000000000 Binary files a/public/img/emoji/goberserk.png and /dev/null differ diff --git a/public/img/emoji/godmode.png b/public/img/emoji/godmode.png deleted file mode 100644 index 7e75ab208..000000000 Binary files a/public/img/emoji/godmode.png and /dev/null differ diff --git a/public/img/emoji/golf.png b/public/img/emoji/golf.png deleted file mode 100644 index cba2116a7..000000000 Binary files a/public/img/emoji/golf.png and /dev/null differ diff --git a/public/img/emoji/grapes.png b/public/img/emoji/grapes.png deleted file mode 100644 index 0f9f007a1..000000000 Binary files a/public/img/emoji/grapes.png and /dev/null differ diff --git a/public/img/emoji/green_apple.png b/public/img/emoji/green_apple.png deleted file mode 100644 index 337205cd1..000000000 Binary files a/public/img/emoji/green_apple.png and /dev/null differ diff --git a/public/img/emoji/green_book.png b/public/img/emoji/green_book.png deleted file mode 100644 index e86651e5c..000000000 Binary files a/public/img/emoji/green_book.png and /dev/null differ diff --git a/public/img/emoji/green_heart.png b/public/img/emoji/green_heart.png deleted file mode 100644 index 7289cb814..000000000 Binary files a/public/img/emoji/green_heart.png and /dev/null differ diff --git a/public/img/emoji/grey_exclamation.png b/public/img/emoji/grey_exclamation.png deleted file mode 100644 index cf027dda5..000000000 Binary files a/public/img/emoji/grey_exclamation.png and /dev/null differ diff --git a/public/img/emoji/grey_question.png b/public/img/emoji/grey_question.png deleted file mode 100644 index fb97ba752..000000000 Binary files a/public/img/emoji/grey_question.png and /dev/null differ diff --git a/public/img/emoji/grimacing.png b/public/img/emoji/grimacing.png deleted file mode 100644 index 1219ba7d3..000000000 Binary files a/public/img/emoji/grimacing.png and /dev/null differ diff --git a/public/img/emoji/grin.png b/public/img/emoji/grin.png deleted file mode 100644 index 591cfcef8..000000000 Binary files a/public/img/emoji/grin.png and /dev/null differ diff --git a/public/img/emoji/grinning.png b/public/img/emoji/grinning.png deleted file mode 100644 index 7e812b7ed..000000000 Binary files a/public/img/emoji/grinning.png and /dev/null differ diff --git a/public/img/emoji/guardsman.png b/public/img/emoji/guardsman.png deleted file mode 100644 index b67b335d6..000000000 Binary files a/public/img/emoji/guardsman.png and /dev/null differ diff --git a/public/img/emoji/guitar.png b/public/img/emoji/guitar.png deleted file mode 100644 index 2b7fa43c9..000000000 Binary files a/public/img/emoji/guitar.png and /dev/null differ diff --git a/public/img/emoji/gun.png b/public/img/emoji/gun.png deleted file mode 100644 index c49dc52c6..000000000 Binary files a/public/img/emoji/gun.png and /dev/null differ diff --git a/public/img/emoji/haircut.png b/public/img/emoji/haircut.png deleted file mode 100644 index 902d273f6..000000000 Binary files a/public/img/emoji/haircut.png and /dev/null differ diff --git a/public/img/emoji/hamburger.png b/public/img/emoji/hamburger.png deleted file mode 100644 index 9f1a3fdff..000000000 Binary files a/public/img/emoji/hamburger.png and /dev/null differ diff --git a/public/img/emoji/hammer.png b/public/img/emoji/hammer.png deleted file mode 100644 index 482b1c747..000000000 Binary files a/public/img/emoji/hammer.png and /dev/null differ diff --git a/public/img/emoji/hamster.png b/public/img/emoji/hamster.png deleted file mode 100644 index addfd2e6b..000000000 Binary files a/public/img/emoji/hamster.png and /dev/null differ diff --git a/public/img/emoji/hand.png b/public/img/emoji/hand.png deleted file mode 100644 index 5e45c25a5..000000000 Binary files a/public/img/emoji/hand.png and /dev/null differ diff --git a/public/img/emoji/handbag.png b/public/img/emoji/handbag.png deleted file mode 100644 index d7adf04dd..000000000 Binary files a/public/img/emoji/handbag.png and /dev/null differ diff --git a/public/img/emoji/hankey.png b/public/img/emoji/hankey.png deleted file mode 100644 index 73a4dc840..000000000 Binary files a/public/img/emoji/hankey.png and /dev/null differ diff --git a/public/img/emoji/hash.png b/public/img/emoji/hash.png deleted file mode 100644 index 6765d7d3c..000000000 Binary files a/public/img/emoji/hash.png and /dev/null differ diff --git a/public/img/emoji/hatched_chick.png b/public/img/emoji/hatched_chick.png deleted file mode 100644 index 39c25bc7c..000000000 Binary files a/public/img/emoji/hatched_chick.png and /dev/null differ diff --git a/public/img/emoji/hatching_chick.png b/public/img/emoji/hatching_chick.png deleted file mode 100644 index 005a55519..000000000 Binary files a/public/img/emoji/hatching_chick.png and /dev/null differ diff --git a/public/img/emoji/headphones.png b/public/img/emoji/headphones.png deleted file mode 100644 index ad83000e6..000000000 Binary files a/public/img/emoji/headphones.png and /dev/null differ diff --git a/public/img/emoji/hear_no_evil.png b/public/img/emoji/hear_no_evil.png deleted file mode 100644 index f97a1f9a0..000000000 Binary files a/public/img/emoji/hear_no_evil.png and /dev/null differ diff --git a/public/img/emoji/heart.png b/public/img/emoji/heart.png deleted file mode 100644 index 7d7790ce4..000000000 Binary files a/public/img/emoji/heart.png and /dev/null differ diff --git a/public/img/emoji/heart_decoration.png b/public/img/emoji/heart_decoration.png deleted file mode 100644 index b8be44db3..000000000 Binary files a/public/img/emoji/heart_decoration.png and /dev/null differ diff --git a/public/img/emoji/heart_eyes.png b/public/img/emoji/heart_eyes.png deleted file mode 100644 index 0e5794270..000000000 Binary files a/public/img/emoji/heart_eyes.png and /dev/null differ diff --git a/public/img/emoji/heart_eyes_cat.png b/public/img/emoji/heart_eyes_cat.png deleted file mode 100644 index eeba240e5..000000000 Binary files a/public/img/emoji/heart_eyes_cat.png and /dev/null differ diff --git a/public/img/emoji/heartbeat.png b/public/img/emoji/heartbeat.png deleted file mode 100644 index b6628f6fa..000000000 Binary files a/public/img/emoji/heartbeat.png and /dev/null differ diff --git a/public/img/emoji/heartpulse.png b/public/img/emoji/heartpulse.png deleted file mode 100644 index a7491cbea..000000000 Binary files a/public/img/emoji/heartpulse.png and /dev/null differ diff --git a/public/img/emoji/hearts.png b/public/img/emoji/hearts.png deleted file mode 100644 index e89471538..000000000 Binary files a/public/img/emoji/hearts.png and /dev/null differ diff --git a/public/img/emoji/heavy_check_mark.png b/public/img/emoji/heavy_check_mark.png deleted file mode 100644 index d0f010b4a..000000000 Binary files a/public/img/emoji/heavy_check_mark.png and /dev/null differ diff --git a/public/img/emoji/heavy_division_sign.png b/public/img/emoji/heavy_division_sign.png deleted file mode 100644 index e193fd252..000000000 Binary files a/public/img/emoji/heavy_division_sign.png and /dev/null differ diff --git a/public/img/emoji/heavy_dollar_sign.png b/public/img/emoji/heavy_dollar_sign.png deleted file mode 100644 index 5eddfc52b..000000000 Binary files a/public/img/emoji/heavy_dollar_sign.png and /dev/null differ diff --git a/public/img/emoji/heavy_exclamation_mark.png b/public/img/emoji/heavy_exclamation_mark.png deleted file mode 100644 index 4c560f5e3..000000000 Binary files a/public/img/emoji/heavy_exclamation_mark.png and /dev/null differ diff --git a/public/img/emoji/heavy_minus_sign.png b/public/img/emoji/heavy_minus_sign.png deleted file mode 100644 index 4a33f905a..000000000 Binary files a/public/img/emoji/heavy_minus_sign.png and /dev/null differ diff --git a/public/img/emoji/heavy_multiplication_x.png b/public/img/emoji/heavy_multiplication_x.png deleted file mode 100644 index 13d666078..000000000 Binary files a/public/img/emoji/heavy_multiplication_x.png and /dev/null differ diff --git a/public/img/emoji/heavy_plus_sign.png b/public/img/emoji/heavy_plus_sign.png deleted file mode 100644 index ade3c3a85..000000000 Binary files a/public/img/emoji/heavy_plus_sign.png and /dev/null differ diff --git a/public/img/emoji/helicopter.png b/public/img/emoji/helicopter.png deleted file mode 100644 index 8e82a0d58..000000000 Binary files a/public/img/emoji/helicopter.png and /dev/null differ diff --git a/public/img/emoji/herb.png b/public/img/emoji/herb.png deleted file mode 100644 index de1ff1b73..000000000 Binary files a/public/img/emoji/herb.png and /dev/null differ diff --git a/public/img/emoji/hibiscus.png b/public/img/emoji/hibiscus.png deleted file mode 100644 index 9365ae216..000000000 Binary files a/public/img/emoji/hibiscus.png and /dev/null differ diff --git a/public/img/emoji/high_brightness.png b/public/img/emoji/high_brightness.png deleted file mode 100644 index ba9de7d40..000000000 Binary files a/public/img/emoji/high_brightness.png and /dev/null differ diff --git a/public/img/emoji/high_heel.png b/public/img/emoji/high_heel.png deleted file mode 100644 index 525b6a0dd..000000000 Binary files a/public/img/emoji/high_heel.png and /dev/null differ diff --git a/public/img/emoji/hocho.png b/public/img/emoji/hocho.png deleted file mode 100644 index 3f05193c7..000000000 Binary files a/public/img/emoji/hocho.png and /dev/null differ diff --git a/public/img/emoji/honey_pot.png b/public/img/emoji/honey_pot.png deleted file mode 100644 index 73278898a..000000000 Binary files a/public/img/emoji/honey_pot.png and /dev/null differ diff --git a/public/img/emoji/honeybee.png b/public/img/emoji/honeybee.png deleted file mode 100644 index f53733953..000000000 Binary files a/public/img/emoji/honeybee.png and /dev/null differ diff --git a/public/img/emoji/horse.png b/public/img/emoji/horse.png deleted file mode 100644 index 78d580ad3..000000000 Binary files a/public/img/emoji/horse.png and /dev/null differ diff --git a/public/img/emoji/horse_racing.png b/public/img/emoji/horse_racing.png deleted file mode 100644 index e3bbaec1d..000000000 Binary files a/public/img/emoji/horse_racing.png and /dev/null differ diff --git a/public/img/emoji/hospital.png b/public/img/emoji/hospital.png deleted file mode 100644 index c05c49377..000000000 Binary files a/public/img/emoji/hospital.png and /dev/null differ diff --git a/public/img/emoji/hotel.png b/public/img/emoji/hotel.png deleted file mode 100644 index d29f276a1..000000000 Binary files a/public/img/emoji/hotel.png and /dev/null differ diff --git a/public/img/emoji/hotsprings.png b/public/img/emoji/hotsprings.png deleted file mode 100644 index a0bc9d75f..000000000 Binary files a/public/img/emoji/hotsprings.png and /dev/null differ diff --git a/public/img/emoji/hourglass.png b/public/img/emoji/hourglass.png deleted file mode 100644 index 405aab41b..000000000 Binary files a/public/img/emoji/hourglass.png and /dev/null differ diff --git a/public/img/emoji/hourglass_flowing_sand.png b/public/img/emoji/hourglass_flowing_sand.png deleted file mode 100644 index b68eb6957..000000000 Binary files a/public/img/emoji/hourglass_flowing_sand.png and /dev/null differ diff --git a/public/img/emoji/house.png b/public/img/emoji/house.png deleted file mode 100644 index 95b9ee094..000000000 Binary files a/public/img/emoji/house.png and /dev/null differ diff --git a/public/img/emoji/house_with_garden.png b/public/img/emoji/house_with_garden.png deleted file mode 100644 index 3338fb717..000000000 Binary files a/public/img/emoji/house_with_garden.png and /dev/null differ diff --git a/public/img/emoji/hurtrealbad.png b/public/img/emoji/hurtrealbad.png deleted file mode 100644 index 146ef1a6a..000000000 Binary files a/public/img/emoji/hurtrealbad.png and /dev/null differ diff --git a/public/img/emoji/hushed.png b/public/img/emoji/hushed.png deleted file mode 100644 index bbd2cd4bc..000000000 Binary files a/public/img/emoji/hushed.png and /dev/null differ diff --git a/public/img/emoji/ice_cream.png b/public/img/emoji/ice_cream.png deleted file mode 100644 index 190be0165..000000000 Binary files a/public/img/emoji/ice_cream.png and /dev/null differ diff --git a/public/img/emoji/icecream.png b/public/img/emoji/icecream.png deleted file mode 100644 index 871ce0976..000000000 Binary files a/public/img/emoji/icecream.png and /dev/null differ diff --git a/public/img/emoji/id.png b/public/img/emoji/id.png deleted file mode 100644 index 47437a76d..000000000 Binary files a/public/img/emoji/id.png and /dev/null differ diff --git a/public/img/emoji/ideograph_advantage.png b/public/img/emoji/ideograph_advantage.png deleted file mode 100644 index 3c1334d16..000000000 Binary files a/public/img/emoji/ideograph_advantage.png and /dev/null differ diff --git a/public/img/emoji/imp.png b/public/img/emoji/imp.png deleted file mode 100644 index fa7d9dc10..000000000 Binary files a/public/img/emoji/imp.png and /dev/null differ diff --git a/public/img/emoji/inbox_tray.png b/public/img/emoji/inbox_tray.png deleted file mode 100644 index e2df0f897..000000000 Binary files a/public/img/emoji/inbox_tray.png and /dev/null differ diff --git a/public/img/emoji/incoming_envelope.png b/public/img/emoji/incoming_envelope.png deleted file mode 100644 index afc827125..000000000 Binary files a/public/img/emoji/incoming_envelope.png and /dev/null differ diff --git a/public/img/emoji/information_desk_person.png b/public/img/emoji/information_desk_person.png deleted file mode 100644 index 52c0a50a3..000000000 Binary files a/public/img/emoji/information_desk_person.png and /dev/null differ diff --git a/public/img/emoji/information_source.png b/public/img/emoji/information_source.png deleted file mode 100644 index 9cb8b09b2..000000000 Binary files a/public/img/emoji/information_source.png and /dev/null differ diff --git a/public/img/emoji/innocent.png b/public/img/emoji/innocent.png deleted file mode 100644 index 503b614f8..000000000 Binary files a/public/img/emoji/innocent.png and /dev/null differ diff --git a/public/img/emoji/interrobang.png b/public/img/emoji/interrobang.png deleted file mode 100644 index 64304b9f5..000000000 Binary files a/public/img/emoji/interrobang.png and /dev/null differ diff --git a/public/img/emoji/iphone.png b/public/img/emoji/iphone.png deleted file mode 100644 index df007103b..000000000 Binary files a/public/img/emoji/iphone.png and /dev/null differ diff --git a/public/img/emoji/it.png b/public/img/emoji/it.png deleted file mode 100644 index 70bc9f324..000000000 Binary files a/public/img/emoji/it.png and /dev/null differ diff --git a/public/img/emoji/izakaya_lantern.png b/public/img/emoji/izakaya_lantern.png deleted file mode 100644 index 18730ad55..000000000 Binary files a/public/img/emoji/izakaya_lantern.png and /dev/null differ diff --git a/public/img/emoji/jack_o_lantern.png b/public/img/emoji/jack_o_lantern.png deleted file mode 100644 index 1f7667ea4..000000000 Binary files a/public/img/emoji/jack_o_lantern.png and /dev/null differ diff --git a/public/img/emoji/japan.png b/public/img/emoji/japan.png deleted file mode 100644 index 459328035..000000000 Binary files a/public/img/emoji/japan.png and /dev/null differ diff --git a/public/img/emoji/japanese_castle.png b/public/img/emoji/japanese_castle.png deleted file mode 100644 index f225ab217..000000000 Binary files a/public/img/emoji/japanese_castle.png and /dev/null differ diff --git a/public/img/emoji/japanese_goblin.png b/public/img/emoji/japanese_goblin.png deleted file mode 100644 index bd21b1875..000000000 Binary files a/public/img/emoji/japanese_goblin.png and /dev/null differ diff --git a/public/img/emoji/japanese_ogre.png b/public/img/emoji/japanese_ogre.png deleted file mode 100644 index e9f5471c9..000000000 Binary files a/public/img/emoji/japanese_ogre.png and /dev/null differ diff --git a/public/img/emoji/jeans.png b/public/img/emoji/jeans.png deleted file mode 100644 index d721cea54..000000000 Binary files a/public/img/emoji/jeans.png and /dev/null differ diff --git a/public/img/emoji/joy.png b/public/img/emoji/joy.png deleted file mode 100644 index 47df693d4..000000000 Binary files a/public/img/emoji/joy.png and /dev/null differ diff --git a/public/img/emoji/joy_cat.png b/public/img/emoji/joy_cat.png deleted file mode 100644 index 6c60cb0ef..000000000 Binary files a/public/img/emoji/joy_cat.png and /dev/null differ diff --git a/public/img/emoji/jp.png b/public/img/emoji/jp.png deleted file mode 100644 index b786efbbd..000000000 Binary files a/public/img/emoji/jp.png and /dev/null differ diff --git a/public/img/emoji/key.png b/public/img/emoji/key.png deleted file mode 100644 index 34673213f..000000000 Binary files a/public/img/emoji/key.png and /dev/null differ diff --git a/public/img/emoji/keycap_ten.png b/public/img/emoji/keycap_ten.png deleted file mode 100644 index 71dac1c1c..000000000 Binary files a/public/img/emoji/keycap_ten.png and /dev/null differ diff --git a/public/img/emoji/kimono.png b/public/img/emoji/kimono.png deleted file mode 100644 index 34ffe137d..000000000 Binary files a/public/img/emoji/kimono.png and /dev/null differ diff --git a/public/img/emoji/kiss.png b/public/img/emoji/kiss.png deleted file mode 100644 index 14fd9918d..000000000 Binary files a/public/img/emoji/kiss.png and /dev/null differ diff --git a/public/img/emoji/kissing.png b/public/img/emoji/kissing.png deleted file mode 100644 index f3c8dcd78..000000000 Binary files a/public/img/emoji/kissing.png and /dev/null differ diff --git a/public/img/emoji/kissing_cat.png b/public/img/emoji/kissing_cat.png deleted file mode 100644 index adc62fbe3..000000000 Binary files a/public/img/emoji/kissing_cat.png and /dev/null differ diff --git a/public/img/emoji/kissing_closed_eyes.png b/public/img/emoji/kissing_closed_eyes.png deleted file mode 100644 index 449de1970..000000000 Binary files a/public/img/emoji/kissing_closed_eyes.png and /dev/null differ diff --git a/public/img/emoji/kissing_face.png b/public/img/emoji/kissing_face.png deleted file mode 100644 index 449de1970..000000000 Binary files a/public/img/emoji/kissing_face.png and /dev/null differ diff --git a/public/img/emoji/kissing_heart.png b/public/img/emoji/kissing_heart.png deleted file mode 100644 index af9a80b7f..000000000 Binary files a/public/img/emoji/kissing_heart.png and /dev/null differ diff --git a/public/img/emoji/kissing_smiling_eyes.png b/public/img/emoji/kissing_smiling_eyes.png deleted file mode 100644 index 57f7b4935..000000000 Binary files a/public/img/emoji/kissing_smiling_eyes.png and /dev/null differ diff --git a/public/img/emoji/koala.png b/public/img/emoji/koala.png deleted file mode 100644 index e17bd3cf5..000000000 Binary files a/public/img/emoji/koala.png and /dev/null differ diff --git a/public/img/emoji/koko.png b/public/img/emoji/koko.png deleted file mode 100644 index 3bef28c9f..000000000 Binary files a/public/img/emoji/koko.png and /dev/null differ diff --git a/public/img/emoji/kr.png b/public/img/emoji/kr.png deleted file mode 100644 index b4c0c1b67..000000000 Binary files a/public/img/emoji/kr.png and /dev/null differ diff --git a/public/img/emoji/large_blue_circle.png b/public/img/emoji/large_blue_circle.png deleted file mode 100644 index a5b4ad4aa..000000000 Binary files a/public/img/emoji/large_blue_circle.png and /dev/null differ diff --git a/public/img/emoji/large_blue_diamond.png b/public/img/emoji/large_blue_diamond.png deleted file mode 100644 index f4598ec0f..000000000 Binary files a/public/img/emoji/large_blue_diamond.png and /dev/null differ diff --git a/public/img/emoji/large_orange_diamond.png b/public/img/emoji/large_orange_diamond.png deleted file mode 100644 index 803725aad..000000000 Binary files a/public/img/emoji/large_orange_diamond.png and /dev/null differ diff --git a/public/img/emoji/last_quarter_moon.png b/public/img/emoji/last_quarter_moon.png deleted file mode 100644 index 6ae30d6c2..000000000 Binary files a/public/img/emoji/last_quarter_moon.png and /dev/null differ diff --git a/public/img/emoji/last_quarter_moon_with_face.png b/public/img/emoji/last_quarter_moon_with_face.png deleted file mode 100644 index 9ece82dfe..000000000 Binary files a/public/img/emoji/last_quarter_moon_with_face.png and /dev/null differ diff --git a/public/img/emoji/laughing.png b/public/img/emoji/laughing.png deleted file mode 100644 index 11c91eb22..000000000 Binary files a/public/img/emoji/laughing.png and /dev/null differ diff --git a/public/img/emoji/leaves.png b/public/img/emoji/leaves.png deleted file mode 100644 index 5229e06bd..000000000 Binary files a/public/img/emoji/leaves.png and /dev/null differ diff --git a/public/img/emoji/ledger.png b/public/img/emoji/ledger.png deleted file mode 100644 index e4f72acea..000000000 Binary files a/public/img/emoji/ledger.png and /dev/null differ diff --git a/public/img/emoji/left_luggage.png b/public/img/emoji/left_luggage.png deleted file mode 100644 index 1c08b464d..000000000 Binary files a/public/img/emoji/left_luggage.png and /dev/null differ diff --git a/public/img/emoji/left_right_arrow.png b/public/img/emoji/left_right_arrow.png deleted file mode 100644 index b9fd11c51..000000000 Binary files a/public/img/emoji/left_right_arrow.png and /dev/null differ diff --git a/public/img/emoji/leftwards_arrow_with_hook.png b/public/img/emoji/leftwards_arrow_with_hook.png deleted file mode 100644 index bc45dfefd..000000000 Binary files a/public/img/emoji/leftwards_arrow_with_hook.png and /dev/null differ diff --git a/public/img/emoji/lemon.png b/public/img/emoji/lemon.png deleted file mode 100644 index 9814dc959..000000000 Binary files a/public/img/emoji/lemon.png and /dev/null differ diff --git a/public/img/emoji/leo.png b/public/img/emoji/leo.png deleted file mode 100644 index e025933b2..000000000 Binary files a/public/img/emoji/leo.png and /dev/null differ diff --git a/public/img/emoji/leopard.png b/public/img/emoji/leopard.png deleted file mode 100644 index 3e738d2d3..000000000 Binary files a/public/img/emoji/leopard.png and /dev/null differ diff --git a/public/img/emoji/libra.png b/public/img/emoji/libra.png deleted file mode 100644 index 6f4a927cd..000000000 Binary files a/public/img/emoji/libra.png and /dev/null differ diff --git a/public/img/emoji/light_rail.png b/public/img/emoji/light_rail.png deleted file mode 100644 index bcfe801ee..000000000 Binary files a/public/img/emoji/light_rail.png and /dev/null differ diff --git a/public/img/emoji/link.png b/public/img/emoji/link.png deleted file mode 100644 index 0239e48e4..000000000 Binary files a/public/img/emoji/link.png and /dev/null differ diff --git a/public/img/emoji/lips.png b/public/img/emoji/lips.png deleted file mode 100644 index 826ed1102..000000000 Binary files a/public/img/emoji/lips.png and /dev/null differ diff --git a/public/img/emoji/lipstick.png b/public/img/emoji/lipstick.png deleted file mode 100644 index 82f990c56..000000000 Binary files a/public/img/emoji/lipstick.png and /dev/null differ diff --git a/public/img/emoji/lock.png b/public/img/emoji/lock.png deleted file mode 100644 index 4892b0235..000000000 Binary files a/public/img/emoji/lock.png and /dev/null differ diff --git a/public/img/emoji/lock_with_ink_pen.png b/public/img/emoji/lock_with_ink_pen.png deleted file mode 100644 index 375e67e82..000000000 Binary files a/public/img/emoji/lock_with_ink_pen.png and /dev/null differ diff --git a/public/img/emoji/lollipop.png b/public/img/emoji/lollipop.png deleted file mode 100644 index ba55e7093..000000000 Binary files a/public/img/emoji/lollipop.png and /dev/null differ diff --git a/public/img/emoji/loop.png b/public/img/emoji/loop.png deleted file mode 100644 index ef34df3a4..000000000 Binary files a/public/img/emoji/loop.png and /dev/null differ diff --git a/public/img/emoji/loudspeaker.png b/public/img/emoji/loudspeaker.png deleted file mode 100644 index 752385e52..000000000 Binary files a/public/img/emoji/loudspeaker.png and /dev/null differ diff --git a/public/img/emoji/love_hotel.png b/public/img/emoji/love_hotel.png deleted file mode 100644 index 44d7db828..000000000 Binary files a/public/img/emoji/love_hotel.png and /dev/null differ diff --git a/public/img/emoji/love_letter.png b/public/img/emoji/love_letter.png deleted file mode 100644 index e29981f44..000000000 Binary files a/public/img/emoji/love_letter.png and /dev/null differ diff --git a/public/img/emoji/low_brightness.png b/public/img/emoji/low_brightness.png deleted file mode 100644 index ea15bde4f..000000000 Binary files a/public/img/emoji/low_brightness.png and /dev/null differ diff --git a/public/img/emoji/m.png b/public/img/emoji/m.png deleted file mode 100644 index 7e3a3bffb..000000000 Binary files a/public/img/emoji/m.png and /dev/null differ diff --git a/public/img/emoji/mag.png b/public/img/emoji/mag.png deleted file mode 100644 index aa5b1d7c4..000000000 Binary files a/public/img/emoji/mag.png and /dev/null differ diff --git a/public/img/emoji/mag_right.png b/public/img/emoji/mag_right.png deleted file mode 100644 index 6e6cf11e6..000000000 Binary files a/public/img/emoji/mag_right.png and /dev/null differ diff --git a/public/img/emoji/mahjong.png b/public/img/emoji/mahjong.png deleted file mode 100644 index f51ce65fd..000000000 Binary files a/public/img/emoji/mahjong.png and /dev/null differ diff --git a/public/img/emoji/mailbox.png b/public/img/emoji/mailbox.png deleted file mode 100644 index 8351e7076..000000000 Binary files a/public/img/emoji/mailbox.png and /dev/null differ diff --git a/public/img/emoji/mailbox_closed.png b/public/img/emoji/mailbox_closed.png deleted file mode 100644 index a5982b69b..000000000 Binary files a/public/img/emoji/mailbox_closed.png and /dev/null differ diff --git a/public/img/emoji/mailbox_with_mail.png b/public/img/emoji/mailbox_with_mail.png deleted file mode 100644 index dae345943..000000000 Binary files a/public/img/emoji/mailbox_with_mail.png and /dev/null differ diff --git a/public/img/emoji/mailbox_with_no_mail.png b/public/img/emoji/mailbox_with_no_mail.png deleted file mode 100644 index 59f15c5d7..000000000 Binary files a/public/img/emoji/mailbox_with_no_mail.png and /dev/null differ diff --git a/public/img/emoji/man.png b/public/img/emoji/man.png deleted file mode 100644 index d9bfa26a6..000000000 Binary files a/public/img/emoji/man.png and /dev/null differ diff --git a/public/img/emoji/man_with_gua_pi_mao.png b/public/img/emoji/man_with_gua_pi_mao.png deleted file mode 100644 index 7aad74b55..000000000 Binary files a/public/img/emoji/man_with_gua_pi_mao.png and /dev/null differ diff --git a/public/img/emoji/man_with_turban.png b/public/img/emoji/man_with_turban.png deleted file mode 100644 index 036604caf..000000000 Binary files a/public/img/emoji/man_with_turban.png and /dev/null differ diff --git a/public/img/emoji/mans_shoe.png b/public/img/emoji/mans_shoe.png deleted file mode 100644 index ecba9ba7d..000000000 Binary files a/public/img/emoji/mans_shoe.png and /dev/null differ diff --git a/public/img/emoji/maple_leaf.png b/public/img/emoji/maple_leaf.png deleted file mode 100644 index 4e9b47207..000000000 Binary files a/public/img/emoji/maple_leaf.png and /dev/null differ diff --git a/public/img/emoji/mask.png b/public/img/emoji/mask.png deleted file mode 100644 index 05887e99c..000000000 Binary files a/public/img/emoji/mask.png and /dev/null differ diff --git a/public/img/emoji/massage.png b/public/img/emoji/massage.png deleted file mode 100644 index dd30d1597..000000000 Binary files a/public/img/emoji/massage.png and /dev/null differ diff --git a/public/img/emoji/meat_on_bone.png b/public/img/emoji/meat_on_bone.png deleted file mode 100644 index 5b79a660c..000000000 Binary files a/public/img/emoji/meat_on_bone.png and /dev/null differ diff --git a/public/img/emoji/mega.png b/public/img/emoji/mega.png deleted file mode 100644 index 022df2f8d..000000000 Binary files a/public/img/emoji/mega.png and /dev/null differ diff --git a/public/img/emoji/melon.png b/public/img/emoji/melon.png deleted file mode 100644 index 11c13cbbd..000000000 Binary files a/public/img/emoji/melon.png and /dev/null differ diff --git a/public/img/emoji/memo.png b/public/img/emoji/memo.png deleted file mode 100644 index fc97ddbc9..000000000 Binary files a/public/img/emoji/memo.png and /dev/null differ diff --git a/public/img/emoji/mens.png b/public/img/emoji/mens.png deleted file mode 100644 index abccfc9f2..000000000 Binary files a/public/img/emoji/mens.png and /dev/null differ diff --git a/public/img/emoji/metal.png b/public/img/emoji/metal.png deleted file mode 100644 index 94f1fda22..000000000 Binary files a/public/img/emoji/metal.png and /dev/null differ diff --git a/public/img/emoji/metro.png b/public/img/emoji/metro.png deleted file mode 100644 index 4acf5ab3e..000000000 Binary files a/public/img/emoji/metro.png and /dev/null differ diff --git a/public/img/emoji/microphone.png b/public/img/emoji/microphone.png deleted file mode 100644 index 68c74adad..000000000 Binary files a/public/img/emoji/microphone.png and /dev/null differ diff --git a/public/img/emoji/microscope.png b/public/img/emoji/microscope.png deleted file mode 100644 index 8b7a5e4e6..000000000 Binary files a/public/img/emoji/microscope.png and /dev/null differ diff --git a/public/img/emoji/milky_way.png b/public/img/emoji/milky_way.png deleted file mode 100644 index 901090a12..000000000 Binary files a/public/img/emoji/milky_way.png and /dev/null differ diff --git a/public/img/emoji/minibus.png b/public/img/emoji/minibus.png deleted file mode 100644 index c52cef234..000000000 Binary files a/public/img/emoji/minibus.png and /dev/null differ diff --git a/public/img/emoji/minidisc.png b/public/img/emoji/minidisc.png deleted file mode 100644 index e19cc5d01..000000000 Binary files a/public/img/emoji/minidisc.png and /dev/null differ diff --git a/public/img/emoji/mobile_phone_off.png b/public/img/emoji/mobile_phone_off.png deleted file mode 100644 index fa16c763c..000000000 Binary files a/public/img/emoji/mobile_phone_off.png and /dev/null differ diff --git a/public/img/emoji/money_with_wings.png b/public/img/emoji/money_with_wings.png deleted file mode 100644 index 581a82449..000000000 Binary files a/public/img/emoji/money_with_wings.png and /dev/null differ diff --git a/public/img/emoji/moneybag.png b/public/img/emoji/moneybag.png deleted file mode 100644 index 5546c04ba..000000000 Binary files a/public/img/emoji/moneybag.png and /dev/null differ diff --git a/public/img/emoji/monkey.png b/public/img/emoji/monkey.png deleted file mode 100644 index 640703597..000000000 Binary files a/public/img/emoji/monkey.png and /dev/null differ diff --git a/public/img/emoji/monkey_face.png b/public/img/emoji/monkey_face.png deleted file mode 100644 index 6964cf4d5..000000000 Binary files a/public/img/emoji/monkey_face.png and /dev/null differ diff --git a/public/img/emoji/monorail.png b/public/img/emoji/monorail.png deleted file mode 100644 index 913d30024..000000000 Binary files a/public/img/emoji/monorail.png and /dev/null differ diff --git a/public/img/emoji/mortar_board.png b/public/img/emoji/mortar_board.png deleted file mode 100644 index 84513f6ba..000000000 Binary files a/public/img/emoji/mortar_board.png and /dev/null differ diff --git a/public/img/emoji/mount_fuji.png b/public/img/emoji/mount_fuji.png deleted file mode 100644 index 4c313e583..000000000 Binary files a/public/img/emoji/mount_fuji.png and /dev/null differ diff --git a/public/img/emoji/mountain_bicyclist.png b/public/img/emoji/mountain_bicyclist.png deleted file mode 100644 index b69889756..000000000 Binary files a/public/img/emoji/mountain_bicyclist.png and /dev/null differ diff --git a/public/img/emoji/mountain_cableway.png b/public/img/emoji/mountain_cableway.png deleted file mode 100644 index 5688bb239..000000000 Binary files a/public/img/emoji/mountain_cableway.png and /dev/null differ diff --git a/public/img/emoji/mountain_railway.png b/public/img/emoji/mountain_railway.png deleted file mode 100644 index 1f3d1aab5..000000000 Binary files a/public/img/emoji/mountain_railway.png and /dev/null differ diff --git a/public/img/emoji/mouse.png b/public/img/emoji/mouse.png deleted file mode 100644 index 8ff162e2d..000000000 Binary files a/public/img/emoji/mouse.png and /dev/null differ diff --git a/public/img/emoji/mouse2.png b/public/img/emoji/mouse2.png deleted file mode 100644 index 2d777e5e1..000000000 Binary files a/public/img/emoji/mouse2.png and /dev/null differ diff --git a/public/img/emoji/movie_camera.png b/public/img/emoji/movie_camera.png deleted file mode 100644 index 9c1438409..000000000 Binary files a/public/img/emoji/movie_camera.png and /dev/null differ diff --git a/public/img/emoji/moyai.png b/public/img/emoji/moyai.png deleted file mode 100644 index 61a1a9c21..000000000 Binary files a/public/img/emoji/moyai.png and /dev/null differ diff --git a/public/img/emoji/muscle.png b/public/img/emoji/muscle.png deleted file mode 100644 index 19f92efb6..000000000 Binary files a/public/img/emoji/muscle.png and /dev/null differ diff --git a/public/img/emoji/mushroom.png b/public/img/emoji/mushroom.png deleted file mode 100644 index 5eeed8e79..000000000 Binary files a/public/img/emoji/mushroom.png and /dev/null differ diff --git a/public/img/emoji/musical_keyboard.png b/public/img/emoji/musical_keyboard.png deleted file mode 100644 index 93647a4a3..000000000 Binary files a/public/img/emoji/musical_keyboard.png and /dev/null differ diff --git a/public/img/emoji/musical_note.png b/public/img/emoji/musical_note.png deleted file mode 100644 index 68b261bcb..000000000 Binary files a/public/img/emoji/musical_note.png and /dev/null differ diff --git a/public/img/emoji/musical_score.png b/public/img/emoji/musical_score.png deleted file mode 100644 index c99e3381f..000000000 Binary files a/public/img/emoji/musical_score.png and /dev/null differ diff --git a/public/img/emoji/mute.png b/public/img/emoji/mute.png deleted file mode 100644 index 4cf67c367..000000000 Binary files a/public/img/emoji/mute.png and /dev/null differ diff --git a/public/img/emoji/nail_care.png b/public/img/emoji/nail_care.png deleted file mode 100644 index 6a66e63d2..000000000 Binary files a/public/img/emoji/nail_care.png and /dev/null differ diff --git a/public/img/emoji/name_badge.png b/public/img/emoji/name_badge.png deleted file mode 100644 index 2b712dcd5..000000000 Binary files a/public/img/emoji/name_badge.png and /dev/null differ diff --git a/public/img/emoji/neckbeard.png b/public/img/emoji/neckbeard.png deleted file mode 100644 index 6e31d1652..000000000 Binary files a/public/img/emoji/neckbeard.png and /dev/null differ diff --git a/public/img/emoji/necktie.png b/public/img/emoji/necktie.png deleted file mode 100644 index 80461c66f..000000000 Binary files a/public/img/emoji/necktie.png and /dev/null differ diff --git a/public/img/emoji/negative_squared_cross_mark.png b/public/img/emoji/negative_squared_cross_mark.png deleted file mode 100644 index b47a0cece..000000000 Binary files a/public/img/emoji/negative_squared_cross_mark.png and /dev/null differ diff --git a/public/img/emoji/neutral_face.png b/public/img/emoji/neutral_face.png deleted file mode 100644 index 682a1ba06..000000000 Binary files a/public/img/emoji/neutral_face.png and /dev/null differ diff --git a/public/img/emoji/new.png b/public/img/emoji/new.png deleted file mode 100644 index 28d1570e0..000000000 Binary files a/public/img/emoji/new.png and /dev/null differ diff --git a/public/img/emoji/new_moon.png b/public/img/emoji/new_moon.png deleted file mode 100644 index 72492cb90..000000000 Binary files a/public/img/emoji/new_moon.png and /dev/null differ diff --git a/public/img/emoji/new_moon_with_face.png b/public/img/emoji/new_moon_with_face.png deleted file mode 100644 index 21a696eb9..000000000 Binary files a/public/img/emoji/new_moon_with_face.png and /dev/null differ diff --git a/public/img/emoji/newspaper.png b/public/img/emoji/newspaper.png deleted file mode 100644 index 60c3394dc..000000000 Binary files a/public/img/emoji/newspaper.png and /dev/null differ diff --git a/public/img/emoji/ng.png b/public/img/emoji/ng.png deleted file mode 100644 index 2ca180ae3..000000000 Binary files a/public/img/emoji/ng.png and /dev/null differ diff --git a/public/img/emoji/nine.png b/public/img/emoji/nine.png deleted file mode 100644 index 8006cc909..000000000 Binary files a/public/img/emoji/nine.png and /dev/null differ diff --git a/public/img/emoji/no_bell.png b/public/img/emoji/no_bell.png deleted file mode 100644 index 613b81cd2..000000000 Binary files a/public/img/emoji/no_bell.png and /dev/null differ diff --git a/public/img/emoji/no_bicycles.png b/public/img/emoji/no_bicycles.png deleted file mode 100644 index 4b2621664..000000000 Binary files a/public/img/emoji/no_bicycles.png and /dev/null differ diff --git a/public/img/emoji/no_entry.png b/public/img/emoji/no_entry.png deleted file mode 100644 index cf2086a8e..000000000 Binary files a/public/img/emoji/no_entry.png and /dev/null differ diff --git a/public/img/emoji/no_entry_sign.png b/public/img/emoji/no_entry_sign.png deleted file mode 100644 index b3231f66d..000000000 Binary files a/public/img/emoji/no_entry_sign.png and /dev/null differ diff --git a/public/img/emoji/no_good.png b/public/img/emoji/no_good.png deleted file mode 100644 index d459a35bc..000000000 Binary files a/public/img/emoji/no_good.png and /dev/null differ diff --git a/public/img/emoji/no_mobile_phones.png b/public/img/emoji/no_mobile_phones.png deleted file mode 100644 index 41df57cf8..000000000 Binary files a/public/img/emoji/no_mobile_phones.png and /dev/null differ diff --git a/public/img/emoji/no_mouth.png b/public/img/emoji/no_mouth.png deleted file mode 100644 index e67802046..000000000 Binary files a/public/img/emoji/no_mouth.png and /dev/null differ diff --git a/public/img/emoji/no_pedestrians.png b/public/img/emoji/no_pedestrians.png deleted file mode 100644 index 53ee0f927..000000000 Binary files a/public/img/emoji/no_pedestrians.png and /dev/null differ diff --git a/public/img/emoji/no_smoking.png b/public/img/emoji/no_smoking.png deleted file mode 100644 index 5880ddfd1..000000000 Binary files a/public/img/emoji/no_smoking.png and /dev/null differ diff --git a/public/img/emoji/non-potable_water.png b/public/img/emoji/non-potable_water.png deleted file mode 100644 index 1b29d35b9..000000000 Binary files a/public/img/emoji/non-potable_water.png and /dev/null differ diff --git a/public/img/emoji/nose.png b/public/img/emoji/nose.png deleted file mode 100644 index ad17c16c2..000000000 Binary files a/public/img/emoji/nose.png and /dev/null differ diff --git a/public/img/emoji/notebook.png b/public/img/emoji/notebook.png deleted file mode 100644 index 5f0a5f6a2..000000000 Binary files a/public/img/emoji/notebook.png and /dev/null differ diff --git a/public/img/emoji/notebook_with_decorative_cover.png b/public/img/emoji/notebook_with_decorative_cover.png deleted file mode 100644 index 4f3b14c85..000000000 Binary files a/public/img/emoji/notebook_with_decorative_cover.png and /dev/null differ diff --git a/public/img/emoji/notes.png b/public/img/emoji/notes.png deleted file mode 100644 index 0956d6ab2..000000000 Binary files a/public/img/emoji/notes.png and /dev/null differ diff --git a/public/img/emoji/nut_and_bolt.png b/public/img/emoji/nut_and_bolt.png deleted file mode 100644 index bddfa72a7..000000000 Binary files a/public/img/emoji/nut_and_bolt.png and /dev/null differ diff --git a/public/img/emoji/o.png b/public/img/emoji/o.png deleted file mode 100644 index 1ff846c19..000000000 Binary files a/public/img/emoji/o.png and /dev/null differ diff --git a/public/img/emoji/o2.png b/public/img/emoji/o2.png deleted file mode 100644 index d85f9fb98..000000000 Binary files a/public/img/emoji/o2.png and /dev/null differ diff --git a/public/img/emoji/ocean.png b/public/img/emoji/ocean.png deleted file mode 100644 index f8d520cd4..000000000 Binary files a/public/img/emoji/ocean.png and /dev/null differ diff --git a/public/img/emoji/octocat.png b/public/img/emoji/octocat.png deleted file mode 100644 index d296f25fe..000000000 Binary files a/public/img/emoji/octocat.png and /dev/null differ diff --git a/public/img/emoji/octopus.png b/public/img/emoji/octopus.png deleted file mode 100644 index 52ce64b46..000000000 Binary files a/public/img/emoji/octopus.png and /dev/null differ diff --git a/public/img/emoji/oden.png b/public/img/emoji/oden.png deleted file mode 100644 index 73add1c73..000000000 Binary files a/public/img/emoji/oden.png and /dev/null differ diff --git a/public/img/emoji/office.png b/public/img/emoji/office.png deleted file mode 100644 index 53c3ef8d1..000000000 Binary files a/public/img/emoji/office.png and /dev/null differ diff --git a/public/img/emoji/ok.png b/public/img/emoji/ok.png deleted file mode 100644 index 6433d1a90..000000000 Binary files a/public/img/emoji/ok.png and /dev/null differ diff --git a/public/img/emoji/ok_hand.png b/public/img/emoji/ok_hand.png deleted file mode 100644 index 80c5aebb6..000000000 Binary files a/public/img/emoji/ok_hand.png and /dev/null differ diff --git a/public/img/emoji/ok_woman.png b/public/img/emoji/ok_woman.png deleted file mode 100644 index e8b98194e..000000000 Binary files a/public/img/emoji/ok_woman.png and /dev/null differ diff --git a/public/img/emoji/older_man.png b/public/img/emoji/older_man.png deleted file mode 100644 index 149f0cfb8..000000000 Binary files a/public/img/emoji/older_man.png and /dev/null differ diff --git a/public/img/emoji/older_woman.png b/public/img/emoji/older_woman.png deleted file mode 100644 index f839565f4..000000000 Binary files a/public/img/emoji/older_woman.png and /dev/null differ diff --git a/public/img/emoji/on.png b/public/img/emoji/on.png deleted file mode 100644 index 4cd69a15d..000000000 Binary files a/public/img/emoji/on.png and /dev/null differ diff --git a/public/img/emoji/oncoming_automobile.png b/public/img/emoji/oncoming_automobile.png deleted file mode 100644 index cb46de22c..000000000 Binary files a/public/img/emoji/oncoming_automobile.png and /dev/null differ diff --git a/public/img/emoji/oncoming_bus.png b/public/img/emoji/oncoming_bus.png deleted file mode 100644 index 3695f7623..000000000 Binary files a/public/img/emoji/oncoming_bus.png and /dev/null differ diff --git a/public/img/emoji/oncoming_police_car.png b/public/img/emoji/oncoming_police_car.png deleted file mode 100644 index af20e7eff..000000000 Binary files a/public/img/emoji/oncoming_police_car.png and /dev/null differ diff --git a/public/img/emoji/oncoming_taxi.png b/public/img/emoji/oncoming_taxi.png deleted file mode 100644 index f78cf3103..000000000 Binary files a/public/img/emoji/oncoming_taxi.png and /dev/null differ diff --git a/public/img/emoji/one.png b/public/img/emoji/one.png deleted file mode 100644 index 2d1f9f8c4..000000000 Binary files a/public/img/emoji/one.png and /dev/null differ diff --git a/public/img/emoji/open_file_folder.png b/public/img/emoji/open_file_folder.png deleted file mode 100644 index 2bbbbf5e7..000000000 Binary files a/public/img/emoji/open_file_folder.png and /dev/null differ diff --git a/public/img/emoji/open_hands.png b/public/img/emoji/open_hands.png deleted file mode 100644 index cef9f428b..000000000 Binary files a/public/img/emoji/open_hands.png and /dev/null differ diff --git a/public/img/emoji/open_mouth.png b/public/img/emoji/open_mouth.png deleted file mode 100644 index daf914274..000000000 Binary files a/public/img/emoji/open_mouth.png and /dev/null differ diff --git a/public/img/emoji/ophiuchus.png b/public/img/emoji/ophiuchus.png deleted file mode 100644 index 4eef715bc..000000000 Binary files a/public/img/emoji/ophiuchus.png and /dev/null differ diff --git a/public/img/emoji/orange_book.png b/public/img/emoji/orange_book.png deleted file mode 100644 index 49650d59e..000000000 Binary files a/public/img/emoji/orange_book.png and /dev/null differ diff --git a/public/img/emoji/outbox_tray.png b/public/img/emoji/outbox_tray.png deleted file mode 100644 index 7ad15e649..000000000 Binary files a/public/img/emoji/outbox_tray.png and /dev/null differ diff --git a/public/img/emoji/ox.png b/public/img/emoji/ox.png deleted file mode 100644 index 8d9819462..000000000 Binary files a/public/img/emoji/ox.png and /dev/null differ diff --git a/public/img/emoji/package.png b/public/img/emoji/package.png deleted file mode 100644 index 168434bc8..000000000 Binary files a/public/img/emoji/package.png and /dev/null differ diff --git a/public/img/emoji/page_facing_up.png b/public/img/emoji/page_facing_up.png deleted file mode 100644 index 804c0d739..000000000 Binary files a/public/img/emoji/page_facing_up.png and /dev/null differ diff --git a/public/img/emoji/page_with_curl.png b/public/img/emoji/page_with_curl.png deleted file mode 100644 index 37cb4de50..000000000 Binary files a/public/img/emoji/page_with_curl.png and /dev/null differ diff --git a/public/img/emoji/pager.png b/public/img/emoji/pager.png deleted file mode 100644 index e3e1fc44e..000000000 Binary files a/public/img/emoji/pager.png and /dev/null differ diff --git a/public/img/emoji/palm_tree.png b/public/img/emoji/palm_tree.png deleted file mode 100644 index d13b7c620..000000000 Binary files a/public/img/emoji/palm_tree.png and /dev/null differ diff --git a/public/img/emoji/panda_face.png b/public/img/emoji/panda_face.png deleted file mode 100644 index a794fb17f..000000000 Binary files a/public/img/emoji/panda_face.png and /dev/null differ diff --git a/public/img/emoji/paperclip.png b/public/img/emoji/paperclip.png deleted file mode 100644 index 677669a83..000000000 Binary files a/public/img/emoji/paperclip.png and /dev/null differ diff --git a/public/img/emoji/parking.png b/public/img/emoji/parking.png deleted file mode 100644 index c24af81cc..000000000 Binary files a/public/img/emoji/parking.png and /dev/null differ diff --git a/public/img/emoji/part_alternation_mark.png b/public/img/emoji/part_alternation_mark.png deleted file mode 100644 index 1e5855f8d..000000000 Binary files a/public/img/emoji/part_alternation_mark.png and /dev/null differ diff --git a/public/img/emoji/partly_sunny.png b/public/img/emoji/partly_sunny.png deleted file mode 100644 index b3f5bcfdd..000000000 Binary files a/public/img/emoji/partly_sunny.png and /dev/null differ diff --git a/public/img/emoji/passport_control.png b/public/img/emoji/passport_control.png deleted file mode 100644 index 675b76d37..000000000 Binary files a/public/img/emoji/passport_control.png and /dev/null differ diff --git a/public/img/emoji/paw_prints.png b/public/img/emoji/paw_prints.png deleted file mode 100644 index 89b9fec9e..000000000 Binary files a/public/img/emoji/paw_prints.png and /dev/null differ diff --git a/public/img/emoji/peach.png b/public/img/emoji/peach.png deleted file mode 100644 index ee2139ecb..000000000 Binary files a/public/img/emoji/peach.png and /dev/null differ diff --git a/public/img/emoji/pear.png b/public/img/emoji/pear.png deleted file mode 100644 index f24aca8c0..000000000 Binary files a/public/img/emoji/pear.png and /dev/null differ diff --git a/public/img/emoji/pencil.png b/public/img/emoji/pencil.png deleted file mode 100644 index fc97ddbc9..000000000 Binary files a/public/img/emoji/pencil.png and /dev/null differ diff --git a/public/img/emoji/pencil2.png b/public/img/emoji/pencil2.png deleted file mode 100644 index 64c2d9b79..000000000 Binary files a/public/img/emoji/pencil2.png and /dev/null differ diff --git a/public/img/emoji/penguin.png b/public/img/emoji/penguin.png deleted file mode 100644 index d8edbcb8f..000000000 Binary files a/public/img/emoji/penguin.png and /dev/null differ diff --git a/public/img/emoji/pensive.png b/public/img/emoji/pensive.png deleted file mode 100644 index 4159f3c42..000000000 Binary files a/public/img/emoji/pensive.png and /dev/null differ diff --git a/public/img/emoji/performing_arts.png b/public/img/emoji/performing_arts.png deleted file mode 100644 index 899fbe5a7..000000000 Binary files a/public/img/emoji/performing_arts.png and /dev/null differ diff --git a/public/img/emoji/persevere.png b/public/img/emoji/persevere.png deleted file mode 100644 index f99f6da47..000000000 Binary files a/public/img/emoji/persevere.png and /dev/null differ diff --git a/public/img/emoji/person_frowning.png b/public/img/emoji/person_frowning.png deleted file mode 100644 index 6f34d5e15..000000000 Binary files a/public/img/emoji/person_frowning.png and /dev/null differ diff --git a/public/img/emoji/person_with_blond_hair.png b/public/img/emoji/person_with_blond_hair.png deleted file mode 100644 index c144301cb..000000000 Binary files a/public/img/emoji/person_with_blond_hair.png and /dev/null differ diff --git a/public/img/emoji/person_with_pouting_face.png b/public/img/emoji/person_with_pouting_face.png deleted file mode 100644 index c4a95c3b2..000000000 Binary files a/public/img/emoji/person_with_pouting_face.png and /dev/null differ diff --git a/public/img/emoji/phone.png b/public/img/emoji/phone.png deleted file mode 100644 index 87d2559b5..000000000 Binary files a/public/img/emoji/phone.png and /dev/null differ diff --git a/public/img/emoji/pig.png b/public/img/emoji/pig.png deleted file mode 100644 index f7f273c73..000000000 Binary files a/public/img/emoji/pig.png and /dev/null differ diff --git a/public/img/emoji/pig2.png b/public/img/emoji/pig2.png deleted file mode 100644 index fec3374d7..000000000 Binary files a/public/img/emoji/pig2.png and /dev/null differ diff --git a/public/img/emoji/pig_nose.png b/public/img/emoji/pig_nose.png deleted file mode 100644 index 38d612446..000000000 Binary files a/public/img/emoji/pig_nose.png and /dev/null differ diff --git a/public/img/emoji/pill.png b/public/img/emoji/pill.png deleted file mode 100644 index cd84a78ff..000000000 Binary files a/public/img/emoji/pill.png and /dev/null differ diff --git a/public/img/emoji/pineapple.png b/public/img/emoji/pineapple.png deleted file mode 100644 index d6f8e2876..000000000 Binary files a/public/img/emoji/pineapple.png and /dev/null differ diff --git a/public/img/emoji/pisces.png b/public/img/emoji/pisces.png deleted file mode 100644 index 6db2c3d50..000000000 Binary files a/public/img/emoji/pisces.png and /dev/null differ diff --git a/public/img/emoji/pizza.png b/public/img/emoji/pizza.png deleted file mode 100644 index 460367d02..000000000 Binary files a/public/img/emoji/pizza.png and /dev/null differ diff --git a/public/img/emoji/plus1.png b/public/img/emoji/plus1.png deleted file mode 100644 index 81786c1d8..000000000 Binary files a/public/img/emoji/plus1.png and /dev/null differ diff --git a/public/img/emoji/point_down.png b/public/img/emoji/point_down.png deleted file mode 100644 index 658c6d918..000000000 Binary files a/public/img/emoji/point_down.png and /dev/null differ diff --git a/public/img/emoji/point_left.png b/public/img/emoji/point_left.png deleted file mode 100644 index 38a99b43f..000000000 Binary files a/public/img/emoji/point_left.png and /dev/null differ diff --git a/public/img/emoji/point_right.png b/public/img/emoji/point_right.png deleted file mode 100644 index 6f9f029a4..000000000 Binary files a/public/img/emoji/point_right.png and /dev/null differ diff --git a/public/img/emoji/point_up.png b/public/img/emoji/point_up.png deleted file mode 100644 index 01896e214..000000000 Binary files a/public/img/emoji/point_up.png and /dev/null differ diff --git a/public/img/emoji/point_up_2.png b/public/img/emoji/point_up_2.png deleted file mode 100644 index 1cfe73672..000000000 Binary files a/public/img/emoji/point_up_2.png and /dev/null differ diff --git a/public/img/emoji/police_car.png b/public/img/emoji/police_car.png deleted file mode 100644 index b8f17275e..000000000 Binary files a/public/img/emoji/police_car.png and /dev/null differ diff --git a/public/img/emoji/poodle.png b/public/img/emoji/poodle.png deleted file mode 100644 index adac80bd9..000000000 Binary files a/public/img/emoji/poodle.png and /dev/null differ diff --git a/public/img/emoji/poop.png b/public/img/emoji/poop.png deleted file mode 100644 index 73a4dc840..000000000 Binary files a/public/img/emoji/poop.png and /dev/null differ diff --git a/public/img/emoji/post_office.png b/public/img/emoji/post_office.png deleted file mode 100644 index 43b59e30e..000000000 Binary files a/public/img/emoji/post_office.png and /dev/null differ diff --git a/public/img/emoji/postal_horn.png b/public/img/emoji/postal_horn.png deleted file mode 100644 index 13a151418..000000000 Binary files a/public/img/emoji/postal_horn.png and /dev/null differ diff --git a/public/img/emoji/postbox.png b/public/img/emoji/postbox.png deleted file mode 100644 index ce04b7008..000000000 Binary files a/public/img/emoji/postbox.png and /dev/null differ diff --git a/public/img/emoji/potable_water.png b/public/img/emoji/potable_water.png deleted file mode 100644 index e9fd56079..000000000 Binary files a/public/img/emoji/potable_water.png and /dev/null differ diff --git a/public/img/emoji/pouch.png b/public/img/emoji/pouch.png deleted file mode 100644 index dc35ae8e5..000000000 Binary files a/public/img/emoji/pouch.png and /dev/null differ diff --git a/public/img/emoji/poultry_leg.png b/public/img/emoji/poultry_leg.png deleted file mode 100644 index 43ad85965..000000000 Binary files a/public/img/emoji/poultry_leg.png and /dev/null differ diff --git a/public/img/emoji/pound.png b/public/img/emoji/pound.png deleted file mode 100644 index f8be91d7a..000000000 Binary files a/public/img/emoji/pound.png and /dev/null differ diff --git a/public/img/emoji/pouting_cat.png b/public/img/emoji/pouting_cat.png deleted file mode 100644 index 4325fd48d..000000000 Binary files a/public/img/emoji/pouting_cat.png and /dev/null differ diff --git a/public/img/emoji/pray.png b/public/img/emoji/pray.png deleted file mode 100644 index f86c992d5..000000000 Binary files a/public/img/emoji/pray.png and /dev/null differ diff --git a/public/img/emoji/princess.png b/public/img/emoji/princess.png deleted file mode 100644 index 1ebb2ce9b..000000000 Binary files a/public/img/emoji/princess.png and /dev/null differ diff --git a/public/img/emoji/punch.png b/public/img/emoji/punch.png deleted file mode 100644 index 277047b7c..000000000 Binary files a/public/img/emoji/punch.png and /dev/null differ diff --git a/public/img/emoji/purple_heart.png b/public/img/emoji/purple_heart.png deleted file mode 100644 index d5f875043..000000000 Binary files a/public/img/emoji/purple_heart.png and /dev/null differ diff --git a/public/img/emoji/purse.png b/public/img/emoji/purse.png deleted file mode 100644 index 8f06a2b93..000000000 Binary files a/public/img/emoji/purse.png and /dev/null differ diff --git a/public/img/emoji/pushpin.png b/public/img/emoji/pushpin.png deleted file mode 100644 index 540c4ecb8..000000000 Binary files a/public/img/emoji/pushpin.png and /dev/null differ diff --git a/public/img/emoji/put_litter_in_its_place.png b/public/img/emoji/put_litter_in_its_place.png deleted file mode 100644 index c2e350c2d..000000000 Binary files a/public/img/emoji/put_litter_in_its_place.png and /dev/null differ diff --git a/public/img/emoji/question.png b/public/img/emoji/question.png deleted file mode 100644 index 38cedf560..000000000 Binary files a/public/img/emoji/question.png and /dev/null differ diff --git a/public/img/emoji/rabbit.png b/public/img/emoji/rabbit.png deleted file mode 100644 index 5cb3ef6f0..000000000 Binary files a/public/img/emoji/rabbit.png and /dev/null differ diff --git a/public/img/emoji/rabbit2.png b/public/img/emoji/rabbit2.png deleted file mode 100644 index a9fd24dc1..000000000 Binary files a/public/img/emoji/rabbit2.png and /dev/null differ diff --git a/public/img/emoji/racehorse.png b/public/img/emoji/racehorse.png deleted file mode 100644 index 4d09c64de..000000000 Binary files a/public/img/emoji/racehorse.png and /dev/null differ diff --git a/public/img/emoji/radio.png b/public/img/emoji/radio.png deleted file mode 100644 index ea589efe3..000000000 Binary files a/public/img/emoji/radio.png and /dev/null differ diff --git a/public/img/emoji/radio_button.png b/public/img/emoji/radio_button.png deleted file mode 100644 index 63755eec2..000000000 Binary files a/public/img/emoji/radio_button.png and /dev/null differ diff --git a/public/img/emoji/rage.png b/public/img/emoji/rage.png deleted file mode 100644 index c65ddff55..000000000 Binary files a/public/img/emoji/rage.png and /dev/null differ diff --git a/public/img/emoji/rage1.png b/public/img/emoji/rage1.png deleted file mode 100644 index 1506ba403..000000000 Binary files a/public/img/emoji/rage1.png and /dev/null differ diff --git a/public/img/emoji/rage2.png b/public/img/emoji/rage2.png deleted file mode 100644 index f792e063b..000000000 Binary files a/public/img/emoji/rage2.png and /dev/null differ diff --git a/public/img/emoji/rage3.png b/public/img/emoji/rage3.png deleted file mode 100644 index 58764cbcb..000000000 Binary files a/public/img/emoji/rage3.png and /dev/null differ diff --git a/public/img/emoji/rage4.png b/public/img/emoji/rage4.png deleted file mode 100644 index c726c94a2..000000000 Binary files a/public/img/emoji/rage4.png and /dev/null differ diff --git a/public/img/emoji/railway_car.png b/public/img/emoji/railway_car.png deleted file mode 100644 index 22361158f..000000000 Binary files a/public/img/emoji/railway_car.png and /dev/null differ diff --git a/public/img/emoji/rainbow.png b/public/img/emoji/rainbow.png deleted file mode 100644 index 6b1faa037..000000000 Binary files a/public/img/emoji/rainbow.png and /dev/null differ diff --git a/public/img/emoji/raised_hand.png b/public/img/emoji/raised_hand.png deleted file mode 100644 index 5e45c25a5..000000000 Binary files a/public/img/emoji/raised_hand.png and /dev/null differ diff --git a/public/img/emoji/raised_hands.png b/public/img/emoji/raised_hands.png deleted file mode 100644 index e03142bdc..000000000 Binary files a/public/img/emoji/raised_hands.png and /dev/null differ diff --git a/public/img/emoji/raising_hand.png b/public/img/emoji/raising_hand.png deleted file mode 100644 index e1741a40e..000000000 Binary files a/public/img/emoji/raising_hand.png and /dev/null differ diff --git a/public/img/emoji/ram.png b/public/img/emoji/ram.png deleted file mode 100644 index 5ea7bfbc0..000000000 Binary files a/public/img/emoji/ram.png and /dev/null differ diff --git a/public/img/emoji/ramen.png b/public/img/emoji/ramen.png deleted file mode 100644 index 78dc7d537..000000000 Binary files a/public/img/emoji/ramen.png and /dev/null differ diff --git a/public/img/emoji/rat.png b/public/img/emoji/rat.png deleted file mode 100644 index fa7dd401c..000000000 Binary files a/public/img/emoji/rat.png and /dev/null differ diff --git a/public/img/emoji/recycle.png b/public/img/emoji/recycle.png deleted file mode 100644 index 99104c0e9..000000000 Binary files a/public/img/emoji/recycle.png and /dev/null differ diff --git a/public/img/emoji/red_car.png b/public/img/emoji/red_car.png deleted file mode 100644 index d70a2f062..000000000 Binary files a/public/img/emoji/red_car.png and /dev/null differ diff --git a/public/img/emoji/red_circle.png b/public/img/emoji/red_circle.png deleted file mode 100644 index b391289b2..000000000 Binary files a/public/img/emoji/red_circle.png and /dev/null differ diff --git a/public/img/emoji/registered.png b/public/img/emoji/registered.png deleted file mode 100644 index 31c68a80b..000000000 Binary files a/public/img/emoji/registered.png and /dev/null differ diff --git a/public/img/emoji/relaxed.png b/public/img/emoji/relaxed.png deleted file mode 100644 index bbab82d3b..000000000 Binary files a/public/img/emoji/relaxed.png and /dev/null differ diff --git a/public/img/emoji/relieved.png b/public/img/emoji/relieved.png deleted file mode 100644 index fe5629f43..000000000 Binary files a/public/img/emoji/relieved.png and /dev/null differ diff --git a/public/img/emoji/repeat.png b/public/img/emoji/repeat.png deleted file mode 100644 index 80113b692..000000000 Binary files a/public/img/emoji/repeat.png and /dev/null differ diff --git a/public/img/emoji/repeat_one.png b/public/img/emoji/repeat_one.png deleted file mode 100644 index 3c47bcc1f..000000000 Binary files a/public/img/emoji/repeat_one.png and /dev/null differ diff --git a/public/img/emoji/restroom.png b/public/img/emoji/restroom.png deleted file mode 100644 index d6c111b29..000000000 Binary files a/public/img/emoji/restroom.png and /dev/null differ diff --git a/public/img/emoji/revolving_hearts.png b/public/img/emoji/revolving_hearts.png deleted file mode 100644 index ea3317c47..000000000 Binary files a/public/img/emoji/revolving_hearts.png and /dev/null differ diff --git a/public/img/emoji/rewind.png b/public/img/emoji/rewind.png deleted file mode 100644 index 26289dc3d..000000000 Binary files a/public/img/emoji/rewind.png and /dev/null differ diff --git a/public/img/emoji/ribbon.png b/public/img/emoji/ribbon.png deleted file mode 100644 index 63ee5ba5a..000000000 Binary files a/public/img/emoji/ribbon.png and /dev/null differ diff --git a/public/img/emoji/rice.png b/public/img/emoji/rice.png deleted file mode 100644 index 1fd22027b..000000000 Binary files a/public/img/emoji/rice.png and /dev/null differ diff --git a/public/img/emoji/rice_ball.png b/public/img/emoji/rice_ball.png deleted file mode 100644 index ade7c45d3..000000000 Binary files a/public/img/emoji/rice_ball.png and /dev/null differ diff --git a/public/img/emoji/rice_cracker.png b/public/img/emoji/rice_cracker.png deleted file mode 100644 index 954c901e9..000000000 Binary files a/public/img/emoji/rice_cracker.png and /dev/null differ diff --git a/public/img/emoji/rice_scene.png b/public/img/emoji/rice_scene.png deleted file mode 100644 index 14361988d..000000000 Binary files a/public/img/emoji/rice_scene.png and /dev/null differ diff --git a/public/img/emoji/ring.png b/public/img/emoji/ring.png deleted file mode 100644 index 8a57fd68b..000000000 Binary files a/public/img/emoji/ring.png and /dev/null differ diff --git a/public/img/emoji/rocket.png b/public/img/emoji/rocket.png deleted file mode 100644 index 783078d37..000000000 Binary files a/public/img/emoji/rocket.png and /dev/null differ diff --git a/public/img/emoji/roller_coaster.png b/public/img/emoji/roller_coaster.png deleted file mode 100644 index 9180b9861..000000000 Binary files a/public/img/emoji/roller_coaster.png and /dev/null differ diff --git a/public/img/emoji/rooster.png b/public/img/emoji/rooster.png deleted file mode 100644 index fab23ad36..000000000 Binary files a/public/img/emoji/rooster.png and /dev/null differ diff --git a/public/img/emoji/rose.png b/public/img/emoji/rose.png deleted file mode 100644 index 3479fbcbb..000000000 Binary files a/public/img/emoji/rose.png and /dev/null differ diff --git a/public/img/emoji/rotating_light.png b/public/img/emoji/rotating_light.png deleted file mode 100644 index 6cf4a775e..000000000 Binary files a/public/img/emoji/rotating_light.png and /dev/null differ diff --git a/public/img/emoji/round_pushpin.png b/public/img/emoji/round_pushpin.png deleted file mode 100644 index e498e92cf..000000000 Binary files a/public/img/emoji/round_pushpin.png and /dev/null differ diff --git a/public/img/emoji/rowboat.png b/public/img/emoji/rowboat.png deleted file mode 100644 index e370d0fb1..000000000 Binary files a/public/img/emoji/rowboat.png and /dev/null differ diff --git a/public/img/emoji/ru.png b/public/img/emoji/ru.png deleted file mode 100644 index 55fcf3549..000000000 Binary files a/public/img/emoji/ru.png and /dev/null differ diff --git a/public/img/emoji/rugby_football.png b/public/img/emoji/rugby_football.png deleted file mode 100644 index f8db67d70..000000000 Binary files a/public/img/emoji/rugby_football.png and /dev/null differ diff --git a/public/img/emoji/runner.png b/public/img/emoji/runner.png deleted file mode 100644 index cb0042962..000000000 Binary files a/public/img/emoji/runner.png and /dev/null differ diff --git a/public/img/emoji/running.png b/public/img/emoji/running.png deleted file mode 100644 index cb0042962..000000000 Binary files a/public/img/emoji/running.png and /dev/null differ diff --git a/public/img/emoji/running_shirt_with_sash.png b/public/img/emoji/running_shirt_with_sash.png deleted file mode 100644 index 0d68bba09..000000000 Binary files a/public/img/emoji/running_shirt_with_sash.png and /dev/null differ diff --git a/public/img/emoji/sa.png b/public/img/emoji/sa.png deleted file mode 100644 index 387f098b9..000000000 Binary files a/public/img/emoji/sa.png and /dev/null differ diff --git a/public/img/emoji/sagittarius.png b/public/img/emoji/sagittarius.png deleted file mode 100644 index 8b5435baa..000000000 Binary files a/public/img/emoji/sagittarius.png and /dev/null differ diff --git a/public/img/emoji/sailboat.png b/public/img/emoji/sailboat.png deleted file mode 100644 index ff656dc62..000000000 Binary files a/public/img/emoji/sailboat.png and /dev/null differ diff --git a/public/img/emoji/sake.png b/public/img/emoji/sake.png deleted file mode 100644 index 1f69907e5..000000000 Binary files a/public/img/emoji/sake.png and /dev/null differ diff --git a/public/img/emoji/sandal.png b/public/img/emoji/sandal.png deleted file mode 100644 index 0bb3f663f..000000000 Binary files a/public/img/emoji/sandal.png and /dev/null differ diff --git a/public/img/emoji/santa.png b/public/img/emoji/santa.png deleted file mode 100644 index a2240c07e..000000000 Binary files a/public/img/emoji/santa.png and /dev/null differ diff --git a/public/img/emoji/satellite.png b/public/img/emoji/satellite.png deleted file mode 100644 index 3481cc2ef..000000000 Binary files a/public/img/emoji/satellite.png and /dev/null differ diff --git a/public/img/emoji/satisfied.png b/public/img/emoji/satisfied.png deleted file mode 100644 index 11c91eb22..000000000 Binary files a/public/img/emoji/satisfied.png and /dev/null differ diff --git a/public/img/emoji/saxophone.png b/public/img/emoji/saxophone.png deleted file mode 100644 index 011559a76..000000000 Binary files a/public/img/emoji/saxophone.png and /dev/null differ diff --git a/public/img/emoji/school.png b/public/img/emoji/school.png deleted file mode 100644 index afd922bf1..000000000 Binary files a/public/img/emoji/school.png and /dev/null differ diff --git a/public/img/emoji/school_satchel.png b/public/img/emoji/school_satchel.png deleted file mode 100644 index edfb19aec..000000000 Binary files a/public/img/emoji/school_satchel.png and /dev/null differ diff --git a/public/img/emoji/scissors.png b/public/img/emoji/scissors.png deleted file mode 100644 index d99b8aea0..000000000 Binary files a/public/img/emoji/scissors.png and /dev/null differ diff --git a/public/img/emoji/scorpius.png b/public/img/emoji/scorpius.png deleted file mode 100644 index 67fcea165..000000000 Binary files a/public/img/emoji/scorpius.png and /dev/null differ diff --git a/public/img/emoji/scream.png b/public/img/emoji/scream.png deleted file mode 100644 index 9e93c885d..000000000 Binary files a/public/img/emoji/scream.png and /dev/null differ diff --git a/public/img/emoji/scream_cat.png b/public/img/emoji/scream_cat.png deleted file mode 100644 index d94cd34ff..000000000 Binary files a/public/img/emoji/scream_cat.png and /dev/null differ diff --git a/public/img/emoji/scroll.png b/public/img/emoji/scroll.png deleted file mode 100644 index c5a10e6b8..000000000 Binary files a/public/img/emoji/scroll.png and /dev/null differ diff --git a/public/img/emoji/seat.png b/public/img/emoji/seat.png deleted file mode 100644 index d1cb864b4..000000000 Binary files a/public/img/emoji/seat.png and /dev/null differ diff --git a/public/img/emoji/secret.png b/public/img/emoji/secret.png deleted file mode 100644 index 82e383a60..000000000 Binary files a/public/img/emoji/secret.png and /dev/null differ diff --git a/public/img/emoji/see_no_evil.png b/public/img/emoji/see_no_evil.png deleted file mode 100644 index 0890a6222..000000000 Binary files a/public/img/emoji/see_no_evil.png and /dev/null differ diff --git a/public/img/emoji/seedling.png b/public/img/emoji/seedling.png deleted file mode 100644 index 2ab079310..000000000 Binary files a/public/img/emoji/seedling.png and /dev/null differ diff --git a/public/img/emoji/seven.png b/public/img/emoji/seven.png deleted file mode 100644 index 354e89ae7..000000000 Binary files a/public/img/emoji/seven.png and /dev/null differ diff --git a/public/img/emoji/shaved_ice.png b/public/img/emoji/shaved_ice.png deleted file mode 100644 index 0d0b382c2..000000000 Binary files a/public/img/emoji/shaved_ice.png and /dev/null differ diff --git a/public/img/emoji/sheep.png b/public/img/emoji/sheep.png deleted file mode 100644 index c7277d289..000000000 Binary files a/public/img/emoji/sheep.png and /dev/null differ diff --git a/public/img/emoji/shell.png b/public/img/emoji/shell.png deleted file mode 100644 index 3145b5649..000000000 Binary files a/public/img/emoji/shell.png and /dev/null differ diff --git a/public/img/emoji/ship.png b/public/img/emoji/ship.png deleted file mode 100644 index 5d2d8b602..000000000 Binary files a/public/img/emoji/ship.png and /dev/null differ diff --git a/public/img/emoji/shipit.png b/public/img/emoji/shipit.png deleted file mode 100644 index a58a47f62..000000000 Binary files a/public/img/emoji/shipit.png and /dev/null differ diff --git a/public/img/emoji/shirt.png b/public/img/emoji/shirt.png deleted file mode 100644 index 297a6d63e..000000000 Binary files a/public/img/emoji/shirt.png and /dev/null differ diff --git a/public/img/emoji/shit.png b/public/img/emoji/shit.png deleted file mode 100644 index 73a4dc840..000000000 Binary files a/public/img/emoji/shit.png and /dev/null differ diff --git a/public/img/emoji/shoe.png b/public/img/emoji/shoe.png deleted file mode 100644 index 45b82e61c..000000000 Binary files a/public/img/emoji/shoe.png and /dev/null differ diff --git a/public/img/emoji/shower.png b/public/img/emoji/shower.png deleted file mode 100644 index 0d72ab86b..000000000 Binary files a/public/img/emoji/shower.png and /dev/null differ diff --git a/public/img/emoji/signal_strength.png b/public/img/emoji/signal_strength.png deleted file mode 100644 index a4bd23ebf..000000000 Binary files a/public/img/emoji/signal_strength.png and /dev/null differ diff --git a/public/img/emoji/six.png b/public/img/emoji/six.png deleted file mode 100644 index 568805565..000000000 Binary files a/public/img/emoji/six.png and /dev/null differ diff --git a/public/img/emoji/six_pointed_star.png b/public/img/emoji/six_pointed_star.png deleted file mode 100644 index c11af14c8..000000000 Binary files a/public/img/emoji/six_pointed_star.png and /dev/null differ diff --git a/public/img/emoji/ski.png b/public/img/emoji/ski.png deleted file mode 100644 index 98f5cb0f4..000000000 Binary files a/public/img/emoji/ski.png and /dev/null differ diff --git a/public/img/emoji/skull.png b/public/img/emoji/skull.png deleted file mode 100644 index bd4ee3829..000000000 Binary files a/public/img/emoji/skull.png and /dev/null differ diff --git a/public/img/emoji/sleeping.png b/public/img/emoji/sleeping.png deleted file mode 100644 index 093b85236..000000000 Binary files a/public/img/emoji/sleeping.png and /dev/null differ diff --git a/public/img/emoji/sleepy.png b/public/img/emoji/sleepy.png deleted file mode 100644 index df4f55efd..000000000 Binary files a/public/img/emoji/sleepy.png and /dev/null differ diff --git a/public/img/emoji/slot_machine.png b/public/img/emoji/slot_machine.png deleted file mode 100644 index 26f114830..000000000 Binary files a/public/img/emoji/slot_machine.png and /dev/null differ diff --git a/public/img/emoji/small_blue_diamond.png b/public/img/emoji/small_blue_diamond.png deleted file mode 100644 index 8cd49205f..000000000 Binary files a/public/img/emoji/small_blue_diamond.png and /dev/null differ diff --git a/public/img/emoji/small_orange_diamond.png b/public/img/emoji/small_orange_diamond.png deleted file mode 100644 index 04941d37b..000000000 Binary files a/public/img/emoji/small_orange_diamond.png and /dev/null differ diff --git a/public/img/emoji/small_red_triangle.png b/public/img/emoji/small_red_triangle.png deleted file mode 100644 index 8c4428da8..000000000 Binary files a/public/img/emoji/small_red_triangle.png and /dev/null differ diff --git a/public/img/emoji/small_red_triangle_down.png b/public/img/emoji/small_red_triangle_down.png deleted file mode 100644 index 94832f060..000000000 Binary files a/public/img/emoji/small_red_triangle_down.png and /dev/null differ diff --git a/public/img/emoji/smile.png b/public/img/emoji/smile.png deleted file mode 100644 index 81a839689..000000000 Binary files a/public/img/emoji/smile.png and /dev/null differ diff --git a/public/img/emoji/smile_cat.png b/public/img/emoji/smile_cat.png deleted file mode 100644 index ad333ba3b..000000000 Binary files a/public/img/emoji/smile_cat.png and /dev/null differ diff --git a/public/img/emoji/smiley.png b/public/img/emoji/smiley.png deleted file mode 100644 index 77b581d68..000000000 Binary files a/public/img/emoji/smiley.png and /dev/null differ diff --git a/public/img/emoji/smiley_cat.png b/public/img/emoji/smiley_cat.png deleted file mode 100644 index dbf1b0276..000000000 Binary files a/public/img/emoji/smiley_cat.png and /dev/null differ diff --git a/public/img/emoji/smiling_imp.png b/public/img/emoji/smiling_imp.png deleted file mode 100644 index d90404930..000000000 Binary files a/public/img/emoji/smiling_imp.png and /dev/null differ diff --git a/public/img/emoji/smirk.png b/public/img/emoji/smirk.png deleted file mode 100644 index bc6e5082c..000000000 Binary files a/public/img/emoji/smirk.png and /dev/null differ diff --git a/public/img/emoji/smirk_cat.png b/public/img/emoji/smirk_cat.png deleted file mode 100644 index 351565e24..000000000 Binary files a/public/img/emoji/smirk_cat.png and /dev/null differ diff --git a/public/img/emoji/smoking.png b/public/img/emoji/smoking.png deleted file mode 100644 index 4aad6cbd7..000000000 Binary files a/public/img/emoji/smoking.png and /dev/null differ diff --git a/public/img/emoji/snail.png b/public/img/emoji/snail.png deleted file mode 100644 index e75e69a84..000000000 Binary files a/public/img/emoji/snail.png and /dev/null differ diff --git a/public/img/emoji/snake.png b/public/img/emoji/snake.png deleted file mode 100644 index ef58933e2..000000000 Binary files a/public/img/emoji/snake.png and /dev/null differ diff --git a/public/img/emoji/snowboarder.png b/public/img/emoji/snowboarder.png deleted file mode 100644 index aeda5c8d8..000000000 Binary files a/public/img/emoji/snowboarder.png and /dev/null differ diff --git a/public/img/emoji/snowflake.png b/public/img/emoji/snowflake.png deleted file mode 100644 index 54b68ff4f..000000000 Binary files a/public/img/emoji/snowflake.png and /dev/null differ diff --git a/public/img/emoji/snowman.png b/public/img/emoji/snowman.png deleted file mode 100644 index a97902e53..000000000 Binary files a/public/img/emoji/snowman.png and /dev/null differ diff --git a/public/img/emoji/sob.png b/public/img/emoji/sob.png deleted file mode 100644 index 1561df92e..000000000 Binary files a/public/img/emoji/sob.png and /dev/null differ diff --git a/public/img/emoji/soccer.png b/public/img/emoji/soccer.png deleted file mode 100644 index 1e118b5b1..000000000 Binary files a/public/img/emoji/soccer.png and /dev/null differ diff --git a/public/img/emoji/soon.png b/public/img/emoji/soon.png deleted file mode 100644 index 2cf46df25..000000000 Binary files a/public/img/emoji/soon.png and /dev/null differ diff --git a/public/img/emoji/sos.png b/public/img/emoji/sos.png deleted file mode 100644 index e3e16ef73..000000000 Binary files a/public/img/emoji/sos.png and /dev/null differ diff --git a/public/img/emoji/sound.png b/public/img/emoji/sound.png deleted file mode 100644 index 6aa4dbff4..000000000 Binary files a/public/img/emoji/sound.png and /dev/null differ diff --git a/public/img/emoji/space_invader.png b/public/img/emoji/space_invader.png deleted file mode 100644 index 384049167..000000000 Binary files a/public/img/emoji/space_invader.png and /dev/null differ diff --git a/public/img/emoji/spades.png b/public/img/emoji/spades.png deleted file mode 100644 index 133a1aba8..000000000 Binary files a/public/img/emoji/spades.png and /dev/null differ diff --git a/public/img/emoji/spaghetti.png b/public/img/emoji/spaghetti.png deleted file mode 100644 index 08de243f5..000000000 Binary files a/public/img/emoji/spaghetti.png and /dev/null differ diff --git a/public/img/emoji/sparkle.png b/public/img/emoji/sparkle.png deleted file mode 100644 index 59637de04..000000000 Binary files a/public/img/emoji/sparkle.png and /dev/null differ diff --git a/public/img/emoji/sparkler.png b/public/img/emoji/sparkler.png deleted file mode 100644 index 4aabd7e0e..000000000 Binary files a/public/img/emoji/sparkler.png and /dev/null differ diff --git a/public/img/emoji/sparkles.png b/public/img/emoji/sparkles.png deleted file mode 100644 index 51307bcfc..000000000 Binary files a/public/img/emoji/sparkles.png and /dev/null differ diff --git a/public/img/emoji/sparkling_heart.png b/public/img/emoji/sparkling_heart.png deleted file mode 100644 index 64ac06663..000000000 Binary files a/public/img/emoji/sparkling_heart.png and /dev/null differ diff --git a/public/img/emoji/speak_no_evil.png b/public/img/emoji/speak_no_evil.png deleted file mode 100644 index 87944c4de..000000000 Binary files a/public/img/emoji/speak_no_evil.png and /dev/null differ diff --git a/public/img/emoji/speaker.png b/public/img/emoji/speaker.png deleted file mode 100644 index 470476e18..000000000 Binary files a/public/img/emoji/speaker.png and /dev/null differ diff --git a/public/img/emoji/speech_balloon.png b/public/img/emoji/speech_balloon.png deleted file mode 100644 index 2896c2788..000000000 Binary files a/public/img/emoji/speech_balloon.png and /dev/null differ diff --git a/public/img/emoji/speedboat.png b/public/img/emoji/speedboat.png deleted file mode 100644 index da6689b3b..000000000 Binary files a/public/img/emoji/speedboat.png and /dev/null differ diff --git a/public/img/emoji/squirrel.png b/public/img/emoji/squirrel.png deleted file mode 100644 index a58a47f62..000000000 Binary files a/public/img/emoji/squirrel.png and /dev/null differ diff --git a/public/img/emoji/star.png b/public/img/emoji/star.png deleted file mode 100644 index 1bfddc862..000000000 Binary files a/public/img/emoji/star.png and /dev/null differ diff --git a/public/img/emoji/star2.png b/public/img/emoji/star2.png deleted file mode 100644 index 8b40ff4c8..000000000 Binary files a/public/img/emoji/star2.png and /dev/null differ diff --git a/public/img/emoji/stars.png b/public/img/emoji/stars.png deleted file mode 100644 index 097a84241..000000000 Binary files a/public/img/emoji/stars.png and /dev/null differ diff --git a/public/img/emoji/station.png b/public/img/emoji/station.png deleted file mode 100644 index e77daa8a7..000000000 Binary files a/public/img/emoji/station.png and /dev/null differ diff --git a/public/img/emoji/statue_of_liberty.png b/public/img/emoji/statue_of_liberty.png deleted file mode 100644 index 9ad902806..000000000 Binary files a/public/img/emoji/statue_of_liberty.png and /dev/null differ diff --git a/public/img/emoji/steam_locomotive.png b/public/img/emoji/steam_locomotive.png deleted file mode 100644 index 549507766..000000000 Binary files a/public/img/emoji/steam_locomotive.png and /dev/null differ diff --git a/public/img/emoji/stew.png b/public/img/emoji/stew.png deleted file mode 100644 index e9687f9ec..000000000 Binary files a/public/img/emoji/stew.png and /dev/null differ diff --git a/public/img/emoji/straight_ruler.png b/public/img/emoji/straight_ruler.png deleted file mode 100644 index d96658ea1..000000000 Binary files a/public/img/emoji/straight_ruler.png and /dev/null differ diff --git a/public/img/emoji/strawberry.png b/public/img/emoji/strawberry.png deleted file mode 100644 index 13eb827ab..000000000 Binary files a/public/img/emoji/strawberry.png and /dev/null differ diff --git a/public/img/emoji/stuck_out_tongue.png b/public/img/emoji/stuck_out_tongue.png deleted file mode 100644 index fa7b58e23..000000000 Binary files a/public/img/emoji/stuck_out_tongue.png and /dev/null differ diff --git a/public/img/emoji/stuck_out_tongue_closed_eyes.png b/public/img/emoji/stuck_out_tongue_closed_eyes.png deleted file mode 100644 index 333716ee1..000000000 Binary files a/public/img/emoji/stuck_out_tongue_closed_eyes.png and /dev/null differ diff --git a/public/img/emoji/stuck_out_tongue_winking_eye.png b/public/img/emoji/stuck_out_tongue_winking_eye.png deleted file mode 100644 index 6ae9d497d..000000000 Binary files a/public/img/emoji/stuck_out_tongue_winking_eye.png and /dev/null differ diff --git a/public/img/emoji/sun_with_face.png b/public/img/emoji/sun_with_face.png deleted file mode 100644 index ee276636f..000000000 Binary files a/public/img/emoji/sun_with_face.png and /dev/null differ diff --git a/public/img/emoji/sunflower.png b/public/img/emoji/sunflower.png deleted file mode 100644 index d9bad194a..000000000 Binary files a/public/img/emoji/sunflower.png and /dev/null differ diff --git a/public/img/emoji/sunglasses.png b/public/img/emoji/sunglasses.png deleted file mode 100644 index f2e524787..000000000 Binary files a/public/img/emoji/sunglasses.png and /dev/null differ diff --git a/public/img/emoji/sunny.png b/public/img/emoji/sunny.png deleted file mode 100644 index d23c095e0..000000000 Binary files a/public/img/emoji/sunny.png and /dev/null differ diff --git a/public/img/emoji/sunrise.png b/public/img/emoji/sunrise.png deleted file mode 100644 index ec58dcc94..000000000 Binary files a/public/img/emoji/sunrise.png and /dev/null differ diff --git a/public/img/emoji/sunrise_over_mountains.png b/public/img/emoji/sunrise_over_mountains.png deleted file mode 100644 index ebc3db146..000000000 Binary files a/public/img/emoji/sunrise_over_mountains.png and /dev/null differ diff --git a/public/img/emoji/surfer.png b/public/img/emoji/surfer.png deleted file mode 100644 index b067e8cb3..000000000 Binary files a/public/img/emoji/surfer.png and /dev/null differ diff --git a/public/img/emoji/sushi.png b/public/img/emoji/sushi.png deleted file mode 100644 index 0d179bd97..000000000 Binary files a/public/img/emoji/sushi.png and /dev/null differ diff --git a/public/img/emoji/suspect.png b/public/img/emoji/suspect.png deleted file mode 100644 index 58e8921c0..000000000 Binary files a/public/img/emoji/suspect.png and /dev/null differ diff --git a/public/img/emoji/suspension_railway.png b/public/img/emoji/suspension_railway.png deleted file mode 100644 index aaa45f61f..000000000 Binary files a/public/img/emoji/suspension_railway.png and /dev/null differ diff --git a/public/img/emoji/sweat.png b/public/img/emoji/sweat.png deleted file mode 100644 index e894b7699..000000000 Binary files a/public/img/emoji/sweat.png and /dev/null differ diff --git a/public/img/emoji/sweat_drops.png b/public/img/emoji/sweat_drops.png deleted file mode 100644 index a83b3e960..000000000 Binary files a/public/img/emoji/sweat_drops.png and /dev/null differ diff --git a/public/img/emoji/sweat_smile.png b/public/img/emoji/sweat_smile.png deleted file mode 100644 index 3903f717f..000000000 Binary files a/public/img/emoji/sweat_smile.png and /dev/null differ diff --git a/public/img/emoji/sweet_potato.png b/public/img/emoji/sweet_potato.png deleted file mode 100644 index cde7880a1..000000000 Binary files a/public/img/emoji/sweet_potato.png and /dev/null differ diff --git a/public/img/emoji/swimmer.png b/public/img/emoji/swimmer.png deleted file mode 100644 index d3878a065..000000000 Binary files a/public/img/emoji/swimmer.png and /dev/null differ diff --git a/public/img/emoji/symbols.png b/public/img/emoji/symbols.png deleted file mode 100644 index 16bc1da92..000000000 Binary files a/public/img/emoji/symbols.png and /dev/null differ diff --git a/public/img/emoji/syringe.png b/public/img/emoji/syringe.png deleted file mode 100644 index 36aa8fed5..000000000 Binary files a/public/img/emoji/syringe.png and /dev/null differ diff --git a/public/img/emoji/tada.png b/public/img/emoji/tada.png deleted file mode 100644 index 7411b5266..000000000 Binary files a/public/img/emoji/tada.png and /dev/null differ diff --git a/public/img/emoji/tanabata_tree.png b/public/img/emoji/tanabata_tree.png deleted file mode 100644 index 6dea4b2d4..000000000 Binary files a/public/img/emoji/tanabata_tree.png and /dev/null differ diff --git a/public/img/emoji/tangerine.png b/public/img/emoji/tangerine.png deleted file mode 100644 index fc9d4f82a..000000000 Binary files a/public/img/emoji/tangerine.png and /dev/null differ diff --git a/public/img/emoji/taurus.png b/public/img/emoji/taurus.png deleted file mode 100644 index 6af582f69..000000000 Binary files a/public/img/emoji/taurus.png and /dev/null differ diff --git a/public/img/emoji/taxi.png b/public/img/emoji/taxi.png deleted file mode 100644 index 60a50d365..000000000 Binary files a/public/img/emoji/taxi.png and /dev/null differ diff --git a/public/img/emoji/tea.png b/public/img/emoji/tea.png deleted file mode 100644 index 3ece0b708..000000000 Binary files a/public/img/emoji/tea.png and /dev/null differ diff --git a/public/img/emoji/telephone.png b/public/img/emoji/telephone.png deleted file mode 100644 index 87d2559b5..000000000 Binary files a/public/img/emoji/telephone.png and /dev/null differ diff --git a/public/img/emoji/telephone_receiver.png b/public/img/emoji/telephone_receiver.png deleted file mode 100644 index 36e21e012..000000000 Binary files a/public/img/emoji/telephone_receiver.png and /dev/null differ diff --git a/public/img/emoji/telescope.png b/public/img/emoji/telescope.png deleted file mode 100644 index 98e57558a..000000000 Binary files a/public/img/emoji/telescope.png and /dev/null differ diff --git a/public/img/emoji/tennis.png b/public/img/emoji/tennis.png deleted file mode 100644 index 278d904ee..000000000 Binary files a/public/img/emoji/tennis.png and /dev/null differ diff --git a/public/img/emoji/tent.png b/public/img/emoji/tent.png deleted file mode 100644 index 5c0d20e48..000000000 Binary files a/public/img/emoji/tent.png and /dev/null differ diff --git a/public/img/emoji/thought_balloon.png b/public/img/emoji/thought_balloon.png deleted file mode 100644 index febe30d05..000000000 Binary files a/public/img/emoji/thought_balloon.png and /dev/null differ diff --git a/public/img/emoji/three.png b/public/img/emoji/three.png deleted file mode 100644 index 55644c990..000000000 Binary files a/public/img/emoji/three.png and /dev/null differ diff --git a/public/img/emoji/thumbsdown.png b/public/img/emoji/thumbsdown.png deleted file mode 100644 index 41c6b825d..000000000 Binary files a/public/img/emoji/thumbsdown.png and /dev/null differ diff --git a/public/img/emoji/thumbsup.png b/public/img/emoji/thumbsup.png deleted file mode 100644 index 81786c1d8..000000000 Binary files a/public/img/emoji/thumbsup.png and /dev/null differ diff --git a/public/img/emoji/ticket.png b/public/img/emoji/ticket.png deleted file mode 100644 index cdacf1a70..000000000 Binary files a/public/img/emoji/ticket.png and /dev/null differ diff --git a/public/img/emoji/tiger.png b/public/img/emoji/tiger.png deleted file mode 100644 index d6cc84a3b..000000000 Binary files a/public/img/emoji/tiger.png and /dev/null differ diff --git a/public/img/emoji/tiger2.png b/public/img/emoji/tiger2.png deleted file mode 100644 index b0c7d8dc3..000000000 Binary files a/public/img/emoji/tiger2.png and /dev/null differ diff --git a/public/img/emoji/tired_face.png b/public/img/emoji/tired_face.png deleted file mode 100644 index 77b783453..000000000 Binary files a/public/img/emoji/tired_face.png and /dev/null differ diff --git a/public/img/emoji/tm.png b/public/img/emoji/tm.png deleted file mode 100644 index c7dec75a3..000000000 Binary files a/public/img/emoji/tm.png and /dev/null differ diff --git a/public/img/emoji/toilet.png b/public/img/emoji/toilet.png deleted file mode 100644 index e5cc4119a..000000000 Binary files a/public/img/emoji/toilet.png and /dev/null differ diff --git a/public/img/emoji/tokyo_tower.png b/public/img/emoji/tokyo_tower.png deleted file mode 100644 index e1cbd7a3c..000000000 Binary files a/public/img/emoji/tokyo_tower.png and /dev/null differ diff --git a/public/img/emoji/tomato.png b/public/img/emoji/tomato.png deleted file mode 100644 index a129700bb..000000000 Binary files a/public/img/emoji/tomato.png and /dev/null differ diff --git a/public/img/emoji/tongue.png b/public/img/emoji/tongue.png deleted file mode 100644 index b0bab1207..000000000 Binary files a/public/img/emoji/tongue.png and /dev/null differ diff --git a/public/img/emoji/top.png b/public/img/emoji/top.png deleted file mode 100644 index 5aa4dd442..000000000 Binary files a/public/img/emoji/top.png and /dev/null differ diff --git a/public/img/emoji/tophat.png b/public/img/emoji/tophat.png deleted file mode 100644 index 7d27134d6..000000000 Binary files a/public/img/emoji/tophat.png and /dev/null differ diff --git a/public/img/emoji/tractor.png b/public/img/emoji/tractor.png deleted file mode 100644 index 058fd3eda..000000000 Binary files a/public/img/emoji/tractor.png and /dev/null differ diff --git a/public/img/emoji/traffic_light.png b/public/img/emoji/traffic_light.png deleted file mode 100644 index 1facb276c..000000000 Binary files a/public/img/emoji/traffic_light.png and /dev/null differ diff --git a/public/img/emoji/train.png b/public/img/emoji/train.png deleted file mode 100644 index 3202d80ea..000000000 Binary files a/public/img/emoji/train.png and /dev/null differ diff --git a/public/img/emoji/train2.png b/public/img/emoji/train2.png deleted file mode 100644 index 9c0d3ab64..000000000 Binary files a/public/img/emoji/train2.png and /dev/null differ diff --git a/public/img/emoji/tram.png b/public/img/emoji/tram.png deleted file mode 100644 index 5eb29fb71..000000000 Binary files a/public/img/emoji/tram.png and /dev/null differ diff --git a/public/img/emoji/triangular_flag_on_post.png b/public/img/emoji/triangular_flag_on_post.png deleted file mode 100644 index f9a3f32d7..000000000 Binary files a/public/img/emoji/triangular_flag_on_post.png and /dev/null differ diff --git a/public/img/emoji/triangular_ruler.png b/public/img/emoji/triangular_ruler.png deleted file mode 100644 index 383677cb7..000000000 Binary files a/public/img/emoji/triangular_ruler.png and /dev/null differ diff --git a/public/img/emoji/trident.png b/public/img/emoji/trident.png deleted file mode 100644 index d79a7b4cc..000000000 Binary files a/public/img/emoji/trident.png and /dev/null differ diff --git a/public/img/emoji/triumph.png b/public/img/emoji/triumph.png deleted file mode 100644 index 92f93bd10..000000000 Binary files a/public/img/emoji/triumph.png and /dev/null differ diff --git a/public/img/emoji/trolleybus.png b/public/img/emoji/trolleybus.png deleted file mode 100644 index b9740a53f..000000000 Binary files a/public/img/emoji/trolleybus.png and /dev/null differ diff --git a/public/img/emoji/trollface.png b/public/img/emoji/trollface.png deleted file mode 100644 index 119d77e73..000000000 Binary files a/public/img/emoji/trollface.png and /dev/null differ diff --git a/public/img/emoji/trophy.png b/public/img/emoji/trophy.png deleted file mode 100644 index 95d3b63f5..000000000 Binary files a/public/img/emoji/trophy.png and /dev/null differ diff --git a/public/img/emoji/tropical_drink.png b/public/img/emoji/tropical_drink.png deleted file mode 100644 index 55ca9eeda..000000000 Binary files a/public/img/emoji/tropical_drink.png and /dev/null differ diff --git a/public/img/emoji/tropical_fish.png b/public/img/emoji/tropical_fish.png deleted file mode 100644 index a6d734987..000000000 Binary files a/public/img/emoji/tropical_fish.png and /dev/null differ diff --git a/public/img/emoji/truck.png b/public/img/emoji/truck.png deleted file mode 100644 index 3f25ba1f9..000000000 Binary files a/public/img/emoji/truck.png and /dev/null differ diff --git a/public/img/emoji/trumpet.png b/public/img/emoji/trumpet.png deleted file mode 100644 index c84cfb13e..000000000 Binary files a/public/img/emoji/trumpet.png and /dev/null differ diff --git a/public/img/emoji/tshirt.png b/public/img/emoji/tshirt.png deleted file mode 100644 index 297a6d63e..000000000 Binary files a/public/img/emoji/tshirt.png and /dev/null differ diff --git a/public/img/emoji/tulip.png b/public/img/emoji/tulip.png deleted file mode 100644 index b3ee1102a..000000000 Binary files a/public/img/emoji/tulip.png and /dev/null differ diff --git a/public/img/emoji/turtle.png b/public/img/emoji/turtle.png deleted file mode 100644 index 04d1d9684..000000000 Binary files a/public/img/emoji/turtle.png and /dev/null differ diff --git a/public/img/emoji/tv.png b/public/img/emoji/tv.png deleted file mode 100644 index 803dc3d41..000000000 Binary files a/public/img/emoji/tv.png and /dev/null differ diff --git a/public/img/emoji/twisted_rightwards_arrows.png b/public/img/emoji/twisted_rightwards_arrows.png deleted file mode 100644 index 25cde18b2..000000000 Binary files a/public/img/emoji/twisted_rightwards_arrows.png and /dev/null differ diff --git a/public/img/emoji/two.png b/public/img/emoji/two.png deleted file mode 100644 index c191f8a32..000000000 Binary files a/public/img/emoji/two.png and /dev/null differ diff --git a/public/img/emoji/two_hearts.png b/public/img/emoji/two_hearts.png deleted file mode 100644 index b189e9aea..000000000 Binary files a/public/img/emoji/two_hearts.png and /dev/null differ diff --git a/public/img/emoji/two_men_holding_hands.png b/public/img/emoji/two_men_holding_hands.png deleted file mode 100644 index d1099f21f..000000000 Binary files a/public/img/emoji/two_men_holding_hands.png and /dev/null differ diff --git a/public/img/emoji/two_women_holding_hands.png b/public/img/emoji/two_women_holding_hands.png deleted file mode 100644 index 619646c4e..000000000 Binary files a/public/img/emoji/two_women_holding_hands.png and /dev/null differ diff --git a/public/img/emoji/u5272.png b/public/img/emoji/u5272.png deleted file mode 100644 index 2148253fc..000000000 Binary files a/public/img/emoji/u5272.png and /dev/null differ diff --git a/public/img/emoji/u5408.png b/public/img/emoji/u5408.png deleted file mode 100644 index 03ab0d874..000000000 Binary files a/public/img/emoji/u5408.png and /dev/null differ diff --git a/public/img/emoji/u55b6.png b/public/img/emoji/u55b6.png deleted file mode 100644 index ba946d3f3..000000000 Binary files a/public/img/emoji/u55b6.png and /dev/null differ diff --git a/public/img/emoji/u6307.png b/public/img/emoji/u6307.png deleted file mode 100644 index 6557f5672..000000000 Binary files a/public/img/emoji/u6307.png and /dev/null differ diff --git a/public/img/emoji/u6708.png b/public/img/emoji/u6708.png deleted file mode 100644 index e4dfe5aa7..000000000 Binary files a/public/img/emoji/u6708.png and /dev/null differ diff --git a/public/img/emoji/u6709.png b/public/img/emoji/u6709.png deleted file mode 100644 index cd8fb3f62..000000000 Binary files a/public/img/emoji/u6709.png and /dev/null differ diff --git a/public/img/emoji/u6e80.png b/public/img/emoji/u6e80.png deleted file mode 100644 index 5df1cb878..000000000 Binary files a/public/img/emoji/u6e80.png and /dev/null differ diff --git a/public/img/emoji/u7121.png b/public/img/emoji/u7121.png deleted file mode 100644 index 25f694ed3..000000000 Binary files a/public/img/emoji/u7121.png and /dev/null differ diff --git a/public/img/emoji/u7533.png b/public/img/emoji/u7533.png deleted file mode 100644 index fc4a9901b..000000000 Binary files a/public/img/emoji/u7533.png and /dev/null differ diff --git a/public/img/emoji/u7981.png b/public/img/emoji/u7981.png deleted file mode 100644 index f550a573d..000000000 Binary files a/public/img/emoji/u7981.png and /dev/null differ diff --git a/public/img/emoji/u7a7a.png b/public/img/emoji/u7a7a.png deleted file mode 100644 index c05f5cff7..000000000 Binary files a/public/img/emoji/u7a7a.png and /dev/null differ diff --git a/public/img/emoji/uk.png b/public/img/emoji/uk.png deleted file mode 100644 index 2a62c7a08..000000000 Binary files a/public/img/emoji/uk.png and /dev/null differ diff --git a/public/img/emoji/umbrella.png b/public/img/emoji/umbrella.png deleted file mode 100644 index 1db722fa6..000000000 Binary files a/public/img/emoji/umbrella.png and /dev/null differ diff --git a/public/img/emoji/unamused.png b/public/img/emoji/unamused.png deleted file mode 100644 index 3722e6f57..000000000 Binary files a/public/img/emoji/unamused.png and /dev/null differ diff --git a/public/img/emoji/underage.png b/public/img/emoji/underage.png deleted file mode 100644 index a789b3c62..000000000 Binary files a/public/img/emoji/underage.png and /dev/null differ diff --git a/public/img/emoji/unlock.png b/public/img/emoji/unlock.png deleted file mode 100644 index 22b429cd0..000000000 Binary files a/public/img/emoji/unlock.png and /dev/null differ diff --git a/public/img/emoji/up.png b/public/img/emoji/up.png deleted file mode 100644 index 829219a86..000000000 Binary files a/public/img/emoji/up.png and /dev/null differ diff --git a/public/img/emoji/us.png b/public/img/emoji/us.png deleted file mode 100644 index 38137669a..000000000 Binary files a/public/img/emoji/us.png and /dev/null differ diff --git a/public/img/emoji/v.png b/public/img/emoji/v.png deleted file mode 100644 index f61267c28..000000000 Binary files a/public/img/emoji/v.png and /dev/null differ diff --git a/public/img/emoji/vertical_traffic_light.png b/public/img/emoji/vertical_traffic_light.png deleted file mode 100644 index 7a5ba35f0..000000000 Binary files a/public/img/emoji/vertical_traffic_light.png and /dev/null differ diff --git a/public/img/emoji/vhs.png b/public/img/emoji/vhs.png deleted file mode 100644 index 881081c17..000000000 Binary files a/public/img/emoji/vhs.png and /dev/null differ diff --git a/public/img/emoji/vibration_mode.png b/public/img/emoji/vibration_mode.png deleted file mode 100644 index a716e96c6..000000000 Binary files a/public/img/emoji/vibration_mode.png and /dev/null differ diff --git a/public/img/emoji/video_camera.png b/public/img/emoji/video_camera.png deleted file mode 100644 index 274cecdd6..000000000 Binary files a/public/img/emoji/video_camera.png and /dev/null differ diff --git a/public/img/emoji/video_game.png b/public/img/emoji/video_game.png deleted file mode 100644 index e265a3bd8..000000000 Binary files a/public/img/emoji/video_game.png and /dev/null differ diff --git a/public/img/emoji/violin.png b/public/img/emoji/violin.png deleted file mode 100644 index 69347b545..000000000 Binary files a/public/img/emoji/violin.png and /dev/null differ diff --git a/public/img/emoji/virgo.png b/public/img/emoji/virgo.png deleted file mode 100644 index 72e1763f5..000000000 Binary files a/public/img/emoji/virgo.png and /dev/null differ diff --git a/public/img/emoji/volcano.png b/public/img/emoji/volcano.png deleted file mode 100644 index 9b434539b..000000000 Binary files a/public/img/emoji/volcano.png and /dev/null differ diff --git a/public/img/emoji/vs.png b/public/img/emoji/vs.png deleted file mode 100644 index 863638850..000000000 Binary files a/public/img/emoji/vs.png and /dev/null differ diff --git a/public/img/emoji/walking.png b/public/img/emoji/walking.png deleted file mode 100644 index 52bc0381c..000000000 Binary files a/public/img/emoji/walking.png and /dev/null differ diff --git a/public/img/emoji/waning_crescent_moon.png b/public/img/emoji/waning_crescent_moon.png deleted file mode 100644 index 30387780f..000000000 Binary files a/public/img/emoji/waning_crescent_moon.png and /dev/null differ diff --git a/public/img/emoji/waning_gibbous_moon.png b/public/img/emoji/waning_gibbous_moon.png deleted file mode 100644 index 510099070..000000000 Binary files a/public/img/emoji/waning_gibbous_moon.png and /dev/null differ diff --git a/public/img/emoji/warning.png b/public/img/emoji/warning.png deleted file mode 100644 index db6f96f02..000000000 Binary files a/public/img/emoji/warning.png and /dev/null differ diff --git a/public/img/emoji/watch.png b/public/img/emoji/watch.png deleted file mode 100644 index d503bb87c..000000000 Binary files a/public/img/emoji/watch.png and /dev/null differ diff --git a/public/img/emoji/water_buffalo.png b/public/img/emoji/water_buffalo.png deleted file mode 100644 index 3bcde3edd..000000000 Binary files a/public/img/emoji/water_buffalo.png and /dev/null differ diff --git a/public/img/emoji/watermelon.png b/public/img/emoji/watermelon.png deleted file mode 100644 index fc212be78..000000000 Binary files a/public/img/emoji/watermelon.png and /dev/null differ diff --git a/public/img/emoji/wave.png b/public/img/emoji/wave.png deleted file mode 100644 index 56e6e822b..000000000 Binary files a/public/img/emoji/wave.png and /dev/null differ diff --git a/public/img/emoji/wavy_dash.png b/public/img/emoji/wavy_dash.png deleted file mode 100644 index 5a74e5c7a..000000000 Binary files a/public/img/emoji/wavy_dash.png and /dev/null differ diff --git a/public/img/emoji/waxing_crescent_moon.png b/public/img/emoji/waxing_crescent_moon.png deleted file mode 100644 index c8f13dd31..000000000 Binary files a/public/img/emoji/waxing_crescent_moon.png and /dev/null differ diff --git a/public/img/emoji/waxing_gibbous_moon.png b/public/img/emoji/waxing_gibbous_moon.png deleted file mode 100644 index 54e7ec671..000000000 Binary files a/public/img/emoji/waxing_gibbous_moon.png and /dev/null differ diff --git a/public/img/emoji/wc.png b/public/img/emoji/wc.png deleted file mode 100644 index dfe84d2a7..000000000 Binary files a/public/img/emoji/wc.png and /dev/null differ diff --git a/public/img/emoji/weary.png b/public/img/emoji/weary.png deleted file mode 100644 index 0c5475411..000000000 Binary files a/public/img/emoji/weary.png and /dev/null differ diff --git a/public/img/emoji/wedding.png b/public/img/emoji/wedding.png deleted file mode 100644 index ead19d52c..000000000 Binary files a/public/img/emoji/wedding.png and /dev/null differ diff --git a/public/img/emoji/whale.png b/public/img/emoji/whale.png deleted file mode 100644 index 5bb113e42..000000000 Binary files a/public/img/emoji/whale.png and /dev/null differ diff --git a/public/img/emoji/whale2.png b/public/img/emoji/whale2.png deleted file mode 100644 index 0ef4ea94f..000000000 Binary files a/public/img/emoji/whale2.png and /dev/null differ diff --git a/public/img/emoji/wheelchair.png b/public/img/emoji/wheelchair.png deleted file mode 100644 index eddcdd797..000000000 Binary files a/public/img/emoji/wheelchair.png and /dev/null differ diff --git a/public/img/emoji/white_check_mark.png b/public/img/emoji/white_check_mark.png deleted file mode 100644 index 61dc0583c..000000000 Binary files a/public/img/emoji/white_check_mark.png and /dev/null differ diff --git a/public/img/emoji/white_circle.png b/public/img/emoji/white_circle.png deleted file mode 100644 index 3f648d1bd..000000000 Binary files a/public/img/emoji/white_circle.png and /dev/null differ diff --git a/public/img/emoji/white_flower.png b/public/img/emoji/white_flower.png deleted file mode 100644 index c0929d0dd..000000000 Binary files a/public/img/emoji/white_flower.png and /dev/null differ diff --git a/public/img/emoji/white_large_square.png b/public/img/emoji/white_large_square.png deleted file mode 100644 index 60cb19a13..000000000 Binary files a/public/img/emoji/white_large_square.png and /dev/null differ diff --git a/public/img/emoji/white_medium_small_square.png b/public/img/emoji/white_medium_small_square.png deleted file mode 100644 index 1a35981a3..000000000 Binary files a/public/img/emoji/white_medium_small_square.png and /dev/null differ diff --git a/public/img/emoji/white_medium_square.png b/public/img/emoji/white_medium_square.png deleted file mode 100644 index 3bcd1512b..000000000 Binary files a/public/img/emoji/white_medium_square.png and /dev/null differ diff --git a/public/img/emoji/white_small_square.png b/public/img/emoji/white_small_square.png deleted file mode 100644 index 65d0be20e..000000000 Binary files a/public/img/emoji/white_small_square.png and /dev/null differ diff --git a/public/img/emoji/white_square_button.png b/public/img/emoji/white_square_button.png deleted file mode 100644 index ad54d55c0..000000000 Binary files a/public/img/emoji/white_square_button.png and /dev/null differ diff --git a/public/img/emoji/wind_chime.png b/public/img/emoji/wind_chime.png deleted file mode 100644 index efacf5dd4..000000000 Binary files a/public/img/emoji/wind_chime.png and /dev/null differ diff --git a/public/img/emoji/wine_glass.png b/public/img/emoji/wine_glass.png deleted file mode 100644 index 82b0f0005..000000000 Binary files a/public/img/emoji/wine_glass.png and /dev/null differ diff --git a/public/img/emoji/wink.png b/public/img/emoji/wink.png deleted file mode 100644 index 756766dd3..000000000 Binary files a/public/img/emoji/wink.png and /dev/null differ diff --git a/public/img/emoji/wolf.png b/public/img/emoji/wolf.png deleted file mode 100644 index c60c96895..000000000 Binary files a/public/img/emoji/wolf.png and /dev/null differ diff --git a/public/img/emoji/woman.png b/public/img/emoji/woman.png deleted file mode 100644 index 6bf0d2b12..000000000 Binary files a/public/img/emoji/woman.png and /dev/null differ diff --git a/public/img/emoji/womans_clothes.png b/public/img/emoji/womans_clothes.png deleted file mode 100644 index aa297c7b6..000000000 Binary files a/public/img/emoji/womans_clothes.png and /dev/null differ diff --git a/public/img/emoji/womans_hat.png b/public/img/emoji/womans_hat.png deleted file mode 100644 index 4cb2e6a69..000000000 Binary files a/public/img/emoji/womans_hat.png and /dev/null differ diff --git a/public/img/emoji/womens.png b/public/img/emoji/womens.png deleted file mode 100644 index 2fab29660..000000000 Binary files a/public/img/emoji/womens.png and /dev/null differ diff --git a/public/img/emoji/worried.png b/public/img/emoji/worried.png deleted file mode 100644 index bfa1856c0..000000000 Binary files a/public/img/emoji/worried.png and /dev/null differ diff --git a/public/img/emoji/wrench.png b/public/img/emoji/wrench.png deleted file mode 100644 index a87072ad1..000000000 Binary files a/public/img/emoji/wrench.png and /dev/null differ diff --git a/public/img/emoji/x.png b/public/img/emoji/x.png deleted file mode 100644 index dff9efa8b..000000000 Binary files a/public/img/emoji/x.png and /dev/null differ diff --git a/public/img/emoji/yellow_heart.png b/public/img/emoji/yellow_heart.png deleted file mode 100644 index fa41ce78a..000000000 Binary files a/public/img/emoji/yellow_heart.png and /dev/null differ diff --git a/public/img/emoji/yen.png b/public/img/emoji/yen.png deleted file mode 100644 index 139bc936e..000000000 Binary files a/public/img/emoji/yen.png and /dev/null differ diff --git a/public/img/emoji/yum.png b/public/img/emoji/yum.png deleted file mode 100644 index fc39637ec..000000000 Binary files a/public/img/emoji/yum.png and /dev/null differ diff --git a/public/img/emoji/zap.png b/public/img/emoji/zap.png deleted file mode 100644 index 260c531b9..000000000 Binary files a/public/img/emoji/zap.png and /dev/null differ diff --git a/public/img/emoji/zero.png b/public/img/emoji/zero.png deleted file mode 100644 index 6e57b3343..000000000 Binary files a/public/img/emoji/zero.png and /dev/null differ diff --git a/public/img/emoji/zzz.png b/public/img/emoji/zzz.png deleted file mode 100644 index 30be04655..000000000 Binary files a/public/img/emoji/zzz.png and /dev/null differ diff --git a/public/js/jquery-1.11.3.min.js b/public/js/jquery-1.11.3.min.js deleted file mode 100644 index 0f60b7bd0..000000000 --- a/public/js/jquery-1.11.3.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; - -return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/\s*$/g,ra={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?""!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("'},placeholder:function(e,t){var n="";return t&&(n+=''),e&&(n+=''),n}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.modal=function(o){var a,r=e(this),s=e(t),l=e(n),c=e("body"),u=r.selector||"",d=(new Date).getTime(),f=[],m=arguments[0],g="string"==typeof m,p=[].slice.call(arguments,1),h=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var r,v,b,y,x,C,w,k,S,T=e.isPlainObject(o)?e.extend(!0,{},e.fn.modal.settings,o):e.extend({},e.fn.modal.settings),A=T.selector,R=T.className,P=T.namespace,E=T.error,F="."+P,O="module-"+P,D=e(this),q=e(T.context),j=D.find(A.close),z=this,M=D.data(O);S={initialize:function(){S.verbose("Initializing dimmer",q),S.create.id(),S.create.dimmer(),S.refreshModals(),S.bind.events(),T.observeChanges&&S.observeChanges(),S.instantiate()},instantiate:function(){S.verbose("Storing instance of modal"),M=S,D.data(O,M)},create:{dimmer:function(){var t={debug:T.debug,dimmerName:"modals",duration:{show:T.duration,hide:T.duration}},n=e.extend(!0,t,T.dimmerSettings);return T.inverted&&(n.variation=n.variation!==i?n.variation+" inverted":"inverted"),e.fn.dimmer===i?void S.error(E.dimmer):(S.debug("Creating dimmer with settings",n),y=q.dimmer(n),T.detachable?(S.verbose("Modal is detachable, moving content into dimmer"),y.dimmer("add content",D)):S.set.undetached(),T.blurring&&y.addClass(R.blurring),void(x=y.dimmer("get dimmer")))},id:function(){w=(Math.random().toString(16)+"000000000").substr(2,8),C="."+w,S.verbose("Creating unique id for element",w)}},destroy:function(){S.verbose("Destroying previous modal"),D.removeData(O).off(F),s.off(C),x.off(C),j.off(F),q.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&(k=new MutationObserver(function(e){S.debug("DOM tree modified, refreshing"),S.refresh()}),k.observe(z,{childList:!0,subtree:!0}),S.debug("Setting up mutation observer",k))},refresh:function(){S.remove.scrolling(),S.cacheSizes(),S.set.screenHeight(),S.set.type(),S.set.position()},refreshModals:function(){v=D.siblings(A.modal),r=v.add(D)},attachEvents:function(t,n){var i=e(t);n=e.isFunction(S[n])?S[n]:S.toggle,i.length>0?(S.debug("Attaching modal events to element",t,n),i.off(F).on("click"+F,n)):S.error(E.notFound,t)},bind:{events:function(){S.verbose("Attaching events"),D.on("click"+F,A.close,S.event.close).on("click"+F,A.approve,S.event.approve).on("click"+F,A.deny,S.event.deny),s.on("resize"+C,S.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){return T.onApprove.call(z,e(this))===!1?void S.verbose("Approve callback returned false cancelling hide"):void S.hide()},deny:function(){return T.onDeny.call(z,e(this))===!1?void S.verbose("Deny callback returned false cancelling hide"):void S.hide()},close:function(){S.hide()},click:function(t){var i=e(t.target),o=i.closest(A.modal).length>0,a=e.contains(n.documentElement,t.target);!o&&a&&(S.debug("Dimmer clicked, hiding all modals"),S.is.active()&&(S.remove.clickaway(),T.allowMultiple?S.hide():S.hideAll()))},debounce:function(e,t){clearTimeout(S.timer),S.timer=setTimeout(e,t)},keyboard:function(e){var t=e.which,n=27;t==n&&(T.closable?(S.debug("Escape key pressed hiding modal"),S.hide()):S.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){y.dimmer("is active")&&h(S.refresh)}},toggle:function(){S.is.active()||S.is.animating()?S.hide():S.show()},show:function(t){t=e.isFunction(t)?t:function(){},S.refreshModals(),S.showModal(t)},hide:function(t){t=e.isFunction(t)?t:function(){},S.refreshModals(),S.hideModal(t)},showModal:function(t){t=e.isFunction(t)?t:function(){},S.is.animating()||!S.is.active()?(S.showDimmer(),S.cacheSizes(),S.set.position(),S.set.screenHeight(),S.set.type(),S.set.clickaway(),!T.allowMultiple&&S.others.active()?S.hideOthers(S.showModal):(T.onShow.call(z),T.transition&&e.fn.transition!==i&&D.transition("is supported")?(S.debug("Showing modal with css animations"),D.transition({debug:T.debug,animation:T.transition+" in",queue:T.queue,duration:T.duration,useFailSafe:!0,onComplete:function(){T.onVisible.apply(z),S.add.keyboardShortcuts(),S.save.focus(),S.set.active(),T.autofocus&&S.set.autofocus(),t()}})):S.error(E.noTransition))):S.debug("Modal is already visible")},hideModal:function(t,n){return t=e.isFunction(t)?t:function(){},S.debug("Hiding modal"),T.onHide.call(z,e(this))===!1?void S.verbose("Hide callback returned false cancelling hide"):void((S.is.animating()||S.is.active())&&(T.transition&&e.fn.transition!==i&&D.transition("is supported")?(S.remove.active(),D.transition({debug:T.debug,animation:T.transition+" out",queue:T.queue,duration:T.duration,useFailSafe:!0,onStart:function(){S.others.active()||n||S.hideDimmer(),S.remove.keyboardShortcuts()},onComplete:function(){T.onHidden.call(z),S.restore.focus(),t()}})):S.error(E.noTransition)))},showDimmer:function(){y.dimmer("is animating")||!y.dimmer("is active")?(S.debug("Showing dimmer"),y.dimmer("show")):S.debug("Dimmer already visible")},hideDimmer:function(){return y.dimmer("is animating")||y.dimmer("is active")?void y.dimmer("hide",function(){S.remove.clickaway(),S.remove.screenHeight()}):void S.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var n=r.filter("."+R.active+", ."+R.animating);t=e.isFunction(t)?t:function(){},n.length>0&&(S.debug("Hiding all visible modals"),S.hideDimmer(),n.modal("hide modal",t))},hideOthers:function(t){var n=v.filter("."+R.active+", ."+R.animating);t=e.isFunction(t)?t:function(){},n.length>0&&(S.debug("Hiding other modals",v),n.modal("hide modal",t,!0))},others:{active:function(){return v.filter("."+R.active).length>0},animating:function(){return v.filter("."+R.animating).length>0}},add:{keyboardShortcuts:function(){S.verbose("Adding keyboard shortcuts"),l.on("keyup"+F,S.event.keyboard)}},save:{focus:function(){b=e(n.activeElement).blur()}},restore:{focus:function(){b&&b.length>0&&b.focus()}},remove:{active:function(){D.removeClass(R.active)},clickaway:function(){T.closable&&x.off("click"+C)},bodyStyle:function(){""===c.attr("style")&&(S.verbose("Removing style attribute"),c.removeAttr("style"))},screenHeight:function(){S.debug("Removing page height"),c.css("height","")},keyboardShortcuts:function(){S.verbose("Removing keyboard shortcuts"),l.off("keyup"+F)},scrolling:function(){y.removeClass(R.scrolling),D.removeClass(R.scrolling)}},cacheSizes:function(){var o=D.outerHeight();(S.cache===i||0!==o)&&(S.cache={pageHeight:e(n).outerHeight(),height:o+T.offset,contextHeight:"body"==T.context?e(t).height():y.height()}),S.debug("Caching modal and container sizes",S.cache)},can:{fit:function(){return S.cache.height+2*T.padding0?t.first():e.first();n.length>0&&n.focus()},clickaway:function(){T.closable&&x.on("click"+C,S.event.click)},screenHeight:function(){S.can.fit()?c.css("height",""):(S.debug("Modal is taller than page content, resizing page height"),c.css("height",S.cache.height+2*T.padding))},active:function(){D.addClass(R.active)},scrolling:function(){y.addClass(R.scrolling),D.addClass(R.scrolling)},type:function(){S.can.fit()?(S.verbose("Modal fits on screen"),S.others.active()||S.others.animating()||S.remove.scrolling()):(S.verbose("Modal cannot fit on screen setting to scrolling"),S.set.scrolling())},position:function(){S.verbose("Centering modal on page",S.cache),S.can.fit()?D.css({top:"",marginTop:-(S.cache.height/2)}):D.css({marginTop:"",top:l.scrollTop()})},undetached:function(){y.addClass(R.undetached)}},setting:function(t,n){if(S.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,T,t);else{if(n===i)return T[t];e.isPlainObject(T[t])?e.extend(!0,T[t],n):T[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,S,t);else{if(n===i)return S[t];S[t]=n}},debug:function(){!T.silent&&T.debug&&(T.performance?S.performance.log(arguments):(S.debug=Function.prototype.bind.call(console.info,console,T.name+":"),S.debug.apply(console,arguments)))},verbose:function(){!T.silent&&T.verbose&&T.debug&&(T.performance?S.performance.log(arguments):(S.verbose=Function.prototype.bind.call(console.info,console,T.name+":"),S.verbose.apply(console,arguments)))},error:function(){T.silent||(S.error=Function.prototype.bind.call(console.error,console,T.name+":"),S.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;T.performance&&(t=(new Date).getTime(),i=d||t,n=t-i,d=t,f.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:z,"Execution Time":n})),clearTimeout(S.performance.timer),S.performance.timer=setTimeout(S.performance.display,500)},display:function(){var t=T.name+":",n=0;d=!1,clearTimeout(S.performance.timer),e.each(f,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",u&&(t+=" '"+u+"'"),(console.group!==i||console.table!==i)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):e.each(f,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,n,o){var r,s,l,c=M;return n=n||p,o=z||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},g?(M===i&&S.initialize(),S.invoke(m)):(M!==i&&M.invoke("destroy"),S.initialize())}),a!==i?a:this},e.fn.modal.settings={name:"Modal",namespace:"modal",silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,dimmerSettings:{closable:!1,useCSS:!0},context:"body",queue:!1,duration:500,offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.nag=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var a,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.nag.settings,n):e.extend({},e.fn.nag.settings),m=(f.className,f.selector),g=f.error,p=f.namespace,h="."+p,v=p+"-module",b=e(this),y=(b.find(m.close),e(f.context?f.context:"body")),x=this,C=b.data(v);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};a={initialize:function(){a.verbose("Initializing element"),b.on("click"+h,m.close,a.dismiss).data(v,a),f.detachable&&b.parent()[0]!==y[0]&&b.detach().prependTo(y),f.displayTime>0&&setTimeout(a.hide,f.displayTime),a.show()},destroy:function(){a.verbose("Destroying instance"),b.removeData(v).off(h)},show:function(){a.should.show()&&!b.is(":visible")&&(a.debug("Showing nag",f.animation.show),"fade"==f.animation.show?b.fadeIn(f.duration,f.easing):b.slideDown(f.duration,f.easing))},hide:function(){a.debug("Showing nag",f.animation.hide),"fade"==f.animation.show?b.fadeIn(f.duration,f.easing):b.slideUp(f.duration,f.easing)},onHide:function(){a.debug("Removing nag",f.animation.hide),b.remove(),f.onHide&&f.onHide()},dismiss:function(e){f.storageMethod&&a.storage.set(f.key,f.value),a.hide(),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return f.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(f.key)!=f.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(f.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(f.key)),!1)}},get:{storageOptions:function(){var e={};return f.expires&&(e.expires=f.expires),f.domain&&(e.domain=f.domain),f.path&&(e.path=f.path),e}},clear:function(){a.storage.remove(f.key)},storage:{set:function(n,o){var r=a.get.storageOptions();if("localstorage"==f.storageMethod&&t.localStorage!==i)t.localStorage.setItem(n,o),a.debug("Value stored using local storage",n,o);else if("sessionstorage"==f.storageMethod&&t.sessionStorage!==i)t.sessionStorage.setItem(n,o),a.debug("Value stored using session storage",n,o);else{if(e.cookie===i)return void a.error(g.noCookieStorage);e.cookie(n,o,r),a.debug("Value stored using cookie",n,o,r)}},get:function(n,o){var r;return"localstorage"==f.storageMethod&&t.localStorage!==i?r=t.localStorage.getItem(n):"sessionstorage"==f.storageMethod&&t.sessionStorage!==i?r=t.sessionStorage.getItem(n):e.cookie!==i?r=e.cookie(n):a.error(g.noCookieStorage),("undefined"==r||"null"==r||r===i||null===r)&&(r=i),r},remove:function(n){var o=a.get.storageOptions();"localstorage"==f.storageMethod&&t.localStorage!==i?t.localStorage.removeItem(n):"sessionstorage"==f.storageMethod&&t.sessionStorage!==i?t.sessionStorage.removeItem(n):e.cookie!==i?e.removeCookie(n,o):a.error(g.noStorage)}},setting:function(t,n){if(a.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];e.isPlainObject(f[t])?e.extend(!0,f[t],n):f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){!f.silent&&f.debug&&(f.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,f.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),a.verbose.apply(console,arguments)))},error:function(){f.silent||(a.error=Function.prototype.bind.call(console.error,console,f.name+":"),a.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,r){var s,l,c,u=C;return n=n||d,r=x||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return l=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(l=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(l)?c=l.apply(r,n):l!==i&&(c=l),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),l}},u?(C===i&&a.initialize(),a.invoke(c)):(C!==i&&C.invoke("destroy"),a.initialize())}),o!==i?o:this},e.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noCookieStorage:"$.cookie is not included. A storage solution is required.",noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.popup=function(o){var a,r=e(this),s=e(n),l=e(t),c=e("body"),u=r.selector||"",d=!0,f=(new Date).getTime(),m=[],g=arguments[0],p="string"==typeof g,h=[].slice.call(arguments,1);return r.each(function(){var r,v,b,y,x,C,w=e.isPlainObject(o)?e.extend(!0,{},e.fn.popup.settings,o):e.extend({},e.fn.popup.settings),k=w.selector,S=w.className,T=w.error,A=w.metadata,R=w.namespace,P="."+w.namespace,E="module-"+R,F=e(this),O=e(w.context),D=e(w.scrollContext),q=e(w.boundary),j=w.target?e(w.target):F,z=0,M=!1,I=!1,L=this,N=F.data(E);C={initialize:function(){C.debug("Initializing",F),C.createID(),C.bind.events(),!C.exists()&&w.preserve&&C.create(),C.observeChanges(),C.instantiate()},instantiate:function(){C.verbose("Storing instance",C),N=C,F.data(E,N)},observeChanges:function(){"MutationObserver"in t&&(b=new MutationObserver(C.event.documentChanged),b.observe(n,{childList:!0,subtree:!0}),C.debug("Setting up mutation observer",b))},refresh:function(){w.popup?r=e(w.popup).eq(0):w.inline&&(r=j.nextAll(k.popup).eq(0),w.popup=r),w.popup?(r.addClass(S.loading),v=C.get.offsetParent(),r.removeClass(S.loading),w.movePopup&&C.has.popup()&&C.get.offsetParent(r)[0]!==v[0]&&(C.debug("Moving popup to the same offset parent as activating element"),r.detach().appendTo(v))):v=w.inline?C.get.offsetParent(j):C.has.popup()?C.get.offsetParent(r):c,v.is("html")&&v[0]!==c[0]&&(C.debug("Setting page as offset parent"),v=c),C.get.variation()&&C.set.variation()},reposition:function(){C.refresh(),C.set.position()},destroy:function(){C.debug("Destroying previous module"),b&&b.disconnect(),r&&!w.preserve&&C.removePopup(),clearTimeout(C.hideTimer),clearTimeout(C.showTimer),C.unbind.close(),C.unbind.events(),F.removeData(E)},event:{start:function(t){var n=e.isPlainObject(w.delay)?w.delay.show:w.delay;clearTimeout(C.hideTimer),I||(C.showTimer=setTimeout(C.show,n))},end:function(){var t=e.isPlainObject(w.delay)?w.delay.hide:w.delay;clearTimeout(C.showTimer),C.hideTimer=setTimeout(C.hide,t)},touchstart:function(e){I=!0,C.show()},resize:function(){C.is.visible()&&C.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==L||e(t).find(L).length>0)&&(C.debug("Element removed from DOM, tearing down events"),C.destroy())})})},hideGracefully:function(t){var i=e(t.target),o=e.contains(n.documentElement,t.target),a=i.closest(k.popup).length>0;t&&!a&&o?(C.debug("Click occurred outside popup hiding popup"),C.hide()):C.debug("Click was inside popup, keeping popup open")}},create:function(){var t=C.get.html(),n=C.get.title(),i=C.get.content();t||i||n?(C.debug("Creating pop-up html"),t||(t=w.templates.popup({title:n,content:i})),r=e("
").addClass(S.popup).data(A.activator,F).html(t),w.inline?(C.verbose("Inserting popup element inline",r),r.insertAfter(F)):(C.verbose("Appending popup element to body",r),r.appendTo(O)),C.refresh(),C.set.variation(),w.hoverable&&C.bind.popup(),w.onCreate.call(r,L)):0!==j.next(k.popup).length?(C.verbose("Pre-existing popup found"),w.inline=!0,w.popup=j.next(k.popup).data(A.activator,F),C.refresh(),w.hoverable&&C.bind.popup()):w.popup?(e(w.popup).data(A.activator,F),C.verbose("Used popup specified in settings"),C.refresh(),w.hoverable&&C.bind.popup()):C.debug("No content specified skipping display",L)},createID:function(){x=(Math.random().toString(16)+"000000000").substr(2,8),y="."+x,C.verbose("Creating unique id for element",x)},toggle:function(){C.debug("Toggling pop-up"),C.is.hidden()?(C.debug("Popup is hidden, showing pop-up"),C.unbind.close(),C.show()):(C.debug("Popup is visible, hiding pop-up"),C.hide())},show:function(e){if(e=e||function(){},C.debug("Showing pop-up",w.transition),C.is.hidden()&&(!C.is.active()||!C.is.dropdown())){if(C.exists()||C.create(),w.onShow.call(r,L)===!1)return void C.debug("onShow callback returned false, cancelling popup animation"); -w.preserve||w.popup||C.refresh(),r&&C.set.position()&&(C.save.conditions(),w.exclusive&&C.hideAll(),C.animate.show(e))}},hide:function(e){if(e=e||function(){},C.is.visible()||C.is.animating()){if(w.onHide.call(r,L)===!1)return void C.debug("onHide callback returned false, cancelling popup animation");C.remove.visible(),C.unbind.close(),C.restore.conditions(),C.animate.hide(e)}},hideAll:function(){e(k.popup).filter("."+S.visible).each(function(){e(this).data(A.activator).popup("hide")})},exists:function(){return r?w.inline||w.popup?C.has.popup():r.closest(O).length>=1?!0:!1:!1},removePopup:function(){C.has.popup()&&!w.popup&&(C.debug("Removing popup",r),r.remove(),r=i,w.onRemove.call(r,L))},save:{conditions:function(){C.cache={title:F.attr("title")},C.cache.title&&F.removeAttr("title"),C.verbose("Saving original attributes",C.cache.title)}},restore:{conditions:function(){return C.cache&&C.cache.title&&(F.attr("title",C.cache.title),C.verbose("Restoring original attributes",C.cache.title)),!0}},supports:{svg:function(){return typeof SVGGraphicsElement===i}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},w.transition&&e.fn.transition!==i&&F.transition("is supported")?(C.set.visible(),r.transition({animation:w.transition+" in",queue:!1,debug:w.debug,verbose:w.verbose,duration:w.duration,onComplete:function(){C.bind.close(),t.call(r,L),w.onVisible.call(r,L)}})):C.error(T.noTransition)},hide:function(t){return t=e.isFunction(t)?t:function(){},C.debug("Hiding pop-up"),w.onHide.call(r,L)===!1?void C.debug("onHide callback returned false, cancelling popup animation"):void(w.transition&&e.fn.transition!==i&&F.transition("is supported")?r.transition({animation:w.transition+" out",queue:!1,duration:w.duration,debug:w.debug,verbose:w.verbose,onComplete:function(){C.reset(),t.call(r,L),w.onHidden.call(r,L)}}):C.error(T.noTransition))}},change:{content:function(e){r.html(e)}},get:{html:function(){return F.removeData(A.html),F.data(A.html)||w.html},title:function(){return F.removeData(A.title),F.data(A.title)||w.title},content:function(){return F.removeData(A.content),F.data(A.content)||F.attr("title")||w.content},variation:function(){return F.removeData(A.variation),F.data(A.variation)||w.variation},popup:function(){return r},popupOffset:function(){return r.offset()},calculations:function(){var e,n=j[0],i=q[0]==t,o=w.inline||w.popup&&w.movePopup?j.position():j.offset(),a=i?{top:0,left:0}:q.offset(),s={},c=i?{top:l.scrollTop(),left:l.scrollLeft()}:{top:0,left:0};return s={target:{element:j[0],width:j.outerWidth(),height:j.outerHeight(),top:o.top,left:o.left,margin:{}},popup:{width:r.outerWidth(),height:r.outerHeight()},parent:{width:v.outerWidth(),height:v.outerHeight()},screen:{top:a.top,left:a.left,scroll:{top:c.top,left:c.left},width:q.width(),height:q.height()}},w.setFluidWidth&&C.is.fluid()&&(s.container={width:r.parent().outerWidth()},s.popup.width=s.container.width),s.target.margin.top=w.inline?parseInt(t.getComputedStyle(n).getPropertyValue("margin-top"),10):0,s.target.margin.left=w.inline?C.is.rtl()?parseInt(t.getComputedStyle(n).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(n).getPropertyValue("margin-left"),10):0,e=s.screen,s.boundary={top:e.top+e.scroll.top,bottom:e.top+e.scroll.top+e.height,left:e.left+e.scroll.left,right:e.left+e.scroll.left+e.width},s},id:function(){return x},startEvent:function(){return"hover"==w.on?"mouseenter":"focus"==w.on?"focus":!1},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==w.on?"mouseleave":"focus"==w.on?"blur":!1},distanceFromBoundary:function(e,t){var n,i,o={};return t=t||C.get.calculations(),n=t.popup,i=t.boundary,e&&(o={top:e.top-i.top,left:e.left-i.left,right:i.right-(e.left+n.width),bottom:i.bottom-(e.top+n.height)},C.verbose("Distance from boundaries determined",e,o)),o},offsetParent:function(t){var n=t!==i?t[0]:F[0],o=n.parentNode,a=e(o);if(o)for(var r="none"===a.css("transform"),s="static"===a.css("position"),l=a.is("html");o&&!l&&s&&r;)o=o.parentNode,a=e(o),r="none"===a.css("transform"),s="static"===a.css("position"),l=a.is("html");return a&&a.length>0?a:e()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(e){var t=e.split(" "),n=t[0],i=t[1],o={top:"bottom",bottom:"top",left:"right",right:"left"},a={left:"center",center:"right",right:"left"},r={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"},s="top"==n||"bottom"==n,l=!1,c=!1,u=!1;return M||(C.verbose("All available positions available"),M=C.get.positions()),C.debug("Recording last position tried",e),M[e]=!0,"opposite"===w.prefer&&(u=[o[n],i],u=u.join(" "),l=M[u]===!0,C.debug("Trying opposite strategy",u)),"adjacent"===w.prefer&&s&&(u=[n,a[i]],u=u.join(" "),c=M[u]===!0,C.debug("Trying adjacent strategy",u)),(c||l)&&(C.debug("Using backup position",u),u=r[e]),u}},set:{position:function(e,t){if(0===j.length||0===r.length)return void C.error(T.notFound);var n,o,a,s,l,c,u,d;if(t=t||C.get.calculations(),e=e||F.data(A.position)||w.position,n=F.data(A.offset)||w.offset,o=w.distanceAway,a=t.target,s=t.popup,l=t.parent,0===a.width&&0===a.height&&!C.is.svg(a.element))return C.debug("Popup target is hidden, no action taken"),!1;switch(w.inline&&(C.debug("Adding margin to calculation",a.margin),"left center"==e||"right center"==e?(n+=a.margin.top,o+=-a.margin.left):"top left"==e||"top center"==e||"top right"==e?(n+=a.margin.left,o-=a.margin.top):(n+=a.margin.left,o+=a.margin.top)),C.debug("Determining popup position from calculations",e,t),C.is.rtl()&&(e=e.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),C.debug("RTL: Popup position updated",e)),z==w.maxSearchDepth&&"string"==typeof w.lastResort&&(e=w.lastResort),e){case"top left":c={top:"auto",bottom:l.height-a.top+o,left:a.left+n,right:"auto"};break;case"top center":c={bottom:l.height-a.top+o,left:a.left+a.width/2-s.width/2+n,top:"auto",right:"auto"};break;case"top right":c={bottom:l.height-a.top+o,right:l.width-a.left-a.width-n,top:"auto",left:"auto"};break;case"left center":c={top:a.top+a.height/2-s.height/2+n,right:l.width-a.left+o,left:"auto",bottom:"auto"};break;case"right center":c={top:a.top+a.height/2-s.height/2+n,left:a.left+a.width+o,bottom:"auto",right:"auto"};break;case"bottom left":c={top:a.top+a.height+o,left:a.left+n,bottom:"auto",right:"auto"};break;case"bottom center":c={top:a.top+a.height+o,left:a.left+a.width/2-s.width/2+n,bottom:"auto",right:"auto"};break;case"bottom right":c={top:a.top+a.height+o,right:l.width-a.left-a.width-n,left:"auto",bottom:"auto"}}if(c===i&&C.error(T.invalidPosition,e),C.debug("Calculated popup positioning values",c),r.css(c).removeClass(S.position).addClass(e).addClass(S.loading),u=C.get.popupOffset(),d=C.get.distanceFromBoundary(u,t),C.is.offstage(d,e)){if(C.debug("Position is outside viewport",e),z0}},is:{offstage:function(t,n){var i=[];return e.each(t,function(e,t){t<-w.jitter&&(C.debug("Position exceeds allowable distance from edge",e,t,n),i.push(e))}),i.length>0?!0:!1},svg:function(e){return C.supports.svg()&&e instanceof SVGGraphicsElement},active:function(){return F.hasClass(S.active)},animating:function(){return r!==i&&r.hasClass(S.animating)},fluid:function(){return r!==i&&r.hasClass(S.fluid)},visible:function(){return r!==i&&r.hasClass(S.visible)},dropdown:function(){return F.hasClass(S.dropdown)},hidden:function(){return!C.is.visible()},rtl:function(){return"rtl"==F.css("direction")}},reset:function(){C.remove.visible(),w.preserve?e.fn.transition!==i&&r.transition("remove transition"):C.removePopup()},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},debug:function(){!w.silent&&w.debug&&(w.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,w.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!w.silent&&w.verbose&&w.debug&&(w.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),C.verbose.apply(console,arguments)))},error:function(){w.silent||(C.error=Function.prototype.bind.call(console.error,console,w.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;w.performance&&(t=(new Date).getTime(),i=f||t,n=t-i,f=t,m.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:L,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=w.name+":",n=0;f=!1,clearTimeout(C.performance.timer),e.each(m,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",u&&(t+=" '"+u+"'"),(console.group!==i||console.table!==i)&&m.length>0&&(console.groupCollapsed(t),console.table?console.table(m):e.each(m,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(t,n,o){var r,s,l,c=N;return n=n||h,o=L||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},p?(N===i&&C.initialize(),C.invoke(g)):(N!==i&&N.invoke("destroy"),C.initialize())}),a!==i?a:this},e.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:t,addTouchEvents:!0,position:"top left",variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:t,prefer:"opposite",lastResort:!1,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions ",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},popup:function(t){var n="",o=e.fn.popup.settings.templates.escape;return typeof t!==i&&(typeof t.title!==i&&t.title&&(t.title=o(t.title),n+='
'+t.title+"
"),typeof t.content!==i&&t.content&&(t.content=o(t.content),n+='
'+t.content+"
")),n}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();e.fn.progress=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var a,f,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.progress.settings,t):e.extend({},e.fn.progress.settings),g=m.className,p=m.metadata,h=m.namespace,v=m.selector,b=m.error,y="."+h,x="module-"+h,C=e(this),w=e(this).find(v.bar),k=e(this).find(v.progress),S=e(this).find(v.label),T=this,A=C.data(x),R=!1;f={initialize:function(){f.debug("Initializing progress bar",m),f.set.duration(),f.set.transitionEvent(),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),A=f,C.data(x,f)},destroy:function(){f.verbose("Destroying previous progress for",C),clearInterval(A.interval),f.remove.state(),C.removeData(x),A=i},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(){(f.percent===i||f.percent<100)&&(f.remove.progressPoll(),f.set.percent(100))},read:{metadata:function(){var e={percent:C.data(p.percent),total:C.data(p.total),value:C.data(p.value)};e.percent&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent)),e.total&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),e.value&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value))},settings:function(){m.total!==!1&&(f.debug("Current total set in settings",m.total),f.set.total(m.total)),m.value!==!1&&(f.debug("Current value set in settings",m.value),f.set.value(m.value),f.set.progress(f.value)),m.percent!==!1&&(f.debug("Current percent set in settings",m.percent),f.set.percent(m.percent))}},increment:function(e){var t,n,i;f.has.total()?(n=f.get.value(),e=e||1,i=n+e):(n=f.get.percent(),e=e||f.get.randomValue(),i=n+e,t=100,f.debug("Incrementing percentage by",n,i)),i=f.get.normalizedValue(i),f.set.progress(i)},decrement:function(e){var t,n,i=f.get.total();i?(t=f.get.value(),e=e||1,n=t-e,f.debug("Decrementing value by",e,t)):(t=f.get.percent(),e=e||f.get.randomValue(),n=t-e,f.debug("Decrementing percentage by",e,t)),n=f.get.normalizedValue(n),f.set.progress(n)},has:{progressPoll:function(){return f.progressPoll},total:function(){return f.get.total()!==!1}},get:{text:function(e){var t=f.value||0,n=f.total||0,i=R?f.get.displayPercent():f.percent||0,o=f.total>0?n-t:100-i;return e=e||"",e=e.replace("{value}",t).replace("{total}",n).replace("{left}",o).replace("{percent}",i),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(0>e)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(e>100)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"==m.updateInterval?m.duration:m.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*m.random.max+m.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")?+e.replace(/[^\d.]/g,""):!1:e},transitionEnd:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]},displayPercent:function(){var e=w.width(),t=C.width(),n=parseInt(w.css("min-width"),10),i=e>n?e/t*100:f.percent;return m.precision>0?Math.round(i*(10*m.precision))/(10*m.precision):Math.round(i)},percent:function(){return f.percent||0},value:function(){return f.nextValue||f.value||0},total:function(){return f.total||!1}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return C.hasClass(g.success)},warning:function(){return C.hasClass(g.warning)},error:function(){return C.hasClass(g.error)},active:function(){return C.hasClass(g.active)},visible:function(){return C.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),C.removeClass(g.active)},success:function(){f.verbose("Removing success state"),C.removeClass(g.success)},warning:function(){f.verbose("Removing warning state"),C.removeClass(g.warning)},error:function(){f.verbose("Removing error state"),C.removeClass(g.error)}},set:{barWidth:function(e){e>100?f.error(b.tooHigh,e):0>e?f.error(b.tooLow,e):(w.css("width",e+"%"),C.attr("data-percent",parseInt(e,10)))},duration:function(e){e=e||m.duration,e="number"==typeof e?e+"ms":e,f.verbose("Setting progress bar transition duration",e),w.css({"transition-duration":e})},percent:function(e){e="string"==typeof e?+e.replace("%",""):e,e=m.precision>0?Math.round(e*(10*m.precision))/(10*m.precision):Math.round(e),f.percent=e,f.has.total()||(f.value=m.precision>0?Math.round(e/100*f.total*(10*m.precision))/(10*m.precision):Math.round(e/100*f.total*10)/10,m.limitValues&&(f.value=f.value>100?100:f.value<0?0:f.value)),f.set.barWidth(e),f.set.labelInterval(),f.set.labels(),m.onChange.call(T,e,f.value,f.total)},labelInterval:function(){var t=function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),R=!1,f.set.labels()};clearInterval(f.interval),w.one(a+y,t),R=!0,f.interval=setInterval(function(){var t=e.contains(n.documentElement,T);t||(clearInterval(f.interval),R=!1),f.set.labels()},m.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){e=e||"",e&&(e=f.get.text(e),f.verbose("Setting label to text",e),S.text(e))},state:function(e){e=e!==i?e:f.percent,100===e?m.autoSuccess&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):e>0?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.set.label(m.text.active))},barLabel:function(e){e!==i?k.text(f.get.text(e)):"ratio"==m.label&&f.total?(f.verbose("Adding ratio to bar label"),k.text(f.get.text(m.text.ratio))):"percent"==m.label&&(f.verbose("Adding percentage to bar label"),k.text(f.get.text(m.text.percent)))},active:function(e){e=e||m.text.active,f.debug("Setting active state"),m.showActivity&&!f.is.active()&&C.addClass(g.active),f.remove.warning(),f.remove.error(),f.remove.success(),e=m.onLabelUpdate("active",e,f.value,f.total),e&&f.set.label(e),w.one(a+y,function(){m.onActive.call(T,f.value,f.total)})},success:function(e){e=e||m.text.success||m.text.active,f.debug("Setting success state"),C.addClass(g.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(),m.text.success?(e=m.onLabelUpdate("success",e,f.value,f.total),f.set.label(e)):(e=m.onLabelUpdate("active",e,f.value,f.total),f.set.label(e)),w.one(a+y,function(){m.onSuccess.call(T,f.total)})},warning:function(e){e=e||m.text.warning,f.debug("Setting warning state"),C.addClass(g.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(),e=m.onLabelUpdate("warning",e,f.value,f.total),e&&f.set.label(e),w.one(a+y,function(){m.onWarning.call(T,f.value,f.total)})},error:function(e){e=e||m.text.error,f.debug("Setting error state"),C.addClass(g.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(),e=m.onLabelUpdate("error",e,f.value,f.total),e&&f.set.label(e),w.one(a+y,function(){m.onError.call(T,f.value,f.total)})},transitionEvent:function(){a=f.get.transitionEnd()},total:function(e){f.total=e},value:function(e){f.value=e},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var t;e=f.get.numericValue(e),e===!1&&f.error(b.nonNumeric,e),e=f.get.normalizedValue(e),f.has.total()?(f.set.value(e),t=e/f.total*100,f.debug("Calculating percent complete from total",t),f.set.percent(t)):(t=e,f.debug("Setting value to exact percentage value",t),f.set.percent(t))}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,a){var r,s,l,c=A;return n=n||d,a=T||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(f.error(b.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}},u?(A===i&&f.initialize(),f.invoke(c)):(A!==i&&A.invoke("destroy"),f.initialize())}),o!==i?o:this},e.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,onLabelUpdate:function(e,t,n,i){return t},onChange:function(e,t,n){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}"},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.rating=function(t){var n,o=e(this),a=o.selector||"",r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1);return o.each(function(){var d,f,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.rating.settings,t):e.extend({},e.fn.rating.settings),g=m.namespace,p=m.className,h=m.metadata,v=m.selector,b=(m.error,"."+g),y="module-"+g,x=this,C=e(this).data(y),w=e(this),k=w.find(v.icon);f={initialize:function(){f.verbose("Initializing rating module",m),0===k.length&&f.setup.layout(),m.interactive?f.enable():f.disable(),f.set.initialLoad(),f.set.rating(f.get.initialRating()),f.remove.initialLoad(),f.instantiate()},instantiate:function(){f.verbose("Instantiating module",m),C=f,w.data(y,f)},destroy:function(){f.verbose("Destroying previous instance",C),f.remove.events(),w.removeData(y)},refresh:function(){k=w.find(v.icon)},setup:{layout:function(){var t=f.get.maxRating(),n=e.fn.rating.settings.templates.icon(t);f.debug("Generating icon html dynamically"),w.html(n),f.refresh()}},event:{mouseenter:function(){var t=e(this);t.nextAll().removeClass(p.selected),w.addClass(p.selected),t.addClass(p.selected).prevAll().addClass(p.selected)},mouseleave:function(){w.removeClass(p.selected),k.removeClass(p.selected)},click:function(){var t=e(this),n=f.get.rating(),i=k.index(t)+1,o="auto"==m.clearable?1===k.length:m.clearable;o&&n==i?f.clearRating():f.set.rating(i)}},clearRating:function(){f.debug("Clearing current rating"),f.set.rating(0)},bind:{events:function(){f.verbose("Binding events"),w.on("mouseenter"+b,v.icon,f.event.mouseenter).on("mouseleave"+b,v.icon,f.event.mouseleave).on("click"+b,v.icon,f.event.click)}},remove:{events:function(){f.verbose("Removing events"),w.off(b)},initialLoad:function(){d=!1}},enable:function(){f.debug("Setting rating to interactive mode"),f.bind.events(),w.removeClass(p.disabled)},disable:function(){f.debug("Setting rating to read-only mode"),f.remove.events(),w.addClass(p.disabled)},is:{initialLoad:function(){return d}},get:{initialRating:function(){return w.data(h.rating)!==i?(w.removeData(h.rating),w.data(h.rating)):m.initialRating},maxRating:function(){return w.data(h.maxRating)!==i?(w.removeData(h.maxRating),w.data(h.maxRating)):m.maxRating},rating:function(){var e=k.filter("."+p.active).length;return f.verbose("Current rating retrieved",e),e}},set:{rating:function(e){var t=e-1>=0?e-1:0,n=k.eq(t);w.removeClass(p.selected),k.removeClass(p.selected).removeClass(p.active),e>0&&(f.verbose("Setting current rating to",e),n.prevAll().addBack().addClass(p.active)),f.is.initialLoad()||m.onRate.call(x,e)},initialLoad:function(){d=!0}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),o.length>1&&(t+=" ("+o.length+")"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,o,a){var r,s,l,c=C;return o=o||u,a=x||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(a,o):s!==i&&(l=s),e.isArray(n)?n.push(l):n!==i?n=[n,l]:l!==i&&(n=l),s}},c?(C===i&&f.initialize(),f.invoke(l)):(C!==i&&C.invoke("destroy"),f.initialize())}),n!==i?n:this},e.fn.rating.settings={name:"Rating",namespace:"rating",slent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(e){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(e){for(var t=1,n="";e>=t;)n+='',t++;return n}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.search=function(o){var a,r=e(this),s=r.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1);return e(this).each(function(){var m,g=e.isPlainObject(o)?e.extend(!0,{},e.fn.search.settings,o):e.extend({},e.fn.search.settings),p=g.className,h=g.metadata,v=g.regExp,b=g.fields,y=g.selector,x=g.error,C=g.namespace,w="."+C,k=C+"-module",S=e(this),T=S.find(y.prompt),A=S.find(y.searchButton),R=S.find(y.results),P=S.find(y.result),E=S.find(y.category),F=this,O=S.data(k),D=!1;m={initialize:function(){ -m.verbose("Initializing module"),m.determine.searchFields(),m.bind.events(),m.set.type(),m.create.results(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),O=m,S.data(k,m)},destroy:function(){m.verbose("Destroying instance"),S.off(w).removeData(k)},refresh:function(){m.debug("Refreshing selector cache"),T=S.find(y.prompt),A=S.find(y.searchButton),E=S.find(y.category),R=S.find(y.results),P=S.find(y.result)},refreshResults:function(){R=S.find(y.results),P=S.find(y.result)},bind:{events:function(){m.verbose("Binding events to search"),g.automatic&&(S.on(m.get.inputEvent()+w,y.prompt,m.event.input),T.attr("autocomplete","off")),S.on("focus"+w,y.prompt,m.event.focus).on("blur"+w,y.prompt,m.event.blur).on("keydown"+w,y.prompt,m.handleKeyboard).on("click"+w,y.searchButton,m.query).on("mousedown"+w,y.results,m.event.result.mousedown).on("mouseup"+w,y.results,m.event.result.mouseup).on("click"+w,y.result,m.event.result.click)}},determine:{searchFields:function(){o&&o.searchFields!==i&&(g.searchFields=o.searchFields)}},event:{input:function(){clearTimeout(m.timer),m.timer=setTimeout(m.query,g.searchDelay)},focus:function(){m.set.focus(),m.has.minimumCharacters()&&(m.query(),m.can.show()&&m.showResults())},blur:function(e){var t=n.activeElement===this,i=function(){m.cancel.query(),m.remove.focus(),m.timer=setTimeout(m.hideResults,g.hideDelay)};t||(m.resultsClicked?(m.debug("Determining if user action caused search to close"),S.one("click.close"+w,y.results,function(e){return m.is.inMessage(e)||D?void T.focus():(D=!1,void(m.is.animating()||m.is.hidden()||i()))})):(m.debug("Input blurred without user action, closing results"),i()))},result:{mousedown:function(){m.resultsClicked=!0},mouseup:function(){m.resultsClicked=!1},click:function(n){m.debug("Search result selected");var i=e(this),o=i.find(y.title).eq(0),a=i.is("a[href]")?i:i.find("a[href]").eq(0),r=a.attr("href")||!1,s=a.attr("target")||!1,l=(o.html(),o.length>0?o.text():!1),c=m.get.results(),u=i.data(h.result)||m.get.result(l,c);return e.isFunction(g.onSelect)&&g.onSelect.call(F,u,c)===!1?(m.debug("Custom onSelect callback cancelled default select action"),void(D=!0)):(m.hideResults(),l&&m.set.value(l),void(r&&(m.verbose("Opening search link found in result",a),"_blank"==s||n.ctrlKey?t.open(r):t.location.href=r)))}}},handleKeyboard:function(e){var t,n=S.find(y.result),i=S.find(y.category),o=n.index(n.filter("."+p.active)),a=n.length,r=e.which,s={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(r==s.escape&&(m.verbose("Escape key pressed, blurring search field"),m.trigger.blur()),m.is.visible())if(r==s.enter){if(m.verbose("Enter key pressed, selecting active result"),n.filter("."+p.active).length>0)return m.event.result.click.call(n.filter("."+p.active),e),e.preventDefault(),!1}else r==s.upArrow?(m.verbose("Up key pressed, changing active result"),t=0>o-1?o:o-1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault()):r==s.downArrow&&(m.verbose("Down key pressed, changing active result"),t=o+1>=a?o:o+1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault());else r==s.enter&&(m.verbose("Enter key pressed, executing query"),m.query(),m.set.buttonPressed(),T.one("keyup",m.remove.buttonFocus))},setup:{api:function(t){var n={debug:g.debug,on:!1,cache:!0,action:"search",urlData:{query:t},onSuccess:function(e){m.parse.response.call(F,e,t)},onAbort:function(e){},onFailure:function(){m.displayMessage(x.serverError)},onError:m.error};e.extend(!0,n,g.apiSettings),m.verbose("Setting up API request",n),S.api(n)}},can:{useAPI:function(){return e.fn.api!==i},show:function(){return m.is.focused()&&!m.is.visible()&&!m.is.empty()},transition:function(){return g.transition&&e.fn.transition!==i&&S.transition("is supported")}},is:{animating:function(){return R.hasClass(p.animating)},hidden:function(){return R.hasClass(p.hidden)},inMessage:function(t){return t.target&&e(t.target).closest(y.message).length>0},empty:function(){return""===R.html()},visible:function(){return R.filter(":visible").length>0},focused:function(){return T.filter(":focus").length>0}},trigger:{blur:function(){var e=n.createEvent("HTMLEvents"),t=T[0];t&&(m.verbose("Triggering native blur event"),e.initEvent("blur",!1,!1),t.dispatchEvent(e))}},get:{inputEvent:function(){var e=T[0],t=e!==i&&e.oninput!==i?"input":e!==i&&e.onpropertychange!==i?"propertychange":"keyup";return t},value:function(){return T.val()},results:function(){var e=S.data(h.results);return e},result:function(t,n){var o=["title","id"],a=!1;return t=t!==i?t:m.get.value(),n=n!==i?n:m.get.results(),"category"===g.type?(m.debug("Finding result that matches",t),e.each(n,function(n,i){return e.isArray(i.results)&&(a=m.search.object(t,i.results,o)[0])?!1:void 0})):(m.debug("Finding result in results object",t),a=m.search.object(t,n,o)[0]),a||!1}},select:{firstResult:function(){m.verbose("Selecting first result"),P.first().addClass(p.active)}},set:{focus:function(){S.addClass(p.focus)},loading:function(){S.addClass(p.loading)},value:function(e){m.verbose("Setting search input value",e),T.val(e)},type:function(e){e=e||g.type,"category"==g.type&&S.addClass(g.type)},buttonPressed:function(){A.addClass(p.pressed)}},remove:{loading:function(){S.removeClass(p.loading)},focus:function(){S.removeClass(p.focus)},buttonPressed:function(){A.removeClass(p.pressed)}},query:function(){var t=m.get.value(),n=m.read.cache(t);m.has.minimumCharacters()?(n?(m.debug("Reading result from cache",t),m.save.results(n.results),m.addResults(n.html),m.inject.id(n.results)):(m.debug("Querying for",t),e.isPlainObject(g.source)||e.isArray(g.source)?m.search.local(t):m.can.useAPI()?m.search.remote(t):m.error(x.source)),g.onSearchQuery.call(F,t)):m.hideResults()},search:{local:function(e){var t,n=m.search.object(e,g.content);m.set.loading(),m.save.results(n),m.debug("Returned local search results",n),t=m.generateResults({results:n}),m.remove.loading(),m.addResults(t),m.inject.id(n),m.write.cache(e,{html:t,results:n})},remote:function(e){S.api("is loading")&&S.api("abort"),m.setup.api(e),S.api("query")},object:function(t,n,o){var a=[],r=[],s=t.toString().replace(v.escape,"\\$&"),l=new RegExp(v.beginsWith+s,"i"),c=function(t,n){var i=-1==e.inArray(n,a),o=-1==e.inArray(n,r);i&&o&&t.push(n)};return n=n||g.source,o=o!==i?o:g.searchFields,e.isArray(o)||(o=[o]),n===i||n===!1?(m.error(x.source),[]):(e.each(o,function(i,o){e.each(n,function(e,n){var i="string"==typeof n[o];i&&(-1!==n[o].search(l)?c(a,n):g.searchFullText&&m.fuzzySearch(t,n[o])&&c(r,n))})}),e.merge(a,r))}},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;i>o;o++){for(var r=e.charCodeAt(o);n>a;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},parse:{response:function(e,t){var n=m.generateResults(e);m.verbose("Parsing server response",e),e!==i&&t!==i&&e[b.results]!==i&&(m.addResults(n),m.inject.id(e[b.results]),m.write.cache(t,{html:n,results:e[b.results]}),m.save.results(e[b.results]))}},cancel:{query:function(){m.can.useAPI()&&S.api("abort")}},has:{minimumCharacters:function(){var e=m.get.value(),t=e.length;return t>=g.minCharacters}},clear:{cache:function(e){var t=S.data(h.cache);e?e&&t&&t[e]&&(m.debug("Removing value from cache",e),delete t[e],S.data(h.cache,t)):(m.debug("Clearing cache",e),S.removeData(h.cache))}},read:{cache:function(e){var t=S.data(h.cache);return g.cache?(m.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==i?t[e]:!1):!1}},create:{id:function(e,t){var n,o,a=e+1;return t!==i?(n=String.fromCharCode(97+t),o=n+a,m.verbose("Creating category result id",o)):(o=a,m.verbose("Creating result id",o)),o},results:function(){0===R.length&&(R=e("
").addClass(p.results).appendTo(S))}},inject:{result:function(e,t,n){m.verbose("Injecting result into results");var o=n!==i?R.children().eq(n).children(y.result).eq(t):R.children(y.result).eq(t);m.verbose("Injecting results metadata",o),o.data(h.result,e)},id:function(t){m.debug("Injecting unique ids into results");var n=0,o=0;return"category"===g.type?e.each(t,function(t,a){o=0,e.each(a.results,function(e,t){var r=a.results[e];r.id===i&&(r.id=m.create.id(o,n)),m.inject.result(r,o,n),o++}),n++}):e.each(t,function(e,n){var a=t[e];a.id===i&&(a.id=m.create.id(o)),m.inject.result(a,o),o++}),t}},save:{results:function(e){m.verbose("Saving current search results to metadata",e),S.data(h.results,e)}},write:{cache:function(e,t){var n=S.data(h.cache)!==i?S.data(h.cache):{};g.cache&&(m.verbose("Writing generated html to cache",e,t),n[e]=t,S.data(h.cache,n))}},addResults:function(t){return e.isFunction(g.onResultsAdd)&&g.onResultsAdd.call(R,t)===!1?(m.debug("onResultsAdd callback cancelled default action"),!1):void(t?(R.html(t),m.refreshResults(),g.selectFirstResult&&m.select.firstResult(),m.showResults()):m.hideResults())},showResults:function(){m.is.visible()||(m.can.transition()?(m.debug("Showing results with css animations"),R.transition({animation:g.transition+" in",debug:g.debug,verbose:g.verbose,duration:g.duration,queue:!0})):(m.debug("Showing results with javascript"),R.stop().fadeIn(g.duration,g.easing)),g.onResultsOpen.call(R))},hideResults:function(){m.is.visible()&&(m.can.transition()?(m.debug("Hiding results with css animations"),R.transition({animation:g.transition+" out",debug:g.debug,verbose:g.verbose,duration:g.duration,queue:!0})):(m.debug("Hiding results with javascript"),R.stop().fadeOut(g.duration,g.easing)),g.onResultsClose.call(R))},generateResults:function(t){m.debug("Generating html from response",t);var n=g.templates[g.type],i=e.isPlainObject(t[b.results])&&!e.isEmptyObject(t[b.results]),o=e.isArray(t[b.results])&&t[b.results].length>0,a="";return i||o?(g.maxResults>0&&(i?"standard"==g.type&&m.error(x.maxResults):t[b.results]=t[b.results].slice(0,g.maxResults)),e.isFunction(n)?a=n(t,b):m.error(x.noTemplate,!1)):g.showNoResults&&(a=m.displayMessage(x.noResults,"empty")),g.onResults.call(F,t),a},displayMessage:function(e,t){return t=t||"standard",m.debug("Displaying message",e,t),m.addResults(g.templates.message(e,t)),g.templates.message(e,t)},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){!g.silent&&g.debug&&(g.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,g.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!g.silent&&g.verbose&&g.debug&&(g.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),m.verbose.apply(console,arguments)))},error:function(){g.silent||(m.error=Function.prototype.bind.call(console.error,console,g.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;g.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:F,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=g.name+":",n=0;l=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var r,s,l,c=O;return n=n||f,o=F||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},d?(O===i&&m.initialize(),m.invoke(u)):(O!==i&&O.invoke("destroy"),m.initialize())}),a!==i?a:this},e.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchFields:["title","description"],displayField:"",searchFullText:!0,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(e){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined."},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},message:function(e,t){var n="";return e!==i&&t!==i&&(n+='
',n+="empty"==t?'
No Results
'+e+'
':'
'+e+"
",n+="
"),n},category:function(t,n){var o="";e.fn.search.settings.templates.escape;return t[n.categoryResults]!==i?(e.each(t[n.categoryResults],function(t,a){a[n.results]!==i&&a.results.length>0&&(o+='")}),t[n.action]&&(o+=''+t[n.action][n.actionText]+""),o):!1},standard:function(t,n){var o="";return t[n.results]!==i?(e.each(t[n.results],function(e,t){o+=t[n.url]?'':'',t[n.image]!==i&&(o+='
'),o+='
',t[n.price]!==i&&(o+='
'+t[n.price]+"
"),t[n.title]!==i&&(o+='
'+t[n.title]+"
"),t[n.description]!==i&&(o+='
'+t[n.description]+"
"),o+="
",o+="
"}),t[n.action]&&(o+=''+t[n.action][n.actionText]+""),o):!1}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.shape=function(o){var a,r=e(this),s=(e("body"),(new Date).getTime()),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1),f=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var t,m,g,p=r.selector||"",h=e.isPlainObject(o)?e.extend(!0,{},e.fn.shape.settings,o):e.extend({},e.fn.shape.settings),v=h.namespace,b=h.selector,y=h.error,x=h.className,C="."+v,w="module-"+v,k=e(this),S=k.find(b.sides),T=k.find(b.side),A=!1,R=this,P=k.data(w);g={initialize:function(){g.verbose("Initializing module for",R),g.set.defaultSide(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),P=g,k.data(w,P)},destroy:function(){g.verbose("Destroying previous module for",R),k.removeData(w).off(C)},refresh:function(){g.verbose("Refreshing selector cache for",R),k=e(R),S=e(this).find(b.shape),T=e(this).find(b.side)},repaint:function(){g.verbose("Forcing repaint event");var e=S[0]||n.createElement("div");e.offsetWidth},animate:function(e,n){g.verbose("Animating box with properties",e),n=n||function(e){g.verbose("Executing animation callback"),e!==i&&e.stopPropagation(),g.reset(),g.set.active()},h.beforeChange.call(m[0]),g.get.transitionEvent()?(g.verbose("Starting CSS animation"),k.addClass(x.animating),S.css(e).one(g.get.transitionEvent(),n),g.set.duration(h.duration),f(function(){k.addClass(x.animating),t.addClass(x.hidden)})):n()},queue:function(e){g.debug("Queueing animation of",e),S.one(g.get.transitionEvent(),function(){g.debug("Executing queued animation"),setTimeout(function(){k.shape(e)},0)})},reset:function(){g.verbose("Animating states reset"),k.removeClass(x.animating).attr("style","").removeAttr("style"),S.attr("style","").removeAttr("style"),T.attr("style","").removeAttr("style").removeClass(x.hidden),m.removeClass(x.animating).attr("style","").removeAttr("style")},is:{complete:function(){return T.filter("."+x.active)[0]==m[0]},animating:function(){return k.hasClass(x.animating)}},set:{defaultSide:function(){t=k.find("."+h.className.active),m=t.next(b.side).length>0?t.next(b.side):k.find(b.side).first(),A=!1,g.verbose("Active side set to",t),g.verbose("Next side set to",m)},duration:function(e){e=e||h.duration,e="number"==typeof e?e+"ms":e,g.verbose("Setting animation duration",e),(h.duration||0===h.duration)&&S.add(T).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},currentStageSize:function(){var e=k.find("."+h.className.active),t=e.outerWidth(!0),n=e.outerHeight(!0);k.css({width:t,height:n})},stageSize:function(){var e=k.clone().addClass(x.loading),t=e.find("."+h.className.active),n="next"==h.width?o.outerWidth(!0):"initial"==h.width?k.width():h.width,i="next"==h.height?o.outerHeight(!0):"initial"==h.height?k.height():h.height,o=A?e.find(b.side).eq(A):t.next(b.side).length>0?t.next(b.side):e.find(b.side).first();t.removeClass(x.active),o.addClass(x.active),e.insertAfter(k),e.remove(),"auto"!=h.width&&(k.css("width",n+h.jitter),g.verbose("Specifying width during animation",n)),"auto"!=h.height&&(k.css("height",i+h.jitter),g.verbose("Specifying height during animation",i))},nextSide:function(e){A=e,m=T.filter(e),A=T.index(m),0===m.length&&(g.set.defaultSide(),g.error(y.side)),g.verbose("Next side manually set to",m)},active:function(){g.verbose("Setting new side to active",m),T.removeClass(x.active),m.addClass(x.active),h.onChange.call(m[0]),g.set.defaultSide()}},flip:{up:function(){return!g.is.complete()||g.is.animating()||h.allowRepeats?void(g.is.animating()?g.queue("flip up"):(g.debug("Flipping up",m),g.set.stageSize(),g.stage.above(),g.animate(g.get.transform.up()))):void g.debug("Side already visible",m)},down:function(){return!g.is.complete()||g.is.animating()||h.allowRepeats?void(g.is.animating()?g.queue("flip down"):(g.debug("Flipping down",m),g.set.stageSize(),g.stage.below(),g.animate(g.get.transform.down()))):void g.debug("Side already visible",m)},left:function(){return!g.is.complete()||g.is.animating()||h.allowRepeats?void(g.is.animating()?g.queue("flip left"):(g.debug("Flipping left",m),g.set.stageSize(),g.stage.left(),g.animate(g.get.transform.left()))):void g.debug("Side already visible",m)},right:function(){return!g.is.complete()||g.is.animating()||h.allowRepeats?void(g.is.animating()?g.queue("flip right"):(g.debug("Flipping right",m),g.set.stageSize(),g.stage.right(),g.animate(g.get.transform.right()))):void g.debug("Side already visible",m)},over:function(){return!g.is.complete()||g.is.animating()||h.allowRepeats?void(g.is.animating()?g.queue("flip over"):(g.debug("Flipping over",m),g.set.stageSize(),g.stage.behind(),g.animate(g.get.transform.over()))):void g.debug("Side already visible",m)},back:function(){return!g.is.complete()||g.is.animating()||h.allowRepeats?void(g.is.animating()?g.queue("flip back"):(g.debug("Flipping back",m),g.set.stageSize(),g.stage.behind(),g.animate(g.get.transform.back()))):void g.debug("Side already visible",m)}},get:{transform:{up:function(){var e={y:-((t.outerHeight(!0)-m.outerHeight(!0))/2),z:-(t.outerHeight(!0)/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(-90deg)"}},down:function(){var e={y:-((t.outerHeight(!0)-m.outerHeight(!0))/2),z:-(t.outerHeight(!0)/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(90deg)"}},left:function(){var e={x:-((t.outerWidth(!0)-m.outerWidth(!0))/2),z:-(t.outerWidth(!0)/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(90deg)"}},right:function(){var e={x:-((t.outerWidth(!0)-m.outerWidth(!0))/2),z:-(t.outerWidth(!0)/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(-90deg)"}},over:function(){var e={x:-((t.outerWidth(!0)-m.outerWidth(!0))/2)};return{transform:"translateX("+e.x+"px) rotateY(180deg)"}},back:function(){var e={x:-((t.outerWidth(!0)-m.outerWidth(!0))/2)};return{transform:"translateX("+e.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]},nextSide:function(){return t.next(b.side).length>0?t.next(b.side):k.find(b.side).first()}},stage:{above:function(){var e={origin:(t.outerHeight(!0)-m.outerHeight(!0))/2,depth:{active:m.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};g.verbose("Setting the initial animation position as above",m,e),S.css({transform:"translateZ(-"+e.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),m.addClass(x.animating).css({top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px)"})},below:function(){var e={origin:(t.outerHeight(!0)-m.outerHeight(!0))/2,depth:{active:m.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};g.verbose("Setting the initial animation position as below",m,e),S.css({transform:"translateZ(-"+e.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),m.addClass(x.animating).css({top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px)"})},left:function(){var e={active:t.outerWidth(!0),next:m.outerWidth(!0)},n={origin:(e.active-e.next)/2,depth:{active:e.next/2,next:e.active/2}};g.verbose("Setting the initial animation position as left",m,n),S.css({transform:"translateZ(-"+n.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"}),m.addClass(x.animating).css({left:n.origin+"px",transform:"rotateY(-90deg) translateZ("+n.depth.next+"px)"})},right:function(){var e={active:t.outerWidth(!0),next:m.outerWidth(!0)},n={origin:(e.active-e.next)/2,depth:{active:e.next/2,next:e.active/2}};g.verbose("Setting the initial animation position as left",m,n),S.css({transform:"translateZ(-"+n.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"}),m.addClass(x.animating).css({left:n.origin+"px",transform:"rotateY(90deg) translateZ("+n.depth.next+"px)"})},behind:function(){var e={active:t.outerWidth(!0),next:m.outerWidth(!0)},n={origin:(e.active-e.next)/2,depth:{active:e.next/2,next:e.active/2}};g.verbose("Setting the initial animation position as behind",m,n),t.css({transform:"rotateY(0deg)"}),m.addClass(x.animating).css({left:n.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){if(g.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];e.isPlainObject(h[t])?e.extend(!0,h[t],n):h[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},debug:function(){!h.silent&&h.debug&&(h.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,h.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),g.verbose.apply(console,arguments)))},error:function(){h.silent||(g.error=Function.prototype.bind.call(console.error,console,h.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;h.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:R,"Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var t=h.name+":",n=0;s=!1,clearTimeout(g.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",p&&(t+=" '"+p+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,o){var r,s,l,c=P;return n=n||d,o=R||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},u?(P===i&&g.initialize(),g.invoke(c)):(P!==i&&P.invoke("destroy"),g.initialize())}),a!==i?a:this},e.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.sidebar=function(o){var a,r=e(this),s=e(t),l=e(n),c=e("html"),u=e("head"),d=r.selector||"",f=(new Date).getTime(),m=[],g=arguments[0],p="string"==typeof g,h=[].slice.call(arguments,1),v=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var r,b,y,x,C,w,k=e.isPlainObject(o)?e.extend(!0,{},e.fn.sidebar.settings,o):e.extend({},e.fn.sidebar.settings),S=k.selector,T=k.className,A=k.namespace,R=k.regExp,P=k.error,E="."+A,F="module-"+A,O=e(this),D=e(k.context),q=O.children(S.sidebar),j=D.children(S.fixed),z=D.children(S.pusher),M=this,I=O.data(F);w={initialize:function(){w.debug("Initializing sidebar",o),w.create.id(),C=w.get.transitionEvent(),w.is.ios()&&w.set.ios(),k.delaySetup?v(w.setup.layout):w.setup.layout(),v(function(){w.setup.cache()}),w.instantiate()},instantiate:function(){w.verbose("Storing instance of module",w),I=w,O.data(F,w)},create:{id:function(){y=(Math.random().toString(16)+"000000000").substr(2,8),b="."+y,w.verbose("Creating unique id for element",y)}},destroy:function(){w.verbose("Destroying previous module for",O),O.off(E).removeData(F),w.is.ios()&&w.remove.ios(),D.off(b),s.off(b),l.off(b)},event:{clickaway:function(e){var t=z.find(e.target).length>0||z.is(e.target),n=D.is(e.target);t&&(w.verbose("User clicked on dimmed page"),w.hide()),n&&(w.verbose("User clicked on dimmable context (scaled out page)"),w.hide())},touch:function(e){},containScroll:function(e){M.scrollTop<=0&&(M.scrollTop=1),M.scrollTop+M.offsetHeight>=M.scrollHeight&&(M.scrollTop=M.scrollHeight-M.offsetHeight-1)},scroll:function(t){0===e(t.target).closest(S.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){w.verbose("Adding clickaway events to context",D),k.closable&&D.on("click"+b,w.event.clickaway).on("touchend"+b,w.event.clickaway)},scrollLock:function(){k.scrollLock&&(w.debug("Disabling page scroll"),s.on("DOMMouseScroll"+b,w.event.scroll)),w.verbose("Adding events to contain sidebar scroll"),l.on("touchmove"+b,w.event.touch),O.on("scroll"+E,w.event.containScroll)}},unbind:{clickaway:function(){w.verbose("Removing clickaway events from context",D),D.off(b)},scrollLock:function(){w.verbose("Removing scroll lock from page"),l.off(b),s.off(b),O.off("scroll"+E)}},add:{inlineCSS:function(){var t,n=w.cache.width||O.outerWidth(),i=w.cache.height||O.outerHeight(),o=w.is.rtl(),a=w.get.direction(),s={left:n,right:-n,top:i,bottom:-i};o&&(w.verbose("RTL detected, flipping widths"),s.left=-n,s.right=n),t="",r=e(t).appendTo(u),w.debug("Adding sizing css to head",r)}},refresh:function(){w.verbose("Refreshing selector cache"),D=e(k.context),q=D.children(S.sidebar),z=D.children(S.pusher),j=D.children(S.fixed),w.clear.cache()},refreshSidebars:function(){w.verbose("Refreshing other sidebars"),q=D.children(S.sidebar)},repaint:function(){w.verbose("Forcing repaint event"),M.style.display="none";M.offsetHeight;M.scrollTop=M.scrollTop,M.style.display=""},setup:{cache:function(){w.cache={width:O.outerWidth(),height:O.outerHeight(),rtl:"rtl"==O.css("direction")}},layout:function(){0===D.children(S.pusher).length&&(w.debug("Adding wrapper element for sidebar"),w.error(P.pusher),z=e('
'),D.children().not(S.omitted).not(q).wrapAll(z),w.refresh()),(0===O.nextAll(S.pusher).length||O.nextAll(S.pusher)[0]!==z[0])&&(w.debug("Moved sidebar to correct parent element"),w.error(P.movedSidebar,M),O.detach().prependTo(D),w.refresh()),w.clear.cache(),w.set.pushable(),w.set.direction()}},attachEvents:function(t,n){var i=e(t);n=e.isFunction(w[n])?w[n]:w.toggle,i.length>0?(w.debug("Attaching sidebar events to element",t,n), -i.on("click"+E,n)):w.error(P.notFound,t)},show:function(t){if(t=e.isFunction(t)?t:function(){},w.is.hidden()){if(w.refreshSidebars(),k.overlay&&(w.error(P.overlay),k.transition="overlay"),w.refresh(),w.othersActive())if(w.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void w.hideOthers(w.show);w.hideOthers()}else k.transition="overlay";w.pushPage(function(){t.call(M),k.onShow.call(M)}),k.onChange.call(M),k.onVisible.call(M)}else w.debug("Sidebar is already visible")},hide:function(t){t=e.isFunction(t)?t:function(){},(w.is.visible()||w.is.animating())&&(w.debug("Hiding sidebar",t),w.refreshSidebars(),w.pullPage(function(){t.call(M),k.onHidden.call(M)}),k.onChange.call(M),k.onHide.call(M))},othersAnimating:function(){return q.not(O).filter("."+T.animating).length>0},othersVisible:function(){return q.not(O).filter("."+T.visible).length>0},othersActive:function(){return w.othersVisible()||w.othersAnimating()},hideOthers:function(e){var t=q.not(O).filter("."+T.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){i++,i==n&&e()})},toggle:function(){w.verbose("Determining toggled direction"),w.is.hidden()?w.show():w.hide()},pushPage:function(t){var n,i,o,a=w.get.transition(),r="overlay"===a||w.othersActive()?O:z;t=e.isFunction(t)?t:function(){},"scale down"==k.transition&&w.scrollToTop(),w.set.transition(a),w.repaint(),n=function(){w.bind.clickaway(),w.add.inlineCSS(),w.set.animating(),w.set.visible()},i=function(){w.set.dimmed()},o=function(e){e.target==r[0]&&(r.off(C+b,o),w.remove.animating(),w.bind.scrollLock(),t.call(M))},r.off(C+b),r.on(C+b,o),v(n),k.dimPage&&!w.othersVisible()&&v(i)},pullPage:function(t){var n,i,o=w.get.transition(),a="overlay"==o||w.othersActive()?O:z;t=e.isFunction(t)?t:function(){},w.verbose("Removing context push state",w.get.direction()),w.unbind.clickaway(),w.unbind.scrollLock(),n=function(){w.set.transition(o),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersVisible()&&z.removeClass(T.dimmed)},i=function(e){e.target==a[0]&&(a.off(C+b,i),w.remove.animating(),w.remove.transition(),w.remove.inlineCSS(),("scale down"==o||k.returnScroll&&w.is.mobile())&&w.scrollBack(),t.call(M))},a.off(C+b),a.on(C+b,i),v(n)},scrollToTop:function(){w.verbose("Scrolling to top of page to avoid animation issues"),x=e(t).scrollTop(),O.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){w.verbose("Scrolling back to original page position"),t.scrollTo(0,x)},clear:{cache:function(){w.verbose("Clearing cached dimensions"),w.cache={}}},set:{ios:function(){c.addClass(T.ios)},pushed:function(){D.addClass(T.pushed)},pushable:function(){D.addClass(T.pushable)},dimmed:function(){z.addClass(T.dimmed)},active:function(){O.addClass(T.active)},animating:function(){O.addClass(T.animating)},transition:function(e){e=e||w.get.transition(),O.addClass(e)},direction:function(e){e=e||w.get.direction(),O.addClass(T[e])},visible:function(){O.addClass(T.visible)},overlay:function(){O.addClass(T.overlay)}},remove:{inlineCSS:function(){w.debug("Removing inline css styles",r),r&&r.length>0&&r.remove()},ios:function(){c.removeClass(T.ios)},pushed:function(){D.removeClass(T.pushed)},pushable:function(){D.removeClass(T.pushable)},active:function(){O.removeClass(T.active)},animating:function(){O.removeClass(T.animating)},transition:function(e){e=e||w.get.transition(),O.removeClass(e)},direction:function(e){e=e||w.get.direction(),O.removeClass(T[e])},visible:function(){O.removeClass(T.visible)},overlay:function(){O.removeClass(T.overlay)}},get:{direction:function(){return O.hasClass(T.top)?T.top:O.hasClass(T.right)?T.right:O.hasClass(T.bottom)?T.bottom:T.left},transition:function(){var e,t=w.get.direction();return e=w.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,w.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]}},is:{ie:function(){var e=!t.ActiveXObject&&"ActiveXObject"in t,n="ActiveXObject"in t;return e||n},ios:function(){var e=navigator.userAgent,t=e.match(R.ios),n=e.match(R.mobileChrome);return t&&!n?(w.verbose("Browser was found to be iOS",e),!0):!1},mobile:function(){var e=navigator.userAgent,t=e.match(R.mobile);return t?(w.verbose("Browser was found to be mobile",e),!0):(w.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!w.is.visible()},visible:function(){return O.hasClass(T.visible)},open:function(){return w.is.visible()},closed:function(){return w.is.hidden()},vertical:function(){return O.hasClass(T.top)},animating:function(){return D.hasClass(T.animating)},rtl:function(){return w.cache.rtl===i&&(w.cache.rtl="rtl"==O.css("direction")),w.cache.rtl}},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,k,t);else{if(n===i)return k[t];e.isPlainObject(k[t])?e.extend(!0,k[t],n):k[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){!k.silent&&k.debug&&(k.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,k.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),w.verbose.apply(console,arguments)))},error:function(){k.silent||(w.error=Function.prototype.bind.call(console.error,console,k.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;k.performance&&(t=(new Date).getTime(),i=f||t,n=t-i,f=t,m.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:M,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=k.name+":",n=0;f=!1,clearTimeout(w.performance.timer),e.each(m,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",d&&(t+=" '"+d+"'"),(console.group!==i||console.table!==i)&&m.length>0&&(console.groupCollapsed(t),console.table?console.table(m):e.each(m,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(t,n,o){var r,s,l,c=I;return n=n||h,o=M||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(w.error(P.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},p?(I===i&&w.initialize(),w.invoke(g)):(I!==i&&w.invoke("destroy"),w.initialize())}),a!==i?a:this},e.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.sticky=function(o){var a,r=e(this),s=r.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1);return r.each(function(){var r,m,g,p,h,v=e.isPlainObject(o)?e.extend(!0,{},e.fn.sticky.settings,o):e.extend({},e.fn.sticky.settings),b=v.className,y=v.namespace,x=v.error,C="."+y,w="module-"+y,k=e(this),S=e(t),T=e(v.scrollContext),A=(k.selector||"",k.data(w)),R=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},P=this;h={initialize:function(){h.determineContainer(),h.determineContext(),h.verbose("Initializing sticky",v,r),h.save.positions(),h.checkErrors(),h.bind.events(),v.observeChanges&&h.observeChanges(),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),A=h,k.data(w,h)},destroy:function(){h.verbose("Destroying previous instance"),h.reset(),g&&g.disconnect(),p&&p.disconnect(),S.off("load"+C,h.event.load).off("resize"+C,h.event.resize),T.off("scrollchange"+C,h.event.scrollchange),k.removeData(w)},observeChanges:function(){"MutationObserver"in t&&(g=new MutationObserver(h.event.documentChanged),p=new MutationObserver(h.event.changed),g.observe(n,{childList:!0,subtree:!0}),p.observe(P,{childList:!0,subtree:!0}),p.observe(m[0],{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",p))},determineContainer:function(){r=k.offsetParent()},determineContext:function(){return m=v.context?e(v.context):r,0===m.length?void h.error(x.invalidContext,v.context,k):void 0},checkErrors:function(){return h.is.hidden()&&h.error(x.visible,k),h.cache.element.height>h.cache.context.height?(h.reset(),void h.error(x.elementSize,k)):void 0},bind:{events:function(){S.on("load"+C,h.event.load).on("resize"+C,h.event.resize),T.off("scroll"+C).on("scroll"+C,h.event.scroll).on("scrollchange"+C,h.event.scrollchange)}},event:{changed:function(e){clearTimeout(h.timer),h.timer=setTimeout(function(){h.verbose("DOM tree modified, updating sticky menu",e),h.refresh()},100)},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==P||e(t).find(P).length>0)&&(h.debug("Element removed from DOM, tearing down events"),h.destroy())})})},load:function(){h.verbose("Page contents finished loading"),R(h.refresh)},resize:function(){h.verbose("Window resized"),R(h.refresh)},scroll:function(){R(function(){T.triggerHandler("scrollchange"+C,T.scrollTop())})},scrollchange:function(e,t){h.stick(t),v.onScroll.call(P)}},refresh:function(e){h.reset(),v.context||h.determineContext(),e&&h.determineContainer(),h.save.positions(),h.stick(),v.onReposition.call(P)},supports:{sticky:function(){var t=e("
");t[0];return t.addClass(b.supported),t.css("position").match("sticky")}},save:{lastScroll:function(e){h.lastScroll=e},elementScroll:function(e){h.elementScroll=e},positions:function(){var e={height:T.height()},t={margin:{top:parseInt(k.css("margin-top"),10),bottom:parseInt(k.css("margin-bottom"),10)},offset:k.offset(),width:k.outerWidth(),height:k.outerHeight()},n={offset:m.offset(),height:m.outerHeight()};({height:r.outerHeight()});h.is.standardScroll()||(h.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=T.scrollTop(),e.left=T.scrollLeft(),t.offset.top+=e.top,n.offset.top+=e.top,t.offset.left+=e.left,n.offset.left+=e.left),h.cache={fits:t.heighte&&(t="up")),t},scrollChange:function(e){return e=e||T.scrollTop(),h.lastScroll?e-h.lastScroll:0},currentElementScroll:function(){return h.elementScroll?h.elementScroll:h.is.top()?Math.abs(parseInt(k.css("top"),10))||0:Math.abs(parseInt(k.css("bottom"),10))||0},elementScroll:function(e){e=e||T.scrollTop();var t=h.cache.element,n=h.cache.scrollContext,i=h.get.scrollChange(e),o=t.height-n.height+v.offset,a=h.get.currentElementScroll(),r=a+i;return a=h.cache.fits||0>r?0:r>o?o:r}},remove:{lastScroll:function(){delete h.lastScroll},elementScroll:function(e){delete h.elementScroll},offset:function(){k.css("margin-top","")}},set:{offset:function(){h.verbose("Setting offset on element",v.offset),k.css("margin-top",v.offset)},containerSize:function(){var e=r.get(0).tagName;"HTML"===e||"body"==e?h.determineContainer():Math.abs(r.outerHeight()-h.cache.context.height)>v.jitter&&(h.debug("Context has padding, specifying exact height for container",h.cache.context.height),r.css({height:h.cache.context.height}))},minimumSize:function(){var e=h.cache.element;r.css("min-height",e.height)},scroll:function(e){h.debug("Setting scroll on element",e),h.elementScroll!=e&&(h.is.top()&&k.css("bottom","").css("top",-e),h.is.bottom()&&k.css("top","").css("bottom",e))},size:function(){0!==h.cache.element.height&&0!==h.cache.element.width&&(P.style.setProperty("width",h.cache.element.width+"px","important"),P.style.setProperty("height",h.cache.element.height+"px","important"))}},is:{standardScroll:function(){return T[0]==t},top:function(){return k.hasClass(b.top)},bottom:function(){return k.hasClass(b.bottom)},initialPosition:function(){return!h.is.fixed()&&!h.is.bound()},hidden:function(){return!k.is(":visible")},bound:function(){return k.hasClass(b.bound)},fixed:function(){return k.hasClass(b.fixed)}},stick:function(e){var t=e||T.scrollTop(),n=h.cache,i=n.fits,o=n.element,a=n.scrollContext,r=n.context,s=h.is.bottom()&&v.pushing?v.bottomOffset:v.offset,e={top:t+s,bottom:t+s+a.height},l=(h.get.direction(e.top),i?0:h.get.elementScroll(e.top)),c=!i,u=0!==o.height;u&&(h.is.initialPosition()?e.top>=r.bottom?(h.debug("Initial element position is bottom of container"),h.bindBottom()):e.top>o.top&&(o.height+e.top-l>=r.bottom?(h.debug("Initial element position is bottom of container"),h.bindBottom()):(h.debug("Initial element position is fixed"),h.fixTop())):h.is.fixed()?h.is.top()?e.top<=o.top?(h.debug("Fixed element reached top of container"),h.setInitialPosition()):o.height+e.top-l>=r.bottom?(h.debug("Fixed element reached bottom of container"),h.bindBottom()):c&&(h.set.scroll(l),h.save.lastScroll(e.top),h.save.elementScroll(l)):h.is.bottom()&&(e.bottom-o.height<=o.top?(h.debug("Bottom fixed rail has reached top of container"),h.setInitialPosition()):e.bottom>=r.bottom?(h.debug("Bottom fixed rail has reached bottom of container"),h.bindBottom()):c&&(h.set.scroll(l),h.save.lastScroll(e.top),h.save.elementScroll(l))):h.is.bottom()&&(e.top<=o.top?(h.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),h.setInitialPosition()):v.pushing?h.is.bound()&&e.bottom<=r.bottom&&(h.debug("Fixing bottom attached element to bottom of browser."),h.fixBottom()):h.is.bound()&&e.top<=r.bottom-o.height&&(h.debug("Fixing bottom attached element to top of browser."),h.fixTop())))},bindTop:function(){h.debug("Binding element to top of parent container"),h.remove.offset(),k.css({left:"",top:"",marginBottom:""}).removeClass(b.fixed).removeClass(b.bottom).addClass(b.bound).addClass(b.top),v.onTop.call(P),v.onUnstick.call(P)},bindBottom:function(){h.debug("Binding element to bottom of parent container"),h.remove.offset(),k.css({left:"",top:""}).removeClass(b.fixed).removeClass(b.top).addClass(b.bound).addClass(b.bottom),v.onBottom.call(P),v.onUnstick.call(P)},setInitialPosition:function(){h.debug("Returning to initial position"),h.unfix(),h.unbind()},fixTop:function(){h.debug("Fixing element to top of page"),h.set.minimumSize(),h.set.offset(),k.css({left:h.cache.element.left,bottom:"",marginBottom:""}).removeClass(b.bound).removeClass(b.bottom).addClass(b.fixed).addClass(b.top),v.onStick.call(P)},fixBottom:function(){h.debug("Sticking element to bottom of page"),h.set.minimumSize(),h.set.offset(),k.css({left:h.cache.element.left,bottom:"",marginBottom:""}).removeClass(b.bound).removeClass(b.top).addClass(b.fixed).addClass(b.bottom),v.onStick.call(P)},unbind:function(){h.is.bound()&&(h.debug("Removing container bound position on element"),h.remove.offset(),k.removeClass(b.bound).removeClass(b.top).removeClass(b.bottom))},unfix:function(){h.is.fixed()&&(h.debug("Removing fixed position on element"),h.remove.offset(),k.removeClass(b.fixed).removeClass(b.top).removeClass(b.bottom),v.onUnstick.call(P))},reset:function(){h.debug("Resetting elements position"),h.unbind(),h.unfix(),h.resetCSS(),h.remove.offset(),h.remove.lastScroll()},resetCSS:function(){k.css({width:"",height:""}),r.css({height:""})},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];h[t]=n}},debug:function(){!v.silent&&v.debug&&(v.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,v.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),h.verbose.apply(console,arguments)))},error:function(){v.silent||(h.error=Function.prototype.bind.call(console.error,console,v.name+":"),h.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;v.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,0)},display:function(){var t=v.name+":",n=0;l=!1,clearTimeout(h.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var r,s,l,c=A;return n=n||f,o=P||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},d?(A===i&&h.initialize(),h.invoke(u)):(A!==i&&A.invoke("destroy"),h.initialize())}),a!==i?a:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset:0,jitter:5,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to surpress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.tab=function(o){var a,r=e(e.isFunction(this)?t:this),s=r.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1),m=!1;return r.each(function(){var g,p,h,v,b,y,x=e.isPlainObject(o)?e.extend(!0,{},e.fn.tab.settings,o):e.extend({},e.fn.tab.settings),C=x.className,w=x.metadata,k=x.selector,S=x.error,T="."+x.namespace,A="module-"+x.namespace,R=e(this),P={},E=!0,F=0,O=this,D=R.data(A);b={initialize:function(){b.debug("Initializing tab menu item",R),b.fix.callbacks(),b.determineTabs(),b.debug("Determining tabs",x.context,p),x.auto&&b.set.auto(),b.bind.events(),x.history&&!m&&(b.initializeHistory(),m=!0),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),D=b,R.data(A,b)},destroy:function(){b.debug("Destroying tabs",R),R.removeData(A).off(T)},bind:{events:function(){e.isWindow(O)||(b.debug("Attaching tab activation events to element",R),R.on("click"+T,b.event.click))}},determineTabs:function(){var t;"parent"===x.context?(R.closest(k.ui).length>0?(t=R.closest(k.ui),b.verbose("Using closest UI element as parent",t)):t=R,g=t.parent(),b.verbose("Determined parent element for creating context",g)):x.context?(g=e(x.context),b.verbose("Using selector for tab context",x.context,g)):g=e("body"),x.childrenOnly?(p=g.children(k.tabs),b.debug("Searching tab context children for tabs",g,p)):(p=g.find(k.tabs),b.debug("Searching tab context for tabs",g,p))},fix:{callbacks:function(){e.isPlainObject(o)&&(o.onTabLoad||o.onTabInit)&&(o.onTabLoad&&(o.onLoad=o.onTabLoad,delete o.onTabLoad,b.error(S.legacyLoad,o.onLoad)),o.onTabInit&&(o.onFirstLoad=o.onTabInit,delete o.onTabInit,b.error(S.legacyInit,o.onFirstLoad)),x=e.extend(!0,{},e.fn.tab.settings,o))}},initializeHistory:function(){if(b.debug("Initializing page state"),e.address===i)return b.error(S.state),!1;if("state"==x.historyType){if(b.debug("Using HTML5 to manage state"),x.path===!1)return b.error(S.path),!1;e.address.history(!0).state(x.path)}e.address.bind("change",b.event.history.change)},event:{click:function(t){var n=e(this).data(w.tab);n!==i?(x.history?(b.verbose("Updating page state",t),e.address.value(n)):(b.verbose("Changing tab",t),b.changeTab(n)),t.preventDefault()):b.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||b.get.initialPath(),o=x.templates.determineTitle(n)||!1;b.performance.display(),b.debug("History change event",n,t),y=t,n!==i&&b.changeTab(n),o&&e.address.title(o)}}},refresh:function(){h&&(b.debug("Refreshing tab",h),b.changeTab(h))},cache:{read:function(e){return e!==i?P[e]:!1},add:function(e,t){e=e||h,b.debug("Adding cached content for",e),P[e]=t},remove:function(e){e=e||h,b.debug("Removing cached content for",e),delete P[e]}},set:{auto:function(){var t="string"==typeof x.path?x.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";b.verbose("Setting up automatic tab retrieval from server",t),e.isPlainObject(x.apiSettings)?x.apiSettings.url=t:x.apiSettings={url:t}},loading:function(e){var t=b.get.tabElement(e),n=t.hasClass(C.loading);n||(b.verbose("Setting loading state for",t),t.addClass(C.loading).siblings(p).removeClass(C.active+" "+C.loading),t.length>0&&x.onRequest.call(t[0],e))},state:function(t){e.address.value(t)}},changeTab:function(n){var i=t.history&&t.history.pushState,o=i&&x.ignoreFirstLoad&&E,a=x.auto||e.isPlainObject(x.apiSettings),r=a&&!o?b.utilities.pathToArray(n):b.get.defaultPathArray(n);n=b.utilities.arrayToPath(r),e.each(r,function(t,i){var s,l,c,u,d=r.slice(0,t+1),f=b.utilities.arrayToPath(d),m=b.is.tab(f),p=t+1==r.length,k=b.get.tabElement(f);if(b.verbose("Looking for tab",i),m){if(b.verbose("Tab was found",i),h=f,v=b.utilities.filterArray(r,d),p?u=!0:(l=r.slice(0,t+2),c=b.utilities.arrayToPath(l),u=!b.is.tab(c),u&&b.verbose("Tab parameters found",l)),u&&a)return o?(b.debug("Ignoring remote content on first tab load",f),E=!1,b.cache.add(n,k.html()),b.activate.all(f),x.onFirstLoad.call(k[0],f,v,y),x.onLoad.call(k[0],f,v,y)):(b.activate.navigation(f),b.fetch.content(f,n)),!1;b.debug("Opened local tab",f),b.activate.all(f),b.cache.read(f)||(b.cache.add(f,!0),b.debug("First time tab loaded calling tab init"),x.onFirstLoad.call(k[0],f,v,y)),x.onLoad.call(k[0],f,v,y)}else{if(-1!=n.search("/")||""===n)return b.error(S.missingTab,R,g,f),!1;if(s=e("#"+n+', a[name="'+n+'"]'),f=s.closest("[data-tab]").data(w.tab),k=b.get.tabElement(f),s&&s.length>0&&f)return b.debug("Anchor link used, opening parent tab",k,s),k.hasClass(C.active)||setTimeout(function(){b.scrollTo(s)},0),b.activate.all(f),b.cache.read(f)||(b.cache.add(f,!0),b.debug("First time tab loaded calling tab init"),x.onFirstLoad.call(k[0],f,v,y)),x.onLoad.call(k[0],f,v,y),!1}})},scrollTo:function(t){var i=t&&t.length>0?t.offset().top:!1;i!==!1&&(b.debug("Forcing scroll to an in-page link in a hidden tab",i,t),e(n).scrollTop(i))},update:{content:function(e,t,n){var o=b.get.tabElement(e),a=o[0];n=n!==i?n:x.evaluateScripts,n?(b.debug("Updating HTML and evaluating inline scripts",e,t),o.html(t)):(b.debug("Updating HTML",e,t),a.innerHTML=t)}},fetch:{content:function(t,n){var o,a,r=b.get.tabElement(t),s={dataType:"html",encodeParameters:!1,on:"now",cache:x.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==x.cacheType&&b.cache.add(n,e),b.update.content(t,e),t==h?(b.debug("Content loaded",t),b.activate.tab(t)):b.debug("Content loaded in background",t),x.onFirstLoad.call(r[0],t,v,y),x.onLoad.call(r[0],t,v,y),"response"!=x.cacheType&&b.cache.add(n,r.html())},urlData:{tab:n}},l=r.api("get request")||!1,c=l&&"pending"===l.state();n=n||t,a=b.cache.read(n),x.cache&&a?(b.activate.tab(t),b.debug("Adding cached content",n),"once"==x.evaluateScripts?b.update.content(t,a,!1):b.update.content(t,a),x.onLoad.call(r[0],t,v,y)):c?(b.set.loading(t),b.debug("Content is already loading",n)):e.api!==i?(o=e.extend(!0,{},x.apiSettings,s),b.debug("Retrieving remote content",n,o),b.set.loading(t),r.api(o)):b.error(S.api)}},activate:{all:function(e){b.activate.tab(e),b.activate.navigation(e)},tab:function(e){var t=b.get.tabElement(e),n="siblings"==x.deactivate?t.siblings(p):p.not(t),i=t.hasClass(C.active);b.verbose("Showing tab content for",t),i||(t.addClass(C.active),n.removeClass(C.active+" "+C.loading),t.length>0&&x.onVisible.call(t[0],e))},navigation:function(e){var t=b.get.navElement(e),n="siblings"==x.deactivate?t.siblings(r):r.not(t),i=t.hasClass(C.active);b.verbose("Activating tab navigation for",t,e),i||(t.addClass(C.active),n.removeClass(C.active+" "+C.loading))}},deactivate:{all:function(){b.deactivate.navigation(),b.deactivate.tabs()},navigation:function(){r.removeClass(C.active)},tabs:function(){p.removeClass(C.active+" "+C.loading)}},is:{tab:function(e){return e!==i?b.get.tabElement(e).length>0:!1}},get:{initialPath:function(){return r.eq(0).data(w.tab)||p.eq(0).data(w.tab)},path:function(){return e.address.value()},defaultPathArray:function(e){return b.utilities.pathToArray(b.get.defaultPath(e))},defaultPath:function(e){var t=r.filter("[data-"+w.tab+'^="'+e+'/"]').eq(0),n=t.data(w.tab)||!1;if(n){if(b.debug("Found default tab",n),F0?t:n},tab:function(){return h}},utilities:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(t){return e.isArray(t)?t[t.length-1]:!1},pathToArray:function(e){return e===i&&(e=h),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return e.isArray(t)?t.join("/"):!1}},setting:function(t,n){if(b.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];e.isPlainObject(x[t])?e.extend(!0,x[t],n):x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(n===i)return b[t];b[t]=n}},debug:function(){!x.silent&&x.debug&&(x.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,x.name+":"),b.debug.apply(console,arguments)))},verbose:function(){!x.silent&&x.verbose&&x.debug&&(x.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),b.verbose.apply(console,arguments)))},error:function(){x.silent||(b.error=Function.prototype.bind.call(console.error,console,x.name+":"),b.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:O,"Execution Time":n})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,500)},display:function(){var t=x.name+":",n=0;l=!1,clearTimeout(b.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var r,s,l,c=D;return n=n||f,o=O||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(b.error(S.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},d?(D===i&&b.initialize(),b.invoke(u)):(D!==i&&D.invoke("destroy"),b.initialize())}),a!==i?a:this},e.tab=function(){e(t).tab.apply(this,arguments)},e.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(e,t,n){},onLoad:function(e,t,n){},onVisible:function(e,t,n){},onRequest:function(e,t,n){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library "},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.transition=function(){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments,u=c[0],d=[].slice.call(arguments,1),f="string"==typeof u;t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return a.each(function(t){var m,g,p,h,v,b,y,x,C,w=e(this),k=this;C={initialize:function(){m=C.get.settings.apply(k,c),h=m.className,p=m.error,v=m.metadata, -x="."+m.namespace,y="module-"+m.namespace,g=w.data(y)||C,b=C.get.animationEndEvent(),f&&(f=C.invoke(u)),f===!1&&(C.verbose("Converted arguments into settings object",m),m.interval?C.delay(m.animate):C.animate(),C.instantiate())},instantiate:function(){C.verbose("Storing instance of module",C),g=C,w.data(y,g)},destroy:function(){C.verbose("Destroying previous module for",k),w.removeData(y)},refresh:function(){C.verbose("Refreshing display type on next animation"),delete C.displayType},forceRepaint:function(){C.verbose("Forcing element repaint");var e=w.parent(),t=w.next();0===t.length?w.detach().appendTo(e):w.detach().insertBefore(t)},repaint:function(){C.verbose("Repainting element");k.offsetWidth},delay:function(e){var n,o,r=C.get.animationDirection();r||(r=C.can.transition()?C.get.direction():"static"),e=e!==i?e:m.interval,n="auto"==m.reverse&&r==h.outward,o=n||1==m.reverse?(a.length-t)*m.interval:t*m.interval,C.debug("Delaying animation by",o),setTimeout(C.animate,o)},animate:function(e){if(m=e||m,!C.is.supported())return C.error(p.support),!1;if(C.debug("Preparing animation",m.animation),C.is.animating()){if(m.queue)return!m.allowRepeats&&C.has.direction()&&C.is.occurring()&&C.queuing!==!0?C.debug("Animation is currently occurring, preventing queueing same animation",m.animation):C.queue(m.animation),!1;if(!m.allowRepeats&&C.is.occurring())return C.debug("Animation is already occurring, will not execute repeated animation",m.animation),!1;C.debug("New animation started, completing previous early",m.animation),g.complete()}C.can.animate()?C.set.animating(m.animation):C.error(p.noAnimation,m.animation,k)},reset:function(){C.debug("Resetting animation to beginning conditions"),C.remove.animationCallbacks(),C.restore.conditions(),C.remove.animating()},queue:function(e){C.debug("Queueing animation of",e),C.queuing=!0,w.one(b+".queue"+x,function(){C.queuing=!1,C.repaint(),C.animate.apply(this,m)})},complete:function(e){C.debug("Animation complete",m.animation),C.remove.completeCallback(),C.remove.failSafe(),C.is.looping()||(C.is.outward()?(C.verbose("Animation is outward, hiding element"),C.restore.conditions(),C.hide()):C.is.inward()?(C.verbose("Animation is outward, showing element"),C.restore.conditions(),C.show()):(C.verbose("Static animation completed"),C.restore.conditions(),m.onComplete.call(k)))},force:{visible:function(){var e=w.attr("style"),t=C.get.userStyle(),n=C.get.displayType(),o=t+"display: "+n+" !important;",a=w.css("display"),r=e===i||""===e;a!==n?(C.verbose("Overriding default display to show element",n),w.attr("style",o)):r&&w.removeAttr("style")},hidden:function(){var e=w.attr("style"),t=w.css("display"),n=e===i||""===e;"none"===t||C.is.hidden()?n&&w.removeAttr("style"):(C.verbose("Overriding default display to hide element"),w.css("display","none"))}},has:{direction:function(t){var n=!1;return t=t||m.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){(t===h.inward||t===h.outward)&&(n=!0)})),n},inlineDisplay:function(){var t=w.attr("style")||"";return e.isArray(t.match(/display.*?;/,""))}},set:{animating:function(e){var t;C.remove.completeCallback(),e=e||m.animation,t=C.get.animationClass(e),C.save.animation(t),C.force.visible(),C.remove.hidden(),C.remove.direction(),C.start.animation(t)},duration:function(e,t){t=t||m.duration,t="number"==typeof t?t+"ms":t,(t||0===t)&&(C.verbose("Setting animation duration",t),w.css({"animation-duration":t}))},direction:function(e){e=e||C.get.direction(),e==h.inward?C.set.inward():C.set.outward()},looping:function(){C.debug("Transition set to loop"),w.addClass(h.looping)},hidden:function(){w.addClass(h.transition).addClass(h.hidden)},inward:function(){C.debug("Setting direction to inward"),w.removeClass(h.outward).addClass(h.inward)},outward:function(){C.debug("Setting direction to outward"),w.removeClass(h.inward).addClass(h.outward)},visible:function(){w.addClass(h.transition).addClass(h.visible)}},start:{animation:function(e){e=e||C.get.animationClass(),C.debug("Starting tween",e),w.addClass(e).one(b+".complete"+x,C.complete),m.useFailSafe&&C.add.failSafe(),C.set.duration(m.duration),m.onStart.call(k)}},save:{animation:function(e){C.cache||(C.cache={}),C.cache.animation=e},displayType:function(e){"none"!==e&&w.data(v.displayType,e)},transitionExists:function(t,n){e.fn.transition.exists[t]=n,C.verbose("Saving existence of transition",t,n)}},restore:{conditions:function(){var e=C.get.currentAnimation();e&&(w.removeClass(e),C.verbose("Removing animation class",C.cache)),C.remove.duration()}},add:{failSafe:function(){var e=C.get.duration();C.timer=setTimeout(function(){w.triggerHandler(b)},e+m.failSafeDelay),C.verbose("Adding fail safe timer",C.timer)}},remove:{animating:function(){w.removeClass(h.animating)},animationCallbacks:function(){C.remove.queueCallback(),C.remove.completeCallback()},queueCallback:function(){w.off(".queue"+x)},completeCallback:function(){w.off(".complete"+x)},display:function(){w.css("display","")},direction:function(){w.removeClass(h.inward).removeClass(h.outward)},duration:function(){w.css("animation-duration","")},failSafe:function(){C.verbose("Removing fail safe timer",C.timer),C.timer&&clearTimeout(C.timer)},hidden:function(){w.removeClass(h.hidden)},visible:function(){w.removeClass(h.visible)},looping:function(){C.debug("Transitions are no longer looping"),C.is.looping()&&(C.reset(),w.removeClass(h.looping))},transition:function(){w.removeClass(h.visible).removeClass(h.hidden)}},get:{settings:function(t,n,i){return"object"==typeof t?e.extend(!0,{},e.fn.transition.settings,t):"function"==typeof i?e.extend({},e.fn.transition.settings,{animation:t,onComplete:i,duration:n}):"string"==typeof n||"number"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,duration:n}):"object"==typeof n?e.extend({},e.fn.transition.settings,n,{animation:t}):"function"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,onComplete:n}):e.extend({},e.fn.transition.settings,{animation:t})},animationClass:function(e){var t=e||m.animation,n=C.can.transition()&&!C.has.direction()?C.get.direction()+" ":"";return h.animating+" "+h.transition+" "+n+t},currentAnimation:function(){return C.cache&&C.cache.animation!==i?C.cache.animation:!1},currentDirection:function(){return C.is.inward()?h.inward:h.outward},direction:function(){return C.is.hidden()||!C.is.visible()?h.inward:h.outward},animationDirection:function(t){var n;return t=t||m.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){t===h.inward?n=h.inward:t===h.outward&&(n=h.outward)})),n?n:!1},duration:function(e){return e=e||m.duration,e===!1&&(e=w.css("animation-duration")||0),"string"==typeof e?e.indexOf("ms")>-1?parseFloat(e):1e3*parseFloat(e):e},displayType:function(){return m.displayType?m.displayType:(w.data(v.displayType)===i&&C.can.transition(!0),w.data(v.displayType))},userStyle:function(e){return e=e||w.attr("style")||"",e.replace(/display.*?;/,"")},transitionExists:function(t){return e.fn.transition.exists[t]},animationStartEvent:function(){var e,t=n.createElement("div"),o={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in o)if(t.style[e]!==i)return o[e];return!1},animationEndEvent:function(){var e,t=n.createElement("div"),o={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in o)if(t.style[e]!==i)return o[e];return!1}},can:{transition:function(t){var n,o,a,r,s,l,c,u=m.animation,d=C.get.transitionExists(u);if(d===i||t){if(C.verbose("Determining whether animation exists"),n=w.attr("class"),o=w.prop("tagName"),a=e("<"+o+" />").addClass(n).insertAfter(w),r=a.addClass(u).removeClass(h.inward).removeClass(h.outward).addClass(h.animating).addClass(h.transition).css("animationName"),s=a.addClass(h.inward).css("animationName"),c=a.attr("class",n).removeAttr("style").removeClass(h.hidden).removeClass(h.visible).show().css("display"),C.verbose("Determining final display state",c),C.save.displayType(c),a.remove(),r!=s)C.debug("Direction exists for animation",u),l=!0;else{if("none"==r||!r)return void C.debug("No animation defined in css",u);C.debug("Static animation found",u,c),l=!1}C.save.transitionExists(u,l)}return d!==i?d:l},animate:function(){return C.can.transition()!==i}},is:{animating:function(){return w.hasClass(h.animating)},inward:function(){return w.hasClass(h.inward)},outward:function(){return w.hasClass(h.outward)},looping:function(){return w.hasClass(h.looping)},occurring:function(e){return e=e||m.animation,e="."+e.replace(" ","."),w.filter(e).length>0},visible:function(){return w.is(":visible")},hidden:function(){return"hidden"===w.css("visibility")},supported:function(){return b!==!1}},hide:function(){C.verbose("Hiding element"),C.is.animating()&&C.reset(),k.blur(),C.remove.display(),C.remove.visible(),C.set.hidden(),C.force.hidden(),m.onHide.call(k),m.onComplete.call(k)},show:function(e){C.verbose("Showing element",e),C.remove.hidden(),C.set.visible(),C.force.visible(),m.onShow.call(k),m.onComplete.call(k)},toggle:function(){C.is.visible()?C.hide():C.show()},stop:function(){C.debug("Stopping current animation"),w.triggerHandler(b)},stopAll:function(){C.debug("Stopping all animation"),C.remove.queueCallback(),w.triggerHandler(b)},clear:{queue:function(){C.debug("Clearing animation queue"),C.remove.queueCallback()}},enable:function(){C.verbose("Starting animation"),w.removeClass(h.disabled)},disable:function(){C.debug("Stopping animation"),w.addClass(h.disabled)},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,m.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),C.verbose.apply(console,arguments)))},error:function(){m.silent||(C.error=Function.prototype.bind.call(console.error,console,m.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(C.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,a){var r,s,l,c=g;return n=n||d,a=k||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s!==i?s:!1}},C.initialize()}),o!==i?o:this},e.fn.transition.exists={},e.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(e,t,n,i){"use strict";var t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();e.api=e.fn.api=function(n){var o,a=e(e.isFunction(this)?t:this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var a,f,m,g,p,h,v=e.isPlainObject(n)?e.extend(!0,{},e.fn.api.settings,n):e.extend({},e.fn.api.settings),b=v.namespace,y=v.metadata,x=v.selector,C=v.error,w=v.className,k="."+b,S="module-"+b,T=e(this),A=T.closest(x.form),R=v.stateContext?e(v.stateContext):T,P=this,E=R[0],F=T.data(S);h={initialize:function(){u||h.bind.events(),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),F=h,T.data(S,F)},destroy:function(){h.verbose("Destroying previous module for",P),T.removeData(S).off(k)},bind:{events:function(){var e=h.get.event();e?(h.verbose("Attaching API events to element",e),T.on(e+k,h.event.trigger)):"now"==v.on&&(h.debug("Querying API endpoint immediately"),h.query())}},decode:{json:function(e){if(e!==i&&"string"==typeof e)try{e=JSON.parse(e)}catch(t){}return e}},read:{cachedResponse:function(e){var n;return t.Storage===i?void h.error(C.noStorage):(n=sessionStorage.getItem(e),h.debug("Using cached response",e,n),n=h.decode.json(n))}},write:{cachedResponse:function(n,o){return o&&""===o?void h.debug("Response empty, not caching",o):t.Storage===i?void h.error(C.noStorage):(e.isPlainObject(o)&&(o=JSON.stringify(o)),sessionStorage.setItem(n,o),void h.verbose("Storing cached response for url",n,o))}},query:function(){if(h.is.disabled())return void h.debug("Element is disabled API request aborted");if(h.is.loading()){if(!v.interruptRequests)return void h.debug("Cancelling request, previous request is still pending");h.debug("Interrupting previous request"),h.abort()}return v.defaultData&&e.extend(!0,v.urlData,h.get.defaultData()),v.serializeForm&&(v.data=h.add.formData(v.data)),f=h.get.settings(),f===!1?(h.cancelled=!0,void h.error(C.beforeSend)):(h.cancelled=!1,m=h.get.templatedURL(),m||h.is.mocked()?(m=h.add.urlData(m),m||h.is.mocked()?(f.url=v.base+m,a=e.extend(!0,{},v,{type:v.method||v.type,data:g,url:v.base+m,beforeSend:v.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),h.debug("Querying URL",a.url),h.verbose("Using AJAX settings",a),"local"===v.cache&&h.read.cachedResponse(m)?(h.debug("Response returned from local cache"),h.request=h.create.request(),void h.request.resolveWith(E,[h.read.cachedResponse(m)])):void(v.throttle?v.throttleFirstRequest||h.timer?(h.debug("Throttling request",v.throttle),clearTimeout(h.timer),h.timer=setTimeout(function(){h.timer&&delete h.timer,h.debug("Sending throttled request",g,a.method),h.send.request()},v.throttle)):(h.debug("Sending request",g,a.method),h.send.request(),h.timer=setTimeout(function(){},v.throttle)):(h.debug("Sending request",g,a.method),h.send.request()))):void 0):void h.error(C.missingURL))},should:{removeError:function(){return v.hideError===!0||"auto"===v.hideError&&!h.is.form()}},is:{disabled:function(){return T.filter(x.disabled).length>0},expectingJSON:function(){return"json"===v.dataType||"jsonp"===v.dataType},form:function(){return T.is("form")||R.is("form")},mocked:function(){return v.mockResponse||v.mockResponseAsync||v.response||v.responseAsync},input:function(){return T.is("input")},loading:function(){return h.request?"pending"==h.request.state():!1},abortedRequest:function(e){return e&&e.readyState!==i&&0===e.readyState?(h.verbose("XHR request determined to be aborted"),!0):(h.verbose("XHR request was not aborted"),!1)},validResponse:function(t){return h.is.expectingJSON()&&e.isFunction(v.successTest)?(h.debug("Checking JSON returned success",v.successTest,t),v.successTest(t)?(h.debug("Response passed success test",t),!0):(h.debug("Response failed success test",t),!1)):(h.verbose("Response is not JSON, skipping validation",v.successTest,t),!0)}},was:{cancelled:function(){return h.cancelled||!1},succesful:function(){return h.request&&"resolved"==h.request.state()},failure:function(){return h.request&&"rejected"==h.request.state()},complete:function(){return h.request&&("resolved"==h.request.state()||"rejected"==h.request.state())}},add:{urlData:function(t,n){var o,a;return t&&(o=t.match(v.regExp.required),a=t.match(v.regExp.optional),n=n||v.urlData,o&&(h.debug("Looking for required URL variables",o),e.each(o,function(o,a){var r=-1!==a.indexOf("$")?a.substr(2,a.length-3):a.substr(1,a.length-2),s=e.isPlainObject(n)&&n[r]!==i?n[r]:T.data(r)!==i?T.data(r):R.data(r)!==i?R.data(r):n[r];return s===i?(h.error(C.requiredParameter,r,t),t=!1,!1):(h.verbose("Found required variable",r,s),s=v.encodeParameters?h.get.urlEncodedValue(s):s,t=t.replace(a,s),void 0)})),a&&(h.debug("Looking for optional URL variables",o),e.each(a,function(o,a){var r=-1!==a.indexOf("$")?a.substr(3,a.length-4):a.substr(2,a.length-3),s=e.isPlainObject(n)&&n[r]!==i?n[r]:T.data(r)!==i?T.data(r):R.data(r)!==i?R.data(r):n[r];s!==i?(h.verbose("Optional variable Found",r,s),t=t.replace(a,s)):(h.verbose("Optional variable not found",r),t=-1!==t.indexOf("/"+a)?t.replace("/"+a,""):t.replace(a,""))}))),t},formData:function(t){var n,o=e.fn.serializeObject!==i,a=o?A.serializeObject():A.serialize();return t=t||v.data,n=e.isPlainObject(t),n?o?(h.debug("Extending existing data with form data",t,a),t=e.extend(!0,{},t,a)):(h.error(C.missingSerialize),h.debug("Cant extend data. Replacing data with form data",t,a),t=a):(h.debug("Adding form data",a),t=a),t}},send:{request:function(){h.set.loading(),h.request=h.create.request(),h.is.mocked()?h.mockedXHR=h.create.mockedXHR():h.xhr=h.create.xhr(),v.onRequest.call(E,h.request,h.xhr)}},event:{trigger:function(e){h.query(),("submit"==e.type||"click"==e.type)&&e.preventDefault()},xhr:{always:function(){},done:function(t,n,i){var o=this,a=(new Date).getTime()-p,r=v.loadingDuration-a,s=e.isFunction(v.onResponse)?h.is.expectingJSON()?v.onResponse.call(o,e.extend(!0,{},t)):v.onResponse.call(o,t):!1;r=r>0?r:0,s&&(h.debug("Modified API response in onResponse callback",v.onResponse,s,t),t=s),r>0&&h.debug("Response completed early delaying state change by",r),setTimeout(function(){h.is.validResponse(t)?h.request.resolveWith(o,[t,i]):h.request.rejectWith(o,[i,"invalid"])},r)},fail:function(e,t,n){var i=this,o=(new Date).getTime()-p,a=v.loadingDuration-o;a=a>0?a:0,a>0&&h.debug("Response completed early delaying state change by",a),setTimeout(function(){h.is.abortedRequest(e)?h.request.rejectWith(i,[e,"aborted",n]):h.request.rejectWith(i,[e,"error",t,n])},a)}},request:{done:function(e,t){h.debug("Successful API Response",e),"local"===v.cache&&m&&(h.write.cachedResponse(m,e),h.debug("Saving server response locally",h.cache)),v.onSuccess.call(E,e,T,t)},complete:function(e,t){var n,i;h.was.succesful()?(i=e,n=t):(n=e,i=h.get.responseFromXHR(n)),h.remove.loading(),v.onComplete.call(E,i,T,n)},fail:function(e,t,n){var o=h.get.responseFromXHR(e),r=h.get.errorFromRequest(o,t,n);return"aborted"==t?(h.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,n),v.onAbort.call(E,t,T,e),!0):("invalid"==t?h.debug("JSON did not pass success test. A server-side error has most likely occurred",o):"error"==t&&e!==i&&(h.debug("XHR produced a server error",t,n),200!=e.status&&n!==i&&""!==n&&h.error(C.statusMessage+n,a.url),v.onError.call(E,r,T,e)),v.errorDuration&&"aborted"!==t&&(h.debug("Adding error state"),h.set.error(),h.should.removeError()&&setTimeout(h.remove.error,v.errorDuration)),h.debug("API Request failed",r,e),void v.onFailure.call(E,o,T,e))}}},create:{request:function(){return e.Deferred().always(h.event.request.complete).done(h.event.request.done).fail(h.event.request.fail)},mockedXHR:function(){var t,n,i,o=!1,a=!1,r=!1,s=v.mockResponse||v.response,l=v.mockResponseAsync||v.responseAsync;return i=e.Deferred().always(h.event.xhr.complete).done(h.event.xhr.done).fail(h.event.xhr.fail),s?(e.isFunction(s)?(h.debug("Using specified synchronous callback",s),n=s.call(E,f)):(h.debug("Using settings specified response",s),n=s),i.resolveWith(E,[n,o,{responseText:n}])):e.isFunction(l)&&(t=function(e){h.debug("Async callback returned response",e),e?i.resolveWith(E,[e,o,{responseText:e}]):i.rejectWith(E,[{responseText:e},a,r])},h.debug("Using specified async response callback",l),l.call(E,f,t)),i},xhr:function(){var t;return t=e.ajax(a).always(h.event.xhr.always).done(h.event.xhr.done).fail(h.event.xhr.fail),h.verbose("Created server request",t,a),t}},set:{error:function(){h.verbose("Adding error state to element",R),R.addClass(w.error)},loading:function(){h.verbose("Adding loading state to element",R),R.addClass(w.loading),p=(new Date).getTime()}},remove:{error:function(){h.verbose("Removing error state from element",R),R.removeClass(w.error)},loading:function(){h.verbose("Removing loading state from element",R),R.removeClass(w.loading)}},get:{responseFromXHR:function(t){return e.isPlainObject(t)?h.is.expectingJSON()?h.decode.json(t.responseText):t.responseText:!1},errorFromRequest:function(t,n,o){return e.isPlainObject(t)&&t.error!==i?t.error:v.error[n]!==i?v.error[n]:o},request:function(){return h.request||!1},xhr:function(){return h.xhr||!1},settings:function(){var t;return t=v.beforeSend.call(E,v),t&&(t.success!==i&&(h.debug("Legacy success callback detected",t),h.error(C.legacyParameters,t.success),t.onSuccess=t.success),t.failure!==i&&(h.debug("Legacy failure callback detected",t),h.error(C.legacyParameters,t.failure),t.onFailure=t.failure),t.complete!==i&&(h.debug("Legacy complete callback detected",t),h.error(C.legacyParameters,t.complete),t.onComplete=t.complete)),t===i&&h.error(C.noReturnedValue),t===!1?t:t!==i?e.extend(!0,{},t):e.extend(!0,{},v)},urlEncodedValue:function(e){var n=t.decodeURIComponent(e),i=t.encodeURIComponent(e),o=n!==e;return o?(h.debug("URL value is already encoded, avoiding double encoding",e),e):(h.verbose("Encoding value using encodeURIComponent",e,i),i)},defaultData:function(){var t={};return e.isWindow(P)||(h.is.input()?t.value=T.val():h.is.form()||(t.text=T.text())),t},event:function(){return e.isWindow(P)||"now"==v.on?(h.debug("API called without element, no events attached"),!1):"auto"==v.on?T.is("input")?P.oninput!==i?"input":P.onpropertychange!==i?"propertychange":"keyup":T.is("form")?"submit":"click":v.on},templatedURL:function(e){if(e=e||T.data(y.action)||v.action||!1,m=T.data(y.url)||v.url||!1)return h.debug("Using specified url",m),m;if(e){if(h.debug("Looking up url for action",e,v.api),v.api[e]===i&&!h.is.mocked())return void h.error(C.missingAction,v.action,v.api);m=v.api[e]}else h.is.form()&&(m=T.attr("action")||R.attr("action")||!1,h.debug("No url or action specified, defaulting to form action",m));return m}},abort:function(){var e=h.get.xhr();e&&"resolved"!==e.state()&&(h.debug("Cancelling API request"),e.abort())},reset:function(){h.remove.error(),h.remove.loading()},setting:function(t,n){if(h.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];e.isPlainObject(v[t])?e.extend(!0,v[t],n):v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];h[t]=n}},debug:function(){!v.silent&&v.debug&&(v.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,v.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),h.verbose.apply(console,arguments)))},error:function(){v.silent||(h.error=Function.prototype.bind.call(console.error,console,v.name+":"),h.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;v.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(h.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,a){var r,s,l,c=F;return n=n||d,a=P||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(h.error(C.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}},u?(F===i&&h.initialize(),h.invoke(c)):(F!==i&&F.invoke("destroy"),h.initialize())}),o!==i?o:this},e.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.state=function(t){var o,a=e(this),r=a.selector||"",s=("ontouchstart"in n.documentElement,(new Date).getTime()),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var n,f=e.isPlainObject(t)?e.extend(!0,{},e.fn.state.settings,t):e.extend({},e.fn.state.settings),m=f.error,g=f.metadata,p=f.className,h=f.namespace,v=f.states,b=f.text,y="."+h,x=h+"-module",C=e(this),w=this,k=C.data(x);n={initialize:function(){n.verbose("Initializing module"),f.automatic&&n.add.defaults(),f.context&&""!==r?e(f.context).on(r,"mouseenter"+y,n.change.text).on(r,"mouseleave"+y,n.reset.text).on(r,"click"+y,n.toggle.state):C.on("mouseenter"+y,n.change.text).on("mouseleave"+y,n.reset.text).on("click"+y,n.toggle.state),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),k=n,C.data(x,n)},destroy:function(){n.verbose("Destroying previous module",k),C.off(y).removeData(x)},refresh:function(){n.verbose("Refreshing selector cache"),C=e(w)},add:{defaults:function(){var o=t&&e.isPlainObject(t.states)?t.states:{};e.each(f.defaults,function(t,a){n.is[t]!==i&&n.is[t]()&&(n.verbose("Adding default states",t,w),e.extend(f.states,a,o))})}},is:{active:function(){return C.hasClass(p.active)},loading:function(){return C.hasClass(p.loading)},inactive:function(){return!C.hasClass(p.active)},state:function(e){return p[e]===i?!1:C.hasClass(p[e])},enabled:function(){return!C.is(f.filter.active)},disabled:function(){return C.is(f.filter.active)},textEnabled:function(){return!C.is(f.filter.text)},button:function(){return C.is(".button:not(a, .submit)")},input:function(){return C.is("input")},progress:function(){return C.is(".ui.progress")}},allow:function(e){n.debug("Now allowing state",e),v[e]=!0},disallow:function(e){n.debug("No longer allowing",e),v[e]=!1},allows:function(e){return v[e]||!1},enable:function(){C.removeClass(p.disabled)},disable:function(){C.addClass(p.disabled)},setState:function(e){n.allows(e)&&C.addClass(p[e])},removeState:function(e){n.allows(e)&&C.removeClass(p[e])},toggle:{state:function(){var t,o;if(n.allows("active")&&n.is.enabled()){if(n.refresh(),e.fn.api!==i)if(t=C.api("get request"),o=C.api("was cancelled"))n.debug("API Request cancelled by beforesend"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1};else if(t)return void n.listenTo(t);n.change.state()}}},listenTo:function(t){n.debug("API request detected, waiting for state signal",t),t&&(b.loading&&n.update.text(b.loading),e.when(t).then(function(){"resolved"==t.state()?(n.debug("API request succeeded"),f.activateTest=function(){return!0},f.deactivateTest=function(){return!0}):(n.debug("API request failed"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1}),n.change.state()}))},change:{state:function(){n.debug("Determining state change direction"),n.is.inactive()?n.activate():n.deactivate(),f.sync&&n.sync(),f.onChange.call(w)},text:function(){n.is.textEnabled()&&(n.is.disabled()?(n.verbose("Changing text to disabled text",b.hover),n.update.text(b.disabled)):n.is.active()?b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.deactivate&&(n.verbose("Changing text to deactivating text",b.deactivate),n.update.text(b.deactivate)):b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.activate&&(n.verbose("Changing text to activating text",b.activate),n.update.text(b.activate)))}},activate:function(){f.activateTest.call(w)&&(n.debug("Setting state to active"),C.addClass(p.active),n.update.text(b.active),f.onActivate.call(w))},deactivate:function(){f.deactivateTest.call(w)&&(n.debug("Setting state to inactive"),C.removeClass(p.active),n.update.text(b.inactive),f.onDeactivate.call(w))},sync:function(){n.verbose("Syncing other buttons to current state"),n.is.active()?a.not(C).state("activate"):a.not(C).state("deactivate")},get:{text:function(){return f.selector.text?C.find(f.selector.text).text():C.html()},textFor:function(e){return b[e]||!1}},flash:{text:function(e,t,i){var o=n.get.text();n.debug("Flashing text message",e,t),e=e||f.text.flash,t=t||f.flashDuration,i=i||function(){},n.update.text(e),setTimeout(function(){n.update.text(o),i.call(w)},t)}},reset:{text:function(){var e=b.active||C.data(g.storedText),t=b.inactive||C.data(g.storedText);n.is.textEnabled()&&(n.is.active()&&e?(n.verbose("Resetting active text",e),n.update.text(e)):t&&(n.verbose("Resetting inactive text",e),n.update.text(t)))}},update:{text:function(e){var t=n.get.text();e&&e!==t?(n.debug("Updating text",e),f.selector.text?C.data(g.storedText,e).find(f.selector.text).text(e):C.data(g.storedText,e).html(e)):n.debug("Text is already set, ignoring update",e); -}},setting:function(t,o){if(n.debug("Changing setting",t,o),e.isPlainObject(t))e.extend(!0,f,t);else{if(o===i)return f[t];e.isPlainObject(f[t])?e.extend(!0,f[t],o):f[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,n,t);else{if(o===i)return n[t];n[t]=o}},debug:function(){!f.silent&&f.debug&&(f.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,f.name+":"),n.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),n.verbose.apply(console,arguments)))},error:function(){f.silent||(n.error=Function.prototype.bind.call(console.error,console,f.name+":"),n.error.apply(console,arguments))},performance:{log:function(e){var t,i,o;f.performance&&(t=(new Date).getTime(),o=s||t,i=t-o,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":i})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},display:function(){var t=f.name+":",o=0;s=!1,clearTimeout(n.performance.timer),e.each(l,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,a,r){var s,l,c,u=k;return a=a||d,r=w||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(o,a){var r=o!=s?a+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(u[r])&&o!=s)u=u[r];else{if(u[r]!==i)return l=u[r],!1;if(!e.isPlainObject(u[a])||o==s)return u[a]!==i?(l=u[a],!1):(n.error(m.method,t),!1);u=u[a]}})),e.isFunction(l)?c=l.apply(r,a):l!==i&&(c=l),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),l}},u?(k===i&&n.initialize(),n.invoke(c)):(k!==i&&k.invoke("destroy"),n.initialize())}),o!==i?o:this},e.fn.state.settings={name:"State",debug:!1,verbose:!1,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:1e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{beforeSend:"The before send function has cancelled state change",method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",error:"error",loading:"loading",success:"success",warning:"warning"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0},progress:{active:!0,success:!0,warning:!0,error:!0}},states:{active:!0,disabled:!0,error:!0,loading:!0,success:!0,warning:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,activate:!1,deactivate:!1}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.visibility=function(o){var a,r=e(this),s=r.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1),m=r.length,g=0;return r.each(function(){var r,p,h,v,b=e.isPlainObject(o)?e.extend(!0,{},e.fn.visibility.settings,o):e.extend({},e.fn.visibility.settings),y=b.className,x=b.namespace,C=b.error,w=b.metadata,k="."+x,S="module-"+x,T=e(t),A=e(this),R=e(b.context),P=(A.selector||"",A.data(S)),E=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},F=this,O=!1;v={initialize:function(){v.debug("Initializing",b),v.setup.cache(),v.should.trackChanges()&&("image"==b.type&&v.setup.image(),"fixed"==b.type&&v.setup.fixed(),b.observeChanges&&v.observeChanges(),v.bind.events()),v.save.position(),v.is.visible()||v.error(C.visible,A),b.initialCheck&&v.checkVisibility(),v.instantiate()},instantiate:function(){v.debug("Storing instance",v),A.data(S,v),P=v},destroy:function(){v.verbose("Destroying previous module"),h&&h.disconnect(),p&&p.disconnect(),T.off("load"+k,v.event.load).off("resize"+k,v.event.resize),R.off("scroll"+k,v.event.scroll).off("scrollchange"+k,v.event.scrollchange),"fixed"==b.type&&(v.resetFixed(),v.remove.placeholder()),A.off(k).removeData(S)},observeChanges:function(){"MutationObserver"in t&&(p=new MutationObserver(v.event.contextChanged),h=new MutationObserver(v.event.changed),p.observe(n,{childList:!0,subtree:!0}),h.observe(F,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",h))},bind:{events:function(){v.verbose("Binding visibility events to scroll and resize"),b.refreshOnLoad&&T.on("load"+k,v.event.load),T.on("resize"+k,v.event.resize),R.off("scroll"+k).on("scroll"+k,v.event.scroll).on("scrollchange"+k,v.event.scrollchange)}},event:{changed:function(e){v.verbose("DOM tree modified, updating visibility calculations"),v.timer=setTimeout(function(){v.verbose("DOM tree modified, updating sticky menu"),v.refresh()},100)},contextChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==F||e(t).find(F).length>0)&&(v.debug("Element removed from DOM, tearing down events"),v.destroy())})})},resize:function(){v.debug("Window resized"),b.refreshOnResize&&E(v.refresh)},load:function(){v.debug("Page finished loading"),E(v.refresh)},scroll:function(){b.throttle?(clearTimeout(v.timer),v.timer=setTimeout(function(){R.triggerHandler("scrollchange"+k,[R.scrollTop()])},b.throttle)):E(function(){R.triggerHandler("scrollchange"+k,[R.scrollTop()])})},scrollchange:function(e,t){v.checkVisibility(t)}},precache:function(t,i){t instanceof Array||(t=[t]);for(var o=t.length,a=0,r=[],s=n.createElement("img"),l=function(){a++,a>=t.length&&e.isFunction(i)&&i()};o--;)s=n.createElement("img"),s.onload=l,s.onerror=l,s.src=t[o],r.push(s)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),O=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),O=!0},should:{trackChanges:function(){return d?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=A.data(w.src);e&&(v.verbose("Lazy loading image",e),b.once=!0,b.observeChanges=!1,b.onOnScreen=function(){v.debug("Image on screen",F),v.precache(e,function(){v.set.image(e,function(){g++,g==m&&b.onAllLoaded.call(this),b.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),b.once=!1,b.observeChanges=!1,b.initialCheck=!0,b.refreshOnLoad=!0,o.transition||(b.transition=!1),v.create.placeholder(),v.debug("Added placeholder",r),b.onTopPassed=function(){v.debug("Element passed, adding fixed position",A),v.show.placeholder(),v.set.fixed(),b.transition&&e.fn.transition!==i&&A.transition(b.transition,b.duration)},b.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",A),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),r=A.clone(!1).css("display","none").addClass(y.placeholder).insertAfter(A)}},show:{placeholder:function(){v.verbose("Showing placeholder"),r.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),r.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),A.addClass(y.fixed).css({position:"fixed",top:b.offset+"px",left:"auto",zIndex:b.zIndex}),b.onFixed.call(F)},image:function(t,n){A.attr("src",t),b.transition?e.fn.transition!==i?A.transition(b.transition,b.duration,n):A.fadeIn(b.duration,n):A.show()}},is:{onScreen:function(){var e=v.get.elementCalculations();return e.onScreen},offScreen:function(){var e=v.get.elementCalculations();return e.offScreen},visible:function(){return v.cache&&v.cache.element?!(0===v.cache.element.width&&0===v.cache.element.offset.top):!1}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==b.type&&v.resetFixed(),v.reset(),v.save.position(),b.checkOnRefresh&&v.checkVisibility(),b.onRefresh.call(F)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),e.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!O&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),b.onUpdate&&b.onUpdate.call(F,v.get.elementCalculations()))},passed:function(t,n){var o=v.get.elementCalculations();if(t&&n)b.onPassed[t]=n;else{if(t!==i)return v.get.pixelsPassed(t)>o.pixelsPassed;o.passing&&e.each(b.onPassed,function(e,t){o.bottomVisible||o.pixelsPassed>v.get.pixelsPassed(e)?v.execute(t,e):b.once||v.remove.occurred(t)})}},onScreen:function(e){var t=v.get.elementCalculations(),n=e||b.onOnScreen,o="onScreen";return e&&(v.debug("Adding callback for onScreen",e),b.onOnScreen=e),t.onScreen?v.execute(n,o):b.once||v.remove.occurred(o),e!==i?t.onOnScreen:void 0},offScreen:function(e){var t=v.get.elementCalculations(),n=e||b.onOffScreen,o="offScreen";return e&&(v.debug("Adding callback for offScreen",e),b.onOffScreen=e),t.offScreen?v.execute(n,o):b.once||v.remove.occurred(o),e!==i?t.onOffScreen:void 0},passing:function(e){var t=v.get.elementCalculations(),n=e||b.onPassing,o="passing";return e&&(v.debug("Adding callback for passing",e),b.onPassing=e),t.passing?v.execute(n,o):b.once||v.remove.occurred(o),e!==i?t.passing:void 0},topVisible:function(e){var t=v.get.elementCalculations(),n=e||b.onTopVisible,o="topVisible";return e&&(v.debug("Adding callback for top visible",e),b.onTopVisible=e),t.topVisible?v.execute(n,o):b.once||v.remove.occurred(o),e===i?t.topVisible:void 0},bottomVisible:function(e){var t=v.get.elementCalculations(),n=e||b.onBottomVisible,o="bottomVisible";return e&&(v.debug("Adding callback for bottom visible",e),b.onBottomVisible=e),t.bottomVisible?v.execute(n,o):b.once||v.remove.occurred(o),e===i?t.bottomVisible:void 0},topPassed:function(e){var t=v.get.elementCalculations(),n=e||b.onTopPassed,o="topPassed";return e&&(v.debug("Adding callback for top passed",e),b.onTopPassed=e),t.topPassed?v.execute(n,o):b.once||v.remove.occurred(o),e===i?t.topPassed:void 0},bottomPassed:function(e){var t=v.get.elementCalculations(),n=e||b.onBottomPassed,o="bottomPassed";return e&&(v.debug("Adding callback for bottom passed",e),b.onBottomPassed=e),t.bottomPassed?v.execute(n,o):b.once||v.remove.occurred(o),e===i?t.bottomPassed:void 0},passingReverse:function(e){var t=v.get.elementCalculations(),n=e||b.onPassingReverse,o="passingReverse";return e&&(v.debug("Adding callback for passing reverse",e),b.onPassingReverse=e),t.passing?b.once||v.remove.occurred(o):v.get.occurred("passing")&&v.execute(n,o),e!==i?!t.passing:void 0},topVisibleReverse:function(e){var t=v.get.elementCalculations(),n=e||b.onTopVisibleReverse,o="topVisibleReverse";return e&&(v.debug("Adding callback for top visible reverse",e),b.onTopVisibleReverse=e),t.topVisible?b.once||v.remove.occurred(o):v.get.occurred("topVisible")&&v.execute(n,o),e===i?!t.topVisible:void 0},bottomVisibleReverse:function(e){var t=v.get.elementCalculations(),n=e||b.onBottomVisibleReverse,o="bottomVisibleReverse";return e&&(v.debug("Adding callback for bottom visible reverse",e),b.onBottomVisibleReverse=e),t.bottomVisible?b.once||v.remove.occurred(o):v.get.occurred("bottomVisible")&&v.execute(n,o),e===i?!t.bottomVisible:void 0},topPassedReverse:function(e){var t=v.get.elementCalculations(),n=e||b.onTopPassedReverse,o="topPassedReverse";return e&&(v.debug("Adding callback for top passed reverse",e),b.onTopPassedReverse=e),t.topPassed?b.once||v.remove.occurred(o):v.get.occurred("topPassed")&&v.execute(n,o),e===i?!t.onTopPassed:void 0},bottomPassedReverse:function(e){var t=v.get.elementCalculations(),n=e||b.onBottomPassedReverse,o="bottomPassedReverse";return e&&(v.debug("Adding callback for bottom passed reverse",e),b.onBottomPassedReverse=e),t.bottomPassed?b.once||v.remove.occurred(o):v.get.occurred("bottomPassed")&&v.execute(n,o),e===i?!t.bottomPassed:void 0},execute:function(e,t){var n=v.get.elementCalculations(),i=v.get.screenCalculations();e=e||!1,e&&(b.continuous?(v.debug("Callback being called continuously",t,n),e.call(F,n,i)):v.get.occurred(t)||(v.debug("Conditions met",t,n),e.call(F,n,i))),v.save.occurred(t)},remove:{fixed:function(){v.debug("Removing fixed position"),A.removeClass(y.fixed).css({position:"",top:"",left:"",zIndex:""}),b.onUnfixed.call(F)},placeholder:function(){v.debug("Removing placeholder content"),r&&r.remove()},occurred:function(e){if(e){var t=v.cache.occurred;t[e]!==i&&t[e]===!0&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1)}else v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){e&&(v.cache.occurred[e]===i||v.cache.occurred[e]!==!0)&&(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0)},scroll:function(e){e=e+b.offset||R.scrollTop()+b.offset,v.cache.scroll=e},direction:function(){var e,t=v.get.scroll(),n=v.get.lastScroll();return e=t>n&&n?"down":n>t&&n?"up":"static",v.cache.direction=e,v.cache.direction},elementPosition:function(){var e=v.cache.element,t=v.get.screenSize();return v.verbose("Saving element position"),e.fits=e.height=t.top,t.topPassed=e.top>=t.top,t.bottomVisible=e.bottom>=t.bottom,t.bottomPassed=e.top>=t.bottom,t.pixelsPassed=0,t.percentagePassed=0,t.onScreen=t.topVisible&&!t.bottomPassed,t.passing=t.topPassed&&!t.bottomPassed,t.offScreen=!t.onScreen,t.passing&&(t.pixelsPassed=e.top-t.top,t.percentagePassed=(e.top-t.top)/t.height),v.cache.element=t,v.verbose("Updated element calculations",t),t},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:R.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var t=v.get.elementCalculations();return e.search("%")>-1?t.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return v.cache.occurred!==i?v.cache.occurred[e]||!1:!1},direction:function(){return v.cache.direction===i&&v.save.direction(),v.cache.direction},elementPosition:function(){return v.cache.element===i&&v.save.elementPosition(),v.cache.element},elementCalculations:function(){return v.cache.element===i&&v.save.elementCalculations(),v.cache.element},screenCalculations:function(){return v.cache.screen===i&&v.save.screenCalculations(),v.cache.screen},screenSize:function(){return v.cache.screen===i&&v.save.screenSize(),v.cache.screen},scroll:function(){return v.cache.scroll===i&&v.save.scroll(),v.cache.scroll},lastScroll:function(){return v.cache.screen===i?(v.debug("First scroll event, no last scroll could be found"),!1):v.cache.screen.top}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(n===i)return b[t];b[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];v[t]=n}},debug:function(){!b.silent&&b.debug&&(b.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,b.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),v.verbose.apply(console,arguments)))},error:function(){b.silent||(v.error=Function.prototype.bind.call(console.error,console,b.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;b.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:F,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=b.name+":",n=0;l=!1,clearTimeout(v.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var r,s,l,c=P;return n=n||f,o=F||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(v.error(C.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},d?(P===i&&v.initialize(),P.save.scroll(),P.save.calculations(),v.invoke(u)):(P!==i&&P.invoke("destroy"),v.initialize())}),a!==i?a:this},e.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document); \ No newline at end of file diff --git a/public/plugins/codemirror-5.17.0/.gitattributes b/public/plugins/codemirror-5.17.0/.gitattributes deleted file mode 100644 index f8bdd60f4..000000000 --- a/public/plugins/codemirror-5.17.0/.gitattributes +++ /dev/null @@ -1,8 +0,0 @@ -*.txt text -*.js text -*.html text -*.md text -*.json text -*.yml text -*.css text -*.svg text diff --git a/public/plugins/codemirror-5.17.0/.gitignore b/public/plugins/codemirror-5.17.0/.gitignore deleted file mode 100644 index f91c241f2..000000000 --- a/public/plugins/codemirror-5.17.0/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/node_modules -/npm-debug.log -/test*.html -.tern-* -*~ -*.swp -.idea -*.iml diff --git a/public/plugins/codemirror-5.17.0/.npmignore b/public/plugins/codemirror-5.17.0/.npmignore deleted file mode 100644 index 5ed053f89..000000000 --- a/public/plugins/codemirror-5.17.0/.npmignore +++ /dev/null @@ -1,10 +0,0 @@ -/node_modules -/demo -/doc -/test -/test*.html -/index.html -/mode/*/*test.js -/mode/*/*.html -/mode/index.html -.* diff --git a/public/plugins/codemirror-5.17.0/.travis.yml b/public/plugins/codemirror-5.17.0/.travis.yml deleted file mode 100644 index 52b8b8159..000000000 --- a/public/plugins/codemirror-5.17.0/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - stable -sudo: false diff --git a/public/plugins/codemirror-5.17.0/addon/mode/loadmode.js b/public/plugins/codemirror-5.17.0/addon/mode/loadmode.js deleted file mode 100644 index 10117ec22..000000000 --- a/public/plugins/codemirror-5.17.0/addon/mode/loadmode.js +++ /dev/null @@ -1,64 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), "cjs"); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); - else // Plain browser env - mod(CodeMirror, "plain"); -})(function(CodeMirror, env) { - if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; - - var loading = {}; - function splitCallback(cont, n) { - var countDown = n; - return function() { if (--countDown == 0) cont(); }; - } - function ensureDeps(mode, cont) { - var deps = CodeMirror.modes[mode].dependencies; - if (!deps) return cont(); - var missing = []; - for (var i = 0; i < deps.length; ++i) { - if (!CodeMirror.modes.hasOwnProperty(deps[i])) - missing.push(deps[i]); - } - if (!missing.length) return cont(); - var split = splitCallback(cont, missing.length); - for (var i = 0; i < missing.length; ++i) - CodeMirror.requireMode(missing[i], split); - } - - CodeMirror.requireMode = function(mode, cont) { - if (typeof mode != "string") mode = mode.name; - if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); - if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); - - var file = CodeMirror.modeURL.replace(/%N/g, mode); - if (env == "plain") { - var script = document.createElement("script"); - script.src = file; - var others = document.getElementsByTagName("script")[0]; - var list = loading[mode] = [cont]; - CodeMirror.on(script, "load", function() { - ensureDeps(mode, function() { - for (var i = 0; i < list.length; ++i) list[i](); - }); - }); - others.parentNode.insertBefore(script, others); - } else if (env == "cjs") { - require(file); - cont(); - } else if (env == "amd") { - requirejs([file], cont); - } - }; - - CodeMirror.autoLoadMode = function(instance, mode) { - if (!CodeMirror.modes.hasOwnProperty(mode)) - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - }); - }; -}); diff --git a/public/plugins/codemirror-5.17.0/addon/mode/multiplex.js b/public/plugins/codemirror-5.17.0/addon/mode/multiplex.js deleted file mode 100644 index 3d8b34c45..000000000 --- a/public/plugins/codemirror-5.17.0/addon/mode/multiplex.js +++ /dev/null @@ -1,123 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.multiplexingMode = function(outer /*, others */) { - // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects - var others = Array.prototype.slice.call(arguments, 1); - - function indexOf(string, pattern, from, returnEnd) { - if (typeof pattern == "string") { - var found = string.indexOf(pattern, from); - return returnEnd && found > -1 ? found + pattern.length : found; - } - var m = pattern.exec(from ? string.slice(from) : string); - return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1; - } - - return { - startState: function() { - return { - outer: CodeMirror.startState(outer), - innerActive: null, - inner: null - }; - }, - - copyState: function(state) { - return { - outer: CodeMirror.copyState(outer, state.outer), - innerActive: state.innerActive, - inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) - }; - }, - - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; - for (var i = 0; i < others.length; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { - if (!other.parseDelimiters) stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open"); - } else if (found != -1 && found < cutOff) { - cutOff = found; - } - } - if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); - var outerToken = outer.token(stream, state.outer); - if (cutOff != Infinity) stream.string = oldContent; - return outerToken; - } else { - var curInner = state.innerActive, oldContent = stream.string; - if (!curInner.close && stream.sol()) { - state.innerActive = state.inner = null; - return this.token(stream, state); - } - var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1; - if (found == stream.pos && !curInner.parseDelimiters) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle && (curInner.delimStyle + " " + curInner.delimStyle + "-close"); - } - if (found > -1) stream.string = oldContent.slice(0, found); - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - - if (found == stream.pos && curInner.parseDelimiters) - state.innerActive = state.inner = null; - - if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + " " + curInner.innerStyle; - else innerToken = curInner.innerStyle; - } - - return innerToken; - } - }, - - indent: function(state, textAfter) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (!mode.indent) return CodeMirror.Pass; - return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); - }, - - blankLine: function(state) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (mode.blankLine) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { - for (var i = 0; i < others.length; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); - } - } - } else if (state.innerActive.close === "\n") { - state.innerActive = state.inner = null; - } - }, - - electricChars: outer.electricChars, - - innerMode: function(state) { - return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; - } - }; -}; - -}); diff --git a/public/plugins/codemirror-5.17.0/addon/mode/multiplex_test.js b/public/plugins/codemirror-5.17.0/addon/mode/multiplex_test.js deleted file mode 100644 index 24e5e670d..000000000 --- a/public/plugins/codemirror-5.17.0/addon/mode/multiplex_test.js +++ /dev/null @@ -1,33 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - CodeMirror.defineMode("markdown_with_stex", function(){ - var inner = CodeMirror.getMode({}, "stex"); - var outer = CodeMirror.getMode({}, "markdown"); - - var innerOptions = { - open: '$', - close: '$', - mode: inner, - delimStyle: 'delim', - innerStyle: 'inner' - }; - - return CodeMirror.multiplexingMode(outer, innerOptions); - }); - - var mode = CodeMirror.getMode({}, "markdown_with_stex"); - - function MT(name) { - test.mode( - name, - mode, - Array.prototype.slice.call(arguments, 1), - 'multiplexing'); - } - - MT( - "stexInsideMarkdown", - "[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]"); -})(); diff --git a/public/plugins/codemirror-5.17.0/addon/mode/overlay.js b/public/plugins/codemirror-5.17.0/addon/mode/overlay.js deleted file mode 100644 index e1b9ed375..000000000 --- a/public/plugins/codemirror-5.17.0/addon/mode/overlay.js +++ /dev/null @@ -1,85 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Utility function that allows modes to be combined. The mode given -// as the base argument takes care of most of the normal mode -// functionality, but a second (typically simple) mode is used, which -// can override the style of text. Both modes get to parse all of the -// text, but when both assign a non-null style to a piece of code, the -// overlay wins, unless the combine argument was true and not overridden, -// or state.overlay.combineTokens was true, in which case the styles are -// combined. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.overlayMode = function(base, overlay, combine) { - return { - startState: function() { - return { - base: CodeMirror.startState(base), - overlay: CodeMirror.startState(overlay), - basePos: 0, baseCur: null, - overlayPos: 0, overlayCur: null, - streamSeen: null - }; - }, - copyState: function(state) { - return { - base: CodeMirror.copyState(base, state.base), - overlay: CodeMirror.copyState(overlay, state.overlay), - basePos: state.basePos, baseCur: null, - overlayPos: state.overlayPos, overlayCur: null - }; - }, - - token: function(stream, state) { - if (stream != state.streamSeen || - Math.min(state.basePos, state.overlayPos) < stream.start) { - state.streamSeen = stream; - state.basePos = state.overlayPos = stream.start; - } - - if (stream.start == state.basePos) { - state.baseCur = base.token(stream, state.base); - state.basePos = stream.pos; - } - if (stream.start == state.overlayPos) { - stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay); - state.overlayPos = stream.pos; - } - stream.pos = Math.min(state.basePos, state.overlayPos); - - // state.overlay.combineTokens always takes precedence over combine, - // unless set to null - if (state.overlayCur == null) return state.baseCur; - else if (state.baseCur != null && - state.overlay.combineTokens || - combine && state.overlay.combineTokens == null) - return state.baseCur + " " + state.overlayCur; - else return state.overlayCur; - }, - - indent: base.indent && function(state, textAfter) { - return base.indent(state.base, textAfter); - }, - electricChars: base.electricChars, - - innerMode: function(state) { return {state: state.base, mode: base}; }, - - blankLine: function(state) { - if (base.blankLine) base.blankLine(state.base); - if (overlay.blankLine) overlay.blankLine(state.overlay); - } - }; -}; - -}); diff --git a/public/plugins/codemirror-5.17.0/addon/mode/simple.js b/public/plugins/codemirror-5.17.0/addon/mode/simple.js deleted file mode 100644 index df663365e..000000000 --- a/public/plugins/codemirror-5.17.0/addon/mode/simple.js +++ /dev/null @@ -1,213 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineSimpleMode = function(name, states) { - CodeMirror.defineMode(name, function(config) { - return CodeMirror.simpleMode(config, states); - }); - }; - - CodeMirror.simpleMode = function(config, states) { - ensureState(states, "start"); - var states_ = {}, meta = states.meta || {}, hasIndentation = false; - for (var state in states) if (state != meta && states.hasOwnProperty(state)) { - var list = states_[state] = [], orig = states[state]; - for (var i = 0; i < orig.length; i++) { - var data = orig[i]; - list.push(new Rule(data, states)); - if (data.indent || data.dedent) hasIndentation = true; - } - } - var mode = { - startState: function() { - return {state: "start", pending: null, - local: null, localState: null, - indent: hasIndentation ? [] : null}; - }, - copyState: function(state) { - var s = {state: state.state, pending: state.pending, - local: state.local, localState: null, - indent: state.indent && state.indent.slice(0)}; - if (state.localState) - s.localState = CodeMirror.copyState(state.local.mode, state.localState); - if (state.stack) - s.stack = state.stack.slice(0); - for (var pers = state.persistentStates; pers; pers = pers.next) - s.persistentStates = {mode: pers.mode, - spec: pers.spec, - state: pers.state == state.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state), - next: s.persistentStates}; - return s; - }, - token: tokenFunction(states_, config), - innerMode: function(state) { return state.local && {mode: state.local.mode, state: state.localState}; }, - indent: indentFunction(states_, meta) - }; - if (meta) for (var prop in meta) if (meta.hasOwnProperty(prop)) - mode[prop] = meta[prop]; - return mode; - }; - - function ensureState(states, name) { - if (!states.hasOwnProperty(name)) - throw new Error("Undefined state " + name + " in simple mode"); - } - - function toRegex(val, caret) { - if (!val) return /(?:)/; - var flags = ""; - if (val instanceof RegExp) { - if (val.ignoreCase) flags = "i"; - val = val.source; - } else { - val = String(val); - } - return new RegExp((caret === false ? "" : "^") + "(?:" + val + ")", flags); - } - - function asToken(val) { - if (!val) return null; - if (typeof val == "string") return val.replace(/\./g, " "); - var result = []; - for (var i = 0; i < val.length; i++) - result.push(val[i] && val[i].replace(/\./g, " ")); - return result; - } - - function Rule(data, states) { - if (data.next || data.push) ensureState(states, data.next || data.push); - this.regex = toRegex(data.regex); - this.token = asToken(data.token); - this.data = data; - } - - function tokenFunction(states, config) { - return function(stream, state) { - if (state.pending) { - var pend = state.pending.shift(); - if (state.pending.length == 0) state.pending = null; - stream.pos += pend.text.length; - return pend.token; - } - - if (state.local) { - if (state.local.end && stream.match(state.local.end)) { - var tok = state.local.endToken || null; - state.local = state.localState = null; - return tok; - } else { - var tok = state.local.mode.token(stream, state.localState), m; - if (state.local.endScan && (m = state.local.endScan.exec(stream.current()))) - stream.pos = stream.start + m.index; - return tok; - } - } - - var curState = states[state.state]; - for (var i = 0; i < curState.length; i++) { - var rule = curState[i]; - var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex); - if (matches) { - if (rule.data.next) { - state.state = rule.data.next; - } else if (rule.data.push) { - (state.stack || (state.stack = [])).push(state.state); - state.state = rule.data.push; - } else if (rule.data.pop && state.stack && state.stack.length) { - state.state = state.stack.pop(); - } - - if (rule.data.mode) - enterLocalMode(config, state, rule.data.mode, rule.token); - if (rule.data.indent) - state.indent.push(stream.indentation() + config.indentUnit); - if (rule.data.dedent) - state.indent.pop(); - if (matches.length > 2) { - state.pending = []; - for (var j = 2; j < matches.length; j++) - if (matches[j]) - state.pending.push({text: matches[j], token: rule.token[j - 1]}); - stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0)); - return rule.token[0]; - } else if (rule.token && rule.token.join) { - return rule.token[0]; - } else { - return rule.token; - } - } - } - stream.next(); - return null; - }; - } - - function cmp(a, b) { - if (a === b) return true; - if (!a || typeof a != "object" || !b || typeof b != "object") return false; - var props = 0; - for (var prop in a) if (a.hasOwnProperty(prop)) { - if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop])) return false; - props++; - } - for (var prop in b) if (b.hasOwnProperty(prop)) props--; - return props == 0; - } - - function enterLocalMode(config, state, spec, token) { - var pers; - if (spec.persistent) for (var p = state.persistentStates; p && !pers; p = p.next) - if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode) pers = p; - var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec); - var lState = pers ? pers.state : CodeMirror.startState(mode); - if (spec.persistent && !pers) - state.persistentStates = {mode: mode, spec: spec.spec, state: lState, next: state.persistentStates}; - - state.localState = lState; - state.local = {mode: mode, - end: spec.end && toRegex(spec.end), - endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false), - endToken: token && token.join ? token[token.length - 1] : token}; - } - - function indexOf(val, arr) { - for (var i = 0; i < arr.length; i++) if (arr[i] === val) return true; - } - - function indentFunction(states, meta) { - return function(state, textAfter, line) { - if (state.local && state.local.mode.indent) - return state.local.mode.indent(state.localState, textAfter, line); - if (state.indent == null || state.local || meta.dontIndentStates && indexOf(state.state, meta.dontIndentStates) > -1) - return CodeMirror.Pass; - - var pos = state.indent.length - 1, rules = states[state.state]; - scan: for (;;) { - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (rule.data.dedent && rule.data.dedentIfLineStart !== false) { - var m = rule.regex.exec(textAfter); - if (m && m[0]) { - pos--; - if (rule.next || rule.push) rules = states[rule.next || rule.push]; - textAfter = textAfter.slice(m[0].length); - continue scan; - } - } - } - break; - } - return pos < 0 ? 0 : state.indent[pos]; - }; - } -}); diff --git a/public/plugins/codemirror-5.17.0/mode/apl/apl.js b/public/plugins/codemirror-5.17.0/mode/apl/apl.js deleted file mode 100644 index caafe4e91..000000000 --- a/public/plugins/codemirror-5.17.0/mode/apl/apl.js +++ /dev/null @@ -1,174 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("apl", function() { - var builtInOps = { - ".": "innerProduct", - "\\": "scan", - "/": "reduce", - "⌿": "reduce1Axis", - "⍀": "scan1Axis", - "¨": "each", - "⍣": "power" - }; - var builtInFuncs = { - "+": ["conjugate", "add"], - "−": ["negate", "subtract"], - "×": ["signOf", "multiply"], - "÷": ["reciprocal", "divide"], - "⌈": ["ceiling", "greaterOf"], - "⌊": ["floor", "lesserOf"], - "∣": ["absolute", "residue"], - "⍳": ["indexGenerate", "indexOf"], - "?": ["roll", "deal"], - "⋆": ["exponentiate", "toThePowerOf"], - "⍟": ["naturalLog", "logToTheBase"], - "○": ["piTimes", "circularFuncs"], - "!": ["factorial", "binomial"], - "⌹": ["matrixInverse", "matrixDivide"], - "<": [null, "lessThan"], - "≤": [null, "lessThanOrEqual"], - "=": [null, "equals"], - ">": [null, "greaterThan"], - "≥": [null, "greaterThanOrEqual"], - "≠": [null, "notEqual"], - "≡": ["depth", "match"], - "≢": [null, "notMatch"], - "∈": ["enlist", "membership"], - "⍷": [null, "find"], - "∪": ["unique", "union"], - "∩": [null, "intersection"], - "∼": ["not", "without"], - "∨": [null, "or"], - "∧": [null, "and"], - "⍱": [null, "nor"], - "⍲": [null, "nand"], - "⍴": ["shapeOf", "reshape"], - ",": ["ravel", "catenate"], - "⍪": [null, "firstAxisCatenate"], - "⌽": ["reverse", "rotate"], - "⊖": ["axis1Reverse", "axis1Rotate"], - "⍉": ["transpose", null], - "↑": ["first", "take"], - "↓": [null, "drop"], - "⊂": ["enclose", "partitionWithAxis"], - "⊃": ["diclose", "pick"], - "⌷": [null, "index"], - "⍋": ["gradeUp", null], - "⍒": ["gradeDown", null], - "⊤": ["encode", null], - "⊥": ["decode", null], - "⍕": ["format", "formatByExample"], - "⍎": ["execute", null], - "⊣": ["stop", "left"], - "⊢": ["pass", "right"] - }; - - var isOperator = /[\.\/⌿⍀¨⍣]/; - var isNiladic = /⍬/; - var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/; - var isArrow = /←/; - var isComment = /[⍝#].*$/; - - var stringEater = function(type) { - var prev; - prev = false; - return function(c) { - prev = c; - if (c === type) { - return prev === "\\"; - } - return true; - }; - }; - return { - startState: function() { - return { - prev: false, - func: false, - op: false, - string: false, - escape: false - }; - }, - token: function(stream, state) { - var ch, funcName; - if (stream.eatSpace()) { - return null; - } - ch = stream.next(); - if (ch === '"' || ch === "'") { - stream.eatWhile(stringEater(ch)); - stream.next(); - state.prev = true; - return "string"; - } - if (/[\[{\(]/.test(ch)) { - state.prev = false; - return null; - } - if (/[\]}\)]/.test(ch)) { - state.prev = true; - return null; - } - if (isNiladic.test(ch)) { - state.prev = false; - return "niladic"; - } - if (/[¯\d]/.test(ch)) { - if (state.func) { - state.func = false; - state.prev = false; - } else { - state.prev = true; - } - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (isOperator.test(ch)) { - return "operator apl-" + builtInOps[ch]; - } - if (isArrow.test(ch)) { - return "apl-arrow"; - } - if (isFunction.test(ch)) { - funcName = "apl-"; - if (builtInFuncs[ch] != null) { - if (state.prev) { - funcName += builtInFuncs[ch][1]; - } else { - funcName += builtInFuncs[ch][0]; - } - } - state.func = true; - state.prev = false; - return "function " + funcName; - } - if (isComment.test(ch)) { - stream.skipToEnd(); - return "comment"; - } - if (ch === "∘" && stream.peek() === ".") { - stream.next(); - return "function jot-dot"; - } - stream.eatWhile(/[\w\$_]/); - state.prev = true; - return "keyword"; - } - }; -}); - -CodeMirror.defineMIME("text/apl", "apl"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/apl/index.html b/public/plugins/codemirror-5.17.0/mode/apl/index.html deleted file mode 100644 index 53dda6b58..000000000 --- a/public/plugins/codemirror-5.17.0/mode/apl/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: APL mode - - - - - - - - - - -
-

APL mode

-
- - - -

Simple mode that tries to handle APL as well as it can.

-

It attempts to label functions/operators based upon - monadic/dyadic usage (but this is far from fully fleshed out). - This means there are meaningful classnames so hover states can - have popups etc.

- -

MIME types defined: text/apl (APL code)

-
diff --git a/public/plugins/codemirror-5.17.0/mode/asciiarmor/asciiarmor.js b/public/plugins/codemirror-5.17.0/mode/asciiarmor/asciiarmor.js deleted file mode 100644 index d83090376..000000000 --- a/public/plugins/codemirror-5.17.0/mode/asciiarmor/asciiarmor.js +++ /dev/null @@ -1,73 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function errorIfNotEmpty(stream) { - var nonWS = stream.match(/^\s*\S/); - stream.skipToEnd(); - return nonWS ? "error" : null; - } - - CodeMirror.defineMode("asciiarmor", function() { - return { - token: function(stream, state) { - var m; - if (state.state == "top") { - if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) { - state.state = "headers"; - state.type = m[1]; - return "tag"; - } - return errorIfNotEmpty(stream); - } else if (state.state == "headers") { - if (stream.sol() && stream.match(/^\w+:/)) { - state.state = "header"; - return "atom"; - } else { - var result = errorIfNotEmpty(stream); - if (result) state.state = "body"; - return result; - } - } else if (state.state == "header") { - stream.skipToEnd(); - state.state = "headers"; - return "string"; - } else if (state.state == "body") { - if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) { - if (m[1] != state.type) return "error"; - state.state = "end"; - return "tag"; - } else { - if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) { - return null; - } else { - stream.next(); - return "error"; - } - } - } else if (state.state == "end") { - return errorIfNotEmpty(stream); - } - }, - blankLine: function(state) { - if (state.state == "headers") state.state = "body"; - }, - startState: function() { - return {state: "top", type: null}; - } - }; - }); - - CodeMirror.defineMIME("application/pgp", "asciiarmor"); - CodeMirror.defineMIME("application/pgp-keys", "asciiarmor"); - CodeMirror.defineMIME("application/pgp-signature", "asciiarmor"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/asciiarmor/index.html b/public/plugins/codemirror-5.17.0/mode/asciiarmor/index.html deleted file mode 100644 index 8ba1b5c76..000000000 --- a/public/plugins/codemirror-5.17.0/mode/asciiarmor/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - -CodeMirror: ASCII Armor (PGP) mode - - - - - - - - - -
-

ASCII Armor (PGP) mode

-
- - - -

MIME types -defined: application/pgp, application/pgp-keys, application/pgp-signature

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/asn.1/asn.1.js b/public/plugins/codemirror-5.17.0/mode/asn.1/asn.1.js deleted file mode 100644 index 9600247ea..000000000 --- a/public/plugins/codemirror-5.17.0/mode/asn.1/asn.1.js +++ /dev/null @@ -1,204 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("asn.1", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - cmipVerbs = parserConfig.cmipVerbs || {}, - compareTypes = parserConfig.compareTypes || {}, - status = parserConfig.status || {}, - tags = parserConfig.tags || {}, - storage = parserConfig.storage || {}, - modifier = parserConfig.modifier || {}, - accessTypes = parserConfig.accessTypes|| {}, - multiLineStrings = parserConfig.multiLineStrings, - indentStatements = parserConfig.indentStatements !== false; - var isOperatorChar = /[\|\^]/; - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]\(\){}:=,;]/.test(ch)) { - curPunc = ch; - return "punctuation"; - } - if (ch == "-"){ - if (stream.eat("-")) { - stream.skipToEnd(); - return "comment"; - } - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - - stream.eatWhile(/[\w\-]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs"; - if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes"; - if (status.propertyIsEnumerable(cur)) return "comment status"; - if (tags.propertyIsEnumerable(cur)) return "variable-3 tags"; - if (storage.propertyIsEnumerable(cur)) return "builtin storage"; - if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier"; - if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes"; - - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped){ - var afterNext = stream.peek(); - //look if the character if the quote is like the B in '10100010'B - if (afterNext){ - afterNext = afterNext.toLowerCase(); - if(afterNext == "b" || afterNext == "h" || afterNext == "o") - stream.next(); - } - end = true; break; - } - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && state.context.type == "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - //Interface - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":" || curPunc == ",") - && ctx.type == "statement"){ - popContext(state); - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") - && curPunc != ';') || (ctx.type == "statement" - && curPunc == "newstatement"))) - pushContext(state, stream.column(), "statement"); - - state.startOfLine = false; - return style; - }, - - electricChars: "{}", - lineComment: "--", - fold: "brace" - }; - }); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - CodeMirror.defineMIME("text/x-ttcn-asn", { - name: "asn.1", - keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" + - " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" + - " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" + - " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" + - " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" + - " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" + - " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" + - " IMPLIED EXPORTS"), - cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"), - compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" + - " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" + - " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" + - " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" + - " TEXTUAL-CONVENTION"), - status: words("current deprecated mandatory obsolete"), - tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" + - " UNIVERSAL"), - storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" + - " UTCTime InterfaceIndex IANAifType CMIP-Attribute" + - " REAL PACKAGE PACKAGES IpAddress PhysAddress" + - " NetworkAddress BITS BMPString TimeStamp TimeTicks" + - " TruthValue RowStatus DisplayString GeneralString" + - " GraphicString IA5String NumericString" + - " PrintableString SnmpAdminAtring TeletexString" + - " UTF8String VideotexString VisibleString StringStore" + - " ISO646String T61String UniversalString Unsigned32" + - " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), - modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" + - " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" + - " DEFINED"), - accessTypes: words("not-accessible accessible-for-notify read-only" + - " read-create read-write"), - multiLineStrings: true - }); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/asn.1/index.html b/public/plugins/codemirror-5.17.0/mode/asn.1/index.html deleted file mode 100644 index 699fd4473..000000000 --- a/public/plugins/codemirror-5.17.0/mode/asn.1/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: ASN.1 mode - - - - - - - - -
-

ASN.1 example

-
- -
- - -
-

Language: Abstract Syntax Notation One - (ASN.1) -

-

MIME types defined: text/x-ttcn-asn

- -
-

The development of this mode has been sponsored by Ericsson - .

-

Coded by Asmelash Tsegay Gebretsadkan

-
- diff --git a/public/plugins/codemirror-5.17.0/mode/asterisk/asterisk.js b/public/plugins/codemirror-5.17.0/mode/asterisk/asterisk.js deleted file mode 100644 index b7ebfc5ad..000000000 --- a/public/plugins/codemirror-5.17.0/mode/asterisk/asterisk.js +++ /dev/null @@ -1,196 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - * ===================================================================================== - * - * Filename: mode/asterisk/asterisk.js - * - * Description: CodeMirror mode for Asterisk dialplan - * - * Created: 05/17/2012 09:20:25 PM - * Revision: none - * - * Author: Stas Kobzar (stas@modulis.ca), - * Company: Modulis.ca Inc. - * - * ===================================================================================== - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("asterisk", function() { - var atoms = ["exten", "same", "include","ignorepat","switch"], - dpcmd = ["#include","#exec"], - apps = [ - "addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi", - "alarmreceiver","amd","answer","authenticate","background","backgrounddetect", - "bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent", - "changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge", - "congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge", - "dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility", - "datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa", - "dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy", - "externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif", - "goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete", - "ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus", - "jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme", - "meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete", - "minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode", - "mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish", - "originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce", - "parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones", - "privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten", - "readfile","receivefax","receivefax","receivefax","record","removequeuemember", - "resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun", - "saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax", - "sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags", - "setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel", - "slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground", - "speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound", - "speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor", - "stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec", - "trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate", - "vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring", - "waitforsilence","waitmusiconhold","waituntil","while","zapateller" - ]; - - function basicToken(stream,state){ - var cur = ''; - var ch = stream.next(); - // comment - if(ch == ";") { - stream.skipToEnd(); - return "comment"; - } - // context - if(ch == '[') { - stream.skipTo(']'); - stream.eat(']'); - return "header"; - } - // string - if(ch == '"') { - stream.skipTo('"'); - return "string"; - } - if(ch == "'") { - stream.skipTo("'"); - return "string-2"; - } - // dialplan commands - if(ch == '#') { - stream.eatWhile(/\w/); - cur = stream.current(); - if(dpcmd.indexOf(cur) !== -1) { - stream.skipToEnd(); - return "strong"; - } - } - // application args - if(ch == '$'){ - var ch1 = stream.peek(); - if(ch1 == '{'){ - stream.skipTo('}'); - stream.eat('}'); - return "variable-3"; - } - } - // extension - stream.eatWhile(/\w/); - cur = stream.current(); - if(atoms.indexOf(cur) !== -1) { - state.extenStart = true; - switch(cur) { - case 'same': state.extenSame = true; break; - case 'include': - case 'switch': - case 'ignorepat': - state.extenInclude = true;break; - default:break; - } - return "atom"; - } - } - - return { - startState: function() { - return { - extenStart: false, - extenSame: false, - extenInclude: false, - extenExten: false, - extenPriority: false, - extenApplication: false - }; - }, - token: function(stream, state) { - - var cur = ''; - if(stream.eatSpace()) return null; - // extension started - if(state.extenStart){ - stream.eatWhile(/[^\s]/); - cur = stream.current(); - if(/^=>?$/.test(cur)){ - state.extenExten = true; - state.extenStart = false; - return "strong"; - } else { - state.extenStart = false; - stream.skipToEnd(); - return "error"; - } - } else if(state.extenExten) { - // set exten and priority - state.extenExten = false; - state.extenPriority = true; - stream.eatWhile(/[^,]/); - if(state.extenInclude) { - stream.skipToEnd(); - state.extenPriority = false; - state.extenInclude = false; - } - if(state.extenSame) { - state.extenPriority = false; - state.extenSame = false; - state.extenApplication = true; - } - return "tag"; - } else if(state.extenPriority) { - state.extenPriority = false; - state.extenApplication = true; - stream.next(); // get comma - if(state.extenSame) return null; - stream.eatWhile(/[^,]/); - return "number"; - } else if(state.extenApplication) { - stream.eatWhile(/,/); - cur = stream.current(); - if(cur === ',') return null; - stream.eatWhile(/\w/); - cur = stream.current().toLowerCase(); - state.extenApplication = false; - if(apps.indexOf(cur) !== -1){ - return "def strong"; - } - } else{ - return basicToken(stream,state); - } - - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-asterisk", "asterisk"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/asterisk/index.html b/public/plugins/codemirror-5.17.0/mode/asterisk/index.html deleted file mode 100644 index 257bd3987..000000000 --- a/public/plugins/codemirror-5.17.0/mode/asterisk/index.html +++ /dev/null @@ -1,154 +0,0 @@ - - -CodeMirror: Asterisk dialplan mode - - - - - - - - - -
-

Asterisk dialplan mode

-
- - -

MIME types defined: text/x-asterisk.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/brainfuck/brainfuck.js b/public/plugins/codemirror-5.17.0/mode/brainfuck/brainfuck.js deleted file mode 100644 index 3becf2a5a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/brainfuck/brainfuck.js +++ /dev/null @@ -1,85 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11 - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") - mod(require("../../lib/codemirror")) - else if (typeof define == "function" && define.amd) - define(["../../lib/codemirror"], mod) - else - mod(CodeMirror) -})(function(CodeMirror) { - "use strict" - var reserve = "><+-.,[]".split(""); - /* - comments can be either: - placed behind lines - - +++ this is a comment - - where reserved characters cannot be used - or in a loop - [ - this is ok to use [ ] and stuff - ] - or preceded by # - */ - CodeMirror.defineMode("brainfuck", function() { - return { - startState: function() { - return { - commentLine: false, - left: 0, - right: 0, - commentLoop: false - } - }, - token: function(stream, state) { - if (stream.eatSpace()) return null - if(stream.sol()){ - state.commentLine = false; - } - var ch = stream.next().toString(); - if(reserve.indexOf(ch) !== -1){ - if(state.commentLine === true){ - if(stream.eol()){ - state.commentLine = false; - } - return "comment"; - } - if(ch === "]" || ch === "["){ - if(ch === "["){ - state.left++; - } - else{ - state.right++; - } - return "bracket"; - } - else if(ch === "+" || ch === "-"){ - return "keyword"; - } - else if(ch === "<" || ch === ">"){ - return "atom"; - } - else if(ch === "." || ch === ","){ - return "def"; - } - } - else{ - state.commentLine = true; - if(stream.eol()){ - state.commentLine = false; - } - return "comment"; - } - if(stream.eol()){ - state.commentLine = false; - } - } - }; - }); -CodeMirror.defineMIME("text/x-brainfuck","brainfuck") -}); diff --git a/public/plugins/codemirror-5.17.0/mode/brainfuck/index.html b/public/plugins/codemirror-5.17.0/mode/brainfuck/index.html deleted file mode 100644 index 6048fc241..000000000 --- a/public/plugins/codemirror-5.17.0/mode/brainfuck/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Brainfuck mode - - - - - - - - - - -
-

Brainfuck mode

-
- - - -

A mode for Brainfuck

- -

MIME types defined: text/x-brainfuck

-
diff --git a/public/plugins/codemirror-5.17.0/mode/clike/clike.js b/public/plugins/codemirror-5.17.0/mode/clike/clike.js deleted file mode 100644 index a37921fda..000000000 --- a/public/plugins/codemirror-5.17.0/mode/clike/clike.js +++ /dev/null @@ -1,786 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -function Context(indented, column, type, info, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.info = info; - this.align = align; - this.prev = prev; -} -function pushContext(state, col, type, info) { - var indent = state.indented; - if (state.context && state.context.type != "statement" && type != "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, info, null, state.context); -} -function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; -} - -function typeBefore(stream, state, pos) { - if (state.prevToken == "variable" || state.prevToken == "variable-3") return true; - if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true; - if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true; -} - -function isTopScope(context) { - for (;;) { - if (!context || context.type == "top") return true; - if (context.type == "}" && context.prev.info != "namespace") return false; - context = context.prev; - } -} - -CodeMirror.defineMode("clike", function(config, parserConfig) { - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - dontAlignCalls = parserConfig.dontAlignCalls, - keywords = parserConfig.keywords || {}, - types = parserConfig.types || {}, - builtin = parserConfig.builtin || {}, - blockKeywords = parserConfig.blockKeywords || {}, - defKeywords = parserConfig.defKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings, - indentStatements = parserConfig.indentStatements !== false, - indentSwitch = parserConfig.indentSwitch !== false, - namespaceSeparator = parserConfig.namespaceSeparator, - isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/, - numberStart = parserConfig.numberStart || /[\d\.]/, - number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i, - isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/, - endStatement = parserConfig.endStatement || /^[;:,]$/; - - var curPunc, isDefKeyword; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (isPunctuationChar.test(ch)) { - curPunc = ch; - return null; - } - if (numberStart.test(ch)) { - stream.backUp(1) - if (stream.match(number)) return "number" - stream.next() - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {} - return "operator"; - } - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - if (namespaceSeparator) while (stream.match(namespaceSeparator)) - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - - var cur = stream.current(); - if (contains(keywords, cur)) { - if (contains(blockKeywords, cur)) curPunc = "newstatement"; - if (contains(defKeywords, cur)) isDefKeyword = true; - return "keyword"; - } - if (contains(types, cur)) return "variable-3"; - if (contains(builtin, cur)) { - if (contains(blockKeywords, cur)) curPunc = "newstatement"; - return "builtin"; - } - if (contains(atoms, cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function maybeEOL(stream, state) { - if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) - state.typeAtEndOfLine = typeBefore(stream, state, stream.pos) - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false), - indented: 0, - startOfLine: true, - prevToken: null - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) { maybeEOL(stream, state); return null; } - curPunc = isDefKeyword = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if (endStatement.test(curPunc)) while (state.context.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (indentStatements && - (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") || - (ctx.type == "statement" && curPunc == "newstatement"))) { - pushContext(state, stream.column(), "statement", stream.current()); - } - - if (style == "variable" && - ((state.prevToken == "def" || - (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && - isTopScope(state.context) && stream.match(/^\s*\(/, false))))) - style = "def"; - - if (hooks.token) { - var result = hooks.token(stream, state, style); - if (result !== undefined) style = result; - } - - if (style == "def" && parserConfig.styleDefs === false) style = "variable"; - - state.startOfLine = false; - state.prevToken = isDefKeyword ? "def" : style || curPunc; - maybeEOL(stream, state); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - if (parserConfig.dontIndentStatements) - while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) - ctx = ctx.prev - if (hooks.indent) { - var hook = hooks.indent(state, ctx, textAfter); - if (typeof hook == "number") return hook - } - var closing = firstChar == ctx.type; - var switchBlock = ctx.prev && ctx.prev.info == "switch"; - if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) { - while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev - return ctx.indented - } - if (ctx.type == "statement") - return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - if (ctx.align && (!dontAlignCalls || ctx.type != ")")) - return ctx.column + (closing ? 0 : 1); - if (ctx.type == ")" && !closing) - return ctx.indented + statementIndentUnit; - - return ctx.indented + (closing ? 0 : indentUnit) + - (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0); - }, - - electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/, - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - fold: "brace" - }; -}); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - function contains(words, word) { - if (typeof words === "function") { - return words(word); - } else { - return words.propertyIsEnumerable(word); - } - } - var cKeywords = "auto if break case register continue return default do sizeof " + - "static else struct switch extern typedef union for goto while enum const volatile"; - var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t"; - - function cppHook(stream, state) { - if (!state.startOfLine) return false - for (var ch, next = null; ch = stream.peek();) { - if (ch == "\\" && stream.match(/^.$/)) { - next = cppHook - break - } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) { - break - } - stream.next() - } - state.tokenize = next - return "meta" - } - - function pointerHook(_stream, state) { - if (state.prevToken == "variable-3") return "variable-3"; - return false; - } - - function cpp14Literal(stream) { - stream.eatWhile(/[\w\.']/); - return "number"; - } - - function cpp11StringHook(stream, state) { - stream.backUp(1); - // Raw strings. - if (stream.match(/(R|u8R|uR|UR|LR)/)) { - var match = stream.match(/"([^\s\\()]{0,16})\(/); - if (!match) { - return false; - } - state.cpp11RawStringDelim = match[1]; - state.tokenize = tokenRawString; - return tokenRawString(stream, state); - } - // Unicode strings/chars. - if (stream.match(/(u8|u|U|L)/)) { - if (stream.match(/["']/, /* eat */ false)) { - return "string"; - } - return false; - } - // Ignore this hook. - stream.next(); - return false; - } - - function cppLooksLikeConstructor(word) { - var lastTwo = /(\w+)::(\w+)$/.exec(word); - return lastTwo && lastTwo[1] == lastTwo[2]; - } - - // C#-style strings where "" escapes a quote. - function tokenAtString(stream, state) { - var next; - while ((next = stream.next()) != null) { - if (next == '"' && !stream.eat('"')) { - state.tokenize = null; - break; - } - } - return "string"; - } - - // C++11 raw string literal is "( anything )", where - // can be a string up to 16 characters long. - function tokenRawString(stream, state) { - // Escape characters that have special regex meanings. - var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&'); - var match = stream.match(new RegExp(".*?\\)" + delim + '"')); - if (match) - state.tokenize = null; - else - stream.skipToEnd(); - return "string"; - } - - function def(mimes, mode) { - if (typeof mimes == "string") mimes = [mimes]; - var words = []; - function add(obj) { - if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) - words.push(prop); - } - add(mode.keywords); - add(mode.types); - add(mode.builtin); - add(mode.atoms); - if (words.length) { - mode.helperType = mimes[0]; - CodeMirror.registerHelper("hintWords", mimes[0], words); - } - - for (var i = 0; i < mimes.length; ++i) - CodeMirror.defineMIME(mimes[i], mode); - } - - def(["text/x-csrc", "text/x-c", "text/x-chdr"], { - name: "clike", - keywords: words(cKeywords), - types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " + - "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " + - "uint32_t uint64_t"), - blockKeywords: words("case do else for if switch while struct"), - defKeywords: words("struct"), - typeFirstDefinitions: true, - atoms: words("null true false"), - hooks: {"#": cppHook, "*": pointerHook}, - modeProps: {fold: ["brace", "include"]} - }); - - def(["text/x-c++src", "text/x-c++hdr"], { - name: "clike", - keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " + - "static_cast typeid catch operator template typename class friend private " + - "this using const_cast inline public throw virtual delete mutable protected " + - "alignas alignof constexpr decltype nullptr noexcept thread_local final " + - "static_assert override"), - types: words(cTypes + " bool wchar_t"), - blockKeywords: words("catch class do else finally for if struct switch try while"), - defKeywords: words("class namespace struct enum union"), - typeFirstDefinitions: true, - atoms: words("true false null"), - dontIndentStatements: /^template$/, - hooks: { - "#": cppHook, - "*": pointerHook, - "u": cpp11StringHook, - "U": cpp11StringHook, - "L": cpp11StringHook, - "R": cpp11StringHook, - "0": cpp14Literal, - "1": cpp14Literal, - "2": cpp14Literal, - "3": cpp14Literal, - "4": cpp14Literal, - "5": cpp14Literal, - "6": cpp14Literal, - "7": cpp14Literal, - "8": cpp14Literal, - "9": cpp14Literal, - token: function(stream, state, style) { - if (style == "variable" && stream.peek() == "(" && - (state.prevToken == ";" || state.prevToken == null || - state.prevToken == "}") && - cppLooksLikeConstructor(stream.current())) - return "def"; - } - }, - namespaceSeparator: "::", - modeProps: {fold: ["brace", "include"]} - }); - - def("text/x-java", { - name: "clike", - keywords: words("abstract assert break case catch class const continue default " + - "do else enum extends final finally float for goto if implements import " + - "instanceof interface native new package private protected public " + - "return static strictfp super switch synchronized this throw throws transient " + - "try volatile while"), - types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " + - "Integer Long Number Object Short String StringBuffer StringBuilder Void"), - blockKeywords: words("catch class do else finally for if switch try while"), - defKeywords: words("class interface package enum"), - typeFirstDefinitions: true, - atoms: words("true false null"), - endStatement: /^[;:]$/, - number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i, - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - }, - modeProps: {fold: ["brace", "import"]} - }); - - def("text/x-csharp", { - name: "clike", - keywords: words("abstract as async await base break case catch checked class const continue" + - " default delegate do else enum event explicit extern finally fixed for" + - " foreach goto if implicit in interface internal is lock namespace new" + - " operator out override params private protected public readonly ref return sealed" + - " sizeof stackalloc static struct switch this throw try typeof unchecked" + - " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + - " global group into join let orderby partial remove select set value var yield"), - types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" + - " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" + - " UInt64 bool byte char decimal double short int long object" + - " sbyte float string ushort uint ulong"), - blockKeywords: words("catch class do else finally for foreach if struct switch try while"), - defKeywords: words("class interface namespace struct var"), - typeFirstDefinitions: true, - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - if (stream.eat('"')) { - state.tokenize = tokenAtString; - return tokenAtString(stream, state); - } - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - - function tokenTripleString(stream, state) { - var escaped = false; - while (!stream.eol()) { - if (!escaped && stream.match('"""')) { - state.tokenize = null; - break; - } - escaped = stream.next() == "\\" && !escaped; - } - return "string"; - } - - def("text/x-scala", { - name: "clike", - keywords: words( - - /* scala */ - "abstract case catch class def do else extends final finally for forSome if " + - "implicit import lazy match new null object override package private protected return " + - "sealed super this throw trait try type val var while with yield _ : = => <- <: " + - "<% >: # @ " + - - /* package scala */ - "assert assume require print println printf readLine readBoolean readByte readShort " + - "readChar readInt readLong readFloat readDouble " + - - ":: #:: " - ), - types: words( - "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + - "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " + - "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + - "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + - "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " + - - /* package java.lang */ - "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + - "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + - "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + - "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" - ), - multiLineStrings: true, - blockKeywords: words("catch class do else finally for forSome if match switch try while"), - defKeywords: words("class def object package trait type val var"), - atoms: words("true false null"), - indentStatements: false, - indentSwitch: false, - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - }, - '"': function(stream, state) { - if (!stream.match('""')) return false; - state.tokenize = tokenTripleString; - return state.tokenize(stream, state); - }, - "'": function(stream) { - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - return "atom"; - }, - "=": function(stream, state) { - var cx = state.context - if (cx.type == "}" && cx.align && stream.eat(">")) { - state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev) - return "operator" - } else { - return false - } - } - }, - modeProps: {closeBrackets: {triples: '"'}} - }); - - function tokenKotlinString(tripleString){ - return function (stream, state) { - var escaped = false, next, end = false; - while (!stream.eol()) { - if (!tripleString && !escaped && stream.match('"') ) {end = true; break;} - if (tripleString && stream.match('"""')) {end = true; break;} - next = stream.next(); - if(!escaped && next == "$" && stream.match('{')) - stream.skipTo("}"); - escaped = !escaped && next == "\\" && !tripleString; - } - if (end || !tripleString) - state.tokenize = null; - return "string"; - } - } - - def("text/x-kotlin", { - name: "clike", - keywords: words( - /*keywords*/ - "package as typealias class interface this super val " + - "var fun for is in This throw return " + - "break continue object if else while do try when !in !is as? " + - - /*soft keywords*/ - "file import where by get set abstract enum open inner override private public internal " + - "protected catch finally out final vararg reified dynamic companion constructor init " + - "sealed field property receiver param sparam lateinit data inline noinline tailrec " + - "external annotation crossinline const operator infix" - ), - types: words( - /* package java.lang */ - "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + - "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + - "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + - "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" - ), - intendSwitch: false, - indentStatements: false, - multiLineStrings: true, - blockKeywords: words("catch class do else finally for if where try while enum"), - defKeywords: words("class val var object package interface fun"), - atoms: words("true false null this"), - hooks: { - '"': function(stream, state) { - state.tokenize = tokenKotlinString(stream.match('""')); - return state.tokenize(stream, state); - } - }, - modeProps: {closeBrackets: {triples: '"'}} - }); - - def(["x-shader/x-vertex", "x-shader/x-fragment"], { - name: "clike", - keywords: words("sampler1D sampler2D sampler3D samplerCube " + - "sampler1DShadow sampler2DShadow " + - "const attribute uniform varying " + - "break continue discard return " + - "for while do if else struct " + - "in out inout"), - types: words("float int bool void " + - "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + - "mat2 mat3 mat4"), - blockKeywords: words("for while do if else struct"), - builtin: words("radians degrees sin cos tan asin acos atan " + - "pow exp log exp2 sqrt inversesqrt " + - "abs sign floor ceil fract mod min max clamp mix step smoothstep " + - "length distance dot cross normalize ftransform faceforward " + - "reflect refract matrixCompMult " + - "lessThan lessThanEqual greaterThan greaterThanEqual " + - "equal notEqual any all not " + - "texture1D texture1DProj texture1DLod texture1DProjLod " + - "texture2D texture2DProj texture2DLod texture2DProjLod " + - "texture3D texture3DProj texture3DLod texture3DProjLod " + - "textureCube textureCubeLod " + - "shadow1D shadow2D shadow1DProj shadow2DProj " + - "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " + - "dFdx dFdy fwidth " + - "noise1 noise2 noise3 noise4"), - atoms: words("true false " + - "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " + - "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " + - "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " + - "gl_FogCoord gl_PointCoord " + - "gl_Position gl_PointSize gl_ClipVertex " + - "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " + - "gl_TexCoord gl_FogFragCoord " + - "gl_FragCoord gl_FrontFacing " + - "gl_FragData gl_FragDepth " + - "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " + - "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " + - "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " + - "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + - "gl_ProjectionMatrixInverseTranspose " + - "gl_ModelViewProjectionMatrixInverseTranspose " + - "gl_TextureMatrixInverseTranspose " + - "gl_NormalScale gl_DepthRange gl_ClipPlane " + - "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " + - "gl_FrontLightModelProduct gl_BackLightModelProduct " + - "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " + - "gl_FogParameters " + - "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " + - "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " + - "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + - "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + - "gl_MaxDrawBuffers"), - indentSwitch: false, - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); - - def("text/x-nesc", { - name: "clike", - keywords: words(cKeywords + "as atomic async call command component components configuration event generic " + - "implementation includes interface module new norace nx_struct nx_union post provides " + - "signal task uses abstract extends"), - types: words(cTypes), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null true false"), - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); - - def("text/x-objectivec", { - name: "clike", - keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " + - "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"), - types: words(cTypes), - atoms: words("YES NO NULL NILL ON OFF true false"), - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$]/); - return "keyword"; - }, - "#": cppHook, - indent: function(_state, ctx, textAfter) { - if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented - } - }, - modeProps: {fold: "brace"} - }); - - def("text/x-squirrel", { - name: "clike", - keywords: words("base break clone continue const default delete enum extends function in class" + - " foreach local resume return this throw typeof yield constructor instanceof static"), - types: words(cTypes), - blockKeywords: words("case catch class else for foreach if switch try while"), - defKeywords: words("function local class"), - typeFirstDefinitions: true, - atoms: words("true false null"), - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); - - // Ceylon Strings need to deal with interpolation - var stringTokenizer = null; - function tokenCeylonString(type) { - return function(stream, state) { - var escaped = false, next, end = false; - while (!stream.eol()) { - if (!escaped && stream.match('"') && - (type == "single" || stream.match('""'))) { - end = true; - break; - } - if (!escaped && stream.match('``')) { - stringTokenizer = tokenCeylonString(type); - end = true; - break; - } - next = stream.next(); - escaped = type == "single" && !escaped && next == "\\"; - } - if (end) - state.tokenize = null; - return "string"; - } - } - - def("text/x-ceylon", { - name: "clike", - keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" + - " exists extends finally for function given if import in interface is let module new" + - " nonempty object of out outer package return satisfies super switch then this throw" + - " try value void while"), - types: function(word) { - // In Ceylon all identifiers that start with an uppercase are types - var first = word.charAt(0); - return (first === first.toUpperCase() && first !== first.toLowerCase()); - }, - blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"), - defKeywords: words("class dynamic function interface module object package value"), - builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" + - " native optional sealed see serializable shared suppressWarnings tagged throws variable"), - isPunctuationChar: /[\[\]{}\(\),;\:\.`]/, - isOperatorChar: /[+\-*&%=<>!?|^~:\/]/, - numberStart: /[\d#$]/, - number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i, - multiLineStrings: true, - typeFirstDefinitions: true, - atoms: words("true false null larger smaller equal empty finished"), - indentSwitch: false, - styleDefs: false, - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - }, - '"': function(stream, state) { - state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single"); - return state.tokenize(stream, state); - }, - '`': function(stream, state) { - if (!stringTokenizer || !stream.match('`')) return false; - state.tokenize = stringTokenizer; - stringTokenizer = null; - return state.tokenize(stream, state); - }, - "'": function(stream) { - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - return "atom"; - }, - token: function(_stream, state, style) { - if ((style == "variable" || style == "variable-3") && - state.prevToken == ".") { - return "variable-2"; - } - } - }, - modeProps: { - fold: ["brace", "import"], - closeBrackets: {triples: '"'} - } - }); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/clike/index.html b/public/plugins/codemirror-5.17.0/mode/clike/index.html deleted file mode 100644 index 45c670ae5..000000000 --- a/public/plugins/codemirror-5.17.0/mode/clike/index.html +++ /dev/null @@ -1,360 +0,0 @@ - - -CodeMirror: C-like mode - - - - - - - - - - - - -
-

C-like mode

- -
- -

C++ example

- -
- -

Objective-C example

- -
- -

Java example

- -
- -

Scala example

- -
- -

Kotlin mode

- -
- -

Ceylon mode

- -
- - - -

Simple mode that tries to handle C-like languages as well as it - can. Takes two configuration parameters: keywords, an - object whose property names are the keywords in the language, - and useCPP, which determines whether C preprocessor - directives are recognized.

- -

MIME types defined: text/x-csrc - (C), text/x-c++src (C++), text/x-java - (Java), text/x-csharp (C#), - text/x-objectivec (Objective-C), - text/x-scala (Scala), text/x-vertex - x-shader/x-fragment (shader programs), - text/x-squirrel (Squirrel) and - text/x-ceylon (Ceylon)

-
diff --git a/public/plugins/codemirror-5.17.0/mode/clike/scala.html b/public/plugins/codemirror-5.17.0/mode/clike/scala.html deleted file mode 100644 index aa04cf0f0..000000000 --- a/public/plugins/codemirror-5.17.0/mode/clike/scala.html +++ /dev/null @@ -1,767 +0,0 @@ - - -CodeMirror: Scala mode - - - - - - - - - - -
-

Scala mode

-
- - - - -
diff --git a/public/plugins/codemirror-5.17.0/mode/clike/test.js b/public/plugins/codemirror-5.17.0/mode/clike/test.js deleted file mode 100644 index bea85b869..000000000 --- a/public/plugins/codemirror-5.17.0/mode/clike/test.js +++ /dev/null @@ -1,55 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("indent", - "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {", - " [variable-3 int] [variable c] [operator =] [variable b] [operator +]", - " [number 1];", - " [keyword return] [operator *][variable a];", - "}"); - - MT("indent_switch", - "[keyword switch] ([variable x]) {", - " [keyword case] [number 10]:", - " [keyword return] [number 20];", - " [keyword default]:", - " [variable printf]([string \"foo %c\"], [variable x]);", - "}"); - - MT("def", - "[variable-3 void] [def foo]() {}", - "[keyword struct] [def bar]{}", - "[variable-3 int] [variable-3 *][def baz]() {}"); - - MT("def_new_line", - "::[variable std]::[variable SomeTerribleType][operator <][variable T][operator >]", - "[def SomeLongMethodNameThatDoesntFitIntoOneLine]([keyword const] [variable MyType][operator &] [variable param]) {}") - - MT("double_block", - "[keyword for] (;;)", - " [keyword for] (;;)", - " [variable x][operator ++];", - "[keyword return];"); - - MT("preprocessor", - "[meta #define FOO 3]", - "[variable-3 int] [variable foo];", - "[meta #define BAR\\]", - "[meta 4]", - "[variable-3 unsigned] [variable-3 int] [variable bar] [operator =] [number 8];", - "[meta #include ][comment // comment]") - - - var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src"); - function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); } - - MTCPP("cpp14_literal", - "[number 10'000];", - "[number 0b10'000];", - "[number 0x10'000];", - "[string '100000'];"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/clojure/clojure.js b/public/plugins/codemirror-5.17.0/mode/clojure/clojure.js deleted file mode 100644 index ed6af2c83..000000000 --- a/public/plugins/codemirror-5.17.0/mode/clojure/clojure.js +++ /dev/null @@ -1,306 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Author: Hans Engel - * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("clojure", function (options) { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword", VAR = "variable"; - var INDENT_WORD_SKIP = options.indentUnit || 2; - var NORMAL_INDENT_UNIT = options.indentUnit || 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var atoms = makeKeywords("true false nil"); - - var keywords = makeKeywords( - "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest " + - "slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn " + - "do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync " + - "doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars " + - "binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); - - var builtins = makeKeywords( - "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* " + - "*compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* " + - "*math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* " + - "*source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> " + - "->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor " + - "aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! " + - "alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double " + - "aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 " + - "bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set " + - "bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast " + - "byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append " + - "chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors " + - "clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp " + - "conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? " + - "declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol " + - "defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc " + - "dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last " + - "drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info " + - "extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword " + - "find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? " + - "fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? " + - "gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash " + - "hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? " + - "int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep " + - "keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file " + - "load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array " + - "make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods " + - "min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty " + - "not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias " + - "ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all " + - "partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers " + - "primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str " + - "prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues " + - "quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern " + - "re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history " + - "ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods " + - "remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest " + - "restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? " + - "seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts " + - "shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? " + - "special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol " + - "symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce " + - "transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec " + - "unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int " + - "unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int "+ - "unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote " + - "unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of " + - "vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context " + - "with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap " + - "*default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! " + - "set-agent-send-off-executor! some-> some->>"); - - var indentKeys = makeKeywords( - // Built-ins - "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto " + - "locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type " + - "try catch " + - - // Binding forms - "let letfn binding loop for doseq dotimes when-let if-let " + - - // Data structures - "defstruct struct-map assoc " + - - // clojure.test - "testing deftest " + - - // contrib - "handler-case handle dotrace deftrace"); - - var tests = { - digit: /\d/, - digit_or_colon: /[\d:]/, - hex: /[0-9a-f]/i, - sign: /[+-]/, - exponent: /e/i, - keyword_char: /[^\s\(\[\;\)\]]/, - symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/, - block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/ - }; - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - function isNumber(ch, stream){ - // hex - if ( ch === '0' && stream.eat(/x/i) ) { - stream.eatWhile(tests.hex); - return true; - } - - // leading sign - if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { - stream.eat(tests.sign); - ch = stream.next(); - } - - if ( tests.digit.test(ch) ) { - stream.eat(ch); - stream.eatWhile(tests.digit); - - if ( '.' == stream.peek() ) { - stream.eat('.'); - stream.eatWhile(tests.digit); - } else if ('/' == stream.peek() ) { - stream.eat('/'); - stream.eatWhile(tests.digit); - } - - if ( stream.eat(tests.exponent) ) { - stream.eat(tests.sign); - stream.eatWhile(tests.digit); - } - - return true; - } - - return false; - } - - // Eat character that starts after backslash \ - function eatCharacter(stream) { - var first = stream.next(); - // Read special literals: backspace, newline, space, return. - // Just read all lowercase letters. - if (first && first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) { - return; - } - // Read unicode character: \u1000 \uA0a1 - if (first === "u") { - stream.match(/[0-9a-z]{4}/i, true); - } - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (state.mode != "string" && stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in string mode - break; - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - } else if (ch == "\\") { - eatCharacter(stream); - returnType = CHARACTER; - } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { - returnType = ATOM; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[" || ch == "{" ) { - var keyWord = '', indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || - tests.block_indent.test(keyWord))) { // indent-word - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation the user defined spaces after - pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - returnType = BRACKET; - } else if (ch == ")" || ch == "]" || ch == "}") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) { - popStack(state); - } - } else if ( ch == ":" ) { - stream.eatWhile(tests.symbol); - return ATOM; - } else { - stream.eatWhile(tests.symbol); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = KEYWORD; - } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { - returnType = ATOM; - } else { - returnType = VAR; - } - } - } - - return returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - }, - - closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;" - }; -}); - -CodeMirror.defineMIME("text/x-clojure", "clojure"); -CodeMirror.defineMIME("text/x-clojurescript", "clojure"); -CodeMirror.defineMIME("application/edn", "clojure"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/clojure/index.html b/public/plugins/codemirror-5.17.0/mode/clojure/index.html deleted file mode 100644 index 81294bc14..000000000 --- a/public/plugins/codemirror-5.17.0/mode/clojure/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - -CodeMirror: Clojure mode - - - - - - - - - -
-

Clojure mode

-
- - -

MIME types defined: text/x-clojure.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/cmake/cmake.js b/public/plugins/codemirror-5.17.0/mode/cmake/cmake.js deleted file mode 100644 index 9f9eda541..000000000 --- a/public/plugins/codemirror-5.17.0/mode/cmake/cmake.js +++ /dev/null @@ -1,97 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) - define(["../../lib/codemirror"], mod); - else - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("cmake", function () { - var variable_regex = /({)?[a-zA-Z0-9_]+(})?/; - - function tokenString(stream, state) { - var current, prev, found_var = false; - while (!stream.eol() && (current = stream.next()) != state.pending) { - if (current === '$' && prev != '\\' && state.pending == '"') { - found_var = true; - break; - } - prev = current; - } - if (found_var) { - stream.backUp(1); - } - if (current == state.pending) { - state.continueString = false; - } else { - state.continueString = true; - } - return "string"; - } - - function tokenize(stream, state) { - var ch = stream.next(); - - // Have we found a variable? - if (ch === '$') { - if (stream.match(variable_regex)) { - return 'variable-2'; - } - return 'variable'; - } - // Should we still be looking for the end of a string? - if (state.continueString) { - // If so, go through the loop again - stream.backUp(1); - return tokenString(stream, state); - } - // Do we just have a function on our hands? - // In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched - if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) { - stream.backUp(1); - return 'def'; - } - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - // Have we found a string? - if (ch == "'" || ch == '"') { - // Store the type (single or double) - state.pending = ch; - // Perform the looping function to find the end - return tokenString(stream, state); - } - if (ch == '(' || ch == ')') { - return 'bracket'; - } - if (ch.match(/[0-9]/)) { - return 'number'; - } - stream.eatWhile(/[\w-]/); - return null; - } - return { - startState: function () { - var state = {}; - state.inDefinition = false; - state.inInclude = false; - state.continueString = false; - state.pending = false; - return state; - }, - token: function (stream, state) { - if (stream.eatSpace()) return null; - return tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/x-cmake", "cmake"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/cmake/index.html b/public/plugins/codemirror-5.17.0/mode/cmake/index.html deleted file mode 100644 index ed114fece..000000000 --- a/public/plugins/codemirror-5.17.0/mode/cmake/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - -CodeMirror: CMake mode - - - - - - - - - - -
-

CMake mode

-
- - -

MIME types defined: text/x-cmake.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/cobol/cobol.js b/public/plugins/codemirror-5.17.0/mode/cobol/cobol.js deleted file mode 100644 index 897022b18..000000000 --- a/public/plugins/codemirror-5.17.0/mode/cobol/cobol.js +++ /dev/null @@ -1,255 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Author: Gautam Mehta - * Branched from CodeMirror's Scheme mode - */ -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("cobol", function () { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header", - COBOLLINENUM = "def", PERIOD = "link"; - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES "); - var keywords = makeKeywords( - "ACCEPT ACCESS ACQUIRE ADD ADDRESS " + - "ADVANCING AFTER ALIAS ALL ALPHABET " + - "ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " + - "ALSO ALTER ALTERNATE AND ANY " + - "ARE AREA AREAS ARITHMETIC ASCENDING " + - "ASSIGN AT ATTRIBUTE AUTHOR AUTO " + - "AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " + - "B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " + - "BEFORE BELL BINARY BIT BITS " + - "BLANK BLINK BLOCK BOOLEAN BOTTOM " + - "BY CALL CANCEL CD CF " + - "CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " + - "CLOSE COBOL CODE CODE-SET COL " + - "COLLATING COLUMN COMMA COMMIT COMMITMENT " + - "COMMON COMMUNICATION COMP COMP-0 COMP-1 " + - "COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " + - "COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " + - "COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " + - "COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " + - "CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " + - "CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " + - "CONVERTING COPY CORR CORRESPONDING COUNT " + - "CRT CRT-UNDER CURRENCY CURRENT CURSOR " + - "DATA DATE DATE-COMPILED DATE-WRITTEN DAY " + - "DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " + - "DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " + - "DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " + - "DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " + - "DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " + - "DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " + - "DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " + - "DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " + - "DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " + - "DOWN DROP DUPLICATE DUPLICATES DYNAMIC " + - "EBCDIC EGI EJECT ELSE EMI " + - "EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " + - "END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " + - "END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " + - "END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " + - "END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " + - "END-UNSTRING END-WRITE END-XML ENTER ENTRY " + - "ENVIRONMENT EOP EQUAL EQUALS ERASE " + - "ERROR ESI EVALUATE EVERY EXCEEDS " + - "EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " + - "EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " + - "FILE-STREAM FILES FILLER FINAL FIND " + - "FINISH FIRST FOOTING FOR FOREGROUND-COLOR " + - "FOREGROUND-COLOUR FORMAT FREE FROM FULL " + - "FUNCTION GENERATE GET GIVING GLOBAL " + - "GO GOBACK GREATER GROUP HEADING " + - "HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " + - "ID IDENTIFICATION IF IN INDEX " + - "INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " + - "INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " + - "INDIC INDICATE INDICATOR INDICATORS INITIAL " + - "INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " + - "INSTALLATION INTO INVALID INVOKE IS " + - "JUST JUSTIFIED KANJI KEEP KEY " + - "LABEL LAST LD LEADING LEFT " + - "LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " + - "LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " + - "LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " + - "LOCALE LOCALLY LOCK " + - "MEMBER MEMORY MERGE MESSAGE METACLASS " + - "MODE MODIFIED MODIFY MODULES MOVE " + - "MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " + - "NEXT NO NO-ECHO NONE NOT " + - "NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " + - "NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " + - "OF OFF OMITTED ON ONLY " + - "OPEN OPTIONAL OR ORDER ORGANIZATION " + - "OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " + - "PADDING PAGE PAGE-COUNTER PARSE PERFORM " + - "PF PH PIC PICTURE PLUS " + - "POINTER POSITION POSITIVE PREFIX PRESENT " + - "PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " + - "PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " + - "PROMPT PROTECTED PURGE QUEUE QUOTE " + - "QUOTES RANDOM RD READ READY " + - "REALM RECEIVE RECONNECT RECORD RECORD-NAME " + - "RECORDS RECURSIVE REDEFINES REEL REFERENCE " + - "REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " + - "REMAINDER REMOVAL RENAMES REPEATED REPLACE " + - "REPLACING REPORT REPORTING REPORTS REPOSITORY " + - "REQUIRED RERUN RESERVE RESET RETAINING " + - "RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " + - "REVERSED REWIND REWRITE RF RH " + - "RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " + - "RUN SAME SCREEN SD SEARCH " + - "SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " + - "SELECT SEND SENTENCE SEPARATE SEQUENCE " + - "SEQUENTIAL SET SHARED SIGN SIZE " + - "SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " + - "SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " + - "SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " + - "START STARTING STATUS STOP STORE " + - "STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " + - "SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " + - "SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " + - "TABLE TALLYING TAPE TENANT TERMINAL " + - "TERMINATE TEST TEXT THAN THEN " + - "THROUGH THRU TIME TIMES TITLE " + - "TO TOP TRAILING TRAILING-SIGN TRANSACTION " + - "TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " + - "UNSTRING UNTIL UP UPDATE UPON " + - "USAGE USAGE-MODE USE USING VALID " + - "VALIDATE VALUE VALUES VARYING VLR " + - "WAIT WHEN WHEN-COMPILED WITH WITHIN " + - "WORDS WORKING-STORAGE WRITE XML XML-CODE " + - "XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " ); - - var builtins = makeKeywords("- * ** / + < <= = > >= "); - var tests = { - digit: /\d/, - digit_or_colon: /[\d:]/, - hex: /[0-9a-f]/i, - sign: /[+-]/, - exponent: /e/i, - keyword_char: /[^\s\(\[\;\)\]]/, - symbol: /[\w*+\-]/ - }; - function isNumber(ch, stream){ - // hex - if ( ch === '0' && stream.eat(/x/i) ) { - stream.eatWhile(tests.hex); - return true; - } - // leading sign - if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { - stream.eat(tests.sign); - ch = stream.next(); - } - if ( tests.digit.test(ch) ) { - stream.eat(ch); - stream.eatWhile(tests.digit); - if ( '.' == stream.peek()) { - stream.eat('.'); - stream.eatWhile(tests.digit); - } - if ( stream.eat(tests.exponent) ) { - stream.eat(tests.sign); - stream.eatWhile(tests.digit); - } - return true; - } - return false; - } - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false - }; - }, - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = 6 ; //stream.indentation(); - } - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - switch(state.mode){ - case "string": // multi-line string parsing mode - var next = false; - while ((next = stream.next()) != null) { - if (next == "\"" || next == "\'") { - state.mode = false; - break; - } - } - returnType = STRING; // continue on in string mode - break; - default: // default parsing mode - var ch = stream.next(); - var col = stream.column(); - if (col >= 0 && col <= 5) { - returnType = COBOLLINENUM; - } else if (col >= 72 && col <= 79) { - stream.skipToEnd(); - returnType = MODTAG; - } else if (ch == "*" && col == 6) { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "\"" || ch == "\'") { - state.mode = "string"; - returnType = STRING; - } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { - returnType = ATOM; - } else if (ch == ".") { - returnType = PERIOD; - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else { - if (stream.current().match(tests.symbol)) { - while (col < 71) { - if (stream.eat(tests.symbol) === undefined) { - break; - } else { - col++; - } - } - } - if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { - returnType = KEYWORD; - } else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) { - returnType = BUILTIN; - } else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) { - returnType = ATOM; - } else returnType = null; - } - } - return returnType; - }, - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-cobol", "cobol"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/cobol/index.html b/public/plugins/codemirror-5.17.0/mode/cobol/index.html deleted file mode 100644 index 4352419a0..000000000 --- a/public/plugins/codemirror-5.17.0/mode/cobol/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - -CodeMirror: COBOL mode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

COBOL mode

- -

Select Theme Select Font Size - - - - -

- - -
diff --git a/public/plugins/codemirror-5.17.0/mode/coffeescript/coffeescript.js b/public/plugins/codemirror-5.17.0/mode/coffeescript/coffeescript.js deleted file mode 100644 index adf2184fd..000000000 --- a/public/plugins/codemirror-5.17.0/mode/coffeescript/coffeescript.js +++ /dev/null @@ -1,355 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Link to the project's GitHub page: - * https://github.com/pickhardt/coffeescript-codemirror-mode - */ -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("coffeescript", function(conf, parserConf) { - var ERRORCLASS = "error"; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/; - var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/; - var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/; - var atProp = /^@[_A-Za-z$][_A-Za-z$0-9]*/; - - var wordOperators = wordRegexp(["and", "or", "not", - "is", "isnt", "in", - "instanceof", "typeof"]); - var indentKeywords = ["for", "while", "loop", "if", "unless", "else", - "switch", "try", "catch", "finally", "class"]; - var commonKeywords = ["break", "by", "continue", "debugger", "delete", - "do", "in", "of", "new", "return", "then", - "this", "@", "throw", "when", "until", "extends"]; - - var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); - - indentKeywords = wordRegexp(indentKeywords); - - - var stringPrefixes = /^('{3}|\"{3}|['\"])/; - var regexPrefixes = /^(\/{3}|\/)/; - var commonConstants = ["Infinity", "NaN", "undefined", "null", "true", "false", "on", "off", "yes", "no"]; - var constants = wordRegexp(commonConstants); - - // Tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - if (state.scope.align === null) state.scope.align = false; - var scopeOffset = state.scope.offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset && state.scope.type == "coffee") { - return "indent"; - } else if (lineOffset < scopeOffset) { - return "dedent"; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle docco title comment (single line) - if (stream.match("####")) { - stream.skipToEnd(); - return "comment"; - } - - // Handle multi line comments - if (stream.match("###")) { - state.tokenize = longComment; - return state.tokenize(stream, state); - } - - // Single line comment - if (ch === "#") { - stream.skipToEnd(); - return "comment"; - } - - // Handle number literals - if (stream.match(/^-?[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { - floatLiteral = true; - } - if (stream.match(/^-?\d+\.\d*/)) { - floatLiteral = true; - } - if (stream.match(/^-?\.\d+/)) { - floatLiteral = true; - } - - if (floatLiteral) { - // prevent from getting extra . on 1.. - if (stream.peek() == "."){ - stream.backUp(1); - } - return "number"; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^-?0x[0-9a-f]+/i)) { - intLiteral = true; - } - // Decimal - if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^-?0(?![\dx])/i)) { - intLiteral = true; - } - if (intLiteral) { - return "number"; - } - } - - // Handle strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenFactory(stream.current(), false, "string"); - return state.tokenize(stream, state); - } - // Handle regex literals - if (stream.match(regexPrefixes)) { - if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division - state.tokenize = tokenFactory(stream.current(), true, "string-2"); - return state.tokenize(stream, state); - } else { - stream.backUp(1); - } - } - - - - // Handle operators and delimiters - if (stream.match(operators) || stream.match(wordOperators)) { - return "operator"; - } - if (stream.match(delimiters)) { - return "punctuation"; - } - - if (stream.match(constants)) { - return "atom"; - } - - if (stream.match(atProp) || state.prop && stream.match(identifiers)) { - return "property"; - } - - if (stream.match(keywords)) { - return "keyword"; - } - - if (stream.match(identifiers)) { - return "variable"; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenFactory(delimiter, singleline, outclass) { - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\/\\]/); - if (stream.eat("\\")) { - stream.next(); - if (singleline && stream.eol()) { - return outclass; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return outclass; - } else { - stream.eat(/['"\/]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - outclass = ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return outclass; - }; - } - - function longComment(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^#]/); - if (stream.match("###")) { - state.tokenize = tokenBase; - break; - } - stream.eatWhile("#"); - } - return "comment"; - } - - function indent(stream, state, type) { - type = type || "coffee"; - var offset = 0, align = false, alignOffset = null; - for (var scope = state.scope; scope; scope = scope.prev) { - if (scope.type === "coffee" || scope.type == "}") { - offset = scope.offset + conf.indentUnit; - break; - } - } - if (type !== "coffee") { - align = null; - alignOffset = stream.column() + stream.current().length; - } else if (state.scope.align) { - state.scope.align = false; - } - state.scope = { - offset: offset, - type: type, - prev: state.scope, - align: align, - alignOffset: alignOffset - }; - } - - function dedent(stream, state) { - if (!state.scope.prev) return; - if (state.scope.type === "coffee") { - var _indent = stream.indentation(); - var matched = false; - for (var scope = state.scope; scope; scope = scope.prev) { - if (_indent === scope.offset) { - matched = true; - break; - } - } - if (!matched) { - return true; - } - while (state.scope.prev && state.scope.offset !== _indent) { - state.scope = state.scope.prev; - } - return false; - } else { - state.scope = state.scope.prev; - return false; - } - } - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle scope changes. - if (current === "return") { - state.dedent = true; - } - if (((current === "->" || current === "=>") && stream.eol()) - || style === "indent") { - indent(stream, state); - } - var delimiter_index = "[({".indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); - } - if (indentKeywords.exec(current)){ - indent(stream, state); - } - if (current == "then"){ - dedent(stream, state); - } - - - if (style === "dedent") { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = "])}".indexOf(current); - if (delimiter_index !== -1) { - while (state.scope.type == "coffee" && state.scope.prev) - state.scope = state.scope.prev; - if (state.scope.type == current) - state.scope = state.scope.prev; - } - if (state.dedent && stream.eol()) { - if (state.scope.type == "coffee" && state.scope.prev) - state.scope = state.scope.prev; - state.dedent = false; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false}, - prop: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var fillAlign = state.scope.align === null && state.scope; - if (fillAlign && stream.sol()) fillAlign.align = false; - - var style = tokenLexer(stream, state); - if (style && style != "comment") { - if (fillAlign) fillAlign.align = true; - state.prop = style == "punctuation" && stream.current() == "." - } - - return style; - }, - - indent: function(state, text) { - if (state.tokenize != tokenBase) return 0; - var scope = state.scope; - var closer = text && "])}".indexOf(text.charAt(0)) > -1; - if (closer) while (scope.type == "coffee" && scope.prev) scope = scope.prev; - var closes = closer && scope.type === text.charAt(0); - if (scope.align) - return scope.alignOffset - (closes ? 1 : 0); - else - return (closes ? scope.prev : scope).offset; - }, - - lineComment: "#", - fold: "indent" - }; - return external; -}); - -CodeMirror.defineMIME("text/x-coffeescript", "coffeescript"); -CodeMirror.defineMIME("text/coffeescript", "coffeescript"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/coffeescript/index.html b/public/plugins/codemirror-5.17.0/mode/coffeescript/index.html deleted file mode 100644 index 93a5f4f30..000000000 --- a/public/plugins/codemirror-5.17.0/mode/coffeescript/index.html +++ /dev/null @@ -1,740 +0,0 @@ - - -CodeMirror: CoffeeScript mode - - - - - - - - - -
-

CoffeeScript mode

-
- - -

MIME types defined: text/x-coffeescript.

- -

The CoffeeScript mode was written by Jeff Pickhardt.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/commonlisp/commonlisp.js b/public/plugins/codemirror-5.17.0/mode/commonlisp/commonlisp.js deleted file mode 100644 index fb1f99c63..000000000 --- a/public/plugins/codemirror-5.17.0/mode/commonlisp/commonlisp.js +++ /dev/null @@ -1,123 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("commonlisp", function (config) { - var specialForm = /^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/; - var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; - var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; - var symbol = /[^\s'`,@()\[\]";]/; - var type; - - function readSym(stream) { - var ch; - while (ch = stream.next()) { - if (ch == "\\") stream.next(); - else if (!symbol.test(ch)) { stream.backUp(1); break; } - } - return stream.current(); - } - - function base(stream, state) { - if (stream.eatSpace()) {type = "ws"; return null;} - if (stream.match(numLiteral)) return "number"; - var ch = stream.next(); - if (ch == "\\") ch = stream.next(); - - if (ch == '"') return (state.tokenize = inString)(stream, state); - else if (ch == "(") { type = "open"; return "bracket"; } - else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; } - else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; } - else if (/['`,@]/.test(ch)) return null; - else if (ch == "|") { - if (stream.skipTo("|")) { stream.next(); return "symbol"; } - else { stream.skipToEnd(); return "error"; } - } else if (ch == "#") { - var ch = stream.next(); - if (ch == "[") { type = "open"; return "bracket"; } - else if (/[+\-=\.']/.test(ch)) return null; - else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null; - else if (ch == "|") return (state.tokenize = inComment)(stream, state); - else if (ch == ":") { readSym(stream); return "meta"; } - else return "error"; - } else { - var name = readSym(stream); - if (name == ".") return null; - type = "symbol"; - if (name == "nil" || name == "t" || name.charAt(0) == ":") return "atom"; - if (state.lastType == "open" && (specialForm.test(name) || assumeBody.test(name))) return "keyword"; - if (name.charAt(0) == "&") return "variable-2"; - return "variable"; - } - } - - function inString(stream, state) { - var escaped = false, next; - while (next = stream.next()) { - if (next == '"' && !escaped) { state.tokenize = base; break; } - escaped = !escaped && next == "\\"; - } - return "string"; - } - - function inComment(stream, state) { - var next, last; - while (next = stream.next()) { - if (next == "#" && last == "|") { state.tokenize = base; break; } - last = next; - } - type = "ws"; - return "comment"; - } - - return { - startState: function () { - return {ctx: {prev: null, start: 0, indentTo: 0}, lastType: null, tokenize: base}; - }, - - token: function (stream, state) { - if (stream.sol() && typeof state.ctx.indentTo != "number") - state.ctx.indentTo = state.ctx.start + 1; - - type = null; - var style = state.tokenize(stream, state); - if (type != "ws") { - if (state.ctx.indentTo == null) { - if (type == "symbol" && assumeBody.test(stream.current())) - state.ctx.indentTo = state.ctx.start + config.indentUnit; - else - state.ctx.indentTo = "next"; - } else if (state.ctx.indentTo == "next") { - state.ctx.indentTo = stream.column(); - } - state.lastType = type; - } - if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null}; - else if (type == "close") state.ctx = state.ctx.prev || state.ctx; - return style; - }, - - indent: function (state, _textAfter) { - var i = state.ctx.indentTo; - return typeof i == "number" ? i : state.ctx.start + 1; - }, - - closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;", - blockCommentStart: "#|", - blockCommentEnd: "|#" - }; -}); - -CodeMirror.defineMIME("text/x-common-lisp", "commonlisp"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/commonlisp/index.html b/public/plugins/codemirror-5.17.0/mode/commonlisp/index.html deleted file mode 100644 index f2bf4522d..000000000 --- a/public/plugins/codemirror-5.17.0/mode/commonlisp/index.html +++ /dev/null @@ -1,177 +0,0 @@ - - -CodeMirror: Common Lisp mode - - - - - - - - - -
-

Common Lisp mode

-
- - -

MIME types defined: text/x-common-lisp.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/crystal/crystal.js b/public/plugins/codemirror-5.17.0/mode/crystal/crystal.js deleted file mode 100644 index e63627cee..000000000 --- a/public/plugins/codemirror-5.17.0/mode/crystal/crystal.js +++ /dev/null @@ -1,391 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("crystal", function(config) { - function wordRegExp(words, end) { - return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b")); - } - - function chain(tokenize, stream, state) { - state.tokenize.push(tokenize); - return tokenize(stream, state); - } - - var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/; - var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/; - var indexingOperators = /^(?:\[\][?=]?)/; - var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/; - var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/; - var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/; - var keywords = wordRegExp([ - "abstract", "alias", "as", "asm", "begin", "break", "case", "class", "def", "do", - "else", "elsif", "end", "ensure", "enum", "extend", "for", "fun", "if", "ifdef", - "include", "instance_sizeof", "lib", "macro", "module", "next", "of", "out", "pointerof", - "private", "protected", "rescue", "return", "require", "sizeof", "struct", - "super", "then", "type", "typeof", "union", "unless", "until", "when", "while", "with", - "yield", "__DIR__", "__FILE__", "__LINE__" - ]); - var atomWords = wordRegExp(["true", "false", "nil", "self"]); - var indentKeywordsArray = [ - "def", "fun", "macro", - "class", "module", "struct", "lib", "enum", "union", - "if", "unless", "case", "while", "until", "begin", "then", - "do", - "for", "ifdef" - ]; - var indentKeywords = wordRegExp(indentKeywordsArray); - var dedentKeywordsArray = [ - "end", - "else", "elsif", - "rescue", "ensure" - ]; - var dedentKeywords = wordRegExp(dedentKeywordsArray); - var dedentPunctualsArray = ["\\)", "\\}", "\\]"]; - var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$"); - var nextTokenizer = { - "def": tokenFollowIdent, "fun": tokenFollowIdent, "macro": tokenMacroDef, - "class": tokenFollowType, "module": tokenFollowType, "struct": tokenFollowType, - "lib": tokenFollowType, "enum": tokenFollowType, "union": tokenFollowType - }; - var matching = {"[": "]", "{": "}", "(": ")", "<": ">"}; - - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return null; - } - - // Macros - if (state.lastToken != "\\" && stream.match("{%", false)) { - return chain(tokenMacro("%", "%"), stream, state); - } - - if (state.lastToken != "\\" && stream.match("{{", false)) { - return chain(tokenMacro("{", "}"), stream, state); - } - - // Comments - if (stream.peek() == "#") { - stream.skipToEnd(); - return "comment"; - } - - // Variables and keywords - var matched; - if (stream.match(idents)) { - stream.eat(/[?!]/); - - matched = stream.current(); - if (stream.eat(":")) { - return "atom"; - } else if (state.lastToken == ".") { - return "property"; - } else if (keywords.test(matched)) { - if (state.lastToken != "abstract" && indentKeywords.test(matched)) { - if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0)) { - state.blocks.push(matched); - state.currentIndent += 1; - } - } else if (dedentKeywords.test(matched)) { - state.blocks.pop(); - state.currentIndent -= 1; - } - - if (nextTokenizer.hasOwnProperty(matched)) { - state.tokenize.push(nextTokenizer[matched]); - } - - return "keyword"; - } else if (atomWords.test(matched)) { - return "atom"; - } - - return "variable"; - } - - // Class variables and instance variables - // or attributes - if (stream.eat("@")) { - if (stream.peek() == "[") { - return chain(tokenNest("[", "]", "meta"), stream, state); - } - - stream.eat("@"); - stream.match(idents) || stream.match(types); - return "variable-2"; - } - - // Global variables - if (stream.eat("$")) { - stream.eat(/[0-9]+|\?/) || stream.match(idents) || stream.match(types); - return "variable-3"; - } - - // Constants and types - if (stream.match(types)) { - return "tag"; - } - - // Symbols or ':' operator - if (stream.eat(":")) { - if (stream.eat("\"")) { - return chain(tokenQuote("\"", "atom", false), stream, state); - } else if (stream.match(idents) || stream.match(types) || - stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) { - return "atom"; - } - stream.eat(":"); - return "operator"; - } - - // Strings - if (stream.eat("\"")) { - return chain(tokenQuote("\"", "string", true), stream, state); - } - - // Strings or regexps or macro variables or '%' operator - if (stream.peek() == "%") { - var style = "string"; - var embed = true; - var delim; - - if (stream.match("%r")) { - // Regexps - style = "string-2"; - delim = stream.next(); - } else if (stream.match("%w")) { - embed = false; - delim = stream.next(); - } else { - if(delim = stream.match(/^%([^\w\s=])/)) { - delim = delim[1]; - } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) { - // Macro variables - return "meta"; - } else { - // '%' operator - return "operator"; - } - } - - if (matching.hasOwnProperty(delim)) { - delim = matching[delim]; - } - return chain(tokenQuote(delim, style, embed), stream, state); - } - - // Characters - if (stream.eat("'")) { - stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/); - stream.eat("'"); - return "atom"; - } - - // Numbers - if (stream.eat("0")) { - if (stream.eat("x")) { - stream.match(/^[0-9a-fA-F]+/); - } else if (stream.eat("o")) { - stream.match(/^[0-7]+/); - } else if (stream.eat("b")) { - stream.match(/^[01]+/); - } - return "number"; - } - - if (stream.eat(/\d/)) { - stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/); - return "number"; - } - - // Operators - if (stream.match(operators)) { - stream.eat("="); // Operators can follow assign symbol. - return "operator"; - } - - if (stream.match(conditionalOperators) || stream.match(anotherOperators)) { - return "operator"; - } - - // Parens and braces - if (matched = stream.match(/[({[]/, false)) { - matched = matched[0]; - return chain(tokenNest(matched, matching[matched], null), stream, state); - } - - // Escapes - if (stream.eat("\\")) { - stream.next(); - return "meta"; - } - - stream.next(); - return null; - } - - function tokenNest(begin, end, style, started) { - return function (stream, state) { - if (!started && stream.match(begin)) { - state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true); - state.currentIndent += 1; - return style; - } - - var nextStyle = tokenBase(stream, state); - if (stream.current() === end) { - state.tokenize.pop(); - state.currentIndent -= 1; - nextStyle = style; - } - - return nextStyle; - }; - } - - function tokenMacro(begin, end, started) { - return function (stream, state) { - if (!started && stream.match("{" + begin)) { - state.currentIndent += 1; - state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true); - return "meta"; - } - - if (stream.match(end + "}")) { - state.currentIndent -= 1; - state.tokenize.pop(); - return "meta"; - } - - return tokenBase(stream, state); - }; - } - - function tokenMacroDef(stream, state) { - if (stream.eatSpace()) { - return null; - } - - var matched; - if (matched = stream.match(idents)) { - if (matched == "def") { - return "keyword"; - } - stream.eat(/[?!]/); - } - - state.tokenize.pop(); - return "def"; - } - - function tokenFollowIdent(stream, state) { - if (stream.eatSpace()) { - return null; - } - - if (stream.match(idents)) { - stream.eat(/[!?]/); - } else { - stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators); - } - state.tokenize.pop(); - return "def"; - } - - function tokenFollowType(stream, state) { - if (stream.eatSpace()) { - return null; - } - - stream.match(types); - state.tokenize.pop(); - return "def"; - } - - function tokenQuote(end, style, embed) { - return function (stream, state) { - var escaped = false; - - while (stream.peek()) { - if (!escaped) { - if (stream.match("{%", false)) { - state.tokenize.push(tokenMacro("%", "%")); - return style; - } - - if (stream.match("{{", false)) { - state.tokenize.push(tokenMacro("{", "}")); - return style; - } - - if (embed && stream.match("#{", false)) { - state.tokenize.push(tokenNest("#{", "}", "meta")); - return style; - } - - var ch = stream.next(); - - if (ch == end) { - state.tokenize.pop(); - return style; - } - - escaped = ch == "\\"; - } else { - stream.next(); - escaped = false; - } - } - - return style; - }; - } - - return { - startState: function () { - return { - tokenize: [tokenBase], - currentIndent: 0, - lastToken: null, - blocks: [] - }; - }, - - token: function (stream, state) { - var style = state.tokenize[state.tokenize.length - 1](stream, state); - var token = stream.current(); - - if (style && style != "comment") { - state.lastToken = token; - } - - return style; - }, - - indent: function (state, textAfter) { - textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, ""); - - if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) { - return config.indentUnit * (state.currentIndent - 1); - } - - return config.indentUnit * state.currentIndent; - }, - - fold: "indent", - electricInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true), - lineComment: '#' - }; - }); - - CodeMirror.defineMIME("text/x-crystal", "crystal"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/crystal/index.html b/public/plugins/codemirror-5.17.0/mode/crystal/index.html deleted file mode 100644 index ec03e2509..000000000 --- a/public/plugins/codemirror-5.17.0/mode/crystal/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - -CodeMirror: Crystal mode - - - - - - - - - - - -
-

Crystal mode

-
- - -

MIME types defined: text/x-crystal.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/css/css.js b/public/plugins/codemirror-5.17.0/mode/css/css.js deleted file mode 100644 index ea7bd01d8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/css.js +++ /dev/null @@ -1,825 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("css", function(config, parserConfig) { - var inline = parserConfig.inline - if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); - - var indentUnit = config.indentUnit, - tokenHooks = parserConfig.tokenHooks, - documentTypes = parserConfig.documentTypes || {}, - mediaTypes = parserConfig.mediaTypes || {}, - mediaFeatures = parserConfig.mediaFeatures || {}, - mediaValueKeywords = parserConfig.mediaValueKeywords || {}, - propertyKeywords = parserConfig.propertyKeywords || {}, - nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, - fontProperties = parserConfig.fontProperties || {}, - counterDescriptors = parserConfig.counterDescriptors || {}, - colorKeywords = parserConfig.colorKeywords || {}, - valueKeywords = parserConfig.valueKeywords || {}, - allowNested = parserConfig.allowNested, - supportsAtComponent = parserConfig.supportsAtComponent === true; - - var type, override; - function ret(style, tp) { type = tp; return style; } - - // Tokenizers - - function tokenBase(stream, state) { - var ch = stream.next(); - if (tokenHooks[ch]) { - var result = tokenHooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == "@") { - stream.eatWhile(/[\w\\\-]/); - return ret("def", stream.current()); - } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { - return ret(null, "compare"); - } else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (ch === "-") { - if (/[\d.]/.test(stream.peek())) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (stream.match(/^-[\w\\\-]+/)) { - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) - return ret("variable-2", "variable-definition"); - return ret("variable-2", "variable"); - } else if (stream.match(/^\w+-/)) { - return ret("meta", "meta"); - } - } else if (/[,+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { - return ret("qualifier", "qualifier"); - } else if (/[:;{}\[\]\(\)]/.test(ch)) { - return ret(null, ch); - } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) || - (ch == "d" && stream.match("omain(")) || - (ch == "r" && stream.match("egexp("))) { - stream.backUp(1); - state.tokenize = tokenParenthesized; - return ret("property", "word"); - } else if (/[\w\\\-]/.test(ch)) { - stream.eatWhile(/[\w\\\-]/); - return ret("property", "word"); - } else { - return ret(null, null); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - if (quote == ")") stream.backUp(1); - break; - } - escaped = !escaped && ch == "\\"; - } - if (ch == quote || !escaped && quote != ")") state.tokenize = null; - return ret("string", "string"); - }; - } - - function tokenParenthesized(stream, state) { - stream.next(); // Must be '(' - if (!stream.match(/\s*[\"\')]/, false)) - state.tokenize = tokenString(")"); - else - state.tokenize = null; - return ret(null, "("); - } - - // Context management - - function Context(type, indent, prev) { - this.type = type; - this.indent = indent; - this.prev = prev; - } - - function pushContext(state, stream, type, indent) { - state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context); - return type; - } - - function popContext(state) { - if (state.context.prev) - state.context = state.context.prev; - return state.context.type; - } - - function pass(type, stream, state) { - return states[state.context.type](type, stream, state); - } - function popAndPass(type, stream, state, n) { - for (var i = n || 1; i > 0; i--) - state.context = state.context.prev; - return pass(type, stream, state); - } - - // Parser - - function wordAsValue(stream) { - var word = stream.current().toLowerCase(); - if (valueKeywords.hasOwnProperty(word)) - override = "atom"; - else if (colorKeywords.hasOwnProperty(word)) - override = "keyword"; - else - override = "variable"; - } - - var states = {}; - - states.top = function(type, stream, state) { - if (type == "{") { - return pushContext(state, stream, "block"); - } else if (type == "}" && state.context.prev) { - return popContext(state); - } else if (supportsAtComponent && /@component/.test(type)) { - return pushContext(state, stream, "atComponentBlock"); - } else if (/^@(-moz-)?document$/.test(type)) { - return pushContext(state, stream, "documentTypes"); - } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) { - return pushContext(state, stream, "atBlock"); - } else if (/^@(font-face|counter-style)/.test(type)) { - state.stateArg = type; - return "restricted_atBlock_before"; - } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { - return "keyframes"; - } else if (type && type.charAt(0) == "@") { - return pushContext(state, stream, "at"); - } else if (type == "hash") { - override = "builtin"; - } else if (type == "word") { - override = "tag"; - } else if (type == "variable-definition") { - return "maybeprop"; - } else if (type == "interpolation") { - return pushContext(state, stream, "interpolation"); - } else if (type == ":") { - return "pseudo"; - } else if (allowNested && type == "(") { - return pushContext(state, stream, "parens"); - } - return state.context.type; - }; - - states.block = function(type, stream, state) { - if (type == "word") { - var word = stream.current().toLowerCase(); - if (propertyKeywords.hasOwnProperty(word)) { - override = "property"; - return "maybeprop"; - } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { - override = "string-2"; - return "maybeprop"; - } else if (allowNested) { - override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; - return "block"; - } else { - override += " error"; - return "maybeprop"; - } - } else if (type == "meta") { - return "block"; - } else if (!allowNested && (type == "hash" || type == "qualifier")) { - override = "error"; - return "block"; - } else { - return states.top(type, stream, state); - } - }; - - states.maybeprop = function(type, stream, state) { - if (type == ":") return pushContext(state, stream, "prop"); - return pass(type, stream, state); - }; - - states.prop = function(type, stream, state) { - if (type == ";") return popContext(state); - if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); - if (type == "}" || type == "{") return popAndPass(type, stream, state); - if (type == "(") return pushContext(state, stream, "parens"); - - if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) { - override += " error"; - } else if (type == "word") { - wordAsValue(stream); - } else if (type == "interpolation") { - return pushContext(state, stream, "interpolation"); - } - return "prop"; - }; - - states.propBlock = function(type, _stream, state) { - if (type == "}") return popContext(state); - if (type == "word") { override = "property"; return "maybeprop"; } - return state.context.type; - }; - - states.parens = function(type, stream, state) { - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == ")") return popContext(state); - if (type == "(") return pushContext(state, stream, "parens"); - if (type == "interpolation") return pushContext(state, stream, "interpolation"); - if (type == "word") wordAsValue(stream); - return "parens"; - }; - - states.pseudo = function(type, stream, state) { - if (type == "word") { - override = "variable-3"; - return state.context.type; - } - return pass(type, stream, state); - }; - - states.documentTypes = function(type, stream, state) { - if (type == "word" && documentTypes.hasOwnProperty(stream.current())) { - override = "tag"; - return state.context.type; - } else { - return states.atBlock(type, stream, state); - } - }; - - states.atBlock = function(type, stream, state) { - if (type == "(") return pushContext(state, stream, "atBlock_parens"); - if (type == "}" || type == ";") return popAndPass(type, stream, state); - if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); - - if (type == "interpolation") return pushContext(state, stream, "interpolation"); - - if (type == "word") { - var word = stream.current().toLowerCase(); - if (word == "only" || word == "not" || word == "and" || word == "or") - override = "keyword"; - else if (mediaTypes.hasOwnProperty(word)) - override = "attribute"; - else if (mediaFeatures.hasOwnProperty(word)) - override = "property"; - else if (mediaValueKeywords.hasOwnProperty(word)) - override = "keyword"; - else if (propertyKeywords.hasOwnProperty(word)) - override = "property"; - else if (nonStandardPropertyKeywords.hasOwnProperty(word)) - override = "string-2"; - else if (valueKeywords.hasOwnProperty(word)) - override = "atom"; - else if (colorKeywords.hasOwnProperty(word)) - override = "keyword"; - else - override = "error"; - } - return state.context.type; - }; - - states.atComponentBlock = function(type, stream, state) { - if (type == "}") - return popAndPass(type, stream, state); - if (type == "{") - return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false); - if (type == "word") - override = "error"; - return state.context.type; - }; - - states.atBlock_parens = function(type, stream, state) { - if (type == ")") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); - return states.atBlock(type, stream, state); - }; - - states.restricted_atBlock_before = function(type, stream, state) { - if (type == "{") - return pushContext(state, stream, "restricted_atBlock"); - if (type == "word" && state.stateArg == "@counter-style") { - override = "variable"; - return "restricted_atBlock_before"; - } - return pass(type, stream, state); - }; - - states.restricted_atBlock = function(type, stream, state) { - if (type == "}") { - state.stateArg = null; - return popContext(state); - } - if (type == "word") { - if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || - (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) - override = "error"; - else - override = "property"; - return "maybeprop"; - } - return "restricted_atBlock"; - }; - - states.keyframes = function(type, stream, state) { - if (type == "word") { override = "variable"; return "keyframes"; } - if (type == "{") return pushContext(state, stream, "top"); - return pass(type, stream, state); - }; - - states.at = function(type, stream, state) { - if (type == ";") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == "word") override = "tag"; - else if (type == "hash") override = "builtin"; - return "at"; - }; - - states.interpolation = function(type, stream, state) { - if (type == "}") return popContext(state); - if (type == "{" || type == ";") return popAndPass(type, stream, state); - if (type == "word") override = "variable"; - else if (type != "variable" && type != "(" && type != ")") override = "error"; - return "interpolation"; - }; - - return { - startState: function(base) { - return {tokenize: null, - state: inline ? "block" : "top", - stateArg: null, - context: new Context(inline ? "block" : "top", base || 0, null)}; - }, - - token: function(stream, state) { - if (!state.tokenize && stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style && typeof style == "object") { - type = style[1]; - style = style[0]; - } - override = style; - state.state = states[state.state](type, stream, state); - return override; - }, - - indent: function(state, textAfter) { - var cx = state.context, ch = textAfter && textAfter.charAt(0); - var indent = cx.indent; - if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; - if (cx.prev) { - if (ch == "}" && (cx.type == "block" || cx.type == "top" || - cx.type == "interpolation" || cx.type == "restricted_atBlock")) { - // Resume indentation from parent context. - cx = cx.prev; - indent = cx.indent; - } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || - ch == "{" && (cx.type == "at" || cx.type == "atBlock")) { - // Dedent relative to current context. - indent = Math.max(0, cx.indent - indentUnit); - cx = cx.prev; - } - } - return indent; - }, - - electricChars: "}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - fold: "brace" - }; -}); - - function keySet(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) { - keys[array[i]] = true; - } - return keys; - } - - var documentTypes_ = [ - "domain", "regexp", "url", "url-prefix" - ], documentTypes = keySet(documentTypes_); - - var mediaTypes_ = [ - "all", "aural", "braille", "handheld", "print", "projection", "screen", - "tty", "tv", "embossed" - ], mediaTypes = keySet(mediaTypes_); - - var mediaFeatures_ = [ - "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" - ], mediaFeatures = keySet(mediaFeatures_); - - var mediaValueKeywords_ = [ - "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", - "interlace", "progressive" - ], mediaValueKeywords = keySet(mediaValueKeywords_); - - var propertyKeywords_ = [ - "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", "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", "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", - "marker-offset", "marks", "marquee-direction", "marquee-loop", - "marquee-play-count", "marquee-speed", "marquee-style", "max-height", - "max-width", "min-height", "min-width", "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", "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", - "vertical-align", "visibility", "voice-balance", "voice-duration", - "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", - "voice-volume", "volume", "white-space", "widows", "width", "word-break", - "word-spacing", "word-wrap", "z-index", - // SVG-specific - "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" - ], propertyKeywords = keySet(propertyKeywords_); - - var nonStandardPropertyKeywords_ = [ - "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" - ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); - - var fontProperties_ = [ - "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", - "font-stretch", "font-weight", "font-style" - ], fontProperties = keySet(fontProperties_); - - var counterDescriptors_ = [ - "additive-symbols", "fallback", "negative", "pad", "prefix", "range", - "speak-as", "suffix", "symbols", "system" - ], counterDescriptors = keySet(counterDescriptors_); - - var colorKeywords_ = [ - "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" - ], colorKeywords = keySet(colorKeywords_); - - var valueKeywords_ = [ - "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", "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", - "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", "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", "se-resize", "searchfield", - "searchfield-cancel-button", "searchfield-decoration", - "searchfield-results-button", "searchfield-results-decoration", - "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", "spell-out", "square", - "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", - "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "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", - "translate", "translate3d", "translateX", "translateY", "translateZ", - "transparent", "ultra-condensed", "ultra-expanded", "underline", "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" - ], valueKeywords = keySet(valueKeywords_); - - var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_) - .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_) - .concat(valueKeywords_); - CodeMirror.registerHelper("hintWords", "css", allWords); - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return ["comment", "comment"]; - } - - CodeMirror.defineMIME("text/css", { - documentTypes: documentTypes, - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - mediaValueKeywords: mediaValueKeywords, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - fontProperties: fontProperties, - counterDescriptors: counterDescriptors, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - tokenHooks: { - "/": function(stream, state) { - if (!stream.eat("*")) return false; - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - }, - name: "css" - }); - - CodeMirror.defineMIME("text/x-scss", { - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - mediaValueKeywords: mediaValueKeywords, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - fontProperties: fontProperties, - allowNested: true, - tokenHooks: { - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - ":": function(stream) { - if (stream.match(/\s*\{/)) - return [null, "{"]; - return false; - }, - "$": function(stream) { - stream.match(/^[\w-]+/); - if (stream.match(/^\s*:/, false)) - return ["variable-2", "variable-definition"]; - return ["variable-2", "variable"]; - }, - "#": function(stream) { - if (!stream.eat("{")) return false; - return [null, "interpolation"]; - } - }, - name: "css", - helperType: "scss" - }); - - CodeMirror.defineMIME("text/x-less", { - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - mediaValueKeywords: mediaValueKeywords, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - fontProperties: fontProperties, - allowNested: true, - tokenHooks: { - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - "@": function(stream) { - if (stream.eat("{")) return [null, "interpolation"]; - if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) - return ["variable-2", "variable-definition"]; - return ["variable-2", "variable"]; - }, - "&": function() { - return ["atom", "atom"]; - } - }, - name: "css", - helperType: "less" - }); - - CodeMirror.defineMIME("text/x-gss", { - documentTypes: documentTypes, - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - fontProperties: fontProperties, - counterDescriptors: counterDescriptors, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - supportsAtComponent: true, - tokenHooks: { - "/": function(stream, state) { - if (!stream.eat("*")) return false; - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - }, - name: "css", - helperType: "gss" - }); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/css/gss.html b/public/plugins/codemirror-5.17.0/mode/css/gss.html deleted file mode 100644 index 232fe8c12..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/gss.html +++ /dev/null @@ -1,103 +0,0 @@ - - -CodeMirror: Closure Stylesheets (GSS) mode - - - - - - - - - - - - -
-

Closure Stylesheets (GSS) mode

-
- - -

A mode for Closure Stylesheets (GSS).

-

MIME type defined: text/x-gss.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/css/gss_test.js b/public/plugins/codemirror-5.17.0/mode/css/gss_test.js deleted file mode 100644 index d56e59280..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/gss_test.js +++ /dev/null @@ -1,17 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - "use strict"; - - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } - - MT("atComponent", - "[def @component] {", - "[tag foo] {", - " [property color]: [keyword black];", - "}", - "}"); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/css/index.html b/public/plugins/codemirror-5.17.0/mode/css/index.html deleted file mode 100644 index 2d2b9b073..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: CSS mode - - - - - - - - - - - - -
-

CSS mode

-
- - -

MIME types defined: text/css, text/x-scss (demo), text/x-less (demo).

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/css/less.html b/public/plugins/codemirror-5.17.0/mode/css/less.html deleted file mode 100644 index adf7427d3..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/less.html +++ /dev/null @@ -1,152 +0,0 @@ - - -CodeMirror: LESS mode - - - - - - - - - - -
-

LESS mode

-
- - -

The LESS mode is a sub-mode of the CSS mode (defined in css.js).

- -

Parsing/Highlighting Tests: normal, verbose.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/css/less_test.js b/public/plugins/codemirror-5.17.0/mode/css/less_test.js deleted file mode 100644 index dd821558b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/less_test.js +++ /dev/null @@ -1,54 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - "use strict"; - - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } - - MT("variable", - "[variable-2 @base]: [atom #f04615];", - "[qualifier .class] {", - " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", - " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", - "}"); - - MT("amp", - "[qualifier .child], [qualifier .sibling] {", - " [qualifier .parent] [atom &] {", - " [property color]: [keyword black];", - " }", - " [atom &] + [atom &] {", - " [property color]: [keyword red];", - " }", - "}"); - - MT("mixin", - "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", - " [property color]: [atom darken]([variable-2 @color], [number 10%]);", - "}", - "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", - " [property color]: [atom lighten]([variable-2 @color], [number 10%]);", - "}", - "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", - " [property display]: [atom block];", - "}", - "[variable-2 @switch]: [variable light];", - "[qualifier .class] {", - " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", - "}"); - - MT("nest", - "[qualifier .one] {", - " [def @media] ([property width]: [number 400px]) {", - " [property font-size]: [number 1.2em];", - " [def @media] [attribute print] [keyword and] [property color] {", - " [property color]: [keyword blue];", - " }", - " }", - "}"); - - - MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/css/scss.html b/public/plugins/codemirror-5.17.0/mode/css/scss.html deleted file mode 100644 index f8e4d3736..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/scss.html +++ /dev/null @@ -1,157 +0,0 @@ - - -CodeMirror: SCSS mode - - - - - - - - - -
-

SCSS mode

-
- - -

The SCSS mode is a sub-mode of the CSS mode (defined in css.js).

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/css/scss_test.js b/public/plugins/codemirror-5.17.0/mode/css/scss_test.js deleted file mode 100644 index 785921b39..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/scss_test.js +++ /dev/null @@ -1,110 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } - - MT('url_with_quotation', - "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); - - MT('url_with_double_quotes', - "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); - - MT('url_with_single_quotes', - "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); - - MT('string', - "[def @import] [string \"compass/css3\"]"); - - MT('important_keyword', - "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); - - MT('variable', - "[variable-2 $blue]:[atom #333]"); - - MT('variable_as_attribute', - "[tag foo] { [property color]:[variable-2 $blue] }"); - - MT('numbers', - "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); - - MT('number_percentage', - "[tag foo] { [property width]:[number 80%] }"); - - MT('selector', - "[builtin #hello][qualifier .world]{}"); - - MT('singleline_comment', - "[comment // this is a comment]"); - - MT('multiline_comment', - "[comment /*foobar*/]"); - - MT('attribute_with_hyphen', - "[tag foo] { [property font-size]:[number 10px] }"); - - MT('string_after_attribute', - "[tag foo] { [property content]:[string \"::\"] }"); - - MT('directives', - "[def @include] [qualifier .mixin]"); - - MT('basic_structure', - "[tag p] { [property background]:[keyword red]; }"); - - MT('nested_structure', - "[tag p] { [tag a] { [property color]:[keyword red]; } }"); - - MT('mixin', - "[def @mixin] [tag table-base] {}"); - - MT('number_without_semicolon', - "[tag p] {[property width]:[number 12]}", - "[tag a] {[property color]:[keyword red];}"); - - MT('atom_in_nested_block', - "[tag p] { [tag a] { [property color]:[atom #000]; } }"); - - MT('interpolation_in_property', - "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); - - MT('interpolation_in_selector', - "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); - - MT('interpolation_error', - "[tag foo]#{[variable foo]} { [property color]:[atom #000]; }"); - - MT("divide_operator", - "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); - - MT('nested_structure_with_id_selector', - "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); - - MT('indent_mixin', - "[def @mixin] [tag container] (", - " [variable-2 $a]: [number 10],", - " [variable-2 $b]: [number 10])", - "{}"); - - MT('indent_nested', - "[tag foo] {", - " [tag bar] {", - " }", - "}"); - - MT('indent_parentheses', - "[tag foo] {", - " [property color]: [atom darken]([variable-2 $blue],", - " [number 9%]);", - "}"); - - MT('indent_vardef', - "[variable-2 $name]:", - " [string 'val'];", - "[tag tag] {", - " [tag inner] {", - " [property margin]: [number 3px];", - " }", - "}"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/css/test.js b/public/plugins/codemirror-5.17.0/mode/css/test.js deleted file mode 100644 index 7a496fb09..000000000 --- a/public/plugins/codemirror-5.17.0/mode/css/test.js +++ /dev/null @@ -1,200 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "css"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Error, because "foobarhello" is neither a known type or property, but - // property was expected (after "and"), and it should be in parentheses. - MT("atMediaUnknownType", - "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); - - // Soft error, because "foobarhello" is not a known property or type. - MT("atMediaUnknownProperty", - "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); - - // Make sure nesting works with media queries - MT("atMediaMaxWidthNested", - "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); - - MT("atMediaFeatureValueKeyword", - "[def @media] ([property orientation]: [keyword landscape]) { }"); - - MT("atMediaUnknownFeatureValueKeyword", - "[def @media] ([property orientation]: [error upsidedown]) { }"); - - MT("tagSelector", - "[tag foo] { }"); - - MT("classSelector", - "[qualifier .foo-bar_hello] { }"); - - MT("idSelector", - "[builtin #foo] { [error #foo] }"); - - MT("tagSelectorUnclosed", - "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); - - MT("tagStringNoQuotes", - "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); - - MT("tagStringDouble", - "[tag foo] { [property font-family]: [string \"hello world\"]; }"); - - MT("tagStringSingle", - "[tag foo] { [property font-family]: [string 'hello world']; }"); - - MT("tagColorKeyword", - "[tag foo] {", - " [property color]: [keyword black];", - " [property color]: [keyword navy];", - " [property color]: [keyword yellow];", - "}"); - - MT("tagColorHex3", - "[tag foo] { [property background]: [atom #fff]; }"); - - MT("tagColorHex4", - "[tag foo] { [property background]: [atom #ffff]; }"); - - MT("tagColorHex6", - "[tag foo] { [property background]: [atom #ffffff]; }"); - - MT("tagColorHex8", - "[tag foo] { [property background]: [atom #ffffffff]; }"); - - MT("tagColorHex5Invalid", - "[tag foo] { [property background]: [atom&error #fffff]; }"); - - MT("tagColorHexInvalid", - "[tag foo] { [property background]: [atom&error #ffg]; }"); - - MT("tagNegativeNumber", - "[tag foo] { [property margin]: [number -5px]; }"); - - MT("tagPositiveNumber", - "[tag foo] { [property padding]: [number 5px]; }"); - - MT("tagVendor", - "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); - - MT("tagBogusProperty", - "[tag foo] { [property&error barhelloworld]: [number 0]; }"); - - MT("tagTwoProperties", - "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); - - MT("tagTwoPropertiesURL", - "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); - - MT("indent_tagSelector", - "[tag strong], [tag em] {", - " [property background]: [atom rgba](", - " [number 255], [number 255], [number 0], [number .2]", - " );", - "}"); - - MT("indent_atMedia", - "[def @media] {", - " [tag foo] {", - " [property color]:", - " [keyword yellow];", - " }", - "}"); - - MT("indent_comma", - "[tag foo] {", - " [property font-family]: [variable verdana],", - " [atom sans-serif];", - "}"); - - MT("indent_parentheses", - "[tag foo]:[variable-3 before] {", - " [property background]: [atom url](", - "[string blahblah]", - "[string etc]", - "[string ]) [keyword !important];", - "}"); - - MT("font_face", - "[def @font-face] {", - " [property font-family]: [string 'myfont'];", - " [error nonsense]: [string 'abc'];", - " [property src]: [atom url]([string http://blah]),", - " [atom url]([string http://foo]);", - "}"); - - MT("empty_url", - "[def @import] [atom url]() [attribute screen];"); - - MT("parens", - "[qualifier .foo] {", - " [property background-image]: [variable fade]([atom #000], [number 20%]);", - " [property border-image]: [atom linear-gradient](", - " [atom to] [atom bottom],", - " [variable fade]([atom #000], [number 20%]) [number 0%],", - " [variable fade]([atom #000], [number 20%]) [number 100%]", - " );", - "}"); - - MT("css_variable", - ":[variable-3 root] {", - " [variable-2 --main-color]: [atom #06c];", - "}", - "[tag h1][builtin #foo] {", - " [property color]: [atom var]([variable-2 --main-color]);", - "}"); - - MT("supports", - "[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {", - " [property text-align-last]: [atom justify];", - "}"); - - MT("document", - "[def @document] [tag url]([string http://blah]),", - " [tag url-prefix]([string https://]),", - " [tag domain]([string blah.com]),", - " [tag regexp]([string \".*blah.+\"]) {", - " [builtin #id] {", - " [property background-color]: [keyword white];", - " }", - " [tag foo] {", - " [property font-family]: [variable Verdana], [atom sans-serif];", - " }", - "}"); - - MT("document_url", - "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); - - MT("document_urlPrefix", - "[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"); - - MT("document_domain", - "[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"); - - MT("document_regexp", - "[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }"); - - MT("counter-style", - "[def @counter-style] [variable binary] {", - " [property system]: [atom numeric];", - " [property symbols]: [number 0] [number 1];", - " [property suffix]: [string \".\"];", - " [property range]: [atom infinite];", - " [property speak-as]: [atom numeric];", - "}"); - - MT("counter-style-additive-symbols", - "[def @counter-style] [variable simple-roman] {", - " [property system]: [atom additive];", - " [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];", - " [property range]: [number 1] [number 49];", - "}"); - - MT("counter-style-use", - "[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"); - - MT("counter-style-symbols", - "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/cypher/cypher.js b/public/plugins/codemirror-5.17.0/mode/cypher/cypher.js deleted file mode 100644 index 107e4f6d2..000000000 --- a/public/plugins/codemirror-5.17.0/mode/cypher/cypher.js +++ /dev/null @@ -1,146 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// By the Neo4j Team and contributors. -// https://github.com/neo4j-contrib/CodeMirror - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var wordRegexp = function(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - }; - - CodeMirror.defineMode("cypher", function(config) { - var tokenBase = function(stream/*, state*/) { - var ch = stream.next(); - if (ch === "\"" || ch === "'") { - stream.match(/.+?["']/); - return "string"; - } - if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return "node"; - } else if (ch === "/" && stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (funcs.test(word)) return "builtin"; - if (preds.test(word)) return "def"; - if (keywords.test(word)) return "keyword"; - return "variable"; - } - }; - var pushContext = function(state, type, col) { - return state.context = { - prev: state.context, - indent: state.indent, - col: col, - type: type - }; - }; - var popContext = function(state) { - state.indent = state.context.indent; - return state.context = state.context.prev; - }; - var indentUnit = config.indentUnit; - var curPunc; - var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]); - var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]); - var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); - var operatorChars = /[*+\-<>=&|~%^]/; - - return { - startState: function(/*base*/) { - return { - tokenize: tokenBase, - context: null, - indent: 0, - col: 0 - }; - }, - token: function(stream, state) { - if (stream.sol()) { - if (state.context && (state.context.align == null)) { - state.context.align = false; - } - state.indent = stream.indentation(); - } - if (stream.eatSpace()) { - return null; - } - var style = state.tokenize(stream, state); - if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") { - state.context.align = true; - } - if (curPunc === "(") { - pushContext(state, ")", stream.column()); - } else if (curPunc === "[") { - pushContext(state, "]", stream.column()); - } else if (curPunc === "{") { - pushContext(state, "}", stream.column()); - } else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type === "pattern") { - popContext(state); - } - if (state.context && curPunc === state.context.type) { - popContext(state); - } - } else if (curPunc === "." && state.context && state.context.type === "pattern") { - popContext(state); - } else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) { - pushContext(state, "pattern", stream.column()); - } else if (state.context.type === "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - return style; - }, - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) { - while (context && context.type === "pattern") { - context = context.prev; - } - } - var closing = context && firstChar === context.type; - if (!context) return 0; - if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent; - if (context.align) return context.col + (closing ? 0 : 1); - return context.indent + (closing ? 0 : indentUnit); - } - }; - }); - - CodeMirror.modeExtensions["cypher"] = { - autoFormatLineBreaks: function(text) { - var i, lines, reProcessedPortion; - var lines = text.split("\n"); - var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g; - for (var i = 0; i < lines.length; i++) - lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim(); - return lines.join("\n"); - } - }; - - CodeMirror.defineMIME("application/x-cypher-query", "cypher"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/cypher/index.html b/public/plugins/codemirror-5.17.0/mode/cypher/index.html deleted file mode 100644 index b8bd75c8b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/cypher/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - -CodeMirror: Cypher Mode for CodeMirror - - - - - - - - - - -
-

Cypher Mode for CodeMirror

-
- - -

MIME types defined: - application/x-cypher-query -

- - -
diff --git a/public/plugins/codemirror-5.17.0/mode/d/d.js b/public/plugins/codemirror-5.17.0/mode/d/d.js deleted file mode 100644 index c927a7e35..000000000 --- a/public/plugins/codemirror-5.17.0/mode/d/d.js +++ /dev/null @@ -1,218 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("d", function(config, parserConfig) { - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - keywords = parserConfig.keywords || {}, - builtin = parserConfig.builtin || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'" || ch == "`") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("+")) { - state.tokenize = tokenComment; - return tokenNestedComment(stream, state); - } - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "builtin"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenNestedComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "+"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && state.context.type == "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " + - "out scope struct switch try union unittest version while with"; - - CodeMirror.defineMIME("text/x-d", { - name: "d", - keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " + - "debug default delegate delete deprecated export extern final finally function goto immutable " + - "import inout invariant is lazy macro module new nothrow override package pragma private " + - "protected public pure ref return shared short static super synchronized template this " + - "throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " + - blockKeywords), - blockKeywords: words(blockKeywords), - builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " + - "ucent uint ulong ushort wchar wstring void size_t sizediff_t"), - atoms: words("exit failure success true false null"), - hooks: { - "@": function(stream, _state) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/d/index.html b/public/plugins/codemirror-5.17.0/mode/d/index.html deleted file mode 100644 index 08cabd8a2..000000000 --- a/public/plugins/codemirror-5.17.0/mode/d/index.html +++ /dev/null @@ -1,273 +0,0 @@ - - -CodeMirror: D mode - - - - - - - - - - -
-

D mode

-
- - - -

Simple mode that handle D-Syntax (DLang Homepage).

- -

MIME types defined: text/x-d - .

-
diff --git a/public/plugins/codemirror-5.17.0/mode/dart/dart.js b/public/plugins/codemirror-5.17.0/mode/dart/dart.js deleted file mode 100644 index 8d383a95e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dart/dart.js +++ /dev/null @@ -1,157 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../clike/clike")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../clike/clike"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var keywords = ("this super static final const abstract class extends external factory " + - "implements get native operator set typedef with enum throw rethrow " + - "assert break case continue default in return new deferred async await " + - "try catch finally do else for if switch while import library export " + - "part of show hide is as").split(" "); - var blockKeywords = "try catch finally do else for if switch while".split(" "); - var atoms = "true false null".split(" "); - var builtins = "void bool num int double dynamic var String".split(" "); - - function set(words) { - var obj = {}; - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - function pushInterpolationStack(state) { - (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize); - } - - function popInterpolationStack(state) { - return (state.interpolationStack || (state.interpolationStack = [])).pop(); - } - - function sizeInterpolationStack(state) { - return state.interpolationStack ? state.interpolationStack.length : 0; - } - - CodeMirror.defineMIME("application/dart", { - name: "clike", - keywords: set(keywords), - blockKeywords: set(blockKeywords), - builtin: set(builtins), - atoms: set(atoms), - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_\.]/); - return "meta"; - }, - - // custom string handling to deal with triple-quoted strings and string interpolation - "'": function(stream, state) { - return tokenString("'", stream, state, false); - }, - "\"": function(stream, state) { - return tokenString("\"", stream, state, false); - }, - "r": function(stream, state) { - var peek = stream.peek(); - if (peek == "'" || peek == "\"") { - return tokenString(stream.next(), stream, state, true); - } - return false; - }, - - "}": function(_stream, state) { - // "}" is end of interpolation, if interpolation stack is non-empty - if (sizeInterpolationStack(state) > 0) { - state.tokenize = popInterpolationStack(state); - return null; - } - return false; - }, - - "/": function(stream, state) { - if (!stream.eat("*")) return false - state.tokenize = tokenNestedComment(1) - return state.tokenize(stream, state) - } - } - }); - - function tokenString(quote, stream, state, raw) { - var tripleQuoted = false; - if (stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; //empty string - } - function tokenStringHelper(stream, state) { - var escaped = false; - while (!stream.eol()) { - if (!raw && !escaped && stream.peek() == "$") { - pushInterpolationStack(state); - state.tokenize = tokenInterpolation; - return "string"; - } - var next = stream.next(); - if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) { - state.tokenize = null; - break; - } - escaped = !raw && !escaped && next == "\\"; - } - return "string"; - } - state.tokenize = tokenStringHelper; - return tokenStringHelper(stream, state); - } - - function tokenInterpolation(stream, state) { - stream.eat("$"); - if (stream.eat("{")) { - // let clike handle the content of ${...}, - // we take over again when "}" appears (see hooks). - state.tokenize = null; - } else { - state.tokenize = tokenInterpolationIdentifier; - } - return null; - } - - function tokenInterpolationIdentifier(stream, state) { - stream.eatWhile(/[\w_]/); - state.tokenize = popInterpolationStack(state); - return "variable"; - } - - function tokenNestedComment(depth) { - return function (stream, state) { - var ch - while (ch = stream.next()) { - if (ch == "*" && stream.eat("/")) { - if (depth == 1) { - state.tokenize = null - break - } else { - state.tokenize = tokenNestedComment(depth - 1) - return state.tokenize(stream, state) - } - } else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenNestedComment(depth + 1) - return state.tokenize(stream, state) - } - } - return "comment" - } - } - - CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); - - // This is needed to make loading through meta.js work. - CodeMirror.defineMode("dart", function(conf) { - return CodeMirror.getMode(conf, "application/dart"); - }, "clike"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/dart/index.html b/public/plugins/codemirror-5.17.0/mode/dart/index.html deleted file mode 100644 index e79da5a8b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dart/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - -CodeMirror: Dart mode - - - - - - - - - -
-

Dart mode

-
- - - - - -
diff --git a/public/plugins/codemirror-5.17.0/mode/diff/diff.js b/public/plugins/codemirror-5.17.0/mode/diff/diff.js deleted file mode 100644 index fe0305e7b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/diff/diff.js +++ /dev/null @@ -1,47 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("diff", function() { - - var TOKEN_NAMES = { - '+': 'positive', - '-': 'negative', - '@': 'meta' - }; - - return { - token: function(stream) { - var tw_pos = stream.string.search(/[\t ]+?$/); - - if (!stream.sol() || tw_pos === 0) { - stream.skipToEnd(); - return ("error " + ( - TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); - } - - var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); - - if (tw_pos === -1) { - stream.skipToEnd(); - } else { - stream.pos = tw_pos; - } - - return token_name; - } - }; -}); - -CodeMirror.defineMIME("text/x-diff", "diff"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/diff/index.html b/public/plugins/codemirror-5.17.0/mode/diff/index.html deleted file mode 100644 index 0af611fa4..000000000 --- a/public/plugins/codemirror-5.17.0/mode/diff/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - -CodeMirror: Diff mode - - - - - - - - - -
-

Diff mode

-
- - -

MIME types defined: text/x-diff.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/django/django.js b/public/plugins/codemirror-5.17.0/mode/django/django.js deleted file mode 100644 index 7b4ef3b56..000000000 --- a/public/plugins/codemirror-5.17.0/mode/django/django.js +++ /dev/null @@ -1,356 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), - require("../../addon/mode/overlay")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", - "../../addon/mode/overlay"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("django:inner", function() { - var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter", - "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import", - "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal", - "endifnotequal", "extends", "include", "load", "comment", "endcomment", - "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now", - "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", - "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless", - "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"], - filters = ["add", "addslashes", "capfirst", "center", "cut", "date", - "default", "default_if_none", "dictsort", - "dictsortreversed", "divisibleby", "escape", "escapejs", - "filesizeformat", "first", "floatformat", "force_escape", - "get_digit", "iriencode", "join", "last", "length", - "length_is", "linebreaks", "linebreaksbr", "linenumbers", - "ljust", "lower", "make_list", "phone2numeric", "pluralize", - "pprint", "random", "removetags", "rjust", "safe", - "safeseq", "slice", "slugify", "stringformat", "striptags", - "time", "timesince", "timeuntil", "title", "truncatechars", - "truncatechars_html", "truncatewords", "truncatewords_html", - "unordered_list", "upper", "urlencode", "urlize", - "urlizetrunc", "wordcount", "wordwrap", "yesno"], - operators = ["==", "!=", "<", ">", "<=", ">="], - wordOperators = ["in", "not", "or", "and"]; - - keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); - filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); - operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); - wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b"); - - // We have to return "null" instead of null, in order to avoid string - // styling as the default, when using Django templates inside HTML - // element attributes - function tokenBase (stream, state) { - // Attempt to identify a variable, template or comment tag respectively - if (stream.match("{{")) { - state.tokenize = inVariable; - return "tag"; - } else if (stream.match("{%")) { - state.tokenize = inTag; - return "tag"; - } else if (stream.match("{#")) { - state.tokenize = inComment; - return "comment"; - } - - // Ignore completely any stream series that do not match the - // Django template opening tags. - while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {} - return null; - } - - // A string can be included in either single or double quotes (this is - // the delimiter). Mark everything as a string until the start delimiter - // occurs again. - function inString (delimiter, previousTokenizer) { - return function (stream, state) { - if (!state.escapeNext && stream.eat(delimiter)) { - state.tokenize = previousTokenizer; - } else { - if (state.escapeNext) { - state.escapeNext = false; - } - - var ch = stream.next(); - - // Take into account the backslash for escaping characters, such as - // the string delimiter. - if (ch == "\\") { - state.escapeNext = true; - } - } - - return "string"; - }; - } - - // Apply Django template variable syntax highlighting - function inVariable (stream, state) { - // Attempt to match a dot that precedes a property - if (state.waitDot) { - state.waitDot = false; - - if (stream.peek() != ".") { - return "null"; - } - - // Dot followed by a non-word character should be considered an error. - if (stream.match(/\.\W+/)) { - return "error"; - } else if (stream.eat(".")) { - state.waitProperty = true; - return "null"; - } else { - throw Error ("Unexpected error while waiting for property."); - } - } - - // Attempt to match a pipe that precedes a filter - if (state.waitPipe) { - state.waitPipe = false; - - if (stream.peek() != "|") { - return "null"; - } - - // Pipe followed by a non-word character should be considered an error. - if (stream.match(/\.\W+/)) { - return "error"; - } else if (stream.eat("|")) { - state.waitFilter = true; - return "null"; - } else { - throw Error ("Unexpected error while waiting for filter."); - } - } - - // Highlight properties - if (state.waitProperty) { - state.waitProperty = false; - if (stream.match(/\b(\w+)\b/)) { - state.waitDot = true; // A property can be followed by another property - state.waitPipe = true; // A property can be followed by a filter - return "property"; - } - } - - // Highlight filters - if (state.waitFilter) { - state.waitFilter = false; - if (stream.match(filters)) { - return "variable-2"; - } - } - - // Ignore all white spaces - if (stream.eatSpace()) { - state.waitProperty = false; - return "null"; - } - - // Identify numbers - if (stream.match(/\b\d+(\.\d+)?\b/)) { - return "number"; - } - - // Identify strings - if (stream.match("'")) { - state.tokenize = inString("'", state.tokenize); - return "string"; - } else if (stream.match('"')) { - state.tokenize = inString('"', state.tokenize); - return "string"; - } - - // Attempt to find the variable - if (stream.match(/\b(\w+)\b/) && !state.foundVariable) { - state.waitDot = true; - state.waitPipe = true; // A property can be followed by a filter - return "variable"; - } - - // If found closing tag reset - if (stream.match("}}")) { - state.waitProperty = null; - state.waitFilter = null; - state.waitDot = null; - state.waitPipe = null; - state.tokenize = tokenBase; - return "tag"; - } - - // If nothing was found, advance to the next character - stream.next(); - return "null"; - } - - function inTag (stream, state) { - // Attempt to match a dot that precedes a property - if (state.waitDot) { - state.waitDot = false; - - if (stream.peek() != ".") { - return "null"; - } - - // Dot followed by a non-word character should be considered an error. - if (stream.match(/\.\W+/)) { - return "error"; - } else if (stream.eat(".")) { - state.waitProperty = true; - return "null"; - } else { - throw Error ("Unexpected error while waiting for property."); - } - } - - // Attempt to match a pipe that precedes a filter - if (state.waitPipe) { - state.waitPipe = false; - - if (stream.peek() != "|") { - return "null"; - } - - // Pipe followed by a non-word character should be considered an error. - if (stream.match(/\.\W+/)) { - return "error"; - } else if (stream.eat("|")) { - state.waitFilter = true; - return "null"; - } else { - throw Error ("Unexpected error while waiting for filter."); - } - } - - // Highlight properties - if (state.waitProperty) { - state.waitProperty = false; - if (stream.match(/\b(\w+)\b/)) { - state.waitDot = true; // A property can be followed by another property - state.waitPipe = true; // A property can be followed by a filter - return "property"; - } - } - - // Highlight filters - if (state.waitFilter) { - state.waitFilter = false; - if (stream.match(filters)) { - return "variable-2"; - } - } - - // Ignore all white spaces - if (stream.eatSpace()) { - state.waitProperty = false; - return "null"; - } - - // Identify numbers - if (stream.match(/\b\d+(\.\d+)?\b/)) { - return "number"; - } - - // Identify strings - if (stream.match("'")) { - state.tokenize = inString("'", state.tokenize); - return "string"; - } else if (stream.match('"')) { - state.tokenize = inString('"', state.tokenize); - return "string"; - } - - // Attempt to match an operator - if (stream.match(operators)) { - return "operator"; - } - - // Attempt to match a word operator - if (stream.match(wordOperators)) { - return "keyword"; - } - - // Attempt to match a keyword - var keywordMatch = stream.match(keywords); - if (keywordMatch) { - if (keywordMatch[0] == "comment") { - state.blockCommentTag = true; - } - return "keyword"; - } - - // Attempt to match a variable - if (stream.match(/\b(\w+)\b/)) { - state.waitDot = true; - state.waitPipe = true; // A property can be followed by a filter - return "variable"; - } - - // If found closing tag reset - if (stream.match("%}")) { - state.waitProperty = null; - state.waitFilter = null; - state.waitDot = null; - state.waitPipe = null; - // If the tag that closes is a block comment tag, we want to mark the - // following code as comment, until the tag closes. - if (state.blockCommentTag) { - state.blockCommentTag = false; // Release the "lock" - state.tokenize = inBlockComment; - } else { - state.tokenize = tokenBase; - } - return "tag"; - } - - // If nothing was found, advance to the next character - stream.next(); - return "null"; - } - - // Mark everything as comment inside the tag and the tag itself. - function inComment (stream, state) { - if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase - else stream.skipToEnd() - return "comment"; - } - - // Mark everything as a comment until the `blockcomment` tag closes. - function inBlockComment (stream, state) { - if (stream.match(/\{%\s*endcomment\s*%\}/, false)) { - state.tokenize = inTag; - stream.match("{%"); - return "tag"; - } else { - stream.next(); - return "comment"; - } - } - - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - }, - blockCommentStart: "{% comment %}", - blockCommentEnd: "{% endcomment %}" - }; - }); - - CodeMirror.defineMode("django", function(config) { - var htmlBase = CodeMirror.getMode(config, "text/html"); - var djangoInner = CodeMirror.getMode(config, "django:inner"); - return CodeMirror.overlayMode(htmlBase, djangoInner); - }); - - CodeMirror.defineMIME("text/x-django", "django"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/django/index.html b/public/plugins/codemirror-5.17.0/mode/django/index.html deleted file mode 100644 index 41ea07c91..000000000 --- a/public/plugins/codemirror-5.17.0/mode/django/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: Django template mode - - - - - - - - - - - - - -
-

Django template mode

-
- - - -

Mode for HTML with embedded Django template markup.

- -

MIME types defined: text/x-django

-
diff --git a/public/plugins/codemirror-5.17.0/mode/dockerfile/dockerfile.js b/public/plugins/codemirror-5.17.0/mode/dockerfile/dockerfile.js deleted file mode 100644 index 4419009af..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dockerfile/dockerfile.js +++ /dev/null @@ -1,79 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - // Collect all Dockerfile directives - var instructions = ["from", "maintainer", "run", "cmd", "expose", "env", - "add", "copy", "entrypoint", "volume", "user", - "workdir", "onbuild"], - instructionRegex = "(" + instructions.join('|') + ")", - instructionOnlyLine = new RegExp(instructionRegex + "\\s*$", "i"), - instructionWithArguments = new RegExp(instructionRegex + "(\\s+)", "i"); - - CodeMirror.defineSimpleMode("dockerfile", { - start: [ - // Block comment: This is a line starting with a comment - { - regex: /#.*$/, - token: "comment" - }, - // Highlight an instruction without any arguments (for convenience) - { - regex: instructionOnlyLine, - token: "variable-2" - }, - // Highlight an instruction followed by arguments - { - regex: instructionWithArguments, - token: ["variable-2", null], - next: "arguments" - }, - { - regex: /./, - token: null - } - ], - arguments: [ - { - // Line comment without instruction arguments is an error - regex: /#.*$/, - token: "error", - next: "start" - }, - { - regex: /[^#]+\\$/, - token: null - }, - { - // Match everything except for the inline comment - regex: /[^#]+/, - token: null, - next: "start" - }, - { - regex: /$/, - token: null, - next: "start" - }, - // Fail safe return to start - { - token: null, - next: "start" - } - ], - meta: { - lineComment: "#" - } - }); - - CodeMirror.defineMIME("text/x-dockerfile", "dockerfile"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/dockerfile/index.html b/public/plugins/codemirror-5.17.0/mode/dockerfile/index.html deleted file mode 100644 index a31759bce..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dockerfile/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: Dockerfile mode - - - - - - - - - - -
-

Dockerfile mode

-
- - - -

Dockerfile syntax highlighting for CodeMirror. Depends on - the simplemode addon.

- -

MIME types defined: text/x-dockerfile

-
diff --git a/public/plugins/codemirror-5.17.0/mode/dtd/dtd.js b/public/plugins/codemirror-5.17.0/mode/dtd/dtd.js deleted file mode 100644 index 52d76ee11..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dtd/dtd.js +++ /dev/null @@ -1,142 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - DTD mode - Ported to CodeMirror by Peter Kroon - Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues - GitHub: @peterkroon -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("dtd", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch == "<" && stream.eat("!") ) { - if (stream.eatWhile(/[\-]/)) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent"); - } else if (ch == "<" && stream.eat("?")) { //xml declaration - state.tokenize = inBlock("meta", "?>"); - return ret("meta", ch); - } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag"); - else if (ch == "|") return ret("keyword", "seperator"); - else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else - else if (ch.match(/[\[\]]/)) return ret("rule", ch); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) { - var sc = stream.current(); - if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1); - return ret("tag", "tag"); - } else if (ch == "%" || ch == "*" ) return ret("number", "number"); - else { - stream.eatWhile(/[\w\\\-_%.{,]/); - return ret(null, null); - } - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return ret("string", "tag"); - }; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = tokenBase; - break; - } - stream.next(); - } - return style; - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule"); - else if (type === "endtag") state.stack[state.stack.length-1] = "endtag"; - else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop(); - else if (type == "[") state.stack.push("["); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - - if( textAfter.match(/\]\s+|\]/) )n=n-1; - else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){ - if(textAfter.substr(0,1) === "<") {} - else if( type == "doindent" && textAfter.length > 1 ) {} - else if( type == "doindent")n--; - else if( type == ">" && textAfter.length > 1) {} - else if( type == "tag" && textAfter !== ">") {} - else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--; - else if( type == "tag")n++; - else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--; - else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule") {} - else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1; - else if( textAfter === ">") {} - else n=n-1; - //over rule them all - if(type == null || type == "]")n--; - } - - return state.baseIndent + n * indentUnit; - }, - - electricChars: "]>" - }; -}); - -CodeMirror.defineMIME("application/xml-dtd", "dtd"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/dtd/index.html b/public/plugins/codemirror-5.17.0/mode/dtd/index.html deleted file mode 100644 index e6798a748..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dtd/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: DTD mode - - - - - - - - - -
-

DTD mode

-
- - -

MIME types defined: application/xml-dtd.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/dylan/dylan.js b/public/plugins/codemirror-5.17.0/mode/dylan/dylan.js deleted file mode 100644 index 1b46bc828..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dylan/dylan.js +++ /dev/null @@ -1,344 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("dylan", function(_config) { - // Words - var words = { - // Words that introduce unnamed definitions like "define interface" - unnamedDefinition: ["interface"], - - // Words that introduce simple named definitions like "define library" - namedDefinition: ["module", "library", "macro", - "C-struct", "C-union", - "C-function", "C-callable-wrapper" - ], - - // Words that introduce type definitions like "define class". - // These are also parameterized like "define method" and are - // appended to otherParameterizedDefinitionWords - typeParameterizedDefinition: ["class", "C-subtype", "C-mapped-subtype"], - - // Words that introduce trickier definitions like "define method". - // These require special definitions to be added to startExpressions - otherParameterizedDefinition: ["method", "function", - "C-variable", "C-address" - ], - - // Words that introduce module constant definitions. - // These must also be simple definitions and are - // appended to otherSimpleDefinitionWords - constantSimpleDefinition: ["constant"], - - // Words that introduce module variable definitions. - // These must also be simple definitions and are - // appended to otherSimpleDefinitionWords - variableSimpleDefinition: ["variable"], - - // Other words that introduce simple definitions - // (without implicit bodies). - otherSimpleDefinition: ["generic", "domain", - "C-pointer-type", - "table" - ], - - // Words that begin statements with implicit bodies. - statement: ["if", "block", "begin", "method", "case", - "for", "select", "when", "unless", "until", - "while", "iterate", "profiling", "dynamic-bind" - ], - - // Patterns that act as separators in compound statements. - // This may include any general pattern that must be indented - // specially. - separator: ["finally", "exception", "cleanup", "else", - "elseif", "afterwards" - ], - - // Keywords that do not require special indentation handling, - // but which should be highlighted - other: ["above", "below", "by", "from", "handler", "in", - "instance", "let", "local", "otherwise", "slot", - "subclass", "then", "to", "keyed-by", "virtual" - ], - - // Condition signaling function calls - signalingCalls: ["signal", "error", "cerror", - "break", "check-type", "abort" - ] - }; - - words["otherDefinition"] = - words["unnamedDefinition"] - .concat(words["namedDefinition"]) - .concat(words["otherParameterizedDefinition"]); - - words["definition"] = - words["typeParameterizedDefinition"] - .concat(words["otherDefinition"]); - - words["parameterizedDefinition"] = - words["typeParameterizedDefinition"] - .concat(words["otherParameterizedDefinition"]); - - words["simpleDefinition"] = - words["constantSimpleDefinition"] - .concat(words["variableSimpleDefinition"]) - .concat(words["otherSimpleDefinition"]); - - words["keyword"] = - words["statement"] - .concat(words["separator"]) - .concat(words["other"]); - - // Patterns - var symbolPattern = "[-_a-zA-Z?!*@<>$%]+"; - var symbol = new RegExp("^" + symbolPattern); - var patterns = { - // Symbols with special syntax - symbolKeyword: symbolPattern + ":", - symbolClass: "<" + symbolPattern + ">", - symbolGlobal: "\\*" + symbolPattern + "\\*", - symbolConstant: "\\$" + symbolPattern - }; - var patternStyles = { - symbolKeyword: "atom", - symbolClass: "tag", - symbolGlobal: "variable-2", - symbolConstant: "variable-3" - }; - - // Compile all patterns to regular expressions - for (var patternName in patterns) - if (patterns.hasOwnProperty(patternName)) - patterns[patternName] = new RegExp("^" + patterns[patternName]); - - // Names beginning "with-" and "without-" are commonly - // used as statement macro - patterns["keyword"] = [/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/]; - - var styles = {}; - styles["keyword"] = "keyword"; - styles["definition"] = "def"; - styles["simpleDefinition"] = "def"; - styles["signalingCalls"] = "builtin"; - - // protected words lookup table - var wordLookup = {}; - var styleLookup = {}; - - [ - "keyword", - "definition", - "simpleDefinition", - "signalingCalls" - ].forEach(function(type) { - words[type].forEach(function(word) { - wordLookup[word] = type; - styleLookup[word] = styles[type]; - }); - }); - - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function tokenBase(stream, state) { - // String - var ch = stream.peek(); - if (ch == "'" || ch == '"') { - stream.next(); - return chain(stream, state, tokenString(ch, "string")); - } - // Comment - else if (ch == "/") { - stream.next(); - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - stream.backUp(1); - } - // Decimal - else if (/[+\-\d\.]/.test(ch)) { - if (stream.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i) || - stream.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i) || - stream.match(/^[+-]?\d+/)) { - return "number"; - } - } - // Hash - else if (ch == "#") { - stream.next(); - // Symbol with string syntax - ch = stream.peek(); - if (ch == '"') { - stream.next(); - return chain(stream, state, tokenString('"', "string")); - } - // Binary number - else if (ch == "b") { - stream.next(); - stream.eatWhile(/[01]/); - return "number"; - } - // Hex number - else if (ch == "x") { - stream.next(); - stream.eatWhile(/[\da-f]/i); - return "number"; - } - // Octal number - else if (ch == "o") { - stream.next(); - stream.eatWhile(/[0-7]/); - return "number"; - } - // Token concatenation in macros - else if (ch == '#') { - stream.next(); - return "punctuation"; - } - // Sequence literals - else if ((ch == '[') || (ch == '(')) { - stream.next(); - return "bracket"; - // Hash symbol - } else if (stream.match(/f|t|all-keys|include|key|next|rest/i)) { - return "atom"; - } else { - stream.eatWhile(/[-a-zA-Z]/); - return "error"; - } - } else if (ch == "~") { - stream.next(); - ch = stream.peek(); - if (ch == "=") { - stream.next(); - ch = stream.peek(); - if (ch == "=") { - stream.next(); - return "operator"; - } - return "operator"; - } - return "operator"; - } else if (ch == ":") { - stream.next(); - ch = stream.peek(); - if (ch == "=") { - stream.next(); - return "operator"; - } else if (ch == ":") { - stream.next(); - return "punctuation"; - } - } else if ("[](){}".indexOf(ch) != -1) { - stream.next(); - return "bracket"; - } else if (".,".indexOf(ch) != -1) { - stream.next(); - return "punctuation"; - } else if (stream.match("end")) { - return "keyword"; - } - for (var name in patterns) { - if (patterns.hasOwnProperty(name)) { - var pattern = patterns[name]; - if ((pattern instanceof Array && pattern.some(function(p) { - return stream.match(p); - })) || stream.match(pattern)) - return patternStyles[name]; - } - } - if (/[+\-*\/^=<>&|]/.test(ch)) { - stream.next(); - return "operator"; - } - if (stream.match("define")) { - return "def"; - } else { - stream.eatWhile(/[\w\-]/); - // Keyword - if (wordLookup[stream.current()]) { - return styleLookup[stream.current()]; - } else if (stream.current().match(symbol)) { - return "variable"; - } else { - stream.next(); - return "variable-2"; - } - } - } - - function tokenComment(stream, state) { - var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; - while ((ch = stream.next())) { - if (ch == "/" && maybeEnd) { - if (nestedCount > 0) { - nestedCount--; - } else { - state.tokenize = tokenBase; - break; - } - } else if (ch == "*" && maybeNested) { - nestedCount++; - } - maybeEnd = (ch == "*"); - maybeNested = (ch == "/"); - } - return "comment"; - } - - function tokenString(quote, style) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end || !escaped) { - state.tokenize = tokenBase; - } - return style; - }; - } - - // Interface - return { - startState: function() { - return { - tokenize: tokenBase, - currentIndent: 0 - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) - return null; - var style = state.tokenize(stream, state); - return style; - }, - blockCommentStart: "/*", - blockCommentEnd: "*/" - }; -}); - -CodeMirror.defineMIME("text/x-dylan", "dylan"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/dylan/index.html b/public/plugins/codemirror-5.17.0/mode/dylan/index.html deleted file mode 100644 index ddf5ad067..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dylan/index.html +++ /dev/null @@ -1,407 +0,0 @@ - - -CodeMirror: Dylan mode - - - - - - - - - - - - -
-

Dylan mode

- - -
- - - -

MIME types defined: text/x-dylan.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/dylan/test.js b/public/plugins/codemirror-5.17.0/mode/dylan/test.js deleted file mode 100644 index bf25be27e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/dylan/test.js +++ /dev/null @@ -1,88 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "dylan"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('comments', - '[comment // This is a line comment]', - '[comment /* This is a block comment */]', - '[comment /* This is a multi]', - '[comment line comment]', - '[comment */]', - '[comment /* And this is a /*]', - '[comment /* nested */ comment */]'); - - MT('unary_operators', - '[operator -][variable a]', - '[operator -] [variable a]', - '[operator ~][variable a]', - '[operator ~] [variable a]'); - - MT('binary_operators', - '[variable a] [operator +] [variable b]', - '[variable a] [operator -] [variable b]', - '[variable a] [operator *] [variable b]', - '[variable a] [operator /] [variable b]', - '[variable a] [operator ^] [variable b]', - '[variable a] [operator =] [variable b]', - '[variable a] [operator ==] [variable b]', - '[variable a] [operator ~=] [variable b]', - '[variable a] [operator ~==] [variable b]', - '[variable a] [operator <] [variable b]', - '[variable a] [operator <=] [variable b]', - '[variable a] [operator >] [variable b]', - '[variable a] [operator >=] [variable b]', - '[variable a] [operator &] [variable b]', - '[variable a] [operator |] [variable b]', - '[variable a] [operator :=] [variable b]'); - - MT('integers', - '[number 1]', - '[number 123]', - '[number -123]', - '[number +456]', - '[number #b010]', - '[number #o073]', - '[number #xabcDEF123]'); - - MT('floats', - '[number .3]', - '[number -1.]', - '[number -2.335]', - '[number +3.78d1]', - '[number 3.78s-1]', - '[number -3.32e+5]'); - - MT('characters_and_strings', - "[string 'a']", - "[string '\\\\'']", - '[string ""]', - '[string "a"]', - '[string "abc def"]', - '[string "More escaped characters: \\\\\\\\ \\\\a \\\\b \\\\e \\\\f \\\\n \\\\r \\\\t \\\\0 ..."]'); - - MT('brackets', - '[bracket #[[]]]', - '[bracket #()]', - '[bracket #(][number 1][bracket )]', - '[bracket [[][number 1][punctuation ,] [number 3][bracket ]]]', - '[bracket ()]', - '[bracket {}]', - '[keyword if] [bracket (][variable foo][bracket )]', - '[bracket (][number 1][bracket )]', - '[bracket [[][number 1][bracket ]]]'); - - MT('hash_words', - '[punctuation ##]', - '[atom #f]', '[atom #F]', - '[atom #t]', '[atom #T]', - '[atom #all-keys]', - '[atom #include]', - '[atom #key]', - '[atom #next]', - '[atom #rest]', - '[string #"foo"]', - '[error #invalid]'); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/ebnf/ebnf.js b/public/plugins/codemirror-5.17.0/mode/ebnf/ebnf.js deleted file mode 100644 index 9618f8e42..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ebnf/ebnf.js +++ /dev/null @@ -1,195 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("ebnf", function (config) { - var commentType = {slash: 0, parenthesis: 1}; - var stateType = {comment: 0, _string: 1, characterClass: 2}; - var bracesMode = null; - - if (config.bracesMode) - bracesMode = CodeMirror.getMode(config, config.bracesMode); - - return { - startState: function () { - return { - stringType: null, - commentType: null, - braced: 0, - lhs: true, - localState: null, - stack: [], - inDefinition: false - }; - }, - token: function (stream, state) { - if (!stream) return; - - //check for state changes - if (state.stack.length === 0) { - //strings - if ((stream.peek() == '"') || (stream.peek() == "'")) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.stack.unshift(stateType._string); - } else if (stream.match(/^\/\*/)) { //comments starting with /* - state.stack.unshift(stateType.comment); - state.commentType = commentType.slash; - } else if (stream.match(/^\(\*/)) { //comments starting with (* - state.stack.unshift(stateType.comment); - state.commentType = commentType.parenthesis; - } - } - - //return state - //stack has - switch (state.stack[0]) { - case stateType._string: - while (state.stack[0] === stateType._string && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.stack.shift(); // Clear flag - } else if (stream.peek() === "\\") { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return state.lhs ? "property string" : "string"; // Token style - - case stateType.comment: - while (state.stack[0] === stateType.comment && !stream.eol()) { - if (state.commentType === commentType.slash && stream.match(/\*\//)) { - state.stack.shift(); // Clear flag - state.commentType = null; - } else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) { - state.stack.shift(); // Clear flag - state.commentType = null; - } else { - stream.match(/^.[^\*]*/); - } - } - return "comment"; - - case stateType.characterClass: - while (state.stack[0] === stateType.characterClass && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { - state.stack.shift(); - } - } - return "operator"; - } - - var peek = stream.peek(); - - if (bracesMode !== null && (state.braced || peek === "{")) { - if (state.localState === null) - state.localState = CodeMirror.startState(bracesMode); - - var token = bracesMode.token(stream, state.localState), - text = stream.current(); - - if (!token) { - for (var i = 0; i < text.length; i++) { - if (text[i] === "{") { - if (state.braced === 0) { - token = "matchingbracket"; - } - state.braced++; - } else if (text[i] === "}") { - state.braced--; - if (state.braced === 0) { - token = "matchingbracket"; - } - } - } - } - return token; - } - - //no stack - switch (peek) { - case "[": - stream.next(); - state.stack.unshift(stateType.characterClass); - return "bracket"; - case ":": - case "|": - case ";": - stream.next(); - return "operator"; - case "%": - if (stream.match("%%")) { - return "header"; - } else if (stream.match(/[%][A-Za-z]+/)) { - return "keyword"; - } else if (stream.match(/[%][}]/)) { - return "matchingbracket"; - } - break; - case "/": - if (stream.match(/[\/][A-Za-z]+/)) { - return "keyword"; - } - case "\\": - if (stream.match(/[\][a-z]+/)) { - return "string-2"; - } - case ".": - if (stream.match(".")) { - return "atom"; - } - case "*": - case "-": - case "+": - case "^": - if (stream.match(peek)) { - return "atom"; - } - case "$": - if (stream.match("$$")) { - return "builtin"; - } else if (stream.match(/[$][0-9]+/)) { - return "variable-3"; - } - case "<": - if (stream.match(/<<[a-zA-Z_]+>>/)) { - return "builtin"; - } - } - - if (stream.match(/^\/\//)) { - stream.skipToEnd(); - return "comment"; - } else if (stream.match(/return/)) { - return "operator"; - } else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) { - if (stream.match(/(?=[\(.])/)) { - return "variable"; - } else if (stream.match(/(?=[\s\n]*[:=])/)) { - return "def"; - } - return "variable-2"; - } else if (["[", "]", "(", ")"].indexOf(stream.peek()) != -1) { - stream.next(); - return "bracket"; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; - }); - - CodeMirror.defineMIME("text/x-ebnf", "ebnf"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/ebnf/index.html b/public/plugins/codemirror-5.17.0/mode/ebnf/index.html deleted file mode 100644 index 13845629b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ebnf/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - CodeMirror: EBNF Mode - - - - - - - - - - - - -
-

EBNF Mode (bracesMode setting = "javascript")

-
- -

The EBNF Mode

-

Created by Robert Plummer

-
- - diff --git a/public/plugins/codemirror-5.17.0/mode/ecl/ecl.js b/public/plugins/codemirror-5.17.0/mode/ecl/ecl.js deleted file mode 100644 index 8df7ebe4a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ecl/ecl.js +++ /dev/null @@ -1,206 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("ecl", function(config) { - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - function metaHook(stream, state) { - if (!state.startOfLine) return false; - stream.skipToEnd(); - return "meta"; - } - - var indentUnit = config.indentUnit; - var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"); - var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"); - var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"); - var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"); - var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"); - var blockKeywords = words("catch class do else finally for if switch try while"); - var atoms = words("true false null"); - var hooks = {"#": metaHook}; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current().toLowerCase(); - if (keyword.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } else if (variable.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "variable"; - } else if (variable_2.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "variable-2"; - } else if (variable_3.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "variable-3"; - } else if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "builtin"; - } else { //Data types are of from KEYWORD## - var i = cur.length - 1; - while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_')) - --i; - - if (i > 0) { - var cur2 = cur.substr(0, i + 1); - if (variable_3.propertyIsEnumerable(cur2)) { - if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement"; - return "variable-3"; - } - } - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return null; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-ecl", "ecl"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/ecl/index.html b/public/plugins/codemirror-5.17.0/mode/ecl/index.html deleted file mode 100644 index 2306860dc..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ecl/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: ECL mode - - - - - - - - - -
-

ECL mode

-
- - -

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

-

MIME types defined: text/x-ecl.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/eiffel/eiffel.js b/public/plugins/codemirror-5.17.0/mode/eiffel/eiffel.js deleted file mode 100644 index b8b70e36e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/eiffel/eiffel.js +++ /dev/null @@ -1,160 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("eiffel", function() { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - 'note', - 'across', - 'when', - 'variant', - 'until', - 'unique', - 'undefine', - 'then', - 'strip', - 'select', - 'retry', - 'rescue', - 'require', - 'rename', - 'reference', - 'redefine', - 'prefix', - 'once', - 'old', - 'obsolete', - 'loop', - 'local', - 'like', - 'is', - 'inspect', - 'infix', - 'include', - 'if', - 'frozen', - 'from', - 'external', - 'export', - 'ensure', - 'end', - 'elseif', - 'else', - 'do', - 'creation', - 'create', - 'check', - 'alias', - 'agent', - 'separate', - 'invariant', - 'inherit', - 'indexing', - 'feature', - 'expanded', - 'deferred', - 'class', - 'Void', - 'True', - 'Result', - 'Precursor', - 'False', - 'Current', - 'create', - 'attached', - 'detachable', - 'as', - 'and', - 'implies', - 'not', - 'or' - ]); - var operators = wordObj([":=", "and then","and", "or","<<",">>"]); - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - if (stream.eatSpace()) return null; - var ch = stream.next(); - if (ch == '"'||ch == "'") { - return chain(readQuoted(ch, "string"), stream, state); - } else if (ch == "-"&&stream.eat("-")) { - stream.skipToEnd(); - return "comment"; - } else if (ch == ":"&&stream.eat("=")) { - return "operator"; - } else if (/[0-9]/.test(ch)) { - stream.eatWhile(/[xXbBCc0-9\.]/); - stream.eat(/[\?\!]/); - return "ident"; - } else if (/[a-zA-Z_0-9]/.test(ch)) { - stream.eatWhile(/[a-zA-Z_0-9]/); - stream.eat(/[\?\!]/); - return "ident"; - } else if (/[=+\-\/*^%<>~]/.test(ch)) { - stream.eatWhile(/[=+\-\/*^%<>~]/); - return "operator"; - } else { - return null; - } - } - - function readQuoted(quote, style, unescaped) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - escaped = !escaped && ch == "%"; - } - return style; - }; - } - - return { - startState: function() { - return {tokenize: [tokenBase]}; - }, - - token: function(stream, state) { - var style = state.tokenize[state.tokenize.length-1](stream, state); - if (style == "ident") { - var word = stream.current(); - style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : operators.propertyIsEnumerable(stream.current()) ? "operator" - : /^[A-Z][A-Z_0-9]*$/g.test(word) ? "tag" - : /^0[bB][0-1]+$/g.test(word) ? "number" - : /^0[cC][0-7]+$/g.test(word) ? "number" - : /^0[xX][a-fA-F0-9]+$/g.test(word) ? "number" - : /^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word) ? "number" - : /^[0-9]+$/g.test(word) ? "number" - : "variable"; - } - return style; - }, - lineComment: "--" - }; -}); - -CodeMirror.defineMIME("text/x-eiffel", "eiffel"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/eiffel/index.html b/public/plugins/codemirror-5.17.0/mode/eiffel/index.html deleted file mode 100644 index 108a71bec..000000000 --- a/public/plugins/codemirror-5.17.0/mode/eiffel/index.html +++ /dev/null @@ -1,429 +0,0 @@ - - -CodeMirror: Eiffel mode - - - - - - - - - - -
-

Eiffel mode

-
- - -

MIME types defined: text/x-eiffel.

- -

Created by YNH.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/elm/elm.js b/public/plugins/codemirror-5.17.0/mode/elm/elm.js deleted file mode 100644 index b31e66375..000000000 --- a/public/plugins/codemirror-5.17.0/mode/elm/elm.js +++ /dev/null @@ -1,205 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("elm", function() { - - function switchState(source, setState, f) { - setState(f); - return f(source, setState); - } - - // These should all be Unicode extended, as per the Haskell 2010 report - var smallRE = /[a-z_]/; - var largeRE = /[A-Z]/; - var digitRE = /[0-9]/; - var hexitRE = /[0-9A-Fa-f]/; - var octitRE = /[0-7]/; - var idRE = /[a-z_A-Z0-9\']/; - var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/; - var specialRE = /[(),;[\]`{}]/; - var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer - - function normal() { - return function (source, setState) { - if (source.eatWhile(whiteCharRE)) { - return null; - } - - var ch = source.next(); - if (specialRE.test(ch)) { - if (ch == '{' && source.eat('-')) { - var t = "comment"; - if (source.eat('#')) t = "meta"; - return switchState(source, setState, ncomment(t, 1)); - } - return null; - } - - if (ch == '\'') { - if (source.eat('\\')) - source.next(); // should handle other escapes here - else - source.next(); - - if (source.eat('\'')) - return "string"; - return "error"; - } - - if (ch == '"') { - return switchState(source, setState, stringLiteral); - } - - if (largeRE.test(ch)) { - source.eatWhile(idRE); - if (source.eat('.')) - return "qualifier"; - return "variable-2"; - } - - if (smallRE.test(ch)) { - var isDef = source.pos === 1; - source.eatWhile(idRE); - return isDef ? "variable-3" : "variable"; - } - - if (digitRE.test(ch)) { - if (ch == '0') { - if (source.eat(/[xX]/)) { - source.eatWhile(hexitRE); // should require at least 1 - return "integer"; - } - if (source.eat(/[oO]/)) { - source.eatWhile(octitRE); // should require at least 1 - return "number"; - } - } - source.eatWhile(digitRE); - var t = "number"; - if (source.eat('.')) { - t = "number"; - source.eatWhile(digitRE); // should require at least 1 - } - if (source.eat(/[eE]/)) { - t = "number"; - source.eat(/[-+]/); - source.eatWhile(digitRE); // should require at least 1 - } - return t; - } - - if (symbolRE.test(ch)) { - if (ch == '-' && source.eat(/-/)) { - source.eatWhile(/-/); - if (!source.eat(symbolRE)) { - source.skipToEnd(); - return "comment"; - } - } - source.eatWhile(symbolRE); - return "builtin"; - } - - return "error"; - } - } - - function ncomment(type, nest) { - if (nest == 0) { - return normal(); - } - return function(source, setState) { - var currNest = nest; - while (!source.eol()) { - var ch = source.next(); - if (ch == '{' && source.eat('-')) { - ++currNest; - } else if (ch == '-' && source.eat('}')) { - --currNest; - if (currNest == 0) { - setState(normal()); - return type; - } - } - } - setState(ncomment(type, currNest)); - return type; - } - } - - function stringLiteral(source, setState) { - while (!source.eol()) { - var ch = source.next(); - if (ch == '"') { - setState(normal()); - return "string"; - } - if (ch == '\\') { - if (source.eol() || source.eat(whiteCharRE)) { - setState(stringGap); - return "string"; - } - if (!source.eat('&')) source.next(); // should handle other escapes here - } - } - setState(normal()); - return "error"; - } - - function stringGap(source, setState) { - if (source.eat('\\')) { - return switchState(source, setState, stringLiteral); - } - source.next(); - setState(normal()); - return "error"; - } - - - var wellKnownWords = (function() { - var wkw = {}; - - var keywords = [ - "case", "of", "as", - "if", "then", "else", - "let", "in", - "infix", "infixl", "infixr", - "type", "alias", - "input", "output", "foreign", "loopback", - "module", "where", "import", "exposing", - "_", "..", "|", ":", "=", "\\", "\"", "->", "<-" - ]; - - for (var i = keywords.length; i--;) - wkw[keywords[i]] = "keyword"; - - return wkw; - })(); - - - - return { - startState: function () { return { f: normal() }; }, - copyState: function (s) { return { f: s.f }; }, - - token: function(stream, state) { - var t = state.f(stream, function(s) { state.f = s; }); - var w = stream.current(); - return (wellKnownWords.hasOwnProperty(w)) ? wellKnownWords[w] : t; - } - }; - - }); - - CodeMirror.defineMIME("text/x-elm", "elm"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/elm/index.html b/public/plugins/codemirror-5.17.0/mode/elm/index.html deleted file mode 100644 index d5cb16abf..000000000 --- a/public/plugins/codemirror-5.17.0/mode/elm/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Elm mode - - - - - - - - - -
-

Elm mode

- -
- - - -

MIME types defined: text/x-elm.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/erlang/erlang.js b/public/plugins/codemirror-5.17.0/mode/erlang/erlang.js deleted file mode 100644 index 5aed76a52..000000000 --- a/public/plugins/codemirror-5.17.0/mode/erlang/erlang.js +++ /dev/null @@ -1,618 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/*jshint unused:true, eqnull:true, curly:true, bitwise:true */ -/*jshint undef:true, latedef:true, trailing:true */ -/*global CodeMirror:true */ - -// erlang mode. -// tokenizer -> token types -> CodeMirror styles -// tokenizer maintains a parse stack -// indenter uses the parse stack - -// TODO indenter: -// bit syntax -// old guard/bif/conversion clashes (e.g. "float/1") -// type/spec/opaque - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMIME("text/x-erlang", "erlang"); - -CodeMirror.defineMode("erlang", function(cmCfg) { - "use strict"; - -///////////////////////////////////////////////////////////////////////////// -// constants - - var typeWords = [ - "-type", "-spec", "-export_type", "-opaque"]; - - var keywordWords = [ - "after","begin","catch","case","cond","end","fun","if", - "let","of","query","receive","try","when"]; - - var separatorRE = /[\->,;]/; - var separatorWords = [ - "->",";",","]; - - var operatorAtomWords = [ - "and","andalso","band","bnot","bor","bsl","bsr","bxor", - "div","not","or","orelse","rem","xor"]; - - var operatorSymbolRE = /[\+\-\*\/<>=\|:!]/; - var operatorSymbolWords = [ - "=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"]; - - var openParenRE = /[<\(\[\{]/; - var openParenWords = [ - "<<","(","[","{"]; - - var closeParenRE = /[>\)\]\}]/; - var closeParenWords = [ - "}","]",")",">>"]; - - var guardWords = [ - "is_atom","is_binary","is_bitstring","is_boolean","is_float", - "is_function","is_integer","is_list","is_number","is_pid", - "is_port","is_record","is_reference","is_tuple", - "atom","binary","bitstring","boolean","function","integer","list", - "number","pid","port","record","reference","tuple"]; - - var bifWords = [ - "abs","adler32","adler32_combine","alive","apply","atom_to_binary", - "atom_to_list","binary_to_atom","binary_to_existing_atom", - "binary_to_list","binary_to_term","bit_size","bitstring_to_list", - "byte_size","check_process_code","contact_binary","crc32", - "crc32_combine","date","decode_packet","delete_module", - "disconnect_node","element","erase","exit","float","float_to_list", - "garbage_collect","get","get_keys","group_leader","halt","hd", - "integer_to_list","internal_bif","iolist_size","iolist_to_binary", - "is_alive","is_atom","is_binary","is_bitstring","is_boolean", - "is_float","is_function","is_integer","is_list","is_number","is_pid", - "is_port","is_process_alive","is_record","is_reference","is_tuple", - "length","link","list_to_atom","list_to_binary","list_to_bitstring", - "list_to_existing_atom","list_to_float","list_to_integer", - "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded", - "monitor_node","node","node_link","node_unlink","nodes","notalive", - "now","open_port","pid_to_list","port_close","port_command", - "port_connect","port_control","pre_loaded","process_flag", - "process_info","processes","purge_module","put","register", - "registered","round","self","setelement","size","spawn","spawn_link", - "spawn_monitor","spawn_opt","split_binary","statistics", - "term_to_binary","time","throw","tl","trunc","tuple_size", - "tuple_to_list","unlink","unregister","whereis"]; - -// upper case: [A-Z] [Ø-Þ] [À-Ö] -// lower case: [a-z] [ß-ö] [ø-ÿ] - var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/; - var escapesRE = - /[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/; - -///////////////////////////////////////////////////////////////////////////// -// tokenizer - - function tokenizer(stream,state) { - // in multi-line string - if (state.in_string) { - state.in_string = (!doubleQuote(stream)); - return rval(state,stream,"string"); - } - - // in multi-line atom - if (state.in_atom) { - state.in_atom = (!singleQuote(stream)); - return rval(state,stream,"atom"); - } - - // whitespace - if (stream.eatSpace()) { - return rval(state,stream,"whitespace"); - } - - // attributes and type specs - if (!peekToken(state) && - stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) { - if (is_member(stream.current(),typeWords)) { - return rval(state,stream,"type"); - }else{ - return rval(state,stream,"attribute"); - } - } - - var ch = stream.next(); - - // comment - if (ch == '%') { - stream.skipToEnd(); - return rval(state,stream,"comment"); - } - - // colon - if (ch == ":") { - return rval(state,stream,"colon"); - } - - // macro - if (ch == '?') { - stream.eatSpace(); - stream.eatWhile(anumRE); - return rval(state,stream,"macro"); - } - - // record - if (ch == "#") { - stream.eatSpace(); - stream.eatWhile(anumRE); - return rval(state,stream,"record"); - } - - // dollar escape - if (ch == "$") { - if (stream.next() == "\\" && !stream.match(escapesRE)) { - return rval(state,stream,"error"); - } - return rval(state,stream,"number"); - } - - // dot - if (ch == ".") { - return rval(state,stream,"dot"); - } - - // quoted atom - if (ch == '\'') { - if (!(state.in_atom = (!singleQuote(stream)))) { - if (stream.match(/\s*\/\s*[0-9]/,false)) { - stream.match(/\s*\/\s*[0-9]/,true); - return rval(state,stream,"fun"); // 'f'/0 style fun - } - if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) { - return rval(state,stream,"function"); - } - } - return rval(state,stream,"atom"); - } - - // string - if (ch == '"') { - state.in_string = (!doubleQuote(stream)); - return rval(state,stream,"string"); - } - - // variable - if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) { - stream.eatWhile(anumRE); - return rval(state,stream,"variable"); - } - - // atom/keyword/BIF/function - if (/[a-z_ß-öø-ÿ]/.test(ch)) { - stream.eatWhile(anumRE); - - if (stream.match(/\s*\/\s*[0-9]/,false)) { - stream.match(/\s*\/\s*[0-9]/,true); - return rval(state,stream,"fun"); // f/0 style fun - } - - var w = stream.current(); - - if (is_member(w,keywordWords)) { - return rval(state,stream,"keyword"); - }else if (is_member(w,operatorAtomWords)) { - return rval(state,stream,"operator"); - }else if (stream.match(/\s*\(/,false)) { - // 'put' and 'erlang:put' are bifs, 'foo:put' is not - if (is_member(w,bifWords) && - ((peekToken(state).token != ":") || - (peekToken(state,2).token == "erlang"))) { - return rval(state,stream,"builtin"); - }else if (is_member(w,guardWords)) { - return rval(state,stream,"guard"); - }else{ - return rval(state,stream,"function"); - } - }else if (lookahead(stream) == ":") { - if (w == "erlang") { - return rval(state,stream,"builtin"); - } else { - return rval(state,stream,"function"); - } - }else if (is_member(w,["true","false"])) { - return rval(state,stream,"boolean"); - }else{ - return rval(state,stream,"atom"); - } - } - - // number - var digitRE = /[0-9]/; - var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int - if (digitRE.test(ch)) { - stream.eatWhile(digitRE); - if (stream.eat('#')) { // 36#aZ style integer - if (!stream.eatWhile(radixRE)) { - stream.backUp(1); //"36#" - syntax error - } - } else if (stream.eat('.')) { // float - if (!stream.eatWhile(digitRE)) { - stream.backUp(1); // "3." - probably end of function - } else { - if (stream.eat(/[eE]/)) { // float with exponent - if (stream.eat(/[-+]/)) { - if (!stream.eatWhile(digitRE)) { - stream.backUp(2); // "2e-" - syntax error - } - } else { - if (!stream.eatWhile(digitRE)) { - stream.backUp(1); // "2e" - syntax error - } - } - } - } - } - return rval(state,stream,"number"); // normal integer - } - - // open parens - if (nongreedy(stream,openParenRE,openParenWords)) { - return rval(state,stream,"open_paren"); - } - - // close parens - if (nongreedy(stream,closeParenRE,closeParenWords)) { - return rval(state,stream,"close_paren"); - } - - // separators - if (greedy(stream,separatorRE,separatorWords)) { - return rval(state,stream,"separator"); - } - - // operators - if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) { - return rval(state,stream,"operator"); - } - - return rval(state,stream,null); - } - -///////////////////////////////////////////////////////////////////////////// -// utilities - function nongreedy(stream,re,words) { - if (stream.current().length == 1 && re.test(stream.current())) { - stream.backUp(1); - while (re.test(stream.peek())) { - stream.next(); - if (is_member(stream.current(),words)) { - return true; - } - } - stream.backUp(stream.current().length-1); - } - return false; - } - - function greedy(stream,re,words) { - if (stream.current().length == 1 && re.test(stream.current())) { - while (re.test(stream.peek())) { - stream.next(); - } - while (0 < stream.current().length) { - if (is_member(stream.current(),words)) { - return true; - }else{ - stream.backUp(1); - } - } - stream.next(); - } - return false; - } - - function doubleQuote(stream) { - return quote(stream, '"', '\\'); - } - - function singleQuote(stream) { - return quote(stream,'\'','\\'); - } - - function quote(stream,quoteChar,escapeChar) { - while (!stream.eol()) { - var ch = stream.next(); - if (ch == quoteChar) { - return true; - }else if (ch == escapeChar) { - stream.next(); - } - } - return false; - } - - function lookahead(stream) { - var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false); - return m ? m.pop() : ""; - } - - function is_member(element,list) { - return (-1 < list.indexOf(element)); - } - - function rval(state,stream,type) { - - // parse stack - pushToken(state,realToken(type,stream)); - - // map erlang token type to CodeMirror style class - // erlang -> CodeMirror tag - switch (type) { - case "atom": return "atom"; - case "attribute": return "attribute"; - case "boolean": return "atom"; - case "builtin": return "builtin"; - case "close_paren": return null; - case "colon": return null; - case "comment": return "comment"; - case "dot": return null; - case "error": return "error"; - case "fun": return "meta"; - case "function": return "tag"; - case "guard": return "property"; - case "keyword": return "keyword"; - case "macro": return "variable-2"; - case "number": return "number"; - case "open_paren": return null; - case "operator": return "operator"; - case "record": return "bracket"; - case "separator": return null; - case "string": return "string"; - case "type": return "def"; - case "variable": return "variable"; - default: return null; - } - } - - function aToken(tok,col,ind,typ) { - return {token: tok, - column: col, - indent: ind, - type: typ}; - } - - function realToken(type,stream) { - return aToken(stream.current(), - stream.column(), - stream.indentation(), - type); - } - - function fakeToken(type) { - return aToken(type,0,0,type); - } - - function peekToken(state,depth) { - var len = state.tokenStack.length; - var dep = (depth ? depth : 1); - - if (len < dep) { - return false; - }else{ - return state.tokenStack[len-dep]; - } - } - - function pushToken(state,token) { - - if (!(token.type == "comment" || token.type == "whitespace")) { - state.tokenStack = maybe_drop_pre(state.tokenStack,token); - state.tokenStack = maybe_drop_post(state.tokenStack); - } - } - - function maybe_drop_pre(s,token) { - var last = s.length-1; - - if (0 < last && s[last].type === "record" && token.type === "dot") { - s.pop(); - }else if (0 < last && s[last].type === "group") { - s.pop(); - s.push(token); - }else{ - s.push(token); - } - return s; - } - - function maybe_drop_post(s) { - var last = s.length-1; - - if (s[last].type === "dot") { - return []; - } - if (s[last].type === "fun" && s[last-1].token === "fun") { - return s.slice(0,last-1); - } - switch (s[s.length-1].token) { - case "}": return d(s,{g:["{"]}); - case "]": return d(s,{i:["["]}); - case ")": return d(s,{i:["("]}); - case ">>": return d(s,{i:["<<"]}); - case "end": return d(s,{i:["begin","case","fun","if","receive","try"]}); - case ",": return d(s,{e:["begin","try","when","->", - ",","(","[","{","<<"]}); - case "->": return d(s,{r:["when"], - m:["try","if","case","receive"]}); - case ";": return d(s,{E:["case","fun","if","receive","try","when"]}); - case "catch":return d(s,{e:["try"]}); - case "of": return d(s,{e:["case"]}); - case "after":return d(s,{e:["receive","try"]}); - default: return s; - } - } - - function d(stack,tt) { - // stack is a stack of Token objects. - // tt is an object; {type:tokens} - // type is a char, tokens is a list of token strings. - // The function returns (possibly truncated) stack. - // It will descend the stack, looking for a Token such that Token.token - // is a member of tokens. If it does not find that, it will normally (but - // see "E" below) return stack. If it does find a match, it will remove - // all the Tokens between the top and the matched Token. - // If type is "m", that is all it does. - // If type is "i", it will also remove the matched Token and the top Token. - // If type is "g", like "i", but add a fake "group" token at the top. - // If type is "r", it will remove the matched Token, but not the top Token. - // If type is "e", it will keep the matched Token but not the top Token. - // If type is "E", it behaves as for type "e", except if there is no match, - // in which case it will return an empty stack. - - for (var type in tt) { - var len = stack.length-1; - var tokens = tt[type]; - for (var i = len-1; -1 < i ; i--) { - if (is_member(stack[i].token,tokens)) { - var ss = stack.slice(0,i); - switch (type) { - case "m": return ss.concat(stack[i]).concat(stack[len]); - case "r": return ss.concat(stack[len]); - case "i": return ss; - case "g": return ss.concat(fakeToken("group")); - case "E": return ss.concat(stack[i]); - case "e": return ss.concat(stack[i]); - } - } - } - } - return (type == "E" ? [] : stack); - } - -///////////////////////////////////////////////////////////////////////////// -// indenter - - function indenter(state,textAfter) { - var t; - var unit = cmCfg.indentUnit; - var wordAfter = wordafter(textAfter); - var currT = peekToken(state,1); - var prevT = peekToken(state,2); - - if (state.in_string || state.in_atom) { - return CodeMirror.Pass; - }else if (!prevT) { - return 0; - }else if (currT.token == "when") { - return currT.column+unit; - }else if (wordAfter === "when" && prevT.type === "function") { - return prevT.indent+unit; - }else if (wordAfter === "(" && currT.token === "fun") { - return currT.column+3; - }else if (wordAfter === "catch" && (t = getToken(state,["try"]))) { - return t.column; - }else if (is_member(wordAfter,["end","after","of"])) { - t = getToken(state,["begin","case","fun","if","receive","try"]); - return t ? t.column : CodeMirror.Pass; - }else if (is_member(wordAfter,closeParenWords)) { - t = getToken(state,openParenWords); - return t ? t.column : CodeMirror.Pass; - }else if (is_member(currT.token,[",","|","||"]) || - is_member(wordAfter,[",","|","||"])) { - t = postcommaToken(state); - return t ? t.column+t.token.length : unit; - }else if (currT.token == "->") { - if (is_member(prevT.token, ["receive","case","if","try"])) { - return prevT.column+unit+unit; - }else{ - return prevT.column+unit; - } - }else if (is_member(currT.token,openParenWords)) { - return currT.column+currT.token.length; - }else{ - t = defaultToken(state); - return truthy(t) ? t.column+unit : 0; - } - } - - function wordafter(str) { - var m = str.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/); - - return truthy(m) && (m.index === 0) ? m[0] : ""; - } - - function postcommaToken(state) { - var objs = state.tokenStack.slice(0,-1); - var i = getTokenIndex(objs,"type",["open_paren"]); - - return truthy(objs[i]) ? objs[i] : false; - } - - function defaultToken(state) { - var objs = state.tokenStack; - var stop = getTokenIndex(objs,"type",["open_paren","separator","keyword"]); - var oper = getTokenIndex(objs,"type",["operator"]); - - if (truthy(stop) && truthy(oper) && stop < oper) { - return objs[stop+1]; - } else if (truthy(stop)) { - return objs[stop]; - } else { - return false; - } - } - - function getToken(state,tokens) { - var objs = state.tokenStack; - var i = getTokenIndex(objs,"token",tokens); - - return truthy(objs[i]) ? objs[i] : false; - } - - function getTokenIndex(objs,propname,propvals) { - - for (var i = objs.length-1; -1 < i ; i--) { - if (is_member(objs[i][propname],propvals)) { - return i; - } - } - return false; - } - - function truthy(x) { - return (x !== false) && (x != null); - } - -///////////////////////////////////////////////////////////////////////////// -// this object defines the mode - - return { - startState: - function() { - return {tokenStack: [], - in_string: false, - in_atom: false}; - }, - - token: - function(stream, state) { - return tokenizer(stream, state); - }, - - indent: - function(state, textAfter) { - return indenter(state,textAfter); - }, - - lineComment: "%" - }; -}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/erlang/index.html b/public/plugins/codemirror-5.17.0/mode/erlang/index.html deleted file mode 100644 index 6d06a890a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/erlang/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - -CodeMirror: Erlang mode - - - - - - - - - - - -
-

Erlang mode

-
- - - -

MIME types defined: text/x-erlang.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/factor/factor.js b/public/plugins/codemirror-5.17.0/mode/factor/factor.js deleted file mode 100644 index 86d7adf62..000000000 --- a/public/plugins/codemirror-5.17.0/mode/factor/factor.js +++ /dev/null @@ -1,83 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Factor syntax highlight - simple mode -// -// by Dimage Sapelkin (https://github.com/kerabromsmu) - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineSimpleMode("factor", { - // The start state contains the rules that are intially used - start: [ - // comments - {regex: /#?!.*/, token: "comment"}, - // strings """, multiline --> state - {regex: /"""/, token: "string", next: "string3"}, - {regex: /"/, token: "string", next: "string"}, - // numbers: dec, hex, unicode, bin, fractional, complex - {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"}, - //{regex: /[+-]?/} //fractional - // definition: defining word, defined word, etc - {regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"}, - // vocabulary using --> state - {regex: /USING\:/, token: "keyword", next: "vocabulary"}, - // vocabulary definition/use - {regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]}, - // - {regex: /<\S+>/, token: "builtin"}, - // "keywords", incl. ; t f . [ ] { } defining words - {regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"}, - // any id (?) - {regex: /\S+/, token: "variable"}, - - { - regex: /./, - token: null - } - ], - vocabulary: [ - {regex: /;/, token: "keyword", next: "start"}, - {regex: /\S+/, token: "variable-2"}, - { - regex: /./, - token: null - } - ], - string: [ - {regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"}, - {regex: /.*/, token: "string"} - ], - string3: [ - {regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"}, - {regex: /.*/, token: "string"} - ], - stack: [ - {regex: /\)/, token: "meta", next: "start"}, - {regex: /--/, token: "meta"}, - {regex: /\S+/, token: "variable-3"}, - { - regex: /./, - token: null - } - ], - // The meta property contains global information about the mode. It - // can contain properties like lineComment, which are supported by - // all modes, and also directives like dontIndentStates, which are - // specific to simple modes. - meta: { - dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"], - lineComment: [ "!", "#!" ] - } - }); - - CodeMirror.defineMIME("text/x-factor", "factor"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/factor/index.html b/public/plugins/codemirror-5.17.0/mode/factor/index.html deleted file mode 100644 index 9f1548914..000000000 --- a/public/plugins/codemirror-5.17.0/mode/factor/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: Factor mode - - - - - - - - - - - -
- -

Factor mode

- -
- - - -

-

Simple mode that handles Factor Syntax (Factor on WikiPedia).

- -

MIME types defined: text/x-factor.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/fcl/fcl.js b/public/plugins/codemirror-5.17.0/mode/fcl/fcl.js deleted file mode 100644 index 518116976..000000000 --- a/public/plugins/codemirror-5.17.0/mode/fcl/fcl.js +++ /dev/null @@ -1,173 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("fcl", function(config) { - var indentUnit = config.indentUnit; - - var keywords = { - "term": true, - "method": true, "accu": true, - "rule": true, "then": true, "is": true, "and": true, "or": true, - "if": true, "default": true - }; - - var start_blocks = { - "var_input": true, - "var_output": true, - "fuzzify": true, - "defuzzify": true, - "function_block": true, - "ruleblock": true - }; - - var end_blocks = { - "end_ruleblock": true, - "end_defuzzify": true, - "end_function_block": true, - "end_fuzzify": true, - "end_var": true - }; - - var atoms = { - "true": true, "false": true, "nan": true, - "real": true, "min": true, "max": true, "cog": true, "cogs": true - }; - - var isOperatorChar = /[+\-*&^%:=<>!|\/]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (/[\d\.]/.test(ch)) { - if (ch == ".") { - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); - } else if (ch == "0") { - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); - } else { - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); - } - return "number"; - } - - if (ch == "/" || ch == "(") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - - var cur = stream.current().toLowerCase(); - if (keywords.propertyIsEnumerable(cur) || - start_blocks.propertyIsEnumerable(cur) || - end_blocks.propertyIsEnumerable(cur)) { - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if ((ch == "/" || ch == ")") && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - - function popContext(state) { - if (!state.context.prev) return; - var t = state.context.type; - if (t == "end_block") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - var cur = stream.current().toLowerCase(); - - if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), "end_block"); - else if (end_blocks.propertyIsEnumerable(cur)) popContext(state); - - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context; - - var closing = end_blocks.propertyIsEnumerable(textAfter); - if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "ryk", - fold: "brace", - blockCommentStart: "(*", - blockCommentEnd: "*)", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-fcl", "fcl"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/fcl/index.html b/public/plugins/codemirror-5.17.0/mode/fcl/index.html deleted file mode 100644 index 3c18d0b3c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/fcl/index.html +++ /dev/null @@ -1,108 +0,0 @@ - - -CodeMirror: FCL mode - - - - - - - - - - - -
-

FCL mode

-
- - - -

MIME type: text/x-fcl

-
diff --git a/public/plugins/codemirror-5.17.0/mode/forth/forth.js b/public/plugins/codemirror-5.17.0/mode/forth/forth.js deleted file mode 100644 index 1f519d886..000000000 --- a/public/plugins/codemirror-5.17.0/mode/forth/forth.js +++ /dev/null @@ -1,180 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Author: Aliaksei Chapyzhenka - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function toWordList(words) { - var ret = []; - words.split(' ').forEach(function(e){ - ret.push({name: e}); - }); - return ret; - } - - var coreWordList = toWordList( -'INVERT AND OR XOR\ - 2* 2/ LSHIFT RSHIFT\ - 0= = 0< < > U< MIN MAX\ - 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\ - >R R> R@\ - + - 1+ 1- ABS NEGATE\ - S>D * M* UM*\ - FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\ - HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\ - ALIGN ALIGNED +! ALLOT\ - CHAR [CHAR] [ ] BL\ - FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\ - ; DOES> >BODY\ - EVALUATE\ - SOURCE >IN\ - <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\ - FILL MOVE\ - . CR EMIT SPACE SPACES TYPE U. .R U.R\ - ACCEPT\ - TRUE FALSE\ - <> U> 0<> 0>\ - NIP TUCK ROLL PICK\ - 2>R 2R@ 2R>\ - WITHIN UNUSED MARKER\ - I J\ - TO\ - COMPILE, [COMPILE]\ - SAVE-INPUT RESTORE-INPUT\ - PAD ERASE\ - 2LITERAL DNEGATE\ - D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\ - M+ M*/ D. D.R 2ROT DU<\ - CATCH THROW\ - FREE RESIZE ALLOCATE\ - CS-PICK CS-ROLL\ - GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\ - PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\ - -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL'); - - var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE'); - - CodeMirror.defineMode('forth', function() { - function searchWordList (wordList, word) { - var i; - for (i = wordList.length - 1; i >= 0; i--) { - if (wordList[i].name === word.toUpperCase()) { - return wordList[i]; - } - } - return undefined; - } - return { - startState: function() { - return { - state: '', - base: 10, - coreWordList: coreWordList, - immediateWordList: immediateWordList, - wordList: [] - }; - }, - token: function (stream, stt) { - var mat; - if (stream.eatSpace()) { - return null; - } - if (stt.state === '') { // interpretation - if (stream.match(/^(\]|:NONAME)(\s|$)/i)) { - stt.state = ' compilation'; - return 'builtin compilation'; - } - mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/); - if (mat) { - stt.wordList.push({name: mat[2].toUpperCase()}); - stt.state = ' compilation'; - return 'def' + stt.state; - } - mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i); - if (mat) { - stt.wordList.push({name: mat[2].toUpperCase()}); - return 'def' + stt.state; - } - mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/); - if (mat) { - return 'builtin' + stt.state; - } - } else { // compilation - // ; [ - if (stream.match(/^(\;|\[)(\s)/)) { - stt.state = ''; - stream.backUp(1); - return 'builtin compilation'; - } - if (stream.match(/^(\;|\[)($)/)) { - stt.state = ''; - return 'builtin compilation'; - } - if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) { - return 'builtin'; - } - } - - // dynamic wordlist - mat = stream.match(/^(\S+)(\s+|$)/); - if (mat) { - if (searchWordList(stt.wordList, mat[1]) !== undefined) { - return 'variable' + stt.state; - } - - // comments - if (mat[1] === '\\') { - stream.skipToEnd(); - return 'comment' + stt.state; - } - - // core words - if (searchWordList(stt.coreWordList, mat[1]) !== undefined) { - return 'builtin' + stt.state; - } - if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) { - return 'keyword' + stt.state; - } - - if (mat[1] === '(') { - stream.eatWhile(function (s) { return s !== ')'; }); - stream.eat(')'); - return 'comment' + stt.state; - } - - // // strings - if (mat[1] === '.(') { - stream.eatWhile(function (s) { return s !== ')'; }); - stream.eat(')'); - return 'string' + stt.state; - } - if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') { - stream.eatWhile(function (s) { return s !== '"'; }); - stream.eat('"'); - return 'string' + stt.state; - } - - // numbers - if (mat[1] - 0xfffffffff) { - return 'number' + stt.state; - } - // if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) { - // return 'number' + stt.state; - // } - - return 'atom' + stt.state; - } - } - }; - }); - CodeMirror.defineMIME("text/x-forth", "forth"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/forth/index.html b/public/plugins/codemirror-5.17.0/mode/forth/index.html deleted file mode 100644 index ae8cd3458..000000000 --- a/public/plugins/codemirror-5.17.0/mode/forth/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Forth mode - - - - - - - - - - - -
- -

Forth mode

- -
- - - - -

Simple mode that handle Forth-Syntax (Forth on WikiPedia).

- -

MIME types defined: text/x-forth.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/fortran/fortran.js b/public/plugins/codemirror-5.17.0/mode/fortran/fortran.js deleted file mode 100644 index 4d88f006a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/fortran/fortran.js +++ /dev/null @@ -1,188 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("fortran", function() { - function words(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) { - keys[array[i]] = true; - } - return keys; - } - - var keywords = words([ - "abstract", "accept", "allocatable", "allocate", - "array", "assign", "asynchronous", "backspace", - "bind", "block", "byte", "call", "case", - "class", "close", "common", "contains", - "continue", "cycle", "data", "deallocate", - "decode", "deferred", "dimension", "do", - "elemental", "else", "encode", "end", - "endif", "entry", "enumerator", "equivalence", - "exit", "external", "extrinsic", "final", - "forall", "format", "function", "generic", - "go", "goto", "if", "implicit", "import", "include", - "inquire", "intent", "interface", "intrinsic", - "module", "namelist", "non_intrinsic", - "non_overridable", "none", "nopass", - "nullify", "open", "optional", "options", - "parameter", "pass", "pause", "pointer", - "print", "private", "program", "protected", - "public", "pure", "read", "recursive", "result", - "return", "rewind", "save", "select", "sequence", - "stop", "subroutine", "target", "then", "to", "type", - "use", "value", "volatile", "where", "while", - "write"]); - var builtins = words(["abort", "abs", "access", "achar", "acos", - "adjustl", "adjustr", "aimag", "aint", "alarm", - "all", "allocated", "alog", "amax", "amin", - "amod", "and", "anint", "any", "asin", - "associated", "atan", "besj", "besjn", "besy", - "besyn", "bit_size", "btest", "cabs", "ccos", - "ceiling", "cexp", "char", "chdir", "chmod", - "clog", "cmplx", "command_argument_count", - "complex", "conjg", "cos", "cosh", "count", - "cpu_time", "cshift", "csin", "csqrt", "ctime", - "c_funloc", "c_loc", "c_associated", "c_null_ptr", - "c_null_funptr", "c_f_pointer", "c_null_char", - "c_alert", "c_backspace", "c_form_feed", - "c_new_line", "c_carriage_return", - "c_horizontal_tab", "c_vertical_tab", "dabs", - "dacos", "dasin", "datan", "date_and_time", - "dbesj", "dbesj", "dbesjn", "dbesy", "dbesy", - "dbesyn", "dble", "dcos", "dcosh", "ddim", "derf", - "derfc", "dexp", "digits", "dim", "dint", "dlog", - "dlog", "dmax", "dmin", "dmod", "dnint", - "dot_product", "dprod", "dsign", "dsinh", - "dsin", "dsqrt", "dtanh", "dtan", "dtime", - "eoshift", "epsilon", "erf", "erfc", "etime", - "exit", "exp", "exponent", "extends_type_of", - "fdate", "fget", "fgetc", "float", "floor", - "flush", "fnum", "fputc", "fput", "fraction", - "fseek", "fstat", "ftell", "gerror", "getarg", - "get_command", "get_command_argument", - "get_environment_variable", "getcwd", - "getenv", "getgid", "getlog", "getpid", - "getuid", "gmtime", "hostnm", "huge", "iabs", - "iachar", "iand", "iargc", "ibclr", "ibits", - "ibset", "ichar", "idate", "idim", "idint", - "idnint", "ieor", "ierrno", "ifix", "imag", - "imagpart", "index", "int", "ior", "irand", - "isatty", "ishft", "ishftc", "isign", - "iso_c_binding", "is_iostat_end", "is_iostat_eor", - "itime", "kill", "kind", "lbound", "len", "len_trim", - "lge", "lgt", "link", "lle", "llt", "lnblnk", "loc", - "log", "logical", "long", "lshift", "lstat", "ltime", - "matmul", "max", "maxexponent", "maxloc", "maxval", - "mclock", "merge", "move_alloc", "min", "minexponent", - "minloc", "minval", "mod", "modulo", "mvbits", - "nearest", "new_line", "nint", "not", "or", "pack", - "perror", "precision", "present", "product", "radix", - "rand", "random_number", "random_seed", "range", - "real", "realpart", "rename", "repeat", "reshape", - "rrspacing", "rshift", "same_type_as", "scale", - "scan", "second", "selected_int_kind", - "selected_real_kind", "set_exponent", "shape", - "short", "sign", "signal", "sinh", "sin", "sleep", - "sngl", "spacing", "spread", "sqrt", "srand", "stat", - "sum", "symlnk", "system", "system_clock", "tan", - "tanh", "time", "tiny", "transfer", "transpose", - "trim", "ttynam", "ubound", "umask", "unlink", - "unpack", "verify", "xor", "zabs", "zcos", "zexp", - "zlog", "zsin", "zsqrt"]); - - var dataTypes = words(["c_bool", "c_char", "c_double", "c_double_complex", - "c_float", "c_float_complex", "c_funptr", "c_int", - "c_int16_t", "c_int32_t", "c_int64_t", "c_int8_t", - "c_int_fast16_t", "c_int_fast32_t", "c_int_fast64_t", - "c_int_fast8_t", "c_int_least16_t", "c_int_least32_t", - "c_int_least64_t", "c_int_least8_t", "c_intmax_t", - "c_intptr_t", "c_long", "c_long_double", - "c_long_double_complex", "c_long_long", "c_ptr", - "c_short", "c_signed_char", "c_size_t", "character", - "complex", "double", "integer", "logical", "real"]); - var isOperatorChar = /[+\-*&=<>\/\:]/; - var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i"); - - function tokenBase(stream, state) { - - if (stream.match(litOperator)){ - return 'operator'; - } - - var ch = stream.next(); - if (ch == "!") { - stream.skipToEnd(); - return "comment"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]\(\),]/.test(ch)) { - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var word = stream.current().toLowerCase(); - - if (keywords.hasOwnProperty(word)){ - return 'keyword'; - } - if (builtins.hasOwnProperty(word) || dataTypes.hasOwnProperty(word)) { - return 'builtin'; - } - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - // Interface - - return { - startState: function() { - return {tokenize: null}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - return style; - } - }; -}); - -CodeMirror.defineMIME("text/x-fortran", "fortran"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/fortran/index.html b/public/plugins/codemirror-5.17.0/mode/fortran/index.html deleted file mode 100644 index 9aed0efcc..000000000 --- a/public/plugins/codemirror-5.17.0/mode/fortran/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - -CodeMirror: Fortran mode - - - - - - - - - -
-

Fortran mode

- - -
- - - -

MIME types defined: text/x-fortran.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/gas/gas.js b/public/plugins/codemirror-5.17.0/mode/gas/gas.js deleted file mode 100644 index 0c74bedc5..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gas/gas.js +++ /dev/null @@ -1,345 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("gas", function(_config, parserConfig) { - 'use strict'; - - // If an architecture is specified, its initialization function may - // populate this array with custom parsing functions which will be - // tried in the event that the standard functions do not find a match. - var custom = []; - - // The symbol used to start a line comment changes based on the target - // architecture. - // If no architecture is pased in "parserConfig" then only multiline - // comments will have syntax support. - var lineCommentStartSymbol = ""; - - // These directives are architecture independent. - // Machine specific directives should go in their respective - // architecture initialization function. - // Reference: - // http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops - var directives = { - ".abort" : "builtin", - ".align" : "builtin", - ".altmacro" : "builtin", - ".ascii" : "builtin", - ".asciz" : "builtin", - ".balign" : "builtin", - ".balignw" : "builtin", - ".balignl" : "builtin", - ".bundle_align_mode" : "builtin", - ".bundle_lock" : "builtin", - ".bundle_unlock" : "builtin", - ".byte" : "builtin", - ".cfi_startproc" : "builtin", - ".comm" : "builtin", - ".data" : "builtin", - ".def" : "builtin", - ".desc" : "builtin", - ".dim" : "builtin", - ".double" : "builtin", - ".eject" : "builtin", - ".else" : "builtin", - ".elseif" : "builtin", - ".end" : "builtin", - ".endef" : "builtin", - ".endfunc" : "builtin", - ".endif" : "builtin", - ".equ" : "builtin", - ".equiv" : "builtin", - ".eqv" : "builtin", - ".err" : "builtin", - ".error" : "builtin", - ".exitm" : "builtin", - ".extern" : "builtin", - ".fail" : "builtin", - ".file" : "builtin", - ".fill" : "builtin", - ".float" : "builtin", - ".func" : "builtin", - ".global" : "builtin", - ".gnu_attribute" : "builtin", - ".hidden" : "builtin", - ".hword" : "builtin", - ".ident" : "builtin", - ".if" : "builtin", - ".incbin" : "builtin", - ".include" : "builtin", - ".int" : "builtin", - ".internal" : "builtin", - ".irp" : "builtin", - ".irpc" : "builtin", - ".lcomm" : "builtin", - ".lflags" : "builtin", - ".line" : "builtin", - ".linkonce" : "builtin", - ".list" : "builtin", - ".ln" : "builtin", - ".loc" : "builtin", - ".loc_mark_labels" : "builtin", - ".local" : "builtin", - ".long" : "builtin", - ".macro" : "builtin", - ".mri" : "builtin", - ".noaltmacro" : "builtin", - ".nolist" : "builtin", - ".octa" : "builtin", - ".offset" : "builtin", - ".org" : "builtin", - ".p2align" : "builtin", - ".popsection" : "builtin", - ".previous" : "builtin", - ".print" : "builtin", - ".protected" : "builtin", - ".psize" : "builtin", - ".purgem" : "builtin", - ".pushsection" : "builtin", - ".quad" : "builtin", - ".reloc" : "builtin", - ".rept" : "builtin", - ".sbttl" : "builtin", - ".scl" : "builtin", - ".section" : "builtin", - ".set" : "builtin", - ".short" : "builtin", - ".single" : "builtin", - ".size" : "builtin", - ".skip" : "builtin", - ".sleb128" : "builtin", - ".space" : "builtin", - ".stab" : "builtin", - ".string" : "builtin", - ".struct" : "builtin", - ".subsection" : "builtin", - ".symver" : "builtin", - ".tag" : "builtin", - ".text" : "builtin", - ".title" : "builtin", - ".type" : "builtin", - ".uleb128" : "builtin", - ".val" : "builtin", - ".version" : "builtin", - ".vtable_entry" : "builtin", - ".vtable_inherit" : "builtin", - ".warning" : "builtin", - ".weak" : "builtin", - ".weakref" : "builtin", - ".word" : "builtin" - }; - - var registers = {}; - - function x86(_parserConfig) { - lineCommentStartSymbol = "#"; - - registers.ax = "variable"; - registers.eax = "variable-2"; - registers.rax = "variable-3"; - - registers.bx = "variable"; - registers.ebx = "variable-2"; - registers.rbx = "variable-3"; - - registers.cx = "variable"; - registers.ecx = "variable-2"; - registers.rcx = "variable-3"; - - registers.dx = "variable"; - registers.edx = "variable-2"; - registers.rdx = "variable-3"; - - registers.si = "variable"; - registers.esi = "variable-2"; - registers.rsi = "variable-3"; - - registers.di = "variable"; - registers.edi = "variable-2"; - registers.rdi = "variable-3"; - - registers.sp = "variable"; - registers.esp = "variable-2"; - registers.rsp = "variable-3"; - - registers.bp = "variable"; - registers.ebp = "variable-2"; - registers.rbp = "variable-3"; - - registers.ip = "variable"; - registers.eip = "variable-2"; - registers.rip = "variable-3"; - - registers.cs = "keyword"; - registers.ds = "keyword"; - registers.ss = "keyword"; - registers.es = "keyword"; - registers.fs = "keyword"; - registers.gs = "keyword"; - } - - function armv6(_parserConfig) { - // Reference: - // http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf - // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf - lineCommentStartSymbol = "@"; - directives.syntax = "builtin"; - - registers.r0 = "variable"; - registers.r1 = "variable"; - registers.r2 = "variable"; - registers.r3 = "variable"; - registers.r4 = "variable"; - registers.r5 = "variable"; - registers.r6 = "variable"; - registers.r7 = "variable"; - registers.r8 = "variable"; - registers.r9 = "variable"; - registers.r10 = "variable"; - registers.r11 = "variable"; - registers.r12 = "variable"; - - registers.sp = "variable-2"; - registers.lr = "variable-2"; - registers.pc = "variable-2"; - registers.r13 = registers.sp; - registers.r14 = registers.lr; - registers.r15 = registers.pc; - - custom.push(function(ch, stream) { - if (ch === '#') { - stream.eatWhile(/\w/); - return "number"; - } - }); - } - - var arch = (parserConfig.architecture || "x86").toLowerCase(); - if (arch === "x86") { - x86(parserConfig); - } else if (arch === "arm" || arch === "armv6") { - armv6(parserConfig); - } - - function nextUntilUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next === end && !escaped) { - return false; - } - escaped = !escaped && next === "\\"; - } - return escaped; - } - - function clikeComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (ch === "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch === "*"); - } - return "comment"; - } - - return { - startState: function() { - return { - tokenize: null - }; - }, - - token: function(stream, state) { - if (state.tokenize) { - return state.tokenize(stream, state); - } - - if (stream.eatSpace()) { - return null; - } - - var style, cur, ch = stream.next(); - - if (ch === "/") { - if (stream.eat("*")) { - state.tokenize = clikeComment; - return clikeComment(stream, state); - } - } - - if (ch === lineCommentStartSymbol) { - stream.skipToEnd(); - return "comment"; - } - - if (ch === '"') { - nextUntilUnescaped(stream, '"'); - return "string"; - } - - if (ch === '.') { - stream.eatWhile(/\w/); - cur = stream.current().toLowerCase(); - style = directives[cur]; - return style || null; - } - - if (ch === '=') { - stream.eatWhile(/\w/); - return "tag"; - } - - if (ch === '{') { - return "braket"; - } - - if (ch === '}') { - return "braket"; - } - - if (/\d/.test(ch)) { - if (ch === "0" && stream.eat("x")) { - stream.eatWhile(/[0-9a-fA-F]/); - return "number"; - } - stream.eatWhile(/\d/); - return "number"; - } - - if (/\w/.test(ch)) { - stream.eatWhile(/\w/); - if (stream.eat(":")) { - return 'tag'; - } - cur = stream.current().toLowerCase(); - style = registers[cur]; - return style || null; - } - - for (var i = 0; i < custom.length; i++) { - style = custom[i](ch, stream, state); - if (style) { - return style; - } - } - }, - - lineComment: lineCommentStartSymbol, - blockCommentStart: "/*", - blockCommentEnd: "*/" - }; -}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/gas/index.html b/public/plugins/codemirror-5.17.0/mode/gas/index.html deleted file mode 100644 index df75ca2db..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gas/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Gas mode - - - - - - - - - -
-

Gas mode

-
- - - - - -

Handles AT&T assembler syntax (more specifically this handles - the GNU Assembler (gas) syntax.) - It takes a single optional configuration parameter: - architecture, which can be one of "ARM", - "ARMv6" or "x86". - Including the parameter adds syntax for the registers and special - directives for the supplied architecture. - -

MIME types defined: text/x-gas

-
diff --git a/public/plugins/codemirror-5.17.0/mode/gfm/gfm.js b/public/plugins/codemirror-5.17.0/mode/gfm/gfm.js deleted file mode 100644 index 6e74ad4fd..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gfm/gfm.js +++ /dev/null @@ -1,130 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i - -CodeMirror.defineMode("gfm", function(config, modeConfig) { - var codeDepth = 0; - function blankLine(state) { - state.code = false; - return null; - } - var gfmOverlay = { - startState: function() { - return { - code: false, - codeBlock: false, - ateSpace: false - }; - }, - copyState: function(s) { - return { - code: s.code, - codeBlock: s.codeBlock, - ateSpace: s.ateSpace - }; - }, - token: function(stream, state) { - state.combineTokens = null; - - // Hack to prevent formatting override inside code blocks (block and inline) - if (state.codeBlock) { - if (stream.match(/^```+/)) { - state.codeBlock = false; - return null; - } - stream.skipToEnd(); - return null; - } - if (stream.sol()) { - state.code = false; - } - if (stream.sol() && stream.match(/^```+/)) { - stream.skipToEnd(); - state.codeBlock = true; - return null; - } - // If this block is changed, it may need to be updated in Markdown mode - if (stream.peek() === '`') { - stream.next(); - var before = stream.pos; - stream.eatWhile('`'); - var difference = 1 + stream.pos - before; - if (!state.code) { - codeDepth = difference; - state.code = true; - } else { - if (difference === codeDepth) { // Must be exact - state.code = false; - } - } - return null; - } else if (state.code) { - stream.next(); - return null; - } - // Check if space. If so, links can be formatted later on - if (stream.eatSpace()) { - state.ateSpace = true; - return null; - } - if (stream.sol() || state.ateSpace) { - state.ateSpace = false; - if (modeConfig.gitHubSpice !== false) { - if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { - // User/Project@SHA - // User@SHA - // SHA - state.combineTokens = true; - return "link"; - } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { - // User/Project#Num - // User#Num - // #Num - state.combineTokens = true; - return "link"; - } - } - } - if (stream.match(urlRE) && - stream.string.slice(stream.start - 2, stream.start) != "](" && - (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) { - // URLs - // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls - // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine - // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL - state.combineTokens = true; - return "link"; - } - stream.next(); - return null; - }, - blankLine: blankLine - }; - - var markdownConfig = { - underscoresBreakWords: false, - taskLists: true, - fencedCodeBlocks: '```', - strikethrough: true - }; - for (var attr in modeConfig) { - markdownConfig[attr] = modeConfig[attr]; - } - markdownConfig.name = "markdown"; - return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay); - -}, "markdown"); - - CodeMirror.defineMIME("text/x-gfm", "gfm"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/gfm/index.html b/public/plugins/codemirror-5.17.0/mode/gfm/index.html deleted file mode 100644 index 24c90c068..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gfm/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - -CodeMirror: GFM mode - - - - - - - - - - - - - - - - - -
-

GFM mode

-
- - - -

Optionally depends on other modes for properly highlighted code blocks.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/gfm/test.js b/public/plugins/codemirror-5.17.0/mode/gfm/test.js deleted file mode 100644 index 7a1a4ccf2..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gfm/test.js +++ /dev/null @@ -1,236 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true}); - function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } - - FT("codeBackticks", - "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); - - FT("doubleBackticks", - "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); - - FT("codeBlock", - "[comment&formatting&formatting-code-block ```css]", - "[tag foo]", - "[comment&formatting&formatting-code-block ```]"); - - FT("taskList", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"); - - FT("formatting_strikethrough", - "[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]"); - - FT("formatting_strikethrough", - "foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]"); - - MT("emInWordAsterisk", - "foo[em *bar*]hello"); - - MT("emInWordUnderscore", - "foo_bar_hello"); - - MT("emStrongUnderscore", - "[strong __][em&strong _foo__][em _] bar"); - - MT("fencedCodeBlocks", - "[comment ```]", - "[comment foo]", - "", - "[comment ```]", - "bar"); - - MT("fencedCodeBlockModeSwitching", - "[comment ```javascript]", - "[variable foo]", - "", - "[comment ```]", - "bar"); - - MT("fencedCodeBlockModeSwitchingObjc", - "[comment ```objective-c]", - "[keyword @property] [variable NSString] [operator *] [variable foo];", - "[comment ```]", - "bar"); - - MT("fencedCodeBlocksNoTildes", - "~~~", - "foo", - "~~~"); - - MT("taskListAsterisk", - "[variable-2 * []] foo]", // Invalid; must have space or x between [] - "[variable-2 * [ ]]bar]", // Invalid; must have space after ] - "[variable-2 * [x]]hello]", // Invalid; must have space after ] - "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("taskListPlus", - "[variable-2 + []] foo]", // Invalid; must have space or x between [] - "[variable-2 + [ ]]bar]", // Invalid; must have space after ] - "[variable-2 + [x]]hello]", // Invalid; must have space after ] - "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("taskListDash", - "[variable-2 - []] foo]", // Invalid; must have space or x between [] - "[variable-2 - [ ]]bar]", // Invalid; must have space after ] - "[variable-2 - [x]]hello]", // Invalid; must have space after ] - "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("taskListNumber", - "[variable-2 1. []] foo]", // Invalid; must have space or x between [] - "[variable-2 2. [ ]]bar]", // Invalid; must have space after ] - "[variable-2 3. [x]]hello]", // Invalid; must have space after ] - "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("SHA", - "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"); - - MT("SHAEmphasis", - "[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); - - MT("shortSHA", - "foo [link be6a8cc] bar"); - - MT("tooShortSHA", - "foo be6a8c bar"); - - MT("longSHA", - "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"); - - MT("badSHA", - "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"); - - MT("userSHA", - "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"); - - MT("userSHAEmphasis", - "[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); - - MT("userProjectSHA", - "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"); - - MT("userProjectSHAEmphasis", - "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); - - MT("num", - "foo [link #1] bar"); - - MT("numEmphasis", - "[em *foo ][em&link #1][em *]"); - - MT("badNum", - "foo #1bar hello"); - - MT("userNum", - "foo [link bar#1] hello"); - - MT("userNumEmphasis", - "[em *foo ][em&link bar#1][em *]"); - - MT("userProjectNum", - "foo [link bar/hello#1] world"); - - MT("userProjectNumEmphasis", - "[em *foo ][em&link bar/hello#1][em *]"); - - MT("vanillaLink", - "foo [link http://www.example.com/] bar"); - - MT("vanillaLinkNoScheme", - "foo [link www.example.com] bar"); - - MT("vanillaLinkHttps", - "foo [link https://www.example.com/] bar"); - - MT("vanillaLinkDataSchema", - "foo [link data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==] bar"); - - MT("vanillaLinkPunctuation", - "foo [link http://www.example.com/]. bar"); - - MT("vanillaLinkExtension", - "foo [link http://www.example.com/index.html] bar"); - - MT("vanillaLinkEmphasis", - "foo [em *][em&link http://www.example.com/index.html][em *] bar"); - - MT("notALink", - "foo asfd:asdf bar"); - - MT("notALink", - "[comment ```css]", - "[tag foo] {[property color]:[keyword black];}", - "[comment ```][link http://www.example.com/]"); - - MT("notALink", - "[comment ``foo `bar` http://www.example.com/``] hello"); - - MT("notALink", - "[comment `foo]", - "[comment&link http://www.example.com/]", - "[comment `] foo", - "", - "[link http://www.example.com/]"); - - MT("headerCodeBlockGithub", - "[header&header-1 # heading]", - "", - "[comment ```]", - "[comment code]", - "[comment ```]", - "", - "Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]", - "Issue: [link #1]", - "Link: [link http://www.example.com/]"); - - MT("strikethrough", - "[strikethrough ~~foo~~]"); - - MT("strikethroughWithStartingSpace", - "~~ foo~~"); - - MT("strikethroughUnclosedStrayTildes", - "[strikethrough ~~foo~~~]"); - - MT("strikethroughUnclosedStrayTildes", - "[strikethrough ~~foo ~~]"); - - MT("strikethroughUnclosedStrayTildes", - "[strikethrough ~~foo ~~ bar]"); - - MT("strikethroughUnclosedStrayTildes", - "[strikethrough ~~foo ~~ bar~~]hello"); - - MT("strikethroughOneLetter", - "[strikethrough ~~a~~]"); - - MT("strikethroughWrapped", - "[strikethrough ~~foo]", - "[strikethrough foo~~]"); - - MT("strikethroughParagraph", - "[strikethrough ~~foo]", - "", - "foo[strikethrough ~~bar]"); - - MT("strikethroughEm", - "[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]"); - - MT("strikethroughEm", - "[em *][em&strikethrough ~~foo~~][em *]"); - - MT("strikethroughStrong", - "[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]"); - - MT("strikethroughStrong", - "[strong **][strong&strikethrough ~~foo~~][strong **]"); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/gherkin/gherkin.js b/public/plugins/codemirror-5.17.0/mode/gherkin/gherkin.js deleted file mode 100644 index fc2ebee16..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gherkin/gherkin.js +++ /dev/null @@ -1,178 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* -Gherkin mode - http://www.cukes.info/ -Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues -*/ - -// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js -//var Quotes = { -// SINGLE: 1, -// DOUBLE: 2 -//}; - -//var regex = { -// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/ -//}; - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("gherkin", function () { - return { - startState: function () { - return { - lineNumber: 0, - tableHeaderLine: false, - allowFeature: true, - allowBackground: false, - allowScenario: false, - allowSteps: false, - allowPlaceholders: false, - allowMultilineArgument: false, - inMultilineString: false, - inMultilineTable: false, - inKeywordLine: false - }; - }, - token: function (stream, state) { - if (stream.sol()) { - state.lineNumber++; - state.inKeywordLine = false; - if (state.inMultilineTable) { - state.tableHeaderLine = false; - if (!stream.match(/\s*\|/, false)) { - state.allowMultilineArgument = false; - state.inMultilineTable = false; - } - } - } - - stream.eatSpace(); - - if (state.allowMultilineArgument) { - - // STRING - if (state.inMultilineString) { - if (stream.match('"""')) { - state.inMultilineString = false; - state.allowMultilineArgument = false; - } else { - stream.match(/.*/); - } - return "string"; - } - - // TABLE - if (state.inMultilineTable) { - if (stream.match(/\|\s*/)) { - return "bracket"; - } else { - stream.match(/[^\|]*/); - return state.tableHeaderLine ? "header" : "string"; - } - } - - // DETECT START - if (stream.match('"""')) { - // String - state.inMultilineString = true; - return "string"; - } else if (stream.match("|")) { - // Table - state.inMultilineTable = true; - state.tableHeaderLine = true; - return "bracket"; - } - - } - - // LINE COMMENT - if (stream.match(/#.*/)) { - return "comment"; - - // TAG - } else if (!state.inKeywordLine && stream.match(/@\S+/)) { - return "tag"; - - // FEATURE - } else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) { - state.allowScenario = true; - state.allowBackground = true; - state.allowPlaceholders = false; - state.allowSteps = false; - state.allowMultilineArgument = false; - state.inKeywordLine = true; - return "keyword"; - - // BACKGROUND - } else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) { - state.allowPlaceholders = false; - state.allowSteps = true; - state.allowBackground = false; - state.allowMultilineArgument = false; - state.inKeywordLine = true; - return "keyword"; - - // SCENARIO OUTLINE - } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) { - state.allowPlaceholders = true; - state.allowSteps = true; - state.allowMultilineArgument = false; - state.inKeywordLine = true; - return "keyword"; - - // EXAMPLES - } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) { - state.allowPlaceholders = false; - state.allowSteps = true; - state.allowBackground = false; - state.allowMultilineArgument = true; - return "keyword"; - - // SCENARIO - } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) { - state.allowPlaceholders = false; - state.allowSteps = true; - state.allowBackground = false; - state.allowMultilineArgument = false; - state.inKeywordLine = true; - return "keyword"; - - // STEPS - } else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) { - state.inStep = true; - state.allowPlaceholders = true; - state.allowMultilineArgument = true; - state.inKeywordLine = true; - return "keyword"; - - // INLINE STRING - } else if (stream.match(/"[^"]*"?/)) { - return "string"; - - // PLACEHOLDER - } else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) { - return "variable"; - - // Fall through - } else { - stream.next(); - stream.eatWhile(/[^@"<#]/); - return null; - } - } - }; -}); - -CodeMirror.defineMIME("text/x-feature", "gherkin"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/gherkin/index.html b/public/plugins/codemirror-5.17.0/mode/gherkin/index.html deleted file mode 100644 index af8184c98..000000000 --- a/public/plugins/codemirror-5.17.0/mode/gherkin/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - -CodeMirror: Gherkin mode - - - - - - - - - -
-

Gherkin mode

-
- - -

MIME types defined: text/x-feature.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/go/go.js b/public/plugins/codemirror-5.17.0/mode/go/go.js deleted file mode 100644 index 3c9ef6b98..000000000 --- a/public/plugins/codemirror-5.17.0/mode/go/go.js +++ /dev/null @@ -1,185 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("go", function(config) { - var indentUnit = config.indentUnit; - - var keywords = { - "break":true, "case":true, "chan":true, "const":true, "continue":true, - "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, - "func":true, "go":true, "goto":true, "if":true, "import":true, - "interface":true, "map":true, "package":true, "range":true, "return":true, - "select":true, "struct":true, "switch":true, "type":true, "var":true, - "bool":true, "byte":true, "complex64":true, "complex128":true, - "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, - "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, - "uint64":true, "int":true, "uint":true, "uintptr":true, "error": true - }; - - var atoms = { - "true":true, "false":true, "iota":true, "nil":true, "append":true, - "cap":true, "close":true, "complex":true, "copy":true, "imag":true, - "len":true, "make":true, "new":true, "panic":true, "print":true, - "println":true, "real":true, "recover":true - }; - - var isOperatorChar = /[+\-*&^%:=<>!|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'" || ch == "`") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\d\.]/.test(ch)) { - if (ch == ".") { - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); - } else if (ch == "0") { - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); - } else { - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); - } - return "number"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (cur == "case" || cur == "default") curPunc = "case"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && quote != "`" && next == "\\"; - } - if (end || !(escaped || quote == "`")) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - if (!state.context.prev) return; - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - if (ctx.type == "case") ctx.type = "}"; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "case") ctx.type = "case"; - else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state); - else if (curPunc == ctx.type) popContext(state); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) { - state.context.type = "}"; - return ctx.indented; - } - var closing = firstChar == ctx.type; - if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}):", - fold: "brace", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-go", "go"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/go/index.html b/public/plugins/codemirror-5.17.0/mode/go/index.html deleted file mode 100644 index 72e3b364c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/go/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Go mode - - - - - - - - - - - -
-

Go mode

-
- - - -

MIME type: text/x-go

-
diff --git a/public/plugins/codemirror-5.17.0/mode/groovy/groovy.js b/public/plugins/codemirror-5.17.0/mode/groovy/groovy.js deleted file mode 100644 index 721933b01..000000000 --- a/public/plugins/codemirror-5.17.0/mode/groovy/groovy.js +++ /dev/null @@ -1,230 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("groovy", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words( - "abstract as assert boolean break byte case catch char class const continue def default " + - "do double else enum extends final finally float for goto if implements import in " + - "instanceof int interface long native new package private protected public return " + - "short static strictfp super switch synchronized threadsafe throw throws transient " + - "try void volatile while"); - var blockKeywords = words("catch class do else finally for if switch try while enum interface def"); - var standaloneKeywords = words("return break continue"); - var atoms = words("null true false this"); - - var curPunc; - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return startString(ch, stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); } - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize.push(tokenComment); - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - if (expectExpression(state.lastToken, false)) { - return startString(ch, stream, state); - } - } - if (ch == "-" && stream.eat(">")) { - curPunc = "->"; - return null; - } - if (/[+\-*&%=<>!?|\/~]/.test(ch)) { - stream.eatWhile(/[+\-*&%=<>|~]/); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; } - if (state.lastToken == ".") return "property"; - if (stream.eat(":")) { curPunc = "proplabel"; return "property"; } - var cur = stream.current(); - if (atoms.propertyIsEnumerable(cur)) { return "atom"; } - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - else if (standaloneKeywords.propertyIsEnumerable(cur)) curPunc = "standalone"; - return "keyword"; - } - return "variable"; - } - tokenBase.isBase = true; - - function startString(quote, stream, state) { - var tripleQuoted = false; - if (quote != "/" && stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; - } - function t(stream, state) { - var escaped = false, next, end = !tripleQuoted; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - if (!tripleQuoted) { break; } - if (stream.match(quote + quote)) { end = true; break; } - } - if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace()); - return "string"; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize.pop(); - return "string"; - } - state.tokenize.push(t); - return t(stream, state); - } - - function tokenBaseUntilBrace() { - var depth = 1; - function t(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - } - t.isBase = true; - return t; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize.pop(); - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function expectExpression(last, newline) { - return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || - last == "newstatement" || last == "keyword" || last == "proplabel" || - (last == "standalone" && !newline); - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: [tokenBase], - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true, - lastToken: null - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - // Automatic semicolon insertion - if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) { - popContext(state); ctx = state.context; - } - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = state.tokenize[state.tokenize.length-1](stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - // Handle indentation for {x -> \n ... } - else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { - popContext(state); - state.context.align = false; - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - state.lastToken = curPunc || style; - return style; - }, - - indent: function(state, textAfter) { - if (!state.tokenize[state.tokenize.length-1].isBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; - if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - - electricChars: "{}", - closeBrackets: {triples: "'\""}, - fold: "brace" - }; -}); - -CodeMirror.defineMIME("text/x-groovy", "groovy"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/groovy/index.html b/public/plugins/codemirror-5.17.0/mode/groovy/index.html deleted file mode 100644 index bb0df078c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/groovy/index.html +++ /dev/null @@ -1,84 +0,0 @@ - - -CodeMirror: Groovy mode - - - - - - - - - - -
-

Groovy mode

-
- - - -

MIME types defined: text/x-groovy

-
diff --git a/public/plugins/codemirror-5.17.0/mode/haml/haml.js b/public/plugins/codemirror-5.17.0/mode/haml/haml.js deleted file mode 100644 index 20ae1e19c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haml/haml.js +++ /dev/null @@ -1,161 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - - // full haml mode. This handled embedded ruby and html fragments too - CodeMirror.defineMode("haml", function(config) { - var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); - var rubyMode = CodeMirror.getMode(config, "ruby"); - - function rubyInQuote(endQuote) { - return function(stream, state) { - var ch = stream.peek(); - if (ch == endQuote && state.rubyState.tokenize.length == 1) { - // step out of ruby context as it seems to complete processing all the braces - stream.next(); - state.tokenize = html; - return "closeAttributeTag"; - } else { - return ruby(stream, state); - } - }; - } - - function ruby(stream, state) { - if (stream.match("-#")) { - stream.skipToEnd(); - return "comment"; - } - return rubyMode.token(stream, state.rubyState); - } - - function html(stream, state) { - var ch = stream.peek(); - - // handle haml declarations. All declarations that cant be handled here - // will be passed to html mode - if (state.previousToken.style == "comment" ) { - if (state.indented > state.previousToken.indented) { - stream.skipToEnd(); - return "commentLine"; - } - } - - if (state.startOfLine) { - if (ch == "!" && stream.match("!!")) { - stream.skipToEnd(); - return "tag"; - } else if (stream.match(/^%[\w:#\.]+=/)) { - state.tokenize = ruby; - return "hamlTag"; - } else if (stream.match(/^%[\w:]+/)) { - return "hamlTag"; - } else if (ch == "/" ) { - stream.skipToEnd(); - return "comment"; - } - } - - if (state.startOfLine || state.previousToken.style == "hamlTag") { - if ( ch == "#" || ch == ".") { - stream.match(/[\w-#\.]*/); - return "hamlAttribute"; - } - } - - // donot handle --> as valid ruby, make it HTML close comment instead - if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { - state.tokenize = ruby; - return state.tokenize(stream, state); - } - - if (state.previousToken.style == "hamlTag" || - state.previousToken.style == "closeAttributeTag" || - state.previousToken.style == "hamlAttribute") { - if (ch == "(") { - state.tokenize = rubyInQuote(")"); - return state.tokenize(stream, state); - } else if (ch == "{") { - if (!stream.match(/^\{%.*/)) { - state.tokenize = rubyInQuote("}"); - return state.tokenize(stream, state); - } - } - } - - return htmlMode.token(stream, state.htmlState); - } - - return { - // default to html mode - startState: function() { - var htmlState = CodeMirror.startState(htmlMode); - var rubyState = CodeMirror.startState(rubyMode); - return { - htmlState: htmlState, - rubyState: rubyState, - indented: 0, - previousToken: { style: null, indented: 0}, - tokenize: html - }; - }, - - copyState: function(state) { - return { - htmlState : CodeMirror.copyState(htmlMode, state.htmlState), - rubyState: CodeMirror.copyState(rubyMode, state.rubyState), - indented: state.indented, - previousToken: state.previousToken, - tokenize: state.tokenize - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - state.startOfLine = false; - // dont record comment line as we only want to measure comment line with - // the opening comment block - if (style && style != "commentLine") { - state.previousToken = { style: style, indented: state.indented }; - } - // if current state is ruby and the previous token is not `,` reset the - // tokenize to html - if (stream.eol() && state.tokenize == ruby) { - stream.backUp(1); - var ch = stream.peek(); - stream.next(); - if (ch && ch != ",") { - state.tokenize = html; - } - } - // reprocess some of the specific style tag when finish setting previousToken - if (style == "hamlTag") { - style = "tag"; - } else if (style == "commentLine") { - style = "comment"; - } else if (style == "hamlAttribute") { - style = "attribute"; - } else if (style == "closeAttributeTag") { - style = null; - } - return style; - } - }; - }, "htmlmixed", "ruby"); - - CodeMirror.defineMIME("text/x-haml", "haml"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/haml/index.html b/public/plugins/codemirror-5.17.0/mode/haml/index.html deleted file mode 100644 index 2894a938e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haml/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: HAML mode - - - - - - - - - - - - - -
-

HAML mode

-
- - -

MIME types defined: text/x-haml.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/haml/test.js b/public/plugins/codemirror-5.17.0/mode/haml/test.js deleted file mode 100644 index 508458a43..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haml/test.js +++ /dev/null @@ -1,97 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Requires at least one media query - MT("elementName", - "[tag %h1] Hey There"); - - MT("oneElementPerLine", - "[tag %h1] Hey There %h2"); - - MT("idSelector", - "[tag %h1][attribute #test] Hey There"); - - MT("classSelector", - "[tag %h1][attribute .hello] Hey There"); - - MT("docType", - "[tag !!! XML]"); - - MT("comment", - "[comment / Hello WORLD]"); - - MT("notComment", - "[tag %h1] This is not a / comment "); - - MT("attributes", - "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}"); - - MT("htmlCode", - "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); - - MT("rubyBlock", - "[operator =][variable-2 @item]"); - - MT("selectorRubyBlock", - "[tag %a.selector=] [variable-2 @item]"); - - MT("nestedRubyBlock", - "[tag %a]", - " [operator =][variable puts] [string \"test\"]"); - - MT("multilinePlaintext", - "[tag %p]", - " Hello,", - " World"); - - MT("multilineRuby", - "[tag %p]", - " [comment -# this is a comment]", - " [comment and this is a comment too]", - " Date/Time", - " [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]", - " [tag %strong=] [variable now]", - " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", - " [operator =][string \"Happy\"]", - " [operator =][string \"Belated\"]", - " [operator =][string \"Birthday\"]"); - - MT("multilineComment", - "[comment /]", - " [comment Multiline]", - " [comment Comment]"); - - MT("hamlComment", - "[comment -# this is a comment]"); - - MT("multilineHamlComment", - "[comment -# this is a comment]", - " [comment and this is a comment too]"); - - MT("multilineHTMLComment", - "[comment ]"); - - MT("hamlAfterRubyTag", - "[attribute .block]", - " [tag %strong=] [variable now]", - " [attribute .test]", - " [operator =][variable now]", - " [attribute .right]"); - - MT("stretchedRuby", - "[operator =] [variable puts] [string \"Hello\"],", - " [string \"World\"]"); - - MT("interpolationInHashAttribute", - //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); - "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); - - MT("interpolationInHTMLAttribute", - "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/handlebars/handlebars.js b/public/plugins/codemirror-5.17.0/mode/handlebars/handlebars.js deleted file mode 100644 index 2174e5384..000000000 --- a/public/plugins/codemirror-5.17.0/mode/handlebars/handlebars.js +++ /dev/null @@ -1,62 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple"), require("../../addon/mode/multiplex")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple", "../../addon/mode/multiplex"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineSimpleMode("handlebars-tags", { - start: [ - { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, - { regex: /\{\{!/, push: "comment", token: "comment" }, - { regex: /\{\{/, push: "handlebars", token: "tag" } - ], - handlebars: [ - { regex: /\}\}/, pop: true, token: "tag" }, - - // Double and single quotes - { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, - { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, - - // Handlebars keywords - { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, - { regex: /(?:else|this)\b/, token: "keyword" }, - - // Numeral - { regex: /\d+/i, token: "number" }, - - // Atoms like = and . - { regex: /=|~|@|true|false/, token: "atom" }, - - // Paths - { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } - ], - dash_comment: [ - { regex: /--\}\}/, pop: true, token: "comment" }, - - // Commented code - { regex: /./, token: "comment"} - ], - comment: [ - { regex: /\}\}/, pop: true, token: "comment" }, - { regex: /./, token: "comment" } - ] - }); - - CodeMirror.defineMode("handlebars", function(config, parserConfig) { - var handlebars = CodeMirror.getMode(config, "handlebars-tags"); - if (!parserConfig || !parserConfig.base) return handlebars; - return CodeMirror.multiplexingMode( - CodeMirror.getMode(config, parserConfig.base), - {open: "{{", close: "}}", mode: handlebars, parseDelimiters: true} - ); - }); - - CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/handlebars/index.html b/public/plugins/codemirror-5.17.0/mode/handlebars/index.html deleted file mode 100644 index b1bfad1ca..000000000 --- a/public/plugins/codemirror-5.17.0/mode/handlebars/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: Handlebars mode - - - - - - - - - - - - -
-

Handlebars

-
- - -

Handlebars syntax highlighting for CodeMirror.

- -

MIME types defined: text/x-handlebars-template

- -

Supported options: base to set the mode to - wrap. For example, use

-
mode: {name: "handlebars", base: "text/html"}
-

to highlight an HTML template.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/haskell-literate/haskell-literate.js b/public/plugins/codemirror-5.17.0/mode/haskell-literate/haskell-literate.js deleted file mode 100644 index 906415b4c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haskell-literate/haskell-literate.js +++ /dev/null @@ -1,43 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function (mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../haskell/haskell")) - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../haskell/haskell"], mod) - else // Plain browser env - mod(CodeMirror) -})(function (CodeMirror) { - "use strict" - - CodeMirror.defineMode("haskell-literate", function (config, parserConfig) { - var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell") - - return { - startState: function () { - return { - inCode: false, - baseState: CodeMirror.startState(baseMode) - } - }, - token: function (stream, state) { - if (stream.sol()) { - if (state.inCode = stream.eat(">")) - return "meta" - } - if (state.inCode) { - return baseMode.token(stream, state.baseState) - } else { - stream.skipToEnd() - return "comment" - } - }, - innerMode: function (state) { - return state.inCode ? {state: state.baseState, mode: baseMode} : null - } - } - }, "haskell") - - CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate") -}); diff --git a/public/plugins/codemirror-5.17.0/mode/haskell-literate/index.html b/public/plugins/codemirror-5.17.0/mode/haskell-literate/index.html deleted file mode 100644 index 8c9bc60d1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haskell-literate/index.html +++ /dev/null @@ -1,282 +0,0 @@ - - -CodeMirror: Haskell-literate mode - - - - - - - - - - -
-

Haskell literate mode

-
- - - -

MIME types - defined: text/x-literate-haskell.

- -

Parser configuration parameters recognized: base to - set the base mode (defaults to "haskell").

- - - -
diff --git a/public/plugins/codemirror-5.17.0/mode/haskell/haskell.js b/public/plugins/codemirror-5.17.0/mode/haskell/haskell.js deleted file mode 100644 index fe0bab67e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haskell/haskell.js +++ /dev/null @@ -1,267 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("haskell", function(_config, modeConfig) { - - function switchState(source, setState, f) { - setState(f); - return f(source, setState); - } - - // These should all be Unicode extended, as per the Haskell 2010 report - var smallRE = /[a-z_]/; - var largeRE = /[A-Z]/; - var digitRE = /\d/; - var hexitRE = /[0-9A-Fa-f]/; - var octitRE = /[0-7]/; - var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/; - var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; - var specialRE = /[(),;[\]`{}]/; - var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer - - function normal(source, setState) { - if (source.eatWhile(whiteCharRE)) { - return null; - } - - var ch = source.next(); - if (specialRE.test(ch)) { - if (ch == '{' && source.eat('-')) { - var t = "comment"; - if (source.eat('#')) { - t = "meta"; - } - return switchState(source, setState, ncomment(t, 1)); - } - return null; - } - - if (ch == '\'') { - if (source.eat('\\')) { - source.next(); // should handle other escapes here - } - else { - source.next(); - } - if (source.eat('\'')) { - return "string"; - } - return "error"; - } - - if (ch == '"') { - return switchState(source, setState, stringLiteral); - } - - if (largeRE.test(ch)) { - source.eatWhile(idRE); - if (source.eat('.')) { - return "qualifier"; - } - return "variable-2"; - } - - if (smallRE.test(ch)) { - source.eatWhile(idRE); - return "variable"; - } - - if (digitRE.test(ch)) { - if (ch == '0') { - if (source.eat(/[xX]/)) { - source.eatWhile(hexitRE); // should require at least 1 - return "integer"; - } - if (source.eat(/[oO]/)) { - source.eatWhile(octitRE); // should require at least 1 - return "number"; - } - } - source.eatWhile(digitRE); - var t = "number"; - if (source.match(/^\.\d+/)) { - t = "number"; - } - if (source.eat(/[eE]/)) { - t = "number"; - source.eat(/[-+]/); - source.eatWhile(digitRE); // should require at least 1 - } - return t; - } - - if (ch == "." && source.eat(".")) - return "keyword"; - - if (symbolRE.test(ch)) { - if (ch == '-' && source.eat(/-/)) { - source.eatWhile(/-/); - if (!source.eat(symbolRE)) { - source.skipToEnd(); - return "comment"; - } - } - var t = "variable"; - if (ch == ':') { - t = "variable-2"; - } - source.eatWhile(symbolRE); - return t; - } - - return "error"; - } - - function ncomment(type, nest) { - if (nest == 0) { - return normal; - } - return function(source, setState) { - var currNest = nest; - while (!source.eol()) { - var ch = source.next(); - if (ch == '{' && source.eat('-')) { - ++currNest; - } - else if (ch == '-' && source.eat('}')) { - --currNest; - if (currNest == 0) { - setState(normal); - return type; - } - } - } - setState(ncomment(type, currNest)); - return type; - }; - } - - function stringLiteral(source, setState) { - while (!source.eol()) { - var ch = source.next(); - if (ch == '"') { - setState(normal); - return "string"; - } - if (ch == '\\') { - if (source.eol() || source.eat(whiteCharRE)) { - setState(stringGap); - return "string"; - } - if (source.eat('&')) { - } - else { - source.next(); // should handle other escapes here - } - } - } - setState(normal); - return "error"; - } - - function stringGap(source, setState) { - if (source.eat('\\')) { - return switchState(source, setState, stringLiteral); - } - source.next(); - setState(normal); - return "error"; - } - - - var wellKnownWords = (function() { - var wkw = {}; - function setType(t) { - return function () { - for (var i = 0; i < arguments.length; i++) - wkw[arguments[i]] = t; - }; - } - - setType("keyword")( - "case", "class", "data", "default", "deriving", "do", "else", "foreign", - "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", - "module", "newtype", "of", "then", "type", "where", "_"); - - setType("keyword")( - "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); - - setType("builtin")( - "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", - "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); - - setType("builtin")( - "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", - "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", - "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", - "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", - "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", - "String", "True"); - - setType("builtin")( - "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", - "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", - "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", - "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", - "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", - "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", - "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", - "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", - "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", - "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", - "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", - "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", - "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", - "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", - "otherwise", "pi", "pred", "print", "product", "properFraction", - "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", - "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", - "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", - "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", - "sequence", "sequence_", "show", "showChar", "showList", "showParen", - "showString", "shows", "showsPrec", "significand", "signum", "sin", - "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", - "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", - "toRational", "truncate", "uncurry", "undefined", "unlines", "until", - "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", - "zip3", "zipWith", "zipWith3"); - - var override = modeConfig.overrideKeywords; - if (override) for (var word in override) if (override.hasOwnProperty(word)) - wkw[word] = override[word]; - - return wkw; - })(); - - - - return { - startState: function () { return { f: normal }; }, - copyState: function (s) { return { f: s.f }; }, - - token: function(stream, state) { - var t = state.f(stream, function(s) { state.f = s; }); - var w = stream.current(); - return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t; - }, - - blockCommentStart: "{-", - blockCommentEnd: "-}", - lineComment: "--" - }; - -}); - -CodeMirror.defineMIME("text/x-haskell", "haskell"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/haskell/index.html b/public/plugins/codemirror-5.17.0/mode/haskell/index.html deleted file mode 100644 index 42240b0f2..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haskell/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: Haskell mode - - - - - - - - - - - -
-

Haskell mode

-
- - - -

MIME types defined: text/x-haskell.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/haxe/haxe.js b/public/plugins/codemirror-5.17.0/mode/haxe/haxe.js deleted file mode 100644 index a9573dd71..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haxe/haxe.js +++ /dev/null @@ -1,515 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("haxe", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - // Tokenizer - - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; - var type = kw("typedef"); - var keywords = { - "if": A, "while": A, "else": B, "do": B, "try": B, - "return": C, "break": C, "continue": C, "new": C, "throw": C, - "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), - "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), - "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "never": kw("property_access"), "trace":kw("trace"), - "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, - "true": atom, "false": atom, "null": atom - }; - - var isOperatorChar = /[+\-*&%=<>!?|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function toUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) - return true; - escaped = !escaped && next == "\\"; - } - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function haxeTokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return chain(stream, state, haxeTokenString(ch)); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { - stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { - toUnescaped(stream, "/"); - stream.eatWhile(/[gimsu]/); - return ret("regexp", "string-2"); - } else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, haxeTokenComment); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - } else if (ch == "#") { - stream.skipToEnd(); - return ret("conditional", "meta"); - } else if (ch == "@") { - stream.eat(/:/); - stream.eatWhile(/[\w_]/); - return ret ("metadata", "meta"); - } else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } else { - var word; - if(/[A-Z]/.test(ch)) { - stream.eatWhile(/[\w_<>]/); - word = stream.current(); - return ret("type", "variable-3", word); - } else { - stream.eatWhile(/[\w_]/); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.kwAllowed) ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - } - - function haxeTokenString(quote) { - return function(stream, state) { - if (toUnescaped(stream, quote)) - state.tokenize = haxeTokenBase; - return ret("string", "string"); - }; - } - - function haxeTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = haxeTokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; - - function HaxeLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - } - - function parseHaxe(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - if (type == "variable" && imported(state, content)) return "variable-3"; - return style; - } - } - } - - function imported(state, typename) { - if (/[a-z]/.test(typename.charAt(0))) - return false; - var len = state.importedtypes.length; - for (var i = 0; i= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function inList(name, list) { - for (var v = list; v; v = v.next) - if (v.name == name) return true; - return false; - } - function register(varname) { - var state = cx.state; - if (state.context) { - cx.marked = "def"; - if (inList(varname, state.localVars)) return; - state.localVars = {name: varname, next: state.localVars}; - } else if (state.globalVars) { - if (inList(varname, state.globalVars)) return; - state.globalVars = {name: varname, next: state.globalVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: null}; - function pushcontext() { - if (!cx.state.context) cx.state.localVars = defaultVars; - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - popcontext.lex = true; - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - function f(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(f); - } - return f; - } - - function statement(type) { - if (type == "@") return cont(metadef); - if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext); - if (type == ";") return cont(); - if (type == "attribute") return cont(maybeattribute); - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), - poplex, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - if (type == "import") return cont(importdef, expect(";")); - if (type == "typedef") return cont(typedef); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); - if (type == "type" ) return cont(maybeoperator); - if (type == "function") return cont(functiondef); - if (type == "keyword c") return cont(maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); - if (type == "operator") return cont(expression); - if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator); - if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperator(type, value) { - if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); - if (type == "operator" || type == ":") return cont(expression); - if (type == ";") return; - if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); - if (type == ".") return cont(property, maybeoperator); - if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); - } - - function maybeattribute(type) { - if (type == "attribute") return cont(maybeattribute); - if (type == "function") return cont(functiondef); - if (type == "var") return cont(vardef1); - } - - function metadef(type) { - if(type == ":") return cont(metadef); - if(type == "variable") return cont(metadef); - if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement); - } - function metaargs(type) { - if(type == "variable") return cont(); - } - - function importdef (type, value) { - if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } - else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef); - } - - function typedef (type, value) - { - if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } - else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); } - } - - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperator, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type) { - if (type == "variable") cx.marked = "property"; - if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") return cont(what, proceed); - if (type == end) return cont(); - return cont(expect(end)); - } - return function(type) { - if (type == end) return cont(); - else return pass(what, proceed); - }; - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function vardef1(type, value) { - if (type == "variable"){register(value); return cont(typeuse, vardef2);} - return cont(); - } - function vardef2(type, value) { - if (value == "=") return cont(expression, vardef2); - if (type == ",") return cont(vardef1); - } - function forspec1(type, value) { - if (type == "variable") { - register(value); - return cont(forin, expression) - } else { - return pass() - } - } - function forin(_type, value) { - if (value == "in") return cont(); - } - function functiondef(type, value) { - //function names starting with upper-case letters are recognised as types, so cludging them together here. - if (type == "variable" || type == "type") {register(value); return cont(functiondef);} - if (value == "new") return cont(functiondef); - if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext); - } - function typeuse(type) { - if(type == ":") return cont(typestring); - } - function typestring(type) { - if(type == "type") return cont(); - if(type == "variable") return cont(); - if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex); - } - function typeprop(type) { - if(type == "variable") return cont(typeuse); - } - function funarg(type, value) { - if (type == "variable") {register(value); return cont(typeuse);} - } - - // Interface - return { - startState: function(basecolumn) { - var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"]; - var state = { - tokenize: haxeTokenBase, - reAllowed: true, - kwAllowed: true, - cc: [], - lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - importedtypes: defaulttypes, - context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") - state.globalVars = parserConfig.globalVars; - return state; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/)); - state.kwAllowed = type != '.'; - return parseHaxe(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize != haxeTokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; - if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + 4; - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "stat" || type == "form") return lexical.indented + indentUnit; - else if (lexical.info == "switch" && !closing) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-haxe", "haxe"); - -CodeMirror.defineMode("hxml", function () { - - return { - startState: function () { - return { - define: false, - inString: false - }; - }, - token: function (stream, state) { - var ch = stream.peek(); - var sol = stream.sol(); - - ///* comments */ - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - if (sol && ch == "-") { - var style = "variable-2"; - - stream.eat(/-/); - - if (stream.peek() == "-") { - stream.eat(/-/); - style = "keyword a"; - } - - if (stream.peek() == "D") { - stream.eat(/[D]/); - style = "keyword c"; - state.define = true; - } - - stream.eatWhile(/[A-Z]/i); - return style; - } - - var ch = stream.peek(); - - if (state.inString == false && ch == "'") { - state.inString = true; - ch = stream.next(); - } - - if (state.inString == true) { - if (stream.skipTo("'")) { - - } else { - stream.skipToEnd(); - } - - if (stream.peek() == "'") { - stream.next(); - state.inString = false; - } - - return "string"; - } - - stream.next(); - return null; - }, - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-hxml", "hxml"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/haxe/index.html b/public/plugins/codemirror-5.17.0/mode/haxe/index.html deleted file mode 100644 index d415b5e10..000000000 --- a/public/plugins/codemirror-5.17.0/mode/haxe/index.html +++ /dev/null @@ -1,124 +0,0 @@ - - -CodeMirror: Haxe mode - - - - - - - - - -
-

Haxe mode

- - -

- -

Hxml mode:

- -

-
- - - -

MIME types defined: text/x-haxe, text/x-hxml.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/htmlembedded/htmlembedded.js b/public/plugins/codemirror-5.17.0/mode/htmlembedded/htmlembedded.js deleted file mode 100644 index 464dc57f8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/htmlembedded/htmlembedded.js +++ /dev/null @@ -1,28 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), - require("../../addon/mode/multiplex")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", - "../../addon/mode/multiplex"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { - return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { - open: parserConfig.open || parserConfig.scriptStartRegex || "<%", - close: parserConfig.close || parserConfig.scriptEndRegex || "%>", - mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) - }); - }, "htmlmixed"); - - CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); - CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); - CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); - CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/htmlembedded/index.html b/public/plugins/codemirror-5.17.0/mode/htmlembedded/index.html deleted file mode 100644 index 9ed33cffe..000000000 --- a/public/plugins/codemirror-5.17.0/mode/htmlembedded/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - -CodeMirror: Html Embedded Scripts mode - - - - - - - - - - - - - - -
-

Html Embedded Scripts mode

-
- - - -

Mode for html embedded scripts like JSP and ASP.NET. Depends on multiplex and HtmlMixed which in turn depends on - JavaScript, CSS and XML.
Other dependencies include those of the scripting language chosen.

- -

MIME types defined: application/x-aspx (ASP.NET), - application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages) - and application/x-erb

-
diff --git a/public/plugins/codemirror-5.17.0/mode/htmlmixed/htmlmixed.js b/public/plugins/codemirror-5.17.0/mode/htmlmixed/htmlmixed.js deleted file mode 100644 index d74083ee1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/htmlmixed/htmlmixed.js +++ /dev/null @@ -1,152 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var defaultTags = { - script: [ - ["lang", /(javascript|babel)/i, "javascript"], - ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/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"] - ] - }; - - function maybeBackup(stream, pat, style) { - var cur = stream.current(), close = cur.search(pat); - if (close > -1) { - stream.backUp(cur.length - close); - } else if (cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur); - } - return style; - } - - var attrRegexpCache = {}; - function getAttrRegexp(attr) { - var regexp = attrRegexpCache[attr]; - if (regexp) return regexp; - return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"); - } - - function getAttrValue(text, attr) { - var match = text.match(getAttrRegexp(attr)) - return match ? match[2] : "" - } - - function getTagRegexp(tagName, anchored) { - return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); - } - - function addTags(from, to) { - for (var tag in from) { - var dest = to[tag] || (to[tag] = []); - var source = from[tag]; - for (var i = source.length - 1; i >= 0; i--) - dest.unshift(source[i]) - } - } - - function findMatchingMode(tagInfo, tagText) { - for (var i = 0; i < tagInfo.length; i++) { - var spec = tagInfo[i]; - if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2]; - } - } - - CodeMirror.defineMode("htmlmixed", function (config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, { - name: "xml", - htmlMode: true, - multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, - multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag - }); - - var tags = {}; - var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes; - addTags(defaultTags, tags); - if (configTags) addTags(configTags, tags); - if (configScript) for (var i = configScript.length - 1; i >= 0; i--) - tags.script.unshift(["type", configScript[i].matches, configScript[i].mode]) - - function html(stream, state) { - var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName - if (tag && !/[<>\s\/]/.test(stream.current()) && - (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) && - tags.hasOwnProperty(tagName)) { - state.inTag = tagName + " " - } else if (state.inTag && tag && />$/.test(stream.current())) { - var inTag = /^([\S]+) (.*)/.exec(state.inTag) - state.inTag = null - var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2]) - var mode = CodeMirror.getMode(config, modeSpec) - var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false); - state.token = function (stream, state) { - if (stream.match(endTagA, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; - } - return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState)); - }; - state.localMode = mode; - state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "")); - } else if (state.inTag) { - state.inTag += stream.current() - if (stream.eol()) state.inTag += " " - } - return style; - }; - - return { - startState: function () { - var state = CodeMirror.startState(htmlMode); - return {token: html, inTag: null, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function (state) { - var local; - if (state.localState) { - local = CodeMirror.copyState(state.localMode, state.localState); - } - return {token: state.token, inTag: state.inTag, - localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function (stream, state) { - return state.token(stream, state); - }, - - indent: function (state, textAfter) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter); - else - return CodeMirror.Pass; - }, - - innerMode: function (state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; - } - }; - }, "xml", "javascript", "css"); - - CodeMirror.defineMIME("text/html", "htmlmixed"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/htmlmixed/index.html b/public/plugins/codemirror-5.17.0/mode/htmlmixed/index.html deleted file mode 100644 index f94df9e21..000000000 --- a/public/plugins/codemirror-5.17.0/mode/htmlmixed/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: HTML mixed mode - - - - - - - - - - - - - - -
-

HTML mixed mode

-
- - -

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

- -

It takes an optional mode configuration - option, scriptTypes, which can be used to add custom - behavior for specific <script type="..."> tags. If - given, it should hold an array of {matches, mode} - objects, where matches is a string or regexp that - matches the script type, and mode is - either null, for script types that should stay in - HTML mode, or a mode - spec corresponding to the mode that should be used for the - script.

- -

MIME types defined: text/html - (redefined, only takes effect if you load this parser after the - XML parser).

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/http/http.js b/public/plugins/codemirror-5.17.0/mode/http/http.js deleted file mode 100644 index 9a3c5f9fd..000000000 --- a/public/plugins/codemirror-5.17.0/mode/http/http.js +++ /dev/null @@ -1,113 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("http", function() { - function failFirstLine(stream, state) { - stream.skipToEnd(); - state.cur = header; - return "error"; - } - - function start(stream, state) { - if (stream.match(/^HTTP\/\d\.\d/)) { - state.cur = responseStatusCode; - return "keyword"; - } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) { - state.cur = requestPath; - return "keyword"; - } else { - return failFirstLine(stream, state); - } - } - - function responseStatusCode(stream, state) { - var code = stream.match(/^\d+/); - if (!code) return failFirstLine(stream, state); - - state.cur = responseStatusText; - var status = Number(code[0]); - if (status >= 100 && status < 200) { - return "positive informational"; - } else if (status >= 200 && status < 300) { - return "positive success"; - } else if (status >= 300 && status < 400) { - return "positive redirect"; - } else if (status >= 400 && status < 500) { - return "negative client-error"; - } else if (status >= 500 && status < 600) { - return "negative server-error"; - } else { - return "error"; - } - } - - function responseStatusText(stream, state) { - stream.skipToEnd(); - state.cur = header; - return null; - } - - function requestPath(stream, state) { - stream.eatWhile(/\S/); - state.cur = requestProtocol; - return "string-2"; - } - - function requestProtocol(stream, state) { - if (stream.match(/^HTTP\/\d\.\d$/)) { - state.cur = header; - return "keyword"; - } else { - return failFirstLine(stream, state); - } - } - - function header(stream) { - if (stream.sol() && !stream.eat(/[ \t]/)) { - if (stream.match(/^.*?:/)) { - return "atom"; - } else { - stream.skipToEnd(); - return "error"; - } - } else { - stream.skipToEnd(); - return "string"; - } - } - - function body(stream) { - stream.skipToEnd(); - return null; - } - - return { - token: function(stream, state) { - var cur = state.cur; - if (cur != header && cur != body && stream.eatSpace()) return null; - return cur(stream, state); - }, - - blankLine: function(state) { - state.cur = body; - }, - - startState: function() { - return {cur: start}; - } - }; -}); - -CodeMirror.defineMIME("message/http", "http"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/http/index.html b/public/plugins/codemirror-5.17.0/mode/http/index.html deleted file mode 100644 index 0b8d5315d..000000000 --- a/public/plugins/codemirror-5.17.0/mode/http/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: HTTP mode - - - - - - - - - -
-

HTTP mode

- - -
- - - -

MIME types defined: message/http.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/idl/idl.js b/public/plugins/codemirror-5.17.0/mode/idl/idl.js deleted file mode 100644 index 07308d71d..000000000 --- a/public/plugins/codemirror-5.17.0/mode/idl/idl.js +++ /dev/null @@ -1,290 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function wordRegexp(words) { - return new RegExp('^((' + words.join(')|(') + '))\\b', 'i'); - }; - - var builtinArray = [ - 'a_correlate', 'abs', 'acos', 'adapt_hist_equal', 'alog', - 'alog2', 'alog10', 'amoeba', 'annotate', 'app_user_dir', - 'app_user_dir_query', 'arg_present', 'array_equal', 'array_indices', - 'arrow', 'ascii_template', 'asin', 'assoc', 'atan', - 'axis', 'axis', 'bandpass_filter', 'bandreject_filter', 'barplot', - 'bar_plot', 'beseli', 'beselj', 'beselk', 'besely', - 'beta', 'biginteger', 'bilinear', 'bin_date', 'binary_template', - 'bindgen', 'binomial', 'bit_ffs', 'bit_population', 'blas_axpy', - 'blk_con', 'boolarr', 'boolean', 'boxplot', 'box_cursor', - 'breakpoint', 'broyden', 'bubbleplot', 'butterworth', 'bytarr', - 'byte', 'byteorder', 'bytscl', 'c_correlate', 'calendar', - 'caldat', 'call_external', 'call_function', 'call_method', - 'call_procedure', 'canny', 'catch', 'cd', 'cdf', 'ceil', - 'chebyshev', 'check_math', 'chisqr_cvf', 'chisqr_pdf', 'choldc', - 'cholsol', 'cindgen', 'cir_3pnt', 'clipboard', 'close', - 'clust_wts', 'cluster', 'cluster_tree', 'cmyk_convert', 'code_coverage', - 'color_convert', 'color_exchange', 'color_quan', 'color_range_map', - 'colorbar', 'colorize_sample', 'colormap_applicable', - 'colormap_gradient', 'colormap_rotation', 'colortable', - 'comfit', 'command_line_args', 'common', 'compile_opt', 'complex', - 'complexarr', 'complexround', 'compute_mesh_normals', 'cond', 'congrid', - 'conj', 'constrained_min', 'contour', 'contour', 'convert_coord', - 'convol', 'convol_fft', 'coord2to3', 'copy_lun', 'correlate', - 'cos', 'cosh', 'cpu', 'cramer', 'createboxplotdata', - 'create_cursor', 'create_struct', 'create_view', 'crossp', 'crvlength', - 'ct_luminance', 'cti_test', 'cursor', 'curvefit', 'cv_coord', - 'cvttobm', 'cw_animate', 'cw_animate_getp', 'cw_animate_load', - 'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index', - 'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel', 'cw_form', - 'cw_fslider', 'cw_light_editor', 'cw_light_editor_get', - 'cw_light_editor_set', 'cw_orient', 'cw_palette_editor', - 'cw_palette_editor_get', 'cw_palette_editor_set', 'cw_pdmenu', - 'cw_rgbslider', 'cw_tmpl', 'cw_zoom', 'db_exists', - 'dblarr', 'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key', - 'define_msgblk', 'define_msgblk_from_file', 'defroi', 'defsysv', - 'delvar', 'dendro_plot', 'dendrogram', 'deriv', 'derivsig', - 'determ', 'device', 'dfpmin', 'diag_matrix', 'dialog_dbconnect', - 'dialog_message', 'dialog_pickfile', 'dialog_printersetup', - 'dialog_printjob', 'dialog_read_image', - 'dialog_write_image', 'dictionary', 'digital_filter', 'dilate', 'dindgen', - 'dissolve', 'dist', 'distance_measure', 'dlm_load', 'dlm_register', - 'doc_library', 'double', 'draw_roi', 'edge_dog', 'efont', - 'eigenql', 'eigenvec', 'ellipse', 'elmhes', 'emboss', - 'empty', 'enable_sysrtn', 'eof', 'eos', 'erase', - 'erf', 'erfc', 'erfcx', 'erode', 'errorplot', - 'errplot', 'estimator_filter', 'execute', 'exit', 'exp', - 'expand', 'expand_path', 'expint', 'extrac', 'extract_slice', - 'f_cvf', 'f_pdf', 'factorial', 'fft', 'file_basename', - 'file_chmod', 'file_copy', 'file_delete', 'file_dirname', - 'file_expand_path', 'file_gunzip', 'file_gzip', 'file_info', - 'file_lines', 'file_link', 'file_mkdir', 'file_move', - 'file_poll_input', 'file_readlink', 'file_same', - 'file_search', 'file_tar', 'file_test', 'file_untar', 'file_unzip', - 'file_which', 'file_zip', 'filepath', 'findgen', 'finite', - 'fix', 'flick', 'float', 'floor', 'flow3', - 'fltarr', 'flush', 'format_axis_values', 'forward_function', 'free_lun', - 'fstat', 'fulstr', 'funct', 'function', 'fv_test', - 'fx_root', 'fz_roots', 'gamma', 'gamma_ct', 'gauss_cvf', - 'gauss_pdf', 'gauss_smooth', 'gauss2dfit', 'gaussfit', - 'gaussian_function', 'gaussint', 'get_drive_list', 'get_dxf_objects', - 'get_kbrd', 'get_login_info', - 'get_lun', 'get_screen_size', 'getenv', 'getwindows', 'greg2jul', - 'grib', 'grid_input', 'grid_tps', 'grid3', 'griddata', - 'gs_iter', 'h_eq_ct', 'h_eq_int', 'hanning', 'hash', - 'hdf', 'hdf5', 'heap_free', 'heap_gc', 'heap_nosave', - 'heap_refcount', 'heap_save', 'help', 'hilbert', 'hist_2d', - 'hist_equal', 'histogram', 'hls', 'hough', 'hqr', - 'hsv', 'i18n_multibytetoutf8', - 'i18n_multibytetowidechar', 'i18n_utf8tomultibyte', - 'i18n_widechartomultibyte', - 'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity', - 'idl_base64', 'idl_container', 'idl_validname', - 'idlexbr_assistant', 'idlitsys_createtool', - 'idlunit', 'iellipse', 'igamma', 'igetcurrent', 'igetdata', - 'igetid', 'igetproperty', 'iimage', 'image', 'image_cont', - 'image_statistics', 'image_threshold', 'imaginary', 'imap', 'indgen', - 'int_2d', 'int_3d', 'int_tabulated', 'intarr', 'interpol', - 'interpolate', 'interval_volume', 'invert', 'ioctl', 'iopen', - 'ir_filter', 'iplot', 'ipolygon', 'ipolyline', 'iputdata', - 'iregister', 'ireset', 'iresolve', 'irotate', 'isa', - 'isave', 'iscale', 'isetcurrent', 'isetproperty', 'ishft', - 'isocontour', 'isosurface', 'isurface', 'itext', 'itranslate', - 'ivector', 'ivolume', 'izoom', 'journal', 'json_parse', - 'json_serialize', 'jul2greg', 'julday', 'keyword_set', 'krig2d', - 'kurtosis', 'kw_test', 'l64indgen', 'la_choldc', 'la_cholmprove', - 'la_cholsol', 'la_determ', 'la_eigenproblem', 'la_eigenql', 'la_eigenvec', - 'la_elmhes', 'la_gm_linear_model', 'la_hqr', 'la_invert', - 'la_least_square_equality', 'la_least_squares', 'la_linear_equation', - 'la_ludc', 'la_lumprove', 'la_lusol', - 'la_svd', 'la_tridc', 'la_trimprove', 'la_triql', 'la_trired', - 'la_trisol', 'label_date', 'label_region', 'ladfit', 'laguerre', - 'lambda', 'lambdap', 'lambertw', 'laplacian', 'least_squares_filter', - 'leefilt', 'legend', 'legendre', 'linbcg', 'lindgen', - 'linfit', 'linkimage', 'list', 'll_arc_distance', 'lmfit', - 'lmgr', 'lngamma', 'lnp_test', 'loadct', 'locale_get', - 'logical_and', 'logical_or', 'logical_true', 'lon64arr', 'lonarr', - 'long', 'long64', 'lsode', 'lu_complex', 'ludc', - 'lumprove', 'lusol', 'm_correlate', 'machar', 'make_array', - 'make_dll', 'make_rt', 'map', 'mapcontinents', 'mapgrid', - 'map_2points', 'map_continents', 'map_grid', 'map_image', 'map_patch', - 'map_proj_forward', 'map_proj_image', 'map_proj_info', - 'map_proj_init', 'map_proj_inverse', - 'map_set', 'matrix_multiply', 'matrix_power', 'max', 'md_test', - 'mean', 'meanabsdev', 'mean_filter', 'median', 'memory', - 'mesh_clip', 'mesh_decimate', 'mesh_issolid', - 'mesh_merge', 'mesh_numtriangles', - 'mesh_obj', 'mesh_smooth', 'mesh_surfacearea', - 'mesh_validate', 'mesh_volume', - 'message', 'min', 'min_curve_surf', 'mk_html_help', 'modifyct', - 'moment', 'morph_close', 'morph_distance', - 'morph_gradient', 'morph_hitormiss', - 'morph_open', 'morph_thin', 'morph_tophat', 'multi', 'n_elements', - 'n_params', 'n_tags', 'ncdf', 'newton', 'noise_hurl', - 'noise_pick', 'noise_scatter', 'noise_slur', 'norm', 'obj_class', - 'obj_destroy', 'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid', - 'objarr', 'on_error', 'on_ioerror', 'online_help', 'openr', - 'openu', 'openw', 'oplot', 'oploterr', 'orderedhash', - 'p_correlate', 'parse_url', 'particle_trace', 'path_cache', 'path_sep', - 'pcomp', 'plot', 'plot3d', 'plot', 'plot_3dbox', - 'plot_field', 'ploterr', 'plots', 'polar_contour', 'polar_surface', - 'polyfill', 'polyshade', 'pnt_line', 'point_lun', 'polarplot', - 'poly', 'poly_2d', 'poly_area', 'poly_fit', 'polyfillv', - 'polygon', 'polyline', 'polywarp', 'popd', 'powell', - 'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes', - 'print', 'printf', 'printd', 'pro', 'product', - 'profile', 'profiler', 'profiles', 'project_vol', 'ps_show_fonts', - 'psafm', 'pseudo', 'ptr_free', 'ptr_new', 'ptr_valid', - 'ptrarr', 'pushd', 'qgrid3', 'qhull', 'qromb', - 'qromo', 'qsimp', 'query_*', 'query_ascii', 'query_bmp', - 'query_csv', 'query_dicom', 'query_gif', 'query_image', 'query_jpeg', - 'query_jpeg2000', 'query_mrsid', 'query_pict', 'query_png', 'query_ppm', - 'query_srf', 'query_tiff', 'query_video', 'query_wav', 'r_correlate', - 'r_test', 'radon', 'randomn', 'randomu', 'ranks', - 'rdpix', 'read', 'readf', 'read_ascii', 'read_binary', - 'read_bmp', 'read_csv', 'read_dicom', 'read_gif', 'read_image', - 'read_interfile', 'read_jpeg', 'read_jpeg2000', 'read_mrsid', 'read_pict', - 'read_png', 'read_ppm', 'read_spr', 'read_srf', 'read_sylk', - 'read_tiff', 'read_video', 'read_wav', 'read_wave', 'read_x11_bitmap', - 'read_xwd', 'reads', 'readu', 'real_part', 'rebin', - 'recall_commands', 'recon3', 'reduce_colors', 'reform', 'region_grow', - 'register_cursor', 'regress', 'replicate', - 'replicate_inplace', 'resolve_all', - 'resolve_routine', 'restore', 'retall', 'return', 'reverse', - 'rk4', 'roberts', 'rot', 'rotate', 'round', - 'routine_filepath', 'routine_info', 'rs_test', 's_test', 'save', - 'savgol', 'scale3', 'scale3d', 'scatterplot', 'scatterplot3d', - 'scope_level', 'scope_traceback', 'scope_varfetch', - 'scope_varname', 'search2d', - 'search3d', 'sem_create', 'sem_delete', 'sem_lock', 'sem_release', - 'set_plot', 'set_shading', 'setenv', 'sfit', 'shade_surf', - 'shade_surf_irr', 'shade_volume', 'shift', 'shift_diff', 'shmdebug', - 'shmmap', 'shmunmap', 'shmvar', 'show3', 'showfont', - 'signum', 'simplex', 'sin', 'sindgen', 'sinh', - 'size', 'skewness', 'skip_lun', 'slicer3', 'slide_image', - 'smooth', 'sobel', 'socket', 'sort', 'spawn', - 'sph_4pnt', 'sph_scat', 'spher_harm', 'spl_init', 'spl_interp', - 'spline', 'spline_p', 'sprsab', 'sprsax', 'sprsin', - 'sprstp', 'sqrt', 'standardize', 'stddev', 'stop', - 'strarr', 'strcmp', 'strcompress', 'streamline', 'streamline', - 'stregex', 'stretch', 'string', 'strjoin', 'strlen', - 'strlowcase', 'strmatch', 'strmessage', 'strmid', 'strpos', - 'strput', 'strsplit', 'strtrim', 'struct_assign', 'struct_hide', - 'strupcase', 'surface', 'surface', 'surfr', 'svdc', - 'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace', 'symbol', - 'systime', 't_cvf', 't_pdf', 't3d', 'tag_names', - 'tan', 'tanh', 'tek_color', 'temporary', 'terminal_size', - 'tetra_clip', 'tetra_surface', 'tetra_volume', 'text', 'thin', - 'thread', 'threed', 'tic', 'time_test2', 'timegen', - 'timer', 'timestamp', 'timestamptovalues', 'tm_test', 'toc', - 'total', 'trace', 'transpose', 'tri_surf', 'triangulate', - 'trigrid', 'triql', 'trired', 'trisol', 'truncate_lun', - 'ts_coef', 'ts_diff', 'ts_fcast', 'ts_smooth', 'tv', - 'tvcrs', 'tvlct', 'tvrd', 'tvscl', 'typename', - 'uindgen', 'uint', 'uintarr', 'ul64indgen', 'ulindgen', - 'ulon64arr', 'ulonarr', 'ulong', 'ulong64', 'uniq', - 'unsharp_mask', 'usersym', 'value_locate', 'variance', 'vector', - 'vector_field', 'vel', 'velovect', 'vert_t3d', 'voigt', - 'volume', 'voronoi', 'voxel_proj', 'wait', 'warp_tri', - 'watershed', 'wdelete', 'wf_draw', 'where', 'widget_base', - 'widget_button', 'widget_combobox', 'widget_control', - 'widget_displaycontextmenu', 'widget_draw', - 'widget_droplist', 'widget_event', 'widget_info', - 'widget_label', 'widget_list', - 'widget_propertysheet', 'widget_slider', 'widget_tab', - 'widget_table', 'widget_text', - 'widget_tree', 'widget_tree_move', 'widget_window', - 'wiener_filter', 'window', - 'window', 'write_bmp', 'write_csv', 'write_gif', 'write_image', - 'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict', 'write_png', - 'write_ppm', 'write_spr', 'write_srf', 'write_sylk', 'write_tiff', - 'write_video', 'write_wav', 'write_wave', 'writeu', 'wset', - 'wshow', 'wtn', 'wv_applet', 'wv_cwt', 'wv_cw_wavelet', - 'wv_denoise', 'wv_dwt', 'wv_fn_coiflet', - 'wv_fn_daubechies', 'wv_fn_gaussian', - 'wv_fn_haar', 'wv_fn_morlet', 'wv_fn_paul', - 'wv_fn_symlet', 'wv_import_data', - 'wv_import_wavelet', 'wv_plot3d_wps', 'wv_plot_multires', - 'wv_pwt', 'wv_tool_denoise', - 'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont', 'xinteranimate', - 'xloadct', 'xmanager', 'xmng_tmpl', 'xmtool', 'xobjview', - 'xobjview_rotate', 'xobjview_write_image', - 'xpalette', 'xpcolor', 'xplot3d', - 'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit', - 'xvolume', 'xvolume_rotate', 'xvolume_write_image', - 'xyouts', 'zlib_compress', 'zlib_uncompress', 'zoom', 'zoom_24' - ]; - var builtins = wordRegexp(builtinArray); - - var keywordArray = [ - 'begin', 'end', 'endcase', 'endfor', - 'endwhile', 'endif', 'endrep', 'endforeach', - 'break', 'case', 'continue', 'for', - 'foreach', 'goto', 'if', 'then', 'else', - 'repeat', 'until', 'switch', 'while', - 'do', 'pro', 'function' - ]; - var keywords = wordRegexp(keywordArray); - - CodeMirror.registerHelper("hintWords", "idl", builtinArray.concat(keywordArray)); - - var identifiers = new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*', 'i'); - - var singleOperators = /[+\-*&=<>\/@#~$]/; - var boolOperators = new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)', 'i'); - - function tokenBase(stream) { - // whitespaces - if (stream.eatSpace()) return null; - - // Handle one line Comments - if (stream.match(';')) { - stream.skipToEnd(); - return 'comment'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.+-]/, false)) { - if (stream.match(/^[+-]?0x[0-9a-fA-F]+/)) - return 'number'; - if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)) - return 'number'; - if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/)) - return 'number'; - } - - // Handle Strings - if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } - if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } - - // Handle words - if (stream.match(keywords)) { return 'keyword'; } - if (stream.match(builtins)) { return 'builtin'; } - if (stream.match(identifiers)) { return 'variable'; } - - if (stream.match(singleOperators) || stream.match(boolOperators)) { - return 'operator'; } - - // Handle non-detected items - stream.next(); - return null; - }; - - CodeMirror.defineMode('idl', function() { - return { - token: function(stream) { - return tokenBase(stream); - } - }; - }); - - CodeMirror.defineMIME('text/x-idl', 'idl'); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/idl/index.html b/public/plugins/codemirror-5.17.0/mode/idl/index.html deleted file mode 100644 index 4c169e2d6..000000000 --- a/public/plugins/codemirror-5.17.0/mode/idl/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: IDL mode - - - - - - - - - -
-

IDL mode

- -
- - -

MIME types defined: text/x-idl.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/index.html b/public/plugins/codemirror-5.17.0/mode/index.html deleted file mode 100644 index 732e0e52c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/index.html +++ /dev/null @@ -1,164 +0,0 @@ - - -CodeMirror: Language Modes - - - - - -
- -

Language modes

- -

This is a list of every mode in the distribution. Each mode lives -in a subdirectory of the mode/ directory, and typically -defines a single JavaScript file that implements the mode. Loading -such file will make the language available to CodeMirror, through -the mode -option.

- -
- -
- -
diff --git a/public/plugins/codemirror-5.17.0/mode/jade/index.html b/public/plugins/codemirror-5.17.0/mode/jade/index.html deleted file mode 100644 index e534981b2..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jade/index.html +++ /dev/null @@ -1,70 +0,0 @@ - - -CodeMirror: Jade Templating Mode - - - - - - - - - - - - - -
-

Jade Templating Mode

-
- -

The Jade Templating Mode

-

Created by Forbes Lindesay. Managed as part of a Brackets extension at https://github.com/ForbesLindesay/jade-brackets.

-

MIME type defined: text/x-jade.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/jade/jade.js b/public/plugins/codemirror-5.17.0/mode/jade/jade.js deleted file mode 100644 index 51ed105ac..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jade/jade.js +++ /dev/null @@ -1,590 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('jade', function (config) { - // token types - var KEYWORD = 'keyword'; - var DOCTYPE = 'meta'; - var ID = 'builtin'; - var CLASS = 'qualifier'; - - var ATTRS_NEST = { - '{': '}', - '(': ')', - '[': ']' - }; - - var jsMode = CodeMirror.getMode(config, 'javascript'); - - function State() { - this.javaScriptLine = false; - this.javaScriptLineExcludesColon = false; - - this.javaScriptArguments = false; - this.javaScriptArgumentsDepth = 0; - - this.isInterpolating = false; - this.interpolationNesting = 0; - - this.jsState = CodeMirror.startState(jsMode); - - this.restOfLine = ''; - - this.isIncludeFiltered = false; - this.isEach = false; - - this.lastTag = ''; - this.scriptType = ''; - - // Attributes Mode - this.isAttrs = false; - this.attrsNest = []; - this.inAttributeName = true; - this.attributeIsType = false; - this.attrValue = ''; - - // Indented Mode - this.indentOf = Infinity; - this.indentToken = ''; - - this.innerMode = null; - this.innerState = null; - - this.innerModeForLine = false; - } - /** - * Safely copy a state - * - * @return {State} - */ - State.prototype.copy = function () { - var res = new State(); - res.javaScriptLine = this.javaScriptLine; - res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon; - res.javaScriptArguments = this.javaScriptArguments; - res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; - res.isInterpolating = this.isInterpolating; - res.interpolationNesting = this.interpolationNesting; - - res.jsState = CodeMirror.copyState(jsMode, this.jsState); - - res.innerMode = this.innerMode; - if (this.innerMode && this.innerState) { - res.innerState = CodeMirror.copyState(this.innerMode, this.innerState); - } - - res.restOfLine = this.restOfLine; - - res.isIncludeFiltered = this.isIncludeFiltered; - res.isEach = this.isEach; - res.lastTag = this.lastTag; - res.scriptType = this.scriptType; - res.isAttrs = this.isAttrs; - res.attrsNest = this.attrsNest.slice(); - res.inAttributeName = this.inAttributeName; - res.attributeIsType = this.attributeIsType; - res.attrValue = this.attrValue; - res.indentOf = this.indentOf; - res.indentToken = this.indentToken; - - res.innerModeForLine = this.innerModeForLine; - - return res; - }; - - function javaScript(stream, state) { - if (stream.sol()) { - // if javaScriptLine was set at end of line, ignore it - state.javaScriptLine = false; - state.javaScriptLineExcludesColon = false; - } - if (state.javaScriptLine) { - if (state.javaScriptLineExcludesColon && stream.peek() === ':') { - state.javaScriptLine = false; - state.javaScriptLineExcludesColon = false; - return; - } - var tok = jsMode.token(stream, state.jsState); - if (stream.eol()) state.javaScriptLine = false; - return tok || true; - } - } - function javaScriptArguments(stream, state) { - if (state.javaScriptArguments) { - if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') { - state.javaScriptArguments = false; - return; - } - if (stream.peek() === '(') { - state.javaScriptArgumentsDepth++; - } else if (stream.peek() === ')') { - state.javaScriptArgumentsDepth--; - } - if (state.javaScriptArgumentsDepth === 0) { - state.javaScriptArguments = false; - return; - } - - var tok = jsMode.token(stream, state.jsState); - return tok || true; - } - } - - function yieldStatement(stream) { - if (stream.match(/^yield\b/)) { - return 'keyword'; - } - } - - function doctype(stream) { - if (stream.match(/^(?:doctype) *([^\n]+)?/)) { - return DOCTYPE; - } - } - - function interpolation(stream, state) { - if (stream.match('#{')) { - state.isInterpolating = true; - state.interpolationNesting = 0; - return 'punctuation'; - } - } - - function interpolationContinued(stream, state) { - if (state.isInterpolating) { - if (stream.peek() === '}') { - state.interpolationNesting--; - if (state.interpolationNesting < 0) { - stream.next(); - state.isInterpolating = false; - return 'punctuation'; - } - } else if (stream.peek() === '{') { - state.interpolationNesting++; - } - return jsMode.token(stream, state.jsState) || true; - } - } - - function caseStatement(stream, state) { - if (stream.match(/^case\b/)) { - state.javaScriptLine = true; - return KEYWORD; - } - } - - function when(stream, state) { - if (stream.match(/^when\b/)) { - state.javaScriptLine = true; - state.javaScriptLineExcludesColon = true; - return KEYWORD; - } - } - - function defaultStatement(stream) { - if (stream.match(/^default\b/)) { - return KEYWORD; - } - } - - function extendsStatement(stream, state) { - if (stream.match(/^extends?\b/)) { - state.restOfLine = 'string'; - return KEYWORD; - } - } - - function append(stream, state) { - if (stream.match(/^append\b/)) { - state.restOfLine = 'variable'; - return KEYWORD; - } - } - function prepend(stream, state) { - if (stream.match(/^prepend\b/)) { - state.restOfLine = 'variable'; - return KEYWORD; - } - } - function block(stream, state) { - if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) { - state.restOfLine = 'variable'; - return KEYWORD; - } - } - - function include(stream, state) { - if (stream.match(/^include\b/)) { - state.restOfLine = 'string'; - return KEYWORD; - } - } - - function includeFiltered(stream, state) { - if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) { - state.isIncludeFiltered = true; - return KEYWORD; - } - } - - function includeFilteredContinued(stream, state) { - if (state.isIncludeFiltered) { - var tok = filter(stream, state); - state.isIncludeFiltered = false; - state.restOfLine = 'string'; - return tok; - } - } - - function mixin(stream, state) { - if (stream.match(/^mixin\b/)) { - state.javaScriptLine = true; - return KEYWORD; - } - } - - function call(stream, state) { - if (stream.match(/^\+([-\w]+)/)) { - if (!stream.match(/^\( *[-\w]+ *=/, false)) { - state.javaScriptArguments = true; - state.javaScriptArgumentsDepth = 0; - } - return 'variable'; - } - if (stream.match(/^\+#{/, false)) { - stream.next(); - state.mixinCallAfter = true; - return interpolation(stream, state); - } - } - function callArguments(stream, state) { - if (state.mixinCallAfter) { - state.mixinCallAfter = false; - if (!stream.match(/^\( *[-\w]+ *=/, false)) { - state.javaScriptArguments = true; - state.javaScriptArgumentsDepth = 0; - } - return true; - } - } - - function conditional(stream, state) { - if (stream.match(/^(if|unless|else if|else)\b/)) { - state.javaScriptLine = true; - return KEYWORD; - } - } - - function each(stream, state) { - if (stream.match(/^(- *)?(each|for)\b/)) { - state.isEach = true; - return KEYWORD; - } - } - function eachContinued(stream, state) { - if (state.isEach) { - if (stream.match(/^ in\b/)) { - state.javaScriptLine = true; - state.isEach = false; - return KEYWORD; - } else if (stream.sol() || stream.eol()) { - state.isEach = false; - } else if (stream.next()) { - while (!stream.match(/^ in\b/, false) && stream.next()); - return 'variable'; - } - } - } - - function whileStatement(stream, state) { - if (stream.match(/^while\b/)) { - state.javaScriptLine = true; - return KEYWORD; - } - } - - function tag(stream, state) { - var captures; - if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) { - state.lastTag = captures[1].toLowerCase(); - if (state.lastTag === 'script') { - state.scriptType = 'application/javascript'; - } - return 'tag'; - } - } - - function filter(stream, state) { - if (stream.match(/^:([\w\-]+)/)) { - var innerMode; - if (config && config.innerModes) { - innerMode = config.innerModes(stream.current().substring(1)); - } - if (!innerMode) { - innerMode = stream.current().substring(1); - } - if (typeof innerMode === 'string') { - innerMode = CodeMirror.getMode(config, innerMode); - } - setInnerMode(stream, state, innerMode); - return 'atom'; - } - } - - function code(stream, state) { - if (stream.match(/^(!?=|-)/)) { - state.javaScriptLine = true; - return 'punctuation'; - } - } - - function id(stream) { - if (stream.match(/^#([\w-]+)/)) { - return ID; - } - } - - function className(stream) { - if (stream.match(/^\.([\w-]+)/)) { - return CLASS; - } - } - - function attrs(stream, state) { - if (stream.peek() == '(') { - stream.next(); - state.isAttrs = true; - state.attrsNest = []; - state.inAttributeName = true; - state.attrValue = ''; - state.attributeIsType = false; - return 'punctuation'; - } - } - - function attrsContinued(stream, state) { - if (state.isAttrs) { - if (ATTRS_NEST[stream.peek()]) { - state.attrsNest.push(ATTRS_NEST[stream.peek()]); - } - if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) { - state.attrsNest.pop(); - } else if (stream.eat(')')) { - state.isAttrs = false; - return 'punctuation'; - } - if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { - if (stream.peek() === '=' || stream.peek() === '!') { - state.inAttributeName = false; - state.jsState = CodeMirror.startState(jsMode); - if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { - state.attributeIsType = true; - } else { - state.attributeIsType = false; - } - } - return 'attribute'; - } - - var tok = jsMode.token(stream, state.jsState); - if (state.attributeIsType && tok === 'string') { - state.scriptType = stream.current().toString(); - } - if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) { - try { - Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, '')); - state.inAttributeName = true; - state.attrValue = ''; - stream.backUp(stream.current().length); - return attrsContinued(stream, state); - } catch (ex) { - //not the end of an attribute - } - } - state.attrValue += stream.current(); - return tok || true; - } - } - - function attributesBlock(stream, state) { - if (stream.match(/^&attributes\b/)) { - state.javaScriptArguments = true; - state.javaScriptArgumentsDepth = 0; - return 'keyword'; - } - } - - function indent(stream) { - if (stream.sol() && stream.eatSpace()) { - return 'indent'; - } - } - - function comment(stream, state) { - if (stream.match(/^ *\/\/(-)?([^\n]*)/)) { - state.indentOf = stream.indentation(); - state.indentToken = 'comment'; - return 'comment'; - } - } - - function colon(stream) { - if (stream.match(/^: */)) { - return 'colon'; - } - } - - function text(stream, state) { - if (stream.match(/^(?:\| ?| )([^\n]+)/)) { - return 'string'; - } - if (stream.match(/^(<[^\n]*)/, false)) { - // html string - setInnerMode(stream, state, 'htmlmixed'); - state.innerModeForLine = true; - return innerMode(stream, state, true); - } - } - - function dot(stream, state) { - if (stream.eat('.')) { - var innerMode = null; - if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) { - innerMode = state.scriptType.toLowerCase().replace(/"|'/g, ''); - } else if (state.lastTag === 'style') { - innerMode = 'css'; - } - setInnerMode(stream, state, innerMode); - return 'dot'; - } - } - - function fail(stream) { - stream.next(); - return null; - } - - - function setInnerMode(stream, state, mode) { - mode = CodeMirror.mimeModes[mode] || mode; - mode = config.innerModes ? config.innerModes(mode) || mode : mode; - mode = CodeMirror.mimeModes[mode] || mode; - mode = CodeMirror.getMode(config, mode); - state.indentOf = stream.indentation(); - - if (mode && mode.name !== 'null') { - state.innerMode = mode; - } else { - state.indentToken = 'string'; - } - } - function innerMode(stream, state, force) { - if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { - if (state.innerMode) { - if (!state.innerState) { - state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {}; - } - return stream.hideFirstChars(state.indentOf + 2, function () { - return state.innerMode.token(stream, state.innerState) || true; - }); - } else { - stream.skipToEnd(); - return state.indentToken; - } - } else if (stream.sol()) { - state.indentOf = Infinity; - state.indentToken = null; - state.innerMode = null; - state.innerState = null; - } - } - function restOfLine(stream, state) { - if (stream.sol()) { - // if restOfLine was set at end of line, ignore it - state.restOfLine = ''; - } - if (state.restOfLine) { - stream.skipToEnd(); - var tok = state.restOfLine; - state.restOfLine = ''; - return tok; - } - } - - - function startState() { - return new State(); - } - function copyState(state) { - return state.copy(); - } - /** - * Get the next token in the stream - * - * @param {Stream} stream - * @param {State} state - */ - function nextToken(stream, state) { - var tok = innerMode(stream, state) - || restOfLine(stream, state) - || interpolationContinued(stream, state) - || includeFilteredContinued(stream, state) - || eachContinued(stream, state) - || attrsContinued(stream, state) - || javaScript(stream, state) - || javaScriptArguments(stream, state) - || callArguments(stream, state) - - || yieldStatement(stream, state) - || doctype(stream, state) - || interpolation(stream, state) - || caseStatement(stream, state) - || when(stream, state) - || defaultStatement(stream, state) - || extendsStatement(stream, state) - || append(stream, state) - || prepend(stream, state) - || block(stream, state) - || include(stream, state) - || includeFiltered(stream, state) - || mixin(stream, state) - || call(stream, state) - || conditional(stream, state) - || each(stream, state) - || whileStatement(stream, state) - || tag(stream, state) - || filter(stream, state) - || code(stream, state) - || id(stream, state) - || className(stream, state) - || attrs(stream, state) - || attributesBlock(stream, state) - || indent(stream, state) - || text(stream, state) - || comment(stream, state) - || colon(stream, state) - || dot(stream, state) - || fail(stream, state); - - return tok === true ? null : tok; - } - return { - startState: startState, - copyState: copyState, - token: nextToken - }; -}, 'javascript', 'css', 'htmlmixed'); - -CodeMirror.defineMIME('text/x-jade', 'jade'); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/javascript/index.html b/public/plugins/codemirror-5.17.0/mode/javascript/index.html deleted file mode 100644 index 592a133d8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/javascript/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - -CodeMirror: JavaScript mode - - - - - - - - - - - - -
-

JavaScript mode

- - -
- - - -

- JavaScript mode supports several configuration options: -

    -
  • json which will set the mode to expect JSON - data rather than a JavaScript program.
  • -
  • jsonld which will set the mode to expect - JSON-LD linked data rather - than a JavaScript program (demo).
  • -
  • typescript which will activate additional - syntax highlighting and some other things for TypeScript code - (demo).
  • -
  • statementIndent which (given a number) will - determine the amount of indentation to use for statements - continued on a new line.
  • -
  • wordCharacters, a regexp that indicates which - characters should be considered part of an identifier. - Defaults to /[\w$]/, which does not handle - non-ASCII identifiers. Can be set to something more elaborate - to improve Unicode support.
  • -
-

- -

MIME types defined: text/javascript, application/json, application/ld+json, text/typescript, application/typescript.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/javascript/javascript.js b/public/plugins/codemirror-5.17.0/mode/javascript/javascript.js deleted file mode 100644 index 3909c85e6..000000000 --- a/public/plugins/codemirror-5.17.0/mode/javascript/javascript.js +++ /dev/null @@ -1,743 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// TODO actually recognize syntax of TypeScript constructs - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -function expressionAllowed(stream, state, backUp) { - return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) || - (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) -} - -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var statementIndent = parserConfig.statementIndent; - var jsonldMode = parserConfig.jsonld; - var jsonMode = parserConfig.json || jsonldMode; - var isTS = parserConfig.typescript; - var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - - var jsKeywords = { - "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C, - "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, - "this": kw("this"), "class": kw("class"), "super": kw("atom"), - "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, - "await": C, "async": kw("async") - }; - - // Extend the 'normal' keywords with the TypeScript language extensions - if (isTS) { - var type = {type: "variable", style: "variable-3"}; - var tsKeywords = { - // object-like things - "interface": kw("class"), - "implements": C, - "namespace": C, - "module": kw("module"), - "enum": kw("module"), - - // scope modifiers - "public": kw("modifier"), - "private": kw("modifier"), - "protected": kw("modifier"), - "abstract": kw("modifier"), - - // operators - "as": operator, - - // types - "string": type, "number": type, "boolean": type, "any": type - }; - - for (var attr in tsKeywords) { - jsKeywords[attr] = tsKeywords[attr]; - } - } - - return jsKeywords; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|~^]/; - var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; - - function readRegexp(stream) { - var escaped = false, next, inSet = false; - while ((next = stream.next()) != null) { - if (!escaped) { - if (next == "/" && !inSet) return; - if (next == "[") inSet = true; - else if (inSet && next == "]") inSet = false; - } - escaped = !escaped && next == "\\"; - } - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { - return ret("number", "number"); - } else if (ch == "." && stream.match("..")) { - return ret("spread", "meta"); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "=" && stream.eat(">")) { - return ret("=>", "operator"); - } else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } else if (ch == "0" && stream.eat(/o/i)) { - stream.eatWhile(/[0-7]/i); - return ret("number", "number"); - } else if (ch == "0" && stream.eat(/b/i)) { - stream.eatWhile(/[01]/i); - return ret("number", "number"); - } else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (expressionAllowed(stream, state, 1)) { - readRegexp(stream); - stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); - return ret("regexp", "string-2"); - } else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator", stream.current()); - } - } else if (ch == "`") { - state.tokenize = tokenQuasi; - return tokenQuasi(stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return ret("error", "error"); - } else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator", stream.current()); - } else if (wordRE.test(ch)) { - stream.eatWhile(wordRE); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.lastType != ".") ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next; - if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ - state.tokenize = tokenBase; - return ret("jsonld-keyword", "meta"); - } - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenQuasi(stream, state) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && next == "\\"; - } - return ret("quasi", "string-2", stream.current()); - } - - var brackets = "([{}])"; - // This is a crude lookahead trick to try and notice that we're - // parsing the argument patterns for a fat-arrow function before we - // actually hit the arrow token. It only works if the arrow is on - // the same line as the arguments and there's no strange noise - // (comments) in between. Fallback is to only notice when we hit the - // arrow, and not declare the arguments as locals for the arrow - // body. - function findFatArrow(stream, state) { - if (state.fatArrowAt) state.fatArrowAt = null; - var arrow = stream.string.indexOf("=>", stream.start); - if (arrow < 0) return; - - var depth = 0, sawSomething = false; - for (var pos = arrow - 1; pos >= 0; --pos) { - var ch = stream.string.charAt(pos); - var bracket = brackets.indexOf(ch); - if (bracket >= 0 && bracket < 3) { - if (!depth) { ++pos; break; } - if (--depth == 0) break; - } else if (bracket >= 3 && bracket < 6) { - ++depth; - } else if (wordRE.test(ch)) { - sawSomething = true; - } else if (/["'\/]/.test(ch)) { - return; - } else if (sawSomething && !depth) { - ++pos; - break; - } - } - if (sawSomething && !depth) state.fatArrowAt = pos; - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - for (var cx = state.context; cx; cx = cx.prev) { - for (var v = cx.vars; v; v = v.next) - if (v.name == varname) return true; - } - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - function inList(list) { - for (var v = list; v; v = v.next) - if (v.name == varname) return true; - return false; - } - var state = cx.state; - cx.marked = "def"; - if (state.context) { - if (inList(state.localVars)) return; - state.localVars = {name: varname, next: state.localVars}; - } else { - if (inList(state.globalVars)) return; - if (parserConfig.globalVars) - state.globalVars = {name: varname, next: state.globalVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: {name: "arguments"}}; - function pushcontext() { - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - cx.state.localVars = defaultVars; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state, indent = state.indented; - if (state.lexical.type == "stat") indent = state.lexical.indented; - else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) - indent = outer.indented; - state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - function exp(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(exp); - }; - return exp; - } - - function statement(type, value) { - if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); - if (type == ";") return cont(); - if (type == "if") { - if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) - cx.state.cc.pop()(); - return cont(pushlex("form"), expression, statement, poplex, maybeelse); - } - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - if (type == "class") return cont(pushlex("form"), className, poplex); - if (type == "export") return cont(pushlex("stat"), afterExport, poplex); - if (type == "import") return cont(pushlex("stat"), afterImport, poplex); - if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) - if (type == "async") return cont(statement) - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - return expressionInner(type, false); - } - function expressionNoComma(type) { - return expressionInner(type, true); - } - function expressionInner(type, noComma) { - if (cx.state.fatArrowAt == cx.stream.start) { - var body = noComma ? arrowBodyNoComma : arrowBody; - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); - else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); - } - - var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; - if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); - if (type == "function") return cont(functiondef, maybeop); - if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); - if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); - if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); - if (type == "{") return contCommasep(objprop, "}", null, maybeop); - if (type == "quasi") return pass(quasi, maybeop); - if (type == "new") return cont(maybeTarget(noComma)); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - function maybeexpressionNoComma(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expressionNoComma); - } - - function maybeoperatorComma(type, value) { - if (type == ",") return cont(expression); - return maybeoperatorNoComma(type, value, false); - } - function maybeoperatorNoComma(type, value, noComma) { - var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; - var expr = noComma == false ? expression : expressionNoComma; - if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); - if (type == "operator") { - if (/\+\+|--/.test(value)) return cont(me); - if (value == "?") return cont(expression, expect(":"), expr); - return cont(expr); - } - if (type == "quasi") { return pass(quasi, me); } - if (type == ";") return; - if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); - if (type == ".") return cont(property, me); - if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); - } - function quasi(type, value) { - if (type != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasi); - return cont(expression, continueQuasi); - } - function continueQuasi(type) { - if (type == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasi); - } - } - function arrowBody(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expression); - } - function arrowBodyNoComma(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expressionNoComma); - } - function maybeTarget(noComma) { - return function(type) { - if (type == ".") return cont(noComma ? targetNoComma : target); - else return pass(noComma ? expressionNoComma : expression); - }; - } - function target(_, value) { - if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } - } - function targetNoComma(_, value) { - if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperatorComma, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type, value) { - if (type == "async") return cont(objprop); - if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - if (value == "get" || value == "set") return cont(getterSetter); - return cont(afterprop); - } else if (type == "number" || type == "string") { - cx.marked = jsonldMode ? "property" : (cx.style + " property"); - return cont(afterprop); - } else if (type == "jsonld-keyword") { - return cont(afterprop); - } else if (type == "modifier") { - return cont(objprop) - } else if (type == "[") { - return cont(expression, expect("]"), afterprop); - } else if (type == "spread") { - return cont(expression); - } - } - function getterSetter(type) { - if (type != "variable") return pass(afterprop); - cx.marked = "property"; - return cont(functiondef); - } - function afterprop(type) { - if (type == ":") return cont(expressionNoComma); - if (type == "(") return pass(functiondef); - } - function commasep(what, end) { - function proceed(type, value) { - if (type == ",") { - var lex = cx.state.lexical; - if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; - return cont(function(type, value) { - if (type == end || value == end) return pass() - return pass(what) - }, proceed); - } - if (type == end || value == end) return cont(); - return cont(expect(end)); - } - return function(type, value) { - if (type == end || value == end) return cont(); - return pass(what, proceed); - }; - } - function contCommasep(what, end, info) { - for (var i = 3; i < arguments.length; i++) - cx.cc.push(arguments[i]); - return cont(pushlex(end, info), commasep(what, end), poplex); - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function maybetype(type) { - if (isTS && type == ":") return cont(typeexpr); - } - function maybedefault(_, value) { - if (value == "=") return cont(expressionNoComma); - } - function typeexpr(type) { - if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);} - } - function afterType(type, value) { - if (value == "<") return cont(commasep(typeexpr, ">"), afterType) - if (type == "[") return cont(expect("]"), afterType) - } - function vardef() { - return pass(pattern, maybetype, maybeAssign, vardefCont); - } - function pattern(type, value) { - if (type == "modifier") return cont(pattern) - if (type == "variable") { register(value); return cont(); } - if (type == "spread") return cont(pattern); - if (type == "[") return contCommasep(pattern, "]"); - if (type == "{") return contCommasep(proppattern, "}"); - } - function proppattern(type, value) { - if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { - register(value); - return cont(maybeAssign); - } - if (type == "variable") cx.marked = "property"; - if (type == "spread") return cont(pattern); - if (type == "}") return pass(); - return cont(expect(":"), pattern, maybeAssign); - } - function maybeAssign(_type, value) { - if (value == "=") return cont(expressionNoComma); - } - function vardefCont(type) { - if (type == ",") return cont(vardef); - } - function maybeelse(type, value) { - if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); - } - function forspec(type) { - if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); - } - function forspec1(type) { - if (type == "var") return cont(vardef, expect(";"), forspec2); - if (type == ";") return cont(forspec2); - if (type == "variable") return cont(formaybeinof); - return pass(expression, expect(";"), forspec2); - } - function formaybeinof(_type, value) { - if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } - return cont(maybeoperatorComma, forspec2); - } - function forspec2(type, value) { - if (type == ";") return cont(forspec3); - if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } - return pass(expression, expect(";"), forspec3); - } - function forspec3(type) { - if (type != ")") cont(expression); - } - function functiondef(type, value) { - if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext); - } - function funarg(type) { - if (type == "spread") return cont(funarg); - return pass(pattern, maybetype, maybedefault); - } - function className(type, value) { - if (type == "variable") {register(value); return cont(classNameAfter);} - } - function classNameAfter(type, value) { - if (value == "extends") return cont(expression, classNameAfter); - if (type == "{") return cont(pushlex("}"), classBody, poplex); - } - function classBody(type, value) { - if (type == "variable" || cx.style == "keyword") { - if (value == "static") { - cx.marked = "keyword"; - return cont(classBody); - } - cx.marked = "property"; - if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); - return cont(functiondef, classBody); - } - if (value == "*") { - cx.marked = "keyword"; - return cont(classBody); - } - if (type == ";") return cont(classBody); - if (type == "}") return cont(); - } - function classGetterSetter(type) { - if (type != "variable") return pass(); - cx.marked = "property"; - return cont(); - } - function afterExport(_type, value) { - if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } - if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } - return pass(statement); - } - function afterImport(type) { - if (type == "string") return cont(); - return pass(importSpec, maybeFrom); - } - function importSpec(type, value) { - if (type == "{") return contCommasep(importSpec, "}"); - if (type == "variable") register(value); - if (value == "*") cx.marked = "keyword"; - return cont(maybeAs); - } - function maybeAs(_type, value) { - if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } - } - function maybeFrom(_type, value) { - if (value == "from") { cx.marked = "keyword"; return cont(expression); } - } - function arrayLiteral(type) { - if (type == "]") return cont(); - return pass(expressionNoComma, commasep(expressionNoComma, "]")); - } - - function isContinuedStatement(state, textAfter) { - return state.lastType == "operator" || state.lastType == "," || - isOperatorChar.test(textAfter.charAt(0)) || - /[,.]/.test(textAfter.charAt(0)); - } - - // Interface - - return { - startState: function(basecolumn) { - var state = { - tokenize: tokenBase, - lastType: "sof", - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: basecolumn || 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") - state.globalVars = parserConfig.globalVars; - return state; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - findFatArrow(stream, state); - } - if (state.tokenize != tokenComment && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize == tokenComment) return CodeMirror.Pass; - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; - // Kludge to prevent 'maybelse' from blocking lexical scope pops - if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { - var c = state.cc[i]; - if (c == poplex) lexical = lexical.prev; - else if (c != maybeelse) break; - } - if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; - if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") - lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - - if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "form") return lexical.indented + indentUnit; - else if (type == "stat") - return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); - else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, - blockCommentStart: jsonMode ? null : "/*", - blockCommentEnd: jsonMode ? null : "*/", - lineComment: jsonMode ? null : "//", - fold: "brace", - closeBrackets: "()[]{}''\"\"``", - - helperType: jsonMode ? "json" : "javascript", - jsonldMode: jsonldMode, - jsonMode: jsonMode, - - expressionAllowed: expressionAllowed, - skipExpression: function(state) { - var top = state.cc[state.cc.length - 1] - if (top == expression || top == expressionNoComma) state.cc.pop() - } - }; -}); - -CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("text/ecmascript", "javascript"); -CodeMirror.defineMIME("application/javascript", "javascript"); -CodeMirror.defineMIME("application/x-javascript", "javascript"); -CodeMirror.defineMIME("application/ecmascript", "javascript"); -CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); -CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); -CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); -CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); -CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/javascript/json-ld.html b/public/plugins/codemirror-5.17.0/mode/javascript/json-ld.html deleted file mode 100644 index 3a37f0bce..000000000 --- a/public/plugins/codemirror-5.17.0/mode/javascript/json-ld.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: JSON-LD mode - - - - - - - - - - - - -
-

JSON-LD mode

- - -
- - - -

This is a specialization of the JavaScript mode.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/javascript/test.js b/public/plugins/codemirror-5.17.0/mode/javascript/test.js deleted file mode 100644 index 8916b7558..000000000 --- a/public/plugins/codemirror-5.17.0/mode/javascript/test.js +++ /dev/null @@ -1,207 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("locals", - "[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); - - MT("comma-and-binop", - "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); - - MT("destructuring", - "([keyword function]([def a], [[[def b], [def c] ]]) {", - " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", - " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", - "})();"); - - MT("destructure_trailing_comma", - "[keyword let] {[def a], [def b],} [operator =] [variable foo];", - "[keyword let] [def c];"); // Parser still in good state? - - MT("class_body", - "[keyword class] [def Foo] {", - " [property constructor]() {}", - " [property sayName]() {", - " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", - " }", - "}"); - - MT("class", - "[keyword class] [def Point] [keyword extends] [variable SuperThing] {", - " [property get] [property prop]() { [keyword return] [number 24]; }", - " [property constructor]([def x], [def y]) {", - " [keyword super]([string 'something']);", - " [keyword this].[property x] [operator =] [variable-2 x];", - " }", - "}"); - - MT("import", - "[keyword function] [def foo]() {", - " [keyword import] [def $] [keyword from] [string 'jquery'];", - " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", - "}"); - - MT("import_trailing_comma", - "[keyword import] {[def foo], [def bar],} [keyword from] [string 'baz']") - - MT("const", - "[keyword function] [def f]() {", - " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", - "}"); - - MT("for/of", - "[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}"); - - MT("generator", - "[keyword function*] [def repeat]([def n]) {", - " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", - " [keyword yield] [variable-2 i];", - "}"); - - MT("quotedStringAddition", - "[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"); - - MT("quotedFatArrow", - "[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"); - - MT("fatArrow", - "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", - "[variable a];", // No longer in scope - "[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", - "[variable c];"); - - MT("spread", - "[keyword function] [def f]([def a], [meta ...][def b]) {", - " [variable something]([variable-2 a], [meta ...][variable-2 b]);", - "}"); - - MT("quasi", - "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); - - MT("quasi_no_function", - "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); - - MT("indent_statement", - "[keyword var] [def x] [operator =] [number 10]", - "[variable x] [operator +=] [variable y] [operator +]", - " [atom Infinity]", - "[keyword debugger];"); - - MT("indent_if", - "[keyword if] ([number 1])", - " [keyword break];", - "[keyword else] [keyword if] ([number 2])", - " [keyword continue];", - "[keyword else]", - " [number 10];", - "[keyword if] ([number 1]) {", - " [keyword break];", - "} [keyword else] [keyword if] ([number 2]) {", - " [keyword continue];", - "} [keyword else] {", - " [number 10];", - "}"); - - MT("indent_for", - "[keyword for] ([keyword var] [def i] [operator =] [number 0];", - " [variable i] [operator <] [number 100];", - " [variable i][operator ++])", - " [variable doSomething]([variable i]);", - "[keyword debugger];"); - - MT("indent_c_style", - "[keyword function] [def foo]()", - "{", - " [keyword debugger];", - "}"); - - MT("indent_else", - "[keyword for] (;;)", - " [keyword if] ([variable foo])", - " [keyword if] ([variable bar])", - " [number 1];", - " [keyword else]", - " [number 2];", - " [keyword else]", - " [number 3];"); - - MT("indent_funarg", - "[variable foo]([number 10000],", - " [keyword function]([def a]) {", - " [keyword debugger];", - "};"); - - MT("indent_below_if", - "[keyword for] (;;)", - " [keyword if] ([variable foo])", - " [number 1];", - "[number 2];"); - - MT("multilinestring", - "[keyword var] [def x] [operator =] [string 'foo\\]", - "[string bar'];"); - - MT("scary_regexp", - "[string-2 /foo[[/]]bar/];"); - - MT("indent_strange_array", - "[keyword var] [def x] [operator =] [[", - " [number 1],,", - " [number 2],", - "]];", - "[number 10];"); - - MT("param_default", - "[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {", - " [keyword return] [variable-2 x];", - "}"); - - MT("new_target", - "[keyword function] [def F]([def target]) {", - " [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {", - " [keyword return] [keyword new]", - " .[keyword target];", - " }", - "}"); - - var jsonld_mode = CodeMirror.getMode( - {indentUnit: 2}, - {name: "javascript", jsonld: true} - ); - function LD(name) { - test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); - } - - LD("json_ld_keywords", - '{', - ' [meta "@context"]: {', - ' [meta "@base"]: [string "http://example.com"],', - ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', - ' [property "likesFlavor"]: {', - ' [meta "@container"]: [meta "@list"]', - ' [meta "@reverse"]: [string "@beFavoriteOf"]', - ' },', - ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', - ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', - ' },', - ' [meta "@graph"]: [[ {', - ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', - ' [property "name"]: [string "John Lennon"],', - ' [property "modified"]: {', - ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', - ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', - ' }', - ' } ]]', - '}'); - - LD("json_ld_fake", - '{', - ' [property "@fake"]: [string "@fake"],', - ' [property "@contextual"]: [string "@identifier"],', - ' [property "user@domain.com"]: [string "@graphical"],', - ' [property "@ID"]: [string "@@ID"]', - '}'); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/javascript/typescript.html b/public/plugins/codemirror-5.17.0/mode/javascript/typescript.html deleted file mode 100644 index 2cfc5381f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/javascript/typescript.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: TypeScript mode - - - - - - - - - -
-

TypeScript mode

- - -
- - - -

This is a specialization of the JavaScript mode.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/jinja2/index.html b/public/plugins/codemirror-5.17.0/mode/jinja2/index.html deleted file mode 100644 index 5a70e9153..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jinja2/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - -CodeMirror: Jinja2 mode - - - - - - - - - -
-

Jinja2 mode

-
- -
diff --git a/public/plugins/codemirror-5.17.0/mode/jinja2/jinja2.js b/public/plugins/codemirror-5.17.0/mode/jinja2/jinja2.js deleted file mode 100644 index ed195581c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jinja2/jinja2.js +++ /dev/null @@ -1,142 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("jinja2", function() { - var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif", - "extends", "filter", "endfilter", "firstof", "for", - "endfor", "if", "endif", "ifchanged", "endifchanged", - "ifequal", "endifequal", "ifnotequal", - "endifnotequal", "in", "include", "load", "not", "now", "or", - "parsed", "regroup", "reversed", "spaceless", - "endspaceless", "ssi", "templatetag", "openblock", - "closeblock", "openvariable", "closevariable", - "openbrace", "closebrace", "opencomment", - "closecomment", "widthratio", "url", "with", "endwith", - "get_current_language", "trans", "endtrans", "noop", "blocktrans", - "endblocktrans", "get_available_languages", - "get_current_language_bidi", "plural"], - operator = /^[+\-*&%=<>!?|~^]/, - sign = /^[:\[\(\{]/, - atom = ["true", "false"], - number = /^(\d[+\-\*\/])?\d+(\.\d+)?/; - - keywords = new RegExp("((" + keywords.join(")|(") + "))\\b"); - atom = new RegExp("((" + atom.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - var ch = stream.peek(); - - //Comment - if (state.incomment) { - if(!stream.skipTo("#}")) { - stream.skipToEnd(); - } else { - stream.eatWhile(/\#|}/); - state.incomment = false; - } - return "comment"; - //Tag - } else if (state.intag) { - //After operator - if(state.operator) { - state.operator = false; - if(stream.match(atom)) { - return "atom"; - } - if(stream.match(number)) { - return "number"; - } - } - //After sign - if(state.sign) { - state.sign = false; - if(stream.match(atom)) { - return "atom"; - } - if(stream.match(number)) { - return "number"; - } - } - - if(state.instring) { - if(ch == state.instring) { - state.instring = false; - } - stream.next(); - return "string"; - } else if(ch == "'" || ch == '"') { - state.instring = ch; - stream.next(); - return "string"; - } else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) { - state.intag = false; - return "tag"; - } else if(stream.match(operator)) { - state.operator = true; - return "operator"; - } else if(stream.match(sign)) { - state.sign = true; - } else { - if(stream.eat(" ") || stream.sol()) { - if(stream.match(keywords)) { - return "keyword"; - } - if(stream.match(atom)) { - return "atom"; - } - if(stream.match(number)) { - return "number"; - } - if(stream.sol()) { - stream.next(); - } - } else { - stream.next(); - } - - } - return "variable"; - } else if (stream.eat("{")) { - if (ch = stream.eat("#")) { - state.incomment = true; - if(!stream.skipTo("#}")) { - stream.skipToEnd(); - } else { - stream.eatWhile(/\#|}/); - state.incomment = false; - } - return "comment"; - //Open tag - } else if (ch = stream.eat(/\{|%/)) { - //Cache close tag - state.intag = ch; - if(ch == "{") { - state.intag = "}"; - } - stream.eat("-"); - return "tag"; - } - } - stream.next(); - }; - - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; - }); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/jsx/index.html b/public/plugins/codemirror-5.17.0/mode/jsx/index.html deleted file mode 100644 index cb51edb36..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jsx/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: JSX mode - - - - - - - - - - - -
-

JSX mode

- -
- - - -

JSX Mode for React's -JavaScript syntax extension.

- -

MIME types defined: text/jsx.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/jsx/jsx.js b/public/plugins/codemirror-5.17.0/mode/jsx/jsx.js deleted file mode 100644 index aff01b8d3..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jsx/jsx.js +++ /dev/null @@ -1,147 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript")) - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod) - else // Plain browser env - mod(CodeMirror) -})(function(CodeMirror) { - "use strict" - - // Depth means the amount of open braces in JS context, in XML - // context 0 means not in tag, 1 means in tag, and 2 means in tag - // and js block comment. - function Context(state, mode, depth, prev) { - this.state = state; this.mode = mode; this.depth = depth; this.prev = prev - } - - function copyContext(context) { - return new Context(CodeMirror.copyState(context.mode, context.state), - context.mode, - context.depth, - context.prev && copyContext(context.prev)) - } - - CodeMirror.defineMode("jsx", function(config, modeConfig) { - var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false}) - var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript") - - function flatXMLIndent(state) { - var tagName = state.tagName - state.tagName = null - var result = xmlMode.indent(state, "") - state.tagName = tagName - return result - } - - function token(stream, state) { - if (state.context.mode == xmlMode) - return xmlToken(stream, state, state.context) - else - return jsToken(stream, state, state.context) - } - - function xmlToken(stream, state, cx) { - if (cx.depth == 2) { // Inside a JS /* */ comment - if (stream.match(/^.*?\*\//)) cx.depth = 1 - else stream.skipToEnd() - return "comment" - } - - if (stream.peek() == "{") { - xmlMode.skipAttribute(cx.state) - - var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context - // If JS starts on same line as tag - if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) { - while (xmlContext.prev && !xmlContext.startOfLine) - xmlContext = xmlContext.prev - // If tag starts the line, use XML indentation level - if (xmlContext.startOfLine) indent -= config.indentUnit - // Else use JS indentation level - else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented - // Else if inside of tag - } else if (cx.depth == 1) { - indent += config.indentUnit - } - - state.context = new Context(CodeMirror.startState(jsMode, indent), - jsMode, 0, state.context) - return null - } - - if (cx.depth == 1) { // Inside of tag - if (stream.peek() == "<") { // Tag inside of tag - xmlMode.skipAttribute(cx.state) - state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)), - xmlMode, 0, state.context) - return null - } else if (stream.match("//")) { - stream.skipToEnd() - return "comment" - } else if (stream.match("/*")) { - cx.depth = 2 - return token(stream, state) - } - } - - var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop - if (/\btag\b/.test(style)) { - if (/>$/.test(cur)) { - if (cx.state.context) cx.depth = 0 - else state.context = state.context.prev - } else if (/^ -1) { - stream.backUp(cur.length - stop) - } - return style - } - - function jsToken(stream, state, cx) { - if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) { - jsMode.skipExpression(cx.state) - state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")), - xmlMode, 0, state.context) - return null - } - - var style = jsMode.token(stream, cx.state) - if (!style && cx.depth != null) { - var cur = stream.current() - if (cur == "{") { - cx.depth++ - } else if (cur == "}") { - if (--cx.depth == 0) state.context = state.context.prev - } - } - return style - } - - return { - startState: function() { - return {context: new Context(CodeMirror.startState(jsMode), jsMode)} - }, - - copyState: function(state) { - return {context: copyContext(state.context)} - }, - - token: token, - - indent: function(state, textAfter, fullLine) { - return state.context.mode.indent(state.context.state, textAfter, fullLine) - }, - - innerMode: function(state) { - return state.context - } - } - }, "xml", "javascript") - - CodeMirror.defineMIME("text/jsx", "jsx") -}); diff --git a/public/plugins/codemirror-5.17.0/mode/jsx/test.js b/public/plugins/codemirror-5.17.0/mode/jsx/test.js deleted file mode 100644 index c54a8b24c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/jsx/test.js +++ /dev/null @@ -1,69 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "jsx") - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)) } - - MT("selfclose", - "[keyword var] [def x] [operator =] [bracket&tag <] [tag foo] [bracket&tag />] [operator +] [number 1];") - - MT("openclose", - "([bracket&tag <][tag foo][bracket&tag >]hello [atom &][bracket&tag ][operator ++])") - - MT("attr", - "([bracket&tag <][tag foo] [attribute abc]=[string 'value'][bracket&tag >]hello [atom &][bracket&tag ][operator ++])") - - MT("braced_attr", - "([bracket&tag <][tag foo] [attribute abc]={[number 10]}[bracket&tag >]hello [atom &][bracket&tag ][operator ++])") - - MT("braced_text", - "([bracket&tag <][tag foo][bracket&tag >]hello {[number 10]} [atom &][bracket&tag ][operator ++])") - - MT("nested_tag", - "([bracket&tag <][tag foo][bracket&tag ><][tag bar][bracket&tag >][operator ++])") - - MT("nested_jsx", - "[keyword return] (", - " [bracket&tag <][tag foo][bracket&tag >]", - " say {[number 1] [operator +] [bracket&tag <][tag bar] [attribute attr]={[number 10]}[bracket&tag />]}!", - " [bracket&tag ][operator ++]", - ")") - - MT("preserve_js_context", - "[variable x] [operator =] [string-2 `quasi${][bracket&tag <][tag foo][bracket&tag />][string-2 }quoted`]") - - MT("line_comment", - "([bracket&tag <][tag foo] [comment // hello]", - " [bracket&tag >][operator ++])") - - MT("line_comment_not_in_tag", - "([bracket&tag <][tag foo][bracket&tag >] // hello", - " [bracket&tag ][operator ++])") - - MT("block_comment", - "([bracket&tag <][tag foo] [comment /* hello]", - "[comment line 2]", - "[comment line 3 */] [bracket&tag >][operator ++])") - - MT("block_comment_not_in_tag", - "([bracket&tag <][tag foo][bracket&tag >]/* hello", - " line 2", - " line 3 */ [bracket&tag ][operator ++])") - - MT("missing_attr", - "([bracket&tag <][tag foo] [attribute selected][bracket&tag />][operator ++])") - - MT("indent_js", - "([bracket&tag <][tag foo][bracket&tag >]", - " [bracket&tag <][tag bar] [attribute baz]={[keyword function]() {", - " [keyword return] [number 10]", - " }}[bracket&tag />]", - " [bracket&tag ])") - - MT("spread", - "([bracket&tag <][tag foo] [attribute bar]={[meta ...][variable baz] [operator /][number 2]}[bracket&tag />])") - - MT("tag_attribute", - "([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])") -})() diff --git a/public/plugins/codemirror-5.17.0/mode/julia/index.html b/public/plugins/codemirror-5.17.0/mode/julia/index.html deleted file mode 100644 index e1492c210..000000000 --- a/public/plugins/codemirror-5.17.0/mode/julia/index.html +++ /dev/null @@ -1,195 +0,0 @@ - - -CodeMirror: Julia mode - - - - - - - - - -
-

Julia mode

- -
- - -

MIME types defined: text/x-julia.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/julia/julia.js b/public/plugins/codemirror-5.17.0/mode/julia/julia.js deleted file mode 100644 index 004de4431..000000000 --- a/public/plugins/codemirror-5.17.0/mode/julia/julia.js +++ /dev/null @@ -1,392 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("julia", function(_conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words, end) { - if (typeof end === 'undefined') { end = "\\b"; } - return new RegExp("^((" + words.join(")|(") + "))" + end); - } - - var octChar = "\\\\[0-7]{1,3}"; - var hexChar = "\\\\x[A-Fa-f0-9]{1,2}"; - var specialChar = "\\\\[abfnrtv0%?'\"\\\\]"; - var singleChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"; - var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b(?!\()|[\u2208\u2209](?!\()/; - var delimiters = parserConf.delimiters || /^[;,()[\]{}]/; - var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/; - var charsList = [octChar, hexChar, specialChar, singleChar]; - var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"]; - var blockClosers = ["end", "else", "elseif", "catch", "finally"]; - var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype']; - var builtinList = ['true', 'false', 'nothing', 'NaN', 'Inf']; - - //var stringPrefixes = new RegExp("^[br]?('|\")") - var stringPrefixes = /^(`|"{3}|([brv]?"))/; - var chars = wordRegexp(charsList, "'"); - var keywords = wordRegexp(keywordList); - var builtins = wordRegexp(builtinList); - var openers = wordRegexp(blockOpeners); - var closers = wordRegexp(blockClosers); - var macro = /^@[_A-Za-z][\w]*/; - var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/; - var typeAnnotation = /^::[^,;"{()=$\s]+({[^}]*}+)*/; - - function inArray(state) { - var ch = currentScope(state); - if (ch == '[') { - return true; - } - return false; - } - - function currentScope(state) { - if (state.scopes.length == 0) { - return null; - } - return state.scopes[state.scopes.length - 1]; - } - - // tokenizers - function tokenBase(stream, state) { - // Handle multiline comments - if (stream.match(/^#=/, false)) { - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - - // Handle scope changes - var leavingExpr = state.leavingExpr; - if (stream.sol()) { - leavingExpr = false; - } - state.leavingExpr = false; - if (leavingExpr) { - if (stream.match(/^'+/)) { - return 'operator'; - } - } - - if (stream.match(/^\.{2,3}/)) { - return 'operator'; - } - - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle single line comments - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - if (ch === '[') { - state.scopes.push('['); - } - - if (ch === '(') { - state.scopes.push('('); - } - - var scope = currentScope(state); - - if (scope == '[' && ch === ']') { - state.scopes.pop(); - state.leavingExpr = true; - } - - if (scope == '(' && ch === ')') { - state.scopes.pop(); - state.leavingExpr = true; - } - - var match; - if (!inArray(state) && (match=stream.match(openers, false))) { - state.scopes.push(match); - } - - if (!inArray(state) && stream.match(closers, false)) { - state.scopes.pop(); - } - - if (inArray(state)) { - if (state.lastToken == 'end' && stream.match(/^:/)) { - return 'operator'; - } - if (stream.match(/^end/)) { - return 'number'; - } - } - - if (stream.match(/^=>/)) { - return 'operator'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var imMatcher = RegExp(/^im\b/); - var numberLiteral = false; - // Floats - if (stream.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)) { numberLiteral = true; } - if (stream.match(/^\d+\.(?!\.)\d*/)) { numberLiteral = true; } - if (stream.match(/^\.\d+/)) { numberLiteral = true; } - if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { numberLiteral = true; } - // Integers - if (stream.match(/^0x[0-9a-f]+/i)) { numberLiteral = true; } // Hex - if (stream.match(/^0b[01]+/i)) { numberLiteral = true; } // Binary - if (stream.match(/^0o[0-7]+/i)) { numberLiteral = true; } // Octal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { numberLiteral = true; } // Decimal - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) { numberLiteral = true; } - if (numberLiteral) { - // Integer literals may be "long" - stream.match(imMatcher); - state.leavingExpr = true; - return 'number'; - } - } - - if (stream.match(/^<:/)) { - return 'operator'; - } - - if (stream.match(typeAnnotation)) { - return 'builtin'; - } - - // Handle symbols - if (!leavingExpr && stream.match(symbol) || stream.match(/:\./)) { - return 'builtin'; - } - - // Handle parametric types - if (stream.match(/^{[^}]*}(?=\()/)) { - return 'builtin'; - } - - // Handle operators and Delimiters - if (stream.match(operators)) { - return 'operator'; - } - - // Handle Chars - if (stream.match(/^'/)) { - state.tokenize = tokenChar; - return state.tokenize(stream, state); - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - if (stream.match(macro)) { - return 'meta'; - } - - if (stream.match(delimiters)) { - return null; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(builtins)) { - return 'builtin'; - } - - var isDefinition = state.isDefinition || - state.lastToken == 'function' || - state.lastToken == 'macro' || - state.lastToken == 'type' || - state.lastToken == 'immutable'; - - if (stream.match(identifiers)) { - if (isDefinition) { - if (stream.peek() === '.') { - state.isDefinition = true; - return 'variable'; - } - state.isDefinition = false; - return 'def'; - } - if (stream.match(/^({[^}]*})*\(/, false)) { - return callOrDef(stream, state); - } - state.leavingExpr = true; - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function callOrDef(stream, state) { - var match = stream.match(/^(\(\s*)/); - if (match) { - if (state.firstParenPos < 0) - state.firstParenPos = state.scopes.length; - state.scopes.push('('); - state.charsAdvanced += match[1].length; - } - if (currentScope(state) == '(' && stream.match(/^\)/)) { - state.scopes.pop(); - state.charsAdvanced += 1; - if (state.scopes.length <= state.firstParenPos) { - var isDefinition = stream.match(/^\s*?=(?!=)/, false); - stream.backUp(state.charsAdvanced); - state.firstParenPos = -1; - state.charsAdvanced = 0; - if (isDefinition) - return 'def'; - return 'builtin'; - } - } - // Unfortunately javascript does not support multiline strings, so we have - // to undo anything done upto here if a function call or definition splits - // over two or more lines. - if (stream.match(/^$/g, false)) { - stream.backUp(state.charsAdvanced); - while (state.scopes.length > state.firstParenPos) - state.scopes.pop(); - state.firstParenPos = -1; - state.charsAdvanced = 0; - return 'builtin'; - } - state.charsAdvanced += stream.match(/^([^()]*)/)[1].length; - return callOrDef(stream, state); - } - - function tokenComment(stream, state) { - if (stream.match(/^#=/)) { - state.weakScopes++; - } - if (!stream.match(/.*?(?=(#=|=#))/)) { - stream.skipToEnd(); - } - if (stream.match(/^=#/)) { - state.weakScopes--; - if (state.weakScopes == 0) - state.tokenize = tokenBase; - } - return 'comment'; - } - - function tokenChar(stream, state) { - var isChar = false, match; - if (stream.match(chars)) { - isChar = true; - } else if (match = stream.match(/\\u([a-f0-9]{1,4})(?=')/i)) { - var value = parseInt(match[1], 16); - if (value <= 55295 || value >= 57344) { // (U+0,U+D7FF), (U+E000,U+FFFF) - isChar = true; - stream.next(); - } - } else if (match = stream.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) { - var value = parseInt(match[1], 16); - if (value <= 1114111) { // U+10FFFF - isChar = true; - stream.next(); - } - } - if (isChar) { - state.leavingExpr = true; - state.tokenize = tokenBase; - return 'string'; - } - if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); } - if (stream.match(/^'/)) { state.tokenize = tokenBase; } - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { - delimiter = delimiter.substr(1); - } - var OUTCLASS = 'string'; - - function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^"\\]/); - if (stream.eat('\\')) { - stream.next(); - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - state.leavingExpr = true; - return OUTCLASS; - } else { - stream.eat(/["]/); - } - } - return OUTCLASS; - } - tokenString.isString = true; - return tokenString; - } - - var external = { - startState: function() { - return { - tokenize: tokenBase, - scopes: [], - weakScopes: 0, - lastToken: null, - leavingExpr: false, - isDefinition: false, - charsAdvanced: 0, - firstParenPos: -1 - }; - }, - - token: function(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - if (current && style) { - state.lastToken = current; - } - - // Handle '.' connected identifiers - if (current === '.') { - style = stream.match(identifiers, false) || stream.match(macro, false) || - stream.match(/\(/, false) ? 'operator' : ERRORCLASS; - } - return style; - }, - - indent: function(state, textAfter) { - var delta = 0; - if (textAfter == "]" || textAfter == ")" || textAfter == "end" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") { - delta = -1; - } - return (state.scopes.length + delta) * _conf.indentUnit; - }, - - electricInput: /(end|else(if)?|catch|finally)$/, - lineComment: "#", - fold: "indent" - }; - return external; -}); - - -CodeMirror.defineMIME("text/x-julia", "julia"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/livescript/index.html b/public/plugins/codemirror-5.17.0/mode/livescript/index.html deleted file mode 100644 index f41547987..000000000 --- a/public/plugins/codemirror-5.17.0/mode/livescript/index.html +++ /dev/null @@ -1,459 +0,0 @@ - - -CodeMirror: LiveScript mode - - - - - - - - - - -
-

LiveScript mode

-
- - -

MIME types defined: text/x-livescript.

- -

The LiveScript mode was written by Kenneth Bentley.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/livescript/livescript.js b/public/plugins/codemirror-5.17.0/mode/livescript/livescript.js deleted file mode 100644 index 4b26e0461..000000000 --- a/public/plugins/codemirror-5.17.0/mode/livescript/livescript.js +++ /dev/null @@ -1,280 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Link to the project's GitHub page: - * https://github.com/duralog/CodeMirror - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode('livescript', function(){ - var tokenBase = function(stream, state) { - var next_rule = state.next || "start"; - if (next_rule) { - state.next = state.next; - var nr = Rules[next_rule]; - if (nr.splice) { - for (var i$ = 0; i$ < nr.length; ++i$) { - var r = nr[i$]; - if (r.regex && stream.match(r.regex)) { - state.next = r.next || state.next; - return r.token; - } - } - stream.next(); - return 'error'; - } - if (stream.match(r = Rules[next_rule])) { - if (r.regex && stream.match(r.regex)) { - state.next = r.next; - return r.token; - } else { - stream.next(); - return 'error'; - } - } - } - stream.next(); - return 'error'; - }; - var external = { - startState: function(){ - return { - next: 'start', - lastToken: null - }; - }, - token: function(stream, state){ - while (stream.pos == stream.start) - var style = tokenBase(stream, state); - state.lastToken = { - style: style, - indent: stream.indentation(), - content: stream.current() - }; - return style.replace(/\./g, ' '); - }, - indent: function(state){ - var indentation = state.lastToken.indent; - if (state.lastToken.content.match(indenter)) { - indentation += 2; - } - return indentation; - } - }; - return external; - }); - - var identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; - var indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); - var keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; - var stringfill = { - token: 'string', - regex: '.+' - }; - var Rules = { - start: [ - { - token: 'comment.doc', - regex: '/\\*', - next: 'comment' - }, { - token: 'comment', - regex: '#.*' - }, { - token: 'keyword', - regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend - }, { - token: 'constant.language', - regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend - }, { - token: 'invalid.illegal', - regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend - }, { - token: 'language.support.class', - regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend - }, { - token: 'language.support.function', - regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend - }, { - token: 'variable.language', - regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend - }, { - token: 'identifier', - regex: identifier + '\\s*:(?![:=])' - }, { - token: 'variable', - regex: identifier - }, { - token: 'keyword.operator', - regex: '(?:\\.{3}|\\s+\\?)' - }, { - token: 'keyword.variable', - regex: '(?:@+|::|\\.\\.)', - next: 'key' - }, { - token: 'keyword.operator', - regex: '\\.\\s*', - next: 'key' - }, { - token: 'string', - regex: '\\\\\\S[^\\s,;)}\\]]*' - }, { - token: 'string.doc', - regex: '\'\'\'', - next: 'qdoc' - }, { - token: 'string.doc', - regex: '"""', - next: 'qqdoc' - }, { - token: 'string', - regex: '\'', - next: 'qstring' - }, { - token: 'string', - regex: '"', - next: 'qqstring' - }, { - token: 'string', - regex: '`', - next: 'js' - }, { - token: 'string', - regex: '<\\[', - next: 'words' - }, { - token: 'string.regex', - regex: '//', - next: 'heregex' - }, { - token: 'string.regex', - regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}', - next: 'key' - }, { - token: 'constant.numeric', - regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)' - }, { - token: 'lparen', - regex: '[({[]' - }, { - token: 'rparen', - regex: '[)}\\]]', - next: 'key' - }, { - token: 'keyword.operator', - regex: '\\S+' - }, { - token: 'text', - regex: '\\s+' - } - ], - heregex: [ - { - token: 'string.regex', - regex: '.*?//[gimy$?]{0,4}', - next: 'start' - }, { - token: 'string.regex', - regex: '\\s*#{' - }, { - token: 'comment.regex', - regex: '\\s+(?:#.*)?' - }, { - token: 'string.regex', - regex: '\\S+' - } - ], - key: [ - { - token: 'keyword.operator', - regex: '[.?@!]+' - }, { - token: 'identifier', - regex: identifier, - next: 'start' - }, { - token: 'text', - regex: '', - next: 'start' - } - ], - comment: [ - { - token: 'comment.doc', - regex: '.*?\\*/', - next: 'start' - }, { - token: 'comment.doc', - regex: '.+' - } - ], - qdoc: [ - { - token: 'string', - regex: ".*?'''", - next: 'key' - }, stringfill - ], - qqdoc: [ - { - token: 'string', - regex: '.*?"""', - next: 'key' - }, stringfill - ], - qstring: [ - { - token: 'string', - regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'', - next: 'key' - }, stringfill - ], - qqstring: [ - { - token: 'string', - regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', - next: 'key' - }, stringfill - ], - js: [ - { - token: 'string', - regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`', - next: 'key' - }, stringfill - ], - words: [ - { - token: 'string', - regex: '.*?\\]>', - next: 'key' - }, stringfill - ] - }; - for (var idx in Rules) { - var r = Rules[idx]; - if (r.splice) { - for (var i = 0, len = r.length; i < len; ++i) { - var rr = r[i]; - if (typeof rr.regex === 'string') { - Rules[idx][i].regex = new RegExp('^' + rr.regex); - } - } - } else if (typeof rr.regex === 'string') { - Rules[idx].regex = new RegExp('^' + r.regex); - } - } - - CodeMirror.defineMIME('text/x-livescript', 'livescript'); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/lua/index.html b/public/plugins/codemirror-5.17.0/mode/lua/index.html deleted file mode 100644 index fc98b9446..000000000 --- a/public/plugins/codemirror-5.17.0/mode/lua/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Lua mode - - - - - - - - - - - -
-

Lua mode

-
- - -

Loosely based on Franciszek - Wawrzak's CodeMirror - 1 mode. One configuration parameter is - supported, specials, to which you can provide an - array of strings to have those identifiers highlighted with - the lua-special style.

-

MIME types defined: text/x-lua.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/lua/lua.js b/public/plugins/codemirror-5.17.0/mode/lua/lua.js deleted file mode 100644 index 0b19abd30..000000000 --- a/public/plugins/codemirror-5.17.0/mode/lua/lua.js +++ /dev/null @@ -1,159 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's -// CodeMirror 1 mode. -// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("lua", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - function prefixRE(words) { - return new RegExp("^(?:" + words.join("|") + ")", "i"); - } - function wordRE(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var specials = wordRE(parserConfig.specials || []); - - // long list of standard functions from lua manual - var builtins = wordRE([ - "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", - "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", - "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", - - "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", - - "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", - "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", - "debug.setupvalue","debug.traceback", - - "close","flush","lines","read","seek","setvbuf","write", - - "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", - "io.stdout","io.tmpfile","io.type","io.write", - - "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", - "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", - "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", - "math.sqrt","math.tan","math.tanh", - - "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", - "os.time","os.tmpname", - - "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", - "package.seeall", - - "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", - "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", - - "table.concat","table.insert","table.maxn","table.remove","table.sort" - ]); - var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", - "true","function", "end", "if", "then", "else", "do", - "while", "repeat", "until", "for", "in", "local" ]); - - var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); - var dedentTokens = wordRE(["end", "until", "\\)", "}"]); - var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); - - function readBracket(stream) { - var level = 0; - while (stream.eat("=")) ++level; - stream.eat("["); - return level; - } - - function normal(stream, state) { - var ch = stream.next(); - if (ch == "-" && stream.eat("-")) { - if (stream.eat("[") && stream.eat("[")) - return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); - stream.skipToEnd(); - return "comment"; - } - if (ch == "\"" || ch == "'") - return (state.cur = string(ch))(stream, state); - if (ch == "[" && /[\[=]/.test(stream.peek())) - return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); - if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return "number"; - } - if (/[\w_]/.test(ch)) { - stream.eatWhile(/[\w\\\-_.]/); - return "variable"; - } - return null; - } - - function bracketed(level, style) { - return function(stream, state) { - var curlev = null, ch; - while ((ch = stream.next()) != null) { - if (curlev == null) {if (ch == "]") curlev = 0;} - else if (ch == "=") ++curlev; - else if (ch == "]" && curlev == level) { state.cur = normal; break; } - else curlev = null; - } - return style; - }; - } - - function string(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.cur = normal; - return "string"; - }; - } - - return { - startState: function(basecol) { - return {basecol: basecol || 0, indentDepth: 0, cur: normal}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.cur(stream, state); - var word = stream.current(); - if (style == "variable") { - if (keywords.test(word)) style = "keyword"; - else if (builtins.test(word)) style = "builtin"; - else if (specials.test(word)) style = "variable-2"; - } - if ((style != "comment") && (style != "string")){ - if (indentTokens.test(word)) ++state.indentDepth; - else if (dedentTokens.test(word)) --state.indentDepth; - } - return style; - }, - - indent: function(state, textAfter) { - var closing = dedentPartial.test(textAfter); - return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); - }, - - lineComment: "--", - blockCommentStart: "--[[", - blockCommentEnd: "]]" - }; -}); - -CodeMirror.defineMIME("text/x-lua", "lua"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/markdown/index.html b/public/plugins/codemirror-5.17.0/mode/markdown/index.html deleted file mode 100644 index 15660c261..000000000 --- a/public/plugins/codemirror-5.17.0/mode/markdown/index.html +++ /dev/null @@ -1,361 +0,0 @@ - - -CodeMirror: Markdown mode - - - - - - - - - - - -
-

Markdown mode

-
- - - -

You might want to use the Github-Flavored Markdown mode instead, which adds support for fenced code blocks and a few other things.

- -

Optionally depends on the XML mode for properly highlighted inline XML blocks.

- -

MIME types defined: text/x-markdown.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/markdown/markdown.js b/public/plugins/codemirror-5.17.0/mode/markdown/markdown.js deleted file mode 100644 index 9dd44574f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/markdown/markdown.js +++ /dev/null @@ -1,819 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml", "../meta"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var htmlMode = CodeMirror.getMode(cmCfg, "text/html"); - var htmlModeMissing = htmlMode.name == "null" - - function getMode(name) { - if (CodeMirror.findModeByName) { - var found = CodeMirror.findModeByName(name); - if (found) name = found.mime || found.mimes[0]; - } - var mode = CodeMirror.getMode(cmCfg, name); - return mode.name == "null" ? null : mode; - } - - // Should characters that affect highlighting be highlighted separate? - // Does not include characters that will be output (such as `1.` and `-` for lists) - if (modeCfg.highlightFormatting === undefined) - modeCfg.highlightFormatting = false; - - // Maximum number of nested blockquotes. Set to 0 for infinite nesting. - // Excess `>` will emit `error` token. - if (modeCfg.maxBlockquoteDepth === undefined) - modeCfg.maxBlockquoteDepth = 0; - - // Should underscores in words open/close em/strong? - if (modeCfg.underscoresBreakWords === undefined) - modeCfg.underscoresBreakWords = true; - - // Use `fencedCodeBlocks` to configure fenced code blocks. false to - // disable, string to specify a precise regexp that the fence should - // match, and true to allow three or more backticks or tildes (as - // per CommonMark). - - // Turn on task lists? ("- [ ] " and "- [x] ") - if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; - - // Turn on strikethrough syntax - if (modeCfg.strikethrough === undefined) - modeCfg.strikethrough = false; - - // Allow token types to be overridden by user-provided token types. - if (modeCfg.tokenTypeOverrides === undefined) - modeCfg.tokenTypeOverrides = {}; - - var tokenTypes = { - header: "header", - code: "comment", - quote: "quote", - list1: "variable-2", - list2: "variable-3", - list3: "keyword", - hr: "hr", - image: "image", - imageAltText: "image-alt-text", - imageMarker: "image-marker", - formatting: "formatting", - linkInline: "link", - linkEmail: "link", - linkText: "link", - linkHref: "string", - em: "em", - strong: "strong", - strikethrough: "strikethrough" - }; - - for (var tokenType in tokenTypes) { - if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) { - tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType]; - } - } - - var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ - , ulRE = /^[*\-+]\s+/ - , olRE = /^[0-9]+([.)])\s+/ - , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE - , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/ - , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ - , textRE = /^[^#!\[\]*_\\<>` "'(~]+/ - , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) + - ")[ \\t]*([\\w+#\-]*)"); - - function switchInline(stream, state, f) { - state.f = state.inline = f; - return f(stream, state); - } - - function switchBlock(stream, state, f) { - state.f = state.block = f; - return f(stream, state); - } - - function lineIsEmpty(line) { - return !line || !/\S/.test(line.string) - } - - // Blocks - - function blankLine(state) { - // Reset linkTitle state - state.linkTitle = false; - // Reset EM state - state.em = false; - // Reset STRONG state - state.strong = false; - // Reset strikethrough state - state.strikethrough = false; - // Reset state.quote - state.quote = 0; - // Reset state.indentedCode - state.indentedCode = false; - if (htmlModeMissing && state.f == htmlBlock) { - state.f = inlineNormal; - state.block = blockNormal; - } - // Reset state.trailingSpace - state.trailingSpace = 0; - state.trailingSpaceNewLine = false; - // Mark this line as blank - state.prevLine = state.thisLine - state.thisLine = null - return null; - } - - function blockNormal(stream, state) { - - var sol = stream.sol(); - - var prevLineIsList = state.list !== false, - prevLineIsIndentedCode = state.indentedCode; - - state.indentedCode = false; - - if (prevLineIsList) { - if (state.indentationDiff >= 0) { // Continued list - if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block - state.indentation -= state.indentationDiff; - } - state.list = null; - } else if (state.indentation > 0) { - state.list = null; - } else { // No longer a list - state.list = false; - } - } - - var match = null; - if (state.indentationDiff >= 4) { - stream.skipToEnd(); - if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) { - state.indentation -= 4; - state.indentedCode = true; - return tokenTypes.code; - } else { - return null; - } - } else if (stream.eatSpace()) { - return null; - } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) { - state.header = match[1].length; - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); - } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList && - !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { - state.header = match[0].charAt(0) == '=' ? 1 : 2; - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); - } else if (stream.eat('>')) { - state.quote = sol ? 1 : state.quote + 1; - if (modeCfg.highlightFormatting) state.formatting = "quote"; - stream.eatSpace(); - return getType(state); - } else if (stream.peek() === '[') { - return switchInline(stream, state, footnoteLink); - } else if (stream.match(hrRE, true)) { - state.hr = true; - return tokenTypes.hr; - } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { - var listType = null; - if (stream.match(ulRE, true)) { - listType = 'ul'; - } else { - stream.match(olRE, true); - listType = 'ol'; - } - state.indentation = stream.column() + stream.current().length; - state.list = true; - - // While this list item's marker's indentation - // is less than the deepest list item's content's indentation, - // pop the deepest list item indentation off the stack. - while (state.listStack && stream.column() < state.listStack[state.listStack.length - 1]) { - state.listStack.pop(); - } - - // Add this list item's content's indentation to the stack - state.listStack.push(state.indentation); - - if (modeCfg.taskLists && stream.match(taskListRE, false)) { - state.taskList = true; - } - state.f = state.inline; - if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; - return getType(state); - } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) { - state.fencedChars = match[1] - // try switching mode - state.localMode = getMode(match[2]); - if (state.localMode) state.localState = CodeMirror.startState(state.localMode); - state.f = state.block = local; - if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = -1 - return getType(state); - } - - return switchInline(stream, state, state.inline); - } - - function htmlBlock(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if (!htmlModeMissing) { - var inner = CodeMirror.innerMode(htmlMode, state.htmlState) - if ((inner.mode.name == "xml" && inner.state.tagStart === null && - (!inner.state.context && inner.state.tokenize.isInText)) || - (state.md_inside && stream.current().indexOf(">") > -1)) { - state.f = inlineNormal; - state.block = blockNormal; - state.htmlState = null; - } - } - return style; - } - - function local(stream, state) { - if (state.fencedChars && stream.match(state.fencedChars, false)) { - state.localMode = state.localState = null; - state.f = state.block = leavingLocal; - return null; - } else if (state.localMode) { - return state.localMode.token(stream, state.localState); - } else { - stream.skipToEnd(); - return tokenTypes.code; - } - } - - function leavingLocal(stream, state) { - stream.match(state.fencedChars); - state.block = blockNormal; - state.f = inlineNormal; - state.fencedChars = null; - if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = 1 - var returnType = getType(state); - state.code = 0 - return returnType; - } - - // Inline - function getType(state) { - var styles = []; - - if (state.formatting) { - styles.push(tokenTypes.formatting); - - if (typeof state.formatting === "string") state.formatting = [state.formatting]; - - for (var i = 0; i < state.formatting.length; i++) { - styles.push(tokenTypes.formatting + "-" + state.formatting[i]); - - if (state.formatting[i] === "header") { - styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header); - } - - // Add `formatting-quote` and `formatting-quote-#` for blockquotes - // Add `error` instead if the maximum blockquote nesting depth is passed - if (state.formatting[i] === "quote") { - if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote); - } else { - styles.push("error"); - } - } - } - } - - if (state.taskOpen) { - styles.push("meta"); - return styles.length ? styles.join(' ') : null; - } - if (state.taskClosed) { - styles.push("property"); - return styles.length ? styles.join(' ') : null; - } - - if (state.linkHref) { - styles.push(tokenTypes.linkHref, "url"); - } else { // Only apply inline styles to non-url text - if (state.strong) { styles.push(tokenTypes.strong); } - if (state.em) { styles.push(tokenTypes.em); } - if (state.strikethrough) { styles.push(tokenTypes.strikethrough); } - if (state.linkText) { styles.push(tokenTypes.linkText); } - if (state.code) { styles.push(tokenTypes.code); } - if (state.image) { styles.push(tokenTypes.image); } - if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); } - if (state.imageMarker) { styles.push(tokenTypes.imageMarker); } - } - - if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); } - - if (state.quote) { - styles.push(tokenTypes.quote); - - // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth - if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(tokenTypes.quote + "-" + state.quote); - } else { - styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth); - } - } - - if (state.list !== false) { - var listMod = (state.listStack.length - 1) % 3; - if (!listMod) { - styles.push(tokenTypes.list1); - } else if (listMod === 1) { - styles.push(tokenTypes.list2); - } else { - styles.push(tokenTypes.list3); - } - } - - if (state.trailingSpaceNewLine) { - styles.push("trailing-space-new-line"); - } else if (state.trailingSpace) { - styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b")); - } - - return styles.length ? styles.join(' ') : null; - } - - function handleText(stream, state) { - if (stream.match(textRE, true)) { - return getType(state); - } - return undefined; - } - - function inlineNormal(stream, state) { - var style = state.text(stream, state); - if (typeof style !== 'undefined') - return style; - - if (state.list) { // List marker (*, +, -, 1., etc) - state.list = null; - return getType(state); - } - - if (state.taskList) { - var taskOpen = stream.match(taskListRE, true)[1] !== "x"; - if (taskOpen) state.taskOpen = true; - else state.taskClosed = true; - if (modeCfg.highlightFormatting) state.formatting = "task"; - state.taskList = false; - return getType(state); - } - - state.taskOpen = false; - state.taskClosed = false; - - if (state.header && stream.match(/^#+$/, true)) { - if (modeCfg.highlightFormatting) state.formatting = "header"; - return getType(state); - } - - // Get sol() value now, before character is consumed - var sol = stream.sol(); - - var ch = stream.next(); - - // Matches link titles present on next line - if (state.linkTitle) { - state.linkTitle = false; - var matchCh = ch; - if (ch === '(') { - matchCh = ')'; - } - matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; - if (stream.match(new RegExp(regex), true)) { - return tokenTypes.linkHref; - } - } - - // If this block is changed, it may need to be updated in GFM mode - if (ch === '`') { - var previousFormatting = state.formatting; - if (modeCfg.highlightFormatting) state.formatting = "code"; - stream.eatWhile('`'); - var count = stream.current().length - if (state.code == 0) { - state.code = count - return getType(state) - } else if (count == state.code) { // Must be exact - var t = getType(state) - state.code = 0 - return t - } else { - state.formatting = previousFormatting - return getType(state) - } - } else if (state.code) { - return getType(state); - } - - if (ch === '\\') { - stream.next(); - if (modeCfg.highlightFormatting) { - var type = getType(state); - var formattingEscape = tokenTypes.formatting + "-escape"; - return type ? type + " " + formattingEscape : formattingEscape; - } - } - - if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { - state.imageMarker = true; - state.image = true; - if (modeCfg.highlightFormatting) state.formatting = "image"; - return getType(state); - } - - if (ch === '[' && state.imageMarker) { - state.imageMarker = false; - state.imageAltText = true - if (modeCfg.highlightFormatting) state.formatting = "image"; - return getType(state); - } - - if (ch === ']' && state.imageAltText) { - if (modeCfg.highlightFormatting) state.formatting = "image"; - var type = getType(state); - state.imageAltText = false; - state.image = false; - state.inline = state.f = linkHref; - return type; - } - - if (ch === '[' && stream.match(/[^\]]*\](\(.*\)| ?\[.*?\])/, false) && !state.image) { - state.linkText = true; - if (modeCfg.highlightFormatting) state.formatting = "link"; - return getType(state); - } - - if (ch === ']' && state.linkText && stream.match(/\(.*?\)| ?\[.*?\]/, false)) { - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - state.linkText = false; - state.inline = state.f = linkHref; - return type; - } - - if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { - state.f = state.inline = linkInline; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + tokenTypes.linkInline; - } - - if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { - state.f = state.inline = linkInline; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + tokenTypes.linkEmail; - } - - if (ch === '<' && stream.match(/^(!--|\w)/, false)) { - var end = stream.string.indexOf(">", stream.pos); - if (end != -1) { - var atts = stream.string.substring(stream.start, end); - if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true; - } - stream.backUp(1); - state.htmlState = CodeMirror.startState(htmlMode); - return switchBlock(stream, state, htmlBlock); - } - - if (ch === '<' && stream.match(/^\/\w*?>/)) { - state.md_inside = false; - return "tag"; - } - - var ignoreUnderscore = false; - if (!modeCfg.underscoresBreakWords) { - if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { - var prevPos = stream.pos - 2; - if (prevPos >= 0) { - var prevCh = stream.string.charAt(prevPos); - if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { - ignoreUnderscore = true; - } - } - } - } - if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { - if (sol && stream.peek() === ' ') { - // Do nothing, surrounded by newline and space - } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG - if (modeCfg.highlightFormatting) state.formatting = "strong"; - var t = getType(state); - state.strong = false; - return t; - } else if (!state.strong && stream.eat(ch)) { // Add STRONG - state.strong = ch; - if (modeCfg.highlightFormatting) state.formatting = "strong"; - return getType(state); - } else if (state.em === ch) { // Remove EM - if (modeCfg.highlightFormatting) state.formatting = "em"; - var t = getType(state); - state.em = false; - return t; - } else if (!state.em) { // Add EM - state.em = ch; - if (modeCfg.highlightFormatting) state.formatting = "em"; - return getType(state); - } - } else if (ch === ' ') { - if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces - if (stream.peek() === ' ') { // Surrounded by spaces, ignore - return getType(state); - } else { // Not surrounded by spaces, back up pointer - stream.backUp(1); - } - } - } - - if (modeCfg.strikethrough) { - if (ch === '~' && stream.eatWhile(ch)) { - if (state.strikethrough) {// Remove strikethrough - if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; - var t = getType(state); - state.strikethrough = false; - return t; - } else if (stream.match(/^[^\s]/, false)) {// Add strikethrough - state.strikethrough = true; - if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; - return getType(state); - } - } else if (ch === ' ') { - if (stream.match(/^~~/, true)) { // Probably surrounded by space - if (stream.peek() === ' ') { // Surrounded by spaces, ignore - return getType(state); - } else { // Not surrounded by spaces, back up pointer - stream.backUp(2); - } - } - } - } - - if (ch === ' ') { - if (stream.match(/ +$/, false)) { - state.trailingSpace++; - } else if (state.trailingSpace) { - state.trailingSpaceNewLine = true; - } - } - - return getType(state); - } - - function linkInline(stream, state) { - var ch = stream.next(); - - if (ch === ">") { - state.f = state.inline = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + tokenTypes.linkInline; - } - - stream.match(/^[^>]+/, true); - - return tokenTypes.linkInline; - } - - function linkHref(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - var ch = stream.next(); - if (ch === '(' || ch === '[') { - state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0); - if (modeCfg.highlightFormatting) state.formatting = "link-string"; - state.linkHref = true; - return getType(state); - } - return 'error'; - } - - var linkRE = { - ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/, - "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/ - } - - function getLinkHrefInside(endChar) { - return function(stream, state) { - var ch = stream.next(); - - if (ch === endChar) { - state.f = state.inline = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "link-string"; - var returnState = getType(state); - state.linkHref = false; - return returnState; - } - - stream.match(linkRE[endChar]) - state.linkHref = true; - return getType(state); - }; - } - - function footnoteLink(stream, state) { - if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) { - state.f = footnoteLinkInside; - stream.next(); // Consume [ - if (modeCfg.highlightFormatting) state.formatting = "link"; - state.linkText = true; - return getType(state); - } - return switchInline(stream, state, inlineNormal); - } - - function footnoteLinkInside(stream, state) { - if (stream.match(/^\]:/, true)) { - state.f = state.inline = footnoteUrl; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var returnType = getType(state); - state.linkText = false; - return returnType; - } - - stream.match(/^([^\]\\]|\\.)+/, true); - - return tokenTypes.linkText; - } - - function footnoteUrl(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - // Match URL - stream.match(/^[^\s]+/, true); - // Check for link title - if (stream.peek() === undefined) { // End of line, set flag to check next line - state.linkTitle = true; - } else { // More content on line, check if link title - stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); - } - state.f = state.inline = inlineNormal; - return tokenTypes.linkHref + " url"; - } - - var mode = { - startState: function() { - return { - f: blockNormal, - - prevLine: null, - thisLine: null, - - block: blockNormal, - htmlState: null, - indentation: 0, - - inline: inlineNormal, - text: handleText, - - formatting: false, - linkText: false, - linkHref: false, - linkTitle: false, - code: 0, - em: false, - strong: false, - header: 0, - hr: false, - taskList: false, - list: false, - listStack: [], - quote: 0, - trailingSpace: 0, - trailingSpaceNewLine: false, - strikethrough: false, - fencedChars: null - }; - }, - - copyState: function(s) { - return { - f: s.f, - - prevLine: s.prevLine, - thisLine: s.thisLine, - - block: s.block, - htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), - indentation: s.indentation, - - localMode: s.localMode, - localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, - - inline: s.inline, - text: s.text, - formatting: false, - linkTitle: s.linkTitle, - code: s.code, - em: s.em, - strong: s.strong, - strikethrough: s.strikethrough, - header: s.header, - hr: s.hr, - taskList: s.taskList, - list: s.list, - listStack: s.listStack.slice(0), - quote: s.quote, - indentedCode: s.indentedCode, - trailingSpace: s.trailingSpace, - trailingSpaceNewLine: s.trailingSpaceNewLine, - md_inside: s.md_inside, - fencedChars: s.fencedChars - }; - }, - - token: function(stream, state) { - - // Reset state.formatting - state.formatting = false; - - if (stream != state.thisLine) { - var forceBlankLine = state.header || state.hr; - - // Reset state.header and state.hr - state.header = 0; - state.hr = false; - - if (stream.match(/^\s*$/, true) || forceBlankLine) { - blankLine(state); - if (!forceBlankLine) return null - state.prevLine = null - } - - state.prevLine = state.thisLine - state.thisLine = stream - - // Reset state.taskList - state.taskList = false; - - // Reset state.trailingSpace - state.trailingSpace = 0; - state.trailingSpaceNewLine = false; - - state.f = state.block; - var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; - state.indentationDiff = Math.min(indentation - state.indentation, 4); - state.indentation = state.indentation + state.indentationDiff; - if (indentation > 0) return null; - } - return state.f(stream, state); - }, - - innerMode: function(state) { - if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; - if (state.localState) return {state: state.localState, mode: state.localMode}; - return {state: state, mode: mode}; - }, - - blankLine: blankLine, - - getType: getType, - - fold: "markdown" - }; - return mode; -}, "xml"); - -CodeMirror.defineMIME("text/x-markdown", "markdown"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/markdown/test.js b/public/plugins/codemirror-5.17.0/mode/markdown/test.js deleted file mode 100644 index 2f43a170c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/markdown/test.js +++ /dev/null @@ -1,990 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); - function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } - var modeAtxNoSpace = CodeMirror.getMode({tabSize: 4}, {name: "markdown", allowAtxHeaderWithoutSpace: true}); - function AtxNoSpaceTest(name) { test.mode(name, modeAtxNoSpace, Array.prototype.slice.call(arguments, 1)); } - var modeFenced = CodeMirror.getMode({tabSize: 4}, {name: "markdown", fencedCodeBlocks: true}); - function FencedTest(name) { test.mode(name, modeFenced, Array.prototype.slice.call(arguments, 1)); } - var modeOverrideClasses = CodeMirror.getMode({tabsize: 4}, { - name: "markdown", - strikethrough: true, - tokenTypeOverrides: { - "header" : "override-header", - "code" : "override-code", - "quote" : "override-quote", - "list1" : "override-list1", - "list2" : "override-list2", - "list3" : "override-list3", - "hr" : "override-hr", - "image" : "override-image", - "imageAltText": "override-image-alt-text", - "imageMarker": "override-image-marker", - "linkInline" : "override-link-inline", - "linkEmail" : "override-link-email", - "linkText" : "override-link-text", - "linkHref" : "override-link-href", - "em" : "override-em", - "strong" : "override-strong", - "strikethrough" : "override-strikethrough" - }}); - function TokenTypeOverrideTest(name) { test.mode(name, modeOverrideClasses, Array.prototype.slice.call(arguments, 1)); } - var modeFormattingOverride = CodeMirror.getMode({tabsize: 4}, { - name: "markdown", - highlightFormatting: true, - tokenTypeOverrides: { - "formatting" : "override-formatting" - }}); - function FormatTokenTypeOverrideTest(name) { test.mode(name, modeFormattingOverride, Array.prototype.slice.call(arguments, 1)); } - - - FT("formatting_emAsterisk", - "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); - - FT("formatting_emUnderscore", - "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"); - - FT("formatting_strongAsterisk", - "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"); - - FT("formatting_strongUnderscore", - "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"); - - FT("formatting_codeBackticks", - "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); - - FT("formatting_doubleBackticks", - "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); - - FT("formatting_atxHeader", - "[header&header-1&formatting&formatting-header&formatting-header-1 # ][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"); - - FT("formatting_setextHeader", - "foo", - "[header&header-1&formatting&formatting-header&formatting-header-1 =]"); - - FT("formatting_blockquote", - "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"); - - FT("formatting_list", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"); - FT("formatting_list", - "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"); - - FT("formatting_link", - "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url (][string&url http://example.com/][string&formatting&formatting-link-string&url )]"); - - FT("formatting_linkReference", - "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url [][string&url bar][string&formatting&formatting-link-string&url ]]]", - "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string&url http://example.com/]"); - - FT("formatting_linkWeb", - "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"); - - FT("formatting_linkEmail", - "[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"); - - FT("formatting_escape", - "[formatting-escape \\*]"); - - FT("formatting_image", - "[formatting&formatting-image&image&image-marker !][formatting&formatting-image&image&image-alt-text&link [[][image&image-alt-text&link alt text][formatting&formatting-image&image&image-alt-text&link ]]][formatting&formatting-link-string&string&url (][url&string http://link.to/image.jpg][formatting&formatting-link-string&string&url )]"); - - MT("plainText", - "foo"); - - // Don't style single trailing space - MT("trailingSpace1", - "foo "); - - // Two or more trailing spaces should be styled with line break character - MT("trailingSpace2", - "foo[trailing-space-a ][trailing-space-new-line ]"); - - MT("trailingSpace3", - "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"); - - MT("trailingSpace4", - "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"); - - // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) - MT("codeBlocksUsing4Spaces", - " [comment foo]"); - - // Code blocks using 4 spaces with internal indentation - MT("codeBlocksUsing4SpacesIndentation", - " [comment bar]", - " [comment hello]", - " [comment world]", - " [comment foo]", - "bar"); - - // Code blocks should end even after extra indented lines - MT("codeBlocksWithTrailingIndentedLine", - " [comment foo]", - " [comment bar]", - " [comment baz]", - " ", - "hello"); - - // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) - MT("codeBlocksUsing1Tab", - "\t[comment foo]"); - - // No code blocks directly after paragraph - // http://spec.commonmark.org/0.19/#example-65 - MT("noCodeBlocksAfterParagraph", - "Foo", - " Bar"); - - // Inline code using backticks - MT("inlineCodeUsingBackticks", - "foo [comment `bar`]"); - - // Block code using single backtick (shouldn't work) - MT("blockCodeSingleBacktick", - "[comment `]", - "[comment foo]", - "[comment `]"); - - // Unclosed backticks - // Instead of simply marking as CODE, it would be nice to have an - // incomplete flag for CODE, that is styled slightly different. - MT("unclosedBackticks", - "foo [comment `bar]"); - - // Per documentation: "To include a literal backtick character within a - // code span, you can use multiple backticks as the opening and closing - // delimiters" - MT("doubleBackticks", - "[comment ``foo ` bar``]"); - - // Tests based on Dingus - // http://daringfireball.net/projects/markdown/dingus - // - // Multiple backticks within an inline code block - MT("consecutiveBackticks", - "[comment `foo```bar`]"); - - // Multiple backticks within an inline code block with a second code block - MT("consecutiveBackticks", - "[comment `foo```bar`] hello [comment `world`]"); - - // Unclosed with several different groups of backticks - MT("unclosedBackticks", - "[comment ``foo ``` bar` hello]"); - - // Closed with several different groups of backticks - MT("closedBackticks", - "[comment ``foo ``` bar` hello``] world"); - - // atx headers - // http://daringfireball.net/projects/markdown/syntax#header - - MT("atxH1", - "[header&header-1 # foo]"); - - MT("atxH2", - "[header&header-2 ## foo]"); - - MT("atxH3", - "[header&header-3 ### foo]"); - - MT("atxH4", - "[header&header-4 #### foo]"); - - MT("atxH5", - "[header&header-5 ##### foo]"); - - MT("atxH6", - "[header&header-6 ###### foo]"); - - // http://spec.commonmark.org/0.19/#example-24 - MT("noAtxH7", - "####### foo"); - - // http://spec.commonmark.org/0.19/#example-25 - MT("noAtxH1WithoutSpace", - "#5 bolt"); - - // CommonMark requires a space after # but most parsers don't - AtxNoSpaceTest("atxNoSpaceAllowed_H1NoSpace", - "[header&header-1 #foo]"); - - AtxNoSpaceTest("atxNoSpaceAllowed_H4NoSpace", - "[header&header-4 ####foo]"); - - AtxNoSpaceTest("atxNoSpaceAllowed_H1Space", - "[header&header-1 # foo]"); - - // Inline styles should be parsed inside headers - MT("atxH1inline", - "[header&header-1 # foo ][header&header-1&em *bar*]"); - - // Setext headers - H1, H2 - // Per documentation, "Any number of underlining =’s or -’s will work." - // http://daringfireball.net/projects/markdown/syntax#header - // Ideally, the text would be marked as `header` as well, but this is - // not really feasible at the moment. So, instead, we're testing against - // what works today, to avoid any regressions. - // - // Check if single underlining = works - MT("setextH1", - "foo", - "[header&header-1 =]"); - - // Check if 3+ ='s work - MT("setextH1", - "foo", - "[header&header-1 ===]"); - - // Check if single underlining - works - MT("setextH2", - "foo", - "[header&header-2 -]"); - - // Check if 3+ -'s work - MT("setextH2", - "foo", - "[header&header-2 ---]"); - - // http://spec.commonmark.org/0.19/#example-45 - MT("setextH2AllowSpaces", - "foo", - " [header&header-2 ---- ]"); - - // http://spec.commonmark.org/0.19/#example-44 - MT("noSetextAfterIndentedCodeBlock", - " [comment foo]", - "[hr ---]"); - - // http://spec.commonmark.org/0.19/#example-51 - MT("noSetextAfterQuote", - "[quote"e-1 > foo]", - "[hr ---]"); - - MT("noSetextAfterList", - "[variable-2 - foo]", - "[hr ---]"); - - // Single-line blockquote with trailing space - MT("blockquoteSpace", - "[quote"e-1 > foo]"); - - // Single-line blockquote - MT("blockquoteNoSpace", - "[quote"e-1 >foo]"); - - // No blank line before blockquote - MT("blockquoteNoBlankLine", - "foo", - "[quote"e-1 > bar]"); - - // Nested blockquote - MT("blockquoteSpace", - "[quote"e-1 > foo]", - "[quote"e-1 >][quote"e-2 > foo]", - "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"); - - // Single-line blockquote followed by normal paragraph - MT("blockquoteThenParagraph", - "[quote"e-1 >foo]", - "", - "bar"); - - // Multi-line blockquote (lazy mode) - MT("multiBlockquoteLazy", - "[quote"e-1 >foo]", - "[quote"e-1 bar]"); - - // Multi-line blockquote followed by normal paragraph (lazy mode) - MT("multiBlockquoteLazyThenParagraph", - "[quote"e-1 >foo]", - "[quote"e-1 bar]", - "", - "hello"); - - // Multi-line blockquote (non-lazy mode) - MT("multiBlockquote", - "[quote"e-1 >foo]", - "[quote"e-1 >bar]"); - - // Multi-line blockquote followed by normal paragraph (non-lazy mode) - MT("multiBlockquoteThenParagraph", - "[quote"e-1 >foo]", - "[quote"e-1 >bar]", - "", - "hello"); - - // Header with leading space after continued blockquote (#3287, negative indentation) - MT("headerAfterContinuedBlockquote", - "[quote"e-1 > foo]", - "[quote"e-1 bar]", - "", - " [header&header-1 # hello]"); - - // Check list types - - MT("listAsterisk", - "foo", - "bar", - "", - "[variable-2 * foo]", - "[variable-2 * bar]"); - - MT("listPlus", - "foo", - "bar", - "", - "[variable-2 + foo]", - "[variable-2 + bar]"); - - MT("listDash", - "foo", - "bar", - "", - "[variable-2 - foo]", - "[variable-2 - bar]"); - - MT("listNumber", - "foo", - "bar", - "", - "[variable-2 1. foo]", - "[variable-2 2. bar]"); - - // Lists require a preceding blank line (per Dingus) - MT("listBogus", - "foo", - "1. bar", - "2. hello"); - - // List after hr - MT("listAfterHr", - "[hr ---]", - "[variable-2 - bar]"); - - // List after header - MT("listAfterHeader", - "[header&header-1 # foo]", - "[variable-2 - bar]"); - - // hr after list - MT("hrAfterList", - "[variable-2 - foo]", - "[hr -----]"); - - // Formatting in lists (*) - MT("listAsteriskFormatting", - "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (+) - MT("listPlusFormatting", - "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (-) - MT("listDashFormatting", - "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (1.) - MT("listNumberFormatting", - "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); - - // Paragraph lists - MT("listParagraph", - "[variable-2 * foo]", - "", - "[variable-2 * bar]"); - - // Multi-paragraph lists - // - // 4 spaces - MT("listMultiParagraph", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2 hello]"); - - // 4 spaces, extra blank lines (should still be list, per Dingus) - MT("listMultiParagraphExtra", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "", - " [variable-2 hello]"); - - // 4 spaces, plus 1 space (should still be list, per Dingus) - MT("listMultiParagraphExtraSpace", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2 hello]", - "", - " [variable-2 world]"); - - // 1 tab - MT("listTab", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "\t[variable-2 hello]"); - - // No indent - MT("listNoIndent", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "hello"); - - MT("listCommonMarkIndentationCode", - "[variable-2 * Code blocks also affect]", - " [variable-3 * The next level starts where the contents start.]", - " [variable-3 * Anything less than that will keep the item on the same level.]", - " [variable-3 * Each list item can indent the first level further and further.]", - " [variable-3 * For the most part, this makes sense while writing a list.]", - " [keyword * This means two items with same indentation can be different levels.]", - " [keyword * Each level has an indent requirement that can change between items.]", - " [keyword * A list item that meets this will be part of the next level.]", - " [variable-3 * Otherwise, it will be part of the level where it does meet this.]", - " [variable-2 * World]"); - - // Blockquote - MT("blockquote", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2"e"e-1 > hello]"); - - // Code block - MT("blockquoteCode", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [comment > hello]", - "", - " [variable-2 world]"); - - // Code block followed by text - MT("blockquoteCodeText", - "[variable-2 * foo]", - "", - " [variable-2 bar]", - "", - " [comment hello]", - "", - " [variable-2 world]"); - - // Nested list - - MT("listAsteriskNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]"); - - MT("listPlusNested", - "[variable-2 + foo]", - "", - " [variable-3 + bar]"); - - MT("listDashNested", - "[variable-2 - foo]", - "", - " [variable-3 - bar]"); - - MT("listNumberNested", - "[variable-2 1. foo]", - "", - " [variable-3 2. bar]"); - - MT("listMixed", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [keyword - hello]", - "", - " [variable-2 1. world]"); - - MT("listBlockquote", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [quote"e-1&variable-3 > hello]"); - - MT("listCode", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [comment hello]"); - - // Code with internal indentation - MT("listCodeIndentation", - "[variable-2 * foo]", - "", - " [comment bar]", - " [comment hello]", - " [comment world]", - " [comment foo]", - " [variable-2 bar]"); - - // List nesting edge cases - MT("listNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]", - "", - " [variable-3 hello]" - ); - MT("listNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]", - "", - " [keyword * foo]" - ); - - // Code followed by text - MT("listCodeText", - "[variable-2 * foo]", - "", - " [comment bar]", - "", - "hello"); - - // Following tests directly from official Markdown documentation - // http://daringfireball.net/projects/markdown/syntax#hr - - MT("hrSpace", - "[hr * * *]"); - - MT("hr", - "[hr ***]"); - - MT("hrLong", - "[hr *****]"); - - MT("hrSpaceDash", - "[hr - - -]"); - - MT("hrDashLong", - "[hr ---------------------------------------]"); - - //Images - MT("Images", - "[image&image-marker !][image&image-alt-text&link [[alt text]]][string&url (http://link.to/image.jpg)]") - - //Images with highlight alt text - MT("imageEm", - "[image&image-marker !][image&image-alt-text&link [[][image-alt-text&em&image&link *alt text*][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)]"); - - MT("imageStrong", - "[image&image-marker !][image&image-alt-text&link [[][image-alt-text&strong&image&link **alt text**][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)]"); - - MT("imageEmStrong", - "[image&image-marker !][image&image-alt-text&link [[][image-alt-text&image&strong&link **][image&image-alt-text&em&strong&link *alt text**][image&image-alt-text&em&link *][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)]"); - - // Inline link with title - MT("linkTitle", - "[link [[foo]]][string&url (http://example.com/ \"bar\")] hello"); - - // Inline link without title - MT("linkNoTitle", - "[link [[foo]]][string&url (http://example.com/)] bar"); - - // Inline link with image - MT("linkImage", - "[link [[][link&image&image-marker !][link&image&image-alt-text&link [[alt text]]][string&url (http://link.to/image.jpg)][link ]]][string&url (http://example.com/)] bar"); - - // Inline link with Em - MT("linkEm", - "[link [[][link&em *foo*][link ]]][string&url (http://example.com/)] bar"); - - // Inline link with Strong - MT("linkStrong", - "[link [[][link&strong **foo**][link ]]][string&url (http://example.com/)] bar"); - - // Inline link with EmStrong - MT("linkEmStrong", - "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url (http://example.com/)] bar"); - - // Image with title - MT("imageTitle", - "[image&image-marker !][image&image-alt-text&link [[alt text]]][string&url (http://example.com/ \"bar\")] hello"); - - // Image without title - MT("imageNoTitle", - "[image&image-marker !][image&image-alt-text&link [[alt text]]][string&url (http://example.com/)] bar"); - - // Image with asterisks - MT("imageAsterisks", - "[image&image-marker !][image&image-alt-text&link [[ ][image&image-alt-text&em&link *alt text*][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)] bar"); - - // Not a link. Should be normal text due to square brackets being used - // regularly in text, especially in quoted material, and no space is allowed - // between square brackets and parentheses (per Dingus). - MT("notALink", - "[[foo]] (bar)"); - - // Reference-style links - MT("linkReference", - "[link [[foo]]][string&url [[bar]]] hello"); - - // Reference-style links with Em - MT("linkReferenceEm", - "[link [[][link&em *foo*][link ]]][string&url [[bar]]] hello"); - - // Reference-style links with Strong - MT("linkReferenceStrong", - "[link [[][link&strong **foo**][link ]]][string&url [[bar]]] hello"); - - // Reference-style links with EmStrong - MT("linkReferenceEmStrong", - "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello"); - - // Reference-style links with optional space separator (per documentation) - // "You can optionally use a space to separate the sets of brackets" - MT("linkReferenceSpace", - "[link [[foo]]] [string&url [[bar]]] hello"); - - // Should only allow a single space ("...use *a* space...") - MT("linkReferenceDoubleSpace", - "[[foo]] [[bar]] hello"); - - // Reference-style links with implicit link name - MT("linkImplicit", - "[link [[foo]]][string&url [[]]] hello"); - - // @todo It would be nice if, at some point, the document was actually - // checked to see if the referenced link exists - - // Link label, for reference-style links (taken from documentation) - - MT("labelNoTitle", - "[link [[foo]]:] [string&url http://example.com/]"); - - MT("labelIndented", - " [link [[foo]]:] [string&url http://example.com/]"); - - MT("labelSpaceTitle", - "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"]"); - - MT("labelDoubleTitle", - "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"] \"world\""); - - MT("labelTitleDoubleQuotes", - "[link [[foo]]:] [string&url http://example.com/ \"bar\"]"); - - MT("labelTitleSingleQuotes", - "[link [[foo]]:] [string&url http://example.com/ 'bar']"); - - MT("labelTitleParentheses", - "[link [[foo]]:] [string&url http://example.com/ (bar)]"); - - MT("labelTitleInvalid", - "[link [[foo]]:] [string&url http://example.com/] bar"); - - MT("labelLinkAngleBrackets", - "[link [[foo]]:] [string&url \"bar\"]"); - - MT("labelTitleNextDoubleQuotes", - "[link [[foo]]:] [string&url http://example.com/]", - "[string \"bar\"] hello"); - - MT("labelTitleNextSingleQuotes", - "[link [[foo]]:] [string&url http://example.com/]", - "[string 'bar'] hello"); - - MT("labelTitleNextParentheses", - "[link [[foo]]:] [string&url http://example.com/]", - "[string (bar)] hello"); - - MT("labelTitleNextMixed", - "[link [[foo]]:] [string&url http://example.com/]", - "(bar\" hello"); - - MT("labelEscape", - "[link [[foo \\]] ]]:] [string&url http://example.com/]"); - - MT("labelEscapeColon", - "[link [[foo \\]]: bar]]:] [string&url http://example.com/]"); - - MT("labelEscapeEnd", - "[[foo\\]]: http://example.com/"); - - MT("linkWeb", - "[link ] foo"); - - MT("linkWebDouble", - "[link ] foo [link ]"); - - MT("linkEmail", - "[link ] foo"); - - MT("linkEmailDouble", - "[link ] foo [link ]"); - - MT("emAsterisk", - "[em *foo*] bar"); - - MT("emUnderscore", - "[em _foo_] bar"); - - MT("emInWordAsterisk", - "foo[em *bar*]hello"); - - MT("emInWordUnderscore", - "foo[em _bar_]hello"); - - // Per documentation: "...surround an * or _ with spaces, it’ll be - // treated as a literal asterisk or underscore." - - MT("emEscapedBySpaceIn", - "foo [em _bar _ hello_] world"); - - MT("emEscapedBySpaceOut", - "foo _ bar[em _hello_]world"); - - MT("emEscapedByNewline", - "foo", - "_ bar[em _hello_]world"); - - // Unclosed emphasis characters - // Instead of simply marking as EM / STRONG, it would be nice to have an - // incomplete flag for EM and STRONG, that is styled slightly different. - MT("emIncompleteAsterisk", - "foo [em *bar]"); - - MT("emIncompleteUnderscore", - "foo [em _bar]"); - - MT("strongAsterisk", - "[strong **foo**] bar"); - - MT("strongUnderscore", - "[strong __foo__] bar"); - - MT("emStrongAsterisk", - "[em *foo][em&strong **bar*][strong hello**] world"); - - MT("emStrongUnderscore", - "[em _foo][em&strong __bar_][strong hello__] world"); - - // "...same character must be used to open and close an emphasis span."" - MT("emStrongMixed", - "[em _foo][em&strong **bar*hello__ world]"); - - MT("emStrongMixed", - "[em *foo][em&strong __bar_hello** world]"); - - MT("linkWithNestedParens", - "[link [[foo]]][string&url (bar(baz))]") - - // These characters should be escaped: - // \ backslash - // ` backtick - // * asterisk - // _ underscore - // {} curly braces - // [] square brackets - // () parentheses - // # hash mark - // + plus sign - // - minus sign (hyphen) - // . dot - // ! exclamation mark - - MT("escapeBacktick", - "foo \\`bar\\`"); - - MT("doubleEscapeBacktick", - "foo \\\\[comment `bar\\\\`]"); - - MT("escapeAsterisk", - "foo \\*bar\\*"); - - MT("doubleEscapeAsterisk", - "foo \\\\[em *bar\\\\*]"); - - MT("escapeUnderscore", - "foo \\_bar\\_"); - - MT("doubleEscapeUnderscore", - "foo \\\\[em _bar\\\\_]"); - - MT("escapeHash", - "\\# foo"); - - MT("doubleEscapeHash", - "\\\\# foo"); - - MT("escapeNewline", - "\\", - "[em *foo*]"); - - // Class override tests - TokenTypeOverrideTest("overrideHeader1", - "[override-header&override-header-1 # Foo]"); - - TokenTypeOverrideTest("overrideHeader2", - "[override-header&override-header-2 ## Foo]"); - - TokenTypeOverrideTest("overrideHeader3", - "[override-header&override-header-3 ### Foo]"); - - TokenTypeOverrideTest("overrideHeader4", - "[override-header&override-header-4 #### Foo]"); - - TokenTypeOverrideTest("overrideHeader5", - "[override-header&override-header-5 ##### Foo]"); - - TokenTypeOverrideTest("overrideHeader6", - "[override-header&override-header-6 ###### Foo]"); - - TokenTypeOverrideTest("overrideCode", - "[override-code `foo`]"); - - TokenTypeOverrideTest("overrideCodeBlock", - "[override-code ```]", - "[override-code foo]", - "[override-code ```]"); - - TokenTypeOverrideTest("overrideQuote", - "[override-quote&override-quote-1 > foo]", - "[override-quote&override-quote-1 > bar]"); - - TokenTypeOverrideTest("overrideQuoteNested", - "[override-quote&override-quote-1 > foo]", - "[override-quote&override-quote-1 >][override-quote&override-quote-2 > bar]", - "[override-quote&override-quote-1 >][override-quote&override-quote-2 >][override-quote&override-quote-3 > baz]"); - - TokenTypeOverrideTest("overrideLists", - "[override-list1 - foo]", - "", - " [override-list2 + bar]", - "", - " [override-list3 * baz]", - "", - " [override-list1 1. qux]", - "", - " [override-list2 - quux]"); - - TokenTypeOverrideTest("overrideHr", - "[override-hr * * *]"); - - TokenTypeOverrideTest("overrideImage", - "[override-image&override-image-marker !][override-image&override-image-alt-text&link [[alt text]]][override-link-href&url (http://link.to/image.jpg)]"); - - TokenTypeOverrideTest("overrideLinkText", - "[override-link-text [[foo]]][override-link-href&url (http://example.com)]"); - - TokenTypeOverrideTest("overrideLinkEmailAndInline", - "[override-link-email <][override-link-inline foo@example.com>]"); - - TokenTypeOverrideTest("overrideEm", - "[override-em *foo*]"); - - TokenTypeOverrideTest("overrideStrong", - "[override-strong **foo**]"); - - TokenTypeOverrideTest("overrideStrikethrough", - "[override-strikethrough ~~foo~~]"); - - FormatTokenTypeOverrideTest("overrideFormatting", - "[override-formatting-escape \\*]"); - - // Tests to make sure GFM-specific things aren't getting through - - MT("taskList", - "[variable-2 * [ ]] bar]"); - - MT("noFencedCodeBlocks", - "~~~", - "foo", - "~~~"); - - FencedTest("fencedCodeBlocks", - "[comment ```]", - "[comment foo]", - "[comment ```]", - "bar"); - - FencedTest("fencedCodeBlocksMultipleChars", - "[comment `````]", - "[comment foo]", - "[comment ```]", - "[comment foo]", - "[comment `````]", - "bar"); - - FencedTest("fencedCodeBlocksTildes", - "[comment ~~~]", - "[comment foo]", - "[comment ~~~]", - "bar"); - - FencedTest("fencedCodeBlocksTildesMultipleChars", - "[comment ~~~~~]", - "[comment ~~~]", - "[comment foo]", - "[comment ~~~~~]", - "bar"); - - FencedTest("fencedCodeBlocksMultipleChars", - "[comment `````]", - "[comment foo]", - "[comment ```]", - "[comment foo]", - "[comment `````]", - "bar"); - - FencedTest("fencedCodeBlocksMixed", - "[comment ~~~]", - "[comment ```]", - "[comment foo]", - "[comment ~~~]", - "bar"); - - // Tests that require XML mode - - MT("xmlMode", - "[tag&bracket <][tag div][tag&bracket >]", - "*foo*", - "[tag&bracket <][tag http://github.com][tag&bracket />]", - "[tag&bracket ]", - "[link ]"); - - MT("xmlModeWithMarkdownInside", - "[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]", - "[em *foo*]", - "[link ]", - "[tag
]", - "[link ]", - "[tag&bracket <][tag div][tag&bracket >]", - "[tag&bracket ]"); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/mathematica/index.html b/public/plugins/codemirror-5.17.0/mode/mathematica/index.html deleted file mode 100644 index 57c429853..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mathematica/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: Mathematica mode - - - - - - - - - - -
-

Mathematica mode

- - - - - - -

MIME types defined: text/x-mathematica (Mathematica).

-
diff --git a/public/plugins/codemirror-5.17.0/mode/mathematica/mathematica.js b/public/plugins/codemirror-5.17.0/mode/mathematica/mathematica.js deleted file mode 100644 index d6977088c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mathematica/mathematica.js +++ /dev/null @@ -1,176 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Mathematica mode copyright (c) 2015 by Calin Barbat -// Based on code by Patrick Scheibe (halirutan) -// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('mathematica', function(_config, _parserConfig) { - - // used pattern building blocks - var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*'; - var pBase = "(?:\\d+)"; - var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)"; - var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)"; - var pPrecision = "(?:`(?:`?"+pFloat+")?)"; - - // regular expressions - var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))'); - var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)'); - var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)'); - - function tokenBase(stream, state) { - var ch; - - // get next character - ch = stream.next(); - - // string - if (ch === '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - - // comment - if (ch === '(') { - if (stream.eat('*')) { - state.commentLevel++; - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - } - - // go back one character - stream.backUp(1); - - // look for numbers - // Numbers in a baseform - if (stream.match(reBaseForm, true, false)) { - return 'number'; - } - - // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition - // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow. - if (stream.match(reFloatForm, true, false)) { - return 'number'; - } - - /* In[23] and Out[34] */ - if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) { - return 'atom'; - } - - // usage - if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) { - return 'meta'; - } - - // message - if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) { - return 'string-2'; - } - - // this makes a look-ahead match for something like variable:{_Integer} - // the match is then forwarded to the mma-patterns tokenizer. - if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) { - return 'variable-2'; - } - - // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___) - // Cannot start with a number, but can have numbers at any other position. Examples - // blub__Integer, a1_, b34_Integer32 - if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { - return 'variable-2'; - } - if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) { - return 'variable-2'; - } - if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { - return 'variable-2'; - } - - // Named characters in Mathematica, like \[Gamma]. - if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) { - return 'variable-3'; - } - - // Match all braces separately - if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { - return 'bracket'; - } - - // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match - // only one. - if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) { - return 'variable-2'; - } - - // Literals like variables, keywords, functions - if (stream.match(reIdInContext, true, false)) { - return 'keyword'; - } - - // operators. Note that operators like @@ or /; are matched separately for each symbol. - if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { - return 'operator'; - } - - // everything else is an error - stream.next(); // advance the stream. - return 'error'; - } - - function tokenString(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === '"' && !escaped) { - end = true; - break; - } - escaped = !escaped && next === '\\'; - } - if (end && !escaped) { - state.tokenize = tokenBase; - } - return 'string'; - }; - - function tokenComment(stream, state) { - var prev, next; - while(state.commentLevel > 0 && (next = stream.next()) != null) { - if (prev === '(' && next === '*') state.commentLevel++; - if (prev === '*' && next === ')') state.commentLevel--; - prev = next; - } - if (state.commentLevel <= 0) { - state.tokenize = tokenBase; - } - return 'comment'; - } - - return { - startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - blockCommentStart: "(*", - blockCommentEnd: "*)" - }; -}); - -CodeMirror.defineMIME('text/x-mathematica', { - name: 'mathematica' -}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/mbox/index.html b/public/plugins/codemirror-5.17.0/mode/mbox/index.html deleted file mode 100644 index 248ea98e1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mbox/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - -CodeMirror: mbox mode - - - - - - - - - -
-

mbox mode

-
- - -

MIME types defined: application/mbox.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/mbox/mbox.js b/public/plugins/codemirror-5.17.0/mode/mbox/mbox.js deleted file mode 100644 index ba2416ac8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mbox/mbox.js +++ /dev/null @@ -1,129 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -var rfc2822 = [ - "From", "Sender", "Reply-To", "To", "Cc", "Bcc", "Message-ID", - "In-Reply-To", "References", "Resent-From", "Resent-Sender", "Resent-To", - "Resent-Cc", "Resent-Bcc", "Resent-Message-ID", "Return-Path", "Received" -]; -var rfc2822NoEmail = [ - "Date", "Subject", "Comments", "Keywords", "Resent-Date" -]; - -CodeMirror.registerHelper("hintWords", "mbox", rfc2822.concat(rfc2822NoEmail)); - -var whitespace = /^[ \t]/; -var separator = /^From /; // See RFC 4155 -var rfc2822Header = new RegExp("^(" + rfc2822.join("|") + "): "); -var rfc2822HeaderNoEmail = new RegExp("^(" + rfc2822NoEmail.join("|") + "): "); -var header = /^[^:]+:/; // Optional fields defined in RFC 2822 -var email = /^[^ ]+@[^ ]+/; -var untilEmail = /^.*?(?=[^ ]+?@[^ ]+)/; -var bracketedEmail = /^<.*?>/; -var untilBracketedEmail = /^.*?(?=<.*>)/; - -function styleForHeader(header) { - if (header === "Subject") return "header"; - return "string"; -} - -function readToken(stream, state) { - if (stream.sol()) { - // From last line - state.inSeparator = false; - if (state.inHeader && stream.match(whitespace)) { - // Header folding - return null; - } else { - state.inHeader = false; - state.header = null; - } - - if (stream.match(separator)) { - state.inHeaders = true; - state.inSeparator = true; - return "atom"; - } - - var match; - var emailPermitted = false; - if ((match = stream.match(rfc2822HeaderNoEmail)) || - (emailPermitted = true) && (match = stream.match(rfc2822Header))) { - state.inHeaders = true; - state.inHeader = true; - state.emailPermitted = emailPermitted; - state.header = match[1]; - return "atom"; - } - - // Use vim's heuristics: recognize custom headers only if the line is in a - // block of legitimate headers. - if (state.inHeaders && (match = stream.match(header))) { - state.inHeader = true; - state.emailPermitted = true; - state.header = match[1]; - return "atom"; - } - - state.inHeaders = false; - stream.skipToEnd(); - return null; - } - - if (state.inSeparator) { - if (stream.match(email)) return "link"; - if (stream.match(untilEmail)) return "atom"; - stream.skipToEnd(); - return "atom"; - } - - if (state.inHeader) { - var style = styleForHeader(state.header); - - if (state.emailPermitted) { - if (stream.match(bracketedEmail)) return style + " link"; - if (stream.match(untilBracketedEmail)) return style; - } - stream.skipToEnd(); - return style; - } - - stream.skipToEnd(); - return null; -}; - -CodeMirror.defineMode("mbox", function() { - return { - startState: function() { - return { - // Is in a mbox separator - inSeparator: false, - // Is in a mail header - inHeader: false, - // If bracketed email is permitted. Only applicable when inHeader - emailPermitted: false, - // Name of current header - header: null, - // Is in a region of mail headers - inHeaders: false - }; - }, - token: readToken, - blankLine: function(state) { - state.inHeaders = state.inSeparator = state.inHeader = false; - } - }; -}); - -CodeMirror.defineMIME("application/mbox", "mbox"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/meta.js b/public/plugins/codemirror-5.17.0/mode/meta.js deleted file mode 100644 index eb25e242d..000000000 --- a/public/plugins/codemirror-5.17.0/mode/meta.js +++ /dev/null @@ -1,208 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.modeInfo = [ - {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, - {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]}, - {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]}, - {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, - {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]}, - {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, - {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, - {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, - {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, - {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]}, - {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]}, - {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]}, - {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, - {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, - {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, - {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, - {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, - {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]}, - {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, - {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, - {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, - {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]}, - {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]}, - {name: "Django", mime: "text/x-django", mode: "django"}, - {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/}, - {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]}, - {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]}, - {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"}, - {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]}, - {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]}, - {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, - {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]}, - {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, - {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, - {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, - {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]}, - {name: "FCL", mime: "text/x-fcl", mode: "fcl"}, - {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]}, - {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, - {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]}, - {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, - {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, - {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i}, - {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, - {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]}, - {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, - {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, - {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]}, - {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, - {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, - {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]}, - {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, - {name: "HTTP", mime: "message/http", mode: "http"}, - {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, - {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, - {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, - {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, - {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], - mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]}, - {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]}, - {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]}, - {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]}, - {name: "Jinja2", mime: "null", mode: "jinja2"}, - {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, - {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]}, - {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, - {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]}, - {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, - {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, - {name: "mIRC", mime: "text/mirc", mode: "mirc"}, - {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, - {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]}, - {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, - {name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]}, - {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, - {name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]}, - {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, - {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, - {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]}, - {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]}, - {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]}, - {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, - {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, - {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]}, - {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, - {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]}, - {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, - {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]}, - {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]}, - {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]}, - {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]}, - {name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]}, - {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]}, - {name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]}, - {name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/}, - {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]}, - {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]}, - {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]}, - {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]}, - {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"}, - {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]}, - {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]}, - {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]}, - {name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]}, - {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]}, - {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, - {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, - {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, - {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/}, - {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]}, - {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, - {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, - {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, - {name: "Solr", mime: "text/x-solr", mode: "solr"}, - {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, - {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, - {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]}, - {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, - {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]}, - {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]}, - {name: "sTeX", mime: "text/x-stex", mode: "stex"}, - {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]}, - {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]}, - {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]}, - {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]}, - {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, - {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, - {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, - {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, - {name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]}, - {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]}, - {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]}, - {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, - {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, - {name: "Twig", mime: "text/x-twig", mode: "twig"}, - {name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]}, - {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, - {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]}, - {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, - {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, - {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]}, - {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, - {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, - {name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]}, - {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, - {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}, - {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]}, - {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]}, - {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]} - ]; - // Ensure all modes have a mime property for backwards compatibility - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.mimes) info.mime = info.mimes[0]; - } - - CodeMirror.findModeByMIME = function(mime) { - mime = mime.toLowerCase(); - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.mime == mime) return info; - if (info.mimes) for (var j = 0; j < info.mimes.length; j++) - if (info.mimes[j] == mime) return info; - } - }; - - CodeMirror.findModeByExtension = function(ext) { - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.ext) for (var j = 0; j < info.ext.length; j++) - if (info.ext[j] == ext) return info; - } - }; - - CodeMirror.findModeByFileName = function(filename) { - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.file && info.file.test(filename)) return info; - } - var dot = filename.lastIndexOf("."); - var ext = dot > -1 && filename.substring(dot + 1, filename.length); - if (ext) return CodeMirror.findModeByExtension(ext); - }; - - CodeMirror.findModeByName = function(name) { - name = name.toLowerCase(); - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.name.toLowerCase() == name) return info; - if (info.alias) for (var j = 0; j < info.alias.length; j++) - if (info.alias[j].toLowerCase() == name) return info; - } - }; -}); diff --git a/public/plugins/codemirror-5.17.0/mode/mirc/index.html b/public/plugins/codemirror-5.17.0/mode/mirc/index.html deleted file mode 100644 index fd2f34e4b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mirc/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - -CodeMirror: mIRC mode - - - - - - - - - - -
-

mIRC mode

-
- - -

MIME types defined: text/mirc.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/mirc/mirc.js b/public/plugins/codemirror-5.17.0/mode/mirc/mirc.js deleted file mode 100644 index f0d5c6ad5..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mirc/mirc.js +++ /dev/null @@ -1,193 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMIME("text/mirc", "mirc"); -CodeMirror.defineMode("mirc", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " + - "$activewid $address $addtok $agent $agentname $agentstat $agentver " + - "$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " + - "$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " + - "$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " + - "$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " + - "$com $comcall $comchan $comerr $compact $compress $comval $cos $count " + - "$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " + - "$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " + - "$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " + - "$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " + - "$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " + - "$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " + - "$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " + - "$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " + - "$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " + - "$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " + - "$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " + - "$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " + - "$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " + - "$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " + - "$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " + - "$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " + - "$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " + - "$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " + - "$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " + - "$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " + - "$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " + - "$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " + - "$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " + - "$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " + - "$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " + - "$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " + - "$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " + - "$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " + - "$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor"); - var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " + - "away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " + - "channel clear clearall cline clipboard close cnick color comclose comopen " + - "comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " + - "debug dec describe dialog did didtok disable disconnect dlevel dline dll " + - "dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " + - "drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " + - "events exit fclose filter findtext finger firewall flash flist flood flush " + - "flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " + - "gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " + - "halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " + - "ialmark identd if ignore iline inc invite iuser join kick linesep links list " + - "load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " + - "notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " + - "qme qmsg query queryn quit raw reload remini remote remove rename renwin " + - "reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " + - "say scid scon server set showmirc signam sline sockaccept sockclose socklist " + - "socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " + - "sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " + - "toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " + - "var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " + - "isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " + - "isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " + - "elseif else goto menu nicklist status title icon size option text edit " + - "button check radio box scroll list combo link tab item"); - var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); - var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - if (/[\[\]{}\(\),\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - else if (ch == "\\") { - stream.eat("\\"); - stream.eat(/./); - return "number"; - } - else if (ch == "/" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else if (ch == ";" && stream.match(/ *\( *\(/)) { - return chain(stream, state, tokenUnparsed); - } - else if (ch == ";" && !state.inParams) { - stream.skipToEnd(); - return "comment"; - } - else if (ch == '"') { - stream.eat(/"/); - return "keyword"; - } - else if (ch == "$") { - stream.eatWhile(/[$_a-z0-9A-Z\.:]/); - if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { - return "keyword"; - } - else { - state.beforeParams = true; - return "builtin"; - } - } - else if (ch == "%") { - stream.eatWhile(/[^,^\s^\(^\)]/); - state.beforeParams = true; - return "string"; - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - stream.eatWhile(/[\w\$_{}]/); - var word = stream.current().toLowerCase(); - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - if (functions && functions.propertyIsEnumerable(word)) { - state.beforeParams = true; - return "keyword"; - } - return null; - } - } - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == ";" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == ")") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/mllike/index.html b/public/plugins/codemirror-5.17.0/mode/mllike/index.html deleted file mode 100644 index 5923af8f8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mllike/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - -CodeMirror: ML-like mode - - - - - - - - - - -
-

OCaml mode

- - - - -

F# mode

- - - - - -

MIME types defined: text/x-ocaml (OCaml) and text/x-fsharp (F#).

-
diff --git a/public/plugins/codemirror-5.17.0/mode/mllike/mllike.js b/public/plugins/codemirror-5.17.0/mode/mllike/mllike.js deleted file mode 100644 index bf0b8a674..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mllike/mllike.js +++ /dev/null @@ -1,205 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('mllike', function(_config, parserConfig) { - var words = { - 'let': 'keyword', - 'rec': 'keyword', - 'in': 'keyword', - 'of': 'keyword', - 'and': 'keyword', - 'if': 'keyword', - 'then': 'keyword', - 'else': 'keyword', - 'for': 'keyword', - 'to': 'keyword', - 'while': 'keyword', - 'do': 'keyword', - 'done': 'keyword', - 'fun': 'keyword', - 'function': 'keyword', - 'val': 'keyword', - 'type': 'keyword', - 'mutable': 'keyword', - 'match': 'keyword', - 'with': 'keyword', - 'try': 'keyword', - 'open': 'builtin', - 'ignore': 'builtin', - 'begin': 'keyword', - 'end': 'keyword' - }; - - var extraWords = parserConfig.extraWords || {}; - for (var prop in extraWords) { - if (extraWords.hasOwnProperty(prop)) { - words[prop] = parserConfig.extraWords[prop]; - } - } - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch === '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch === '(') { - if (stream.eat('*')) { - state.commentLevel++; - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - } - if (ch === '~') { - stream.eatWhile(/\w/); - return 'variable-2'; - } - if (ch === '`') { - stream.eatWhile(/\w/); - return 'quote'; - } - if (ch === '/' && parserConfig.slashComments && stream.eat('/')) { - stream.skipToEnd(); - return 'comment'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\d]/); - if (stream.eat('.')) { - stream.eatWhile(/[\d]/); - } - return 'number'; - } - if ( /[+\-*&%=<>!?|]/.test(ch)) { - return 'operator'; - } - stream.eatWhile(/\w/); - var cur = stream.current(); - return words.hasOwnProperty(cur) ? words[cur] : 'variable'; - } - - function tokenString(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === '"' && !escaped) { - end = true; - break; - } - escaped = !escaped && next === '\\'; - } - if (end && !escaped) { - state.tokenize = tokenBase; - } - return 'string'; - }; - - function tokenComment(stream, state) { - var prev, next; - while(state.commentLevel > 0 && (next = stream.next()) != null) { - if (prev === '(' && next === '*') state.commentLevel++; - if (prev === '*' && next === ')') state.commentLevel--; - prev = next; - } - if (state.commentLevel <= 0) { - state.tokenize = tokenBase; - } - return 'comment'; - } - - return { - startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - - blockCommentStart: "(*", - blockCommentEnd: "*)", - lineComment: parserConfig.slashComments ? "//" : null - }; -}); - -CodeMirror.defineMIME('text/x-ocaml', { - name: 'mllike', - extraWords: { - 'succ': 'keyword', - 'trace': 'builtin', - 'exit': 'builtin', - 'print_string': 'builtin', - 'print_endline': 'builtin', - 'true': 'atom', - 'false': 'atom', - 'raise': 'keyword' - } -}); - -CodeMirror.defineMIME('text/x-fsharp', { - name: 'mllike', - extraWords: { - 'abstract': 'keyword', - 'as': 'keyword', - 'assert': 'keyword', - 'base': 'keyword', - 'class': 'keyword', - 'default': 'keyword', - 'delegate': 'keyword', - 'downcast': 'keyword', - 'downto': 'keyword', - 'elif': 'keyword', - 'exception': 'keyword', - 'extern': 'keyword', - 'finally': 'keyword', - 'global': 'keyword', - 'inherit': 'keyword', - 'inline': 'keyword', - 'interface': 'keyword', - 'internal': 'keyword', - 'lazy': 'keyword', - 'let!': 'keyword', - 'member' : 'keyword', - 'module': 'keyword', - 'namespace': 'keyword', - 'new': 'keyword', - 'null': 'keyword', - 'override': 'keyword', - 'private': 'keyword', - 'public': 'keyword', - 'return': 'keyword', - 'return!': 'keyword', - 'select': 'keyword', - 'static': 'keyword', - 'struct': 'keyword', - 'upcast': 'keyword', - 'use': 'keyword', - 'use!': 'keyword', - 'val': 'keyword', - 'when': 'keyword', - 'yield': 'keyword', - 'yield!': 'keyword', - - 'List': 'builtin', - 'Seq': 'builtin', - 'Map': 'builtin', - 'Set': 'builtin', - 'int': 'builtin', - 'string': 'builtin', - 'raise': 'builtin', - 'failwith': 'builtin', - 'not': 'builtin', - 'true': 'builtin', - 'false': 'builtin' - }, - slashComments: true -}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/modelica/index.html b/public/plugins/codemirror-5.17.0/mode/modelica/index.html deleted file mode 100644 index 408c3b17e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/modelica/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - -CodeMirror: Modelica mode - - - - - - - - - - - - -
-

Modelica mode

- -
- - - -

Simple mode that tries to handle Modelica as well as it can.

- -

MIME types defined: text/x-modelica - (Modlica code).

-
diff --git a/public/plugins/codemirror-5.17.0/mode/modelica/modelica.js b/public/plugins/codemirror-5.17.0/mode/modelica/modelica.js deleted file mode 100644 index 77ec7a3c1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/modelica/modelica.js +++ /dev/null @@ -1,245 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Modelica support for CodeMirror, copyright (c) by Lennart Ochel - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -}) - -(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("modelica", function(config, parserConfig) { - - var indentUnit = config.indentUnit; - var keywords = parserConfig.keywords || {}; - var builtin = parserConfig.builtin || {}; - var atoms = parserConfig.atoms || {}; - - var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/; - var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/; - var isDigit = /[0-9]/; - var isNonDigit = /[_a-zA-Z]/; - - function tokenLineComment(stream, state) { - stream.skipToEnd(); - state.tokenize = null; - return "comment"; - } - - function tokenBlockComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == '"' && !escaped) { - state.tokenize = null; - state.sol = false; - break; - } - escaped = !escaped && ch == "\\"; - } - - return "string"; - } - - function tokenIdent(stream, state) { - stream.eatWhile(isDigit); - while (stream.eat(isDigit) || stream.eat(isNonDigit)) { } - - - var cur = stream.current(); - - if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++; - else if(state.sol && cur == "end" && state.level > 0) state.level--; - - state.tokenize = null; - state.sol = false; - - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - else if (builtin.propertyIsEnumerable(cur)) return "builtin"; - else if (atoms.propertyIsEnumerable(cur)) return "atom"; - else return "variable"; - } - - function tokenQIdent(stream, state) { - while (stream.eat(/[^']/)) { } - - state.tokenize = null; - state.sol = false; - - if(stream.eat("'")) - return "variable"; - else - return "error"; - } - - function tokenUnsignedNuber(stream, state) { - stream.eatWhile(isDigit); - if (stream.eat('.')) { - stream.eatWhile(isDigit); - } - if (stream.eat('e') || stream.eat('E')) { - if (!stream.eat('-')) - stream.eat('+'); - stream.eatWhile(isDigit); - } - - state.tokenize = null; - state.sol = false; - return "number"; - } - - // Interface - return { - startState: function() { - return { - tokenize: null, - level: 0, - sol: true - }; - }, - - token: function(stream, state) { - if(state.tokenize != null) { - return state.tokenize(stream, state); - } - - if(stream.sol()) { - state.sol = true; - } - - // WHITESPACE - if(stream.eatSpace()) { - state.tokenize = null; - return null; - } - - var ch = stream.next(); - - // LINECOMMENT - if(ch == '/' && stream.eat('/')) { - state.tokenize = tokenLineComment; - } - // BLOCKCOMMENT - else if(ch == '/' && stream.eat('*')) { - state.tokenize = tokenBlockComment; - } - // TWO SYMBOL TOKENS - else if(isDoubleOperatorChar.test(ch+stream.peek())) { - stream.next(); - state.tokenize = null; - return "operator"; - } - // SINGLE SYMBOL TOKENS - else if(isSingleOperatorChar.test(ch)) { - state.tokenize = null; - return "operator"; - } - // IDENT - else if(isNonDigit.test(ch)) { - state.tokenize = tokenIdent; - } - // Q-IDENT - else if(ch == "'" && stream.peek() && stream.peek() != "'") { - state.tokenize = tokenQIdent; - } - // STRING - else if(ch == '"') { - state.tokenize = tokenString; - } - // UNSIGNED_NUBER - else if(isDigit.test(ch)) { - state.tokenize = tokenUnsignedNuber; - } - // ERROR - else { - state.tokenize = null; - return "error"; - } - - return state.tokenize(stream, state); - }, - - indent: function(state, textAfter) { - if (state.tokenize != null) return CodeMirror.Pass; - - var level = state.level; - if(/(algorithm)/.test(textAfter)) level--; - if(/(equation)/.test(textAfter)) level--; - if(/(initial algorithm)/.test(textAfter)) level--; - if(/(initial equation)/.test(textAfter)) level--; - if(/(end)/.test(textAfter)) level--; - - if(level > 0) - return indentUnit*level; - else - return 0; - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; - }); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i=0; i - -CodeMirror: MscGen mode - - - - - - - - - -
-

MscGen mode

- -
- -

Xù mode

- -
- -

MsGenny mode

-
- -

- Simple mode for highlighting MscGen and two derived sequence - chart languages. -

- - - -

MIME types defined: - text/x-mscgen - text/x-xu - text/x-msgenny -

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/mscgen/mscgen.js b/public/plugins/codemirror-5.17.0/mode/mscgen/mscgen.js deleted file mode 100644 index d61b47065..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mscgen/mscgen.js +++ /dev/null @@ -1,169 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// mode(s) for the sequence chart dsl's mscgen, xù and msgenny -// For more information on mscgen, see the site of the original author: -// http://www.mcternan.me.uk/mscgen -// -// This mode for mscgen and the two derivative languages were -// originally made for use in the mscgen_js interpreter -// (https://sverweij.github.io/mscgen_js) - -(function(mod) { - if ( typeof exports == "object" && typeof module == "object")// CommonJS - mod(require("../../lib/codemirror")); - else if ( typeof define == "function" && define.amd)// AMD - define(["../../lib/codemirror"], mod); - else// Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var languages = { - mscgen: { - "keywords" : ["msc"], - "options" : ["hscale", "width", "arcgradient", "wordwraparcs"], - "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], - "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists - "arcsWords" : ["note", "abox", "rbox", "box"], - "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], - "singlecomment" : ["//", "#"], - "operators" : ["="] - }, - xu: { - "keywords" : ["msc"], - "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], - "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], - "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists - "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], - "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], - "singlecomment" : ["//", "#"], - "operators" : ["="] - }, - msgenny: { - "keywords" : null, - "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], - "attributes" : null, - "brackets" : ["\\{", "\\}"], - "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], - "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], - "singlecomment" : ["//", "#"], - "operators" : ["="] - } - } - - CodeMirror.defineMode("mscgen", function(_, modeConfig) { - var language = languages[modeConfig && modeConfig.language || "mscgen"] - return { - startState: startStateFn, - copyState: copyStateFn, - token: produceTokenFunction(language), - lineComment : "#", - blockCommentStart : "/*", - blockCommentEnd : "*/" - }; - }); - - CodeMirror.defineMIME("text/x-mscgen", "mscgen"); - CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"}); - CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"}); - - function wordRegexpBoundary(pWords) { - return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i"); - } - - function wordRegexp(pWords) { - return new RegExp("(" + pWords.join("|") + ")", "i"); - } - - function startStateFn() { - return { - inComment : false, - inString : false, - inAttributeList : false, - inScript : false - }; - } - - function copyStateFn(pState) { - return { - inComment : pState.inComment, - inString : pState.inString, - inAttributeList : pState.inAttributeList, - inScript : pState.inScript - }; - } - - function produceTokenFunction(pConfig) { - - return function(pStream, pState) { - if (pStream.match(wordRegexp(pConfig.brackets), true, true)) { - return "bracket"; - } - /* comments */ - if (!pState.inComment) { - if (pStream.match(/\/\*[^\*\/]*/, true, true)) { - pState.inComment = true; - return "comment"; - } - if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) { - pStream.skipToEnd(); - return "comment"; - } - } - if (pState.inComment) { - if (pStream.match(/[^\*\/]*\*\//, true, true)) - pState.inComment = false; - else - pStream.skipToEnd(); - return "comment"; - } - /* strings */ - if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) { - pState.inString = true; - return "string"; - } - if (pState.inString) { - if (pStream.match(/[^\"]*\"/, true, true)) - pState.inString = false; - else - pStream.skipToEnd(); - return "string"; - } - /* keywords & operators */ - if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true)) - return "keyword"; - - if (pStream.match(wordRegexpBoundary(pConfig.options), true, true)) - return "keyword"; - - if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true)) - return "keyword"; - - if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true)) - return "keyword"; - - if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true)) - return "operator"; - - /* attribute lists */ - if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) { - pConfig.inAttributeList = true; - return "bracket"; - } - if (pConfig.inAttributeList) { - if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) { - return "attribute"; - } - if (pStream.match(/]/, true, true)) { - pConfig.inAttributeList = false; - return "bracket"; - } - } - - pStream.next(); - return "base"; - }; - } - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/mscgen/mscgen_test.js b/public/plugins/codemirror-5.17.0/mode/mscgen/mscgen_test.js deleted file mode 100644 index e319a3997..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mscgen/mscgen_test.js +++ /dev/null @@ -1,75 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "mscgen"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("empty chart", - "[keyword msc][bracket {]", - "[base ]", - "[bracket }]" - ); - - MT("comments", - "[comment // a single line comment]", - "[comment # another single line comment /* and */ ignored here]", - "[comment /* A multi-line comment even though it contains]", - "[comment msc keywords and \"quoted text\"*/]"); - - MT("strings", - "[string \"// a string\"]", - "[string \"a string running over]", - "[string two lines\"]", - "[string \"with \\\"escaped quote\"]" - ); - - MT("xù/ msgenny keywords classify as 'base'", - "[base watermark]", - "[base alt loop opt ref else break par seq assert]" - ); - - MT("mscgen options classify as keyword", - "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" - ); - - MT("mscgen arcs classify as keyword", - "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", - "[keyword |||...---]", "[keyword ..--==::]", - "[keyword ->]", "[keyword <-]", "[keyword <->]", - "[keyword =>]", "[keyword <=]", "[keyword <=>]", - "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", - "[keyword >>]", "[keyword <<]", "[keyword <<>>]", - "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", - "[keyword :>]", "[keyword <:]", "[keyword <:>]" - ); - - MT("within an attribute list, attributes classify as attribute", - "[bracket [[][attribute label]", - "[attribute id]","[attribute url]","[attribute idurl]", - "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]", - "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]", - "[attribute arcskip][bracket ]]]" - ); - - MT("outside an attribute list, attributes classify as base", - "[base label]", - "[base id]","[base url]","[base idurl]", - "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]", - "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]", - "[base arcskip]" - ); - - MT("a typical program", - "[comment # typical mscgen program]", - "[keyword msc][base ][bracket {]", - "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]", - "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]", - "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]", - "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]", - "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]", - "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]", - "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]", - "[bracket }]" - ); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/mscgen/msgenny_test.js b/public/plugins/codemirror-5.17.0/mode/mscgen/msgenny_test.js deleted file mode 100644 index 80173de08..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mscgen/msgenny_test.js +++ /dev/null @@ -1,71 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); } - - MT("comments", - "[comment // a single line comment]", - "[comment # another single line comment /* and */ ignored here]", - "[comment /* A multi-line comment even though it contains]", - "[comment msc keywords and \"quoted text\"*/]"); - - MT("strings", - "[string \"// a string\"]", - "[string \"a string running over]", - "[string two lines\"]", - "[string \"with \\\"escaped quote\"]" - ); - - MT("xù/ msgenny keywords classify as 'keyword'", - "[keyword watermark]", - "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]" - ); - - MT("mscgen options classify as keyword", - "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" - ); - - MT("mscgen arcs classify as keyword", - "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", - "[keyword |||...---]", "[keyword ..--==::]", - "[keyword ->]", "[keyword <-]", "[keyword <->]", - "[keyword =>]", "[keyword <=]", "[keyword <=>]", - "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", - "[keyword >>]", "[keyword <<]", "[keyword <<>>]", - "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", - "[keyword :>]", "[keyword <:]", "[keyword <:>]" - ); - - MT("within an attribute list, mscgen/ xù attributes classify as base", - "[base [[label]", - "[base idurl id url]", - "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]", - "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]", - "[base arcskip]]]" - ); - - MT("outside an attribute list, mscgen/ xù attributes classify as base", - "[base label]", - "[base idurl id url]", - "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]", - "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]", - "[base arcskip]" - ); - - MT("a typical program", - "[comment # typical msgenny program]", - "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]", - "[base a : ][string \"Entity A\"][base ,]", - "[base b : Entity B,]", - "[base c : Entity C;]", - "[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]", - "[base a ][keyword alt][base c][bracket {]", - "[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]", - "[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]", - "[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]", - "[bracket }]", - "[base c ][keyword :>][base *: What about me?;]" - ); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/mscgen/xu_test.js b/public/plugins/codemirror-5.17.0/mode/mscgen/xu_test.js deleted file mode 100644 index f9a50f0af..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mscgen/xu_test.js +++ /dev/null @@ -1,75 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); } - - MT("empty chart", - "[keyword msc][bracket {]", - "[base ]", - "[bracket }]" - ); - - MT("comments", - "[comment // a single line comment]", - "[comment # another single line comment /* and */ ignored here]", - "[comment /* A multi-line comment even though it contains]", - "[comment msc keywords and \"quoted text\"*/]"); - - MT("strings", - "[string \"// a string\"]", - "[string \"a string running over]", - "[string two lines\"]", - "[string \"with \\\"escaped quote\"]" - ); - - MT("xù/ msgenny keywords classify as 'keyword'", - "[keyword watermark]", - "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]" - ); - - MT("mscgen options classify as keyword", - "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" - ); - - MT("mscgen arcs classify as keyword", - "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", - "[keyword |||...---]", "[keyword ..--==::]", - "[keyword ->]", "[keyword <-]", "[keyword <->]", - "[keyword =>]", "[keyword <=]", "[keyword <=>]", - "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", - "[keyword >>]", "[keyword <<]", "[keyword <<>>]", - "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", - "[keyword :>]", "[keyword <:]", "[keyword <:>]" - ); - - MT("within an attribute list, attributes classify as attribute", - "[bracket [[][attribute label]", - "[attribute id]","[attribute url]","[attribute idurl]", - "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]", - "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]", - "[attribute arcskip][bracket ]]]" - ); - - MT("outside an attribute list, attributes classify as base", - "[base label]", - "[base id]","[base url]","[base idurl]", - "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]", - "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]", - "[base arcskip]" - ); - - MT("a typical program", - "[comment # typical mscgen program]", - "[keyword msc][base ][bracket {]", - "[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]", - "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]", - "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]", - "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]", - "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]", - "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]", - "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]", - "[bracket }]" - ); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/mumps/index.html b/public/plugins/codemirror-5.17.0/mode/mumps/index.html deleted file mode 100644 index b1f92c213..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mumps/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: MUMPS mode - - - - - - - - - -
-

MUMPS mode

- - -
- - -
diff --git a/public/plugins/codemirror-5.17.0/mode/mumps/mumps.js b/public/plugins/codemirror-5.17.0/mode/mumps/mumps.js deleted file mode 100644 index 469f8c3d1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/mumps/mumps.js +++ /dev/null @@ -1,148 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - This MUMPS Language script was constructed using vbscript.js as a template. -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("mumps", function() { - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"); - var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"); - var singleDelimiters = new RegExp("^[\\.,:]"); - var brackets = new RegExp("[()]"); - var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); - var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; - // The following list includes instrinsic functions _and_ special variables - var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; - var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); - var command = wordRegexp(commandKeywords); - - function tokenBase(stream, state) { - if (stream.sol()) { - state.label = true; - state.commandMode = 0; - } - - // The character has meaning in MUMPS. Ignoring consecutive - // spaces would interfere with interpreting whether the next non-space - // character belongs to the command or argument context. - - // Examine each character and update a mode variable whose interpretation is: - // >0 => command 0 => argument <0 => command post-conditional - var ch = stream.peek(); - - if (ch == " " || ch == "\t") { // Pre-process - state.label = false; - if (state.commandMode == 0) - state.commandMode = 1; - else if ((state.commandMode < 0) || (state.commandMode == 2)) - state.commandMode = 0; - } else if ((ch != ".") && (state.commandMode > 0)) { - if (ch == ":") - state.commandMode = -1; // SIS - Command post-conditional - else - state.commandMode = 2; - } - - // Do not color parameter list as line tag - if ((ch === "(") || (ch === "\u0009")) - state.label = false; - - // MUMPS comment starts with ";" - if (ch === ";") { - stream.skipToEnd(); - return "comment"; - } - - // Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator - if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)) - return "number"; - - // Handle Strings - if (ch == '"') { - if (stream.skipTo('"')) { - stream.next(); - return "string"; - } else { - stream.skipToEnd(); - return "error"; - } - } - - // Handle operators and Delimiters - if (stream.match(doubleOperators) || stream.match(singleOperators)) - return "operator"; - - // Prevents leading "." in DO block from falling through to error - if (stream.match(singleDelimiters)) - return null; - - if (brackets.test(ch)) { - stream.next(); - return "bracket"; - } - - if (state.commandMode > 0 && stream.match(command)) - return "variable-2"; - - if (stream.match(intrinsicFuncs)) - return "builtin"; - - if (stream.match(identifiers)) - return "variable"; - - // Detect dollar-sign when not a documented intrinsic function - // "^" may introduce a GVN or SSVN - Color same as function - if (ch === "$" || ch === "^") { - stream.next(); - return "builtin"; - } - - // MUMPS Indirection - if (ch === "@") { - stream.next(); - return "string-2"; - } - - if (/[\w%]/.test(ch)) { - stream.eatWhile(/[\w%]/); - return "variable"; - } - - // Handle non-detected items - stream.next(); - return "error"; - } - - return { - startState: function() { - return { - label: false, - commandMode: 0 - }; - }, - - token: function(stream, state) { - var style = tokenBase(stream, state); - if (state.label) return "tag"; - return style; - } - }; - }); - - CodeMirror.defineMIME("text/x-mumps", "mumps"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/nginx/index.html b/public/plugins/codemirror-5.17.0/mode/nginx/index.html deleted file mode 100644 index 03cf67149..000000000 --- a/public/plugins/codemirror-5.17.0/mode/nginx/index.html +++ /dev/null @@ -1,181 +0,0 @@ - - -CodeMirror: NGINX mode - - - - - - - - - - - - - -
-

NGINX mode

-
- - -

MIME types defined: text/nginx.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/nginx/nginx.js b/public/plugins/codemirror-5.17.0/mode/nginx/nginx.js deleted file mode 100644 index 00a322492..000000000 --- a/public/plugins/codemirror-5.17.0/mode/nginx/nginx.js +++ /dev/null @@ -1,178 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("nginx", function(config) { - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = words( - /* ngxDirectiveControl */ "break return rewrite set" + - /* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23" - ); - - var keywords_block = words( - /* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map" - ); - - var keywords_important = words( - /* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files" - ); - - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - - - stream.eatWhile(/[\w\$_]/); - - var cur = stream.current(); - - - if (keywords.propertyIsEnumerable(cur)) { - return "keyword"; - } - else if (keywords_block.propertyIsEnumerable(cur)) { - return "variable-2"; - } - else if (keywords_important.propertyIsEnumerable(cur)) { - return "string-2"; - } - /**/ - - var ch = stream.next(); - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (/[,.+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (/[;{}:\[\]]/.test(ch)) { - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("variable", "variable"); - } - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = "number"; - else if (!context || context == "@media{") style = "tag"; - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/x-nginx-conf", "nginx"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/nsis/index.html b/public/plugins/codemirror-5.17.0/mode/nsis/index.html deleted file mode 100644 index 2afae87f0..000000000 --- a/public/plugins/codemirror-5.17.0/mode/nsis/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - -CodeMirror: NSIS mode - - - - - - - - - - - -
-

NSIS mode

- - - - - - -

MIME types defined: text/x-nsis.

-
\ No newline at end of file diff --git a/public/plugins/codemirror-5.17.0/mode/nsis/nsis.js b/public/plugins/codemirror-5.17.0/mode/nsis/nsis.js deleted file mode 100644 index 172207c5a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/nsis/nsis.js +++ /dev/null @@ -1,95 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Author: Jan T. Sott (http://github.com/idleberg) - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineSimpleMode("nsis",{ - start:[ - // Numbers - {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"}, - - // Strings - { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, - { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, - { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" }, - - // Compile Time Commands - {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"}, - - // Conditional Compilation - {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true}, - {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true}, - - // Runtime Commands - {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"}, - {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true}, - {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true}, - - // Command Options - {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"}, - {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"}, - - // LogicLib.nsh - {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true}, - - // FileFunc.nsh - {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true}, - - // Memento.nsh - {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true}, - - // TextFunc.nsh - {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true}, - - // WinVer.nsh - {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true}, - - // WordFunc.nsh - {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true}, - - // x64.nsh - {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true}, - {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true}, - - // Line Comment - {regex: /(#|;).*/, token: "comment"}, - - // Block Comment - {regex: /\/\*/, token: "comment", next: "comment"}, - - // Operator - {regex: /[-+\/*=<>!]+/, token: "operator"}, - - // Variable - {regex: /\$[\w]+/, token: "variable"}, - - // Constant - {regex: /\${[\w]+}/,token: "variable-2"}, - - // Language String - {regex: /\$\([\w]+\)/,token: "variable-3"} - ], - comment: [ - {regex: /.*?\*\//, token: "comment", next: "start"}, - {regex: /.*/, token: "comment"} - ], - meta: { - electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/, - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: ["#", ";"] - } -}); - -CodeMirror.defineMIME("text/x-nsis", "nsis"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/ntriples/index.html b/public/plugins/codemirror-5.17.0/mode/ntriples/index.html deleted file mode 100644 index 1355e7189..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ntriples/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: NTriples mode - - - - - - - - - -
-

NTriples mode

-
- - - - -

MIME types defined: text/n-triples.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/ntriples/ntriples.js b/public/plugins/codemirror-5.17.0/mode/ntriples/ntriples.js deleted file mode 100644 index 0524b1e8a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ntriples/ntriples.js +++ /dev/null @@ -1,186 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/********************************************************** -* This script provides syntax highlighting support for -* the Ntriples format. -* Ntriples format specification: -* http://www.w3.org/TR/rdf-testcases/#ntriples -***********************************************************/ - -/* - The following expression defines the defined ASF grammar transitions. - - pre_subject -> - { - ( writing_subject_uri | writing_bnode_uri ) - -> pre_predicate - -> writing_predicate_uri - -> pre_object - -> writing_object_uri | writing_object_bnode | - ( - writing_object_literal - -> writing_literal_lang | writing_literal_type - ) - -> post_object - -> BEGIN - } otherwise { - -> ERROR - } -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("ntriples", function() { - - var Location = { - PRE_SUBJECT : 0, - WRITING_SUB_URI : 1, - WRITING_BNODE_URI : 2, - PRE_PRED : 3, - WRITING_PRED_URI : 4, - PRE_OBJ : 5, - WRITING_OBJ_URI : 6, - WRITING_OBJ_BNODE : 7, - WRITING_OBJ_LITERAL : 8, - WRITING_LIT_LANG : 9, - WRITING_LIT_TYPE : 10, - POST_OBJ : 11, - ERROR : 12 - }; - function transitState(currState, c) { - var currLocation = currState.location; - var ret; - - // Opening. - if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; - else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; - else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; - else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; - else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; - else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; - - // Closing. - else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; - else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; - - // Closing typed and language literal. - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; - - // Spaces. - else if( c == ' ' && - ( - currLocation == Location.PRE_SUBJECT || - currLocation == Location.PRE_PRED || - currLocation == Location.PRE_OBJ || - currLocation == Location.POST_OBJ - ) - ) ret = currLocation; - - // Reset. - else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; - - // Error - else ret = Location.ERROR; - - currState.location=ret; - } - - return { - startState: function() { - return { - location : Location.PRE_SUBJECT, - uris : [], - anchors : [], - bnodes : [], - langs : [], - types : [] - }; - }, - token: function(stream, state) { - var ch = stream.next(); - if(ch == '<') { - transitState(state, ch); - var parsedURI = ''; - stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); - state.uris.push(parsedURI); - if( stream.match('#', false) ) return 'variable'; - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if(ch == '#') { - var parsedAnchor = ''; - stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;}); - state.anchors.push(parsedAnchor); - return 'variable-2'; - } - if(ch == '>') { - transitState(state, '>'); - return 'variable'; - } - if(ch == '_') { - transitState(state, ch); - var parsedBNode = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); - state.bnodes.push(parsedBNode); - stream.next(); - transitState(state, ' '); - return 'builtin'; - } - if(ch == '"') { - transitState(state, ch); - stream.eatWhile( function(c) { return c != '"'; } ); - stream.next(); - if( stream.peek() != '@' && stream.peek() != '^' ) { - transitState(state, '"'); - } - return 'string'; - } - if( ch == '@' ) { - transitState(state, '@'); - var parsedLang = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); - state.langs.push(parsedLang); - stream.next(); - transitState(state, ' '); - return 'string-2'; - } - if( ch == '^' ) { - stream.next(); - transitState(state, '^'); - var parsedType = ''; - stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); - state.types.push(parsedType); - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if( ch == ' ' ) { - transitState(state, ch); - } - if( ch == '.' ) { - transitState(state, ch); - } - } - }; -}); - -CodeMirror.defineMIME("text/n-triples", "ntriples"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/octave/index.html b/public/plugins/codemirror-5.17.0/mode/octave/index.html deleted file mode 100644 index 3490ee637..000000000 --- a/public/plugins/codemirror-5.17.0/mode/octave/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - -CodeMirror: Octave mode - - - - - - - - - -
-

Octave mode

- -
- - -

MIME types defined: text/x-octave.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/octave/octave.js b/public/plugins/codemirror-5.17.0/mode/octave/octave.js deleted file mode 100644 index a7bec030c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/octave/octave.js +++ /dev/null @@ -1,135 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("octave", function() { - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"); - var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]'); - var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"); - var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((>>=)|(<<=))"); - var expressionEnd = new RegExp("^[\\]\\)]"); - var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); - - var builtins = wordRegexp([ - 'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos', - 'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh', - 'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones', - 'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov', - 'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot', - 'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str', - 'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember' - ]); - - var keywords = wordRegexp([ - 'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction', - 'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events', - 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until', - 'continue', 'pkg' - ]); - - - // tokenizers - function tokenTranspose(stream, state) { - if (!stream.sol() && stream.peek() === '\'') { - stream.next(); - state.tokenize = tokenBase; - return 'operator'; - } - state.tokenize = tokenBase; - return tokenBase(stream, state); - } - - - function tokenComment(stream, state) { - if (stream.match(/^.*%}/)) { - state.tokenize = tokenBase; - return 'comment'; - }; - stream.skipToEnd(); - return 'comment'; - } - - function tokenBase(stream, state) { - // whitespaces - if (stream.eatSpace()) return null; - - // Handle one line Comments - if (stream.match('%{')){ - state.tokenize = tokenComment; - stream.skipToEnd(); - return 'comment'; - } - - if (stream.match(/^[%#]/)){ - stream.skipToEnd(); - return 'comment'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.+-]/, false)) { - if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) { - stream.tokenize = tokenBase; - return 'number'; }; - if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; }; - if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; }; - } - if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; }; - - // Handle Strings - if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ; - if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ; - - // Handle words - if (stream.match(keywords)) { return 'keyword'; } ; - if (stream.match(builtins)) { return 'builtin'; } ; - if (stream.match(identifiers)) { return 'variable'; } ; - - if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; }; - if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; }; - - if (stream.match(expressionEnd)) { - state.tokenize = tokenTranspose; - return null; - }; - - - // Handle non-detected items - stream.next(); - return 'error'; - }; - - - return { - startState: function() { - return { - tokenize: tokenBase - }; - }, - - token: function(stream, state) { - var style = state.tokenize(stream, state); - if (style === 'number' || style === 'variable'){ - state.tokenize = tokenTranspose; - } - return style; - } - }; -}); - -CodeMirror.defineMIME("text/x-octave", "octave"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/oz/index.html b/public/plugins/codemirror-5.17.0/mode/oz/index.html deleted file mode 100644 index febd82a59..000000000 --- a/public/plugins/codemirror-5.17.0/mode/oz/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - -CodeMirror: Oz mode - - - - - - - - - - -
-

Oz mode

- -

MIME type defined: text/x-oz.

- - -
diff --git a/public/plugins/codemirror-5.17.0/mode/oz/oz.js b/public/plugins/codemirror-5.17.0/mode/oz/oz.js deleted file mode 100644 index ee8cb0ad1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/oz/oz.js +++ /dev/null @@ -1,252 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("oz", function (conf) { - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/; - var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/; - var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/; - - var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch", - "finally", "with", "require", "prepare", "import", "export", "define", "do"]; - var end = ["end"]; - - var atoms = wordRegexp(["true", "false", "nil", "unit"]); - var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex", - "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]); - var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis", - "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]); - var middleKeywords = wordRegexp(middle); - var endKeywords = wordRegexp(end); - - // Tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return null; - } - - // Brackets - if(stream.match(/[{}]/)) { - return "bracket"; - } - - // Special [] keyword - if (stream.match(/(\[])/)) { - return "keyword" - } - - // Operators - if (stream.match(tripleOperators) || stream.match(doubleOperators)) { - return "operator"; - } - - // Atoms - if(stream.match(atoms)) { - return 'atom'; - } - - // Opening keywords - var matched = stream.match(openingKeywords); - if (matched) { - if (!state.doInCurrentLine) - state.currentIndent++; - else - state.doInCurrentLine = false; - - // Special matching for signatures - if(matched[0] == "proc" || matched[0] == "fun") - state.tokenize = tokenFunProc; - else if(matched[0] == "class") - state.tokenize = tokenClass; - else if(matched[0] == "meth") - state.tokenize = tokenMeth; - - return 'keyword'; - } - - // Middle and other keywords - if (stream.match(middleKeywords) || stream.match(commonKeywords)) { - return "keyword" - } - - // End keywords - if (stream.match(endKeywords)) { - state.currentIndent--; - return 'keyword'; - } - - // Eat the next char for next comparisons - var ch = stream.next(); - - // Strings - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - - // Numbers - if (/[~\d]/.test(ch)) { - if (ch == "~") { - if(! /^[0-9]/.test(stream.peek())) - return null; - else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) - return "number"; - } - - if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) - return "number"; - - return null; - } - - // Comments - if (ch == "%") { - stream.skipToEnd(); - return 'comment'; - } - else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - } - - // Single operators - if(singleOperators.test(ch)) { - return "operator"; - } - - // If nothing match, we skip the entire alphanumerical block - stream.eatWhile(/\w/); - - return "variable"; - } - - function tokenClass(stream, state) { - if (stream.eatSpace()) { - return null; - } - stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/); - state.tokenize = tokenBase; - return "variable-3" - } - - function tokenMeth(stream, state) { - if (stream.eatSpace()) { - return null; - } - stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/); - state.tokenize = tokenBase; - return "def" - } - - function tokenFunProc(stream, state) { - if (stream.eatSpace()) { - return null; - } - - if(!state.hasPassedFirstStage && stream.eat("{")) { - state.hasPassedFirstStage = true; - return "bracket"; - } - else if(state.hasPassedFirstStage) { - stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/); - state.hasPassedFirstStage = false; - state.tokenize = tokenBase; - return "def" - } - else { - state.tokenize = tokenBase; - return null; - } - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(quote) { - return function (stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end || !escaped) - state.tokenize = tokenBase; - return "string"; - }; - } - - function buildElectricInputRegEx() { - // Reindentation should occur on [] or on a match of any of - // the block closing keywords, at the end of a line. - var allClosings = middle.concat(end); - return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$"); - } - - return { - - startState: function () { - return { - tokenize: tokenBase, - currentIndent: 0, - doInCurrentLine: false, - hasPassedFirstStage: false - }; - }, - - token: function (stream, state) { - if (stream.sol()) - state.doInCurrentLine = 0; - - return state.tokenize(stream, state); - }, - - indent: function (state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, ''); - - if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/)) - return conf.indentUnit * (state.currentIndent - 1); - - if (state.currentIndent < 0) - return 0; - - return state.currentIndent * conf.indentUnit; - }, - fold: "indent", - electricInput: buildElectricInputRegEx(), - lineComment: "%", - blockCommentStart: "/*", - blockCommentEnd: "*/" - }; -}); - -CodeMirror.defineMIME("text/x-oz", "oz"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/pascal/index.html b/public/plugins/codemirror-5.17.0/mode/pascal/index.html deleted file mode 100644 index f8a99ad01..000000000 --- a/public/plugins/codemirror-5.17.0/mode/pascal/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Pascal mode - - - - - - - - - -
-

Pascal mode

- - -
- - - -

MIME types defined: text/x-pascal.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/pascal/pascal.js b/public/plugins/codemirror-5.17.0/mode/pascal/pascal.js deleted file mode 100644 index 2d0c3d424..000000000 --- a/public/plugins/codemirror-5.17.0/mode/pascal/pascal.js +++ /dev/null @@ -1,109 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pascal", function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words("and array begin case const div do downto else end file for forward integer " + - "boolean char function goto if in label mod nil not of or packed procedure " + - "program record repeat set string then to type until var while with"); - var atoms = {"null": true}; - - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "#" && state.startOfLine) { - stream.skipToEnd(); - return "meta"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (ch == "(" && stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - // Interface - - return { - startState: function() { - return {tokenize: null}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - return style; - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-pascal", "pascal"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/pegjs/index.html b/public/plugins/codemirror-5.17.0/mode/pegjs/index.html deleted file mode 100644 index 0c7460488..000000000 --- a/public/plugins/codemirror-5.17.0/mode/pegjs/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - CodeMirror: PEG.js Mode - - - - - - - - - - - - -
-

PEG.js Mode

-
- -

The PEG.js Mode

-

Created by Forbes Lindesay.

-
- - diff --git a/public/plugins/codemirror-5.17.0/mode/pegjs/pegjs.js b/public/plugins/codemirror-5.17.0/mode/pegjs/pegjs.js deleted file mode 100644 index 6c7207466..000000000 --- a/public/plugins/codemirror-5.17.0/mode/pegjs/pegjs.js +++ /dev/null @@ -1,114 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../javascript/javascript")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../javascript/javascript"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pegjs", function (config) { - var jsMode = CodeMirror.getMode(config, "javascript"); - - function identifier(stream) { - return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/); - } - - return { - startState: function () { - return { - inString: false, - stringType: null, - inComment: false, - inCharacterClass: false, - braced: 0, - lhs: true, - localState: null - }; - }, - token: function (stream, state) { - if (stream) - - //check for state changes - if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.inString = true; // Update state - } - if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { - state.inComment = true; - } - - //return state - if (state.inString) { - while (state.inString && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.inString = false; // Clear flag - } else if (stream.peek() === '\\') { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return state.lhs ? "property string" : "string"; // Token style - } else if (state.inComment) { - while (state.inComment && !stream.eol()) { - if (stream.match(/\*\//)) { - state.inComment = false; // Clear flag - } else { - stream.match(/^.[^\*]*/); - } - } - return "comment"; - } else if (state.inCharacterClass) { - while (state.inCharacterClass && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { - state.inCharacterClass = false; - } - } - } else if (stream.peek() === '[') { - stream.next(); - state.inCharacterClass = true; - return 'bracket'; - } else if (stream.match(/^\/\//)) { - stream.skipToEnd(); - return "comment"; - } else if (state.braced || stream.peek() === '{') { - if (state.localState === null) { - state.localState = CodeMirror.startState(jsMode); - } - var token = jsMode.token(stream, state.localState); - var text = stream.current(); - if (!token) { - for (var i = 0; i < text.length; i++) { - if (text[i] === '{') { - state.braced++; - } else if (text[i] === '}') { - state.braced--; - } - }; - } - return token; - } else if (identifier(stream)) { - if (stream.peek() === ':') { - return 'variable'; - } - return 'variable-2'; - } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) { - stream.next(); - return 'bracket'; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; -}, "javascript"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/perl/index.html b/public/plugins/codemirror-5.17.0/mode/perl/index.html deleted file mode 100644 index 8c1021c42..000000000 --- a/public/plugins/codemirror-5.17.0/mode/perl/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Perl mode - - - - - - - - - -
-

Perl mode

- - -
- - - -

MIME types defined: text/x-perl.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/perl/perl.js b/public/plugins/codemirror-5.17.0/mode/perl/perl.js deleted file mode 100644 index 66e4ed034..000000000 --- a/public/plugins/codemirror-5.17.0/mode/perl/perl.js +++ /dev/null @@ -1,837 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) -// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("perl",function(){ - // http://perldoc.perl.org - var PERL={ // null - magic touch - // 1 - keyword - // 2 - def - // 3 - atom - // 4 - operator - // 5 - variable-2 (predefined) - // [x,y] - x=1,2,3; y=must be defined if x{...} - // PERL operators - '->' : 4, - '++' : 4, - '--' : 4, - '**' : 4, - // ! ~ \ and unary + and - - '=~' : 4, - '!~' : 4, - '*' : 4, - '/' : 4, - '%' : 4, - 'x' : 4, - '+' : 4, - '-' : 4, - '.' : 4, - '<<' : 4, - '>>' : 4, - // named unary operators - '<' : 4, - '>' : 4, - '<=' : 4, - '>=' : 4, - 'lt' : 4, - 'gt' : 4, - 'le' : 4, - 'ge' : 4, - '==' : 4, - '!=' : 4, - '<=>' : 4, - 'eq' : 4, - 'ne' : 4, - 'cmp' : 4, - '~~' : 4, - '&' : 4, - '|' : 4, - '^' : 4, - '&&' : 4, - '||' : 4, - '//' : 4, - '..' : 4, - '...' : 4, - '?' : 4, - ':' : 4, - '=' : 4, - '+=' : 4, - '-=' : 4, - '*=' : 4, // etc. ??? - ',' : 4, - '=>' : 4, - '::' : 4, - // list operators (rightward) - 'not' : 4, - 'and' : 4, - 'or' : 4, - 'xor' : 4, - // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) - 'BEGIN' : [5,1], - 'END' : [5,1], - 'PRINT' : [5,1], - 'PRINTF' : [5,1], - 'GETC' : [5,1], - 'READ' : [5,1], - 'READLINE' : [5,1], - 'DESTROY' : [5,1], - 'TIE' : [5,1], - 'TIEHANDLE' : [5,1], - 'UNTIE' : [5,1], - 'STDIN' : 5, - 'STDIN_TOP' : 5, - 'STDOUT' : 5, - 'STDOUT_TOP' : 5, - 'STDERR' : 5, - 'STDERR_TOP' : 5, - '$ARG' : 5, - '$_' : 5, - '@ARG' : 5, - '@_' : 5, - '$LIST_SEPARATOR' : 5, - '$"' : 5, - '$PROCESS_ID' : 5, - '$PID' : 5, - '$$' : 5, - '$REAL_GROUP_ID' : 5, - '$GID' : 5, - '$(' : 5, - '$EFFECTIVE_GROUP_ID' : 5, - '$EGID' : 5, - '$)' : 5, - '$PROGRAM_NAME' : 5, - '$0' : 5, - '$SUBSCRIPT_SEPARATOR' : 5, - '$SUBSEP' : 5, - '$;' : 5, - '$REAL_USER_ID' : 5, - '$UID' : 5, - '$<' : 5, - '$EFFECTIVE_USER_ID' : 5, - '$EUID' : 5, - '$>' : 5, - '$a' : 5, - '$b' : 5, - '$COMPILING' : 5, - '$^C' : 5, - '$DEBUGGING' : 5, - '$^D' : 5, - '${^ENCODING}' : 5, - '$ENV' : 5, - '%ENV' : 5, - '$SYSTEM_FD_MAX' : 5, - '$^F' : 5, - '@F' : 5, - '${^GLOBAL_PHASE}' : 5, - '$^H' : 5, - '%^H' : 5, - '@INC' : 5, - '%INC' : 5, - '$INPLACE_EDIT' : 5, - '$^I' : 5, - '$^M' : 5, - '$OSNAME' : 5, - '$^O' : 5, - '${^OPEN}' : 5, - '$PERLDB' : 5, - '$^P' : 5, - '$SIG' : 5, - '%SIG' : 5, - '$BASETIME' : 5, - '$^T' : 5, - '${^TAINT}' : 5, - '${^UNICODE}' : 5, - '${^UTF8CACHE}' : 5, - '${^UTF8LOCALE}' : 5, - '$PERL_VERSION' : 5, - '$^V' : 5, - '${^WIN32_SLOPPY_STAT}' : 5, - '$EXECUTABLE_NAME' : 5, - '$^X' : 5, - '$1' : 5, // - regexp $1, $2... - '$MATCH' : 5, - '$&' : 5, - '${^MATCH}' : 5, - '$PREMATCH' : 5, - '$`' : 5, - '${^PREMATCH}' : 5, - '$POSTMATCH' : 5, - "$'" : 5, - '${^POSTMATCH}' : 5, - '$LAST_PAREN_MATCH' : 5, - '$+' : 5, - '$LAST_SUBMATCH_RESULT' : 5, - '$^N' : 5, - '@LAST_MATCH_END' : 5, - '@+' : 5, - '%LAST_PAREN_MATCH' : 5, - '%+' : 5, - '@LAST_MATCH_START' : 5, - '@-' : 5, - '%LAST_MATCH_START' : 5, - '%-' : 5, - '$LAST_REGEXP_CODE_RESULT' : 5, - '$^R' : 5, - '${^RE_DEBUG_FLAGS}' : 5, - '${^RE_TRIE_MAXBUF}' : 5, - '$ARGV' : 5, - '@ARGV' : 5, - 'ARGV' : 5, - 'ARGVOUT' : 5, - '$OUTPUT_FIELD_SEPARATOR' : 5, - '$OFS' : 5, - '$,' : 5, - '$INPUT_LINE_NUMBER' : 5, - '$NR' : 5, - '$.' : 5, - '$INPUT_RECORD_SEPARATOR' : 5, - '$RS' : 5, - '$/' : 5, - '$OUTPUT_RECORD_SEPARATOR' : 5, - '$ORS' : 5, - '$\\' : 5, - '$OUTPUT_AUTOFLUSH' : 5, - '$|' : 5, - '$ACCUMULATOR' : 5, - '$^A' : 5, - '$FORMAT_FORMFEED' : 5, - '$^L' : 5, - '$FORMAT_PAGE_NUMBER' : 5, - '$%' : 5, - '$FORMAT_LINES_LEFT' : 5, - '$-' : 5, - '$FORMAT_LINE_BREAK_CHARACTERS' : 5, - '$:' : 5, - '$FORMAT_LINES_PER_PAGE' : 5, - '$=' : 5, - '$FORMAT_TOP_NAME' : 5, - '$^' : 5, - '$FORMAT_NAME' : 5, - '$~' : 5, - '${^CHILD_ERROR_NATIVE}' : 5, - '$EXTENDED_OS_ERROR' : 5, - '$^E' : 5, - '$EXCEPTIONS_BEING_CAUGHT' : 5, - '$^S' : 5, - '$WARNING' : 5, - '$^W' : 5, - '${^WARNING_BITS}' : 5, - '$OS_ERROR' : 5, - '$ERRNO' : 5, - '$!' : 5, - '%OS_ERROR' : 5, - '%ERRNO' : 5, - '%!' : 5, - '$CHILD_ERROR' : 5, - '$?' : 5, - '$EVAL_ERROR' : 5, - '$@' : 5, - '$OFMT' : 5, - '$#' : 5, - '$*' : 5, - '$ARRAY_BASE' : 5, - '$[' : 5, - '$OLD_PERL_VERSION' : 5, - '$]' : 5, - // PERL blocks - 'if' :[1,1], - elsif :[1,1], - 'else' :[1,1], - 'while' :[1,1], - unless :[1,1], - 'for' :[1,1], - foreach :[1,1], - // PERL functions - 'abs' :1, // - absolute value function - accept :1, // - accept an incoming socket connect - alarm :1, // - schedule a SIGALRM - 'atan2' :1, // - arctangent of Y/X in the range -PI to PI - bind :1, // - binds an address to a socket - binmode :1, // - prepare binary files for I/O - bless :1, // - create an object - bootstrap :1, // - 'break' :1, // - break out of a "given" block - caller :1, // - get context of the current subroutine call - chdir :1, // - change your current working directory - chmod :1, // - changes the permissions on a list of files - chomp :1, // - remove a trailing record separator from a string - chop :1, // - remove the last character from a string - chown :1, // - change the ownership on a list of files - chr :1, // - get character this number represents - chroot :1, // - make directory new root for path lookups - close :1, // - close file (or pipe or socket) handle - closedir :1, // - close directory handle - connect :1, // - connect to a remote socket - 'continue' :[1,1], // - optional trailing block in a while or foreach - 'cos' :1, // - cosine function - crypt :1, // - one-way passwd-style encryption - dbmclose :1, // - breaks binding on a tied dbm file - dbmopen :1, // - create binding on a tied dbm file - 'default' :1, // - defined :1, // - test whether a value, variable, or function is defined - 'delete' :1, // - deletes a value from a hash - die :1, // - raise an exception or bail out - 'do' :1, // - turn a BLOCK into a TERM - dump :1, // - create an immediate core dump - each :1, // - retrieve the next key/value pair from a hash - endgrent :1, // - be done using group file - endhostent :1, // - be done using hosts file - endnetent :1, // - be done using networks file - endprotoent :1, // - be done using protocols file - endpwent :1, // - be done using passwd file - endservent :1, // - be done using services file - eof :1, // - test a filehandle for its end - 'eval' :1, // - catch exceptions or compile and run code - 'exec' :1, // - abandon this program to run another - exists :1, // - test whether a hash key is present - exit :1, // - terminate this program - 'exp' :1, // - raise I to a power - fcntl :1, // - file control system call - fileno :1, // - return file descriptor from filehandle - flock :1, // - lock an entire file with an advisory lock - fork :1, // - create a new process just like this one - format :1, // - declare a picture format with use by the write() function - formline :1, // - internal function used for formats - getc :1, // - get the next character from the filehandle - getgrent :1, // - get next group record - getgrgid :1, // - get group record given group user ID - getgrnam :1, // - get group record given group name - gethostbyaddr :1, // - get host record given its address - gethostbyname :1, // - get host record given name - gethostent :1, // - get next hosts record - getlogin :1, // - return who logged in at this tty - getnetbyaddr :1, // - get network record given its address - getnetbyname :1, // - get networks record given name - getnetent :1, // - get next networks record - getpeername :1, // - find the other end of a socket connection - getpgrp :1, // - get process group - getppid :1, // - get parent process ID - getpriority :1, // - get current nice value - getprotobyname :1, // - get protocol record given name - getprotobynumber :1, // - get protocol record numeric protocol - getprotoent :1, // - get next protocols record - getpwent :1, // - get next passwd record - getpwnam :1, // - get passwd record given user login name - getpwuid :1, // - get passwd record given user ID - getservbyname :1, // - get services record given its name - getservbyport :1, // - get services record given numeric port - getservent :1, // - get next services record - getsockname :1, // - retrieve the sockaddr for a given socket - getsockopt :1, // - get socket options on a given socket - given :1, // - glob :1, // - expand filenames using wildcards - gmtime :1, // - convert UNIX time into record or string using Greenwich time - 'goto' :1, // - create spaghetti code - grep :1, // - locate elements in a list test true against a given criterion - hex :1, // - convert a string to a hexadecimal number - 'import' :1, // - patch a module's namespace into your own - index :1, // - find a substring within a string - 'int' :1, // - get the integer portion of a number - ioctl :1, // - system-dependent device control system call - 'join' :1, // - join a list into a string using a separator - keys :1, // - retrieve list of indices from a hash - kill :1, // - send a signal to a process or process group - last :1, // - exit a block prematurely - lc :1, // - return lower-case version of a string - lcfirst :1, // - return a string with just the next letter in lower case - length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem - listen :1, // - register your socket as a server - local : 2, // - create a temporary value for a global variable (dynamic scoping) - localtime :1, // - convert UNIX time into record or string using local time - lock :1, // - get a thread lock on a variable, subroutine, or method - 'log' :1, // - retrieve the natural logarithm for a number - lstat :1, // - stat a symbolic link - m :null, // - match a string with a regular expression pattern - map :1, // - apply a change to a list to get back a new list with the changes - mkdir :1, // - create a directory - msgctl :1, // - SysV IPC message control operations - msgget :1, // - get SysV IPC message queue - msgrcv :1, // - receive a SysV IPC message from a message queue - msgsnd :1, // - send a SysV IPC message to a message queue - my : 2, // - declare and assign a local variable (lexical scoping) - 'new' :1, // - next :1, // - iterate a block prematurely - no :1, // - unimport some module symbols or semantics at compile time - oct :1, // - convert a string to an octal number - open :1, // - open a file, pipe, or descriptor - opendir :1, // - open a directory - ord :1, // - find a character's numeric representation - our : 2, // - declare and assign a package variable (lexical scoping) - pack :1, // - convert a list into a binary representation - 'package' :1, // - declare a separate global namespace - pipe :1, // - open a pair of connected filehandles - pop :1, // - remove the last element from an array and return it - pos :1, // - find or set the offset for the last/next m//g search - print :1, // - output a list to a filehandle - printf :1, // - output a formatted list to a filehandle - prototype :1, // - get the prototype (if any) of a subroutine - push :1, // - append one or more elements to an array - q :null, // - singly quote a string - qq :null, // - doubly quote a string - qr :null, // - Compile pattern - quotemeta :null, // - quote regular expression magic characters - qw :null, // - quote a list of words - qx :null, // - backquote quote a string - rand :1, // - retrieve the next pseudorandom number - read :1, // - fixed-length buffered input from a filehandle - readdir :1, // - get a directory from a directory handle - readline :1, // - fetch a record from a file - readlink :1, // - determine where a symbolic link is pointing - readpipe :1, // - execute a system command and collect standard output - recv :1, // - receive a message over a Socket - redo :1, // - start this loop iteration over again - ref :1, // - find out the type of thing being referenced - rename :1, // - change a filename - require :1, // - load in external functions from a library at runtime - reset :1, // - clear all variables of a given name - 'return' :1, // - get out of a function early - reverse :1, // - flip a string or a list - rewinddir :1, // - reset directory handle - rindex :1, // - right-to-left substring search - rmdir :1, // - remove a directory - s :null, // - replace a pattern with a string - say :1, // - print with newline - scalar :1, // - force a scalar context - seek :1, // - reposition file pointer for random-access I/O - seekdir :1, // - reposition directory pointer - select :1, // - reset default output or do I/O multiplexing - semctl :1, // - SysV semaphore control operations - semget :1, // - get set of SysV semaphores - semop :1, // - SysV semaphore operations - send :1, // - send a message over a socket - setgrent :1, // - prepare group file for use - sethostent :1, // - prepare hosts file for use - setnetent :1, // - prepare networks file for use - setpgrp :1, // - set the process group of a process - setpriority :1, // - set a process's nice value - setprotoent :1, // - prepare protocols file for use - setpwent :1, // - prepare passwd file for use - setservent :1, // - prepare services file for use - setsockopt :1, // - set some socket options - shift :1, // - remove the first element of an array, and return it - shmctl :1, // - SysV shared memory operations - shmget :1, // - get SysV shared memory segment identifier - shmread :1, // - read SysV shared memory - shmwrite :1, // - write SysV shared memory - shutdown :1, // - close down just half of a socket connection - 'sin' :1, // - return the sine of a number - sleep :1, // - block for some number of seconds - socket :1, // - create a socket - socketpair :1, // - create a pair of sockets - 'sort' :1, // - sort a list of values - splice :1, // - add or remove elements anywhere in an array - 'split' :1, // - split up a string using a regexp delimiter - sprintf :1, // - formatted print into a string - 'sqrt' :1, // - square root function - srand :1, // - seed the random number generator - stat :1, // - get a file's status information - state :1, // - declare and assign a state variable (persistent lexical scoping) - study :1, // - optimize input data for repeated searches - 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng - symlink :1, // - create a symbolic link to a file - syscall :1, // - execute an arbitrary system call - sysopen :1, // - open a file, pipe, or descriptor - sysread :1, // - fixed-length unbuffered input from a filehandle - sysseek :1, // - position I/O pointer on handle used with sysread and syswrite - system :1, // - run a separate program - syswrite :1, // - fixed-length unbuffered output to a filehandle - tell :1, // - get current seekpointer on a filehandle - telldir :1, // - get current seekpointer on a directory handle - tie :1, // - bind a variable to an object class - tied :1, // - get a reference to the object underlying a tied variable - time :1, // - return number of seconds since 1970 - times :1, // - return elapsed time for self and child processes - tr :null, // - transliterate a string - truncate :1, // - shorten a file - uc :1, // - return upper-case version of a string - ucfirst :1, // - return a string with just the next letter in upper case - umask :1, // - set file creation mode mask - undef :1, // - remove a variable or function definition - unlink :1, // - remove one link to a file - unpack :1, // - convert binary structure into normal perl variables - unshift :1, // - prepend more elements to the beginning of a list - untie :1, // - break a tie binding to a variable - use :1, // - load in a module at compile time - utime :1, // - set a file's last access and modify times - values :1, // - return a list of the values in a hash - vec :1, // - test or set particular bits in a string - wait :1, // - wait for any child process to die - waitpid :1, // - wait for a particular child process to die - wantarray :1, // - get void vs scalar vs list context of current subroutine call - warn :1, // - print debugging info - when :1, // - write :1, // - print a picture record - y :null}; // - transliterate a string - - var RXstyle="string-2"; - var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type - - function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) - state.chain=null; // 12 3tail - state.style=null; - state.tail=null; - state.tokenize=function(stream,state){ - var e=false,c,i=0; - while(c=stream.next()){ - if(c===chain[i]&&!e){ - if(chain[++i]!==undefined){ - state.chain=chain[i]; - state.style=style; - state.tail=tail;} - else if(tail) - stream.eatWhile(tail); - state.tokenize=tokenPerl; - return style;} - e=!e&&c=="\\";} - return style;}; - return state.tokenize(stream,state);} - - function tokenSOMETHING(stream,state,string){ - state.tokenize=function(stream,state){ - if(stream.string==string) - state.tokenize=tokenPerl; - stream.skipToEnd(); - return "string";}; - return state.tokenize(stream,state);} - - function tokenPerl(stream,state){ - if(stream.eatSpace()) - return null; - if(state.chain) - return tokenChain(stream,state,state.chain,state.style,state.tail); - if(stream.match(/^\-?[\d\.]/,false)) - if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) - return 'number'; - if(stream.match(/^<<(?=\w)/)){ // NOTE: <"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(c=="q"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],"string");}} - else if(c=="w"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],"bracket");} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],"bracket");} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],"bracket");} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],"bracket");} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],"bracket");}} - else if(c=="r"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(/[\^'"!~\/(\[{<]/.test(c)){ - if(c=="("){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - eatSuffix(stream, 1); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - eatSuffix(stream, 1); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[stream.eat(c)],"string");}}}} - if(ch=="m"){ - var c=look(stream, -2); - if(!(c&&/\w/.test(c))){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[c],RXstyle,RXmodifiers);} - if(c=="("){ - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} - if(ch=="s"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="y"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="t"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat("r");if(c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}} - if(ch=="`"){ - return tokenChain(stream,state,[ch],"variable-2");} - if(ch=="/"){ - if(!/~\s*$/.test(prefix(stream))) - return "operator"; - else - return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} - if(ch=="$"){ - var p=stream.pos; - if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) - return "variable-2"; - else - stream.pos=p;} - if(/[$@%]/.test(ch)){ - var p=stream.pos; - if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ - var c=stream.current(); - if(PERL[c]) - return "variable-2";} - stream.pos=p;} - if(/[$@%&]/.test(ch)){ - if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ - var c=stream.current(); - if(PERL[c]) - return "variable-2"; - else - return "variable";}} - if(ch=="#"){ - if(look(stream, -2)!="$"){ - stream.skipToEnd(); - return "comment";}} - if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ - var p=stream.pos; - stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); - if(PERL[stream.current()]) - return "operator"; - else - stream.pos=p;} - if(ch=="_"){ - if(stream.pos==1){ - if(suffix(stream, 6)=="_END__"){ - return tokenChain(stream,state,['\0'],"comment");} - else if(suffix(stream, 7)=="_DATA__"){ - return tokenChain(stream,state,['\0'],"variable-2");} - else if(suffix(stream, 7)=="_C__"){ - return tokenChain(stream,state,['\0'],"string");}}} - if(/\w/.test(ch)){ - var p=stream.pos; - if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}")) - return "string"; - else - stream.pos=p;} - if(/[A-Z]/.test(ch)){ - var l=look(stream, -2); - var p=stream.pos; - stream.eatWhile(/[A-Z_]/); - if(/[\da-z]/.test(look(stream, 0))){ - stream.pos=p;} - else{ - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";}} - if(/[a-zA-Z_]/.test(ch)){ - var l=look(stream, -2); - stream.eatWhile(/\w/); - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";} - return null;} - - return { - startState: function() { - return { - tokenize: tokenPerl, - chain: null, - style: null, - tail: null - }; - }, - token: function(stream, state) { - return (state.tokenize || tokenPerl)(stream, state); - }, - lineComment: '#' - }; -}); - -CodeMirror.registerHelper("wordChars", "perl", /[\w$]/); - -CodeMirror.defineMIME("text/x-perl", "perl"); - -// it's like "peek", but need for look-ahead or look-behind if index < 0 -function look(stream, c){ - return stream.string.charAt(stream.pos+(c||0)); -} - -// return a part of prefix of current stream from current position -function prefix(stream, c){ - if(c){ - var x=stream.pos-c; - return stream.string.substr((x>=0?x:0),c);} - else{ - return stream.string.substr(0,stream.pos-1); - } -} - -// return a part of suffix of current stream from current position -function suffix(stream, c){ - var y=stream.string.length; - var x=y-stream.pos+1; - return stream.string.substr(stream.pos,(c&&c=(y=stream.string.length-1)) - stream.pos=y; - else - stream.pos=x; -} - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/php/index.html b/public/plugins/codemirror-5.17.0/mode/php/index.html deleted file mode 100644 index adf6b1be2..000000000 --- a/public/plugins/codemirror-5.17.0/mode/php/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: PHP mode - - - - - - - - - - - - - - - -
-

PHP mode

-
- - - -

Simple HTML/PHP mode based on - the C-like mode. Depends on XML, - JavaScript, CSS, HTMLMixed, and C-like modes.

- -

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

-
diff --git a/public/plugins/codemirror-5.17.0/mode/php/php.js b/public/plugins/codemirror-5.17.0/mode/php/php.js deleted file mode 100644 index 57ba812d7..000000000 --- a/public/plugins/codemirror-5.17.0/mode/php/php.js +++ /dev/null @@ -1,234 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // Helper for phpString - function matchSequence(list, end, escapes) { - if (list.length == 0) return phpString(end); - return function (stream, state) { - var patterns = list[0]; - for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) { - state.tokenize = matchSequence(list.slice(1), end); - return patterns[i][1]; - } - state.tokenize = phpString(end, escapes); - return "string"; - }; - } - function phpString(closing, escapes) { - return function(stream, state) { return phpString_(stream, state, closing, escapes); }; - } - function phpString_(stream, state, closing, escapes) { - // "Complex" syntax - if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) { - state.tokenize = null; - return "string"; - } - - // Simple syntax - if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) { - // After the variable name there may appear array or object operator. - if (stream.match("[", false)) { - // Match array operator - state.tokenize = matchSequence([ - [["[", null]], - [[/\d[\w\.]*/, "number"], - [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"], - [/[\w\$]+/, "variable"]], - [["]", null]] - ], closing, escapes); - } - if (stream.match(/\-\>\w/, false)) { - // Match object operator - state.tokenize = matchSequence([ - [["->", null]], - [[/[\w]+/, "variable"]] - ], closing, escapes); - } - return "variable-2"; - } - - var escaped = false; - // Normal string - while (!stream.eol() && - (escaped || escapes === false || - (!stream.match("{$", false) && - !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) { - if (!escaped && stream.match(closing)) { - state.tokenize = null; - state.tokStack.pop(); state.tokStack.pop(); - break; - } - escaped = stream.next() == "\\" && !escaped; - } - return "string"; - } - - var phpKeywords = "abstract and array as break case catch class clone const continue declare default " + - "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + - "for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw trait try use var while xor " + - "die echo empty exit eval include include_once isset list require require_once return " + - "print unset __halt_compiler self static parent yield insteadof finally"; - var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; - var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; - CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); - CodeMirror.registerHelper("wordChars", "php", /[\w$]/); - - var phpConfig = { - name: "clike", - helperType: "php", - keywords: keywords(phpKeywords), - blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), - defKeywords: keywords("class function interface namespace trait"), - atoms: keywords(phpAtoms), - builtin: keywords(phpBuiltin), - multiLineStrings: true, - hooks: { - "$": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - var before; - if (before = stream.match(/<<\s*/)) { - var quoted = stream.eat(/['"]/); - stream.eatWhile(/[\w\.]/); - var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1)); - if (quoted) stream.eat(quoted); - if (delim) { - (state.tokStack || (state.tokStack = [])).push(delim, 0); - state.tokenize = phpString(delim, quoted != "'"); - return "string"; - } - } - return false; - }, - "#": function(stream) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - }, - "/": function(stream) { - if (stream.eat("/")) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - } - return false; - }, - '"': function(_stream, state) { - (state.tokStack || (state.tokStack = [])).push('"', 0); - state.tokenize = phpString('"'); - return "string"; - }, - "{": function(_stream, state) { - if (state.tokStack && state.tokStack.length) - state.tokStack[state.tokStack.length - 1]++; - return false; - }, - "}": function(_stream, state) { - if (state.tokStack && state.tokStack.length > 0 && - !--state.tokStack[state.tokStack.length - 1]) { - state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]); - } - return false; - } - } - }; - - CodeMirror.defineMode("php", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, "text/html"); - var phpMode = CodeMirror.getMode(config, phpConfig); - - function dispatch(stream, state) { - var isPHP = state.curMode == phpMode; - if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null; - if (!isPHP) { - if (stream.match(/^<\?\w*/)) { - state.curMode = phpMode; - if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, "")) - state.curState = state.php; - return "meta"; - } - if (state.pending == '"' || state.pending == "'") { - while (!stream.eol() && stream.next() != state.pending) {} - var style = "string"; - } else if (state.pending && stream.pos < state.pending.end) { - stream.pos = state.pending.end; - var style = state.pending.style; - } else { - var style = htmlMode.token(stream, state.curState); - } - if (state.pending) state.pending = null; - var cur = stream.current(), openPHP = cur.search(/<\?/), m; - if (openPHP != -1) { - if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0]; - else state.pending = {end: stream.pos, style: style}; - stream.backUp(cur.length - openPHP); - } - return style; - } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { - state.curMode = htmlMode; - state.curState = state.html; - if (!state.php.context.prev) state.php = null; - return "meta"; - } else { - return phpMode.token(stream, state.curState); - } - } - - return { - startState: function() { - var html = CodeMirror.startState(htmlMode) - var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null - return {html: html, - php: php, - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? php : html, - pending: null}; - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur; - if (state.curMode == htmlMode) cur = htmlNew; - else cur = phpNew; - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - pending: state.pending}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - - innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } - }; - }, "htmlmixed", "clike"); - - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/php/test.js b/public/plugins/codemirror-5.17.0/mode/php/test.js deleted file mode 100644 index e2ecefc18..000000000 --- a/public/plugins/codemirror-5.17.0/mode/php/test.js +++ /dev/null @@ -1,154 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "php"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('simple_test', - '[meta ]'); - - MT('variable_interpolation_non_alphanumeric', - '[meta $/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]', - '[meta ?>]'); - - MT('variable_interpolation_digits', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_1', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_2', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_3', - '[meta [variable aaaaa][string .aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];', - '[meta ?>]'); - - MT('variable_interpolation_escaping', - '[meta aaa.aaa"];', - '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];', - '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];', - '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];', - '[meta ?>]'); - - MT('variable_interpolation_complex_syntax_1', - '[meta aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'); - - MT('variable_interpolation_complex_syntax_2', - '[meta } $aaaaaa.aaa"];', - '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];', - '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];'); - - - function build_recursive_monsters(nt, t, n){ - var monsters = [t]; - for (var i = 1; i <= n; ++i) - monsters[i] = nt.join(monsters[i - 1]); - return monsters; - } - - var m1 = build_recursive_monsters( - ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'], - '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]', - 10 - ); - - MT('variable_interpolation_complex_syntax_3_1', - '[meta ]'); - - var m2 = build_recursive_monsters( - ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'], - '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', - 5 - ); - - MT('variable_interpolation_complex_syntax_3_2', - '[meta ]'); - - function build_recursive_monsters_2(mf1, mf2, nt, t, n){ - var monsters = [t]; - for (var i = 1; i <= n; ++i) - monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3]; - return monsters; - } - - var m3 = build_recursive_monsters_2( - m1, - m2, - ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'], - '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', - 4 - ); - - MT('variable_interpolation_complex_syntax_3_3', - '[meta ]'); - - MT("variable_interpolation_heredoc", - "[meta -CodeMirror: Pig Latin mode - - - - - - - - - -
-

Pig Latin mode

-
- - - -

- Simple mode that handles Pig Latin language. -

- -

MIME type defined: text/x-pig - (PIG code) -

diff --git a/public/plugins/codemirror-5.17.0/mode/pig/pig.js b/public/plugins/codemirror-5.17.0/mode/pig/pig.js deleted file mode 100644 index 5b567272e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/pig/pig.js +++ /dev/null @@ -1,178 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - * Pig Latin Mode for CodeMirror 2 - * @author Prasanth Jayachandran - * @link https://github.com/prasanthj/pig-codemirror-2 - * This implementation is adapted from PL/SQL mode in CodeMirror 2. - */ -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pig", function(_config, parserConfig) { - var keywords = parserConfig.keywords, - builtins = parserConfig.builtins, - types = parserConfig.types, - multiLineStrings = parserConfig.multiLineStrings; - - var isOperatorChar = /[*+\-%<>=&?:\/!|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function tokenComment(stream, state) { - var isEnd = false; - var ch; - while(ch = stream.next()) { - if(ch == "/" && isEnd) { - state.tokenize = tokenBase; - break; - } - isEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; break; - } - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "error"; - }; - } - - - function tokenBase(stream, state) { - var ch = stream.next(); - - // is a start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special chars - else if(/[\[\]{}\(\),;\.]/.test(ch)) - return null; - // is it a number? - else if(/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment or operator - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return "operator"; - } - } - // single line comment or operator - else if (ch=="-") { - if(stream.eat("-")){ - stream.skipToEnd(); - return "comment"; - } - else { - stream.eatWhile(isOperatorChar); - return "operator"; - } - } - // is it an operator - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the while word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { - //keywords can be used as variables like flatten(group), group.$0 etc.. - if (!stream.eat(")") && !stream.eat(".")) - return "keyword"; - } - // is it one of the builtin functions? - if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) - return "variable-2"; - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toUpperCase())) - return "variable-3"; - // default is a 'variable' - return "variable"; - } - } - - // Interface - return { - startState: function() { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if(stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // builtin funcs taken from trunk revision 1303237 - var pBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL " - + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS " - + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG " - + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN " - + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER " - + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS " - + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA " - + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE " - + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG " - + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER "; - - // taken from QueryLexer.g - var pKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " - + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " - + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " - + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " - + "NEQ MATCHES TRUE FALSE DUMP"; - - // data types - var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP "; - - CodeMirror.defineMIME("text/x-pig", { - name: "pig", - builtins: keywords(pBuiltins), - keywords: keywords(pKeywords), - types: keywords(pTypes) - }); - - CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" ")); -}()); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/powershell/index.html b/public/plugins/codemirror-5.17.0/mode/powershell/index.html deleted file mode 100644 index 6b235df8f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/powershell/index.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - CodeMirror: Powershell mode - - - - - - - - -
-

PowerShell mode

- -
- - -

MIME types defined: application/x-powershell.

-
- - diff --git a/public/plugins/codemirror-5.17.0/mode/powershell/powershell.js b/public/plugins/codemirror-5.17.0/mode/powershell/powershell.js deleted file mode 100644 index c443e7232..000000000 --- a/public/plugins/codemirror-5.17.0/mode/powershell/powershell.js +++ /dev/null @@ -1,396 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - 'use strict'; - if (typeof exports == 'object' && typeof module == 'object') // CommonJS - mod(require('codemirror')); - else if (typeof define == 'function' && define.amd) // AMD - define(['codemirror'], mod); - else // Plain browser env - mod(window.CodeMirror); -})(function(CodeMirror) { -'use strict'; - -CodeMirror.defineMode('powershell', function() { - function buildRegexp(patterns, options) { - options = options || {}; - var prefix = options.prefix !== undefined ? options.prefix : '^'; - var suffix = options.suffix !== undefined ? options.suffix : '\\b'; - - for (var i = 0; i < patterns.length; i++) { - if (patterns[i] instanceof RegExp) { - patterns[i] = patterns[i].source; - } - else { - patterns[i] = patterns[i].replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - } - - return new RegExp(prefix + '(' + patterns.join('|') + ')' + suffix, 'i'); - } - - var notCharacterOrDash = '(?=[^A-Za-z\\d\\-_]|$)'; - var varNames = /[\w\-:]/ - var keywords = buildRegexp([ - /begin|break|catch|continue|data|default|do|dynamicparam/, - /else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/, - /param|process|return|switch|throw|trap|try|until|where|while/ - ], { suffix: notCharacterOrDash }); - - var punctuation = /[\[\]{},;`\.]|@[({]/; - var wordOperators = buildRegexp([ - 'f', - /b?not/, - /[ic]?split/, 'join', - /is(not)?/, 'as', - /[ic]?(eq|ne|[gl][te])/, - /[ic]?(not)?(like|match|contains)/, - /[ic]?replace/, - /b?(and|or|xor)/ - ], { prefix: '-' }); - var symbolOperators = /[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/; - var operators = buildRegexp([wordOperators, symbolOperators], { suffix: '' }); - - var numbers = /^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i; - - var identifiers = /^[A-Za-z\_][A-Za-z\-\_\d]*\b/; - - var symbolBuiltins = /[A-Z]:|%|\?/i; - var namedBuiltins = buildRegexp([ - /Add-(Computer|Content|History|Member|PSSnapin|Type)/, - /Checkpoint-Computer/, - /Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/, - /Compare-Object/, - /Complete-Transaction/, - /Connect-PSSession/, - /ConvertFrom-(Csv|Json|SecureString|StringData)/, - /Convert-Path/, - /ConvertTo-(Csv|Html|Json|SecureString|Xml)/, - /Copy-Item(Property)?/, - /Debug-Process/, - /Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/, - /Disconnect-PSSession/, - /Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/, - /(Enter|Exit)-PSSession/, - /Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/, - /ForEach-Object/, - /Format-(Custom|List|Table|Wide)/, - new RegExp('Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential' - + '|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job' - + '|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration' - + '|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)'), - /Group-Object/, - /Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/, - /ImportSystemModules/, - /Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/, - /Join-Path/, - /Limit-EventLog/, - /Measure-(Command|Object)/, - /Move-Item(Property)?/, - new RegExp('New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile' - + '|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)'), - /Out-(Default|File|GridView|Host|Null|Printer|String)/, - /Pause/, - /(Pop|Push)-Location/, - /Read-Host/, - /Receive-(Job|PSSession)/, - /Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/, - /Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/, - /Rename-(Computer|Item(Property)?)/, - /Reset-ComputerMachinePassword/, - /Resolve-Path/, - /Restart-(Computer|Service)/, - /Restore-Computer/, - /Resume-(Job|Service)/, - /Save-Help/, - /Select-(Object|String|Xml)/, - /Send-MailMessage/, - new RegExp('Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug' + - '|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)'), - /Show-(Command|ControlPanelItem|EventLog)/, - /Sort-Object/, - /Split-Path/, - /Start-(Job|Process|Service|Sleep|Transaction|Transcript)/, - /Stop-(Computer|Job|Process|Service|Transcript)/, - /Suspend-(Job|Service)/, - /TabExpansion2/, - /Tee-Object/, - /Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/, - /Trace-Command/, - /Unblock-File/, - /Undo-Transaction/, - /Unregister-(Event|PSSessionConfiguration)/, - /Update-(FormatData|Help|List|TypeData)/, - /Use-Transaction/, - /Wait-(Event|Job|Process)/, - /Where-Object/, - /Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/, - /cd|help|mkdir|more|oss|prompt/, - /ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/, - /echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/, - /group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/, - /measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/, - /rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/, - /sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/ - ], { prefix: '', suffix: '' }); - var variableBuiltins = buildRegexp([ - /[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/, - /FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/, - /MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/, - /PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/, - /PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/, - /WarningPreference|WhatIfPreference/, - - /Event|EventArgs|EventSubscriber|Sender/, - /Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/, - /true|false|null/ - ], { prefix: '\\$', suffix: '' }); - - var builtins = buildRegexp([symbolBuiltins, namedBuiltins, variableBuiltins], { suffix: notCharacterOrDash }); - - var grammar = { - keyword: keywords, - number: numbers, - operator: operators, - builtin: builtins, - punctuation: punctuation, - identifier: identifiers - }; - - // tokenizers - function tokenBase(stream, state) { - // Handle Comments - //var ch = stream.peek(); - - var parent = state.returnStack[state.returnStack.length - 1]; - if (parent && parent.shouldReturnFrom(state)) { - state.tokenize = parent.tokenize; - state.returnStack.pop(); - return state.tokenize(stream, state); - } - - if (stream.eatSpace()) { - return null; - } - - if (stream.eat('(')) { - state.bracketNesting += 1; - return 'punctuation'; - } - - if (stream.eat(')')) { - state.bracketNesting -= 1; - return 'punctuation'; - } - - for (var key in grammar) { - if (stream.match(grammar[key])) { - return key; - } - } - - var ch = stream.next(); - - // single-quote string - if (ch === "'") { - return tokenSingleQuoteString(stream, state); - } - - if (ch === '$') { - return tokenVariable(stream, state); - } - - // double-quote string - if (ch === '"') { - return tokenDoubleQuoteString(stream, state); - } - - if (ch === '<' && stream.eat('#')) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - if (ch === '@') { - var quoteMatch = stream.eat(/["']/); - if (quoteMatch && stream.eol()) { - state.tokenize = tokenMultiString; - state.startQuote = quoteMatch[0]; - return tokenMultiString(stream, state); - } else if (stream.peek().match(/[({]/)) { - return 'punctuation'; - } else if (stream.peek().match(varNames)) { - // splatted variable - return tokenVariable(stream, state); - } - } - return 'error'; - } - - function tokenSingleQuoteString(stream, state) { - var ch; - while ((ch = stream.peek()) != null) { - stream.next(); - - if (ch === "'" && !stream.eat("'")) { - state.tokenize = tokenBase; - return 'string'; - } - } - - return 'error'; - } - - function tokenDoubleQuoteString(stream, state) { - var ch; - while ((ch = stream.peek()) != null) { - if (ch === '$') { - state.tokenize = tokenStringInterpolation; - return 'string'; - } - - stream.next(); - if (ch === '`') { - stream.next(); - continue; - } - - if (ch === '"' && !stream.eat('"')) { - state.tokenize = tokenBase; - return 'string'; - } - } - - return 'error'; - } - - function tokenStringInterpolation(stream, state) { - return tokenInterpolation(stream, state, tokenDoubleQuoteString); - } - - function tokenMultiStringReturn(stream, state) { - state.tokenize = tokenMultiString; - state.startQuote = '"' - return tokenMultiString(stream, state); - } - - function tokenHereStringInterpolation(stream, state) { - return tokenInterpolation(stream, state, tokenMultiStringReturn); - } - - function tokenInterpolation(stream, state, parentTokenize) { - if (stream.match('$(')) { - var savedBracketNesting = state.bracketNesting; - state.returnStack.push({ - /*jshint loopfunc:true */ - shouldReturnFrom: function(state) { - return state.bracketNesting === savedBracketNesting; - }, - tokenize: parentTokenize - }); - state.tokenize = tokenBase; - state.bracketNesting += 1; - return 'punctuation'; - } else { - stream.next(); - state.returnStack.push({ - shouldReturnFrom: function() { return true; }, - tokenize: parentTokenize - }); - state.tokenize = tokenVariable; - return state.tokenize(stream, state); - } - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == '>') { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch === '#'); - } - return 'comment'; - } - - function tokenVariable(stream, state) { - var ch = stream.peek(); - if (stream.eat('{')) { - state.tokenize = tokenVariableWithBraces; - return tokenVariableWithBraces(stream, state); - } else if (ch != undefined && ch.match(varNames)) { - stream.eatWhile(varNames); - state.tokenize = tokenBase; - return 'variable-2'; - } else { - state.tokenize = tokenBase; - return 'error'; - } - } - - function tokenVariableWithBraces(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch === '}') { - state.tokenize = tokenBase; - break; - } - } - return 'variable-2'; - } - - function tokenMultiString(stream, state) { - var quote = state.startQuote; - if (stream.sol() && stream.match(new RegExp(quote + '@'))) { - state.tokenize = tokenBase; - } - else if (quote === '"') { - while (!stream.eol()) { - var ch = stream.peek(); - if (ch === '$') { - state.tokenize = tokenHereStringInterpolation; - return 'string'; - } - - stream.next(); - if (ch === '`') { - stream.next(); - } - } - } - else { - stream.skipToEnd(); - } - - return 'string'; - } - - var external = { - startState: function() { - return { - returnStack: [], - bracketNesting: 0, - tokenize: tokenBase - }; - }, - - token: function(stream, state) { - return state.tokenize(stream, state); - }, - - blockCommentStart: '<#', - blockCommentEnd: '#>', - lineComment: '#', - fold: 'brace' - }; - return external; -}); - -CodeMirror.defineMIME('application/x-powershell', 'powershell'); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/powershell/test.js b/public/plugins/codemirror-5.17.0/mode/powershell/test.js deleted file mode 100644 index 59b8e6fca..000000000 --- a/public/plugins/codemirror-5.17.0/mode/powershell/test.js +++ /dev/null @@ -1,72 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "powershell"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('comment', '[number 1][comment # A]'); - MT('comment_multiline', '[number 1][comment <#]', - '[comment ABC]', - '[comment #>][number 2]'); - - [ - '0', '1234', - '12kb', '12mb', '12Gb', '12Tb', '12PB', '12L', '12D', '12lkb', '12dtb', - '1.234', '1.234e56', '1.', '1.e2', '.2', '.2e34', - '1.2MB', '1.kb', '.1dTB', '1.e1gb', '.2', '.2e34', - '0x1', '0xabcdef', '0x3tb', '0xelmb' - ].forEach(function(number) { - MT("number_" + number, "[number " + number + "]"); - }); - - MT('string_literal_escaping', "[string 'a''']"); - MT('string_literal_variable', "[string 'a $x']"); - MT('string_escaping_1', '[string "a `""]'); - MT('string_escaping_2', '[string "a """]'); - MT('string_variable_escaping', '[string "a `$x"]'); - MT('string_variable', '[string "a ][variable-2 $x][string b"]'); - MT('string_variable_spaces', '[string "a ][variable-2 ${x y}][string b"]'); - MT('string_expression', '[string "a ][punctuation $(][variable-2 $x][operator +][number 3][punctuation )][string b"]'); - MT('string_expression_nested', '[string "A][punctuation $(][string "a][punctuation $(][string "w"][punctuation )][string b"][punctuation )][string B"]'); - - MT('string_heredoc', '[string @"]', - '[string abc]', - '[string "@]'); - MT('string_heredoc_quotes', '[string @"]', - '[string abc "\']', - '[string "@]'); - MT('string_heredoc_variable', '[string @"]', - '[string a ][variable-2 $x][string b]', - '[string "@]'); - MT('string_heredoc_nested_string', '[string @"]', - '[string a][punctuation $(][string "w"][punctuation )][string b]', - '[string "@]'); - MT('string_heredoc_literal_quotes', "[string @']", - '[string abc "\']', - "[string '@]"); - - MT('array', "[punctuation @(][string 'a'][punctuation ,][string 'b'][punctuation )]"); - MT('hash', "[punctuation @{][string 'key'][operator :][string 'value'][punctuation }]"); - - MT('variable', "[variable-2 $test]"); - MT('variable_global', "[variable-2 $global:test]"); - MT('variable_spaces', "[variable-2 ${test test}]"); - MT('operator_splat', "[variable-2 @x]"); - MT('variable_builtin', "[builtin $ErrorActionPreference]"); - MT('variable_builtin_symbols', "[builtin $$]"); - - MT('operator', "[operator +]"); - MT('operator_unary', "[operator +][number 3]"); - MT('operator_long', "[operator -match]"); - - [ - '(', ')', '[[', ']]', '{', '}', ',', '`', ';', '.' - ].forEach(function(punctuation) { - MT("punctuation_" + punctuation.replace(/^[\[\]]/,''), "[punctuation " + punctuation + "]"); - }); - - MT('keyword', "[keyword if]"); - - MT('call_builtin', "[builtin Get-ChildItem]"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/properties/index.html b/public/plugins/codemirror-5.17.0/mode/properties/index.html deleted file mode 100644 index f885302de..000000000 --- a/public/plugins/codemirror-5.17.0/mode/properties/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - -CodeMirror: Properties files mode - - - - - - - - - -
-

Properties files mode

-
- - -

MIME types defined: text/x-properties, - text/x-ini.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/properties/properties.js b/public/plugins/codemirror-5.17.0/mode/properties/properties.js deleted file mode 100644 index ef8bf37ee..000000000 --- a/public/plugins/codemirror-5.17.0/mode/properties/properties.js +++ /dev/null @@ -1,78 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("properties", function() { - return { - token: function(stream, state) { - var sol = stream.sol() || state.afterSection; - var eol = stream.eol(); - - state.afterSection = false; - - if (sol) { - if (state.nextMultiline) { - state.inMultiline = true; - state.nextMultiline = false; - } else { - state.position = "def"; - } - } - - if (eol && ! state.nextMultiline) { - state.inMultiline = false; - state.position = "def"; - } - - if (sol) { - while(stream.eatSpace()) {} - } - - var ch = stream.next(); - - if (sol && (ch === "#" || ch === "!" || ch === ";")) { - state.position = "comment"; - stream.skipToEnd(); - return "comment"; - } else if (sol && ch === "[") { - state.afterSection = true; - stream.skipTo("]"); stream.eat("]"); - return "header"; - } else if (ch === "=" || ch === ":") { - state.position = "quote"; - return null; - } else if (ch === "\\" && state.position === "quote") { - if (stream.eol()) { // end of line? - // Multiline value - state.nextMultiline = true; - } - } - - return state.position; - }, - - startState: function() { - return { - position : "def", // Current position, "def", "quote" or "comment" - nextMultiline : false, // Is the next line multiline value - inMultiline : false, // Is the current line a multiline value - afterSection : false // Did we just open a section - }; - } - - }; -}); - -CodeMirror.defineMIME("text/x-properties", "properties"); -CodeMirror.defineMIME("text/x-ini", "properties"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/protobuf/index.html b/public/plugins/codemirror-5.17.0/mode/protobuf/index.html deleted file mode 100644 index cfe7b9dcd..000000000 --- a/public/plugins/codemirror-5.17.0/mode/protobuf/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: ProtoBuf mode - - - - - - - - - -
-

ProtoBuf mode

-
- - -

MIME types defined: text/x-protobuf.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/protobuf/protobuf.js b/public/plugins/codemirror-5.17.0/mode/protobuf/protobuf.js deleted file mode 100644 index bcae276e8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/protobuf/protobuf.js +++ /dev/null @@ -1,68 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - }; - - var keywordArray = [ - "package", "message", "import", "syntax", - "required", "optional", "repeated", "reserved", "default", "extensions", "packed", - "bool", "bytes", "double", "enum", "float", "string", - "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64" - ]; - var keywords = wordRegexp(keywordArray); - - CodeMirror.registerHelper("hintWords", "protobuf", keywordArray); - - var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); - - function tokenBase(stream) { - // whitespaces - if (stream.eatSpace()) return null; - - // Handle one line Comments - if (stream.match("//")) { - stream.skipToEnd(); - return "comment"; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.+-]/, false)) { - if (stream.match(/^[+-]?0x[0-9a-fA-F]+/)) - return "number"; - if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)) - return "number"; - if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/)) - return "number"; - } - - // Handle Strings - if (stream.match(/^"([^"]|(""))*"/)) { return "string"; } - if (stream.match(/^'([^']|(''))*'/)) { return "string"; } - - // Handle words - if (stream.match(keywords)) { return "keyword"; } - if (stream.match(identifiers)) { return "variable"; } ; - - // Handle non-detected items - stream.next(); - return null; - }; - - CodeMirror.defineMode("protobuf", function() { - return {token: tokenBase}; - }); - - CodeMirror.defineMIME("text/x-protobuf", "protobuf"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/puppet/index.html b/public/plugins/codemirror-5.17.0/mode/puppet/index.html deleted file mode 100644 index 5614c3695..000000000 --- a/public/plugins/codemirror-5.17.0/mode/puppet/index.html +++ /dev/null @@ -1,121 +0,0 @@ - - -CodeMirror: Puppet mode - - - - - - - - - - -
-

Puppet mode

-
- - -

MIME types defined: text/x-puppet.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/puppet/puppet.js b/public/plugins/codemirror-5.17.0/mode/puppet/puppet.js deleted file mode 100644 index 57041300a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/puppet/puppet.js +++ /dev/null @@ -1,220 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("puppet", function () { - // Stores the words from the define method - var words = {}; - // Taken, mostly, from the Puppet official variable standards regex - var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/; - - // Takes a string of words separated by spaces and adds them as - // keys with the value of the first argument 'style' - function define(style, string) { - var split = string.split(' '); - for (var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - } - - // Takes commonly known puppet types/words and classifies them to a style - define('keyword', 'class define site node include import inherits'); - define('keyword', 'case if else in and elsif default or'); - define('atom', 'false true running present absent file directory undef'); - define('builtin', 'action augeas burst chain computer cron destination dport exec ' + - 'file filebucket group host icmp iniface interface jump k5login limit log_level ' + - 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' + - 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' + - 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' + - 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' + - 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' + - 'resources router schedule scheduled_task selboolean selmodule service source ' + - 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' + - 'user vlan yumrepo zfs zone zpool'); - - // After finding a start of a string ('|") this function attempts to find the end; - // If a variable is encountered along the way, we display it differently when it - // is encapsulated in a double-quoted string. - function tokenString(stream, state) { - var current, prev, found_var = false; - while (!stream.eol() && (current = stream.next()) != state.pending) { - if (current === '$' && prev != '\\' && state.pending == '"') { - found_var = true; - break; - } - prev = current; - } - if (found_var) { - stream.backUp(1); - } - if (current == state.pending) { - state.continueString = false; - } else { - state.continueString = true; - } - return "string"; - } - - // Main function - function tokenize(stream, state) { - // Matches one whole word - var word = stream.match(/[\w]+/, false); - // Matches attributes (i.e. ensure => present ; 'ensure' would be matched) - var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false); - // Matches non-builtin resource declarations - // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched) - var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false); - // Matches virtual and exported resources (i.e. @@user { ; and the like) - var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false); - - // Finally advance the stream - var ch = stream.next(); - - // Have we found a variable? - if (ch === '$') { - if (stream.match(variable_regex)) { - // If so, and its in a string, assign it a different color - return state.continueString ? 'variable-2' : 'variable'; - } - // Otherwise return an invalid variable - return "error"; - } - // Should we still be looking for the end of a string? - if (state.continueString) { - // If so, go through the loop again - stream.backUp(1); - return tokenString(stream, state); - } - // Are we in a definition (class, node, define)? - if (state.inDefinition) { - // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched) - if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) { - return 'def'; - } - // Match the rest it the next time around - stream.match(/\s+{/); - state.inDefinition = false; - } - // Are we in an 'include' statement? - if (state.inInclude) { - // Match and return the included class - stream.match(/(\s+)?\S+(\s+)?/); - state.inInclude = false; - return 'def'; - } - // Do we just have a function on our hands? - // In 'ensure_resource("myclass")', 'ensure_resource' is matched - if (stream.match(/(\s+)?\w+\(/)) { - stream.backUp(1); - return 'def'; - } - // Have we matched the prior attribute regex? - if (attribute) { - stream.match(/(\s+)?\w+/); - return 'tag'; - } - // Do we have Puppet specific words? - if (word && words.hasOwnProperty(word)) { - // Negates the initial next() - stream.backUp(1); - // rs move the stream - stream.match(/[\w]+/); - // We want to process these words differently - // do to the importance they have in Puppet - if (stream.match(/\s+\S+\s+{/, false)) { - state.inDefinition = true; - } - if (word == 'include') { - state.inInclude = true; - } - // Returns their value as state in the prior define methods - return words[word]; - } - // Is there a match on a reference? - if (/(^|\s+)[A-Z][\w:_]+/.test(word)) { - // Negate the next() - stream.backUp(1); - // Match the full reference - stream.match(/(^|\s+)[A-Z][\w:_]+/); - return 'def'; - } - // Have we matched the prior resource regex? - if (resource) { - stream.match(/(\s+)?[\w:_]+/); - return 'def'; - } - // Have we matched the prior special_resource regex? - if (special_resource) { - stream.match(/(\s+)?[@]{1,2}/); - return 'special'; - } - // Match all the comments. All of them. - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - // Have we found a string? - if (ch == "'" || ch == '"') { - // Store the type (single or double) - state.pending = ch; - // Perform the looping function to find the end - return tokenString(stream, state); - } - // Match all the brackets - if (ch == '{' || ch == '}') { - return 'bracket'; - } - // Match characters that we are going to assume - // are trying to be regex - if (ch == '/') { - stream.match(/.*?\//); - return 'variable-3'; - } - // Match all the numbers - if (ch.match(/[0-9]/)) { - stream.eatWhile(/[0-9]+/); - return 'number'; - } - // Match the '=' and '=>' operators - if (ch == '=') { - if (stream.peek() == '>') { - stream.next(); - } - return "operator"; - } - // Keep advancing through all the rest - stream.eatWhile(/[\w-]/); - // Return a blank line for everything else - return null; - } - // Start it all - return { - startState: function () { - var state = {}; - state.inDefinition = false; - state.inInclude = false; - state.continueString = false; - state.pending = false; - return state; - }, - token: function (stream, state) { - // Strip the spaces, but regex will account for them eitherway - if (stream.eatSpace()) return null; - // Go through the main process - return tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/x-puppet", "puppet"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/python/index.html b/public/plugins/codemirror-5.17.0/mode/python/index.html deleted file mode 100644 index 6116a13b6..000000000 --- a/public/plugins/codemirror-5.17.0/mode/python/index.html +++ /dev/null @@ -1,198 +0,0 @@ - - -CodeMirror: Python mode - - - - - - - - - - -
-

Python mode

- -
- - -

Cython mode

- -
- - -

Configuration Options for Python mode:

-
    -
  • version - 2/3 - The version of Python to recognize. Default is 2.
  • -
  • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
  • -
  • hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
  • -
-

Advanced Configuration Options:

-

Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help

-
    -
  • singleOperators - RegEx - Regular Expression for single operator matching, default :
    ^[\\+\\-\\*/%&|\\^~<>!]
    including
    @
    on Python 3
  • -
  • singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :
    ^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]
  • -
  • doubleOperators - RegEx - Regular Expression for double operators matching, default :
    ^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))
  • -
  • doubleDelimiters - RegEx - Regular Expression for double delimiters matching, default :
    ^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))
  • -
  • tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default :
    ^((//=)|(>>=)|(<<=)|(\\*\\*=))
  • -
  • identifiers - RegEx - Regular Expression for identifier, default :
    ^[_A-Za-z][_A-Za-z0-9]*
    on Python 2 and
    ^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*
    on Python 3.
  • -
  • extra_keywords - list of string - List of extra words ton consider as keywords
  • -
  • extra_builtins - list of string - List of extra words ton consider as builtins
  • -
- - -

MIME types defined: text/x-python and text/x-cython.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/python/python.js b/public/plugins/codemirror-5.17.0/mode/python/python.js deleted file mode 100644 index be65ad768..000000000 --- a/public/plugins/codemirror-5.17.0/mode/python/python.js +++ /dev/null @@ -1,340 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var wordOperators = wordRegexp(["and", "or", "not", "is"]); - var commonKeywords = ["as", "assert", "break", "class", "continue", - "def", "del", "elif", "else", "except", "finally", - "for", "from", "global", "if", "import", - "lambda", "pass", "raise", "return", - "try", "while", "with", "yield", "in"]; - var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr", - "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod", - "enumerate", "eval", "filter", "float", "format", "frozenset", - "getattr", "globals", "hasattr", "hash", "help", "hex", "id", - "input", "int", "isinstance", "issubclass", "iter", "len", - "list", "locals", "map", "max", "memoryview", "min", "next", - "object", "oct", "open", "ord", "pow", "property", "range", - "repr", "reversed", "round", "set", "setattr", "slice", - "sorted", "staticmethod", "str", "sum", "super", "tuple", - "type", "vars", "zip", "__import__", "NotImplemented", - "Ellipsis", "__debug__"]; - CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins)); - - function top(state) { - return state.scopes[state.scopes.length - 1]; - } - - CodeMirror.defineMode("python", function(conf, parserConf) { - var ERRORCLASS = "error"; - - var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/; - var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/; - var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/; - var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/; - - var hangingIndent = parserConf.hangingIndent || conf.indentUnit; - - var myKeywords = commonKeywords, myBuiltins = commonBuiltins; - if (parserConf.extra_keywords != undefined) - myKeywords = myKeywords.concat(parserConf.extra_keywords); - - if (parserConf.extra_builtins != undefined) - myBuiltins = myBuiltins.concat(parserConf.extra_builtins); - - var py3 = parserConf.version && parseInt(parserConf.version, 10) == 3 - if (py3) { - // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator - var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/; - var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/; - myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]); - myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]); - var stringPrefixes = new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))", "i"); - } else { - var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/; - var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/; - myKeywords = myKeywords.concat(["exec", "print"]); - myBuiltins = myBuiltins.concat(["apply", "basestring", "buffer", "cmp", "coerce", "execfile", - "file", "intern", "long", "raw_input", "reduce", "reload", - "unichr", "unicode", "xrange", "False", "True", "None"]); - var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); - } - var keywords = wordRegexp(myKeywords); - var builtins = wordRegexp(myBuiltins); - - // tokenizers - function tokenBase(stream, state) { - if (stream.sol()) state.indent = stream.indentation() - // Handle scope changes - if (stream.sol() && top(state).type == "py") { - var scopeOffset = top(state).offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) - pushPyScope(state); - else if (lineOffset < scopeOffset && dedent(stream, state)) - state.errorToken = true; - return null; - } else { - var style = tokenBaseInner(stream, state); - if (scopeOffset > 0 && dedent(stream, state)) - style += " " + ERRORCLASS; - return style; - } - } - return tokenBaseInner(stream, state); - } - - function tokenBaseInner(stream, state) { - if (stream.eatSpace()) return null; - - var ch = stream.peek(); - - // Handle Comments - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return "number"; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true; - // Binary - if (stream.match(/^0b[01]+/i)) intLiteral = true; - // Octal - if (stream.match(/^0o[0-7]+/i)) intLiteral = true; - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) intLiteral = true; - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return "number"; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) - return "punctuation"; - - if (stream.match(doubleOperators) || stream.match(singleOperators)) - return "operator"; - - if (stream.match(singleDelimiters)) - return "punctuation"; - - if (state.lastToken == "." && stream.match(identifiers)) - return "property"; - - if (stream.match(keywords) || stream.match(wordOperators)) - return "keyword"; - - if (stream.match(builtins)) - return "builtin"; - - if (stream.match(/^(self|cls)\b/)) - return "variable-2"; - - if (stream.match(identifiers)) { - if (state.lastToken == "def" || state.lastToken == "class") - return "def"; - return "variable"; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) - delimiter = delimiter.substr(1); - - var singleline = delimiter.length == 1; - var OUTCLASS = "string"; - - function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat("\\")) { - stream.next(); - if (singleline && stream.eol()) - return OUTCLASS; - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) - return ERRORCLASS; - else - state.tokenize = tokenBase; - } - return OUTCLASS; - } - tokenString.isString = true; - return tokenString; - } - - function pushPyScope(state) { - while (top(state).type != "py") state.scopes.pop() - state.scopes.push({offset: top(state).offset + conf.indentUnit, - type: "py", - align: null}) - } - - function pushBracketScope(stream, state, type) { - var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1 - state.scopes.push({offset: state.indent + hangingIndent, - type: type, - align: align}) - } - - function dedent(stream, state) { - var indented = stream.indentation(); - while (state.scopes.length > 1 && top(state).offset > indented) { - if (top(state).type != "py") return true; - state.scopes.pop(); - } - return top(state).offset != indented; - } - - function tokenLexer(stream, state) { - if (stream.sol()) state.beginningOfLine = true; - - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle decorators - if (state.beginningOfLine && current == "@") - return stream.match(identifiers, false) ? "meta" : py3 ? "operator" : ERRORCLASS; - - if (/\S/.test(current)) state.beginningOfLine = false; - - if ((style == "variable" || style == "builtin") - && state.lastToken == "meta") - style = "meta"; - - // Handle scope changes. - if (current == "pass" || current == "return") - state.dedent += 1; - - if (current == "lambda") state.lambda = true; - if (current == ":" && !state.lambda && top(state).type == "py") - pushPyScope(state); - - var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; - if (delimiter_index != -1) - pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); - - delimiter_index = "])}".indexOf(current); - if (delimiter_index != -1) { - if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent - else return ERRORCLASS; - } - if (state.dedent > 0 && stream.eol() && top(state).type == "py") { - if (state.scopes.length > 1) state.scopes.pop(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset: basecolumn || 0, type: "py", align: null}], - indent: basecolumn || 0, - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var addErr = state.errorToken; - if (addErr) state.errorToken = false; - var style = tokenLexer(stream, state); - - if (style && style != "comment") - state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style; - if (style == "punctuation") style = null; - - if (stream.eol() && state.lambda) - state.lambda = false; - return addErr ? style + " " + ERRORCLASS : style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) - return state.tokenize.isString ? CodeMirror.Pass : 0; - - var scope = top(state), closing = scope.type == textAfter.charAt(0) - if (scope.align != null) - return scope.align - (closing ? 1 : 0) - else - return scope.offset - (closing ? hangingIndent : 0) - }, - - electricInput: /^\s*[\}\]\)]$/, - closeBrackets: {triples: "'\""}, - lineComment: "#", - fold: "indent" - }; - return external; - }); - - CodeMirror.defineMIME("text/x-python", "python"); - - var words = function(str) { return str.split(" "); }; - - CodeMirror.defineMIME("text/x-cython", { - name: "python", - extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+ - "extern gil include nogil property public"+ - "readonly struct union DEF IF ELIF ELSE") - }); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/python/test.js b/public/plugins/codemirror-5.17.0/mode/python/test.js deleted file mode 100644 index c1a9c6a99..000000000 --- a/public/plugins/codemirror-5.17.0/mode/python/test.js +++ /dev/null @@ -1,30 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 4}, - {name: "python", - version: 3, - singleLineStringErrors: false}); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Error, because "foobarhello" is neither a known type or property, but - // property was expected (after "and"), and it should be in parentheses. - MT("decoratorStartOfLine", - "[meta @dec]", - "[keyword def] [def function]():", - " [keyword pass]"); - - MT("decoratorIndented", - "[keyword class] [def Foo]:", - " [meta @dec]", - " [keyword def] [def function]():", - " [keyword pass]"); - - MT("matmulWithSpace:", "[variable a] [operator @] [variable b]"); - MT("matmulWithoutSpace:", "[variable a][operator @][variable b]"); - MT("matmulSpaceBefore:", "[variable a] [operator @][variable b]"); - - MT("fValidStringPrefix", "[string f'this is a {formatted} string']"); - MT("uValidStringPrefix", "[string u'this is an unicode string']"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/q/index.html b/public/plugins/codemirror-5.17.0/mode/q/index.html deleted file mode 100644 index 72785ba3b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/q/index.html +++ /dev/null @@ -1,144 +0,0 @@ - - -CodeMirror: Q mode - - - - - - - - - - -
-

Q mode

- - -
- - - -

MIME type defined: text/x-q.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/q/q.js b/public/plugins/codemirror-5.17.0/mode/q/q.js deleted file mode 100644 index a4af9383e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/q/q.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("q",function(config){ - var indentUnit=config.indentUnit, - curPunc, - keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]), - E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/; - function buildRE(w){return new RegExp("^("+w.join("|")+")$");} - function tokenBase(stream,state){ - var sol=stream.sol(),c=stream.next(); - curPunc=null; - if(sol) - if(c=="/") - return(state.tokenize=tokenLineComment)(stream,state); - else if(c=="\\"){ - if(stream.eol()||/\s/.test(stream.peek())) - return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment"; - else - return state.tokenize=tokenBase,"builtin"; - } - if(/\s/.test(c)) - return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace"; - if(c=='"') - return(state.tokenize=tokenString)(stream,state); - if(c=='`') - return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol"; - if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){ - var t=null; - stream.backUp(1); - if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/) - || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/) - || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/) - || stream.match(/^\d+[ptuv]{1}/)) - t="temporal"; - else if(stream.match(/^0[NwW]{1}/) - || stream.match(/^0x[\d|a-f|A-F]*/) - || stream.match(/^[0|1]+[b]{1}/) - || stream.match(/^\d+[chijn]{1}/) - || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/)) - t="number"; - return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error"); - } - if(/[A-Z|a-z]|\./.test(c)) - return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable"; - if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c)) - return null; - if(/[{}\(\[\]\)]/.test(c)) - return null; - return"error"; - } - function tokenLineComment(stream,state){ - return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment"; - } - function tokenBlockComment(stream,state){ - var f=stream.sol()&&stream.peek()=="\\"; - stream.skipToEnd(); - if(f&&/^\\\s*$/.test(stream.current())) - state.tokenize=tokenBase; - return"comment"; - } - function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";} - function tokenString(stream,state){ - var escaped=false,next,end=false; - while((next=stream.next())){ - if(next=="\""&&!escaped){end=true;break;} - escaped=!escaped&&next=="\\"; - } - if(end)state.tokenize=tokenBase; - return"string"; - } - function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};} - function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;} - return{ - startState:function(){ - return{tokenize:tokenBase, - context:null, - indent:0, - col:0}; - }, - token:function(stream,state){ - if(stream.sol()){ - if(state.context&&state.context.align==null) - state.context.align=false; - state.indent=stream.indentation(); - } - //if (stream.eatSpace()) return null; - var style=state.tokenize(stream,state); - if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){ - state.context.align=true; - } - if(curPunc=="(")pushContext(state,")",stream.column()); - else if(curPunc=="[")pushContext(state,"]",stream.column()); - else if(curPunc=="{")pushContext(state,"}",stream.column()); - else if(/[\]\}\)]/.test(curPunc)){ - while(state.context&&state.context.type=="pattern")popContext(state); - if(state.context&&curPunc==state.context.type)popContext(state); - } - else if(curPunc=="."&&state.context&&state.context.type=="pattern")popContext(state); - else if(/atom|string|variable/.test(style)&&state.context){ - if(/[\}\]]/.test(state.context.type)) - pushContext(state,"pattern",stream.column()); - else if(state.context.type=="pattern"&&!state.context.align){ - state.context.align=true; - state.context.col=stream.column(); - } - } - return style; - }, - indent:function(state,textAfter){ - var firstChar=textAfter&&textAfter.charAt(0); - var context=state.context; - if(/[\]\}]/.test(firstChar)) - while (context&&context.type=="pattern")context=context.prev; - var closing=context&&firstChar==context.type; - if(!context) - return 0; - else if(context.type=="pattern") - return context.col; - else if(context.align) - return context.col+(closing?0:1); - else - return context.indent+(closing?0:indentUnit); - } - }; -}); -CodeMirror.defineMIME("text/x-q","q"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/r/index.html b/public/plugins/codemirror-5.17.0/mode/r/index.html deleted file mode 100644 index 6dd963465..000000000 --- a/public/plugins/codemirror-5.17.0/mode/r/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: R mode - - - - - - - - - -
-

R mode

-
- - -

MIME types defined: text/x-rsrc.

- -

Development of the CodeMirror R mode was kindly sponsored - by Ubalo.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/r/r.js b/public/plugins/codemirror-5.17.0/mode/r/r.js deleted file mode 100644 index d41d1c54c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/r/r.js +++ /dev/null @@ -1,164 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("wordChars", "r", /[\w.]/); - -CodeMirror.defineMode("r", function(config) { - function wordObj(str) { - var words = str.split(" "), res = {}; - for (var i = 0; i < words.length; ++i) res[words[i]] = true; - return res; - } - var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); - var builtins = wordObj("list quote bquote eval return call parse deparse"); - var keywords = wordObj("if else repeat while function for in next break"); - var blockkeywords = wordObj("if else repeat while function for"); - var opChars = /[+\-*\/^<>=!&|~$:]/; - var curPunc; - - function tokenBase(stream, state) { - curPunc = null; - var ch = stream.next(); - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "0" && stream.eat("x")) { - stream.eatWhile(/[\da-f]/i); - return "number"; - } else if (ch == "." && stream.eat(/\d/)) { - stream.match(/\d*(?:e[+\-]?\d+)?/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); - return "number"; - } else if (ch == "'" || ch == '"') { - state.tokenize = tokenString(ch); - return "string"; - } else if (ch == "." && stream.match(/.[.\d]+/)) { - return "keyword"; - } else if (/[\w\.]/.test(ch) && ch != "_") { - stream.eatWhile(/[\w\.]/); - var word = stream.current(); - if (atoms.propertyIsEnumerable(word)) return "atom"; - if (keywords.propertyIsEnumerable(word)) { - // Block keywords start new blocks, except 'else if', which only starts - // one new block for the 'if', no block for the 'else'. - if (blockkeywords.propertyIsEnumerable(word) && - !stream.match(/\s*if(\s+|$)/, false)) - curPunc = "block"; - return "keyword"; - } - if (builtins.propertyIsEnumerable(word)) return "builtin"; - return "variable"; - } else if (ch == "%") { - if (stream.skipTo("%")) stream.next(); - return "variable-2"; - } else if (ch == "<" && stream.eat("-")) { - return "arrow"; - } else if (ch == "=" && state.ctx.argList) { - return "arg-is"; - } else if (opChars.test(ch)) { - if (ch == "$") return "dollar"; - stream.eatWhile(opChars); - return "operator"; - } else if (/[\(\){}\[\];]/.test(ch)) { - curPunc = ch; - if (ch == ";") return "semi"; - return null; - } else { - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - if (stream.eat("\\")) { - var ch = stream.next(); - if (ch == "x") stream.match(/^[a-f0-9]{2}/i); - else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); - else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); - else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); - else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); - return "string-2"; - } else { - var next; - while ((next = stream.next()) != null) { - if (next == quote) { state.tokenize = tokenBase; break; } - if (next == "\\") { stream.backUp(1); break; } - } - return "string"; - } - }; - } - - function push(state, type, stream) { - state.ctx = {type: type, - indent: state.indent, - align: null, - column: stream.column(), - prev: state.ctx}; - } - function pop(state) { - state.indent = state.ctx.indent; - state.ctx = state.ctx.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - ctx: {type: "top", - indent: -config.indentUnit, - align: false}, - indent: 0, - afterIdent: false}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.ctx.align == null) state.ctx.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style != "comment" && state.ctx.align == null) state.ctx.align = true; - - var ctype = state.ctx.type; - if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); - if (curPunc == "{") push(state, "}", stream); - else if (curPunc == "(") { - push(state, ")", stream); - if (state.afterIdent) state.ctx.argList = true; - } - else if (curPunc == "[") push(state, "]", stream); - else if (curPunc == "block") push(state, "block", stream); - else if (curPunc == ctype) pop(state); - state.afterIdent = style == "variable" || style == "keyword"; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, - closing = firstChar == ctx.type; - if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indent + (closing ? 0 : config.indentUnit); - }, - - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-rsrc", "r"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/rpm/changes/index.html b/public/plugins/codemirror-5.17.0/mode/rpm/changes/index.html deleted file mode 100644 index 6e5031bd1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rpm/changes/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
-

RPM changes mode

- -
- - -

MIME types defined: text/x-rpm-changes.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/rpm/index.html b/public/plugins/codemirror-5.17.0/mode/rpm/index.html deleted file mode 100644 index 9a34e6dfb..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rpm/index.html +++ /dev/null @@ -1,149 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
-

RPM changes mode

- -
- - -

RPM spec mode

- -
- - -

MIME types defined: text/x-rpm-spec, text/x-rpm-changes.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/rpm/rpm.js b/public/plugins/codemirror-5.17.0/mode/rpm/rpm.js deleted file mode 100644 index 87cde591a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rpm/rpm.js +++ /dev/null @@ -1,109 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("rpm-changes", function() { - var headerSeperator = /^-+$/; - var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; - var simpleEmail = /^[\w+.-]+@[\w.-]+/; - - return { - token: function(stream) { - if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } - if (stream.match(headerLine)) { return 'tag'; } - } - if (stream.match(simpleEmail)) { return 'string'; } - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); - -// Quick and dirty spec file highlighting - -CodeMirror.defineMode("rpm-spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - - var preamble = /^[a-zA-Z0-9()]+:/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/; - var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros - var control_flow_simple = /^%(else|endif)/; // rpm control flow macros - var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros - - return { - startState: function () { - return { - controlFlow: false, - macroParameters: false, - section: false - }; - }, - token: function (stream, state) { - var ch = stream.peek(); - if (ch == "#") { stream.skipToEnd(); return "comment"; } - - if (stream.sol()) { - if (stream.match(preamble)) { return "header"; } - if (stream.match(section)) { return "atom"; } - } - - if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' - if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' - - if (stream.match(control_flow_simple)) { return "keyword"; } - if (stream.match(control_flow_complex)) { - state.controlFlow = true; - return "keyword"; - } - if (state.controlFlow) { - if (stream.match(operators)) { return "operator"; } - if (stream.match(/^(\d+)/)) { return "number"; } - if (stream.eol()) { state.controlFlow = false; } - } - - if (stream.match(arch)) { - if (stream.eol()) { state.controlFlow = false; } - return "number"; - } - - // Macros like '%make_install' or '%attr(0775,root,root)' - if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } - return "keyword"; - } - if (state.macroParameters) { - if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { - state.macroParameters = false; - return "keyword"; - } - } - - // Macros like '%{defined fedora}' - if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) { - if (stream.eol()) { state.controlFlow = false; } - return "def"; - } - - //TODO: Include bash script sub-parser (CodeMirror supports that) - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/rst/index.html b/public/plugins/codemirror-5.17.0/mode/rst/index.html deleted file mode 100644 index 2902dea23..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rst/index.html +++ /dev/null @@ -1,535 +0,0 @@ - - -CodeMirror: reStructuredText mode - - - - - - - - - - -
-

reStructuredText mode

-
- - -

- The python mode will be used for highlighting blocks - containing Python/IPython terminal sessions: blocks starting with - >>> (for Python) or In [num]: (for - IPython). - - Further, the stex mode will be used for highlighting - blocks containing LaTex code. -

- -

MIME types defined: text/x-rst.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/rst/rst.js b/public/plugins/codemirror-5.17.0/mode/rst/rst.js deleted file mode 100644 index bcf110c1a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rst/rst.js +++ /dev/null @@ -1,557 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('rst', function (config, options) { - - var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/; - var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/; - var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/; - - var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/; - var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/; - var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/; - - var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://"; - var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})"; - var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*"; - var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path); - - var overlay = { - token: function (stream) { - - if (stream.match(rx_strong) && stream.match (/\W+|$/, false)) - return 'strong'; - if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false)) - return 'em'; - if (stream.match(rx_literal) && stream.match (/\W+|$/, false)) - return 'string-2'; - if (stream.match(rx_number)) - return 'number'; - if (stream.match(rx_positive)) - return 'positive'; - if (stream.match(rx_negative)) - return 'negative'; - if (stream.match(rx_uri)) - return 'link'; - - while (stream.next() != null) { - if (stream.match(rx_strong, false)) break; - if (stream.match(rx_emphasis, false)) break; - if (stream.match(rx_literal, false)) break; - if (stream.match(rx_number, false)) break; - if (stream.match(rx_positive, false)) break; - if (stream.match(rx_negative, false)) break; - if (stream.match(rx_uri, false)) break; - } - - return null; - } - }; - - var mode = CodeMirror.getMode( - config, options.backdrop || 'rst-base' - ); - - return CodeMirror.overlayMode(mode, overlay, true); // combine -}, 'python', 'stex'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -CodeMirror.defineMode('rst-base', function (config) { - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function format(string) { - var args = Array.prototype.slice.call(arguments, 1); - return string.replace(/{(\d+)}/g, function (match, n) { - return typeof args[n] != 'undefined' ? args[n] : match; - }); - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - var mode_python = CodeMirror.getMode(config, 'python'); - var mode_stex = CodeMirror.getMode(config, 'stex'); - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - var SEPA = "\\s+"; - var TAIL = "(?:\\s*|\\W|$)", - rx_TAIL = new RegExp(format('^{0}', TAIL)); - - var NAME = - "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)", - rx_NAME = new RegExp(format('^{0}', NAME)); - var NAME_WWS = - "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)"; - var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS); - - var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)"; - var TEXT2 = "(?:[^\\`]+)", - rx_TEXT2 = new RegExp(format('^{0}', TEXT2)); - - var rx_section = new RegExp( - "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"); - var rx_explicit = new RegExp( - format('^\\.\\.{0}', SEPA)); - var rx_link = new RegExp( - format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL)); - var rx_directive = new RegExp( - format('^{0}::{1}', REF_NAME, TAIL)); - var rx_substitution = new RegExp( - format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL)); - var rx_footnote = new RegExp( - format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL)); - var rx_citation = new RegExp( - format('^\\[{0}\\]{1}', REF_NAME, TAIL)); - - var rx_substitution_ref = new RegExp( - format('^\\|{0}\\|', TEXT1)); - var rx_footnote_ref = new RegExp( - format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME)); - var rx_citation_ref = new RegExp( - format('^\\[{0}\\]_', REF_NAME)); - var rx_link_ref1 = new RegExp( - format('^{0}__?', REF_NAME)); - var rx_link_ref2 = new RegExp( - format('^`{0}`_', TEXT2)); - - var rx_role_pre = new RegExp( - format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL)); - var rx_role_suf = new RegExp( - format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL)); - var rx_role = new RegExp( - format('^:{0}:{1}', NAME, TAIL)); - - var rx_directive_name = new RegExp(format('^{0}', REF_NAME)); - var rx_directive_tail = new RegExp(format('^::{0}', TAIL)); - var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1)); - var rx_substitution_sepa = new RegExp(format('^{0}', SEPA)); - var rx_substitution_name = new RegExp(format('^{0}', REF_NAME)); - var rx_substitution_tail = new RegExp(format('^::{0}', TAIL)); - var rx_link_head = new RegExp("^_"); - var rx_link_name = new RegExp(format('^{0}|_', REF_NAME)); - var rx_link_tail = new RegExp(format('^:{0}', TAIL)); - - var rx_verbatim = new RegExp('^::\\s*$'); - var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s'); - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_normal(stream, state) { - var token = null; - - if (stream.sol() && stream.match(rx_examples, false)) { - change(state, to_mode, { - mode: mode_python, local: CodeMirror.startState(mode_python) - }); - } else if (stream.sol() && stream.match(rx_explicit)) { - change(state, to_explicit); - token = 'meta'; - } else if (stream.sol() && stream.match(rx_section)) { - change(state, to_normal); - token = 'header'; - } else if (phase(state) == rx_role_pre || - stream.match(rx_role_pre, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role_pre, 1)); - stream.match(/^:/); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role_pre, 2)); - stream.match(rx_NAME); - token = 'keyword'; - - if (stream.current().match(/^(?:math|latex)/)) { - state.tmp_stex = true; - } - break; - case 2: - change(state, to_normal, context(rx_role_pre, 3)); - stream.match(/^:`/); - token = 'meta'; - break; - case 3: - if (state.tmp_stex) { - state.tmp_stex = undefined; state.tmp = { - mode: mode_stex, local: CodeMirror.startState(mode_stex) - }; - } - - if (state.tmp) { - if (stream.peek() == '`') { - change(state, to_normal, context(rx_role_pre, 4)); - state.tmp = undefined; - break; - } - - token = state.tmp.mode.token(stream, state.tmp.local); - break; - } - - change(state, to_normal, context(rx_role_pre, 4)); - stream.match(rx_TEXT2); - token = 'string'; - break; - case 4: - change(state, to_normal, context(rx_role_pre, 5)); - stream.match(/^`/); - token = 'meta'; - break; - case 5: - change(state, to_normal, context(rx_role_pre, 6)); - stream.match(rx_TAIL); - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_role_suf || - stream.match(rx_role_suf, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role_suf, 1)); - stream.match(/^`/); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role_suf, 2)); - stream.match(rx_TEXT2); - token = 'string'; - break; - case 2: - change(state, to_normal, context(rx_role_suf, 3)); - stream.match(/^`:/); - token = 'meta'; - break; - case 3: - change(state, to_normal, context(rx_role_suf, 4)); - stream.match(rx_NAME); - token = 'keyword'; - break; - case 4: - change(state, to_normal, context(rx_role_suf, 5)); - stream.match(/^:/); - token = 'meta'; - break; - case 5: - change(state, to_normal, context(rx_role_suf, 6)); - stream.match(rx_TAIL); - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_role || stream.match(rx_role, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role, 1)); - stream.match(/^:/); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role, 2)); - stream.match(rx_NAME); - token = 'keyword'; - break; - case 2: - change(state, to_normal, context(rx_role, 3)); - stream.match(/^:/); - token = 'meta'; - break; - case 3: - change(state, to_normal, context(rx_role, 4)); - stream.match(rx_TAIL); - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_substitution_ref || - stream.match(rx_substitution_ref, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_substitution_ref, 1)); - stream.match(rx_substitution_text); - token = 'variable-2'; - break; - case 1: - change(state, to_normal, context(rx_substitution_ref, 2)); - if (stream.match(/^_?_?/)) token = 'link'; - break; - default: - change(state, to_normal); - } - } else if (stream.match(rx_footnote_ref)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_citation_ref)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_link_ref1)) { - change(state, to_normal); - if (!stream.peek() || stream.peek().match(/^\W$/)) { - token = 'link'; - } - } else if (phase(state) == rx_link_ref2 || - stream.match(rx_link_ref2, false)) { - - switch (stage(state)) { - case 0: - if (!stream.peek() || stream.peek().match(/^\W$/)) { - change(state, to_normal, context(rx_link_ref2, 1)); - } else { - stream.match(rx_link_ref2); - } - break; - case 1: - change(state, to_normal, context(rx_link_ref2, 2)); - stream.match(/^`/); - token = 'link'; - break; - case 2: - change(state, to_normal, context(rx_link_ref2, 3)); - stream.match(rx_TEXT2); - break; - case 3: - change(state, to_normal, context(rx_link_ref2, 4)); - stream.match(/^`_/); - token = 'link'; - break; - default: - change(state, to_normal); - } - } else if (stream.match(rx_verbatim)) { - change(state, to_verbatim); - } - - else { - if (stream.next()) change(state, to_normal); - } - - return token; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_explicit(stream, state) { - var token = null; - - if (phase(state) == rx_substitution || - stream.match(rx_substitution, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_substitution, 1)); - stream.match(rx_substitution_text); - token = 'variable-2'; - break; - case 1: - change(state, to_explicit, context(rx_substitution, 2)); - stream.match(rx_substitution_sepa); - break; - case 2: - change(state, to_explicit, context(rx_substitution, 3)); - stream.match(rx_substitution_name); - token = 'keyword'; - break; - case 3: - change(state, to_explicit, context(rx_substitution, 4)); - stream.match(rx_substitution_tail); - token = 'meta'; - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_directive || - stream.match(rx_directive, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_directive, 1)); - stream.match(rx_directive_name); - token = 'keyword'; - - if (stream.current().match(/^(?:math|latex)/)) - state.tmp_stex = true; - else if (stream.current().match(/^python/)) - state.tmp_py = true; - break; - case 1: - change(state, to_explicit, context(rx_directive, 2)); - stream.match(rx_directive_tail); - token = 'meta'; - - if (stream.match(/^latex\s*$/) || state.tmp_stex) { - state.tmp_stex = undefined; change(state, to_mode, { - mode: mode_stex, local: CodeMirror.startState(mode_stex) - }); - } - break; - case 2: - change(state, to_explicit, context(rx_directive, 3)); - if (stream.match(/^python\s*$/) || state.tmp_py) { - state.tmp_py = undefined; change(state, to_mode, { - mode: mode_python, local: CodeMirror.startState(mode_python) - }); - } - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_link || stream.match(rx_link, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_link, 1)); - stream.match(rx_link_head); - stream.match(rx_link_name); - token = 'link'; - break; - case 1: - change(state, to_explicit, context(rx_link, 2)); - stream.match(rx_link_tail); - token = 'meta'; - break; - default: - change(state, to_normal); - } - } else if (stream.match(rx_footnote)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_citation)) { - change(state, to_normal); - token = 'quote'; - } - - else { - stream.eatSpace(); - if (stream.eol()) { - change(state, to_normal); - } else { - stream.skipToEnd(); - change(state, to_comment); - token = 'comment'; - } - } - - return token; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_comment(stream, state) { - return as_block(stream, state, 'comment'); - } - - function to_verbatim(stream, state) { - return as_block(stream, state, 'meta'); - } - - function as_block(stream, state, token) { - if (stream.eol() || stream.eatSpace()) { - stream.skipToEnd(); - return token; - } else { - change(state, to_normal); - return null; - } - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_mode(stream, state) { - - if (state.ctx.mode && state.ctx.local) { - - if (stream.sol()) { - if (!stream.eatSpace()) change(state, to_normal); - return null; - } - - return state.ctx.mode.token(stream, state.ctx.local); - } - - change(state, to_normal); - return null; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function context(phase, stage, mode, local) { - return {phase: phase, stage: stage, mode: mode, local: local}; - } - - function change(state, tok, ctx) { - state.tok = tok; - state.ctx = ctx || {}; - } - - function stage(state) { - return state.ctx.stage || 0; - } - - function phase(state) { - return state.ctx.phase; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - return { - startState: function () { - return {tok: to_normal, ctx: context(undefined, 0)}; - }, - - copyState: function (state) { - var ctx = state.ctx, tmp = state.tmp; - if (ctx.local) - ctx = {mode: ctx.mode, local: CodeMirror.copyState(ctx.mode, ctx.local)}; - if (tmp) - tmp = {mode: tmp.mode, local: CodeMirror.copyState(tmp.mode, tmp.local)}; - return {tok: state.tok, ctx: ctx, tmp: tmp}; - }, - - innerMode: function (state) { - return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode} - : state.ctx.mode ? {state: state.ctx.local, mode: state.ctx.mode} - : null; - }, - - token: function (stream, state) { - return state.tok(stream, state); - } - }; -}, 'python', 'stex'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -CodeMirror.defineMIME('text/x-rst', 'rst'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/ruby/index.html b/public/plugins/codemirror-5.17.0/mode/ruby/index.html deleted file mode 100644 index 97544babc..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ruby/index.html +++ /dev/null @@ -1,183 +0,0 @@ - - -CodeMirror: Ruby mode - - - - - - - - - - -
-

Ruby mode

-
- - -

MIME types defined: text/x-ruby.

- -

Development of the CodeMirror Ruby mode was kindly sponsored - by Ubalo.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/ruby/ruby.js b/public/plugins/codemirror-5.17.0/mode/ruby/ruby.js deleted file mode 100644 index 10cad8d9f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ruby/ruby.js +++ /dev/null @@ -1,285 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("ruby", function(config) { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", - "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", - "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", - "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", - "caller", "lambda", "proc", "public", "protected", "private", "require", "load", - "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" - ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then", - "catch", "loop", "proc", "begin"]); - var dedentWords = wordObj(["end", "until"]); - var matching = {"[": "]", "{": "}", "(": ")"}; - var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - if (stream.sol() && stream.match("=begin") && stream.eol()) { - state.tokenize.push(readBlockComment); - return "comment"; - } - if (stream.eatSpace()) return null; - var ch = stream.next(), m; - if (ch == "`" || ch == "'" || ch == '"') { - return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); - } else if (ch == "/") { - var currentIndex = stream.current().length; - if (stream.skipTo("/")) { - var search_till = stream.current().length; - stream.backUp(stream.current().length - currentIndex); - var balance = 0; // balance brackets - while (stream.current().length < search_till) { - var chchr = stream.next(); - if (chchr == "(") balance += 1; - else if (chchr == ")") balance -= 1; - if (balance < 0) break; - } - stream.backUp(stream.current().length - currentIndex); - if (balance == 0) - return chain(readQuoted(ch, "string-2", true), stream, state); - } - return "operator"; - } else if (ch == "%") { - var style = "string", embed = true; - if (stream.eat("s")) style = "atom"; - else if (stream.eat(/[WQ]/)) style = "string"; - else if (stream.eat(/[r]/)) style = "string-2"; - else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; } - var delim = stream.eat(/[^\w\s=]/); - if (!delim) return "operator"; - if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; - return chain(readQuoted(delim, style, embed, true), stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { - return chain(readHereDoc(m[1]), stream, state); - } else if (ch == "0") { - if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); - else if (stream.eat("b")) stream.eatWhile(/[01]/); - else stream.eatWhile(/[0-7]/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); - return "number"; - } else if (ch == "?") { - while (stream.match(/^\\[CM]-/)) {} - if (stream.eat("\\")) stream.eatWhile(/\w/); - else stream.next(); - return "string"; - } else if (ch == ":") { - if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); - if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); - - // :> :>> :< :<< are valid symbols - if (stream.eat(/[\<\>]/)) { - stream.eat(/[\<\>]/); - return "atom"; - } - - // :+ :- :/ :* :| :& :! are valid symbols - if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) { - return "atom"; - } - - // Symbols can't start by a digit - if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) { - stream.eatWhile(/[\w$\xa1-\uffff]/); - // Only one ? ! = is allowed and only as the last character - stream.eat(/[\?\!\=]/); - return "atom"; - } - return "operator"; - } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) { - stream.eat("@"); - stream.eatWhile(/[\w\xa1-\uffff]/); - return "variable-2"; - } else if (ch == "$") { - if (stream.eat(/[a-zA-Z_]/)) { - stream.eatWhile(/[\w]/); - } else if (stream.eat(/\d/)) { - stream.eat(/\d/); - } else { - stream.next(); // Must be a special global like $: or $! - } - return "variable-3"; - } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) { - stream.eatWhile(/[\w\xa1-\uffff]/); - stream.eat(/[\?\!]/); - if (stream.eat(":")) return "atom"; - return "ident"; - } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { - curPunc = "|"; - return null; - } else if (/[\(\)\[\]{}\\;]/.test(ch)) { - curPunc = ch; - return null; - } else if (ch == "-" && stream.eat(">")) { - return "arrow"; - } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); - if (ch == "." && !more) curPunc = "."; - return "operator"; - } else { - return null; - } - } - - function tokenBaseUntilBrace(depth) { - if (!depth) depth = 1; - return function(stream, state) { - if (stream.peek() == "}") { - if (depth == 1) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } else { - state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1); - } - } else if (stream.peek() == "{") { - state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1); - } - return tokenBase(stream, state); - }; - } - function tokenBaseOnce() { - var alreadyCalled = false; - return function(stream, state) { - if (alreadyCalled) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - alreadyCalled = true; - return tokenBase(stream, state); - }; - } - function readQuoted(quote, style, embed, unescaped) { - return function(stream, state) { - var escaped = false, ch; - - if (state.context.type === 'read-quoted-paused') { - state.context = state.context.prev; - stream.eat("}"); - } - - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - if (embed && ch == "#" && !escaped) { - if (stream.eat("{")) { - if (quote == "}") { - state.context = {prev: state.context, type: 'read-quoted-paused'}; - } - state.tokenize.push(tokenBaseUntilBrace()); - break; - } else if (/[@\$]/.test(stream.peek())) { - state.tokenize.push(tokenBaseOnce()); - break; - } - } - escaped = !escaped && ch == "\\"; - } - return style; - }; - } - function readHereDoc(phrase) { - return function(stream, state) { - if (stream.match(phrase)) state.tokenize.pop(); - else stream.skipToEnd(); - return "string"; - }; - } - function readBlockComment(stream, state) { - if (stream.sol() && stream.match("=end") && stream.eol()) - state.tokenize.pop(); - stream.skipToEnd(); - return "comment"; - } - - return { - startState: function() { - return {tokenize: [tokenBase], - indented: 0, - context: {type: "top", indented: -config.indentUnit}, - continuedLine: false, - lastTok: null, - varList: false}; - }, - - token: function(stream, state) { - curPunc = null; - if (stream.sol()) state.indented = stream.indentation(); - var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; - var thisTok = curPunc; - if (style == "ident") { - var word = stream.current(); - style = state.lastTok == "." ? "property" - : keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : /^[A-Z]/.test(word) ? "tag" - : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" - : "variable"; - if (style == "keyword") { - thisTok = word; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) - kwtype = "indent"; - else if (word == "do" && state.context.indented < state.indented) - kwtype = "indent"; - } - } - if (curPunc || (style && style != "comment")) state.lastTok = thisTok; - if (curPunc == "|") state.varList = !state.varList; - - if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) - state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; - else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) - state.context = state.context.prev; - - if (stream.eol()) - state.continuedLine = (curPunc == "\\" || style == "operator"); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0); - var ct = state.context; - var closing = ct.type == matching[firstChar] || - ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); - return ct.indented + (closing ? 0 : config.indentUnit) + - (state.continuedLine ? config.indentUnit : 0); - }, - - electricInput: /^\s*(?:end|rescue|\})$/, - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-ruby", "ruby"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/ruby/test.js b/public/plugins/codemirror-5.17.0/mode/ruby/test.js deleted file mode 100644 index cade864ff..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ruby/test.js +++ /dev/null @@ -1,14 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("divide_equal_operator", - "[variable bar] [operator /=] [variable foo]"); - - MT("divide_equal_operator_no_spacing", - "[variable foo][operator /=][number 42]"); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/rust/index.html b/public/plugins/codemirror-5.17.0/mode/rust/index.html deleted file mode 100644 index 1fe0ad1e6..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rust/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: Rust mode - - - - - - - - - - -
-

Rust mode

- - -
- - - -

MIME types defined: text/x-rustsrc.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/rust/rust.js b/public/plugins/codemirror-5.17.0/mode/rust/rust.js deleted file mode 100644 index 8558b53fe..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rust/rust.js +++ /dev/null @@ -1,71 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineSimpleMode("rust",{ - start: [ - // string and byte string - {regex: /b?"/, token: "string", next: "string"}, - // raw string and raw byte string - {regex: /b?r"/, token: "string", next: "string_raw"}, - {regex: /b?r#+"/, token: "string", next: "string_raw_hash"}, - // character - {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"}, - // byte - {regex: /b'(?:[^']|\\(?:['\\nrt0]|x[\da-fA-F]{2}))'/, token: "string-2"}, - - {regex: /(?:(?:[0-9][0-9_]*)(?:(?:[Ee][+-]?[0-9_]+)|\.[0-9_]+(?:[Ee][+-]?[0-9_]+)?)(?:f32|f64)?)|(?:0(?:b[01_]+|(?:o[0-7_]+)|(?:x[0-9a-fA-F_]+))|(?:[0-9][0-9_]*))(?:u8|u16|u32|u64|i8|i16|i32|i64|isize|usize)?/, - token: "number"}, - {regex: /(let(?:\s+mut)?|fn|enum|mod|struct|type)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, token: ["keyword", null, "def"]}, - {regex: /(?:abstract|alignof|as|box|break|continue|const|crate|do|else|enum|extern|fn|for|final|if|impl|in|loop|macro|match|mod|move|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, token: "keyword"}, - {regex: /\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|f16|f32|f64|i8|i16|i32|i64|str|Option)\b/, token: "atom"}, - {regex: /\b(?:true|false|Some|None|Ok|Err)\b/, token: "builtin"}, - {regex: /\b(fn)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, - token: ["keyword", null ,"def"]}, - {regex: /#!?\[.*\]/, token: "meta"}, - {regex: /\/\/.*/, token: "comment"}, - {regex: /\/\*/, token: "comment", next: "comment"}, - {regex: /[-+\/*=<>!]+/, token: "operator"}, - {regex: /[a-zA-Z_]\w*!/,token: "variable-3"}, - {regex: /[a-zA-Z_]\w*/, token: "variable"}, - {regex: /[\{\[\(]/, indent: true}, - {regex: /[\}\]\)]/, dedent: true} - ], - string: [ - {regex: /"/, token: "string", next: "start"}, - {regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"} - ], - string_raw: [ - {regex: /"/, token: "string", next: "start"}, - {regex: /[^"]*/, token: "string"} - ], - string_raw_hash: [ - {regex: /"#+/, token: "string", next: "start"}, - {regex: /(?:[^"]|"(?!#))*/, token: "string"} - ], - comment: [ - {regex: /.*?\*\//, token: "comment", next: "start"}, - {regex: /.*/, token: "comment"} - ], - meta: { - dontIndentStates: ["comment"], - electricInput: /^\s*\}$/, - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - fold: "brace" - } -}); - - -CodeMirror.defineMIME("text/x-rustsrc", "rust"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/rust/test.js b/public/plugins/codemirror-5.17.0/mode/rust/test.js deleted file mode 100644 index eb256c47e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/rust/test.js +++ /dev/null @@ -1,39 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 4}, "rust"); - function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} - - MT('integer_test', - '[number 123i32]', - '[number 123u32]', - '[number 123_u32]', - '[number 0xff_u8]', - '[number 0o70_i16]', - '[number 0b1111_1111_1001_0000_i32]', - '[number 0usize]'); - - MT('float_test', - '[number 123.0f64]', - '[number 0.1f64]', - '[number 0.1f32]', - '[number 12E+99_f64]'); - - MT('string-literals-test', - '[string "foo"]', - '[string r"foo"]', - '[string "\\"foo\\""]', - '[string r#""foo""#]', - '[string "foo #\\"# bar"]', - - '[string b"foo"]', - '[string br"foo"]', - '[string b"\\"foo\\""]', - '[string br#""foo""#]', - '[string br##"foo #" bar"##]', - - "[string-2 'h']", - "[string-2 b'h']"); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/sas/index.html b/public/plugins/codemirror-5.17.0/mode/sas/index.html deleted file mode 100644 index 636e06594..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sas/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - -CodeMirror: SAS mode - - - - - - - - - - -
-

SAS mode

-
- - - -

MIME types defined: text/x-sas.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/sas/sas.js b/public/plugins/codemirror-5.17.0/mode/sas/sas.js deleted file mode 100755 index fe114827c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sas/sas.js +++ /dev/null @@ -1,315 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - - -// SAS mode copyright (c) 2016 Jared Dean, SAS Institute -// Created by Jared Dean - -// TODO -// indent and de-indent -// identify macro variables - - -//Definitions -// comment -- text withing * ; or /* */ -// keyword -- SAS language variable -// variable -- macro variables starts with '&' or variable formats -// variable-2 -- DATA Step, proc, or macro names -// string -- text within ' ' or " " -// operator -- numeric operator + / - * ** le eq ge ... and so on -// builtin -- proc %macro data run mend -// atom -// def - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("sas", function () { - var words = {}; - var isDoubleOperatorSym = { - eq: 'operator', - lt: 'operator', - le: 'operator', - gt: 'operator', - ge: 'operator', - "in": 'operator', - ne: 'operator', - or: 'operator' - }; - var isDoubleOperatorChar = /(<=|>=|!=|<>)/; - var isSingleOperatorChar = /[=\(:\),{}.*<>+\-\/^\[\]]/; - - // Takes a string of words separated by spaces and adds them as - // keys with the value of the first argument 'style' - function define(style, string, context) { - if (context) { - var split = string.split(' '); - for (var i = 0; i < split.length; i++) { - words[split[i]] = {style: style, state: context}; - } - } - } - //datastep - define('def', 'stack pgm view source debug nesting nolist', ['inDataStep']); - define('def', 'if while until for do do; end end; then else cancel', ['inDataStep']); - define('def', 'label format _n_ _error_', ['inDataStep']); - define('def', 'ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME', ['inDataStep']); - define('def', 'filevar finfo finv fipname fipnamel fipstate first firstobs floor', ['inDataStep']); - define('def', 'varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday', ['inDataStep']); - define('def', 'zipfips zipname zipnamel zipstate', ['inDataStep']); - define('def', 'put putc putn', ['inDataStep']); - define('builtin', 'data run', ['inDataStep']); - - - //proc - define('def', 'data', ['inProc']); - - // flow control for macros - define('def', '%if %end %end; %else %else; %do %do; %then', ['inMacro']); - - //everywhere - define('builtin', 'proc run; quit; libname filename %macro %mend option options', ['ALL']); - - define('def', 'footnote title libname ods', ['ALL']); - define('def', '%let %put %global %sysfunc %eval ', ['ALL']); - // automatic macro variables http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003167023.htm - define('variable', '&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext', ['ALL']); - - //footnote[1-9]? title[1-9]? - - //options statement - define('def', 'source2 nosource2 page pageno pagesize', ['ALL']); - - //proc and datastep - define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']); - define('operator', 'and not ', ['inDataStep', 'inProc']); - - // Main function - function tokenize(stream, state) { - // Finally advance the stream - var ch = stream.next(); - - // BLOCKCOMMENT - if (ch === '/' && stream.eat('*')) { - state.continueComment = true; - return "comment"; - } else if (state.continueComment === true) { // in comment block - //comment ends at the beginning of the line - if (ch === '*' && stream.peek() === '/') { - stream.next(); - state.continueComment = false; - } else if (stream.skipTo('*')) { //comment is potentially later in line - stream.skipTo('*'); - stream.next(); - if (stream.eat('/')) - state.continueComment = false; - } else { - stream.skipToEnd(); - } - return "comment"; - } - - // DoubleOperator match - var doubleOperator = ch + stream.peek(); - - // Match all line comments. - var myString = stream.string; - var myRegexp = /(?:^\s*|[;]\s*)(\*.*?);/ig; - var match = myRegexp.exec(myString); - if (match !== null) { - if (match.index === 0 && (stream.column() !== (match.index + match[0].length - 1))) { - stream.backUp(stream.column()); - stream.skipTo(';'); - stream.next(); - return 'comment'; - } else if (match.index + 1 < stream.column() && stream.column() < match.index + match[0].length - 1) { - // the ';' triggers the match so move one past it to start - // the comment block that is why match.index+1 - stream.backUp(stream.column() - match.index - 1); - stream.skipTo(';'); - stream.next(); - return 'comment'; - } - } else if (!state.continueString && (ch === '"' || ch === "'")) { - // Have we found a string? - state.continueString = ch; //save the matching quote in the state - return "string"; - } else if (state.continueString !== null) { - if (stream.skipTo(state.continueString)) { - // quote found on this line - stream.next(); - state.continueString = null; - } else { - stream.skipToEnd(); - } - return "string"; - } else if (state.continueString !== null && stream.eol()) { - stream.skipTo(state.continueString) || stream.skipToEnd(); - return "string"; - } else if (/[\d\.]/.test(ch)) { //find numbers - if (ch === ".") - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); - else if (ch === "0") - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); - else - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); - return "number"; - } else if (isDoubleOperatorChar.test(ch + stream.peek())) { // TWO SYMBOL TOKENS - stream.next(); - return "operator"; - } else if (isDoubleOperatorSym.hasOwnProperty(doubleOperator)) { - stream.next(); - if (stream.peek() === ' ') - return isDoubleOperatorSym[doubleOperator.toLowerCase()]; - } else if (isSingleOperatorChar.test(ch)) { // SINGLE SYMBOL TOKENS - return "operator"; - } - - // Matches one whole word -- even if the word is a character - var word; - if (stream.match(/[%&;\w]+/, false) != null) { - word = ch + stream.match(/[%&;\w]+/, true); - if (/&/.test(word)) return 'variable' - } else { - word = ch; - } - // the word after DATA PROC or MACRO - if (state.nextword) { - stream.match(/[\w]+/); - // match memname.libname - if (stream.peek() === '.') stream.skipTo(' '); - state.nextword = false; - return 'variable-2'; - - } - - // Are we in a DATA Step? - if (state.inDataStep) { - if (word.toLowerCase() === 'run;' || stream.match(/run\s;/)) { - state.inDataStep = false; - return 'builtin'; - } - // variable formats - if ((word) && stream.next() === '.') { - //either a format or libname.memname - if (/\w/.test(stream.peek())) return 'variable-2'; - else return 'variable'; - } - // do we have a DATA Step keyword - if (word && words.hasOwnProperty(word.toLowerCase()) && - (words[word.toLowerCase()].state.indexOf("inDataStep") !== -1 || - words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { - //backup to the start of the word - if (stream.start < stream.pos) - stream.backUp(stream.pos - stream.start); - //advance the length of the word and return - for (var i = 0; i < word.length; ++i) stream.next(); - return words[word.toLowerCase()].style; - } - } - // Are we in an Proc statement? - if (state.inProc) { - if (word.toLowerCase() === 'run;' || word.toLowerCase() === 'quit;') { - state.inProc = false; - return 'builtin'; - } - // do we have a proc keyword - if (word && words.hasOwnProperty(word.toLowerCase()) && - (words[word.toLowerCase()].state.indexOf("inProc") !== -1 || - words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { - stream.match(/[\w]+/); - return words[word].style; - } - } - // Are we in a Macro statement? - if (state.inMacro) { - if (word.toLowerCase() === '%mend') { - if (stream.peek() === ';') stream.next(); - state.inMacro = false; - return 'builtin'; - } - if (word && words.hasOwnProperty(word.toLowerCase()) && - (words[word.toLowerCase()].state.indexOf("inMacro") !== -1 || - words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { - stream.match(/[\w]+/); - return words[word.toLowerCase()].style; - } - - return 'atom'; - } - // Do we have Keywords specific words? - if (word && words.hasOwnProperty(word.toLowerCase())) { - // Negates the initial next() - stream.backUp(1); - // Actually move the stream - stream.match(/[\w]+/); - if (word.toLowerCase() === 'data' && /=/.test(stream.peek()) === false) { - state.inDataStep = true; - state.nextword = true; - return 'builtin'; - } - if (word.toLowerCase() === 'proc') { - state.inProc = true; - state.nextword = true; - return 'builtin'; - } - if (word.toLowerCase() === '%macro') { - state.inMacro = true; - state.nextword = true; - return 'builtin'; - } - if (/title[1-9]/i.test(word)) return 'def'; - - if (word.toLowerCase() === 'footnote') { - stream.eat(/[1-9]/); - return 'def'; - } - - // Returns their value as state in the prior define methods - if (state.inDataStep === true && words[word.toLowerCase()].state.indexOf("inDataStep") !== -1) - return words[word.toLowerCase()].style; - if (state.inProc === true && words[word.toLowerCase()].state.indexOf("inProc") !== -1) - return words[word.toLowerCase()].style; - if (state.inMacro === true && words[word.toLowerCase()].state.indexOf("inMacro") !== -1) - return words[word.toLowerCase()].style; - if (words[word.toLowerCase()].state.indexOf("ALL") !== -1) - return words[word.toLowerCase()].style; - return null; - } - // Unrecognized syntax - return null; - } - - return { - startState: function () { - return { - inDataStep: false, - inProc: false, - inMacro: false, - nextword: false, - continueString: null, - continueComment: false - }; - }, - token: function (stream, state) { - // Strip the spaces, but regex will account for them either way - if (stream.eatSpace()) return null; - // Go through the main process - return tokenize(stream, state); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/" - }; - - }); - - CodeMirror.defineMIME("text/x-sas", "sas"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/sass/index.html b/public/plugins/codemirror-5.17.0/mode/sass/index.html deleted file mode 100644 index 9f4a79022..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sass/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Sass mode - - - - - - - - - - -
-

Sass mode

-
- - -

MIME types defined: text/x-sass.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/sass/sass.js b/public/plugins/codemirror-5.17.0/mode/sass/sass.js deleted file mode 100644 index 6973ece29..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sass/sass.js +++ /dev/null @@ -1,414 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sass", function(config) { - function tokenRegexp(words) { - return new RegExp("^" + words.join("|")); - } - - var keywords = ["true", "false", "null", "auto"]; - var keywordsRegexp = new RegExp("^" + keywords.join("|")); - - var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", - "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"]; - var opRegexp = tokenRegexp(operators); - - var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/; - - function urlTokens(stream, state) { - var ch = stream.peek(); - - if (ch === ")") { - stream.next(); - state.tokenizer = tokenBase; - return "operator"; - } else if (ch === "(") { - stream.next(); - stream.eatSpace(); - - return "operator"; - } else if (ch === "'" || ch === '"') { - state.tokenizer = buildStringTokenizer(stream.next()); - return "string"; - } else { - state.tokenizer = buildStringTokenizer(")", false); - return "string"; - } - } - function comment(indentation, multiLine) { - return function(stream, state) { - if (stream.sol() && stream.indentation() <= indentation) { - state.tokenizer = tokenBase; - return tokenBase(stream, state); - } - - if (multiLine && stream.skipTo("*/")) { - stream.next(); - stream.next(); - state.tokenizer = tokenBase; - } else { - stream.skipToEnd(); - } - - return "comment"; - }; - } - - function buildStringTokenizer(quote, greedy) { - if (greedy == null) { greedy = true; } - - function stringTokenizer(stream, state) { - var nextChar = stream.next(); - var peekChar = stream.peek(); - var previousChar = stream.string.charAt(stream.pos-2); - - var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); - - if (endingString) { - if (nextChar !== quote && greedy) { stream.next(); } - state.tokenizer = tokenBase; - return "string"; - } else if (nextChar === "#" && peekChar === "{") { - state.tokenizer = buildInterpolationTokenizer(stringTokenizer); - stream.next(); - return "operator"; - } else { - return "string"; - } - } - - return stringTokenizer; - } - - function buildInterpolationTokenizer(currentTokenizer) { - return function(stream, state) { - if (stream.peek() === "}") { - stream.next(); - state.tokenizer = currentTokenizer; - return "operator"; - } else { - return tokenBase(stream, state); - } - }; - } - - function indent(state) { - if (state.indentCount == 0) { - state.indentCount++; - var lastScopeOffset = state.scopes[0].offset; - var currentOffset = lastScopeOffset + config.indentUnit; - state.scopes.unshift({ offset:currentOffset }); - } - } - - function dedent(state) { - if (state.scopes.length == 1) return; - - state.scopes.shift(); - } - - function tokenBase(stream, state) { - var ch = stream.peek(); - - // Comment - if (stream.match("/*")) { - state.tokenizer = comment(stream.indentation(), true); - return state.tokenizer(stream, state); - } - if (stream.match("//")) { - state.tokenizer = comment(stream.indentation(), false); - return state.tokenizer(stream, state); - } - - // Interpolation - if (stream.match("#{")) { - state.tokenizer = buildInterpolationTokenizer(tokenBase); - return "operator"; - } - - // Strings - if (ch === '"' || ch === "'") { - stream.next(); - state.tokenizer = buildStringTokenizer(ch); - return "string"; - } - - if(!state.cursorHalf){// state.cursorHalf === 0 - // first half i.e. before : for key-value pairs - // including selectors - - if (ch === ".") { - stream.next(); - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } else if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - if (ch === "#") { - stream.next(); - // ID selectors - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } - if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "variable-2"; - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)) - return "number"; - - // Units - if (stream.match(/^(px|em|in)\b/)) - return "unit"; - - if (stream.match(keywordsRegexp)) - return "keyword"; - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - return "atom"; - } - - if (ch === "=") { - // Match shortcut mixin definition - if (stream.match(/^=[\w-]+/)) { - indent(state); - return "meta"; - } - } - - if (ch === "+") { - // Match shortcut mixin definition - if (stream.match(/^\+[\w-]+/)){ - return "variable-3"; - } - } - - if(ch === "@"){ - if(stream.match(/@extend/)){ - if(!stream.match(/\s*[\w]/)) - dedent(state); - } - } - - - // Indent Directives - if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { - indent(state); - return "meta"; - } - - // Other Directives - if (ch === "@") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "meta"; - } - - if (stream.eatWhile(/[\w-]/)){ - if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ - return "property"; - } - else if(stream.match(/ *:/,false)){ - indent(state); - state.cursorHalf = 1; - return "atom"; - } - else if(stream.match(/ *,/,false)){ - return "atom"; - } - else{ - indent(state); - return "atom"; - } - } - - if(ch === ":"){ - if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element - return "keyword"; - } - stream.next(); - state.cursorHalf=1; - return "operator"; - } - - } // cursorHalf===0 ends here - else{ - - if (ch === "#") { - stream.next(); - // Hex numbers - if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "number"; - } - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "number"; - } - - // Units - if (stream.match(/^(px|em|in)\b/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "unit"; - } - - if (stream.match(keywordsRegexp)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "keyword"; - } - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "atom"; - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "variable-3"; - } - - // bang character for !important, !default, etc. - if (ch === "!") { - stream.next(); - if(!stream.peek()){ - state.cursorHalf = 0; - } - return stream.match(/^[\w]+/) ? "keyword": "operator"; - } - - if (stream.match(opRegexp)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "operator"; - } - - // attributes - if (stream.eatWhile(/[\w-]/)) { - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "attribute"; - } - - //stream.eatSpace(); - if(!stream.peek()){ - state.cursorHalf = 0; - return null; - } - - } // else ends here - - if (stream.match(opRegexp)) - return "operator"; - - // If we haven't returned by now, we move 1 character - // and return an error - stream.next(); - return null; - } - - function tokenLexer(stream, state) { - if (stream.sol()) state.indentCount = 0; - var style = state.tokenizer(stream, state); - var current = stream.current(); - - if (current === "@return" || current === "}"){ - dedent(state); - } - - if (style !== null) { - var startOfToken = stream.pos - current.length; - - var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); - - var newScopes = []; - - for (var i = 0; i < state.scopes.length; i++) { - var scope = state.scopes[i]; - - if (scope.offset <= withCurrentIndent) - newScopes.push(scope); - } - - state.scopes = newScopes; - } - - - return style; - } - - return { - startState: function() { - return { - tokenizer: tokenBase, - scopes: [{offset: 0, type: "sass"}], - indentCount: 0, - cursorHalf: 0, // cursor half tells us if cursor lies after (1) - // or before (0) colon (well... more or less) - definedVars: [], - definedMixins: [] - }; - }, - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = { style: style, content: stream.current() }; - - return style; - }, - - indent: function(state) { - return state.scopes[0].offset; - } - }; -}); - -CodeMirror.defineMIME("text/x-sass", "sass"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/scheme/index.html b/public/plugins/codemirror-5.17.0/mode/scheme/index.html deleted file mode 100644 index 04d5c6a2a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/scheme/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: Scheme mode - - - - - - - - - -
-

Scheme mode

-
- - -

MIME types defined: text/x-scheme.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/scheme/scheme.js b/public/plugins/codemirror-5.17.0/mode/scheme/scheme.js deleted file mode 100644 index 223464591..000000000 --- a/public/plugins/codemirror-5.17.0/mode/scheme/scheme.js +++ /dev/null @@ -1,249 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Author: Koh Zi Han, based on implementation by Koh Zi Chun - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("scheme", function () { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; - var INDENT_WORD_SKIP = 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); - var indentKeys = makeKeywords("define let letrec let* lambda"); - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i); - var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i); - var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i); - var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i); - - function isBinaryNumber (stream) { - return stream.match(binaryMatcher); - } - - function isOctalNumber (stream) { - return stream.match(octalMatcher); - } - - function isDecimalNumber (stream, backup) { - if (backup === true) { - stream.backUp(1); - } - return stream.match(decimalMatcher); - } - - function isHexNumber (stream) { - return stream.match(hexMatcher); - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - sExprComment: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in scheme-string mode - break; - case "comment": // comment parsing mode - var next, maybeEnd = false; - while ((next = stream.next()) != null) { - if (next == "#" && maybeEnd) { - - state.mode = false; - break; - } - maybeEnd = (next == "|"); - } - returnType = COMMENT; - break; - case "s-expr-comment": // s-expr commenting mode - state.mode = false; - if(stream.peek() == "(" || stream.peek() == "["){ - // actually start scheme s-expr commenting mode - state.sExprComment = 0; - }else{ - // if not we just comment the entire of the next token - stream.eatWhile(/[^/s]/); // eat non spaces - returnType = COMMENT; - break; - } - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - - } else if (ch == "'") { - returnType = ATOM; - } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment - state.mode = "comment"; // toggle to comment mode - returnType = COMMENT; - } else if (stream.eat(/[tf]/i)) { // #t/#f (atom) - returnType = ATOM; - } else if (stream.eat(';')) { // S-Expr comment - state.mode = "s-expr-comment"; - returnType = COMMENT; - } else { - var numTest = null, hasExactness = false, hasRadix = true; - if (stream.eat(/[ei]/i)) { - hasExactness = true; - } else { - stream.backUp(1); // must be radix specifier - } - if (stream.match(/^#b/i)) { - numTest = isBinaryNumber; - } else if (stream.match(/^#o/i)) { - numTest = isOctalNumber; - } else if (stream.match(/^#x/i)) { - numTest = isHexNumber; - } else if (stream.match(/^#d/i)) { - numTest = isDecimalNumber; - } else if (stream.match(/^[-+0-9.]/, false)) { - hasRadix = false; - numTest = isDecimalNumber; - // re-consume the intial # if all matches failed - } else if (!hasExactness) { - stream.eat('#'); - } - if (numTest != null) { - if (hasRadix && !hasExactness) { - // consume optional exactness after radix - stream.match(/^#[ei]/i); - } - if (numTest(stream)) - returnType = NUMBER; - } - } - } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal - returnType = NUMBER; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - if(typeof state.sExprComment == "number") state.sExprComment++; - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - - if(typeof state.sExprComment == "number"){ - if(--state.sExprComment == 0){ - returnType = COMMENT; // final closing bracket - state.sExprComment = false; // turn off s-expr commenting mode - } - } - } - } else { - stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else returnType = "variable"; - } - } - return (typeof state.sExprComment == "number") ? COMMENT : returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - }, - - closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;" - }; -}); - -CodeMirror.defineMIME("text/x-scheme", "scheme"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/shell/index.html b/public/plugins/codemirror-5.17.0/mode/shell/index.html deleted file mode 100644 index 0b56300b1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/shell/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Shell mode - - - - - - - - - - -
-

Shell mode

- - - - - - -

MIME types defined: text/x-sh.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/shell/shell.js b/public/plugins/codemirror-5.17.0/mode/shell/shell.js deleted file mode 100644 index a684e8c23..000000000 --- a/public/plugins/codemirror-5.17.0/mode/shell/shell.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('shell', function() { - - var words = {}; - function define(style, string) { - var split = string.split(' '); - for(var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - }; - - // Atoms - define('atom', 'true false'); - - // Keywords - define('keyword', 'if then do else elif while until for in esac fi fin ' + - 'fil done exit set unset export function'); - - // Commands - define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + - 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + - 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + - 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + - 'touch vi vim wall wc wget who write yes zsh'); - - function tokenBase(stream, state) { - if (stream.eatSpace()) return null; - - var sol = stream.sol(); - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return null; - } - if (ch === '\'' || ch === '"' || ch === '`') { - state.tokens.unshift(tokenString(ch)); - return tokenize(stream, state); - } - if (ch === '#') { - if (sol && stream.eat('!')) { - stream.skipToEnd(); - return 'meta'; // 'comment'? - } - stream.skipToEnd(); - return 'comment'; - } - if (ch === '$') { - state.tokens.unshift(tokenDollar); - return tokenize(stream, state); - } - if (ch === '+' || ch === '=') { - return 'operator'; - } - if (ch === '-') { - stream.eat('-'); - stream.eatWhile(/\w/); - return 'attribute'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - if(stream.eol() || !/\w/.test(stream.peek())) { - return 'number'; - } - } - stream.eatWhile(/[\w-]/); - var cur = stream.current(); - if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; - return words.hasOwnProperty(cur) ? words[cur] : null; - } - - function tokenString(quote) { - return function(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === quote && !escaped) { - end = true; - break; - } - if (next === '$' && !escaped && quote !== '\'') { - escaped = true; - stream.backUp(1); - state.tokens.unshift(tokenDollar); - break; - } - escaped = !escaped && next === '\\'; - } - if (end || !escaped) { - state.tokens.shift(); - } - return (quote === '`' || quote === ')' ? 'quote' : 'string'); - }; - }; - - var tokenDollar = function(stream, state) { - if (state.tokens.length > 1) stream.eat('$'); - var ch = stream.next(), hungry = /\w/; - if (ch === '{') hungry = /[^}]/; - if (ch === '(') { - state.tokens[0] = tokenString(')'); - return tokenize(stream, state); - } - if (!/\d/.test(ch)) { - stream.eatWhile(hungry); - stream.eat('}'); - } - state.tokens.shift(); - return 'def'; - }; - - function tokenize(stream, state) { - return (state.tokens[0] || tokenBase) (stream, state); - }; - - return { - startState: function() {return {tokens:[]};}, - token: function(stream, state) { - return tokenize(stream, state); - }, - lineComment: '#', - fold: "brace" - }; -}); - -CodeMirror.defineMIME('text/x-sh', 'shell'); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/shell/test.js b/public/plugins/codemirror-5.17.0/mode/shell/test.js deleted file mode 100644 index a413b5a40..000000000 --- a/public/plugins/codemirror-5.17.0/mode/shell/test.js +++ /dev/null @@ -1,58 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({}, "shell"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("var", - "text [def $var] text"); - MT("varBraces", - "text[def ${var}]text"); - MT("varVar", - "text [def $a$b] text"); - MT("varBracesVarBraces", - "text[def ${a}${b}]text"); - - MT("singleQuotedVar", - "[string 'text $var text']"); - MT("singleQuotedVarBraces", - "[string 'text ${var} text']"); - - MT("doubleQuotedVar", - '[string "text ][def $var][string text"]'); - MT("doubleQuotedVarBraces", - '[string "text][def ${var}][string text"]'); - MT("doubleQuotedVarPunct", - '[string "text ][def $@][string text"]'); - MT("doubleQuotedVarVar", - '[string "][def $a$b][string "]'); - MT("doubleQuotedVarBracesVarBraces", - '[string "][def ${a}${b}][string "]'); - - MT("notAString", - "text\\'text"); - MT("escapes", - "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); - - MT("subshell", - "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); - MT("doubleQuotedSubshell", - "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); - - MT("hashbang", - "[meta #!/bin/bash]"); - MT("comment", - "text [comment # Blurb]"); - - MT("numbers", - "[number 0] [number 1] [number 2]"); - MT("keywords", - "[keyword while] [atom true]; [keyword do]", - " [builtin sleep] [number 3]", - "[keyword done]"); - MT("options", - "[builtin ls] [attribute -l] [attribute --human-readable]"); - MT("operator", - "[def var][operator =]value"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/sieve/index.html b/public/plugins/codemirror-5.17.0/mode/sieve/index.html deleted file mode 100644 index 6f029b623..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sieve/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - -CodeMirror: Sieve (RFC5228) mode - - - - - - - - - -
-

Sieve (RFC5228) mode

-
- - -

MIME types defined: application/sieve.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/sieve/sieve.js b/public/plugins/codemirror-5.17.0/mode/sieve/sieve.js deleted file mode 100644 index f67db2f55..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sieve/sieve.js +++ /dev/null @@ -1,193 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sieve", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = words("if elsif else stop require"); - var atoms = words("true false not"); - var indentUnit = config.indentUnit; - - function tokenBase(stream, state) { - - var ch = stream.next(); - if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - - if (ch === '#') { - stream.skipToEnd(); - return "comment"; - } - - if (ch == "\"") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - - if (ch == "(") { - state._indent.push("("); - // add virtual angel wings so that editor behaves... - // ...more sane incase of broken brackets - state._indent.push("{"); - return null; - } - - if (ch === "{") { - state._indent.push("{"); - return null; - } - - if (ch == ")") { - state._indent.pop(); - state._indent.pop(); - } - - if (ch === "}") { - state._indent.pop(); - return null; - } - - if (ch == ",") - return null; - - if (ch == ";") - return null; - - - if (/[{}\(\),;]/.test(ch)) - return null; - - // 1*DIGIT "K" / "M" / "G" - if (/\d/.test(ch)) { - stream.eatWhile(/[\d]/); - stream.eat(/[KkMmGg]/); - return "number"; - } - - // ":" (ALPHA / "_") *(ALPHA / DIGIT / "_") - if (ch == ":") { - stream.eatWhile(/[a-zA-Z_]/); - stream.eatWhile(/[a-zA-Z0-9_]/); - - return "operator"; - } - - stream.eatWhile(/\w/); - var cur = stream.current(); - - // "text:" *(SP / HTAB) (hash-comment / CRLF) - // *(multiline-literal / multiline-dotstart) - // "." CRLF - if ((cur == "text") && stream.eat(":")) - { - state.tokenize = tokenMultiLineString; - return "string"; - } - - if (keywords.propertyIsEnumerable(cur)) - return "keyword"; - - if (atoms.propertyIsEnumerable(cur)) - return "atom"; - - return null; - } - - function tokenMultiLineString(stream, state) - { - state._multiLineString = true; - // the first line is special it may contain a comment - if (!stream.sol()) { - stream.eatSpace(); - - if (stream.peek() == "#") { - stream.skipToEnd(); - return "comment"; - } - - stream.skipToEnd(); - return "string"; - } - - if ((stream.next() == ".") && (stream.eol())) - { - state._multiLineString = false; - state.tokenize = tokenBase; - } - - return "string"; - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return "string"; - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - _indent: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) - return null; - - return (state.tokenize || tokenBase)(stream, state);; - }, - - indent: function(state, _textAfter) { - var length = state._indent.length; - if (_textAfter && (_textAfter[0] == "}")) - length--; - - if (length <0) - length = 0; - - return length * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("application/sieve", "sieve"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/slim/index.html b/public/plugins/codemirror-5.17.0/mode/slim/index.html deleted file mode 100644 index 7fa4e50df..000000000 --- a/public/plugins/codemirror-5.17.0/mode/slim/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - -CodeMirror: SLIM mode - - - - - - - - - - - - - - - - - - - - -
-

SLIM mode

-
- - -

MIME types defined: application/x-slim.

- -

- Parsing/Highlighting Tests: - normal, - verbose. -

-
diff --git a/public/plugins/codemirror-5.17.0/mode/slim/slim.js b/public/plugins/codemirror-5.17.0/mode/slim/slim.js deleted file mode 100644 index 991a97efc..000000000 --- a/public/plugins/codemirror-5.17.0/mode/slim/slim.js +++ /dev/null @@ -1,575 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - - CodeMirror.defineMode("slim", function(config) { - var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); - var rubyMode = CodeMirror.getMode(config, "ruby"); - var modes = { html: htmlMode, ruby: rubyMode }; - var embedded = { - ruby: "ruby", - javascript: "javascript", - css: "text/css", - sass: "text/x-sass", - scss: "text/x-scss", - less: "text/x-less", - styl: "text/x-styl", // no highlighting so far - coffee: "coffeescript", - asciidoc: "text/x-asciidoc", - markdown: "text/x-markdown", - textile: "text/x-textile", // no highlighting so far - creole: "text/x-creole", // no highlighting so far - wiki: "text/x-wiki", // no highlighting so far - mediawiki: "text/x-mediawiki", // no highlighting so far - rdoc: "text/x-rdoc", // no highlighting so far - builder: "text/x-builder", // no highlighting so far - nokogiri: "text/x-nokogiri", // no highlighting so far - erb: "application/x-erb" - }; - var embeddedRegexp = function(map){ - var arr = []; - for(var key in map) arr.push(key); - return new RegExp("^("+arr.join('|')+"):"); - }(embedded); - - var styleMap = { - "commentLine": "comment", - "slimSwitch": "operator special", - "slimTag": "tag", - "slimId": "attribute def", - "slimClass": "attribute qualifier", - "slimAttribute": "attribute", - "slimSubmode": "keyword special", - "closeAttributeTag": null, - "slimDoctype": null, - "lineContinuation": null - }; - var closing = { - "{": "}", - "[": "]", - "(": ")" - }; - - var nameStartChar = "_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; - var nameChar = nameStartChar + "\\-0-9\xB7\u0300-\u036F\u203F-\u2040"; - var nameRegexp = new RegExp("^[:"+nameStartChar+"](?::["+nameChar+"]|["+nameChar+"]*)"); - var attributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*(?=\\s*=)"); - var wrappedAttributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*"); - var classNameRegexp = /^\.-?[_a-zA-Z]+[\w\-]*/; - var classIdRegexp = /^#[_a-zA-Z]+[\w\-]*/; - - function backup(pos, tokenize, style) { - var restore = function(stream, state) { - state.tokenize = tokenize; - if (stream.pos < pos) { - stream.pos = pos; - return style; - } - return state.tokenize(stream, state); - }; - return function(stream, state) { - state.tokenize = restore; - return tokenize(stream, state); - }; - } - - function maybeBackup(stream, state, pat, offset, style) { - var cur = stream.current(); - var idx = cur.search(pat); - if (idx > -1) { - state.tokenize = backup(stream.pos, state.tokenize, style); - stream.backUp(cur.length - idx - offset); - } - return style; - } - - function continueLine(state, column) { - state.stack = { - parent: state.stack, - style: "continuation", - indented: column, - tokenize: state.line - }; - state.line = state.tokenize; - } - function finishContinue(state) { - if (state.line == state.tokenize) { - state.line = state.stack.tokenize; - state.stack = state.stack.parent; - } - } - - function lineContinuable(column, tokenize) { - return function(stream, state) { - finishContinue(state); - if (stream.match(/^\\$/)) { - continueLine(state, column); - return "lineContinuation"; - } - var style = tokenize(stream, state); - if (stream.eol() && stream.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)) { - stream.backUp(1); - } - return style; - }; - } - function commaContinuable(column, tokenize) { - return function(stream, state) { - finishContinue(state); - var style = tokenize(stream, state); - if (stream.eol() && stream.current().match(/,$/)) { - continueLine(state, column); - } - return style; - }; - } - - function rubyInQuote(endQuote, tokenize) { - // TODO: add multi line support - return function(stream, state) { - var ch = stream.peek(); - if (ch == endQuote && state.rubyState.tokenize.length == 1) { - // step out of ruby context as it seems to complete processing all the braces - stream.next(); - state.tokenize = tokenize; - return "closeAttributeTag"; - } else { - return ruby(stream, state); - } - }; - } - function startRubySplat(tokenize) { - var rubyState; - var runSplat = function(stream, state) { - if (state.rubyState.tokenize.length == 1 && !state.rubyState.context.prev) { - stream.backUp(1); - if (stream.eatSpace()) { - state.rubyState = rubyState; - state.tokenize = tokenize; - return tokenize(stream, state); - } - stream.next(); - } - return ruby(stream, state); - }; - return function(stream, state) { - rubyState = state.rubyState; - state.rubyState = CodeMirror.startState(rubyMode); - state.tokenize = runSplat; - return ruby(stream, state); - }; - } - - function ruby(stream, state) { - return rubyMode.token(stream, state.rubyState); - } - - function htmlLine(stream, state) { - if (stream.match(/^\\$/)) { - return "lineContinuation"; - } - return html(stream, state); - } - function html(stream, state) { - if (stream.match(/^#\{/)) { - state.tokenize = rubyInQuote("}", state.tokenize); - return null; - } - return maybeBackup(stream, state, /[^\\]#\{/, 1, htmlMode.token(stream, state.htmlState)); - } - - function startHtmlLine(lastTokenize) { - return function(stream, state) { - var style = htmlLine(stream, state); - if (stream.eol()) state.tokenize = lastTokenize; - return style; - }; - } - - function startHtmlMode(stream, state, offset) { - state.stack = { - parent: state.stack, - style: "html", - indented: stream.column() + offset, // pipe + space - tokenize: state.line - }; - state.line = state.tokenize = html; - return null; - } - - function comment(stream, state) { - stream.skipToEnd(); - return state.stack.style; - } - - function commentMode(stream, state) { - state.stack = { - parent: state.stack, - style: "comment", - indented: state.indented + 1, - tokenize: state.line - }; - state.line = comment; - return comment(stream, state); - } - - function attributeWrapper(stream, state) { - if (stream.eat(state.stack.endQuote)) { - state.line = state.stack.line; - state.tokenize = state.stack.tokenize; - state.stack = state.stack.parent; - return null; - } - if (stream.match(wrappedAttributeNameRegexp)) { - state.tokenize = attributeWrapperAssign; - return "slimAttribute"; - } - stream.next(); - return null; - } - function attributeWrapperAssign(stream, state) { - if (stream.match(/^==?/)) { - state.tokenize = attributeWrapperValue; - return null; - } - return attributeWrapper(stream, state); - } - function attributeWrapperValue(stream, state) { - var ch = stream.peek(); - if (ch == '"' || ch == "\'") { - state.tokenize = readQuoted(ch, "string", true, false, attributeWrapper); - stream.next(); - return state.tokenize(stream, state); - } - if (ch == '[') { - return startRubySplat(attributeWrapper)(stream, state); - } - if (stream.match(/^(true|false|nil)\b/)) { - state.tokenize = attributeWrapper; - return "keyword"; - } - return startRubySplat(attributeWrapper)(stream, state); - } - - function startAttributeWrapperMode(state, endQuote, tokenize) { - state.stack = { - parent: state.stack, - style: "wrapper", - indented: state.indented + 1, - tokenize: tokenize, - line: state.line, - endQuote: endQuote - }; - state.line = state.tokenize = attributeWrapper; - return null; - } - - function sub(stream, state) { - if (stream.match(/^#\{/)) { - state.tokenize = rubyInQuote("}", state.tokenize); - return null; - } - var subStream = new CodeMirror.StringStream(stream.string.slice(state.stack.indented), stream.tabSize); - subStream.pos = stream.pos - state.stack.indented; - subStream.start = stream.start - state.stack.indented; - subStream.lastColumnPos = stream.lastColumnPos - state.stack.indented; - subStream.lastColumnValue = stream.lastColumnValue - state.stack.indented; - var style = state.subMode.token(subStream, state.subState); - stream.pos = subStream.pos + state.stack.indented; - return style; - } - function firstSub(stream, state) { - state.stack.indented = stream.column(); - state.line = state.tokenize = sub; - return state.tokenize(stream, state); - } - - function createMode(mode) { - var query = embedded[mode]; - var spec = CodeMirror.mimeModes[query]; - if (spec) { - return CodeMirror.getMode(config, spec); - } - var factory = CodeMirror.modes[query]; - if (factory) { - return factory(config, {name: query}); - } - return CodeMirror.getMode(config, "null"); - } - - function getMode(mode) { - if (!modes.hasOwnProperty(mode)) { - return modes[mode] = createMode(mode); - } - return modes[mode]; - } - - function startSubMode(mode, state) { - var subMode = getMode(mode); - var subState = CodeMirror.startState(subMode); - - state.subMode = subMode; - state.subState = subState; - - state.stack = { - parent: state.stack, - style: "sub", - indented: state.indented + 1, - tokenize: state.line - }; - state.line = state.tokenize = firstSub; - return "slimSubmode"; - } - - function doctypeLine(stream, _state) { - stream.skipToEnd(); - return "slimDoctype"; - } - - function startLine(stream, state) { - var ch = stream.peek(); - if (ch == '<') { - return (state.tokenize = startHtmlLine(state.tokenize))(stream, state); - } - if (stream.match(/^[|']/)) { - return startHtmlMode(stream, state, 1); - } - if (stream.match(/^\/(!|\[\w+])?/)) { - return commentMode(stream, state); - } - if (stream.match(/^(-|==?[<>]?)/)) { - state.tokenize = lineContinuable(stream.column(), commaContinuable(stream.column(), ruby)); - return "slimSwitch"; - } - if (stream.match(/^doctype\b/)) { - state.tokenize = doctypeLine; - return "keyword"; - } - - var m = stream.match(embeddedRegexp); - if (m) { - return startSubMode(m[1], state); - } - - return slimTag(stream, state); - } - - function slim(stream, state) { - if (state.startOfLine) { - return startLine(stream, state); - } - return slimTag(stream, state); - } - - function slimTag(stream, state) { - if (stream.eat('*')) { - state.tokenize = startRubySplat(slimTagExtras); - return null; - } - if (stream.match(nameRegexp)) { - state.tokenize = slimTagExtras; - return "slimTag"; - } - return slimClass(stream, state); - } - function slimTagExtras(stream, state) { - if (stream.match(/^(<>?|> state.indented && state.last != "slimSubmode") { - state.line = state.tokenize = state.stack.tokenize; - state.stack = state.stack.parent; - state.subMode = null; - state.subState = null; - } - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - state.startOfLine = false; - if (style) state.last = style; - return styleMap.hasOwnProperty(style) ? styleMap[style] : style; - }, - - blankLine: function(state) { - if (state.subMode && state.subMode.blankLine) { - return state.subMode.blankLine(state.subState); - } - }, - - innerMode: function(state) { - if (state.subMode) return {state: state.subState, mode: state.subMode}; - return {state: state, mode: mode}; - } - - //indent: function(state) { - // return state.indented; - //} - }; - return mode; - }, "htmlmixed", "ruby"); - - CodeMirror.defineMIME("text/x-slim", "slim"); - CodeMirror.defineMIME("application/x-slim", "slim"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/slim/test.js b/public/plugins/codemirror-5.17.0/mode/slim/test.js deleted file mode 100644 index be4ddacb6..000000000 --- a/public/plugins/codemirror-5.17.0/mode/slim/test.js +++ /dev/null @@ -1,96 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh - -(function() { - var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "slim"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Requires at least one media query - MT("elementName", - "[tag h1] Hey There"); - - MT("oneElementPerLine", - "[tag h1] Hey There .h2"); - - MT("idShortcut", - "[attribute&def #test] Hey There"); - - MT("tagWithIdShortcuts", - "[tag h1][attribute&def #test] Hey There"); - - MT("classShortcut", - "[attribute&qualifier .hello] Hey There"); - - MT("tagWithIdAndClassShortcuts", - "[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"); - - MT("docType", - "[keyword doctype] xml"); - - MT("comment", - "[comment / Hello WORLD]"); - - MT("notComment", - "[tag h1] This is not a / comment "); - - MT("attributes", - "[tag a]([attribute title]=[string \"test\"]) [attribute href]=[string \"link\"]}"); - - MT("multiLineAttributes", - "[tag a]([attribute title]=[string \"test\"]", - " ) [attribute href]=[string \"link\"]}"); - - MT("htmlCode", - "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); - - MT("rubyBlock", - "[operator&special =][variable-2 @item]"); - - MT("selectorRubyBlock", - "[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"); - - MT("nestedRubyBlock", - "[tag a]", - " [operator&special =][variable puts] [string \"test\"]"); - - MT("multilinePlaintext", - "[tag p]", - " | Hello,", - " World"); - - MT("multilineRuby", - "[tag p]", - " [comment /# this is a comment]", - " [comment and this is a comment too]", - " | Date/Time", - " [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]", - " [tag strong][operator&special =] [variable now]", - " [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", - " [operator&special =][string \"Happy\"]", - " [operator&special =][string \"Belated\"]", - " [operator&special =][string \"Birthday\"]"); - - MT("multilineComment", - "[comment /]", - " [comment Multiline]", - " [comment Comment]"); - - MT("hamlAfterRubyTag", - "[attribute&qualifier .block]", - " [tag strong][operator&special =] [variable now]", - " [attribute&qualifier .test]", - " [operator&special =][variable now]", - " [attribute&qualifier .right]"); - - MT("stretchedRuby", - "[operator&special =] [variable puts] [string \"Hello\"],", - " [string \"World\"]"); - - MT("interpolationInHashAttribute", - "[tag div]{[attribute id] = [string \"]#{[variable test]}[string _]#{[variable ting]}[string \"]} test"); - - MT("interpolationInHTMLAttribute", - "[tag div]([attribute title]=[string \"]#{[variable test]}[string _]#{[variable ting]()}[string \"]) Test"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/smalltalk/index.html b/public/plugins/codemirror-5.17.0/mode/smalltalk/index.html deleted file mode 100644 index 2155ebc2a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/smalltalk/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Smalltalk mode - - - - - - - - - - -
-

Smalltalk mode

-
- - - -

Simple Smalltalk mode.

- -

MIME types defined: text/x-stsrc.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/smalltalk/smalltalk.js b/public/plugins/codemirror-5.17.0/mode/smalltalk/smalltalk.js deleted file mode 100644 index bb510ba2e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/smalltalk/smalltalk.js +++ /dev/null @@ -1,168 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('smalltalk', function(config) { - - var specialChars = /[+\-\/\\*~<>=@%|&?!.,:;^]/; - var keywords = /true|false|nil|self|super|thisContext/; - - var Context = function(tokenizer, parent) { - this.next = tokenizer; - this.parent = parent; - }; - - var Token = function(name, context, eos) { - this.name = name; - this.context = context; - this.eos = eos; - }; - - var State = function() { - this.context = new Context(next, null); - this.expectVariable = true; - this.indentation = 0; - this.userIndentationDelta = 0; - }; - - State.prototype.userIndent = function(indentation) { - this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; - }; - - var next = function(stream, context, state) { - var token = new Token(null, context, false); - var aChar = stream.next(); - - if (aChar === '"') { - token = nextComment(stream, new Context(nextComment, context)); - - } else if (aChar === '\'') { - token = nextString(stream, new Context(nextString, context)); - - } else if (aChar === '#') { - if (stream.peek() === '\'') { - stream.next(); - token = nextSymbol(stream, new Context(nextSymbol, context)); - } else { - if (stream.eatWhile(/[^\s.{}\[\]()]/)) - token.name = 'string-2'; - else - token.name = 'meta'; - } - - } else if (aChar === '$') { - if (stream.next() === '<') { - stream.eatWhile(/[^\s>]/); - stream.next(); - } - token.name = 'string-2'; - - } else if (aChar === '|' && state.expectVariable) { - token.context = new Context(nextTemporaries, context); - - } else if (/[\[\]{}()]/.test(aChar)) { - token.name = 'bracket'; - token.eos = /[\[{(]/.test(aChar); - - if (aChar === '[') { - state.indentation++; - } else if (aChar === ']') { - state.indentation = Math.max(0, state.indentation - 1); - } - - } else if (specialChars.test(aChar)) { - stream.eatWhile(specialChars); - token.name = 'operator'; - token.eos = aChar !== ';'; // ; cascaded message expression - - } else if (/\d/.test(aChar)) { - stream.eatWhile(/[\w\d]/); - token.name = 'number'; - - } else if (/[\w_]/.test(aChar)) { - stream.eatWhile(/[\w\d_]/); - token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; - - } else { - token.eos = state.expectVariable; - } - - return token; - }; - - var nextComment = function(stream, context) { - stream.eatWhile(/[^"]/); - return new Token('comment', stream.eat('"') ? context.parent : context, true); - }; - - var nextString = function(stream, context) { - stream.eatWhile(/[^']/); - return new Token('string', stream.eat('\'') ? context.parent : context, false); - }; - - var nextSymbol = function(stream, context) { - stream.eatWhile(/[^']/); - return new Token('string-2', stream.eat('\'') ? context.parent : context, false); - }; - - var nextTemporaries = function(stream, context) { - var token = new Token(null, context, false); - var aChar = stream.next(); - - if (aChar === '|') { - token.context = context.parent; - token.eos = true; - - } else { - stream.eatWhile(/[^|]/); - token.name = 'variable'; - } - - return token; - }; - - return { - startState: function() { - return new State; - }, - - token: function(stream, state) { - state.userIndent(stream.indentation()); - - if (stream.eatSpace()) { - return null; - } - - var token = state.context.next(stream, state.context, state); - state.context = token.context; - state.expectVariable = token.eos; - - return token.name; - }, - - blankLine: function(state) { - state.userIndent(0); - }, - - indent: function(state, textAfter) { - var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; - return (state.indentation + i) * config.indentUnit; - }, - - electricChars: ']' - }; - -}); - -CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/smarty/index.html b/public/plugins/codemirror-5.17.0/mode/smarty/index.html deleted file mode 100644 index b19c8f09b..000000000 --- a/public/plugins/codemirror-5.17.0/mode/smarty/index.html +++ /dev/null @@ -1,138 +0,0 @@ - - -CodeMirror: Smarty mode - - - - - - - - - - -
-

Smarty mode

-
- -

Mode for Smarty version 2 or 3, which allows for custom delimiter tags.

- -

Several configuration parameters are supported:

- -
    -
  • leftDelimiter and rightDelimiter, - which should be strings that determine where the Smarty syntax - starts and ends.
  • -
  • version, which should be 2 or 3.
  • -
  • baseMode, which can be a mode spec - like "text/html" to set a different background mode.
  • -
- -

MIME types defined: text/x-smarty

- -

Smarty 2, custom delimiters

- -
- -

Smarty 3

- - - - - -
diff --git a/public/plugins/codemirror-5.17.0/mode/smarty/smarty.js b/public/plugins/codemirror-5.17.0/mode/smarty/smarty.js deleted file mode 100644 index 6e0fbed42..000000000 --- a/public/plugins/codemirror-5.17.0/mode/smarty/smarty.js +++ /dev/null @@ -1,225 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Smarty 2 and 3 mode. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("smarty", function(config, parserConf) { - var rightDelimiter = parserConf.rightDelimiter || "}"; - var leftDelimiter = parserConf.leftDelimiter || "{"; - var version = parserConf.version || 2; - var baseMode = CodeMirror.getMode(config, parserConf.baseMode || "null"); - - var keyFunctions = ["debug", "extends", "function", "include", "literal"]; - var regs = { - operatorChars: /[+\-*&%=<>!?]/, - validIdentifier: /[a-zA-Z0-9_]/, - stringChar: /['"]/ - }; - - var last; - function cont(style, lastType) { - last = lastType; - return style; - } - - function chain(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - } - - // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode - function doesNotCount(stream, pos) { - if (pos == null) pos = stream.pos; - return version === 3 && leftDelimiter == "{" && - (pos == stream.string.length || /\s/.test(stream.string.charAt(pos))); - } - - function tokenTop(stream, state) { - var string = stream.string; - for (var scan = stream.pos;;) { - var nextMatch = string.indexOf(leftDelimiter, scan); - scan = nextMatch + leftDelimiter.length; - if (nextMatch == -1 || !doesNotCount(stream, nextMatch + leftDelimiter.length)) break; - } - if (nextMatch == stream.pos) { - stream.match(leftDelimiter); - if (stream.eat("*")) { - return chain(stream, state, tokenBlock("comment", "*" + rightDelimiter)); - } else { - state.depth++; - state.tokenize = tokenSmarty; - last = "startTag"; - return "tag"; - } - } - - if (nextMatch > -1) stream.string = string.slice(0, nextMatch); - var token = baseMode.token(stream, state.base); - if (nextMatch > -1) stream.string = string; - return token; - } - - // parsing Smarty content - function tokenSmarty(stream, state) { - if (stream.match(rightDelimiter, true)) { - if (version === 3) { - state.depth--; - if (state.depth <= 0) { - state.tokenize = tokenTop; - } - } else { - state.tokenize = tokenTop; - } - return cont("tag", null); - } - - if (stream.match(leftDelimiter, true)) { - state.depth++; - return cont("tag", "startTag"); - } - - var ch = stream.next(); - if (ch == "$") { - stream.eatWhile(regs.validIdentifier); - return cont("variable-2", "variable"); - } else if (ch == "|") { - return cont("operator", "pipe"); - } else if (ch == ".") { - return cont("operator", "property"); - } else if (regs.stringChar.test(ch)) { - state.tokenize = tokenAttribute(ch); - return cont("string", "string"); - } else if (regs.operatorChars.test(ch)) { - stream.eatWhile(regs.operatorChars); - return cont("operator", "operator"); - } else if (ch == "[" || ch == "]") { - return cont("bracket", "bracket"); - } else if (ch == "(" || ch == ")") { - return cont("bracket", "operator"); - } else if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - return cont("number", "number"); - } else { - - if (state.last == "variable") { - if (ch == "@") { - stream.eatWhile(regs.validIdentifier); - return cont("property", "property"); - } else if (ch == "|") { - stream.eatWhile(regs.validIdentifier); - return cont("qualifier", "modifier"); - } - } else if (state.last == "pipe") { - stream.eatWhile(regs.validIdentifier); - return cont("qualifier", "modifier"); - } else if (state.last == "whitespace") { - stream.eatWhile(regs.validIdentifier); - return cont("attribute", "modifier"); - } if (state.last == "property") { - stream.eatWhile(regs.validIdentifier); - return cont("property", null); - } else if (/\s/.test(ch)) { - last = "whitespace"; - return null; - } - - var str = ""; - if (ch != "/") { - str += ch; - } - var c = null; - while (c = stream.eat(regs.validIdentifier)) { - str += c; - } - for (var i=0, j=keyFunctions.length; i - -CodeMirror: Solr mode - - - - - - - - - -
-

Solr mode

- -
- -
- - - -

MIME types defined: text/x-solr.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/solr/solr.js b/public/plugins/codemirror-5.17.0/mode/solr/solr.js deleted file mode 100644 index f7f708789..000000000 --- a/public/plugins/codemirror-5.17.0/mode/solr/solr.js +++ /dev/null @@ -1,104 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("solr", function() { - "use strict"; - - var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/; - var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/; - var isOperatorString = /^(OR|AND|NOT|TO)$/i; - - function isNumber(word) { - return parseFloat(word, 10).toString() === word; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - - if (!escaped) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenOperator(operator) { - return function(stream, state) { - var style = "operator"; - if (operator == "+") - style += " positive"; - else if (operator == "-") - style += " negative"; - else if (operator == "|") - stream.eat(/\|/); - else if (operator == "&") - stream.eat(/\&/); - else if (operator == "^") - style += " boost"; - - state.tokenize = tokenBase; - return style; - }; - } - - function tokenWord(ch) { - return function(stream, state) { - var word = ch; - while ((ch = stream.peek()) && ch.match(isStringChar) != null) { - word += stream.next(); - } - - state.tokenize = tokenBase; - if (isOperatorString.test(word)) - return "operator"; - else if (isNumber(word)) - return "number"; - else if (stream.peek() == ":") - return "field"; - else - return "string"; - }; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') - state.tokenize = tokenString(ch); - else if (isOperatorChar.test(ch)) - state.tokenize = tokenOperator(ch); - else if (isStringChar.test(ch)) - state.tokenize = tokenWord(ch); - - return (state.tokenize != tokenBase) ? state.tokenize(stream, state) : null; - } - - return { - startState: function() { - return { - tokenize: tokenBase - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/x-solr", "solr"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/soy/index.html b/public/plugins/codemirror-5.17.0/mode/soy/index.html deleted file mode 100644 index f0216f097..000000000 --- a/public/plugins/codemirror-5.17.0/mode/soy/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Soy (Closure Template) mode - - - - - - - - - - - - - - -
-

Soy (Closure Template) mode

-
- - - -

A mode for Closure Templates (Soy).

-

MIME type defined: text/x-soy.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/soy/soy.js b/public/plugins/codemirror-5.17.0/mode/soy/soy.js deleted file mode 100644 index 580c306f1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/soy/soy.js +++ /dev/null @@ -1,199 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var indentingTags = ["template", "literal", "msg", "fallbackmsg", "let", "if", "elseif", - "else", "switch", "case", "default", "foreach", "ifempty", "for", - "call", "param", "deltemplate", "delcall", "log"]; - - CodeMirror.defineMode("soy", function(config) { - var textMode = CodeMirror.getMode(config, "text/plain"); - var modes = { - html: CodeMirror.getMode(config, {name: "text/html", multilineTagIndentFactor: 2, multilineTagIndentPastTag: false}), - attributes: textMode, - text: textMode, - uri: textMode, - css: CodeMirror.getMode(config, "text/css"), - js: CodeMirror.getMode(config, {name: "text/javascript", statementIndent: 2 * config.indentUnit}) - }; - - function last(array) { - return array[array.length - 1]; - } - - function tokenUntil(stream, state, untilRegExp) { - var oldString = stream.string; - var match = untilRegExp.exec(oldString.substr(stream.pos)); - if (match) { - // We don't use backUp because it backs up just the position, not the state. - // This uses an undocumented API. - stream.string = oldString.substr(0, stream.pos + match.index); - } - var result = stream.hideFirstChars(state.indent, function() { - return state.localMode.token(stream, state.localState); - }); - stream.string = oldString; - return result; - } - - return { - startState: function() { - return { - kind: [], - kindTag: [], - soyState: [], - indent: 0, - localMode: modes.html, - localState: CodeMirror.startState(modes.html) - }; - }, - - copyState: function(state) { - return { - tag: state.tag, // Last seen Soy tag. - kind: state.kind.concat([]), // Values of kind="" attributes. - kindTag: state.kindTag.concat([]), // Opened tags with kind="" attributes. - soyState: state.soyState.concat([]), - indent: state.indent, // Indentation of the following line. - localMode: state.localMode, - localState: CodeMirror.copyState(state.localMode, state.localState) - }; - }, - - token: function(stream, state) { - var match; - - switch (last(state.soyState)) { - case "comment": - if (stream.match(/^.*?\*\//)) { - state.soyState.pop(); - } else { - stream.skipToEnd(); - } - return "comment"; - - case "variable": - if (stream.match(/^}/)) { - state.indent -= 2 * config.indentUnit; - state.soyState.pop(); - return "variable-2"; - } - stream.next(); - return null; - - case "tag": - if (stream.match(/^\/?}/)) { - if (state.tag == "/template" || state.tag == "/deltemplate") state.indent = 0; - else state.indent -= (stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1) * config.indentUnit; - state.soyState.pop(); - return "keyword"; - } else if (stream.match(/^([\w?]+)(?==)/)) { - if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) { - var kind = match[1]; - state.kind.push(kind); - state.kindTag.push(state.tag); - state.localMode = modes[kind] || modes.html; - state.localState = CodeMirror.startState(state.localMode); - } - return "attribute"; - } else if (stream.match(/^"/)) { - state.soyState.push("string"); - return "string"; - } - stream.next(); - return null; - - case "literal": - if (stream.match(/^(?=\{\/literal})/)) { - state.indent -= config.indentUnit; - state.soyState.pop(); - return this.token(stream, state); - } - return tokenUntil(stream, state, /\{\/literal}/); - - case "string": - var match = stream.match(/^.*?("|\\[\s\S])/); - if (!match) { - stream.skipToEnd(); - } else if (match[1] == "\"") { - state.soyState.pop(); - } - return "string"; - } - - if (stream.match(/^\/\*/)) { - state.soyState.push("comment"); - return "comment"; - } else if (stream.match(stream.sol() ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) { - return "comment"; - } else if (stream.match(/^\{\$[\w?]*/)) { - state.indent += 2 * config.indentUnit; - state.soyState.push("variable"); - return "variable-2"; - } else if (stream.match(/^\{literal}/)) { - state.indent += config.indentUnit; - state.soyState.push("literal"); - return "keyword"; - } else if (match = stream.match(/^\{([\/@\\]?[\w?]*)/)) { - if (match[1] != "/switch") - state.indent += (/^(\/|(else|elseif|case|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit; - state.tag = match[1]; - if (state.tag == "/" + last(state.kindTag)) { - // We found the tag that opened the current kind="". - state.kind.pop(); - state.kindTag.pop(); - state.localMode = modes[last(state.kind)] || modes.html; - state.localState = CodeMirror.startState(state.localMode); - } - state.soyState.push("tag"); - return "keyword"; - } - - return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/); - }, - - indent: function(state, textAfter) { - var indent = state.indent, top = last(state.soyState); - if (top == "comment") return CodeMirror.Pass; - - if (top == "literal") { - if (/^\{\/literal}/.test(textAfter)) indent -= config.indentUnit; - } else { - if (/^\s*\{\/(template|deltemplate)\b/.test(textAfter)) return 0; - if (/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(textAfter)) indent -= config.indentUnit; - if (state.tag != "switch" && /^\{(case|default)\b/.test(textAfter)) indent -= config.indentUnit; - if (/^\{\/switch\b/.test(textAfter)) indent -= config.indentUnit; - } - if (indent && state.localMode.indent) - indent += state.localMode.indent(state.localState, textAfter); - return indent; - }, - - innerMode: function(state) { - if (state.soyState.length && last(state.soyState) != "literal") return null; - else return {state: state.localState, mode: state.localMode}; - }, - - electricInput: /^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/, - lineComment: "//", - blockCommentStart: "/*", - blockCommentEnd: "*/", - blockCommentContinue: " * ", - fold: "indent" - }; - }, "htmlmixed"); - - CodeMirror.registerHelper("hintWords", "soy", indentingTags.concat( - ["delpackage", "namespace", "alias", "print", "css", "debugger"])); - - CodeMirror.defineMIME("text/x-soy", "soy"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/sparql/index.html b/public/plugins/codemirror-5.17.0/mode/sparql/index.html deleted file mode 100644 index 84ef4d363..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sparql/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: SPARQL mode - - - - - - - - - - -
-

SPARQL mode

-
- - -

MIME types defined: application/sparql-query.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/sparql/sparql.js b/public/plugins/codemirror-5.17.0/mode/sparql/sparql.js deleted file mode 100644 index 095dcca65..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sparql/sparql.js +++ /dev/null @@ -1,180 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sparql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "iri", "uri", "bnode", "count", "sum", "min", "max", "avg", "sample", - "group_concat", "rand", "abs", "ceil", "floor", "round", "concat", "substr", "strlen", - "replace", "ucase", "lcase", "encode_for_uri", "contains", "strstarts", "strends", - "strbefore", "strafter", "year", "month", "day", "hours", "minutes", "seconds", - "timezone", "tz", "now", "uuid", "struuid", "md5", "sha1", "sha256", "sha384", - "sha512", "coalesce", "if", "strlang", "strdt", "isnumeric", "regex", "exists", - "isblank", "isliteral", "a", "bind"]); - var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", - "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", - "graph", "by", "asc", "desc", "as", "having", "undef", "values", "group", - "minus", "in", "not", "service", "silent", "using", "insert", "delete", "union", - "true", "false", "with", - "data", "copy", "to", "move", "add", "create", "drop", "clear", "load"]); - var operatorChars = /[*+\-<>=&|\^\/!\?]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - if(ch == "?" && stream.match(/\s/, false)){ - return "operator"; - } - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return "bracket"; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return "operator"; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else if (ch == "@") { - stream.eatWhile(/[a-z\d\-]/i); - return "meta"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (ops.test(word)) - return "builtin"; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) { - popContext(state); - if (curPunc == "}" && state.context && state.context.type == "pattern") - popContext(state); - } - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - }, - - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("application/sparql-query", "sparql"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/spreadsheet/index.html b/public/plugins/codemirror-5.17.0/mode/spreadsheet/index.html deleted file mode 100644 index a52f76f05..000000000 --- a/public/plugins/codemirror-5.17.0/mode/spreadsheet/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - -CodeMirror: Spreadsheet mode - - - - - - - - - - -
-

Spreadsheet mode

-
- - - -

MIME types defined: text/x-spreadsheet.

- -

The Spreadsheet Mode

-

Created by Robert Plummer

-
diff --git a/public/plugins/codemirror-5.17.0/mode/spreadsheet/spreadsheet.js b/public/plugins/codemirror-5.17.0/mode/spreadsheet/spreadsheet.js deleted file mode 100644 index 222f29766..000000000 --- a/public/plugins/codemirror-5.17.0/mode/spreadsheet/spreadsheet.js +++ /dev/null @@ -1,112 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("spreadsheet", function () { - return { - startState: function () { - return { - stringType: null, - stack: [] - }; - }, - token: function (stream, state) { - if (!stream) return; - - //check for state changes - if (state.stack.length === 0) { - //strings - if ((stream.peek() == '"') || (stream.peek() == "'")) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.stack.unshift("string"); - } - } - - //return state - //stack has - switch (state.stack[0]) { - case "string": - while (state.stack[0] === "string" && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.stack.shift(); // Clear flag - } else if (stream.peek() === "\\") { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return "string"; - - case "characterClass": - while (state.stack[0] === "characterClass" && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) - state.stack.shift(); - } - return "operator"; - } - - var peek = stream.peek(); - - //no stack - switch (peek) { - case "[": - stream.next(); - state.stack.unshift("characterClass"); - return "bracket"; - case ":": - stream.next(); - return "operator"; - case "\\": - if (stream.match(/\\[a-z]+/)) return "string-2"; - else { - stream.next(); - return "atom"; - } - case ".": - case ",": - case ";": - case "*": - case "-": - case "+": - case "^": - case "<": - case "/": - case "=": - stream.next(); - return "atom"; - case "$": - stream.next(); - return "builtin"; - } - - if (stream.match(/\d+/)) { - if (stream.match(/^\w+/)) return "error"; - return "number"; - } else if (stream.match(/^[a-zA-Z_]\w*/)) { - if (stream.match(/(?=[\(.])/, false)) return "keyword"; - return "variable-2"; - } else if (["[", "]", "(", ")", "{", "}"].indexOf(peek) != -1) { - stream.next(); - return "bracket"; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; - }); - - CodeMirror.defineMIME("text/x-spreadsheet", "spreadsheet"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/sql/index.html b/public/plugins/codemirror-5.17.0/mode/sql/index.html deleted file mode 100644 index dba069dc8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sql/index.html +++ /dev/null @@ -1,86 +0,0 @@ - - -CodeMirror: SQL Mode for CodeMirror - - - - - - - - - - - - -
-

SQL Mode for CodeMirror

-
- - -

MIME types defined: - text/x-sql, - text/x-mysql, - text/x-mariadb, - text/x-cassandra, - text/x-plsql, - text/x-mssql, - text/x-hive, - text/x-pgsql, - text/x-gql. -

- - -
diff --git a/public/plugins/codemirror-5.17.0/mode/sql/sql.js b/public/plugins/codemirror-5.17.0/mode/sql/sql.js deleted file mode 100644 index 01ebd80ae..000000000 --- a/public/plugins/codemirror-5.17.0/mode/sql/sql.js +++ /dev/null @@ -1,413 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sql", function(config, parserConfig) { - "use strict"; - - var client = parserConfig.client || {}, - atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, - builtin = parserConfig.builtin || {}, - keywords = parserConfig.keywords || {}, - operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, - support = parserConfig.support || {}, - hooks = parserConfig.hooks || {}, - dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; - - function tokenBase(stream, state) { - var ch = stream.next(); - - // call hooks from the mime type - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - - if (support.hexNumber == true && - ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) - || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { - // hex - // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html - return "number"; - } else if (support.binaryNumber == true && - (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) - || (ch == "0" && stream.match(/^b[01]+/)))) { - // bitstring - // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html - return "number"; - } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { - // numbers - // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html - stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); - support.decimallessFloat == true && stream.eat('.'); - return "number"; - } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { - // placeholders - return "variable-3"; - } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { - // strings - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) - || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) - && (stream.peek() == "'" || stream.peek() == '"'))) { - // charset casting: _utf8'str', N'str', n'str' - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - return "keyword"; - } else if (/^[\(\),\;\[\]]/.test(ch)) { - // no highlighting - return null; - } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { - // 1-line comment - stream.skipToEnd(); - return "comment"; - } else if ((support.commentHash && ch == "#") - || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { - // 1-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - stream.skipToEnd(); - return "comment"; - } else if (ch == "/" && stream.eat("*")) { - // multi-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } else if (ch == ".") { - // .1 for 0.1 - if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) { - return "number"; - } - // .table_name (ODBC) - // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) { - return "variable-2"; - } - } else if (operatorChars.test(ch)) { - // operators - stream.eatWhile(operatorChars); - return null; - } else if (ch == '{' && - (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { - // dates (weird ODBC syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - return "number"; - } else { - stream.eatWhile(/^[_\w\d]/); - var word = stream.current().toLowerCase(); - // dates (standard SQL syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) - return "number"; - if (atoms.hasOwnProperty(word)) return "atom"; - if (builtin.hasOwnProperty(word)) return "builtin"; - if (keywords.hasOwnProperty(word)) return "keyword"; - if (client.hasOwnProperty(word)) return "string-2"; - return null; - } - } - - // 'string', with char specified in quote escaped by '\' - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - function tokenComment(stream, state) { - while (true) { - if (stream.skipTo("*")) { - stream.next(); - if (stream.eat("/")) { - state.tokenize = tokenBase; - break; - } - } else { - stream.skipToEnd(); - break; - } - } - return "comment"; - } - - function pushContext(stream, state, type) { - state.context = { - prev: state.context, - indent: stream.indentation(), - col: stream.column(), - type: type - }; - } - - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) - state.context.align = false; - } - if (stream.eatSpace()) return null; - - var style = state.tokenize(stream, state); - if (style == "comment") return style; - - if (state.context && state.context.align == null) - state.context.align = true; - - var tok = stream.current(); - if (tok == "(") - pushContext(stream, state, ")"); - else if (tok == "[") - pushContext(stream, state, "]"); - else if (state.context && state.context.type == tok) - popContext(state); - return style; - }, - - indent: function(state, textAfter) { - var cx = state.context; - if (!cx) return CodeMirror.Pass; - var closing = textAfter.charAt(0) == cx.type; - if (cx.align) return cx.col + (closing ? 0 : 1); - else return cx.indent + (closing ? 0 : config.indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null - }; -}); - -(function() { - "use strict"; - - // `identifier` - function hookIdentifier(stream) { - // MySQL/MariaDB identifiers - // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - var ch; - while ((ch = stream.next()) != null) { - if (ch == "`" && !stream.eat("`")) return "variable-2"; - } - stream.backUp(stream.current().length - 1); - return stream.eatWhile(/\w/) ? "variable-2" : null; - } - - // variable token - function hookVar(stream) { - // variables - // @@prefix.varName @varName - // varName can be quoted with ` or ' or " - // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html - if (stream.eat("@")) { - stream.match(/^session\./); - stream.match(/^local\./); - stream.match(/^global\./); - } - - if (stream.eat("'")) { - stream.match(/^.*'/); - return "variable-2"; - } else if (stream.eat('"')) { - stream.match(/^.*"/); - return "variable-2"; - } else if (stream.eat("`")) { - stream.match(/^.*`/); - return "variable-2"; - } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { - return "variable-2"; - } - return null; - }; - - // short client keyword token - function hookClient(stream) { - // \N means NULL - // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html - if (stream.eat("N")) { - return "atom"; - } - // \g, etc - // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html - return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; - } - - // these keywords are used by all SQL dialects (however, a mode can still overwrite it) - var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit "; - - // turn a space-separated list into an array - function set(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // A generic SQL Mode. It's not a standard, it just try to support what is generally supported - CodeMirror.defineMIME("text/x-sql", { - name: "sql", - keywords: set(sqlKeywords + "begin"), - builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); - - CodeMirror.defineMIME("text/x-mssql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"), - builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), - hooks: { - "@": hookVar - } - }); - - CodeMirror.defineMIME("text/x-mysql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - CodeMirror.defineMIME("text/x-mariadb", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - // the query language used by Apache Cassandra is called CQL, but this mime type - // is called Cassandra to avoid confusion with Contextual Query Language - CodeMirror.defineMIME("text/x-cassandra", { - name: "sql", - client: { }, - keywords: set("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"), - builtin: set("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"), - atoms: set("false true infinity NaN"), - operatorChars: /^[<>=]/, - dateSQL: { }, - support: set("commentSlashSlash decimallessFloat"), - hooks: { } - }); - - // this is based on Peter Raganitsch's 'plsql' mode - CodeMirror.defineMIME("text/x-plsql", { - name: "sql", - client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), - keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), - builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), - operatorChars: /^[*+\-%<>!=~]/, - dateSQL: set("date time timestamp"), - support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") - }); - - // Created to support specific hive keywords - CodeMirror.defineMIME("text/x-hive", { - name: "sql", - keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), - builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); - - CodeMirror.defineMIME("text/x-pgsql", { - name: "sql", - client: set("source"), - // http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html - keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"), - // http://www.postgresql.org/docs/9.5/static/datatype.html - builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast") - }); - - // Google's SQL-like query language, GQL - CodeMirror.defineMIME("text/x-gql", { - name: "sql", - keywords: set("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"), - atoms: set("false true"), - builtin: set("blob datetime first key __key__ string integer double boolean null"), - operatorChars: /^[*+\-%<>!=]/ - }); -}()); - -}); - -/* - How Properties of Mime Types are used by SQL Mode - ================================================= - - keywords: - A list of keywords you want to be highlighted. - builtin: - A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). - operatorChars: - All characters that must be handled as operators. - client: - Commands parsed and executed by the client (not the server). - support: - A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. - * ODBCdotTable: .tableName - * zerolessFloat: .1 - * doubleQuote - * nCharCast: N'string' - * charsetCast: _utf8'string' - * commentHash: use # char for comments - * commentSlashSlash: use // for comments - * commentSpaceRequired: require a space after -- for comments - atoms: - Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: - UNKNOWN, INFINITY, UNDERFLOW, NaN... - dateSQL: - Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. -*/ diff --git a/public/plugins/codemirror-5.17.0/mode/stex/index.html b/public/plugins/codemirror-5.17.0/mode/stex/index.html deleted file mode 100644 index 14679da4f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/stex/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - -CodeMirror: sTeX mode - - - - - - - - - -
-

sTeX mode

-
- - -

MIME types defined: text/x-stex.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/stex/stex.js b/public/plugins/codemirror-5.17.0/mode/stex/stex.js deleted file mode 100644 index 835ed46d1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/stex/stex.js +++ /dev/null @@ -1,251 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) - * Licence: MIT - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("stex", function() { - "use strict"; - - function pushCommand(state, command) { - state.cmdState.push(command); - } - - function peekCommand(state) { - if (state.cmdState.length > 0) { - return state.cmdState[state.cmdState.length - 1]; - } else { - return null; - } - } - - function popCommand(state) { - var plug = state.cmdState.pop(); - if (plug) { - plug.closeBracket(); - } - } - - // returns the non-default plugin closest to the end of the list - function getMostPowerful(state) { - var context = state.cmdState; - for (var i = context.length - 1; i >= 0; i--) { - var plug = context[i]; - if (plug.name == "DEFAULT") { - continue; - } - return plug; - } - return { styleIdentifier: function() { return null; } }; - } - - function addPluginPattern(pluginName, cmdStyle, styles) { - return function () { - this.name = pluginName; - this.bracketNo = 0; - this.style = cmdStyle; - this.styles = styles; - this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin - - this.styleIdentifier = function() { - return this.styles[this.bracketNo - 1] || null; - }; - this.openBracket = function() { - this.bracketNo++; - return "bracket"; - }; - this.closeBracket = function() {}; - }; - } - - var plugins = {}; - - plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]); - plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]); - plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]); - plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]); - plugins["end"] = addPluginPattern("end", "tag", ["atom"]); - - plugins["DEFAULT"] = function () { - this.name = "DEFAULT"; - this.style = "tag"; - - this.styleIdentifier = this.openBracket = this.closeBracket = function() {}; - }; - - function setState(state, f) { - state.f = f; - } - - // called when in a normal (no environment) context - function normal(source, state) { - var plug; - // Do we look like '\command' ? If so, attempt to apply the plugin 'command' - if (source.match(/^\\[a-zA-Z@]+/)) { - var cmdName = source.current().slice(1); - plug = plugins[cmdName] || plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - setState(state, beginParams); - return plug.style; - } - - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - - // white space control characters - if (source.match(/^\\[,;!\/\\]/)) { - return "tag"; - } - - // find if we're starting various math modes - if (source.match("\\[")) { - setState(state, function(source, state){ return inMathMode(source, state, "\\]"); }); - return "keyword"; - } - if (source.match("$$")) { - setState(state, function(source, state){ return inMathMode(source, state, "$$"); }); - return "keyword"; - } - if (source.match("$")) { - setState(state, function(source, state){ return inMathMode(source, state, "$"); }); - return "keyword"; - } - - var ch = source.next(); - if (ch == "%") { - source.skipToEnd(); - return "comment"; - } else if (ch == '}' || ch == ']') { - plug = peekCommand(state); - if (plug) { - plug.closeBracket(ch); - setState(state, beginParams); - } else { - return "error"; - } - return "bracket"; - } else if (ch == '{' || ch == '[') { - plug = plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - return "bracket"; - } else if (/\d/.test(ch)) { - source.eatWhile(/[\w.%]/); - return "atom"; - } else { - source.eatWhile(/[\w\-_]/); - plug = getMostPowerful(state); - if (plug.name == 'begin') { - plug.argument = source.current(); - } - return plug.styleIdentifier(); - } - } - - function inMathMode(source, state, endModeSeq) { - if (source.eatSpace()) { - return null; - } - if (source.match(endModeSeq)) { - setState(state, normal); - return "keyword"; - } - if (source.match(/^\\[a-zA-Z@]+/)) { - return "tag"; - } - if (source.match(/^[a-zA-Z]+/)) { - return "variable-2"; - } - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - // white space control characters - if (source.match(/^\\[,;!\/]/)) { - return "tag"; - } - // special math-mode characters - if (source.match(/^[\^_&]/)) { - return "tag"; - } - // non-special characters - if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) { - return null; - } - if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) { - return "number"; - } - var ch = source.next(); - if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") { - return "bracket"; - } - - if (ch == "%") { - source.skipToEnd(); - return "comment"; - } - return "error"; - } - - function beginParams(source, state) { - var ch = source.peek(), lastPlug; - if (ch == '{' || ch == '[') { - lastPlug = peekCommand(state); - lastPlug.openBracket(ch); - source.eat(ch); - setState(state, normal); - return "bracket"; - } - if (/[ \t\r]/.test(ch)) { - source.eat(ch); - return null; - } - setState(state, normal); - popCommand(state); - - return normal(source, state); - } - - return { - startState: function() { - return { - cmdState: [], - f: normal - }; - }, - copyState: function(s) { - return { - cmdState: s.cmdState.slice(), - f: s.f - }; - }, - token: function(stream, state) { - return state.f(stream, state); - }, - blankLine: function(state) { - state.f = normal; - state.cmdState.length = 0; - }, - lineComment: "%" - }; - }); - - CodeMirror.defineMIME("text/x-stex", "stex"); - CodeMirror.defineMIME("text/x-latex", "stex"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/stex/test.js b/public/plugins/codemirror-5.17.0/mode/stex/test.js deleted file mode 100644 index 22f027ec7..000000000 --- a/public/plugins/codemirror-5.17.0/mode/stex/test.js +++ /dev/null @@ -1,123 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "stex"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("word", - "foo"); - - MT("twoWords", - "foo bar"); - - MT("beginEndDocument", - "[tag \\begin][bracket {][atom document][bracket }]", - "[tag \\end][bracket {][atom document][bracket }]"); - - MT("beginEndEquation", - "[tag \\begin][bracket {][atom equation][bracket }]", - " E=mc^2", - "[tag \\end][bracket {][atom equation][bracket }]"); - - MT("beginModule", - "[tag \\begin][bracket {][atom module][bracket }[[]]]"); - - MT("beginModuleId", - "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); - - MT("importModule", - "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); - - MT("importModulePath", - "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); - - MT("psForPDF", - "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); - - MT("comment", - "[comment % foo]"); - - MT("tagComment", - "[tag \\item][comment % bar]"); - - MT("commentTag", - " [comment % \\item]"); - - MT("commentLineBreak", - "[comment %]", - "foo"); - - MT("tagErrorCurly", - "[tag \\begin][error }][bracket {]"); - - MT("tagErrorSquare", - "[tag \\item][error ]]][bracket {]"); - - MT("commentCurly", - "[comment % }]"); - - MT("tagHash", - "the [tag \\#] key"); - - MT("tagNumber", - "a [tag \\$][atom 5] stetson"); - - MT("tagPercent", - "[atom 100][tag \\%] beef"); - - MT("tagAmpersand", - "L [tag \\&] N"); - - MT("tagUnderscore", - "foo[tag \\_]bar"); - - MT("tagBracketOpen", - "[tag \\emph][bracket {][tag \\{][bracket }]"); - - MT("tagBracketClose", - "[tag \\emph][bracket {][tag \\}][bracket }]"); - - MT("tagLetterNumber", - "section [tag \\S][atom 1]"); - - MT("textTagNumber", - "para [tag \\P][atom 2]"); - - MT("thinspace", - "x[tag \\,]y"); - - MT("thickspace", - "x[tag \\;]y"); - - MT("negativeThinspace", - "x[tag \\!]y"); - - MT("periodNotSentence", - "J.\\ L.\\ is"); - - MT("periodSentence", - "X[tag \\@]. The"); - - MT("italicCorrection", - "[bracket {][tag \\em] If[tag \\/][bracket }] I"); - - MT("tagBracket", - "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); - - MT("inlineMathTagFollowedByNumber", - "[keyword $][tag \\pi][number 2][keyword $]"); - - MT("inlineMath", - "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); - - MT("displayMath", - "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); - - MT("mathWithComment", - "[keyword $][variable-2 x] [comment % $]", - "[variable-2 y][keyword $] other text"); - - MT("lineBreakArgument", - "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/stylus/index.html b/public/plugins/codemirror-5.17.0/mode/stylus/index.html deleted file mode 100644 index 862c18f25..000000000 --- a/public/plugins/codemirror-5.17.0/mode/stylus/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - -CodeMirror: Stylus mode - - - - - - - - - - - -
-

Stylus mode

-
- - - -

MIME types defined: text/x-styl.

-

Created by Dmitry Kiselyov

-
diff --git a/public/plugins/codemirror-5.17.0/mode/stylus/stylus.js b/public/plugins/codemirror-5.17.0/mode/stylus/stylus.js deleted file mode 100644 index 662cd03c0..000000000 --- a/public/plugins/codemirror-5.17.0/mode/stylus/stylus.js +++ /dev/null @@ -1,769 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Stylus mode created by Dmitry Kiselyov http://git.io/AaRB - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("stylus", function(config) { - var indentUnit = config.indentUnit, - tagKeywords = keySet(tagKeywords_), - tagVariablesRegexp = /^(a|b|i|s|col|em)$/i, - propertyKeywords = keySet(propertyKeywords_), - nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_), - valueKeywords = keySet(valueKeywords_), - colorKeywords = keySet(colorKeywords_), - documentTypes = keySet(documentTypes_), - documentTypesRegexp = wordRegexp(documentTypes_), - mediaFeatures = keySet(mediaFeatures_), - mediaTypes = keySet(mediaTypes_), - fontProperties = keySet(fontProperties_), - operatorsRegexp = /^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/, - wordOperatorKeywordsRegexp = wordRegexp(wordOperatorKeywords_), - blockKeywords = keySet(blockKeywords_), - vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/i), - commonAtoms = keySet(commonAtoms_), - firstWordMatch = "", - states = {}, - ch, - style, - type, - override; - - /** - * Tokenizers - */ - function tokenBase(stream, state) { - firstWordMatch = stream.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/); - state.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : ""; - state.context.line.indent = stream.indentation(); - ch = stream.peek(); - - // Line comment - if (stream.match("//")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } - // Block comment - if (stream.match("/*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - // String - if (ch == "\"" || ch == "'") { - stream.next(); - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - // Def - if (ch == "@") { - stream.next(); - stream.eatWhile(/[\w\\-]/); - return ["def", stream.current()]; - } - // ID selector or Hex color - if (ch == "#") { - stream.next(); - // Hex color - if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { - return ["atom", "atom"]; - } - // ID selector - if (stream.match(/^[a-z][\w-]*/i)) { - return ["builtin", "hash"]; - } - } - // Vendor prefixes - if (stream.match(vendorPrefixesRegexp)) { - return ["meta", "vendor-prefixes"]; - } - // Numbers - if (stream.match(/^-?[0-9]?\.?[0-9]/)) { - stream.eatWhile(/[a-z%]/i); - return ["number", "unit"]; - } - // !important|optional - if (ch == "!") { - stream.next(); - return [stream.match(/^(important|optional)/i) ? "keyword": "operator", "important"]; - } - // Class - if (ch == "." && stream.match(/^\.[a-z][\w-]*/i)) { - return ["qualifier", "qualifier"]; - } - // url url-prefix domain regexp - if (stream.match(documentTypesRegexp)) { - if (stream.peek() == "(") state.tokenize = tokenParenthesized; - return ["property", "word"]; - } - // Mixins / Functions - if (stream.match(/^[a-z][\w-]*\(/i)) { - stream.backUp(1); - return ["keyword", "mixin"]; - } - // Block mixins - if (stream.match(/^(\+|-)[a-z][\w-]*\(/i)) { - stream.backUp(1); - return ["keyword", "block-mixin"]; - } - // Parent Reference BEM naming - if (stream.string.match(/^\s*&/) && stream.match(/^[-_]+[a-z][\w-]*/)) { - return ["qualifier", "qualifier"]; - } - // / Root Reference & Parent Reference - if (stream.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)) { - stream.backUp(1); - return ["variable-3", "reference"]; - } - if (stream.match(/^&{1}\s*$/)) { - return ["variable-3", "reference"]; - } - // Word operator - if (stream.match(wordOperatorKeywordsRegexp)) { - return ["operator", "operator"]; - } - // Word - if (stream.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)) { - // Variable - if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { - if (!wordIsTag(stream.current())) { - stream.match(/\./); - return ["variable-2", "variable-name"]; - } - } - return ["variable-2", "word"]; - } - // Operators - if (stream.match(operatorsRegexp)) { - return ["operator", stream.current()]; - } - // Delimiters - if (/[:;,{}\[\]\(\)]/.test(ch)) { - stream.next(); - return [null, ch]; - } - // Non-detected items - stream.next(); - return [null, null]; - } - - /** - * Token comment - */ - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return ["comment", "comment"]; - } - - /** - * Token string - */ - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - if (quote == ")") stream.backUp(1); - break; - } - escaped = !escaped && ch == "\\"; - } - if (ch == quote || !escaped && quote != ")") state.tokenize = null; - return ["string", "string"]; - }; - } - - /** - * Token parenthesized - */ - function tokenParenthesized(stream, state) { - stream.next(); // Must be "(" - if (!stream.match(/\s*[\"\')]/, false)) - state.tokenize = tokenString(")"); - else - state.tokenize = null; - return [null, "("]; - } - - /** - * Context management - */ - function Context(type, indent, prev, line) { - this.type = type; - this.indent = indent; - this.prev = prev; - this.line = line || {firstWord: "", indent: 0}; - } - - function pushContext(state, stream, type, indent) { - indent = indent >= 0 ? indent : indentUnit; - state.context = new Context(type, stream.indentation() + indent, state.context); - return type; - } - - function popContext(state, currentIndent) { - var contextIndent = state.context.indent - indentUnit; - currentIndent = currentIndent || false; - state.context = state.context.prev; - if (currentIndent) state.context.indent = contextIndent; - return state.context.type; - } - - function pass(type, stream, state) { - return states[state.context.type](type, stream, state); - } - - function popAndPass(type, stream, state, n) { - for (var i = n || 1; i > 0; i--) - state.context = state.context.prev; - return pass(type, stream, state); - } - - - /** - * Parser - */ - function wordIsTag(word) { - return word.toLowerCase() in tagKeywords; - } - - function wordIsProperty(word) { - word = word.toLowerCase(); - return word in propertyKeywords || word in fontProperties; - } - - function wordIsBlock(word) { - return word.toLowerCase() in blockKeywords; - } - - function wordIsVendorPrefix(word) { - return word.toLowerCase().match(vendorPrefixesRegexp); - } - - function wordAsValue(word) { - var wordLC = word.toLowerCase(); - var override = "variable-2"; - if (wordIsTag(word)) override = "tag"; - else if (wordIsBlock(word)) override = "block-keyword"; - else if (wordIsProperty(word)) override = "property"; - else if (wordLC in valueKeywords || wordLC in commonAtoms) override = "atom"; - else if (wordLC == "return" || wordLC in colorKeywords) override = "keyword"; - - // Font family - else if (word.match(/^[A-Z]/)) override = "string"; - return override; - } - - function typeIsBlock(type, stream) { - return ((endOfLine(stream) && (type == "{" || type == "]" || type == "hash" || type == "qualifier")) || type == "block-mixin"); - } - - function typeIsInterpolation(type, stream) { - return type == "{" && stream.match(/^\s*\$?[\w-]+/i, false); - } - - function typeIsPseudo(type, stream) { - return type == ":" && stream.match(/^[a-z-]+/, false); - } - - function startOfLine(stream) { - return stream.sol() || stream.string.match(new RegExp("^\\s*" + escapeRegExp(stream.current()))); - } - - function endOfLine(stream) { - return stream.eol() || stream.match(/^\s*$/, false); - } - - function firstWordOfLine(line) { - var re = /^\s*[-_]*[a-z0-9]+[\w-]*/i; - var result = typeof line == "string" ? line.match(re) : line.string.match(re); - return result ? result[0].replace(/^\s*/, "") : ""; - } - - - /** - * Block - */ - states.block = function(type, stream, state) { - if ((type == "comment" && startOfLine(stream)) || - (type == "," && endOfLine(stream)) || - type == "mixin") { - return pushContext(state, stream, "block", 0); - } - if (typeIsInterpolation(type, stream)) { - return pushContext(state, stream, "interpolation"); - } - if (endOfLine(stream) && type == "]") { - if (!/^\s*(\.|#|:|\[|\*|&)/.test(stream.string) && !wordIsTag(firstWordOfLine(stream))) { - return pushContext(state, stream, "block", 0); - } - } - if (typeIsBlock(type, stream, state)) { - return pushContext(state, stream, "block"); - } - if (type == "}" && endOfLine(stream)) { - return pushContext(state, stream, "block", 0); - } - if (type == "variable-name") { - if (stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/) || wordIsBlock(firstWordOfLine(stream))) { - return pushContext(state, stream, "variableName"); - } - else { - return pushContext(state, stream, "variableName", 0); - } - } - if (type == "=") { - if (!endOfLine(stream) && !wordIsBlock(firstWordOfLine(stream))) { - return pushContext(state, stream, "block", 0); - } - return pushContext(state, stream, "block"); - } - if (type == "*") { - if (endOfLine(stream) || stream.match(/\s*(,|\.|#|\[|:|{)/,false)) { - override = "tag"; - return pushContext(state, stream, "block"); - } - } - if (typeIsPseudo(type, stream)) { - return pushContext(state, stream, "pseudo"); - } - if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { - return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); - } - if (/@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { - return pushContext(state, stream, "keyframes"); - } - if (/@extends?/.test(type)) { - return pushContext(state, stream, "extend", 0); - } - if (type && type.charAt(0) == "@") { - - // Property Lookup - if (stream.indentation() > 0 && wordIsProperty(stream.current().slice(1))) { - override = "variable-2"; - return "block"; - } - if (/(@import|@require|@charset)/.test(type)) { - return pushContext(state, stream, "block", 0); - } - return pushContext(state, stream, "block"); - } - if (type == "reference" && endOfLine(stream)) { - return pushContext(state, stream, "block"); - } - if (type == "(") { - return pushContext(state, stream, "parens"); - } - - if (type == "vendor-prefixes") { - return pushContext(state, stream, "vendorPrefixes"); - } - if (type == "word") { - var word = stream.current(); - override = wordAsValue(word); - - if (override == "property") { - if (startOfLine(stream)) { - return pushContext(state, stream, "block", 0); - } else { - override = "atom"; - return "block"; - } - } - - if (override == "tag") { - - // tag is a css value - if (/embed|menu|pre|progress|sub|table/.test(word)) { - if (wordIsProperty(firstWordOfLine(stream))) { - override = "atom"; - return "block"; - } - } - - // tag is an attribute - if (stream.string.match(new RegExp("\\[\\s*" + word + "|" + word +"\\s*\\]"))) { - override = "atom"; - return "block"; - } - - // tag is a variable - if (tagVariablesRegexp.test(word)) { - if ((startOfLine(stream) && stream.string.match(/=/)) || - (!startOfLine(stream) && - !stream.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/) && - !wordIsTag(firstWordOfLine(stream)))) { - override = "variable-2"; - if (wordIsBlock(firstWordOfLine(stream))) return "block"; - return pushContext(state, stream, "block", 0); - } - } - - if (endOfLine(stream)) return pushContext(state, stream, "block"); - } - if (override == "block-keyword") { - override = "keyword"; - - // Postfix conditionals - if (stream.current(/(if|unless)/) && !startOfLine(stream)) { - return "block"; - } - return pushContext(state, stream, "block"); - } - if (word == "return") return pushContext(state, stream, "block", 0); - - // Placeholder selector - if (override == "variable-2" && stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)) { - return pushContext(state, stream, "block"); - } - } - return state.context.type; - }; - - - /** - * Parens - */ - states.parens = function(type, stream, state) { - if (type == "(") return pushContext(state, stream, "parens"); - if (type == ")") { - if (state.context.prev.type == "parens") { - return popContext(state); - } - if ((stream.string.match(/^[a-z][\w-]*\(/i) && endOfLine(stream)) || - wordIsBlock(firstWordOfLine(stream)) || - /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(firstWordOfLine(stream)) || - (!stream.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/) && - wordIsTag(firstWordOfLine(stream)))) { - return pushContext(state, stream, "block"); - } - if (stream.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/) || - stream.string.match(/^\s*(\(|\)|[0-9])/) || - stream.string.match(/^\s+[a-z][\w-]*\(/i) || - stream.string.match(/^\s+[\$-]?[a-z]/i)) { - return pushContext(state, stream, "block", 0); - } - if (endOfLine(stream)) return pushContext(state, stream, "block"); - else return pushContext(state, stream, "block", 0); - } - if (type && type.charAt(0) == "@" && wordIsProperty(stream.current().slice(1))) { - override = "variable-2"; - } - if (type == "word") { - var word = stream.current(); - override = wordAsValue(word); - if (override == "tag" && tagVariablesRegexp.test(word)) { - override = "variable-2"; - } - if (override == "property" || word == "to") override = "atom"; - } - if (type == "variable-name") { - return pushContext(state, stream, "variableName"); - } - if (typeIsPseudo(type, stream)) { - return pushContext(state, stream, "pseudo"); - } - return state.context.type; - }; - - - /** - * Vendor prefixes - */ - states.vendorPrefixes = function(type, stream, state) { - if (type == "word") { - override = "property"; - return pushContext(state, stream, "block", 0); - } - return popContext(state); - }; - - - /** - * Pseudo - */ - states.pseudo = function(type, stream, state) { - if (!wordIsProperty(firstWordOfLine(stream.string))) { - stream.match(/^[a-z-]+/); - override = "variable-3"; - if (endOfLine(stream)) return pushContext(state, stream, "block"); - return popContext(state); - } - return popAndPass(type, stream, state); - }; - - - /** - * atBlock - */ - states.atBlock = function(type, stream, state) { - if (type == "(") return pushContext(state, stream, "atBlock_parens"); - if (typeIsBlock(type, stream, state)) { - return pushContext(state, stream, "block"); - } - if (typeIsInterpolation(type, stream)) { - return pushContext(state, stream, "interpolation"); - } - if (type == "word") { - var word = stream.current().toLowerCase(); - if (/^(only|not|and|or)$/.test(word)) - override = "keyword"; - else if (documentTypes.hasOwnProperty(word)) - override = "tag"; - else if (mediaTypes.hasOwnProperty(word)) - override = "attribute"; - else if (mediaFeatures.hasOwnProperty(word)) - override = "property"; - else if (nonStandardPropertyKeywords.hasOwnProperty(word)) - override = "string-2"; - else override = wordAsValue(stream.current()); - if (override == "tag" && endOfLine(stream)) { - return pushContext(state, stream, "block"); - } - } - if (type == "operator" && /^(not|and|or)$/.test(stream.current())) { - override = "keyword"; - } - return state.context.type; - }; - - states.atBlock_parens = function(type, stream, state) { - if (type == "{" || type == "}") return state.context.type; - if (type == ")") { - if (endOfLine(stream)) return pushContext(state, stream, "block"); - else return pushContext(state, stream, "atBlock"); - } - if (type == "word") { - var word = stream.current().toLowerCase(); - override = wordAsValue(word); - if (/^(max|min)/.test(word)) override = "property"; - if (override == "tag") { - tagVariablesRegexp.test(word) ? override = "variable-2" : override = "atom"; - } - return state.context.type; - } - return states.atBlock(type, stream, state); - }; - - - /** - * Keyframes - */ - states.keyframes = function(type, stream, state) { - if (stream.indentation() == "0" && ((type == "}" && startOfLine(stream)) || type == "]" || type == "hash" - || type == "qualifier" || wordIsTag(stream.current()))) { - return popAndPass(type, stream, state); - } - if (type == "{") return pushContext(state, stream, "keyframes"); - if (type == "}") { - if (startOfLine(stream)) return popContext(state, true); - else return pushContext(state, stream, "keyframes"); - } - if (type == "unit" && /^[0-9]+\%$/.test(stream.current())) { - return pushContext(state, stream, "keyframes"); - } - if (type == "word") { - override = wordAsValue(stream.current()); - if (override == "block-keyword") { - override = "keyword"; - return pushContext(state, stream, "keyframes"); - } - } - if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { - return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); - } - if (type == "mixin") { - return pushContext(state, stream, "block", 0); - } - return state.context.type; - }; - - - /** - * Interpolation - */ - states.interpolation = function(type, stream, state) { - if (type == "{") popContext(state) && pushContext(state, stream, "block"); - if (type == "}") { - if (stream.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i) || - (stream.string.match(/^\s*[a-z]/i) && wordIsTag(firstWordOfLine(stream)))) { - return pushContext(state, stream, "block"); - } - if (!stream.string.match(/^(\{|\s*\&)/) || - stream.match(/\s*[\w-]/,false)) { - return pushContext(state, stream, "block", 0); - } - return pushContext(state, stream, "block"); - } - if (type == "variable-name") { - return pushContext(state, stream, "variableName", 0); - } - if (type == "word") { - override = wordAsValue(stream.current()); - if (override == "tag") override = "atom"; - } - return state.context.type; - }; - - - /** - * Extend/s - */ - states.extend = function(type, stream, state) { - if (type == "[" || type == "=") return "extend"; - if (type == "]") return popContext(state); - if (type == "word") { - override = wordAsValue(stream.current()); - return "extend"; - } - return popContext(state); - }; - - - /** - * Variable name - */ - states.variableName = function(type, stream, state) { - if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) { - if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2"; - return "variableName"; - } - return popAndPass(type, stream, state); - }; - - - return { - startState: function(base) { - return { - tokenize: null, - state: "block", - context: new Context("block", base || 0, null) - }; - }, - token: function(stream, state) { - if (!state.tokenize && stream.eatSpace()) return null; - style = (state.tokenize || tokenBase)(stream, state); - if (style && typeof style == "object") { - type = style[1]; - style = style[0]; - } - override = style; - state.state = states[state.state](type, stream, state); - return override; - }, - indent: function(state, textAfter, line) { - - var cx = state.context, - ch = textAfter && textAfter.charAt(0), - indent = cx.indent, - lineFirstWord = firstWordOfLine(textAfter), - lineIndent = line.length - line.replace(/^\s*/, "").length, - prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "", - prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent; - - if (cx.prev && - (ch == "}" && (cx.type == "block" || cx.type == "atBlock" || cx.type == "keyframes") || - ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || - ch == "{" && (cx.type == "at"))) { - indent = cx.indent - indentUnit; - cx = cx.prev; - } else if (!(/(\})/.test(ch))) { - if (/@|\$|\d/.test(ch) || - /^\{/.test(textAfter) || -/^\s*\/(\/|\*)/.test(textAfter) || - /^\s*\/\*/.test(prevLineFirstWord) || - /^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(textAfter) || -/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) || -/^return/.test(textAfter) || - wordIsBlock(lineFirstWord)) { - indent = lineIndent; - } else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) { - if (/\,\s*$/.test(prevLineFirstWord)) { - indent = prevLineIndent; - } else if (/^\s+/.test(line) && (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(prevLineFirstWord) || wordIsTag(prevLineFirstWord))) { - indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; - } else { - indent = lineIndent; - } - } else if (!/,\s*$/.test(line) && (wordIsVendorPrefix(lineFirstWord) || wordIsProperty(lineFirstWord))) { - if (wordIsBlock(prevLineFirstWord)) { - indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; - } else if (/^\{/.test(prevLineFirstWord)) { - indent = lineIndent <= prevLineIndent ? lineIndent : prevLineIndent + indentUnit; - } else if (wordIsVendorPrefix(prevLineFirstWord) || wordIsProperty(prevLineFirstWord)) { - indent = lineIndent >= prevLineIndent ? prevLineIndent : lineIndent; - } else if (/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(prevLineFirstWord) || - /=\s*$/.test(prevLineFirstWord) || - wordIsTag(prevLineFirstWord) || - /^\$[\w-\.\[\]\'\"]/.test(prevLineFirstWord)) { - indent = prevLineIndent + indentUnit; - } else { - indent = lineIndent; - } - } - } - return indent; - }, - electricChars: "}", - lineComment: "//", - fold: "indent" - }; - }); - - // developer.mozilla.org/en-US/docs/Web/HTML/Element - var tagKeywords_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi", "bdo","bgsound","blockquote","body","br","button","canvas","caption","cite", "code","col","colgroup","data","datalist","dd","del","details","dfn","div", "dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1", "h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe", "img","input","ins","kbd","keygen","label","legend","li","link","main","map", "mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes", "noscript","object","ol","optgroup","option","output","p","param","pre", "progress","q","rp","rt","ruby","s","samp","script","section","select", "small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track", "u","ul","var","video"]; - - // github.com/codemirror/CodeMirror/blob/master/mode/css/css.js - var documentTypes_ = ["domain", "regexp", "url", "url-prefix"]; - var mediaTypes_ = ["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]; - var mediaFeatures_ = ["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"]; - var propertyKeywords_ = ["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-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","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-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","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","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","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","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","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","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","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","font-smoothing","osx-font-smoothing"]; - var nonStandardPropertyKeywords_ = ["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"]; - var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]; - var colorKeywords_ = ["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"]; - var valueKeywords_ = ["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","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","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","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","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","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","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","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","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","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-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","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","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","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","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","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","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around"]; - - var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"], - blockKeywords_ = ["for","if","else","unless", "from", "to"], - commonAtoms_ = ["null","true","false","href","title","type","not-allowed","readonly","disabled"], - commonDef_ = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"]; - - var hintWords = tagKeywords_.concat(documentTypes_,mediaTypes_,mediaFeatures_, - propertyKeywords_,nonStandardPropertyKeywords_, - colorKeywords_,valueKeywords_,fontProperties_, - wordOperatorKeywords_,blockKeywords_, - commonAtoms_,commonDef_); - - function wordRegexp(words) { - words = words.sort(function(a,b){return b > a;}); - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - function keySet(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) keys[array[i]] = true; - return keys; - } - - function escapeRegExp(text) { - return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } - - CodeMirror.registerHelper("hintWords", "stylus", hintWords); - CodeMirror.defineMIME("text/x-styl", "stylus"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/swift/index.html b/public/plugins/codemirror-5.17.0/mode/swift/index.html deleted file mode 100644 index 109f3fdb0..000000000 --- a/public/plugins/codemirror-5.17.0/mode/swift/index.html +++ /dev/null @@ -1,88 +0,0 @@ - - -CodeMirror: Swift mode - - - - - - - - - - -
-

Swift mode

-
- - - -

A simple mode for Swift

- -

MIME types defined: text/x-swift (Swift code)

-
diff --git a/public/plugins/codemirror-5.17.0/mode/swift/swift.js b/public/plugins/codemirror-5.17.0/mode/swift/swift.js deleted file mode 100644 index 3c28ced32..000000000 --- a/public/plugins/codemirror-5.17.0/mode/swift/swift.js +++ /dev/null @@ -1,202 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Swift mode created by Michael Kaminsky https://github.com/mkaminsky11 - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") - mod(require("../../lib/codemirror")) - else if (typeof define == "function" && define.amd) - define(["../../lib/codemirror"], mod) - else - mod(CodeMirror) -})(function(CodeMirror) { - "use strict" - - function wordSet(words) { - var set = {} - for (var i = 0; i < words.length; i++) set[words[i]] = true - return set - } - - var keywords = wordSet(["var","let","class","deinit","enum","extension","func","import","init","protocol", - "static","struct","subscript","typealias","as","dynamicType","is","new","super", - "self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case", - "continue","default","do","else","fallthrough","if","in","for","return","switch", - "where","while","associativity","didSet","get","infix","inout","left","mutating", - "none","nonmutating","operator","override","postfix","precedence","prefix","right", - "set","unowned","weak","willSet"]) - var definingKeywords = wordSet(["var","let","class","enum","extension","func","import","protocol","struct", - "typealias","dynamicType","for"]) - var atoms = wordSet(["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null", - "this","super"]) - var types = wordSet(["String","bool","int","string","double","Double","Int","Float","float","public", - "private","extension"]) - var operators = "+-/*%=|&<>#" - var punc = ";,.(){}[]" - var number = /^-?(?:(?:[\d_]+\.[_\d]*|\.[_\d]+|0o[0-7_\.]+|0b[01_\.]+)(?:e-?[\d_]+)?|0x[\d_a-f\.]+(?:p-?[\d_]+)?)/i - var identifier = /^[_A-Za-z$][_A-Za-z$0-9]*/ - var property = /^[@\.][_A-Za-z$][_A-Za-z$0-9]*/ - var regexp = /^\/(?!\s)(?:\/\/)?(?:\\.|[^\/])+\// - - function tokenBase(stream, state, prev) { - if (stream.sol()) state.indented = stream.indentation() - if (stream.eatSpace()) return null - - var ch = stream.peek() - if (ch == "/") { - if (stream.match("//")) { - stream.skipToEnd() - return "comment" - } - if (stream.match("/*")) { - state.tokenize.push(tokenComment) - return tokenComment(stream, state) - } - if (stream.match(regexp)) return "string-2" - } - if (operators.indexOf(ch) > -1) { - stream.next() - return "operator" - } - if (punc.indexOf(ch) > -1) { - stream.next() - stream.match("..") - return "punctuation" - } - if (ch == '"' || ch == "'") { - stream.next() - var tokenize = tokenString(ch) - state.tokenize.push(tokenize) - return tokenize(stream, state) - } - - if (stream.match(number)) return "number" - if (stream.match(property)) return "property" - - if (stream.match(identifier)) { - var ident = stream.current() - if (keywords.hasOwnProperty(ident)) { - if (definingKeywords.hasOwnProperty(ident)) - state.prev = "define" - return "keyword" - } - if (types.hasOwnProperty(ident)) return "variable-2" - if (atoms.hasOwnProperty(ident)) return "atom" - if (prev == "define") return "def" - return "variable" - } - - stream.next() - return null - } - - function tokenUntilClosingParen() { - var depth = 0 - return function(stream, state, prev) { - var inner = tokenBase(stream, state, prev) - if (inner == "punctuation") { - if (stream.current() == "(") ++depth - else if (stream.current() == ")") { - if (depth == 0) { - stream.backUp(1) - state.tokenize.pop() - return state.tokenize[state.tokenize.length - 1](stream, state) - } - else --depth - } - } - return inner - } - } - - function tokenString(quote) { - return function(stream, state) { - var ch, escaped = false - while (ch = stream.next()) { - if (escaped) { - if (ch == "(") { - state.tokenize.push(tokenUntilClosingParen()) - return "string" - } - escaped = false - } else if (ch == quote) { - break - } else { - escaped = ch == "\\" - } - } - state.tokenize.pop() - return "string" - } - } - - function tokenComment(stream, state) { - stream.match(/^(?:[^*]|\*(?!\/))*/) - if (stream.match("*/")) state.tokenize.pop() - return "comment" - } - - function Context(prev, align, indented) { - this.prev = prev - this.align = align - this.indented = indented - } - - function pushContext(state, stream) { - var align = stream.match(/^\s*($|\/[\/\*])/, false) ? null : stream.column() + 1 - state.context = new Context(state.context, align, state.indented) - } - - function popContext(state) { - if (state.context) { - state.indented = state.context.indented - state.context = state.context.prev - } - } - - CodeMirror.defineMode("swift", function(config) { - return { - startState: function() { - return { - prev: null, - context: null, - indented: 0, - tokenize: [] - } - }, - - token: function(stream, state) { - var prev = state.prev - state.prev = null - var tokenize = state.tokenize[state.tokenize.length - 1] || tokenBase - var style = tokenize(stream, state, prev) - if (!style || style == "comment") state.prev = prev - else if (!state.prev) state.prev = style - - if (style == "punctuation") { - var bracket = /[\(\[\{]|([\]\)\}])/.exec(stream.current()) - if (bracket) (bracket[1] ? popContext : pushContext)(state, stream) - } - - return style - }, - - indent: function(state, textAfter) { - var cx = state.context - if (!cx) return 0 - var closing = /^[\]\}\)]/.test(textAfter) - if (cx.align != null) return cx.align - (closing ? 1 : 0) - return cx.indented + (closing ? 0 : config.indentUnit) - }, - - electricInput: /^\s*[\)\}\]]$/, - - lineComment: "//", - blockCommentStart: "/*", - blockCommentEnd: "*/" - } - }) - - CodeMirror.defineMIME("text/x-swift","swift") -}); diff --git a/public/plugins/codemirror-5.17.0/mode/tcl/index.html b/public/plugins/codemirror-5.17.0/mode/tcl/index.html deleted file mode 100644 index ce4ad3423..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tcl/index.html +++ /dev/null @@ -1,142 +0,0 @@ - - -CodeMirror: Tcl mode - - - - - - - - - - -
-

Tcl mode

-
- - -

MIME types defined: text/x-tcl.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/tcl/tcl.js b/public/plugins/codemirror-5.17.0/mode/tcl/tcl.js deleted file mode 100644 index 8c76d52ca..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tcl/tcl.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -//tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("tcl", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = parseWords("Tcl safe after append array auto_execok auto_import auto_load " + - "auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " + - "binary break catch cd close concat continue dde eof encoding error " + - "eval exec exit expr fblocked fconfigure fcopy file fileevent filename " + - "filename flush for foreach format gets glob global history http if " + - "incr info interp join lappend lindex linsert list llength load lrange " + - "lreplace lsearch lset lsort memory msgcat namespace open package parray " + - "pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " + - "registry regsub rename resource return scan seek set socket source split " + - "string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " + - "tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " + - "tclvars tell time trace unknown unset update uplevel upvar variable " + - "vwait"); - var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); - var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - if ((ch == '"' || ch == "'") && state.inParams) { - return chain(stream, state, tokenString(ch)); - } else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } else if (ch == "#") { - if (stream.eat("*")) - return chain(stream, state, tokenComment); - if (ch == "#" && stream.match(/ *\[ *\[/)) - return chain(stream, state, tokenUnparsed); - stream.skipToEnd(); - return "comment"; - } else if (ch == '"') { - stream.skipTo(/"/); - return "comment"; - } else if (ch == "$") { - stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); - stream.eatWhile(/}/); - state.beforeParams = true; - return "builtin"; - } else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "comment"; - } else { - stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); - var word = stream.current().toLowerCase(); - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - if (functions && functions.propertyIsEnumerable(word)) { - state.beforeParams = true; - return "keyword"; - } - return null; - } - } - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); -CodeMirror.defineMIME("text/x-tcl", "tcl"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/textile/index.html b/public/plugins/codemirror-5.17.0/mode/textile/index.html deleted file mode 100644 index 42b156b1e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/textile/index.html +++ /dev/null @@ -1,191 +0,0 @@ - - -CodeMirror: Textile mode - - - - - - - - - -
-

Textile mode

-
- - -

MIME types defined: text/x-textile.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/public/plugins/codemirror-5.17.0/mode/textile/test.js b/public/plugins/codemirror-5.17.0/mode/textile/test.js deleted file mode 100644 index 49cdaf9c9..000000000 --- a/public/plugins/codemirror-5.17.0/mode/textile/test.js +++ /dev/null @@ -1,417 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, 'textile'); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('simpleParagraphs', - 'Some text.', - '', - 'Some more text.'); - - /* - * Phrase Modifiers - */ - - MT('em', - 'foo [em _bar_]'); - - MT('emBoogus', - 'code_mirror'); - - MT('strong', - 'foo [strong *bar*]'); - - MT('strongBogus', - '3 * 3 = 9'); - - MT('italic', - 'foo [em __bar__]'); - - MT('italicBogus', - 'code__mirror'); - - MT('bold', - 'foo [strong **bar**]'); - - MT('boldBogus', - '3 ** 3 = 27'); - - MT('simpleLink', - '[link "CodeMirror":http://codemirror.net]'); - - MT('referenceLink', - '[link "CodeMirror":code_mirror]', - 'Normal Text.', - '[link [[code_mirror]]http://codemirror.net]'); - - MT('footCite', - 'foo bar[qualifier [[1]]]'); - - MT('footCiteBogus', - 'foo bar[[1a2]]'); - - MT('special-characters', - 'Registered [tag (r)], ' + - 'Trademark [tag (tm)], and ' + - 'Copyright [tag (c)] 2008'); - - MT('cite', - "A book is [keyword ??The Count of Monte Cristo??] by Dumas."); - - MT('additionAndDeletion', - 'The news networks declared [negative -Al Gore-] ' + - '[positive +George W. Bush+] the winner in Florida.'); - - MT('subAndSup', - 'f(x, n) = log [builtin ~4~] x [builtin ^n^]'); - - MT('spanAndCode', - 'A [quote %span element%] and [atom @code element@]'); - - MT('spanBogus', - 'Percentage 25% is not a span.'); - - MT('citeBogus', - 'Question? is not a citation.'); - - MT('codeBogus', - 'user@example.com'); - - MT('subBogus', - '~username'); - - MT('supBogus', - 'foo ^ bar'); - - MT('deletionBogus', - '3 - 3 = 0'); - - MT('additionBogus', - '3 + 3 = 6'); - - MT('image', - 'An image: [string !http://www.example.com/image.png!]'); - - MT('imageWithAltText', - 'An image: [string !http://www.example.com/image.png (Alt Text)!]'); - - MT('imageWithUrl', - 'An image: [string !http://www.example.com/image.png!:http://www.example.com/]'); - - /* - * Headers - */ - - MT('h1', - '[header&header-1 h1. foo]'); - - MT('h2', - '[header&header-2 h2. foo]'); - - MT('h3', - '[header&header-3 h3. foo]'); - - MT('h4', - '[header&header-4 h4. foo]'); - - MT('h5', - '[header&header-5 h5. foo]'); - - MT('h6', - '[header&header-6 h6. foo]'); - - MT('h7Bogus', - 'h7. foo'); - - MT('multipleHeaders', - '[header&header-1 h1. Heading 1]', - '', - 'Some text.', - '', - '[header&header-2 h2. Heading 2]', - '', - 'More text.'); - - MT('h1inline', - '[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]'); - - /* - * Lists - */ - - MT('ul', - 'foo', - 'bar', - '', - '[variable-2 * foo]', - '[variable-2 * bar]'); - - MT('ulNoBlank', - 'foo', - 'bar', - '[variable-2 * foo]', - '[variable-2 * bar]'); - - MT('ol', - 'foo', - 'bar', - '', - '[variable-2 # foo]', - '[variable-2 # bar]'); - - MT('olNoBlank', - 'foo', - 'bar', - '[variable-2 # foo]', - '[variable-2 # bar]'); - - MT('ulFormatting', - '[variable-2 * ][variable-2&em _foo_][variable-2 bar]', - '[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' + - '[variable-2&strong *][variable-2 bar]', - '[variable-2 * ][variable-2&strong *foo*][variable-2 bar]'); - - MT('olFormatting', - '[variable-2 # ][variable-2&em _foo_][variable-2 bar]', - '[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' + - '[variable-2&strong *][variable-2 bar]', - '[variable-2 # ][variable-2&strong *foo*][variable-2 bar]'); - - MT('ulNested', - '[variable-2 * foo]', - '[variable-3 ** bar]', - '[keyword *** bar]', - '[variable-2 **** bar]', - '[variable-3 ** bar]'); - - MT('olNested', - '[variable-2 # foo]', - '[variable-3 ## bar]', - '[keyword ### bar]', - '[variable-2 #### bar]', - '[variable-3 ## bar]'); - - MT('ulNestedWithOl', - '[variable-2 * foo]', - '[variable-3 ## bar]', - '[keyword *** bar]', - '[variable-2 #### bar]', - '[variable-3 ** bar]'); - - MT('olNestedWithUl', - '[variable-2 # foo]', - '[variable-3 ** bar]', - '[keyword ### bar]', - '[variable-2 **** bar]', - '[variable-3 ## bar]'); - - MT('definitionList', - '[number - coffee := Hot ][number&em _and_][number black]', - '', - 'Normal text.'); - - MT('definitionListSpan', - '[number - coffee :=]', - '', - '[number Hot ][number&em _and_][number black =:]', - '', - 'Normal text.'); - - MT('boo', - '[number - dog := woof woof]', - '[number - cat := meow meow]', - '[number - whale :=]', - '[number Whale noises.]', - '', - '[number Also, ][number&em _splashing_][number . =:]'); - - /* - * Attributes - */ - - MT('divWithAttribute', - '[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]'); - - MT('divWithAttributeAnd2emRightPadding', - '[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]'); - - MT('divWithClassAndId', - '[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]'); - - MT('paragraphWithCss', - 'p[attribute {color:red;}]. foo bar'); - - MT('paragraphNestedStyles', - 'p. [strong *foo ][strong&em _bar_][strong *]'); - - MT('paragraphWithLanguage', - 'p[attribute [[fr]]]. Parlez-vous français?'); - - MT('paragraphLeftAlign', - 'p[attribute <]. Left'); - - MT('paragraphRightAlign', - 'p[attribute >]. Right'); - - MT('paragraphRightAlign', - 'p[attribute =]. Center'); - - MT('paragraphJustified', - 'p[attribute <>]. Justified'); - - MT('paragraphWithLeftIndent1em', - 'p[attribute (]. Left'); - - MT('paragraphWithRightIndent1em', - 'p[attribute )]. Right'); - - MT('paragraphWithLeftIndent2em', - 'p[attribute ((]. Left'); - - MT('paragraphWithRightIndent2em', - 'p[attribute ))]. Right'); - - MT('paragraphWithLeftIndent3emRightIndent2em', - 'p[attribute ((())]. Right'); - - MT('divFormatting', - '[punctuation div. ][punctuation&strong *foo ]' + - '[punctuation&strong&em _bar_][punctuation&strong *]'); - - MT('phraseModifierAttributes', - 'p[attribute (my-class)]. This is a paragraph that has a class and' + - ' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' + - ' has an id.'); - - MT('linkWithClass', - '[link "(my-class). This is a link with class":http://redcloth.org]'); - - /* - * Layouts - */ - - MT('paragraphLayouts', - 'p. This is one paragraph.', - '', - 'p. This is another.'); - - MT('div', - '[punctuation div. foo bar]'); - - MT('pre', - '[operator pre. Text]'); - - MT('bq.', - '[bracket bq. foo bar]', - '', - 'Normal text.'); - - MT('footnote', - '[variable fn123. foo ][variable&strong *bar*]'); - - /* - * Spanning Layouts - */ - - MT('bq..ThenParagraph', - '[bracket bq.. foo bar]', - '', - '[bracket More quote.]', - 'p. Normal Text'); - - MT('bq..ThenH1', - '[bracket bq.. foo bar]', - '', - '[bracket More quote.]', - '[header&header-1 h1. Header Text]'); - - MT('bc..ThenParagraph', - '[atom bc.. # Some ruby code]', - '[atom obj = {foo: :bar}]', - '[atom puts obj]', - '', - '[atom obj[[:love]] = "*love*"]', - '[atom puts obj.love.upcase]', - '', - 'p. Normal text.'); - - MT('fn1..ThenParagraph', - '[variable fn1.. foo bar]', - '', - '[variable More.]', - 'p. Normal Text'); - - MT('pre..ThenParagraph', - '[operator pre.. foo bar]', - '', - '[operator More.]', - 'p. Normal Text'); - - /* - * Tables - */ - - MT('table', - '[variable-3&operator |_. name |_. age|]', - '[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]', - '[variable-3 |Florence| 6 |]', - '', - 'p. Normal text.'); - - MT('tableWithAttributes', - '[variable-3&operator |_. name |_. age|]', - '[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]', - '[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]'); - - /* - * HTML - */ - - MT('html', - '[comment
]', - '[comment
]', - '', - '[header&header-1 h1. Welcome]', - '', - '[variable-2 * Item one]', - '[variable-2 * Item two]', - '', - '[comment Example]', - '', - '[comment
]', - '[comment
]'); - - MT('inlineHtml', - 'I can use HTML directly in my [comment Textile].'); - - /* - * No-Textile - */ - - MT('notextile', - '[string-2 notextile. *No* formatting]'); - - MT('notextileInline', - 'Use [string-2 ==*asterisks*==] for [strong *strong*] text.'); - - MT('notextileWithPre', - '[operator pre. *No* formatting]'); - - MT('notextileWithSpanningPre', - '[operator pre.. *No* formatting]', - '', - '[operator *No* formatting]'); - - /* Only toggling phrases between non-word chars. */ - - MT('phrase-in-word', - 'foo_bar_baz'); - - MT('phrase-non-word', - '[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]'); - - MT('phrase-lone-dash', - 'foo - bar - baz'); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/textile/textile.js b/public/plugins/codemirror-5.17.0/mode/textile/textile.js deleted file mode 100644 index a6f757658..000000000 --- a/public/plugins/codemirror-5.17.0/mode/textile/textile.js +++ /dev/null @@ -1,469 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") { // CommonJS - mod(require("../../lib/codemirror")); - } else if (typeof define == "function" && define.amd) { // AMD - define(["../../lib/codemirror"], mod); - } else { // Plain browser env - mod(CodeMirror); - } -})(function(CodeMirror) { - "use strict"; - - var TOKEN_STYLES = { - addition: "positive", - attributes: "attribute", - bold: "strong", - cite: "keyword", - code: "atom", - definitionList: "number", - deletion: "negative", - div: "punctuation", - em: "em", - footnote: "variable", - footCite: "qualifier", - header: "header", - html: "comment", - image: "string", - italic: "em", - link: "link", - linkDefinition: "link", - list1: "variable-2", - list2: "variable-3", - list3: "keyword", - notextile: "string-2", - pre: "operator", - p: "property", - quote: "bracket", - span: "quote", - specialChar: "tag", - strong: "strong", - sub: "builtin", - sup: "builtin", - table: "variable-3", - tableHeading: "operator" - }; - - function startNewLine(stream, state) { - state.mode = Modes.newLayout; - state.tableHeading = false; - - if (state.layoutType === "definitionList" && state.spanningLayout && - stream.match(RE("definitionListEnd"), false)) - state.spanningLayout = false; - } - - function handlePhraseModifier(stream, state, ch) { - if (ch === "_") { - if (stream.eat("_")) - return togglePhraseModifier(stream, state, "italic", /__/, 2); - else - return togglePhraseModifier(stream, state, "em", /_/, 1); - } - - if (ch === "*") { - if (stream.eat("*")) { - return togglePhraseModifier(stream, state, "bold", /\*\*/, 2); - } - return togglePhraseModifier(stream, state, "strong", /\*/, 1); - } - - if (ch === "[") { - if (stream.match(/\d+\]/)) state.footCite = true; - return tokenStyles(state); - } - - if (ch === "(") { - var spec = stream.match(/^(r|tm|c)\)/); - if (spec) - return tokenStylesWith(state, TOKEN_STYLES.specialChar); - } - - if (ch === "<" && stream.match(/(\w+)[^>]+>[^<]+<\/\1>/)) - return tokenStylesWith(state, TOKEN_STYLES.html); - - if (ch === "?" && stream.eat("?")) - return togglePhraseModifier(stream, state, "cite", /\?\?/, 2); - - if (ch === "=" && stream.eat("=")) - return togglePhraseModifier(stream, state, "notextile", /==/, 2); - - if (ch === "-" && !stream.eat("-")) - return togglePhraseModifier(stream, state, "deletion", /-/, 1); - - if (ch === "+") - return togglePhraseModifier(stream, state, "addition", /\+/, 1); - - if (ch === "~") - return togglePhraseModifier(stream, state, "sub", /~/, 1); - - if (ch === "^") - return togglePhraseModifier(stream, state, "sup", /\^/, 1); - - if (ch === "%") - return togglePhraseModifier(stream, state, "span", /%/, 1); - - if (ch === "@") - return togglePhraseModifier(stream, state, "code", /@/, 1); - - if (ch === "!") { - var type = togglePhraseModifier(stream, state, "image", /(?:\([^\)]+\))?!/, 1); - stream.match(/^:\S+/); // optional Url portion - return type; - } - return tokenStyles(state); - } - - function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) { - var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null; - var charAfter = stream.peek(); - if (state[phraseModifier]) { - if ((!charAfter || /\W/.test(charAfter)) && charBefore && /\S/.test(charBefore)) { - var type = tokenStyles(state); - state[phraseModifier] = false; - return type; - } - } else if ((!charBefore || /\W/.test(charBefore)) && charAfter && /\S/.test(charAfter) && - stream.match(new RegExp("^.*\\S" + closeRE.source + "(?:\\W|$)"), false)) { - state[phraseModifier] = true; - state.mode = Modes.attributes; - } - return tokenStyles(state); - }; - - function tokenStyles(state) { - var disabled = textileDisabled(state); - if (disabled) return disabled; - - var styles = []; - if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]); - - styles = styles.concat(activeStyles( - state, "addition", "bold", "cite", "code", "deletion", "em", "footCite", - "image", "italic", "link", "span", "strong", "sub", "sup", "table", "tableHeading")); - - if (state.layoutType === "header") - styles.push(TOKEN_STYLES.header + "-" + state.header); - - return styles.length ? styles.join(" ") : null; - } - - function textileDisabled(state) { - var type = state.layoutType; - - switch(type) { - case "notextile": - case "code": - case "pre": - return TOKEN_STYLES[type]; - default: - if (state.notextile) - return TOKEN_STYLES.notextile + (type ? (" " + TOKEN_STYLES[type]) : ""); - return null; - } - } - - function tokenStylesWith(state, extraStyles) { - var disabled = textileDisabled(state); - if (disabled) return disabled; - - var type = tokenStyles(state); - if (extraStyles) - return type ? (type + " " + extraStyles) : extraStyles; - else - return type; - } - - function activeStyles(state) { - var styles = []; - for (var i = 1; i < arguments.length; ++i) { - if (state[arguments[i]]) - styles.push(TOKEN_STYLES[arguments[i]]); - } - return styles; - } - - function blankLine(state) { - var spanningLayout = state.spanningLayout, type = state.layoutType; - - for (var key in state) if (state.hasOwnProperty(key)) - delete state[key]; - - state.mode = Modes.newLayout; - if (spanningLayout) { - state.layoutType = type; - state.spanningLayout = true; - } - } - - var REs = { - cache: {}, - single: { - bc: "bc", - bq: "bq", - definitionList: /- [^(?::=)]+:=+/, - definitionListEnd: /.*=:\s*$/, - div: "div", - drawTable: /\|.*\|/, - foot: /fn\d+/, - header: /h[1-6]/, - html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/, - link: /[^"]+":\S/, - linkDefinition: /\[[^\s\]]+\]\S+/, - list: /(?:#+|\*+)/, - notextile: "notextile", - para: "p", - pre: "pre", - table: "table", - tableCellAttributes: /[\/\\]\d+/, - tableHeading: /\|_\./, - tableText: /[^"_\*\[\(\?\+~\^%@|-]+/, - text: /[^!"_=\*\[\(<\?\+~\^%@-]+/ - }, - attributes: { - align: /(?:<>|<|>|=)/, - selector: /\([^\(][^\)]+\)/, - lang: /\[[^\[\]]+\]/, - pad: /(?:\(+|\)+){1,2}/, - css: /\{[^\}]+\}/ - }, - createRe: function(name) { - switch (name) { - case "drawTable": - return REs.makeRe("^", REs.single.drawTable, "$"); - case "html": - return REs.makeRe("^", REs.single.html, "(?:", REs.single.html, ")*", "$"); - case "linkDefinition": - return REs.makeRe("^", REs.single.linkDefinition, "$"); - case "listLayout": - return REs.makeRe("^", REs.single.list, RE("allAttributes"), "*\\s+"); - case "tableCellAttributes": - return REs.makeRe("^", REs.choiceRe(REs.single.tableCellAttributes, - RE("allAttributes")), "+\\."); - case "type": - return REs.makeRe("^", RE("allTypes")); - case "typeLayout": - return REs.makeRe("^", RE("allTypes"), RE("allAttributes"), - "*\\.\\.?", "(\\s+|$)"); - case "attributes": - return REs.makeRe("^", RE("allAttributes"), "+"); - - case "allTypes": - return REs.choiceRe(REs.single.div, REs.single.foot, - REs.single.header, REs.single.bc, REs.single.bq, - REs.single.notextile, REs.single.pre, REs.single.table, - REs.single.para); - - case "allAttributes": - return REs.choiceRe(REs.attributes.selector, REs.attributes.css, - REs.attributes.lang, REs.attributes.align, REs.attributes.pad); - - default: - return REs.makeRe("^", REs.single[name]); - } - }, - makeRe: function() { - var pattern = ""; - for (var i = 0; i < arguments.length; ++i) { - var arg = arguments[i]; - pattern += (typeof arg === "string") ? arg : arg.source; - } - return new RegExp(pattern); - }, - choiceRe: function() { - var parts = [arguments[0]]; - for (var i = 1; i < arguments.length; ++i) { - parts[i * 2 - 1] = "|"; - parts[i * 2] = arguments[i]; - } - - parts.unshift("(?:"); - parts.push(")"); - return REs.makeRe.apply(null, parts); - } - }; - - function RE(name) { - return (REs.cache[name] || (REs.cache[name] = REs.createRe(name))); - } - - var Modes = { - newLayout: function(stream, state) { - if (stream.match(RE("typeLayout"), false)) { - state.spanningLayout = false; - return (state.mode = Modes.blockType)(stream, state); - } - var newMode; - if (!textileDisabled(state)) { - if (stream.match(RE("listLayout"), false)) - newMode = Modes.list; - else if (stream.match(RE("drawTable"), false)) - newMode = Modes.table; - else if (stream.match(RE("linkDefinition"), false)) - newMode = Modes.linkDefinition; - else if (stream.match(RE("definitionList"))) - newMode = Modes.definitionList; - else if (stream.match(RE("html"), false)) - newMode = Modes.html; - } - return (state.mode = (newMode || Modes.text))(stream, state); - }, - - blockType: function(stream, state) { - var match, type; - state.layoutType = null; - - if (match = stream.match(RE("type"))) - type = match[0]; - else - return (state.mode = Modes.text)(stream, state); - - if (match = type.match(RE("header"))) { - state.layoutType = "header"; - state.header = parseInt(match[0][1]); - } else if (type.match(RE("bq"))) { - state.layoutType = "quote"; - } else if (type.match(RE("bc"))) { - state.layoutType = "code"; - } else if (type.match(RE("foot"))) { - state.layoutType = "footnote"; - } else if (type.match(RE("notextile"))) { - state.layoutType = "notextile"; - } else if (type.match(RE("pre"))) { - state.layoutType = "pre"; - } else if (type.match(RE("div"))) { - state.layoutType = "div"; - } else if (type.match(RE("table"))) { - state.layoutType = "table"; - } - - state.mode = Modes.attributes; - return tokenStyles(state); - }, - - text: function(stream, state) { - if (stream.match(RE("text"))) return tokenStyles(state); - - var ch = stream.next(); - if (ch === '"') - return (state.mode = Modes.link)(stream, state); - return handlePhraseModifier(stream, state, ch); - }, - - attributes: function(stream, state) { - state.mode = Modes.layoutLength; - - if (stream.match(RE("attributes"))) - return tokenStylesWith(state, TOKEN_STYLES.attributes); - else - return tokenStyles(state); - }, - - layoutLength: function(stream, state) { - if (stream.eat(".") && stream.eat(".")) - state.spanningLayout = true; - - state.mode = Modes.text; - return tokenStyles(state); - }, - - list: function(stream, state) { - var match = stream.match(RE("list")); - state.listDepth = match[0].length; - var listMod = (state.listDepth - 1) % 3; - if (!listMod) - state.layoutType = "list1"; - else if (listMod === 1) - state.layoutType = "list2"; - else - state.layoutType = "list3"; - - state.mode = Modes.attributes; - return tokenStyles(state); - }, - - link: function(stream, state) { - state.mode = Modes.text; - if (stream.match(RE("link"))) { - stream.match(/\S+/); - return tokenStylesWith(state, TOKEN_STYLES.link); - } - return tokenStyles(state); - }, - - linkDefinition: function(stream, state) { - stream.skipToEnd(); - return tokenStylesWith(state, TOKEN_STYLES.linkDefinition); - }, - - definitionList: function(stream, state) { - stream.match(RE("definitionList")); - - state.layoutType = "definitionList"; - - if (stream.match(/\s*$/)) - state.spanningLayout = true; - else - state.mode = Modes.attributes; - - return tokenStyles(state); - }, - - html: function(stream, state) { - stream.skipToEnd(); - return tokenStylesWith(state, TOKEN_STYLES.html); - }, - - table: function(stream, state) { - state.layoutType = "table"; - return (state.mode = Modes.tableCell)(stream, state); - }, - - tableCell: function(stream, state) { - if (stream.match(RE("tableHeading"))) - state.tableHeading = true; - else - stream.eat("|"); - - state.mode = Modes.tableCellAttributes; - return tokenStyles(state); - }, - - tableCellAttributes: function(stream, state) { - state.mode = Modes.tableText; - - if (stream.match(RE("tableCellAttributes"))) - return tokenStylesWith(state, TOKEN_STYLES.attributes); - else - return tokenStyles(state); - }, - - tableText: function(stream, state) { - if (stream.match(RE("tableText"))) - return tokenStyles(state); - - if (stream.peek() === "|") { // end of cell - state.mode = Modes.tableCell; - return tokenStyles(state); - } - return handlePhraseModifier(stream, state, stream.next()); - } - }; - - CodeMirror.defineMode("textile", function() { - return { - startState: function() { - return { mode: Modes.newLayout }; - }, - token: function(stream, state) { - if (stream.sol()) startNewLine(stream, state); - return state.mode(stream, state); - }, - blankLine: blankLine - }; - }); - - CodeMirror.defineMIME("text/x-textile", "textile"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/tiddlywiki/index.html b/public/plugins/codemirror-5.17.0/mode/tiddlywiki/index.html deleted file mode 100644 index 77dd0457c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tiddlywiki/index.html +++ /dev/null @@ -1,154 +0,0 @@ - - -CodeMirror: TiddlyWiki mode - - - - - - - - - - - -
-

TiddlyWiki mode

- - -
- - - -

TiddlyWiki mode supports a single configuration.

- -

MIME types defined: text/x-tiddlywiki.

-
diff --git a/public/plugins/codemirror-5.17.0/mode/tiddlywiki/tiddlywiki.css b/public/plugins/codemirror-5.17.0/mode/tiddlywiki/tiddlywiki.css deleted file mode 100644 index 9a69b639f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tiddlywiki/tiddlywiki.css +++ /dev/null @@ -1,14 +0,0 @@ -span.cm-underlined { - text-decoration: underline; -} -span.cm-strikethrough { - text-decoration: line-through; -} -span.cm-brace { - color: #170; - font-weight: bold; -} -span.cm-table { - color: blue; - font-weight: bold; -} diff --git a/public/plugins/codemirror-5.17.0/mode/tiddlywiki/tiddlywiki.js b/public/plugins/codemirror-5.17.0/mode/tiddlywiki/tiddlywiki.js deleted file mode 100644 index 1a3b3bc68..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tiddlywiki/tiddlywiki.js +++ /dev/null @@ -1,308 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/*** - |''Name''|tiddlywiki.js| - |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| - |''Author''|PMario| - |''Version''|0.1.7| - |''Status''|''stable''| - |''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| - |''Documentation''|http://codemirror.tiddlyspace.com/| - |''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| - |''CoreVersion''|2.5.0| - |''Requires''|codemirror.js| - |''Keywords''|syntax highlighting color code mirror codemirror| - ! Info - CoreVersion parameter is needed for TiddlyWiki only! -***/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("tiddlywiki", function () { - // Tokenizer - var textwords = {}; - - var keywords = { - "allTags": true, "closeAll": true, "list": true, - "newJournal": true, "newTiddler": true, - "permaview": true, "saveChanges": true, - "search": true, "slider": true, "tabs": true, - "tag": true, "tagging": true, "tags": true, - "tiddler": true, "timeline": true, - "today": true, "version": true, "option": true, - "with": true, "filter": true - }; - - var isSpaceName = /[\w_\-]/i, - reHR = /^\-\-\-\-+$/, //
- reWikiCommentStart = /^\/\*\*\*$/, // /*** - reWikiCommentStop = /^\*\*\*\/$/, // ***/ - reBlockQuote = /^<<<$/, - - reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start - reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop - reXmlCodeStart = /^$/, // xml block start - reXmlCodeStop = /^$/, // xml stop - - reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start - reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop - - reUntilCodeStop = /.*?\}\}\}/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function tokenBase(stream, state) { - var sol = stream.sol(), ch = stream.peek(); - - state.block = false; // indicates the start of a code block. - - // check start of blocks - if (sol && /[<\/\*{}\-]/.test(ch)) { - if (stream.match(reCodeBlockStart)) { - state.block = true; - return chain(stream, state, twTokenCode); - } - if (stream.match(reBlockQuote)) - return 'quote'; - if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) - return 'comment'; - if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) - return 'comment'; - if (stream.match(reHR)) - return 'hr'; - } - - stream.next(); - if (sol && /[\/\*!#;:>|]/.test(ch)) { - if (ch == "!") { // tw header - stream.skipToEnd(); - return "header"; - } - if (ch == "*") { // tw list - stream.eatWhile('*'); - return "comment"; - } - if (ch == "#") { // tw numbered list - stream.eatWhile('#'); - return "comment"; - } - if (ch == ";") { // definition list, term - stream.eatWhile(';'); - return "comment"; - } - if (ch == ":") { // definition list, description - stream.eatWhile(':'); - return "comment"; - } - if (ch == ">") { // single line quote - stream.eatWhile(">"); - return "quote"; - } - if (ch == '|') - return 'header'; - } - - if (ch == '{' && stream.match(/\{\{/)) - return chain(stream, state, twTokenCode); - - // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch) && - /[ti]/i.test(stream.peek()) && - stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) - return "link"; - - // just a little string indicator, don't want to have the whole string covered - if (ch == '"') - return 'string'; - - if (ch == '~') // _no_ CamelCase indicator should be bold - return 'brace'; - - if (/[\[\]]/.test(ch) && stream.match(ch)) // check for [[..]] - return 'brace'; - - if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting - stream.eatWhile(isSpaceName); - return "link"; - } - - if (/\d/.test(ch)) { // numbers - stream.eatWhile(/\d/); - return "number"; - } - - if (ch == "/") { // tw invisible comment - if (stream.eat("%")) { - return chain(stream, state, twTokenComment); - } else if (stream.eat("/")) { // - return chain(stream, state, twTokenEm); - } - } - - if (ch == "_" && stream.eat("_")) // tw underline - return chain(stream, state, twTokenUnderline); - - // strikethrough and mdash handling - if (ch == "-" && stream.eat("-")) { - // if strikethrough looks ugly, change CSS. - if (stream.peek() != ' ') - return chain(stream, state, twTokenStrike); - // mdash - if (stream.peek() == ' ') - return 'brace'; - } - - if (ch == "'" && stream.eat("'")) // tw bold - return chain(stream, state, twTokenStrong); - - if (ch == "<" && stream.eat("<")) // tw macro - return chain(stream, state, twTokenMacro); - - // core macro handling - stream.eatWhile(/[\w\$_]/); - return textwords.propertyIsEnumerable(stream.current()) ? "keyword" : null - } - - // tw invisible comment - function twTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "%"); - } - return "comment"; - } - - // tw strong / bold - function twTokenStrong(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "'" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "'"); - } - return "strong"; - } - - // tw code - function twTokenCode(stream, state) { - var sb = state.block; - - if (sb && stream.current()) { - return "comment"; - } - - if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = tokenBase; - return "comment"; - } - - if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = tokenBase; - return "comment"; - } - - stream.next(); - return "comment"; - } - - // tw em / italic - function twTokenEm(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "/"); - } - return "em"; - } - - // tw underlined text - function twTokenUnderline(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "_" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "_"); - } - return "underlined"; - } - - // tw strike through text looks ugly - // change CSS if needed - function twTokenStrike(stream, state) { - var maybeEnd = false, ch; - - while (ch = stream.next()) { - if (ch == "-" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "-"); - } - return "strikethrough"; - } - - // macro - function twTokenMacro(stream, state) { - if (stream.current() == '<<') { - return 'macro'; - } - - var ch = stream.next(); - if (!ch) { - state.tokenize = tokenBase; - return null; - } - if (ch == ">") { - if (stream.peek() == '>') { - stream.next(); - state.tokenize = tokenBase; - return "macro"; - } - } - - stream.eatWhile(/[\w\$_]/); - return keywords.propertyIsEnumerable(stream.current()) ? "keyword" : null - } - - // Interface - return { - startState: function () { - return {tokenize: tokenBase}; - }, - - token: function (stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/tiki/index.html b/public/plugins/codemirror-5.17.0/mode/tiki/index.html deleted file mode 100644 index 091c5fb2a..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tiki/index.html +++ /dev/null @@ -1,95 +0,0 @@ - - -CodeMirror: Tiki wiki mode - - - - - - - - - - -
-

Tiki wiki mode

- - -
- - - -
diff --git a/public/plugins/codemirror-5.17.0/mode/tiki/tiki.css b/public/plugins/codemirror-5.17.0/mode/tiki/tiki.css deleted file mode 100644 index 1d8704c78..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tiki/tiki.css +++ /dev/null @@ -1,26 +0,0 @@ -.cm-tw-syntaxerror { - color: #FFF; - background-color: #900; -} - -.cm-tw-deleted { - text-decoration: line-through; -} - -.cm-tw-header5 { - font-weight: bold; -} -.cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ - padding-left: 10px; -} - -.cm-tw-box { - border-top-width: 0px !important; - border-style: solid; - border-width: 1px; - border-color: inherit; -} - -.cm-tw-underline { - text-decoration: underline; -} \ No newline at end of file diff --git a/public/plugins/codemirror-5.17.0/mode/tiki/tiki.js b/public/plugins/codemirror-5.17.0/mode/tiki/tiki.js deleted file mode 100644 index 5e05b1ff0..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tiki/tiki.js +++ /dev/null @@ -1,312 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('tiki', function(config) { - function inBlock(style, terminator, returnTokenizer) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - - if (returnTokenizer) state.tokenize = returnTokenizer; - - return style; - }; - } - - function inLine(style) { - return function(stream, state) { - while(!stream.eol()) { - stream.next(); - } - state.tokenize = inText; - return style; - }; - } - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var sol = stream.sol(); - var ch = stream.next(); - - //non start of line - switch (ch) { //switch is generally much faster than if, so it is used here - case "{": //plugin - stream.eat("/"); - stream.eatSpace(); - stream.eatWhile(/[^\s\u00a0=\"\'\/?(}]/); - state.tokenize = inPlugin; - return "tag"; - case "_": //bold - if (stream.eat("_")) - return chain(inBlock("strong", "__", inText)); - break; - case "'": //italics - if (stream.eat("'")) - return chain(inBlock("em", "''", inText)); - break; - case "(":// Wiki Link - if (stream.eat("(")) - return chain(inBlock("variable-2", "))", inText)); - break; - case "[":// Weblink - return chain(inBlock("variable-3", "]", inText)); - break; - case "|": //table - if (stream.eat("|")) - return chain(inBlock("comment", "||")); - break; - case "-": - if (stream.eat("=")) {//titleBar - return chain(inBlock("header string", "=-", inText)); - } else if (stream.eat("-")) {//deleted - return chain(inBlock("error tw-deleted", "--", inText)); - } - break; - case "=": //underline - if (stream.match("==")) - return chain(inBlock("tw-underline", "===", inText)); - break; - case ":": - if (stream.eat(":")) - return chain(inBlock("comment", "::")); - break; - case "^": //box - return chain(inBlock("tw-box", "^")); - break; - case "~": //np - if (stream.match("np~")) - return chain(inBlock("meta", "~/np~")); - break; - } - - //start of line types - if (sol) { - switch (ch) { - case "!": //header at start of line - if (stream.match('!!!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!')) { - return chain(inLine("header string")); - } else { - return chain(inLine("header string")); - } - break; - case "*": //unordered list line item, or
  • at start of line - case "#": //ordered list line item, or
  • at start of line - case "+": //ordered list line item, or
  • at start of line - return chain(inLine("tw-listitem bracket")); - break; - } - } - - //stream.eatWhile(/[&{]/); was eating up plugins, turned off to act less like html and more like tiki - return null; - } - - var indentUnit = config.indentUnit; - - // Return variables for tokenizers - var pluginName, type; - function inPlugin(stream, state) { - var ch = stream.next(); - var peek = stream.peek(); - - if (ch == "}") { - state.tokenize = inText; - //type = ch == ")" ? "endPlugin" : "selfclosePlugin"; inPlugin - return "tag"; - } else if (ch == "(" || ch == ")") { - return "bracket"; - } else if (ch == "=") { - type = "equals"; - - if (peek == ">") { - ch = stream.next(); - peek = stream.peek(); - } - - //here we detect values directly after equal character with no quotes - if (!/[\'\"]/.test(peek)) { - state.tokenize = inAttributeNoQuote(); - } - //end detect values - - return "operator"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - return state.tokenize(stream, state); - } else { - stream.eatWhile(/[^\s\u00a0=\"\'\/?]/); - return "keyword"; - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inPlugin; - break; - } - } - return "string"; - }; - } - - function inAttributeNoQuote() { - return function(stream, state) { - while (!stream.eol()) { - var ch = stream.next(); - var peek = stream.peek(); - if (ch == " " || ch == "," || /[ )}]/.test(peek)) { - state.tokenize = inPlugin; - break; - } - } - return "string"; -}; - } - -var curState, setStyle; -function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); -} - -function cont() { - pass.apply(null, arguments); - return true; -} - -function pushContext(pluginName, startOfLine) { - var noIndent = curState.context && curState.context.noIndent; - curState.context = { - prev: curState.context, - pluginName: pluginName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; -} - -function popContext() { - if (curState.context) curState.context = curState.context.prev; -} - -function element(type) { - if (type == "openPlugin") {curState.pluginName = pluginName; return cont(attributes, endplugin(curState.startOfLine));} - else if (type == "closePlugin") { - var err = false; - if (curState.context) { - err = curState.context.pluginName != pluginName; - popContext(); - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endcloseplugin(err)); - } - else if (type == "string") { - if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); - if (curState.tokenize == inText) popContext(); - return cont(); - } - else return cont(); -} - -function endplugin(startOfLine) { - return function(type) { - if ( - type == "selfclosePlugin" || - type == "endPlugin" - ) - return cont(); - if (type == "endPlugin") {pushContext(curState.pluginName, startOfLine); return cont();} - return cont(); - }; -} - -function endcloseplugin(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endPlugin") return cont(); - return pass(); - }; -} - -function attributes(type) { - if (type == "keyword") {setStyle = "attribute"; return cont(attributes);} - if (type == "equals") return cont(attvalue, attributes); - return pass(); -} -function attvalue(type) { - if (type == "keyword") {setStyle = "string"; return cont();} - if (type == "string") return cont(attvaluemaybe); - return pass(); -} -function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); -} -return { - startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, pluginName: null, context: null}; - }, - token: function(stream, state) { - if (stream.sol()) { - state.startOfLine = true; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - - setStyle = type = pluginName = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - curState = state; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } - } - state.startOfLine = false; - return setStyle || style; - }, - indent: function(state, textAfter) { - var context = state.context; - if (context && context.noIndent) return 0; - if (context && /^{\//.test(textAfter)) - context = context.prev; - while (context && !context.startOfLine) - context = context.prev; - if (context) return context.indent + indentUnit; - else return 0; - }, - electricChars: "/" - }; -}); - -CodeMirror.defineMIME("text/tiki", "tiki"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/toml/index.html b/public/plugins/codemirror-5.17.0/mode/toml/index.html deleted file mode 100644 index 90a2a0215..000000000 --- a/public/plugins/codemirror-5.17.0/mode/toml/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: TOML Mode - - - - - - - - - -
    -

    TOML Mode

    -
    - -

    The TOML Mode

    -

    Created by Forbes Lindesay.

    -

    MIME type defined: text/x-toml.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/toml/toml.js b/public/plugins/codemirror-5.17.0/mode/toml/toml.js deleted file mode 100644 index baeca1556..000000000 --- a/public/plugins/codemirror-5.17.0/mode/toml/toml.js +++ /dev/null @@ -1,88 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("toml", function () { - return { - startState: function () { - return { - inString: false, - stringType: "", - lhs: true, - inArray: 0 - }; - }, - token: function (stream, state) { - //check for state changes - if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.inString = true; // Update state - } - if (stream.sol() && state.inArray === 0) { - state.lhs = true; - } - //return state - if (state.inString) { - while (state.inString && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.inString = false; // Clear flag - } else if (stream.peek() === '\\') { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return state.lhs ? "property string" : "string"; // Token style - } else if (state.inArray && stream.peek() === ']') { - stream.next(); - state.inArray--; - return 'bracket'; - } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) { - stream.next();//skip closing ] - // array of objects has an extra open & close [] - if (stream.peek() === ']') stream.next(); - return "atom"; - } else if (stream.peek() === "#") { - stream.skipToEnd(); - return "comment"; - } else if (stream.eatSpace()) { - return null; - } else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) { - return "property"; - } else if (state.lhs && stream.peek() === "=") { - stream.next(); - state.lhs = false; - return null; - } else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) { - return 'atom'; //date - } else if (!state.lhs && (stream.match('true') || stream.match('false'))) { - return 'atom'; - } else if (!state.lhs && stream.peek() === '[') { - state.inArray++; - stream.next(); - return 'bracket'; - } else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) { - return 'number'; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; -}); - -CodeMirror.defineMIME('text/x-toml', 'toml'); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/tornado/index.html b/public/plugins/codemirror-5.17.0/mode/tornado/index.html deleted file mode 100644 index 8ee7ef56c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tornado/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - -CodeMirror: Tornado template mode - - - - - - - - - - - - -
    -

    Tornado template mode

    -
    - - - -

    Mode for HTML with embedded Tornado template markup.

    - -

    MIME types defined: text/x-tornado

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/tornado/tornado.js b/public/plugins/codemirror-5.17.0/mode/tornado/tornado.js deleted file mode 100644 index dbfbc3489..000000000 --- a/public/plugins/codemirror-5.17.0/mode/tornado/tornado.js +++ /dev/null @@ -1,68 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), - require("../../addon/mode/overlay")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", - "../../addon/mode/overlay"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("tornado:inner", function() { - var keywords = ["and","as","assert","autoescape","block","break","class","comment","context", - "continue","datetime","def","del","elif","else","end","escape","except", - "exec","extends","false","finally","for","from","global","if","import","in", - "include","is","json_encode","lambda","length","linkify","load","module", - "none","not","or","pass","print","put","raise","raw","return","self","set", - "squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"]; - keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - stream.eatWhile(/[^\{]/); - var ch = stream.next(); - if (ch == "{") { - if (ch = stream.eat(/\{|%|#/)) { - state.tokenize = inTag(ch); - return "tag"; - } - } - } - function inTag (close) { - if (close == "{") { - close = "}"; - } - return function (stream, state) { - var ch = stream.next(); - if ((ch == close) && stream.eat("}")) { - state.tokenize = tokenBase; - return "tag"; - } - if (stream.match(keywords)) { - return "keyword"; - } - return close == "#" ? "comment" : "string"; - }; - } - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; - }); - - CodeMirror.defineMode("tornado", function(config) { - var htmlBase = CodeMirror.getMode(config, "text/html"); - var tornadoInner = CodeMirror.getMode(config, "tornado:inner"); - return CodeMirror.overlayMode(htmlBase, tornadoInner); - }); - - CodeMirror.defineMIME("text/x-tornado", "tornado"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/troff/index.html b/public/plugins/codemirror-5.17.0/mode/troff/index.html deleted file mode 100644 index 7c5a54e54..000000000 --- a/public/plugins/codemirror-5.17.0/mode/troff/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - -CodeMirror: troff mode - - - - - - - - - - -
    -

    troff

    - - - - - - -

    MIME types defined: troff.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/troff/troff.js b/public/plugins/codemirror-5.17.0/mode/troff/troff.js deleted file mode 100644 index 86154b6e1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/troff/troff.js +++ /dev/null @@ -1,84 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) - define(["../../lib/codemirror"], mod); - else - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('troff', function() { - - var words = {}; - - function tokenBase(stream) { - if (stream.eatSpace()) return null; - - var sol = stream.sol(); - var ch = stream.next(); - - if (ch === '\\') { - if (stream.match('fB') || stream.match('fR') || stream.match('fI') || - stream.match('u') || stream.match('d') || - stream.match('%') || stream.match('&')) { - return 'string'; - } - if (stream.match('m[')) { - stream.skipTo(']'); - stream.next(); - return 'string'; - } - if (stream.match('s+') || stream.match('s-')) { - stream.eatWhile(/[\d-]/); - return 'string'; - } - if (stream.match('\(') || stream.match('*\(')) { - stream.eatWhile(/[\w-]/); - return 'string'; - } - return 'string'; - } - if (sol && (ch === '.' || ch === '\'')) { - if (stream.eat('\\') && stream.eat('\"')) { - stream.skipToEnd(); - return 'comment'; - } - } - if (sol && ch === '.') { - if (stream.match('B ') || stream.match('I ') || stream.match('R ')) { - return 'attribute'; - } - if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) { - stream.skipToEnd(); - return 'quote'; - } - if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) { - return 'attribute'; - } - } - stream.eatWhile(/[\w-]/); - var cur = stream.current(); - return words.hasOwnProperty(cur) ? words[cur] : null; - } - - function tokenize(stream, state) { - return (state.tokens[0] || tokenBase) (stream, state); - }; - - return { - startState: function() {return {tokens:[]};}, - token: function(stream, state) { - return tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME('text/troff', 'troff'); -CodeMirror.defineMIME('text/x-troff', 'troff'); -CodeMirror.defineMIME('application/x-troff', 'troff'); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/ttcn-cfg/index.html b/public/plugins/codemirror-5.17.0/mode/ttcn-cfg/index.html deleted file mode 100644 index 4a4cd4571..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ttcn-cfg/index.html +++ /dev/null @@ -1,115 +0,0 @@ - - -CodeMirror: TTCN-CFG mode - - - - - - - - -
    -

    TTCN-CFG example

    -
    - -
    - - -
    -

    Language: Testing and Test Control Notation - - Configuration files - (TTCN-CFG) -

    -

    MIME types defined: text/x-ttcn-cfg.

    - -
    -

    The development of this mode has been sponsored by Ericsson - .

    -

    Coded by Asmelash Tsegay Gebretsadkan

    -
    - diff --git a/public/plugins/codemirror-5.17.0/mode/ttcn-cfg/ttcn-cfg.js b/public/plugins/codemirror-5.17.0/mode/ttcn-cfg/ttcn-cfg.js deleted file mode 100644 index e10805119..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ttcn-cfg/ttcn-cfg.js +++ /dev/null @@ -1,214 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("ttcn-cfg", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {}, - externalCommands = parserConfig.externalCommands || {}, - multiLineStrings = parserConfig.multiLineStrings, - indentStatements = parserConfig.indentStatements !== false; - var isOperatorChar = /[\|]/; - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[:=]/.test(ch)) { - curPunc = ch; - return "punctuation"; - } - if (ch == "#"){ - stream.skipToEnd(); - return "comment"; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - if (ch == "["){ - stream.eatWhile(/[\w_\]]/); - return "number sectionTitle"; - } - - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (fileNCtrlMaskOptions.propertyIsEnumerable(cur)) - return "negative fileNCtrlMaskOptions"; - if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands"; - - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped){ - var afterNext = stream.peek(); - //look if the character if the quote is like the B in '10100010'B - if (afterNext){ - afterNext = afterNext.toLowerCase(); - if(afterNext == "b" || afterNext == "h" || afterNext == "o") - stream.next(); - } - end = true; break; - } - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && state.context.type == "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - //Interface - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":" || curPunc == ",") - && ctx.type == "statement"){ - popContext(state); - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") - && curPunc != ';') || (ctx.type == "statement" - && curPunc == "newstatement"))) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - electricChars: "{}", - lineComment: "#", - fold: "brace" - }; - }); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) - obj[words[i]] = true; - return obj; - } - - CodeMirror.defineMIME("text/x-ttcn-cfg", { - name: "ttcn-cfg", - keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" + - " TimeStampFormat LogEventTypes SourceInfoFormat" + - " LogEntityName LogSourceInfo DiskFullAction" + - " LogFileNumber LogFileSize MatchingHints Detailed" + - " Compact SubCategories Stack Single None Seconds" + - " DateTime Time Stop Error Retry Delete TCPPort KillTimer" + - " NumHCs UnixSocketsEnabled LocalAddress"), - fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" + - " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" + - " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" + - " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" + - " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" + - " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" + - " VERDICTOP DEFAULTOP TESTCASE ACTION USER" + - " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" + - " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" + - " DEBUG_ENCDEC DEBUG_TESTPORT" + - " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" + - " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" + - " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" + - " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" + - " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" + - " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" + - " FUNCTION_RND FUNCTION_UNQUALIFIED" + - " MATCHING_DONE MATCHING_MCSUCCESS" + - " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" + - " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" + - " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" + - " MATCHING_PMUNSUCC MATCHING_PROBLEM" + - " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" + - " PARALLEL_PORTCONN PARALLEL_PORTMAP" + - " PARALLEL_PTC PARALLEL_UNQUALIFIED" + - " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" + - " PORTEVENT_MCRECV PORTEVENT_MCSEND" + - " PORTEVENT_MMRECV PORTEVENT_MMSEND" + - " PORTEVENT_MQUEUE PORTEVENT_PCIN" + - " PORTEVENT_PCOUT PORTEVENT_PMIN" + - " PORTEVENT_PMOUT PORTEVENT_PQUEUE" + - " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" + - " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" + - " TESTCASE_FINISH TESTCASE_START" + - " TESTCASE_UNQUALIFIED TIMEROP_GUARD" + - " TIMEROP_READ TIMEROP_START TIMEROP_STOP" + - " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" + - " USER_UNQUALIFIED VERDICTOP_FINAL" + - " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" + - " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"), - externalCommands: words("BeginControlPart EndControlPart BeginTestCase" + - " EndTestCase"), - multiLineStrings: true - }); -}); \ No newline at end of file diff --git a/public/plugins/codemirror-5.17.0/mode/ttcn/index.html b/public/plugins/codemirror-5.17.0/mode/ttcn/index.html deleted file mode 100644 index f1ef81131..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ttcn/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - -CodeMirror: TTCN mode - - - - - - - - -
    -

    TTCN example

    -
    - -
    - - -
    -

    Language: Testing and Test Control Notation - (TTCN) -

    -

    MIME types defined: text/x-ttcn, - text/x-ttcn3, text/x-ttcnpp.

    -
    -

    The development of this mode has been sponsored by Ericsson - .

    -

    Coded by Asmelash Tsegay Gebretsadkan

    -
    - diff --git a/public/plugins/codemirror-5.17.0/mode/ttcn/ttcn.js b/public/plugins/codemirror-5.17.0/mode/ttcn/ttcn.js deleted file mode 100644 index 305185177..000000000 --- a/public/plugins/codemirror-5.17.0/mode/ttcn/ttcn.js +++ /dev/null @@ -1,283 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("ttcn", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - builtin = parserConfig.builtin || {}, - timerOps = parserConfig.timerOps || {}, - portOps = parserConfig.portOps || {}, - configOps = parserConfig.configOps || {}, - verdictOps = parserConfig.verdictOps || {}, - sutOps = parserConfig.sutOps || {}, - functionOps = parserConfig.functionOps || {}, - - verdictConsts = parserConfig.verdictConsts || {}, - booleanConsts = parserConfig.booleanConsts || {}, - otherConsts = parserConfig.otherConsts || {}, - - types = parserConfig.types || {}, - visibilityModifiers = parserConfig.visibilityModifiers || {}, - templateMatch = parserConfig.templateMatch || {}, - multiLineStrings = parserConfig.multiLineStrings, - indentStatements = parserConfig.indentStatements !== false; - var isOperatorChar = /[+\-*&@=<>!\/]/; - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) { - curPunc = ch; - return "punctuation"; - } - if (ch == "#"){ - stream.skipToEnd(); - return "atom preprocessor"; - } - if (ch == "%"){ - stream.eatWhile(/\b/); - return "atom ttcn3Macros"; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - if(ch == "@"){ - if(stream.match("try") || stream.match("catch") - || stream.match("lazy")){ - return "keyword"; - } - } - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - var cur = stream.current(); - - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (builtin.propertyIsEnumerable(cur)) return "builtin"; - - if (timerOps.propertyIsEnumerable(cur)) return "def timerOps"; - if (configOps.propertyIsEnumerable(cur)) return "def configOps"; - if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps"; - if (portOps.propertyIsEnumerable(cur)) return "def portOps"; - if (sutOps.propertyIsEnumerable(cur)) return "def sutOps"; - if (functionOps.propertyIsEnumerable(cur)) return "def functionOps"; - - if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts"; - if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts"; - if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts"; - - if (types.propertyIsEnumerable(cur)) return "builtin types"; - if (visibilityModifiers.propertyIsEnumerable(cur)) - return "builtin visibilityModifiers"; - if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch"; - - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped){ - var afterQuote = stream.peek(); - //look if the character after the quote is like the B in '10100010'B - if (afterQuote){ - afterQuote = afterQuote.toLowerCase(); - if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o") - stream.next(); - } - end = true; break; - } - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && state.context.type == "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - //Interface - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":" || curPunc == ",") - && ctx.type == "statement"){ - popContext(state); - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (indentStatements && - (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || - (ctx.type == "statement" && curPunc == "newstatement"))) - pushContext(state, stream.column(), "statement"); - - state.startOfLine = false; - - return style; - }, - - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - fold: "brace" - }; - }); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - function def(mimes, mode) { - if (typeof mimes == "string") mimes = [mimes]; - var words = []; - function add(obj) { - if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) - words.push(prop); - } - - add(mode.keywords); - add(mode.builtin); - add(mode.timerOps); - add(mode.portOps); - - if (words.length) { - mode.helperType = mimes[0]; - CodeMirror.registerHelper("hintWords", mimes[0], words); - } - - for (var i = 0; i < mimes.length; ++i) - CodeMirror.defineMIME(mimes[i], mode); - } - - def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], { - name: "ttcn", - keywords: words("activate address alive all alt altstep and and4b any" + - " break case component const continue control deactivate" + - " display do else encode enumerated except exception" + - " execute extends extension external for from function" + - " goto group if import in infinity inout interleave" + - " label language length log match message mixed mod" + - " modifies module modulepar mtc noblock not not4b nowait" + - " of on optional or or4b out override param pattern port" + - " procedure record recursive rem repeat return runs select" + - " self sender set signature system template testcase to" + - " type union value valueof var variant while with xor xor4b"), - builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" + - " decomp decvalue float2int float2str hex2bit hex2int" + - " hex2oct hex2str int2bit int2char int2float int2hex" + - " int2oct int2str int2unichar isbound ischosen ispresent" + - " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" + - " oct2str regexp replace rnd sizeof str2bit str2float" + - " str2hex str2int str2oct substr unichar2int unichar2char" + - " enum2int"), - types: words("anytype bitstring boolean char charstring default float" + - " hexstring integer objid octetstring universal verdicttype timer"), - timerOps: words("read running start stop timeout"), - portOps: words("call catch check clear getcall getreply halt raise receive" + - " reply send trigger"), - configOps: words("create connect disconnect done kill killed map unmap"), - verdictOps: words("getverdict setverdict"), - sutOps: words("action"), - functionOps: words("apply derefers refers"), - - verdictConsts: words("error fail inconc none pass"), - booleanConsts: words("true false"), - otherConsts: words("null NULL omit"), - - visibilityModifiers: words("private public friend"), - templateMatch: words("complement ifpresent subset superset permutation"), - multiLineStrings: true - }); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/turtle/index.html b/public/plugins/codemirror-5.17.0/mode/turtle/index.html deleted file mode 100644 index a4962b617..000000000 --- a/public/plugins/codemirror-5.17.0/mode/turtle/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - -CodeMirror: Turtle mode - - - - - - - - - -
    -

    Turtle mode

    -
    - - -

    MIME types defined: text/turtle.

    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/turtle/turtle.js b/public/plugins/codemirror-5.17.0/mode/turtle/turtle.js deleted file mode 100644 index 0988f0a44..000000000 --- a/public/plugins/codemirror-5.17.0/mode/turtle/turtle.js +++ /dev/null @@ -1,162 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("turtle", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp([]); - var keywords = wordRegexp(["@prefix", "@base", "a"]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - return "operator"; - } else { - stream.eatWhile(/[_\w\d]/); - if(stream.peek() == ":") { - return "variable-3"; - } else { - var word = stream.current(); - - if(keywords.test(word)) { - return "meta"; - } - - if(ch >= "A" && ch <= "Z") { - return "comment"; - } else { - return "keyword"; - } - } - var word = stream.current(); - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "meta"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - }, - - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/turtle", "turtle"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/twig/index.html b/public/plugins/codemirror-5.17.0/mode/twig/index.html deleted file mode 100644 index 02493a5cb..000000000 --- a/public/plugins/codemirror-5.17.0/mode/twig/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: Twig mode - - - - - - - - - -
    -

    Twig mode

    -
    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/twig/twig.js b/public/plugins/codemirror-5.17.0/mode/twig/twig.js deleted file mode 100644 index 1f2854bef..000000000 --- a/public/plugins/codemirror-5.17.0/mode/twig/twig.js +++ /dev/null @@ -1,141 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/multiplex")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/multiplex"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("twig:inner", function() { - var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"], - operator = /^[+\-*&%=<>!?|~^]/, - sign = /^[:\[\(\{]/, - atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"], - number = /^(\d[+\-\*\/])?\d+(\.\d+)?/; - - keywords = new RegExp("((" + keywords.join(")|(") + "))\\b"); - atom = new RegExp("((" + atom.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - var ch = stream.peek(); - - //Comment - if (state.incomment) { - if (!stream.skipTo("#}")) { - stream.skipToEnd(); - } else { - stream.eatWhile(/\#|}/); - state.incomment = false; - } - return "comment"; - //Tag - } else if (state.intag) { - //After operator - if (state.operator) { - state.operator = false; - if (stream.match(atom)) { - return "atom"; - } - if (stream.match(number)) { - return "number"; - } - } - //After sign - if (state.sign) { - state.sign = false; - if (stream.match(atom)) { - return "atom"; - } - if (stream.match(number)) { - return "number"; - } - } - - if (state.instring) { - if (ch == state.instring) { - state.instring = false; - } - stream.next(); - return "string"; - } else if (ch == "'" || ch == '"') { - state.instring = ch; - stream.next(); - return "string"; - } else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) { - state.intag = false; - return "tag"; - } else if (stream.match(operator)) { - state.operator = true; - return "operator"; - } else if (stream.match(sign)) { - state.sign = true; - } else { - if (stream.eat(" ") || stream.sol()) { - if (stream.match(keywords)) { - return "keyword"; - } - if (stream.match(atom)) { - return "atom"; - } - if (stream.match(number)) { - return "number"; - } - if (stream.sol()) { - stream.next(); - } - } else { - stream.next(); - } - - } - return "variable"; - } else if (stream.eat("{")) { - if (ch = stream.eat("#")) { - state.incomment = true; - if (!stream.skipTo("#}")) { - stream.skipToEnd(); - } else { - stream.eatWhile(/\#|}/); - state.incomment = false; - } - return "comment"; - //Open tag - } else if (ch = stream.eat(/\{|%/)) { - //Cache close tag - state.intag = ch; - if (ch == "{") { - state.intag = "}"; - } - stream.eat("-"); - return "tag"; - } - } - stream.next(); - }; - - return { - startState: function () { - return {}; - }, - token: function (stream, state) { - return tokenBase(stream, state); - } - }; - }); - - CodeMirror.defineMode("twig", function(config, parserConfig) { - var twigInner = CodeMirror.getMode(config, "twig:inner"); - if (!parserConfig || !parserConfig.base) return twigInner; - return CodeMirror.multiplexingMode( - CodeMirror.getMode(config, parserConfig.base), { - open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true - } - ); - }); - CodeMirror.defineMIME("text/x-twig", "twig"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/vb/index.html b/public/plugins/codemirror-5.17.0/mode/vb/index.html deleted file mode 100644 index adcc44fd3..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vb/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - -CodeMirror: VB.NET mode - - - - - - - - - - - -
    -

    VB.NET mode

    - - - -
    - -
    -
    
    -  

    MIME type defined: text/x-vb.

    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/vb/vb.js b/public/plugins/codemirror-5.17.0/mode/vb/vb.js deleted file mode 100644 index d78f91f70..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vb/vb.js +++ /dev/null @@ -1,276 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("vb", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try']; - var middleKeywords = ['else','elseif','case', 'catch']; - var endKeywords = ['next','loop']; - - var operatorKeywords = ['and', 'or', 'not', 'xor', 'in']; - var wordOperators = wordRegexp(operatorKeywords); - var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', - 'goto', 'byval','byref','new','handles','property', 'return', - 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; - var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; - - var keywords = wordRegexp(commonKeywords); - var types = wordRegexp(commontypes); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - - var indentInfo = null; - - CodeMirror.registerHelper("hintWords", "vb", openingKeywords.concat(middleKeywords).concat(endKeywords) - .concat(operatorKeywords).concat(commonKeywords).concat(commontypes)); - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.a-f]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+F?/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*F?/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+F?/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - return 'keyword'; - } - if (stream.match(closing)) { - dedent(stream,state); - return 'keyword'; - } - - if (stream.match(types)) { - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state ); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - }, - - lineComment: "'" - }; - return external; -}); - -CodeMirror.defineMIME("text/x-vb", "vb"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/vbscript/index.html b/public/plugins/codemirror-5.17.0/mode/vbscript/index.html deleted file mode 100644 index ad7532d7d..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vbscript/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - -CodeMirror: VBScript mode - - - - - - - - - -
    -

    VBScript mode

    - - -
    - - - -

    MIME types defined: text/vbscript.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/vbscript/vbscript.js b/public/plugins/codemirror-5.17.0/mode/vbscript/vbscript.js deleted file mode 100644 index b66df2239..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vbscript/vbscript.js +++ /dev/null @@ -1,350 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* -For extra ASP classic objects, initialize CodeMirror instance with this option: - isASP: true - -E.G.: - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - isASP: true - }); -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("vbscript", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"); - var doubleOperators = new RegExp("^((<>)|(<=)|(>=))"); - var singleDelimiters = new RegExp('^[\\.,]'); - var brakets = new RegExp('^[\\(\\)]'); - var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for']; - var middleKeywords = ['else','elseif','case']; - var endKeywords = ['next','loop','wend']; - - var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']); - var commonkeywords = ['dim', 'redim', 'then', 'until', 'randomize', - 'byval','byref','new','property', 'exit', 'in', - 'const','private', 'public', - 'get','set','let', 'stop', 'on error resume next', 'on error goto 0', 'option explicit', 'call', 'me']; - - //This list was from: http://msdn.microsoft.com/en-us/library/f8tbc79x(v=vs.84).aspx - var atomWords = ['true', 'false', 'nothing', 'empty', 'null']; - //This list was from: http://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx - var builtinFuncsWords = ['abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cos', 'csng', 'cstr', 'date', 'dateadd', 'datediff', 'datepart', - 'dateserial', 'datevalue', 'day', 'escape', 'eval', 'execute', 'exp', 'filter', 'formatcurrency', 'formatdatetime', 'formatnumber', 'formatpercent', 'getlocale', 'getobject', - 'getref', 'hex', 'hour', 'inputbox', 'instr', 'instrrev', 'int', 'fix', 'isarray', 'isdate', 'isempty', 'isnull', 'isnumeric', 'isobject', 'join', 'lbound', 'lcase', 'left', - 'len', 'loadpicture', 'log', 'ltrim', 'rtrim', 'trim', 'maths', 'mid', 'minute', 'month', 'monthname', 'msgbox', 'now', 'oct', 'replace', 'rgb', 'right', 'rnd', 'round', - 'scriptengine', 'scriptenginebuildversion', 'scriptenginemajorversion', 'scriptengineminorversion', 'second', 'setlocale', 'sgn', 'sin', 'space', 'split', 'sqr', 'strcomp', - 'string', 'strreverse', 'tan', 'time', 'timer', 'timeserial', 'timevalue', 'typename', 'ubound', 'ucase', 'unescape', 'vartype', 'weekday', 'weekdayname', 'year']; - - //This list was from: http://msdn.microsoft.com/en-us/library/ydz4cfk3(v=vs.84).aspx - var builtinConsts = ['vbBlack', 'vbRed', 'vbGreen', 'vbYellow', 'vbBlue', 'vbMagenta', 'vbCyan', 'vbWhite', 'vbBinaryCompare', 'vbTextCompare', - 'vbSunday', 'vbMonday', 'vbTuesday', 'vbWednesday', 'vbThursday', 'vbFriday', 'vbSaturday', 'vbUseSystemDayOfWeek', 'vbFirstJan1', 'vbFirstFourDays', 'vbFirstFullWeek', - 'vbGeneralDate', 'vbLongDate', 'vbShortDate', 'vbLongTime', 'vbShortTime', 'vbObjectError', - 'vbOKOnly', 'vbOKCancel', 'vbAbortRetryIgnore', 'vbYesNoCancel', 'vbYesNo', 'vbRetryCancel', 'vbCritical', 'vbQuestion', 'vbExclamation', 'vbInformation', 'vbDefaultButton1', 'vbDefaultButton2', - 'vbDefaultButton3', 'vbDefaultButton4', 'vbApplicationModal', 'vbSystemModal', 'vbOK', 'vbCancel', 'vbAbort', 'vbRetry', 'vbIgnore', 'vbYes', 'vbNo', - 'vbCr', 'VbCrLf', 'vbFormFeed', 'vbLf', 'vbNewLine', 'vbNullChar', 'vbNullString', 'vbTab', 'vbVerticalTab', 'vbUseDefault', 'vbTrue', 'vbFalse', - 'vbEmpty', 'vbNull', 'vbInteger', 'vbLong', 'vbSingle', 'vbDouble', 'vbCurrency', 'vbDate', 'vbString', 'vbObject', 'vbError', 'vbBoolean', 'vbVariant', 'vbDataObject', 'vbDecimal', 'vbByte', 'vbArray']; - //This list was from: http://msdn.microsoft.com/en-us/library/hkc375ea(v=vs.84).aspx - var builtinObjsWords = ['WScript', 'err', 'debug', 'RegExp']; - var knownProperties = ['description', 'firstindex', 'global', 'helpcontext', 'helpfile', 'ignorecase', 'length', 'number', 'pattern', 'source', 'value', 'count']; - var knownMethods = ['clear', 'execute', 'raise', 'replace', 'test', 'write', 'writeline', 'close', 'open', 'state', 'eof', 'update', 'addnew', 'end', 'createobject', 'quit']; - - var aspBuiltinObjsWords = ['server', 'response', 'request', 'session', 'application']; - var aspKnownProperties = ['buffer', 'cachecontrol', 'charset', 'contenttype', 'expires', 'expiresabsolute', 'isclientconnected', 'pics', 'status', //response - 'clientcertificate', 'cookies', 'form', 'querystring', 'servervariables', 'totalbytes', //request - 'contents', 'staticobjects', //application - 'codepage', 'lcid', 'sessionid', 'timeout', //session - 'scripttimeout']; //server - var aspKnownMethods = ['addheader', 'appendtolog', 'binarywrite', 'end', 'flush', 'redirect', //response - 'binaryread', //request - 'remove', 'removeall', 'lock', 'unlock', //application - 'abandon', //session - 'getlasterror', 'htmlencode', 'mappath', 'transfer', 'urlencode']; //server - - var knownWords = knownMethods.concat(knownProperties); - - builtinObjsWords = builtinObjsWords.concat(builtinConsts); - - if (conf.isASP){ - builtinObjsWords = builtinObjsWords.concat(aspBuiltinObjsWords); - knownWords = knownWords.concat(aspKnownMethods, aspKnownProperties); - }; - - var keywords = wordRegexp(commonkeywords); - var atoms = wordRegexp(atomWords); - var builtinFuncs = wordRegexp(builtinFuncsWords); - var builtinObjs = wordRegexp(builtinObjsWords); - var known = wordRegexp(knownWords); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - var noIndentWords = wordRegexp(['on error resume next', 'exit']); - var comment = wordRegexp(['rem']); - - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return 'space'; - //return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - if (stream.match(comment)){ - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.]/i, false) && !stream.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - - if (stream.match(brakets)) { - return "bracket"; - } - - if (stream.match(noIndentWords)) { - state.doInCurrentLine = true; - - return 'keyword'; - } - - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - - return 'keyword'; - } - if (stream.match(closing)) { - if (! state.doInCurrentLine) - dedent(stream,state); - else - state.doInCurrentLine = false; - - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(atoms)) { - return 'atom'; - } - - if (stream.match(known)) { - return 'variable-2'; - } - - if (stream.match(builtinFuncs)) { - return 'builtin'; - } - - if (stream.match(builtinObjs)){ - return 'variable-2'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - - current = stream.current(); - if (style && (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword')){//|| knownWords.indexOf(current.substring(1)) > -1) { - if (style === 'builtin' || style === 'keyword') style='variable'; - if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2'; - - return style; - } else { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false, - ignoreKeyword: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (style==='space') style=null; - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/vbscript", "vbscript"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/velocity/index.html b/public/plugins/codemirror-5.17.0/mode/velocity/index.html deleted file mode 100644 index 7eba8f418..000000000 --- a/public/plugins/codemirror-5.17.0/mode/velocity/index.html +++ /dev/null @@ -1,120 +0,0 @@ - - -CodeMirror: Velocity mode - - - - - - - - - - -
    -

    Velocity mode

    -
    - - -

    MIME types defined: text/velocity.

    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/velocity/velocity.js b/public/plugins/codemirror-5.17.0/mode/velocity/velocity.js deleted file mode 100644 index 12ee22124..000000000 --- a/public/plugins/codemirror-5.17.0/mode/velocity/velocity.js +++ /dev/null @@ -1,201 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("velocity", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = parseWords("#end #else #break #stop #[[ #]] " + - "#{end} #{else} #{break} #{stop}"); - var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + - "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); - var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"); - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - // start of unparsed string? - if ((ch == "'") && !state.inString && state.inParams) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenString(ch)); - } - // start of parsed string? - else if ((ch == '"')) { - state.lastTokenWasBuiltin = false; - if (state.inString) { - state.inString = false; - return "string"; - } - else if (state.inParams) - return chain(stream, state, tokenString(ch)); - } - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) - state.inParams = true; - else if (ch == ")") { - state.inParams = false; - state.lastTokenWasBuiltin = true; - } - return null; - } - // start of a number value? - else if (/\d/.test(ch)) { - state.lastTokenWasBuiltin = false; - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment? - else if (ch == "#" && stream.eat("*")) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenComment); - } - // unparsed content? - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenUnparsed); - } - // single line comment? - else if (ch == "#" && stream.eat("#")) { - state.lastTokenWasBuiltin = false; - stream.skipToEnd(); - return "comment"; - } - // variable? - else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); - // is it one of the specials? - if (specials && specials.propertyIsEnumerable(stream.current())) { - return "keyword"; - } - else { - state.lastTokenWasBuiltin = true; - state.beforeParams = true; - return "builtin"; - } - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - state.lastTokenWasBuiltin = false; - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the whole word - stream.eatWhile(/[\w\$_{}@]/); - var word = stream.current(); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(word) || - (stream.current().match(/^#@?[a-z0-9_]+ *$/i) && stream.peek()=="(") && - !(functions && functions.propertyIsEnumerable(word.toLowerCase()))) { - state.beforeParams = true; - state.lastTokenWasBuiltin = false; - return "keyword"; - } - if (state.inString) { - state.lastTokenWasBuiltin = false; - return "string"; - } - if (stream.pos > word.length && stream.string.charAt(stream.pos-word.length-1)=="." && state.lastTokenWasBuiltin) - return "builtin"; - // default: just a "word" - state.lastTokenWasBuiltin = false; - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if ((next == quote) && !escaped) { - end = true; - break; - } - if (quote=='"' && stream.peek() == '$' && !escaped) { - state.inString = true; - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - // Interface - - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false, - inString: false, - lastTokenWasBuiltin: false - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - blockCommentStart: "#*", - blockCommentEnd: "*#", - lineComment: "##", - fold: "velocity" - }; -}); - -CodeMirror.defineMIME("text/velocity", "velocity"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/verilog/index.html b/public/plugins/codemirror-5.17.0/mode/verilog/index.html deleted file mode 100644 index 9c52722af..000000000 --- a/public/plugins/codemirror-5.17.0/mode/verilog/index.html +++ /dev/null @@ -1,120 +0,0 @@ - - -CodeMirror: Verilog/SystemVerilog mode - - - - - - - - - - -
    -

    SystemVerilog mode

    - -
    - - - -

    -Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800). -

    Configuration options:

    -
      -
    • noIndentKeywords - List of keywords which should not cause indentation to increase. E.g. ["package", "module"]. Default: None
    • -
    -

    - -

    MIME types defined: text/x-verilog and text/x-systemverilog.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/verilog/test.js b/public/plugins/codemirror-5.17.0/mode/verilog/test.js deleted file mode 100644 index 8334fab05..000000000 --- a/public/plugins/codemirror-5.17.0/mode/verilog/test.js +++ /dev/null @@ -1,273 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 4}, "verilog"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("binary_literals", - "[number 1'b0]", - "[number 1'b1]", - "[number 1'bx]", - "[number 1'bz]", - "[number 1'bX]", - "[number 1'bZ]", - "[number 1'B0]", - "[number 1'B1]", - "[number 1'Bx]", - "[number 1'Bz]", - "[number 1'BX]", - "[number 1'BZ]", - "[number 1'b0]", - "[number 1'b1]", - "[number 2'b01]", - "[number 2'bxz]", - "[number 2'b11]", - "[number 2'b10]", - "[number 2'b1Z]", - "[number 12'b0101_0101_0101]", - "[number 1'b 0]", - "[number 'b0101]" - ); - - MT("octal_literals", - "[number 3'o7]", - "[number 3'O7]", - "[number 3'so7]", - "[number 3'SO7]" - ); - - MT("decimal_literals", - "[number 0]", - "[number 1]", - "[number 7]", - "[number 123_456]", - "[number 'd33]", - "[number 8'd255]", - "[number 8'D255]", - "[number 8'sd255]", - "[number 8'SD255]", - "[number 32'd123]", - "[number 32 'd123]", - "[number 32 'd 123]" - ); - - MT("hex_literals", - "[number 4'h0]", - "[number 4'ha]", - "[number 4'hF]", - "[number 4'hx]", - "[number 4'hz]", - "[number 4'hX]", - "[number 4'hZ]", - "[number 32'hdc78]", - "[number 32'hDC78]", - "[number 32 'hDC78]", - "[number 32'h DC78]", - "[number 32 'h DC78]", - "[number 32'h44x7]", - "[number 32'hFFF?]" - ); - - MT("real_number_literals", - "[number 1.2]", - "[number 0.1]", - "[number 2394.26331]", - "[number 1.2E12]", - "[number 1.2e12]", - "[number 1.30e-2]", - "[number 0.1e-0]", - "[number 23E10]", - "[number 29E-2]", - "[number 236.123_763_e-12]" - ); - - MT("operators", - "[meta ^]" - ); - - MT("keywords", - "[keyword logic]", - "[keyword logic] [variable foo]", - "[keyword reg] [variable abc]" - ); - - MT("variables", - "[variable _leading_underscore]", - "[variable _if]", - "[number 12] [variable foo]", - "[variable foo] [number 14]" - ); - - MT("tick_defines", - "[def `FOO]", - "[def `foo]", - "[def `FOO_bar]" - ); - - MT("system_calls", - "[meta $display]", - "[meta $vpi_printf]" - ); - - MT("line_comment", "[comment // Hello world]"); - - // Alignment tests - MT("align_port_map_style1", - /** - * mod mod(.a(a), - * .b(b) - * ); - */ - "[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],", - " .[variable b][bracket (][variable b][bracket )]", - " [bracket )];", - "" - ); - - MT("align_port_map_style2", - /** - * mod mod( - * .a(a), - * .b(b) - * ); - */ - "[variable mod] [variable mod][bracket (]", - " .[variable a][bracket (][variable a][bracket )],", - " .[variable b][bracket (][variable b][bracket )]", - "[bracket )];", - "" - ); - - // Indentation tests - MT("indent_single_statement_if", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword break];", - "" - ); - - MT("no_indent_after_single_line_if", - "[keyword if] [bracket (][variable foo][bracket )] [keyword break];", - "" - ); - - MT("indent_after_if_begin_same_line", - "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", - " [keyword break];", - " [keyword break];", - "[keyword end]", - "" - ); - - MT("indent_after_if_begin_next_line", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword begin]", - " [keyword break];", - " [keyword break];", - " [keyword end]", - "" - ); - - MT("indent_single_statement_if_else", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword break];", - "[keyword else]", - " [keyword break];", - "" - ); - - MT("indent_if_else_begin_same_line", - "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", - " [keyword break];", - " [keyword break];", - "[keyword end] [keyword else] [keyword begin]", - " [keyword break];", - " [keyword break];", - "[keyword end]", - "" - ); - - MT("indent_if_else_begin_next_line", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword begin]", - " [keyword break];", - " [keyword break];", - " [keyword end]", - "[keyword else]", - " [keyword begin]", - " [keyword break];", - " [keyword break];", - " [keyword end]", - "" - ); - - MT("indent_if_nested_without_begin", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword if] [bracket (][variable foo][bracket )]", - " [keyword if] [bracket (][variable foo][bracket )]", - " [keyword break];", - "" - ); - - MT("indent_case", - "[keyword case] [bracket (][variable state][bracket )]", - " [variable FOO]:", - " [keyword break];", - " [variable BAR]:", - " [keyword break];", - "[keyword endcase]", - "" - ); - - MT("unindent_after_end_with_preceding_text", - "[keyword begin]", - " [keyword break]; [keyword end]", - "" - ); - - MT("export_function_one_line_does_not_indent", - "[keyword export] [string \"DPI-C\"] [keyword function] [variable helloFromSV];", - "" - ); - - MT("export_task_one_line_does_not_indent", - "[keyword export] [string \"DPI-C\"] [keyword task] [variable helloFromSV];", - "" - ); - - MT("export_function_two_lines_indents_properly", - "[keyword export]", - " [string \"DPI-C\"] [keyword function] [variable helloFromSV];", - "" - ); - - MT("export_task_two_lines_indents_properly", - "[keyword export]", - " [string \"DPI-C\"] [keyword task] [variable helloFromSV];", - "" - ); - - MT("import_function_one_line_does_not_indent", - "[keyword import] [string \"DPI-C\"] [keyword function] [variable helloFromC];", - "" - ); - - MT("import_task_one_line_does_not_indent", - "[keyword import] [string \"DPI-C\"] [keyword task] [variable helloFromC];", - "" - ); - - MT("import_package_single_line_does_not_indent", - "[keyword import] [variable p]::[variable x];", - "[keyword import] [variable p]::[variable y];", - "" - ); - - MT("covergroup_with_function_indents_properly", - "[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];", - " [variable c] : [keyword coverpoint] [variable c];", - "[keyword endgroup]: [variable cg]", - "" - ); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/verilog/verilog.js b/public/plugins/codemirror-5.17.0/mode/verilog/verilog.js deleted file mode 100644 index 7513dcede..000000000 --- a/public/plugins/codemirror-5.17.0/mode/verilog/verilog.js +++ /dev/null @@ -1,537 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("verilog", function(config, parserConfig) { - - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - dontAlignCalls = parserConfig.dontAlignCalls, - noIndentKeywords = parserConfig.noIndentKeywords || [], - multiLineStrings = parserConfig.multiLineStrings, - hooks = parserConfig.hooks || {}; - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - /** - * Keywords from IEEE 1800-2012 - */ - var keywords = words( - "accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind " + - "bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config " + - "const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable " + - "dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup " + - "endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask " + - "enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin " + - "function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import " + - "incdir include initial inout input inside instance int integer interconnect interface intersect join join_any " + - "join_none large let liblist library local localparam logic longint macromodule matches medium modport module " + - "nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed " + - "parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup " + - "pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg " + - "reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime " + - "s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify " + - "specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on " + - "table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior " + - "trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void " + - "wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"); - - /** Operators from IEEE 1800-2012 - unary_operator ::= - + | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ - binary_operator ::= - + | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | ** - | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<< - | -> | <-> - inc_or_dec_operator ::= ++ | -- - unary_module_path_operator ::= - ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ - binary_module_path_operator ::= - == | != | && | || | & | | | ^ | ^~ | ~^ - */ - var isOperatorChar = /[\+\-\*\/!~&|^%=?:]/; - var isBracketChar = /[\[\]{}()]/; - - var unsignedNumber = /\d[0-9_]*/; - var decimalLiteral = /\d*\s*'s?d\s*\d[0-9_]*/i; - var binaryLiteral = /\d*\s*'s?b\s*[xz01][xz01_]*/i; - var octLiteral = /\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i; - var hexLiteral = /\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i; - var realLiteral = /(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i; - - var closingBracketOrWord = /^((\w+)|[)}\]])/; - var closingBracket = /[)}\]]/; - - var curPunc; - var curKeyword; - - // Block openings which are closed by a matching keyword in the form of ("end" + keyword) - // E.g. "task" => "endtask" - var blockKeywords = words( - "case checker class clocking config function generate interface module package" + - "primitive program property specify sequence table task" - ); - - // Opening/closing pairs - var openClose = {}; - for (var keyword in blockKeywords) { - openClose[keyword] = "end" + keyword; - } - openClose["begin"] = "end"; - openClose["casex"] = "endcase"; - openClose["casez"] = "endcase"; - openClose["do" ] = "while"; - openClose["fork" ] = "join;join_any;join_none"; - openClose["covergroup"] = "endgroup"; - - for (var i in noIndentKeywords) { - var keyword = noIndentKeywords[i]; - if (openClose[keyword]) { - openClose[keyword] = undefined; - } - } - - // Keywords which open statements that are ended with a semi-colon - var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while"); - - function tokenBase(stream, state) { - var ch = stream.peek(), style; - if (hooks[ch] && (style = hooks[ch](stream, state)) != false) return style; - if (hooks.tokenBase && (style = hooks.tokenBase(stream, state)) != false) - return style; - - if (/[,;:\.]/.test(ch)) { - curPunc = stream.next(); - return null; - } - if (isBracketChar.test(ch)) { - curPunc = stream.next(); - return "bracket"; - } - // Macros (tick-defines) - if (ch == '`') { - stream.next(); - if (stream.eatWhile(/[\w\$_]/)) { - return "def"; - } else { - return null; - } - } - // System calls - if (ch == '$') { - stream.next(); - if (stream.eatWhile(/[\w\$_]/)) { - return "meta"; - } else { - return null; - } - } - // Time literals - if (ch == '#') { - stream.next(); - stream.eatWhile(/[\d_.]/); - return "def"; - } - // Strings - if (ch == '"') { - stream.next(); - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - // Comments - if (ch == "/") { - stream.next(); - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - stream.backUp(1); - } - - // Numeric literals - if (stream.match(realLiteral) || - stream.match(decimalLiteral) || - stream.match(binaryLiteral) || - stream.match(octLiteral) || - stream.match(hexLiteral) || - stream.match(unsignedNumber) || - stream.match(realLiteral)) { - return "number"; - } - - // Operators - if (stream.eatWhile(isOperatorChar)) { - return "meta"; - } - - // Keywords / plain variables - if (stream.eatWhile(/[\w\$_]/)) { - var cur = stream.current(); - if (keywords[cur]) { - if (openClose[cur]) { - curPunc = "newblock"; - } - if (statementKeywords[cur]) { - curPunc = "newstatement"; - } - curKeyword = cur; - return "keyword"; - } - return "variable"; - } - - stream.next(); - return null; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - var c = new Context(indent, col, type, null, state.context); - return state.context = c; - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") { - state.indented = state.context.indented; - } - return state.context = state.context.prev; - } - - function isClosing(text, contextClosing) { - if (text == contextClosing) { - return true; - } else { - // contextClosing may be multiple keywords separated by ; - var closingKeywords = contextClosing.split(";"); - for (var i in closingKeywords) { - if (text == closingKeywords[i]) { - return true; - } - } - return false; - } - } - - function buildElectricInputRegEx() { - // Reindentation should occur on any bracket char: {}()[] - // or on a match of any of the block closing keywords, at - // the end of a line - var allClosings = []; - for (var i in openClose) { - if (openClose[i]) { - var closings = openClose[i].split(";"); - for (var j in closings) { - allClosings.push(closings[j]); - } - } - } - var re = new RegExp("[{}()\\[\\]]|(" + allClosings.join("|") + ")$"); - return re; - } - - // Interface - return { - - // Regex to force current line to reindent - electricInput: buildElectricInputRegEx(), - - startState: function(basecolumn) { - var state = { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - if (hooks.startState) hooks.startState(state); - return state; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (hooks.token) hooks.token(stream, state); - if (stream.eatSpace()) return null; - curPunc = null; - curKeyword = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta" || style == "variable") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == ctx.type) { - popContext(state); - } else if ((curPunc == ";" && ctx.type == "statement") || - (ctx.type && isClosing(curKeyword, ctx.type))) { - ctx = popContext(state); - while (ctx && ctx.type == "statement") ctx = popContext(state); - } else if (curPunc == "{") { - pushContext(state, stream.column(), "}"); - } else if (curPunc == "[") { - pushContext(state, stream.column(), "]"); - } else if (curPunc == "(") { - pushContext(state, stream.column(), ")"); - } else if (ctx && ctx.type == "endcase" && curPunc == ":") { - pushContext(state, stream.column(), "statement"); - } else if (curPunc == "newstatement") { - pushContext(state, stream.column(), "statement"); - } else if (curPunc == "newblock") { - if (curKeyword == "function" && ctx && (ctx.type == "statement" || ctx.type == "endgroup")) { - // The 'function' keyword can appear in some other contexts where it actually does not - // indicate a function (import/export DPI and covergroup definitions). - // Do nothing in this case - } else if (curKeyword == "task" && ctx && ctx.type == "statement") { - // Same thing for task - } else { - var close = openClose[curKeyword]; - pushContext(state, stream.column(), close); - } - } - - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - if (hooks.indent) { - var fromHook = hooks.indent(state); - if (fromHook >= 0) return fromHook; - } - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = false; - var possibleClosing = textAfter.match(closingBracketOrWord); - if (possibleClosing) - closing = isClosing(possibleClosing[0], ctx.type); - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1); - else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - - CodeMirror.defineMIME("text/x-verilog", { - name: "verilog" - }); - - CodeMirror.defineMIME("text/x-systemverilog", { - name: "verilog" - }); - - // TLVVerilog mode - - var tlvchScopePrefixes = { - ">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier", - "@-": "variable-3", "@": "variable-3", "?": "qualifier" - }; - - function tlvGenIndent(stream, state) { - var tlvindentUnit = 2; - var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation(); - switch (state.tlvCurCtlFlowChar) { - case "\\": - curIndent = 0; - break; - case "|": - if (state.tlvPrevPrevCtlFlowChar == "@") { - indentUnitRq = -2; //-2 new pipe rq after cur pipe - break; - } - if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - case "M": // m4 - if (state.tlvPrevPrevCtlFlowChar == "@") { - indentUnitRq = -2; //-2 new inst rq after pipe - break; - } - if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - case "@": - if (state.tlvPrevCtlFlowChar == "S") - indentUnitRq = -1; // new pipe stage after stmts - if (state.tlvPrevCtlFlowChar == "|") - indentUnitRq = 1; // 1st pipe stage - break; - case "S": - if (state.tlvPrevCtlFlowChar == "@") - indentUnitRq = 1; // flow in pipe stage - if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - } - var statementIndentUnit = tlvindentUnit; - rtnIndent = curIndent + (indentUnitRq*statementIndentUnit); - return rtnIndent >= 0 ? rtnIndent : curIndent; - } - - CodeMirror.defineMIME("text/x-tlv", { - name: "verilog", - hooks: { - "\\": function(stream, state) { - var vxIndent = 0, style = false; - var curPunc = stream.string; - if ((stream.sol()) && ((/\\SV/.test(stream.string)) || (/\\TLV/.test(stream.string)))) { - curPunc = (/\\TLV_version/.test(stream.string)) - ? "\\TLV_version" : stream.string; - stream.skipToEnd(); - if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;}; - if ((/\\TLV/.test(curPunc) && !state.vxCodeActive) - || (curPunc=="\\TLV_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; - style = "keyword"; - state.tlvCurCtlFlowChar = state.tlvPrevPrevCtlFlowChar - = state.tlvPrevCtlFlowChar = ""; - if (state.vxCodeActive == true) { - state.tlvCurCtlFlowChar = "\\"; - vxIndent = tlvGenIndent(stream, state); - } - state.vxIndentRq = vxIndent; - } - return style; - }, - tokenBase: function(stream, state) { - var vxIndent = 0, style = false; - var tlvisOperatorChar = /[\[\]=:]/; - var tlvkpScopePrefixs = { - "**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable", - "^^":"attribute", "^":"attribute"}; - var ch = stream.peek(); - var vxCurCtlFlowCharValueAtStart = state.tlvCurCtlFlowChar; - if (state.vxCodeActive == true) { - if (/[\[\]{}\(\);\:]/.test(ch)) { - // bypass nesting and 1 char punc - style = "meta"; - stream.next(); - } else if (ch == "/") { - stream.next(); - if (stream.eat("/")) { - stream.skipToEnd(); - style = "comment"; - state.tlvCurCtlFlowChar = "S"; - } else { - stream.backUp(1); - } - } else if (ch == "@") { - // pipeline stage - style = tlvchScopePrefixes[ch]; - state.tlvCurCtlFlowChar = "@"; - stream.next(); - stream.eatWhile(/[\w\$_]/); - } else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive) - // m4 pre proc - stream.skipTo("("); - style = "def"; - state.tlvCurCtlFlowChar = "M"; - } else if (ch == "!" && stream.sol()) { - // v stmt in tlv region - // state.tlvCurCtlFlowChar = "S"; - style = "comment"; - stream.next(); - } else if (tlvisOperatorChar.test(ch)) { - // operators - stream.eatWhile(tlvisOperatorChar); - style = "operator"; - } else if (ch == "#") { - // phy hier - state.tlvCurCtlFlowChar = (state.tlvCurCtlFlowChar == "") - ? ch : state.tlvCurCtlFlowChar; - stream.next(); - stream.eatWhile(/[+-]\d/); - style = "tag"; - } else if (tlvkpScopePrefixs.propertyIsEnumerable(ch)) { - // special TLV operators - style = tlvkpScopePrefixs[ch]; - state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? "S" : state.tlvCurCtlFlowChar; // stmt - stream.next(); - stream.match(/[a-zA-Z_0-9]+/); - } else if (style = tlvchScopePrefixes[ch] || false) { - // special TLV operators - state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? ch : state.tlvCurCtlFlowChar; - stream.next(); - stream.match(/[a-zA-Z_0-9]+/); - } - if (state.tlvCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change - vxIndent = tlvGenIndent(stream, state); - state.vxIndentRq = vxIndent; - } - } - return style; - }, - token: function(stream, state) { - if (state.vxCodeActive == true && stream.sol() && state.tlvCurCtlFlowChar != "") { - state.tlvPrevPrevCtlFlowChar = state.tlvPrevCtlFlowChar; - state.tlvPrevCtlFlowChar = state.tlvCurCtlFlowChar; - state.tlvCurCtlFlowChar = ""; - } - }, - indent: function(state) { - return (state.vxCodeActive == true) ? state.vxIndentRq : -1; - }, - startState: function(state) { - state.tlvCurCtlFlowChar = ""; - state.tlvPrevCtlFlowChar = ""; - state.tlvPrevPrevCtlFlowChar = ""; - state.vxCodeActive = true; - state.vxIndentRq = 0; - } - } - }); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/vhdl/index.html b/public/plugins/codemirror-5.17.0/mode/vhdl/index.html deleted file mode 100644 index 3051bc37e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vhdl/index.html +++ /dev/null @@ -1,95 +0,0 @@ - - -CodeMirror: VHDL mode - - - - - - - - - - -
    -

    VHDL mode

    - -
    - - - -

    -Syntax highlighting and indentation for the VHDL language. -

    Configuration options:

    -
      -
    • atoms - List of atom words. Default: "null"
    • -
    • hooks - List of meta hooks. Default: ["`", "$"]
    • -
    • multiLineStrings - Whether multi-line strings are accepted. Default: false
    • -
    -

    - -

    MIME types defined: text/x-vhdl.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/vhdl/vhdl.js b/public/plugins/codemirror-5.17.0/mode/vhdl/vhdl.js deleted file mode 100644 index 97e086e42..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vhdl/vhdl.js +++ /dev/null @@ -1,189 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Originally written by Alf Nielsen, re-written by Michael Zhou -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -function words(str) { - var obj = {}, words = str.split(","); - for (var i = 0; i < words.length; ++i) { - var allCaps = words[i].toUpperCase(); - var firstCap = words[i].charAt(0).toUpperCase() + words[i].slice(1); - obj[words[i]] = true; - obj[allCaps] = true; - obj[firstCap] = true; - } - return obj; -} - -function metaHook(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; -} - -CodeMirror.defineMode("vhdl", function(config, parserConfig) { - var indentUnit = config.indentUnit, - atoms = parserConfig.atoms || words("null"), - hooks = parserConfig.hooks || {"`": metaHook, "$": metaHook}, - multiLineStrings = parserConfig.multiLineStrings; - - var keywords = words("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block," + - "body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case," + - "end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for," + - "function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage," + - "literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map," + - "postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal," + - "sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"); - - var blockKeywords = words("architecture,entity,begin,case,port,else,elsif,end,for,function,if"); - - var isOperatorChar = /[&|~> - -CodeMirror: Vue.js mode - - - - - - - - - - - - - - - - - - - - - -
    -

    Vue.js mode

    -
    - - -

    MIME types defined: text/x-vue

    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/vue/vue.js b/public/plugins/codemirror-5.17.0/mode/vue/vue.js deleted file mode 100644 index d89a55238..000000000 --- a/public/plugins/codemirror-5.17.0/mode/vue/vue.js +++ /dev/null @@ -1,69 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function (mod) { - "use strict"; - if (typeof exports === "object" && typeof module === "object") {// CommonJS - mod(require("../../lib/codemirror"), - require("../../addon/mode/overlay"), - require("../xml/xml"), - require("../javascript/javascript"), - require("../coffeescript/coffeescript"), - require("../css/css"), - require("../sass/sass"), - require("../stylus/stylus"), - require("../jade/jade"), - require("../handlebars/handlebars")); - } else if (typeof define === "function" && define.amd) { // AMD - define(["../../lib/codemirror", - "../../addon/mode/overlay", - "../xml/xml", - "../javascript/javascript", - "../coffeescript/coffeescript", - "../css/css", - "../sass/sass", - "../stylus/stylus", - "../jade/jade", - "../handlebars/handlebars"], mod); - } else { // Plain browser env - mod(CodeMirror); - } -})(function (CodeMirror) { - var tagLanguages = { - script: [ - ["lang", /coffee(script)?/, "coffeescript"], - ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"] - ], - style: [ - ["lang", /^stylus$/i, "stylus"], - ["lang", /^sass$/i, "sass"], - ["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"], - ["type", /^text\/sass/i, "sass"] - ], - template: [ - ["lang", /^vue-template$/i, "vue"], - ["lang", /^jade$/i, "jade"], - ["lang", /^handlebars$/i, "handlebars"], - ["type", /^(text\/)?(x-)?jade$/i, "jade"], - ["type", /^text\/x-handlebars-template$/i, "handlebars"], - [null, null, "vue-template"] - ] - }; - - CodeMirror.defineMode("vue-template", function (config, parserConfig) { - var mustacheOverlay = { - token: function (stream) { - if (stream.match(/^\{\{.*?\}\}/)) return "meta mustache"; - while (stream.next() && !stream.match("{{", false)) {} - return null; - } - }; - return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay); - }); - - CodeMirror.defineMode("vue", function (config) { - return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages}); - }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "jade", "handlebars"); - - CodeMirror.defineMIME("script/x-vue", "vue"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/webidl/index.html b/public/plugins/codemirror-5.17.0/mode/webidl/index.html deleted file mode 100644 index 1d4112e1c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/webidl/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - -CodeMirror: Web IDL mode - - - - - - - - - - -
    -

    Web IDL mode

    - -
    - -
    - - - -

    MIME type defined: text/x-webidl.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/webidl/webidl.js b/public/plugins/codemirror-5.17.0/mode/webidl/webidl.js deleted file mode 100644 index 814333620..000000000 --- a/public/plugins/codemirror-5.17.0/mode/webidl/webidl.js +++ /dev/null @@ -1,195 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); -}; - -var builtinArray = [ - "Clamp", - "Constructor", - "EnforceRange", - "Exposed", - "ImplicitThis", - "Global", "PrimaryGlobal", - "LegacyArrayClass", - "LegacyUnenumerableNamedProperties", - "LenientThis", - "NamedConstructor", - "NewObject", - "NoInterfaceObject", - "OverrideBuiltins", - "PutForwards", - "Replaceable", - "SameObject", - "TreatNonObjectAsNull", - "TreatNullAs", - "EmptyString", - "Unforgeable", - "Unscopeable" -]; -var builtins = wordRegexp(builtinArray); - -var typeArray = [ - "unsigned", "short", "long", // UnsignedIntegerType - "unrestricted", "float", "double", // UnrestrictedFloatType - "boolean", "byte", "octet", // Rest of PrimitiveType - "Promise", // PromiseType - "ArrayBuffer", "DataView", "Int8Array", "Int16Array", "Int32Array", - "Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray", - "Float32Array", "Float64Array", // BufferRelatedType - "ByteString", "DOMString", "USVString", "sequence", "object", "RegExp", - "Error", "DOMException", "FrozenArray", // Rest of NonAnyType - "any", // Rest of SingleType - "void" // Rest of ReturnType -]; -var types = wordRegexp(typeArray); - -var keywordArray = [ - "attribute", "callback", "const", "deleter", "dictionary", "enum", "getter", - "implements", "inherit", "interface", "iterable", "legacycaller", "maplike", - "partial", "required", "serializer", "setlike", "setter", "static", - "stringifier", "typedef", // ArgumentNameKeyword except - // "unrestricted" - "optional", "readonly", "or" -]; -var keywords = wordRegexp(keywordArray); - -var atomArray = [ - "true", "false", // BooleanLiteral - "Infinity", "NaN", // FloatLiteral - "null" // Rest of ConstValue -]; -var atoms = wordRegexp(atomArray); - -CodeMirror.registerHelper("hintWords", "webidl", - builtinArray.concat(typeArray).concat(keywordArray).concat(atomArray)); - -var startDefArray = ["callback", "dictionary", "enum", "interface"]; -var startDefs = wordRegexp(startDefArray); - -var endDefArray = ["typedef"]; -var endDefs = wordRegexp(endDefArray); - -var singleOperators = /^[:<=>?]/; -var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/; -var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/; -var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/; -var identifiersEnd = /^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/; -var strings = /^"[^"]*"/; -var multilineComments = /^\/\*.*?\*\//; -var multilineCommentsStart = /^\/\*.*/; -var multilineCommentsEnd = /^.*?\*\//; - -function readToken(stream, state) { - // whitespace - if (stream.eatSpace()) return null; - - // comment - if (state.inComment) { - if (stream.match(multilineCommentsEnd)) { - state.inComment = false; - return "comment"; - } - stream.skipToEnd(); - return "comment"; - } - if (stream.match("//")) { - stream.skipToEnd(); - return "comment"; - } - if (stream.match(multilineComments)) return "comment"; - if (stream.match(multilineCommentsStart)) { - state.inComment = true; - return "comment"; - } - - // integer and float - if (stream.match(/^-?[0-9\.]/, false)) { - if (stream.match(integers) || stream.match(floats)) return "number"; - } - - // string - if (stream.match(strings)) return "string"; - - // identifier - if (state.startDef && stream.match(identifiers)) return "def"; - - if (state.endDef && stream.match(identifiersEnd)) { - state.endDef = false; - return "def"; - } - - if (stream.match(keywords)) return "keyword"; - - if (stream.match(types)) { - var lastToken = state.lastToken; - var nextToken = (stream.match(/^\s*(.+?)\b/, false) || [])[1]; - - if (lastToken === ":" || lastToken === "implements" || - nextToken === "implements" || nextToken === "=") { - // Used as identifier - return "builtin"; - } else { - // Used as type - return "variable-3"; - } - } - - if (stream.match(builtins)) return "builtin"; - if (stream.match(atoms)) return "atom"; - if (stream.match(identifiers)) return "variable"; - - // other - if (stream.match(singleOperators)) return "operator"; - - // unrecognized - stream.next(); - return null; -}; - -CodeMirror.defineMode("webidl", function() { - return { - startState: function() { - return { - // Is in multiline comment - inComment: false, - // Last non-whitespace, matched token - lastToken: "", - // Next token is a definition - startDef: false, - // Last token of the statement is a definition - endDef: false - }; - }, - token: function(stream, state) { - var style = readToken(stream, state); - - if (style) { - var cur = stream.current(); - state.lastToken = cur; - if (style === "keyword") { - state.startDef = startDefs.test(cur); - state.endDef = state.endDef || endDefs.test(cur); - } else { - state.startDef = false; - } - } - - return style; - } - }; -}); - -CodeMirror.defineMIME("text/x-webidl", "webidl"); -}); diff --git a/public/plugins/codemirror-5.17.0/mode/xml/index.html b/public/plugins/codemirror-5.17.0/mode/xml/index.html deleted file mode 100644 index c56b8b6eb..000000000 --- a/public/plugins/codemirror-5.17.0/mode/xml/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: XML mode - - - - - - - - - -
    -

    XML mode

    -
    - -

    The XML mode supports these configuration parameters:

    -
    -
    htmlMode (boolean)
    -
    This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as br) do not require a closing tag.
    -
    matchClosing (boolean)
    -
    Controls whether the mode checks that close tags match the - corresponding opening tag, and highlights mismatches as errors. - Defaults to true.
    -
    alignCDATA (boolean)
    -
    Setting this to true will force the opening tag of CDATA - blocks to not be indented.
    -
    - -

    MIME types defined: application/xml, text/html.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/xml/test.js b/public/plugins/codemirror-5.17.0/mode/xml/test.js deleted file mode 100644 index f48156b51..000000000 --- a/public/plugins/codemirror-5.17.0/mode/xml/test.js +++ /dev/null @@ -1,51 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } - - MT("matching", - "[tag&bracket <][tag top][tag&bracket >]", - " text", - " [tag&bracket <][tag inner][tag&bracket />]", - "[tag&bracket ]"); - - MT("nonmatching", - "[tag&bracket <][tag top][tag&bracket >]", - " [tag&bracket <][tag inner][tag&bracket />]", - " [tag&bracket ]"); - - MT("doctype", - "[meta ]", - "[tag&bracket <][tag top][tag&bracket />]"); - - MT("cdata", - "[tag&bracket <][tag top][tag&bracket >]", - " [atom ]", - "[tag&bracket ]"); - - // HTML tests - mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); - - MT("selfclose", - "[tag&bracket <][tag html][tag&bracket >]", - " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", - "[tag&bracket ]"); - - MT("list", - "[tag&bracket <][tag ol][tag&bracket >]", - " [tag&bracket <][tag li][tag&bracket >]one", - " [tag&bracket <][tag li][tag&bracket >]two", - "[tag&bracket ]"); - - MT("valueless", - "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); - - MT("pThenArticle", - "[tag&bracket <][tag p][tag&bracket >]", - " foo", - "[tag&bracket <][tag article][tag&bracket >]bar"); - -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/xml/xml.js b/public/plugins/codemirror-5.17.0/mode/xml/xml.js deleted file mode 100644 index f987a3a3c..000000000 --- a/public/plugins/codemirror-5.17.0/mode/xml/xml.js +++ /dev/null @@ -1,394 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -var htmlConfig = { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true, 'menuitem': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true, - caseFold: true -} - -var xmlConfig = { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false, - caseFold: false -} - -CodeMirror.defineMode("xml", function(editorConf, config_) { - var indentUnit = editorConf.indentUnit - var config = {} - var defaults = config_.htmlMode ? htmlConfig : xmlConfig - for (var prop in defaults) config[prop] = defaults[prop] - for (var prop in config_) config[prop] = config_[prop] - - // Return variables for tokenizers - var type, setStyle; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } else if (stream.match("--")) { - return chain(inBlock("comment", "-->")); - } else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(doctype(1)); - } else { - return null; - } - } else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } else { - type = stream.eat("/") ? "closeTag" : "openTag"; - state.tokenize = inTag; - return "tag bracket"; - } - } else if (ch == "&") { - var ok; - if (stream.eat("#")) { - if (stream.eat("x")) { - ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); - } else { - ok = stream.eatWhile(/[\d]/) && stream.eat(";"); - } - } else { - ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); - } - return ok ? "atom" : "error"; - } else { - stream.eatWhile(/[^&<]/); - return null; - } - } - inText.isInText = true; - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag bracket"; - } else if (ch == "=") { - type = "equals"; - return null; - } else if (ch == "<") { - state.tokenize = inText; - state.state = baseState; - state.tagName = state.tagStart = null; - var next = state.tokenize(stream, state); - return next ? next + " tag error" : "tag error"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - state.stringStartCol = stream.column(); - return state.tokenize(stream, state); - } else { - stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); - return "word"; - } - } - - function inAttribute(quote) { - var closure = function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - closure.isInAttribute = true; - return closure; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - }; - } - function doctype(depth) { - return function(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch == "<") { - state.tokenize = doctype(depth + 1); - return state.tokenize(stream, state); - } else if (ch == ">") { - if (depth == 1) { - state.tokenize = inText; - break; - } else { - state.tokenize = doctype(depth - 1); - return state.tokenize(stream, state); - } - } - } - return "meta"; - }; - } - - function Context(state, tagName, startOfLine) { - this.prev = state.context; - this.tagName = tagName; - this.indent = state.indented; - this.startOfLine = startOfLine; - if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) - this.noIndent = true; - } - function popContext(state) { - if (state.context) state.context = state.context.prev; - } - function maybePopContext(state, nextTagName) { - var parentTagName; - while (true) { - if (!state.context) { - return; - } - parentTagName = state.context.tagName; - if (!config.contextGrabbers.hasOwnProperty(parentTagName) || - !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { - return; - } - popContext(state); - } - } - - function baseState(type, stream, state) { - if (type == "openTag") { - state.tagStart = stream.column(); - return tagNameState; - } else if (type == "closeTag") { - return closeTagNameState; - } else { - return baseState; - } - } - function tagNameState(type, stream, state) { - if (type == "word") { - state.tagName = stream.current(); - setStyle = "tag"; - return attrState; - } else { - setStyle = "error"; - return tagNameState; - } - } - function closeTagNameState(type, stream, state) { - if (type == "word") { - var tagName = stream.current(); - if (state.context && state.context.tagName != tagName && - config.implicitlyClosed.hasOwnProperty(state.context.tagName)) - popContext(state); - if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { - setStyle = "tag"; - return closeState; - } else { - setStyle = "tag error"; - return closeStateErr; - } - } else { - setStyle = "error"; - return closeStateErr; - } - } - - function closeState(type, _stream, state) { - if (type != "endTag") { - setStyle = "error"; - return closeState; - } - popContext(state); - return baseState; - } - function closeStateErr(type, stream, state) { - setStyle = "error"; - return closeState(type, stream, state); - } - - function attrState(type, _stream, state) { - if (type == "word") { - setStyle = "attribute"; - return attrEqState; - } else if (type == "endTag" || type == "selfcloseTag") { - var tagName = state.tagName, tagStart = state.tagStart; - state.tagName = state.tagStart = null; - if (type == "selfcloseTag" || - config.autoSelfClosers.hasOwnProperty(tagName)) { - maybePopContext(state, tagName); - } else { - maybePopContext(state, tagName); - state.context = new Context(state, tagName, tagStart == state.indented); - } - return baseState; - } - setStyle = "error"; - return attrState; - } - function attrEqState(type, stream, state) { - if (type == "equals") return attrValueState; - if (!config.allowMissing) setStyle = "error"; - return attrState(type, stream, state); - } - function attrValueState(type, stream, state) { - if (type == "string") return attrContinuedState; - if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} - setStyle = "error"; - return attrState(type, stream, state); - } - function attrContinuedState(type, stream, state) { - if (type == "string") return attrContinuedState; - return attrState(type, stream, state); - } - - return { - startState: function(baseIndent) { - var state = {tokenize: inText, - state: baseState, - indented: baseIndent || 0, - tagName: null, tagStart: null, - context: null} - if (baseIndent != null) state.baseIndent = baseIndent - return state - }, - - token: function(stream, state) { - if (!state.tagName && stream.sol()) - state.indented = stream.indentation(); - - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - setStyle = null; - state.state = state.state(type || style, stream, state); - if (setStyle) - style = setStyle == "error" ? style + " error" : setStyle; - } - return style; - }, - - indent: function(state, textAfter, fullLine) { - var context = state.context; - // Indent multi-line strings (e.g. css). - if (state.tokenize.isInAttribute) { - if (state.tagStart == state.indented) - return state.stringStartCol + 1; - else - return state.indented + indentUnit; - } - if (context && context.noIndent) return CodeMirror.Pass; - if (state.tokenize != inTag && state.tokenize != inText) - return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; - // Indent the starts of attribute names. - if (state.tagName) { - if (config.multilineTagIndentPastTag !== false) - return state.tagStart + state.tagName.length + 2; - else - return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); - } - if (config.alignCDATA && /$/, - blockCommentStart: "", - - configuration: config.htmlMode ? "html" : "xml", - helperType: config.htmlMode ? "html" : "xml", - - skipAttribute: function(state) { - if (state.state == attrValueState) - state.state = attrState - } - }; -}); - -CodeMirror.defineMIME("text/xml", "xml"); -CodeMirror.defineMIME("application/xml", "xml"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) - CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/xquery/index.html b/public/plugins/codemirror-5.17.0/mode/xquery/index.html deleted file mode 100644 index 7ac5aaeff..000000000 --- a/public/plugins/codemirror-5.17.0/mode/xquery/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - -CodeMirror: XQuery mode - - - - - - - - - - -
    -

    XQuery mode

    - - -
    - -
    - - - -

    MIME types defined: application/xquery.

    - -

    Development of the CodeMirror XQuery mode was sponsored by - MarkLogic and developed by - Mike Brevoort. -

    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/xquery/test.js b/public/plugins/codemirror-5.17.0/mode/xquery/test.js deleted file mode 100644 index 1f148cdbb..000000000 --- a/public/plugins/codemirror-5.17.0/mode/xquery/test.js +++ /dev/null @@ -1,67 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Don't take these too seriously -- the expected results appear to be -// based on the results of actual runs without any serious manual -// verification. If a change you made causes them to fail, the test is -// as likely to wrong as the code. - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("eviltest", - "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", - " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", - " [keyword let] [variable $joe][keyword :=][atom 1]", - " [keyword return] [keyword element] [variable element] {", - " [keyword attribute] [variable attribute] { [atom 1] },", - " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", - " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", - " [keyword //][variable x] } [comment (: a more 'evil' test :)]", - " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", - " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", - " [keyword return] [keyword element] [variable element] {", - " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", - " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", - " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", - " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", - " [keyword //][variable fn:doc]", - " }"); - - MT("testEmptySequenceKeyword", - "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); - - MT("testMultiAttr", - "[tag

    ][variable hello] [variable world][tag

    ]"); - - MT("test namespaced variable", - "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); - - MT("test EQName variable", - "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", - "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); - - MT("test EQName function", - "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", - " [variable $a] [keyword +] [atom 2]", - "}[variable ;]", - "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); - - MT("test EQName function with single quotes", - "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", - " [variable $a] [keyword +] [atom 2]", - "}[variable ;]", - "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); - - MT("testProcessingInstructions", - "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); - - MT("testQuoteEscapeDouble", - "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", - "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); -})(); diff --git a/public/plugins/codemirror-5.17.0/mode/xquery/xquery.js b/public/plugins/codemirror-5.17.0/mode/xquery/xquery.js deleted file mode 100644 index 75dcbee3e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/xquery/xquery.js +++ /dev/null @@ -1,437 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("xquery", function() { - - // The keywords object is set to the result of this self executing - // function. Each keyword is a property of the keywords object whose - // value is {type: atype, style: astyle} - var keywords = function(){ - // convenience functions used to build keywords object - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a") - , B = kw("keyword b") - , C = kw("keyword c") - , operator = kw("operator") - , atom = {type: "atom", style: "atom"} - , punctuation = {type: "punctuation", style: null} - , qualifier = {type: "axis_specifier", style: "qualifier"}; - - // kwObj is what is return from this function at the end - var kwObj = { - 'if': A, 'switch': A, 'while': A, 'for': A, - 'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B, - 'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C, - 'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C, - ',': punctuation, - 'null': atom, 'fn:false()': atom, 'fn:true()': atom - }; - - // a list of 'basic' keywords. For each add a property to kwObj with the value of - // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} - var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before', - 'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self', - 'descending','document','document-node','element','else','eq','every','except','external','following', - 'following-sibling','follows','for','function','if','import','in','instance','intersect','item', - 'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding', - 'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element', - 'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where', - 'xquery', 'empty-sequence']; - for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);}; - - // a list of types. For each add a property to kwObj with the value of - // {type: "atom", style: "atom"} - var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime', - 'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary', - 'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration']; - for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; - - // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} - var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; - for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; - - // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} - var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", - "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; - for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; - - return kwObj; - }(); - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // the primary mode tokenizer - function tokenBase(stream, state) { - var ch = stream.next(), - mightBeFunction = false, - isEQName = isEQNameAhead(stream); - - // an XML tag (if not in some sub, chained tokenizer) - if (ch == "<") { - if(stream.match("!--", true)) - return chain(stream, state, tokenXMLComment); - - if(stream.match("![CDATA", false)) { - state.tokenize = tokenCDATA; - return "tag"; - } - - if(stream.match("?", false)) { - return chain(stream, state, tokenPreProcessing); - } - - var isclose = stream.eat("/"); - stream.eatSpace(); - var tagName = "", c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - - return chain(stream, state, tokenTag(tagName, isclose)); - } - // start code block - else if(ch == "{") { - pushStateStack(state,{ type: "codeblock"}); - return null; - } - // end code block - else if(ch == "}") { - popStateStack(state); - return null; - } - // if we're in an XML block - else if(isInXmlBlock(state)) { - if(ch == ">") - return "tag"; - else if(ch == "/" && stream.eat(">")) { - popStateStack(state); - return "tag"; - } - else - return "variable"; - } - // if a number - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); - return "atom"; - } - // comment start - else if (ch === "(" && stream.eat(":")) { - pushStateStack(state, { type: "comment"}); - return chain(stream, state, tokenComment); - } - // quoted string - else if ( !isEQName && (ch === '"' || ch === "'")) - return chain(stream, state, tokenString(ch)); - // variable - else if(ch === "$") { - return chain(stream, state, tokenVariable); - } - // assignment - else if(ch ===":" && stream.eat("=")) { - return "keyword"; - } - // open paren - else if(ch === "(") { - pushStateStack(state, { type: "paren"}); - return null; - } - // close paren - else if(ch === ")") { - popStateStack(state); - return null; - } - // open paren - else if(ch === "[") { - pushStateStack(state, { type: "bracket"}); - return null; - } - // close paren - else if(ch === "]") { - popStateStack(state); - return null; - } - else { - var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; - - // if there's a EQName ahead, consume the rest of the string portion, it's likely a function - if(isEQName && ch === '\"') while(stream.next() !== '"'){} - if(isEQName && ch === '\'') while(stream.next() !== '\''){} - - // gobble up a word if the character is not known - if(!known) stream.eatWhile(/[\w\$_-]/); - - // gobble a colon in the case that is a lib func type call fn:doc - var foundColon = stream.eat(":"); - - // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier - // which should get matched as a keyword - if(!stream.eat(":") && foundColon) { - stream.eatWhile(/[\w\$_-]/); - } - // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) - if(stream.match(/^[ \t]*\(/, false)) { - mightBeFunction = true; - } - // is the word a keyword? - var word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - // if we think it's a function call but not yet known, - // set style to variable for now for lack of something better - if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; - - // if the previous word was element, attribute, axis specifier, this word should be the name of that - if(isInXmlConstructor(state)) { - popStateStack(state); - return "variable"; - } - // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and - // push the stack so we know to look for it on the next word - if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); - - // if the word is known, return the details of that else just call this a generic 'word' - return known ? known.style : "variable"; - } - } - - // handle comments, including nested - function tokenComment(stream, state) { - var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - if(nestedCount > 0) - nestedCount--; - else { - popStateStack(state); - break; - } - } - else if(ch == ":" && maybeNested) { - nestedCount++; - } - maybeEnd = (ch == ":"); - maybeNested = (ch == "("); - } - - return "comment"; - } - - // tokenizer for string literals - // optionally pass a tokenizer function to set state.tokenize back to when finished - function tokenString(quote, f) { - return function(stream, state) { - var ch; - - if(isInString(state) && stream.current() == quote) { - popStateStack(state); - if(f) state.tokenize = f; - return "string"; - } - - pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); - - // if we're in a string and in an XML block, allow an embedded code block - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return "string"; - } - - - while (ch = stream.next()) { - if (ch == quote) { - popStateStack(state); - if(f) state.tokenize = f; - break; - } - else { - // if we're in a string and in an XML block, allow an embedded code block in an attribute - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return "string"; - } - - } - } - - return "string"; - }; - } - - // tokenizer for variables - function tokenVariable(stream, state) { - var isVariableChar = /[\w\$_-]/; - - // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote - if(stream.eat("\"")) { - while(stream.next() !== '\"'){}; - stream.eat(":"); - } else { - stream.eatWhile(isVariableChar); - if(!stream.match(":=", false)) stream.eat(":"); - } - stream.eatWhile(isVariableChar); - state.tokenize = tokenBase; - return "variable"; - } - - // tokenizer for XML tags - function tokenTag(name, isclose) { - return function(stream, state) { - stream.eatSpace(); - if(isclose && stream.eat(">")) { - popStateStack(state); - state.tokenize = tokenBase; - return "tag"; - } - // self closing tag without attributes? - if(!stream.eat("/")) - pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); - if(!stream.eat(">")) { - state.tokenize = tokenAttribute; - return "tag"; - } - else { - state.tokenize = tokenBase; - } - return "tag"; - }; - } - - // tokenizer for XML attributes - function tokenAttribute(stream, state) { - var ch = stream.next(); - - if(ch == "/" && stream.eat(">")) { - if(isInXmlAttributeBlock(state)) popStateStack(state); - if(isInXmlBlock(state)) popStateStack(state); - return "tag"; - } - if(ch == ">") { - if(isInXmlAttributeBlock(state)) popStateStack(state); - return "tag"; - } - if(ch == "=") - return null; - // quoted string - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch, tokenAttribute)); - - if(!isInXmlAttributeBlock(state)) - pushStateStack(state, { type: "attribute", tokenize: tokenAttribute}); - - stream.eat(/[a-zA-Z_:]/); - stream.eatWhile(/[-a-zA-Z0-9_:.]/); - stream.eatSpace(); - - // the case where the attribute has not value and the tag was closed - if(stream.match(">", false) || stream.match("/", false)) { - popStateStack(state); - state.tokenize = tokenBase; - } - - return "attribute"; - } - - // handle comments, including nested - function tokenXMLComment(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "-" && stream.match("->", true)) { - state.tokenize = tokenBase; - return "comment"; - } - } - } - - - // handle CDATA - function tokenCDATA(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "]" && stream.match("]", true)) { - state.tokenize = tokenBase; - return "comment"; - } - } - } - - // handle preprocessing instructions - function tokenPreProcessing(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "?" && stream.match(">", true)) { - state.tokenize = tokenBase; - return "comment meta"; - } - } - } - - - // functions to test the current context of the state - function isInXmlBlock(state) { return isIn(state, "tag"); } - function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } - function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } - function isInString(state) { return isIn(state, "string"); } - - function isEQNameAhead(stream) { - // assume we've already eaten a quote (") - if(stream.current() === '"') - return stream.match(/^[^\"]+\"\:/, false); - else if(stream.current() === '\'') - return stream.match(/^[^\"]+\'\:/, false); - else - return false; - } - - function isIn(state, type) { - return (state.stack.length && state.stack[state.stack.length - 1].type == type); - } - - function pushStateStack(state, newState) { - state.stack.push(newState); - } - - function popStateStack(state) { - state.stack.pop(); - var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize; - state.tokenize = reinstateTokenize || tokenBase; - } - - // the interface for the mode API - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - stack: [] - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - blockCommentStart: "(:", - blockCommentEnd: ":)" - - }; - -}); - -CodeMirror.defineMIME("application/xquery", "xquery"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/yacas/index.html b/public/plugins/codemirror-5.17.0/mode/yacas/index.html deleted file mode 100644 index 8e52cafb1..000000000 --- a/public/plugins/codemirror-5.17.0/mode/yacas/index.html +++ /dev/null @@ -1,87 +0,0 @@ - - -CodeMirror: yacas mode - - - - - - - - - - -
    -

    yacas mode

    - - - - - - -

    MIME types defined: text/x-yacas (yacas).

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/yacas/yacas.js b/public/plugins/codemirror-5.17.0/mode/yacas/yacas.js deleted file mode 100644 index 30bd60b2f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/yacas/yacas.js +++ /dev/null @@ -1,204 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Yacas mode copyright (c) 2015 by Grzegorz Mazur -// Loosely based on mathematica mode by Calin Barbat - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('yacas', function(_config, _parserConfig) { - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var bodiedOps = words("Assert BackQuote D Defun Deriv For ForEach FromFile " + - "FromString Function Integrate InverseTaylor Limit " + - "LocalSymbols Macro MacroRule MacroRulePattern " + - "NIntegrate Rule RulePattern Subst TD TExplicitSum " + - "TSum Taylor Taylor1 Taylor2 Taylor3 ToFile " + - "ToStdout ToString TraceRule Until While"); - - // patterns - var pFloatForm = "(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)"; - var pIdentifier = "(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)"; - - // regular expressions - var reFloatForm = new RegExp(pFloatForm); - var reIdentifier = new RegExp(pIdentifier); - var rePattern = new RegExp(pIdentifier + "?_" + pIdentifier); - var reFunctionLike = new RegExp(pIdentifier + "\\s*\\("); - - function tokenBase(stream, state) { - var ch; - - // get next character - ch = stream.next(); - - // string - if (ch === '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - - // comment - if (ch === '/') { - if (stream.eat('*')) { - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - - // go back one character - stream.backUp(1); - - // update scope info - var m = stream.match(/^(\w+)\s*\(/, false); - if (m !== null && bodiedOps.hasOwnProperty(m[1])) - state.scopes.push('bodied'); - - var scope = currentScope(state); - - if (scope === 'bodied' && ch === '[') - state.scopes.pop(); - - if (ch === '[' || ch === '{' || ch === '(') - state.scopes.push(ch); - - scope = currentScope(state); - - if (scope === '[' && ch === ']' || - scope === '{' && ch === '}' || - scope === '(' && ch === ')') - state.scopes.pop(); - - if (ch === ';') { - while (scope === 'bodied') { - state.scopes.pop(); - scope = currentScope(state); - } - } - - // look for ordered rules - if (stream.match(/\d+ *#/, true, false)) { - return 'qualifier'; - } - - // look for numbers - if (stream.match(reFloatForm, true, false)) { - return 'number'; - } - - // look for placeholders - if (stream.match(rePattern, true, false)) { - return 'variable-3'; - } - - // match all braces separately - if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { - return 'bracket'; - } - - // literals looking like function calls - if (stream.match(reFunctionLike, true, false)) { - stream.backUp(1); - return 'variable'; - } - - // all other identifiers - if (stream.match(reIdentifier, true, false)) { - return 'variable-2'; - } - - // operators; note that operators like @@ or /; are matched separately for each symbol. - if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { - return 'operator'; - } - - // everything else is an error - return 'error'; - } - - function tokenString(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === '"' && !escaped) { - end = true; - break; - } - escaped = !escaped && next === '\\'; - } - if (end && !escaped) { - state.tokenize = tokenBase; - } - return 'string'; - }; - - function tokenComment(stream, state) { - var prev, next; - while((next = stream.next()) != null) { - if (prev === '*' && next === '/') { - state.tokenize = tokenBase; - break; - } - prev = next; - } - return 'comment'; - } - - function currentScope(state) { - var scope = null; - if (state.scopes.length > 0) - scope = state.scopes[state.scopes.length - 1]; - return scope; - } - - return { - startState: function() { - return { - tokenize: tokenBase, - scopes: [] - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - indent: function(state, textAfter) { - if (state.tokenize !== tokenBase && state.tokenize !== null) - return CodeMirror.Pass; - - var delta = 0; - if (textAfter === ']' || textAfter === '];' || - textAfter === '}' || textAfter === '};' || - textAfter === ');') - delta = -1; - - return (state.scopes.length + delta) * _config.indentUnit; - }, - electricChars: "{}[]();", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME('text/x-yacas', { - name: 'yacas' -}); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/yaml-frontmatter/index.html b/public/plugins/codemirror-5.17.0/mode/yaml-frontmatter/index.html deleted file mode 100644 index 30cb294e8..000000000 --- a/public/plugins/codemirror-5.17.0/mode/yaml-frontmatter/index.html +++ /dev/null @@ -1,121 +0,0 @@ - - -CodeMirror: YAML front matter mode - - - - - - - - - - - - - -
    -

    YAML front matter mode

    -
    - -

    Defines a mode that parses -a YAML frontmatter -at the start of a file, switching to a base mode at the end of that. -Takes a mode configuration option base to configure the -base mode, which defaults to "gfm".

    - - - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/yaml-frontmatter/yaml-frontmatter.js b/public/plugins/codemirror-5.17.0/mode/yaml-frontmatter/yaml-frontmatter.js deleted file mode 100644 index 5f4977237..000000000 --- a/public/plugins/codemirror-5.17.0/mode/yaml-frontmatter/yaml-frontmatter.js +++ /dev/null @@ -1,68 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function (mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../yaml/yaml")) - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../yaml/yaml"], mod) - else // Plain browser env - mod(CodeMirror) -})(function (CodeMirror) { - - var START = 0, FRONTMATTER = 1, BODY = 2 - - // a mixed mode for Markdown text with an optional YAML front matter - CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) { - var yamlMode = CodeMirror.getMode(config, "yaml") - var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm") - - function curMode(state) { - return state.state == BODY ? innerMode : yamlMode - } - - return { - startState: function () { - return { - state: START, - inner: CodeMirror.startState(yamlMode) - } - }, - copyState: function (state) { - return { - state: state.state, - inner: CodeMirror.copyState(curMode(state), state.inner) - } - }, - token: function (stream, state) { - if (state.state == START) { - if (stream.match(/---/, false)) { - state.state = FRONTMATTER - return yamlMode.token(stream, state.inner) - } else { - state.state = BODY - state.inner = CodeMirror.startState(innerMode) - return innerMode.token(stream, state.inner) - } - } else if (state.state == FRONTMATTER) { - var end = stream.sol() && stream.match(/---/, false) - var style = yamlMode.token(stream, state.inner) - if (end) { - state.state = BODY - state.inner = CodeMirror.startState(innerMode) - } - return style - } else { - return innerMode.token(stream, state.inner) - } - }, - innerMode: function (state) { - return {mode: curMode(state), state: state.inner} - }, - blankLine: function (state) { - var mode = curMode(state) - if (mode.blankLine) return mode.blankLine(state.inner) - } - } - }) -}); diff --git a/public/plugins/codemirror-5.17.0/mode/yaml/index.html b/public/plugins/codemirror-5.17.0/mode/yaml/index.html deleted file mode 100644 index be9b63236..000000000 --- a/public/plugins/codemirror-5.17.0/mode/yaml/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - -CodeMirror: YAML mode - - - - - - - - - -
    -

    YAML mode

    -
    - - -

    MIME types defined: text/x-yaml.

    - -
    diff --git a/public/plugins/codemirror-5.17.0/mode/yaml/yaml.js b/public/plugins/codemirror-5.17.0/mode/yaml/yaml.js deleted file mode 100644 index b7015e599..000000000 --- a/public/plugins/codemirror-5.17.0/mode/yaml/yaml.js +++ /dev/null @@ -1,117 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("yaml", function() { - - var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; - var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); - - return { - token: function(stream, state) { - var ch = stream.peek(); - var esc = state.escaped; - state.escaped = false; - /* comments */ - if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) { - stream.skipToEnd(); - return "comment"; - } - - if (stream.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/)) - return "string"; - - if (state.literal && stream.indentation() > state.keyCol) { - stream.skipToEnd(); return "string"; - } else if (state.literal) { state.literal = false; } - if (stream.sol()) { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - /* document start */ - if(stream.match(/---/)) { return "def"; } - /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } - /* array list item */ - if (stream.match(/\s*-\s+/)) { return 'meta'; } - } - /* inline pairs/lists */ - if (stream.match(/^(\{|\}|\[|\])/)) { - if (ch == '{') - state.inlinePairs++; - else if (ch == '}') - state.inlinePairs--; - else if (ch == '[') - state.inlineList++; - else - state.inlineList--; - return 'meta'; - } - - /* list seperator */ - if (state.inlineList > 0 && !esc && ch == ',') { - stream.next(); - return 'meta'; - } - /* pairs seperator */ - if (state.inlinePairs > 0 && !esc && ch == ',') { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - stream.next(); - return 'meta'; - } - - /* start of value of a pair */ - if (state.pairStart) { - /* block literals */ - if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; - /* references */ - if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } - /* numbers */ - if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } - if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } - /* keywords */ - if (stream.match(keywordRegex)) { return 'keyword'; } - } - - /* pairs (associative arrays) -> key */ - if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) { - state.pair = true; - state.keyCol = stream.indentation(); - return "atom"; - } - if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } - - /* nothing found, continue */ - state.pairStart = false; - state.escaped = (ch == '\\'); - stream.next(); - return null; - }, - startState: function() { - return { - pair: false, - pairStart: false, - keyCol: 0, - inlinePairs: 0, - inlineList: 0, - literal: false, - escaped: false - }; - } - }; -}); - -CodeMirror.defineMIME("text/x-yaml", "yaml"); - -}); diff --git a/public/plugins/codemirror-5.17.0/mode/z80/index.html b/public/plugins/codemirror-5.17.0/mode/z80/index.html deleted file mode 100644 index a41b7473e..000000000 --- a/public/plugins/codemirror-5.17.0/mode/z80/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - -CodeMirror: Z80 assembly mode - - - - - - - - - -
    -

    Z80 assembly mode

    - - -
    - - - -

    MIME types defined: text/x-z80, text/x-ez80.

    -
    diff --git a/public/plugins/codemirror-5.17.0/mode/z80/z80.js b/public/plugins/codemirror-5.17.0/mode/z80/z80.js deleted file mode 100644 index aae70216f..000000000 --- a/public/plugins/codemirror-5.17.0/mode/z80/z80.js +++ /dev/null @@ -1,116 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('z80', function(_config, parserConfig) { - var ez80 = parserConfig.ez80; - var keywords1, keywords2; - if (ez80) { - keywords1 = /^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i; - keywords2 = /^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i; - } else { - keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; - keywords2 = /^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i; - } - - var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; - var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; - var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; - var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i; - - return { - startState: function() { - return { - context: 0 - }; - }, - token: function(stream, state) { - if (!stream.column()) - state.context = 0; - - if (stream.eatSpace()) - return null; - - var w; - - if (stream.eatWhile(/\w/)) { - if (ez80 && stream.eat('.')) { - stream.eatWhile(/\w/); - } - w = stream.current(); - - if (stream.indentation()) { - if ((state.context == 1 || state.context == 4) && variables1.test(w)) { - state.context = 4; - return 'var2'; - } - - if (state.context == 2 && variables2.test(w)) { - state.context = 4; - return 'var3'; - } - - if (keywords1.test(w)) { - state.context = 1; - return 'keyword'; - } else if (keywords2.test(w)) { - state.context = 2; - return 'keyword'; - } else if (state.context == 4 && numbers.test(w)) { - return 'number'; - } - - if (errors.test(w)) - return 'error'; - } else if (stream.match(numbers)) { - return 'number'; - } else { - return null; - } - } else if (stream.eat(';')) { - stream.skipToEnd(); - return 'comment'; - } else if (stream.eat('"')) { - while (w = stream.next()) { - if (w == '"') - break; - - if (w == '\\') - stream.next(); - } - return 'string'; - } else if (stream.eat('\'')) { - if (stream.match(/\\?.'/)) - return 'number'; - } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { - state.context = 5; - - if (stream.eatWhile(/\w/)) - return 'def'; - } else if (stream.eat('$')) { - if (stream.eatWhile(/[\da-f]/i)) - return 'number'; - } else if (stream.eat('%')) { - if (stream.eatWhile(/[01]/)) - return 'number'; - } else { - stream.next(); - } - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-z80", "z80"); -CodeMirror.defineMIME("text/x-ez80", { name: "z80", ez80: true }); - -}); diff --git a/public/plugins/dropzone-4.2.0/dropzone.css b/public/plugins/dropzone-4.2.0/dropzone.css deleted file mode 100644 index 0494d1ccf..000000000 --- a/public/plugins/dropzone-4.2.0/dropzone.css +++ /dev/null @@ -1,388 +0,0 @@ -/* - * The MIT License - * Copyright (c) 2012 Matias Meno - */ -@-webkit-keyframes passing-through { - 0% { - opacity: 0; - -webkit-transform: translateY(40px); - -moz-transform: translateY(40px); - -ms-transform: translateY(40px); - -o-transform: translateY(40px); - transform: translateY(40px); } - 30%, 70% { - opacity: 1; - -webkit-transform: translateY(0px); - -moz-transform: translateY(0px); - -ms-transform: translateY(0px); - -o-transform: translateY(0px); - transform: translateY(0px); } - 100% { - opacity: 0; - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); - transform: translateY(-40px); } } -@-moz-keyframes passing-through { - 0% { - opacity: 0; - -webkit-transform: translateY(40px); - -moz-transform: translateY(40px); - -ms-transform: translateY(40px); - -o-transform: translateY(40px); - transform: translateY(40px); } - 30%, 70% { - opacity: 1; - -webkit-transform: translateY(0px); - -moz-transform: translateY(0px); - -ms-transform: translateY(0px); - -o-transform: translateY(0px); - transform: translateY(0px); } - 100% { - opacity: 0; - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); - transform: translateY(-40px); } } -@keyframes passing-through { - 0% { - opacity: 0; - -webkit-transform: translateY(40px); - -moz-transform: translateY(40px); - -ms-transform: translateY(40px); - -o-transform: translateY(40px); - transform: translateY(40px); } - 30%, 70% { - opacity: 1; - -webkit-transform: translateY(0px); - -moz-transform: translateY(0px); - -ms-transform: translateY(0px); - -o-transform: translateY(0px); - transform: translateY(0px); } - 100% { - opacity: 0; - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); - transform: translateY(-40px); } } -@-webkit-keyframes slide-in { - 0% { - opacity: 0; - -webkit-transform: translateY(40px); - -moz-transform: translateY(40px); - -ms-transform: translateY(40px); - -o-transform: translateY(40px); - transform: translateY(40px); } - 30% { - opacity: 1; - -webkit-transform: translateY(0px); - -moz-transform: translateY(0px); - -ms-transform: translateY(0px); - -o-transform: translateY(0px); - transform: translateY(0px); } } -@-moz-keyframes slide-in { - 0% { - opacity: 0; - -webkit-transform: translateY(40px); - -moz-transform: translateY(40px); - -ms-transform: translateY(40px); - -o-transform: translateY(40px); - transform: translateY(40px); } - 30% { - opacity: 1; - -webkit-transform: translateY(0px); - -moz-transform: translateY(0px); - -ms-transform: translateY(0px); - -o-transform: translateY(0px); - transform: translateY(0px); } } -@keyframes slide-in { - 0% { - opacity: 0; - -webkit-transform: translateY(40px); - -moz-transform: translateY(40px); - -ms-transform: translateY(40px); - -o-transform: translateY(40px); - transform: translateY(40px); } - 30% { - opacity: 1; - -webkit-transform: translateY(0px); - -moz-transform: translateY(0px); - -ms-transform: translateY(0px); - -o-transform: translateY(0px); - transform: translateY(0px); } } -@-webkit-keyframes pulse { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); } - 10% { - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -ms-transform: scale(1.1); - -o-transform: scale(1.1); - transform: scale(1.1); } - 20% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); } } -@-moz-keyframes pulse { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); } - 10% { - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -ms-transform: scale(1.1); - -o-transform: scale(1.1); - transform: scale(1.1); } - 20% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); } } -@keyframes pulse { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); } - 10% { - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -ms-transform: scale(1.1); - -o-transform: scale(1.1); - transform: scale(1.1); } - 20% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); } } -.dropzone, .dropzone * { - box-sizing: border-box; } - -.dropzone { - min-height: 150px; - border: 2px solid rgba(0, 0, 0, 0.3); - background: white; - padding: 20px 20px; } - .dropzone.dz-clickable { - cursor: pointer; } - .dropzone.dz-clickable * { - cursor: default; } - .dropzone.dz-clickable .dz-message, .dropzone.dz-clickable .dz-message * { - cursor: pointer; } - .dropzone.dz-started .dz-message { - display: none; } - .dropzone.dz-drag-hover { - border-style: solid; } - .dropzone.dz-drag-hover .dz-message { - opacity: 0.5; } - .dropzone .dz-message { - text-align: center; - margin: 2em 0; } - .dropzone .dz-preview { - position: relative; - display: inline-block; - vertical-align: top; - margin: 16px; - min-height: 100px; } - .dropzone .dz-preview:hover { - z-index: 1000; } - .dropzone .dz-preview:hover .dz-details { - opacity: 1; } - .dropzone .dz-preview.dz-file-preview .dz-image { - border-radius: 20px; - background: #999; - background: linear-gradient(to bottom, #eee, #ddd); } - .dropzone .dz-preview.dz-file-preview .dz-details { - opacity: 1; } - .dropzone .dz-preview.dz-image-preview { - background: white; } - .dropzone .dz-preview.dz-image-preview .dz-details { - -webkit-transition: opacity 0.2s linear; - -moz-transition: opacity 0.2s linear; - -ms-transition: opacity 0.2s linear; - -o-transition: opacity 0.2s linear; - transition: opacity 0.2s linear; } - .dropzone .dz-preview .dz-remove { - font-size: 14px; - text-align: center; - display: block; - cursor: pointer; - border: none; } - .dropzone .dz-preview .dz-remove:hover { - text-decoration: underline; } - .dropzone .dz-preview:hover .dz-details { - opacity: 1; } - .dropzone .dz-preview .dz-details { - z-index: 20; - position: absolute; - top: 0; - left: 0; - opacity: 0; - font-size: 13px; - min-width: 100%; - max-width: 100%; - padding: 2em 1em; - text-align: center; - color: rgba(0, 0, 0, 0.9); - line-height: 150%; } - .dropzone .dz-preview .dz-details .dz-size { - margin-bottom: 1em; - font-size: 16px; } - .dropzone .dz-preview .dz-details .dz-filename { - white-space: nowrap; } - .dropzone .dz-preview .dz-details .dz-filename:hover span { - border: 1px solid rgba(200, 200, 200, 0.8); - background-color: rgba(255, 255, 255, 0.8); } - .dropzone .dz-preview .dz-details .dz-filename:not(:hover) { - overflow: hidden; - text-overflow: ellipsis; } - .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span { - border: 1px solid transparent; } - .dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span { - background-color: rgba(255, 255, 255, 0.4); - padding: 0 0.4em; - border-radius: 3px; } - .dropzone .dz-preview:hover .dz-image img { - -webkit-transform: scale(1.05, 1.05); - -moz-transform: scale(1.05, 1.05); - -ms-transform: scale(1.05, 1.05); - -o-transform: scale(1.05, 1.05); - transform: scale(1.05, 1.05); - -webkit-filter: blur(8px); - filter: blur(8px); } - .dropzone .dz-preview .dz-image { - border-radius: 20px; - overflow: hidden; - width: 120px; - height: 120px; - position: relative; - display: block; - z-index: 10; } - .dropzone .dz-preview .dz-image img { - display: block; } - .dropzone .dz-preview.dz-success .dz-success-mark { - -webkit-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); - -moz-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); - -ms-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); - -o-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); - animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); } - .dropzone .dz-preview.dz-error .dz-error-mark { - opacity: 1; - -webkit-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); - -moz-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); - -ms-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); - -o-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); - animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); } - .dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark { - pointer-events: none; - opacity: 0; - z-index: 500; - position: absolute; - display: block; - top: 50%; - left: 50%; - margin-left: -27px; - margin-top: -27px; } - .dropzone .dz-preview .dz-success-mark svg, .dropzone .dz-preview .dz-error-mark svg { - display: block; - width: 54px; - height: 54px; } - .dropzone .dz-preview.dz-processing .dz-progress { - opacity: 1; - -webkit-transition: all 0.2s linear; - -moz-transition: all 0.2s linear; - -ms-transition: all 0.2s linear; - -o-transition: all 0.2s linear; - transition: all 0.2s linear; } - .dropzone .dz-preview.dz-complete .dz-progress { - opacity: 0; - -webkit-transition: opacity 0.4s ease-in; - -moz-transition: opacity 0.4s ease-in; - -ms-transition: opacity 0.4s ease-in; - -o-transition: opacity 0.4s ease-in; - transition: opacity 0.4s ease-in; } - .dropzone .dz-preview:not(.dz-processing) .dz-progress { - -webkit-animation: pulse 6s ease infinite; - -moz-animation: pulse 6s ease infinite; - -ms-animation: pulse 6s ease infinite; - -o-animation: pulse 6s ease infinite; - animation: pulse 6s ease infinite; } - .dropzone .dz-preview .dz-progress { - opacity: 1; - z-index: 1000; - pointer-events: none; - position: absolute; - height: 16px; - left: 50%; - top: 50%; - margin-top: -8px; - width: 80px; - margin-left: -40px; - background: rgba(255, 255, 255, 0.9); - -webkit-transform: scale(1); - border-radius: 8px; - overflow: hidden; } - .dropzone .dz-preview .dz-progress .dz-upload { - background: #333; - background: linear-gradient(to bottom, #666, #444); - position: absolute; - top: 0; - left: 0; - bottom: 0; - width: 0; - -webkit-transition: width 300ms ease-in-out; - -moz-transition: width 300ms ease-in-out; - -ms-transition: width 300ms ease-in-out; - -o-transition: width 300ms ease-in-out; - transition: width 300ms ease-in-out; } - .dropzone .dz-preview.dz-error .dz-error-message { - display: block; } - .dropzone .dz-preview.dz-error:hover .dz-error-message { - opacity: 1; - pointer-events: auto; } - .dropzone .dz-preview .dz-error-message { - pointer-events: none; - z-index: 1000; - position: absolute; - display: block; - display: none; - opacity: 0; - -webkit-transition: opacity 0.3s ease; - -moz-transition: opacity 0.3s ease; - -ms-transition: opacity 0.3s ease; - -o-transition: opacity 0.3s ease; - transition: opacity 0.3s ease; - border-radius: 8px; - font-size: 13px; - top: 130px; - left: -10px; - width: 140px; - background: #be2626; - background: linear-gradient(to bottom, #be2626, #a92222); - padding: 0.5em 1.2em; - color: white; } - .dropzone .dz-preview .dz-error-message:after { - content: ''; - position: absolute; - top: -6px; - left: 64px; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #be2626; } diff --git a/public/plugins/dropzone-4.2.0/dropzone.js b/public/plugins/dropzone-4.2.0/dropzone.js deleted file mode 100644 index cd7855fbd..000000000 --- a/public/plugins/dropzone-4.2.0/dropzone.js +++ /dev/null @@ -1,1752 +0,0 @@ - -/* - * - * More info at [www.dropzonejs.com](http://www.dropzonejs.com) - * - * Copyright (c) 2012, Matias Meno - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -(function() { - var Dropzone, Emitter, camelize, contentLoaded, detectVerticalSquash, drawImageIOSFix, noop, without, - __slice = [].slice, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - noop = function() {}; - - Emitter = (function() { - function Emitter() {} - - Emitter.prototype.addEventListener = Emitter.prototype.on; - - Emitter.prototype.on = function(event, fn) { - this._callbacks = this._callbacks || {}; - if (!this._callbacks[event]) { - this._callbacks[event] = []; - } - this._callbacks[event].push(fn); - return this; - }; - - Emitter.prototype.emit = function() { - var args, callback, callbacks, event, _i, _len; - event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - this._callbacks = this._callbacks || {}; - callbacks = this._callbacks[event]; - if (callbacks) { - for (_i = 0, _len = callbacks.length; _i < _len; _i++) { - callback = callbacks[_i]; - callback.apply(this, args); - } - } - return this; - }; - - Emitter.prototype.removeListener = Emitter.prototype.off; - - Emitter.prototype.removeAllListeners = Emitter.prototype.off; - - Emitter.prototype.removeEventListener = Emitter.prototype.off; - - Emitter.prototype.off = function(event, fn) { - var callback, callbacks, i, _i, _len; - if (!this._callbacks || arguments.length === 0) { - this._callbacks = {}; - return this; - } - callbacks = this._callbacks[event]; - if (!callbacks) { - return this; - } - if (arguments.length === 1) { - delete this._callbacks[event]; - return this; - } - for (i = _i = 0, _len = callbacks.length; _i < _len; i = ++_i) { - callback = callbacks[i]; - if (callback === fn) { - callbacks.splice(i, 1); - break; - } - } - return this; - }; - - return Emitter; - - })(); - - Dropzone = (function(_super) { - var extend, resolveOption; - - __extends(Dropzone, _super); - - Dropzone.prototype.Emitter = Emitter; - - - /* - This is a list of all available events you can register on a dropzone object. - - You can register an event handler like this: - - dropzone.on("dragEnter", function() { }); - */ - - Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"]; - - Dropzone.prototype.defaultOptions = { - url: null, - method: "post", - withCredentials: false, - parallelUploads: 2, - uploadMultiple: false, - maxFilesize: 256, - paramName: "file", - createImageThumbnails: true, - maxThumbnailFilesize: 10, - thumbnailWidth: 120, - thumbnailHeight: 120, - filesizeBase: 1000, - maxFiles: null, - params: {}, - clickable: true, - ignoreHiddenFiles: true, - acceptedFiles: null, - acceptedMimeTypes: null, - autoProcessQueue: true, - autoQueue: true, - addRemoveLinks: false, - previewsContainer: null, - hiddenInputContainer: "body", - capture: null, - dictDefaultMessage: "Drop files here to upload", - dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", - dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", - dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", - dictInvalidFileType: "You can't upload files of this type.", - dictResponseError: "Server responded with {{statusCode}} code.", - dictCancelUpload: "Cancel upload", - dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", - dictRemoveFile: "Remove file", - dictRemoveFileConfirmation: null, - dictMaxFilesExceeded: "You can not upload any more files.", - accept: function(file, done) { - return done(); - }, - init: function() { - return noop; - }, - forceFallback: false, - fallback: function() { - var child, messageElement, span, _i, _len, _ref; - this.element.className = "" + this.element.className + " dz-browser-not-supported"; - _ref = this.element.getElementsByTagName("div"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - child = _ref[_i]; - if (/(^| )dz-message($| )/.test(child.className)) { - messageElement = child; - child.className = "dz-message"; - continue; - } - } - if (!messageElement) { - messageElement = Dropzone.createElement("
    "); - this.element.appendChild(messageElement); - } - span = messageElement.getElementsByTagName("span")[0]; - if (span) { - if (span.textContent != null) { - span.textContent = this.options.dictFallbackMessage; - } else if (span.innerText != null) { - span.innerText = this.options.dictFallbackMessage; - } - } - return this.element.appendChild(this.getFallbackForm()); - }, - resize: function(file) { - var info, srcRatio, trgRatio; - info = { - srcX: 0, - srcY: 0, - srcWidth: file.width, - srcHeight: file.height - }; - srcRatio = file.width / file.height; - info.optWidth = this.options.thumbnailWidth; - info.optHeight = this.options.thumbnailHeight; - if ((info.optWidth == null) && (info.optHeight == null)) { - info.optWidth = info.srcWidth; - info.optHeight = info.srcHeight; - } else if (info.optWidth == null) { - info.optWidth = srcRatio * info.optHeight; - } else if (info.optHeight == null) { - info.optHeight = (1 / srcRatio) * info.optWidth; - } - trgRatio = info.optWidth / info.optHeight; - if (file.height < info.optHeight || file.width < info.optWidth) { - info.trgHeight = info.srcHeight; - info.trgWidth = info.srcWidth; - } else { - if (srcRatio > trgRatio) { - info.srcHeight = file.height; - info.srcWidth = info.srcHeight * trgRatio; - } else { - info.srcWidth = file.width; - info.srcHeight = info.srcWidth / trgRatio; - } - } - info.srcX = (file.width - info.srcWidth) / 2; - info.srcY = (file.height - info.srcHeight) / 2; - return info; - }, - - /* - Those functions register themselves to the events on init and handle all - the user interface specific stuff. Overwriting them won't break the upload - but can break the way it's displayed. - You can overwrite them if you don't like the default behavior. If you just - want to add an additional event handler, register it on the dropzone object - and don't overwrite those options. - */ - drop: function(e) { - return this.element.classList.remove("dz-drag-hover"); - }, - dragstart: noop, - dragend: function(e) { - return this.element.classList.remove("dz-drag-hover"); - }, - dragenter: function(e) { - return this.element.classList.add("dz-drag-hover"); - }, - dragover: function(e) { - return this.element.classList.add("dz-drag-hover"); - }, - dragleave: function(e) { - return this.element.classList.remove("dz-drag-hover"); - }, - paste: noop, - reset: function() { - return this.element.classList.remove("dz-started"); - }, - addedfile: function(file) { - var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results; - if (this.element === this.previewsContainer) { - this.element.classList.add("dz-started"); - } - if (this.previewsContainer) { - file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim()); - file.previewTemplate = file.previewElement; - this.previewsContainer.appendChild(file.previewElement); - _ref = file.previewElement.querySelectorAll("[data-dz-name]"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - node.textContent = file.name; - } - _ref1 = file.previewElement.querySelectorAll("[data-dz-size]"); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - node = _ref1[_j]; - node.innerHTML = this.filesize(file.size); - } - if (this.options.addRemoveLinks) { - file._removeLink = Dropzone.createElement("" + this.options.dictRemoveFile + ""); - file.previewElement.appendChild(file._removeLink); - } - removeFileEvent = (function(_this) { - return function(e) { - e.preventDefault(); - e.stopPropagation(); - if (file.status === Dropzone.UPLOADING) { - return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function() { - return _this.removeFile(file); - }); - } else { - if (_this.options.dictRemoveFileConfirmation) { - return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function() { - return _this.removeFile(file); - }); - } else { - return _this.removeFile(file); - } - } - }; - })(this); - _ref2 = file.previewElement.querySelectorAll("[data-dz-remove]"); - _results = []; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - removeLink = _ref2[_k]; - _results.push(removeLink.addEventListener("click", removeFileEvent)); - } - return _results; - } - }, - removedfile: function(file) { - var _ref; - if (file.previewElement) { - if ((_ref = file.previewElement) != null) { - _ref.parentNode.removeChild(file.previewElement); - } - } - return this._updateMaxFilesReachedClass(); - }, - thumbnail: function(file, dataUrl) { - var thumbnailElement, _i, _len, _ref; - if (file.previewElement) { - file.previewElement.classList.remove("dz-file-preview"); - _ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - thumbnailElement = _ref[_i]; - thumbnailElement.alt = file.name; - thumbnailElement.src = dataUrl; - } - return setTimeout(((function(_this) { - return function() { - return file.previewElement.classList.add("dz-image-preview"); - }; - })(this)), 1); - } - }, - error: function(file, message) { - var node, _i, _len, _ref, _results; - if (file.previewElement) { - file.previewElement.classList.add("dz-error"); - if (typeof message !== "String" && message.error) { - message = message.error; - } - _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]"); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - _results.push(node.textContent = message); - } - return _results; - } - }, - errormultiple: noop, - processing: function(file) { - if (file.previewElement) { - file.previewElement.classList.add("dz-processing"); - if (file._removeLink) { - return file._removeLink.textContent = this.options.dictCancelUpload; - } - } - }, - processingmultiple: noop, - uploadprogress: function(file, progress, bytesSent) { - var node, _i, _len, _ref, _results; - if (file.previewElement) { - _ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]"); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - if (node.nodeName === 'PROGRESS') { - _results.push(node.value = progress); - } else { - _results.push(node.style.width = "" + progress + "%"); - } - } - return _results; - } - }, - totaluploadprogress: noop, - sending: noop, - sendingmultiple: noop, - success: function(file) { - if (file.previewElement) { - return file.previewElement.classList.add("dz-success"); - } - }, - successmultiple: noop, - canceled: function(file) { - return this.emit("error", file, "Upload canceled."); - }, - canceledmultiple: noop, - complete: function(file) { - if (file._removeLink) { - file._removeLink.textContent = this.options.dictRemoveFile; - } - if (file.previewElement) { - return file.previewElement.classList.add("dz-complete"); - } - }, - completemultiple: noop, - maxfilesexceeded: noop, - maxfilesreached: noop, - queuecomplete: noop, - addedfiles: noop, - previewTemplate: "
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n Check\n \n \n \n \n \n
    \n
    \n \n Error\n \n \n \n \n \n \n \n
    \n
    " - }; - - extend = function() { - var key, object, objects, target, val, _i, _len; - target = arguments[0], objects = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - for (_i = 0, _len = objects.length; _i < _len; _i++) { - object = objects[_i]; - for (key in object) { - val = object[key]; - target[key] = val; - } - } - return target; - }; - - function Dropzone(element, options) { - var elementOptions, fallback, _ref; - this.element = element; - this.version = Dropzone.version; - this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, ""); - this.clickableElements = []; - this.listeners = []; - this.files = []; - if (typeof this.element === "string") { - this.element = document.querySelector(this.element); - } - if (!(this.element && (this.element.nodeType != null))) { - throw new Error("Invalid dropzone element."); - } - if (this.element.dropzone) { - throw new Error("Dropzone already attached."); - } - Dropzone.instances.push(this); - this.element.dropzone = this; - elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {}; - this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {}); - if (this.options.forceFallback || !Dropzone.isBrowserSupported()) { - return this.options.fallback.call(this); - } - if (this.options.url == null) { - this.options.url = this.element.getAttribute("action"); - } - if (!this.options.url) { - throw new Error("No URL provided."); - } - if (this.options.acceptedFiles && this.options.acceptedMimeTypes) { - throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated."); - } - if (this.options.acceptedMimeTypes) { - this.options.acceptedFiles = this.options.acceptedMimeTypes; - delete this.options.acceptedMimeTypes; - } - this.options.method = this.options.method.toUpperCase(); - if ((fallback = this.getExistingFallback()) && fallback.parentNode) { - fallback.parentNode.removeChild(fallback); - } - if (this.options.previewsContainer !== false) { - if (this.options.previewsContainer) { - this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, "previewsContainer"); - } else { - this.previewsContainer = this.element; - } - } - if (this.options.clickable) { - if (this.options.clickable === true) { - this.clickableElements = [this.element]; - } else { - this.clickableElements = Dropzone.getElements(this.options.clickable, "clickable"); - } - } - this.init(); - } - - Dropzone.prototype.getAcceptedFiles = function() { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.accepted) { - _results.push(file); - } - } - return _results; - }; - - Dropzone.prototype.getRejectedFiles = function() { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (!file.accepted) { - _results.push(file); - } - } - return _results; - }; - - Dropzone.prototype.getFilesWithStatus = function(status) { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.status === status) { - _results.push(file); - } - } - return _results; - }; - - Dropzone.prototype.getQueuedFiles = function() { - return this.getFilesWithStatus(Dropzone.QUEUED); - }; - - Dropzone.prototype.getUploadingFiles = function() { - return this.getFilesWithStatus(Dropzone.UPLOADING); - }; - - Dropzone.prototype.getAddedFiles = function() { - return this.getFilesWithStatus(Dropzone.ADDED); - }; - - Dropzone.prototype.getActiveFiles = function() { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED) { - _results.push(file); - } - } - return _results; - }; - - Dropzone.prototype.init = function() { - var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1; - if (this.element.tagName === "form") { - this.element.setAttribute("enctype", "multipart/form-data"); - } - if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) { - this.element.appendChild(Dropzone.createElement("
    " + this.options.dictDefaultMessage + "
    ")); - } - if (this.clickableElements.length) { - setupHiddenFileInput = (function(_this) { - return function() { - if (_this.hiddenFileInput) { - _this.hiddenFileInput.parentNode.removeChild(_this.hiddenFileInput); - } - _this.hiddenFileInput = document.createElement("input"); - _this.hiddenFileInput.setAttribute("type", "file"); - if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) { - _this.hiddenFileInput.setAttribute("multiple", "multiple"); - } - _this.hiddenFileInput.className = "dz-hidden-input"; - if (_this.options.acceptedFiles != null) { - _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles); - } - if (_this.options.capture != null) { - _this.hiddenFileInput.setAttribute("capture", _this.options.capture); - } - _this.hiddenFileInput.style.visibility = "hidden"; - _this.hiddenFileInput.style.position = "absolute"; - _this.hiddenFileInput.style.top = "0"; - _this.hiddenFileInput.style.left = "0"; - _this.hiddenFileInput.style.height = "0"; - _this.hiddenFileInput.style.width = "0"; - document.querySelector(_this.options.hiddenInputContainer).appendChild(_this.hiddenFileInput); - return _this.hiddenFileInput.addEventListener("change", function() { - var file, files, _i, _len; - files = _this.hiddenFileInput.files; - if (files.length) { - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - _this.addFile(file); - } - } - _this.emit("addedfiles", files); - return setupHiddenFileInput(); - }); - }; - })(this); - setupHiddenFileInput(); - } - this.URL = (_ref = window.URL) != null ? _ref : window.webkitURL; - _ref1 = this.events; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - eventName = _ref1[_i]; - this.on(eventName, this.options[eventName]); - } - this.on("uploadprogress", (function(_this) { - return function() { - return _this.updateTotalUploadProgress(); - }; - })(this)); - this.on("removedfile", (function(_this) { - return function() { - return _this.updateTotalUploadProgress(); - }; - })(this)); - this.on("canceled", (function(_this) { - return function(file) { - return _this.emit("complete", file); - }; - })(this)); - this.on("complete", (function(_this) { - return function(file) { - if (_this.getAddedFiles().length === 0 && _this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) { - return setTimeout((function() { - return _this.emit("queuecomplete"); - }), 0); - } - }; - })(this)); - noPropagation = function(e) { - e.stopPropagation(); - if (e.preventDefault) { - return e.preventDefault(); - } else { - return e.returnValue = false; - } - }; - this.listeners = [ - { - element: this.element, - events: { - "dragstart": (function(_this) { - return function(e) { - return _this.emit("dragstart", e); - }; - })(this), - "dragenter": (function(_this) { - return function(e) { - noPropagation(e); - return _this.emit("dragenter", e); - }; - })(this), - "dragover": (function(_this) { - return function(e) { - var efct; - try { - efct = e.dataTransfer.effectAllowed; - } catch (_error) {} - e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy'; - noPropagation(e); - return _this.emit("dragover", e); - }; - })(this), - "dragleave": (function(_this) { - return function(e) { - return _this.emit("dragleave", e); - }; - })(this), - "drop": (function(_this) { - return function(e) { - noPropagation(e); - return _this.drop(e); - }; - })(this), - "dragend": (function(_this) { - return function(e) { - return _this.emit("dragend", e); - }; - })(this) - } - } - ]; - this.clickableElements.forEach((function(_this) { - return function(clickableElement) { - return _this.listeners.push({ - element: clickableElement, - events: { - "click": function(evt) { - if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) { - _this.hiddenFileInput.click(); - } - return true; - } - } - }); - }; - })(this)); - this.enable(); - return this.options.init.call(this); - }; - - Dropzone.prototype.destroy = function() { - var _ref; - this.disable(); - this.removeAllFiles(true); - if ((_ref = this.hiddenFileInput) != null ? _ref.parentNode : void 0) { - this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); - this.hiddenFileInput = null; - } - delete this.element.dropzone; - return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1); - }; - - Dropzone.prototype.updateTotalUploadProgress = function() { - var activeFiles, file, totalBytes, totalBytesSent, totalUploadProgress, _i, _len, _ref; - totalBytesSent = 0; - totalBytes = 0; - activeFiles = this.getActiveFiles(); - if (activeFiles.length) { - _ref = this.getActiveFiles(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - totalBytesSent += file.upload.bytesSent; - totalBytes += file.upload.total; - } - totalUploadProgress = 100 * totalBytesSent / totalBytes; - } else { - totalUploadProgress = 100; - } - return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); - }; - - Dropzone.prototype._getParamName = function(n) { - if (typeof this.options.paramName === "function") { - return this.options.paramName(n); - } else { - return "" + this.options.paramName + (this.options.uploadMultiple ? "[" + n + "]" : ""); - } - }; - - Dropzone.prototype.getFallbackForm = function() { - var existingFallback, fields, fieldsString, form; - if (existingFallback = this.getExistingFallback()) { - return existingFallback; - } - fieldsString = "
    "; - if (this.options.dictFallbackText) { - fieldsString += "

    " + this.options.dictFallbackText + "

    "; - } - fieldsString += "
    "; - fields = Dropzone.createElement(fieldsString); - if (this.element.tagName !== "FORM") { - form = Dropzone.createElement("
    "); - form.appendChild(fields); - } else { - this.element.setAttribute("enctype", "multipart/form-data"); - this.element.setAttribute("method", this.options.method); - } - return form != null ? form : fields; - }; - - Dropzone.prototype.getExistingFallback = function() { - var fallback, getFallback, tagName, _i, _len, _ref; - getFallback = function(elements) { - var el, _i, _len; - for (_i = 0, _len = elements.length; _i < _len; _i++) { - el = elements[_i]; - if (/(^| )fallback($| )/.test(el.className)) { - return el; - } - } - }; - _ref = ["div", "form"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - tagName = _ref[_i]; - if (fallback = getFallback(this.element.getElementsByTagName(tagName))) { - return fallback; - } - } - }; - - Dropzone.prototype.setupEventListeners = function() { - var elementListeners, event, listener, _i, _len, _ref, _results; - _ref = this.listeners; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elementListeners = _ref[_i]; - _results.push((function() { - var _ref1, _results1; - _ref1 = elementListeners.events; - _results1 = []; - for (event in _ref1) { - listener = _ref1[event]; - _results1.push(elementListeners.element.addEventListener(event, listener, false)); - } - return _results1; - })()); - } - return _results; - }; - - Dropzone.prototype.removeEventListeners = function() { - var elementListeners, event, listener, _i, _len, _ref, _results; - _ref = this.listeners; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elementListeners = _ref[_i]; - _results.push((function() { - var _ref1, _results1; - _ref1 = elementListeners.events; - _results1 = []; - for (event in _ref1) { - listener = _ref1[event]; - _results1.push(elementListeners.element.removeEventListener(event, listener, false)); - } - return _results1; - })()); - } - return _results; - }; - - Dropzone.prototype.disable = function() { - var file, _i, _len, _ref, _results; - this.clickableElements.forEach(function(element) { - return element.classList.remove("dz-clickable"); - }); - this.removeEventListeners(); - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - _results.push(this.cancelUpload(file)); - } - return _results; - }; - - Dropzone.prototype.enable = function() { - this.clickableElements.forEach(function(element) { - return element.classList.add("dz-clickable"); - }); - return this.setupEventListeners(); - }; - - Dropzone.prototype.filesize = function(size) { - var cutoff, i, selectedSize, selectedUnit, unit, units, _i, _len; - selectedSize = 0; - selectedUnit = "b"; - if (size > 0) { - units = ['TB', 'GB', 'MB', 'KB', 'b']; - for (i = _i = 0, _len = units.length; _i < _len; i = ++_i) { - unit = units[i]; - cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; - if (size >= cutoff) { - selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); - selectedUnit = unit; - break; - } - } - selectedSize = Math.round(10 * selectedSize) / 10; - } - return "" + selectedSize + " " + selectedUnit; - }; - - Dropzone.prototype._updateMaxFilesReachedClass = function() { - if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) { - if (this.getAcceptedFiles().length === this.options.maxFiles) { - this.emit('maxfilesreached', this.files); - } - return this.element.classList.add("dz-max-files-reached"); - } else { - return this.element.classList.remove("dz-max-files-reached"); - } - }; - - Dropzone.prototype.drop = function(e) { - var files, items; - if (!e.dataTransfer) { - return; - } - this.emit("drop", e); - files = e.dataTransfer.files; - this.emit("addedfiles", files); - if (files.length) { - items = e.dataTransfer.items; - if (items && items.length && (items[0].webkitGetAsEntry != null)) { - this._addFilesFromItems(items); - } else { - this.handleFiles(files); - } - } - }; - - Dropzone.prototype.paste = function(e) { - var items, _ref; - if ((e != null ? (_ref = e.clipboardData) != null ? _ref.items : void 0 : void 0) == null) { - return; - } - this.emit("paste", e); - items = e.clipboardData.items; - if (items.length) { - return this._addFilesFromItems(items); - } - }; - - Dropzone.prototype.handleFiles = function(files) { - var file, _i, _len, _results; - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - _results.push(this.addFile(file)); - } - return _results; - }; - - Dropzone.prototype._addFilesFromItems = function(items) { - var entry, item, _i, _len, _results; - _results = []; - for (_i = 0, _len = items.length; _i < _len; _i++) { - item = items[_i]; - if ((item.webkitGetAsEntry != null) && (entry = item.webkitGetAsEntry())) { - if (entry.isFile) { - _results.push(this.addFile(item.getAsFile())); - } else if (entry.isDirectory) { - _results.push(this._addFilesFromDirectory(entry, entry.name)); - } else { - _results.push(void 0); - } - } else if (item.getAsFile != null) { - if ((item.kind == null) || item.kind === "file") { - _results.push(this.addFile(item.getAsFile())); - } else { - _results.push(void 0); - } - } else { - _results.push(void 0); - } - } - return _results; - }; - - Dropzone.prototype._addFilesFromDirectory = function(directory, path) { - var dirReader, entriesReader; - dirReader = directory.createReader(); - entriesReader = (function(_this) { - return function(entries) { - var entry, _i, _len; - for (_i = 0, _len = entries.length; _i < _len; _i++) { - entry = entries[_i]; - if (entry.isFile) { - entry.file(function(file) { - if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') { - return; - } - file.fullPath = "" + path + "/" + file.name; - return _this.addFile(file); - }); - } else if (entry.isDirectory) { - _this._addFilesFromDirectory(entry, "" + path + "/" + entry.name); - } - } - }; - })(this); - return dirReader.readEntries(entriesReader, function(error) { - return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0; - }); - }; - - Dropzone.prototype.accept = function(file, done) { - if (file.size > this.options.maxFilesize * 1024 * 1024) { - return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); - } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) { - return done(this.options.dictInvalidFileType); - } else if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) { - done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); - return this.emit("maxfilesexceeded", file); - } else { - return this.options.accept.call(this, file, done); - } - }; - - Dropzone.prototype.addFile = function(file) { - file.upload = { - progress: 0, - total: file.size, - bytesSent: 0 - }; - this.files.push(file); - file.status = Dropzone.ADDED; - this.emit("addedfile", file); - this._enqueueThumbnail(file); - return this.accept(file, (function(_this) { - return function(error) { - if (error) { - file.accepted = false; - _this._errorProcessing([file], error); - } else { - file.accepted = true; - if (_this.options.autoQueue) { - _this.enqueueFile(file); - } - } - return _this._updateMaxFilesReachedClass(); - }; - })(this)); - }; - - Dropzone.prototype.enqueueFiles = function(files) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - this.enqueueFile(file); - } - return null; - }; - - Dropzone.prototype.enqueueFile = function(file) { - if (file.status === Dropzone.ADDED && file.accepted === true) { - file.status = Dropzone.QUEUED; - if (this.options.autoProcessQueue) { - return setTimeout(((function(_this) { - return function() { - return _this.processQueue(); - }; - })(this)), 0); - } - } else { - throw new Error("This file can't be queued because it has already been processed or was rejected."); - } - }; - - Dropzone.prototype._thumbnailQueue = []; - - Dropzone.prototype._processingThumbnail = false; - - Dropzone.prototype._enqueueThumbnail = function(file) { - if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) { - this._thumbnailQueue.push(file); - return setTimeout(((function(_this) { - return function() { - return _this._processThumbnailQueue(); - }; - })(this)), 0); - } - }; - - Dropzone.prototype._processThumbnailQueue = function() { - if (this._processingThumbnail || this._thumbnailQueue.length === 0) { - return; - } - this._processingThumbnail = true; - return this.createThumbnail(this._thumbnailQueue.shift(), (function(_this) { - return function() { - _this._processingThumbnail = false; - return _this._processThumbnailQueue(); - }; - })(this)); - }; - - Dropzone.prototype.removeFile = function(file) { - if (file.status === Dropzone.UPLOADING) { - this.cancelUpload(file); - } - this.files = without(this.files, file); - this.emit("removedfile", file); - if (this.files.length === 0) { - return this.emit("reset"); - } - }; - - Dropzone.prototype.removeAllFiles = function(cancelIfNecessary) { - var file, _i, _len, _ref; - if (cancelIfNecessary == null) { - cancelIfNecessary = false; - } - _ref = this.files.slice(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) { - this.removeFile(file); - } - } - return null; - }; - - Dropzone.prototype.createThumbnail = function(file, callback) { - var fileReader; - fileReader = new FileReader; - fileReader.onload = (function(_this) { - return function() { - if (file.type === "image/svg+xml") { - _this.emit("thumbnail", file, fileReader.result); - if (callback != null) { - callback(); - } - return; - } - return _this.createThumbnailFromUrl(file, fileReader.result, callback); - }; - })(this); - return fileReader.readAsDataURL(file); - }; - - Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback, crossOrigin) { - var img; - img = document.createElement("img"); - if (crossOrigin) { - img.crossOrigin = crossOrigin; - } - img.onload = (function(_this) { - return function() { - var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3; - file.width = img.width; - file.height = img.height; - resizeInfo = _this.options.resize.call(_this, file); - if (resizeInfo.trgWidth == null) { - resizeInfo.trgWidth = resizeInfo.optWidth; - } - if (resizeInfo.trgHeight == null) { - resizeInfo.trgHeight = resizeInfo.optHeight; - } - canvas = document.createElement("canvas"); - ctx = canvas.getContext("2d"); - canvas.width = resizeInfo.trgWidth; - canvas.height = resizeInfo.trgHeight; - drawImageIOSFix(ctx, img, (_ref = resizeInfo.srcX) != null ? _ref : 0, (_ref1 = resizeInfo.srcY) != null ? _ref1 : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, (_ref2 = resizeInfo.trgX) != null ? _ref2 : 0, (_ref3 = resizeInfo.trgY) != null ? _ref3 : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); - thumbnail = canvas.toDataURL("image/png"); - _this.emit("thumbnail", file, thumbnail); - if (callback != null) { - return callback(); - } - }; - })(this); - if (callback != null) { - img.onerror = callback; - } - return img.src = imageUrl; - }; - - Dropzone.prototype.processQueue = function() { - var i, parallelUploads, processingLength, queuedFiles; - parallelUploads = this.options.parallelUploads; - processingLength = this.getUploadingFiles().length; - i = processingLength; - if (processingLength >= parallelUploads) { - return; - } - queuedFiles = this.getQueuedFiles(); - if (!(queuedFiles.length > 0)) { - return; - } - if (this.options.uploadMultiple) { - return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); - } else { - while (i < parallelUploads) { - if (!queuedFiles.length) { - return; - } - this.processFile(queuedFiles.shift()); - i++; - } - } - }; - - Dropzone.prototype.processFile = function(file) { - return this.processFiles([file]); - }; - - Dropzone.prototype.processFiles = function(files) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - file.processing = true; - file.status = Dropzone.UPLOADING; - this.emit("processing", file); - } - if (this.options.uploadMultiple) { - this.emit("processingmultiple", files); - } - return this.uploadFiles(files); - }; - - Dropzone.prototype._getFilesWithXhr = function(xhr) { - var file, files; - return files = (function() { - var _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.xhr === xhr) { - _results.push(file); - } - } - return _results; - }).call(this); - }; - - Dropzone.prototype.cancelUpload = function(file) { - var groupedFile, groupedFiles, _i, _j, _len, _len1, _ref; - if (file.status === Dropzone.UPLOADING) { - groupedFiles = this._getFilesWithXhr(file.xhr); - for (_i = 0, _len = groupedFiles.length; _i < _len; _i++) { - groupedFile = groupedFiles[_i]; - groupedFile.status = Dropzone.CANCELED; - } - file.xhr.abort(); - for (_j = 0, _len1 = groupedFiles.length; _j < _len1; _j++) { - groupedFile = groupedFiles[_j]; - this.emit("canceled", groupedFile); - } - if (this.options.uploadMultiple) { - this.emit("canceledmultiple", groupedFiles); - } - } else if ((_ref = file.status) === Dropzone.ADDED || _ref === Dropzone.QUEUED) { - file.status = Dropzone.CANCELED; - this.emit("canceled", file); - if (this.options.uploadMultiple) { - this.emit("canceledmultiple", [file]); - } - } - if (this.options.autoProcessQueue) { - return this.processQueue(); - } - }; - - resolveOption = function() { - var args, option; - option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - if (typeof option === 'function') { - return option.apply(this, args); - } - return option; - }; - - Dropzone.prototype.uploadFile = function(file) { - return this.uploadFiles([file]); - }; - - Dropzone.prototype.uploadFiles = function(files) { - var file, formData, handleError, headerName, headerValue, headers, i, input, inputName, inputType, key, method, option, progressObj, response, updateProgress, url, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - xhr = new XMLHttpRequest(); - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - file.xhr = xhr; - } - method = resolveOption(this.options.method, files); - url = resolveOption(this.options.url, files); - xhr.open(method, url, true); - xhr.withCredentials = !!this.options.withCredentials; - response = null; - handleError = (function(_this) { - return function() { - var _j, _len1, _results; - _results = []; - for (_j = 0, _len1 = files.length; _j < _len1; _j++) { - file = files[_j]; - _results.push(_this._errorProcessing(files, response || _this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr)); - } - return _results; - }; - })(this); - updateProgress = (function(_this) { - return function(e) { - var allFilesFinished, progress, _j, _k, _l, _len1, _len2, _len3, _results; - if (e != null) { - progress = 100 * e.loaded / e.total; - for (_j = 0, _len1 = files.length; _j < _len1; _j++) { - file = files[_j]; - file.upload = { - progress: progress, - total: e.total, - bytesSent: e.loaded - }; - } - } else { - allFilesFinished = true; - progress = 100; - for (_k = 0, _len2 = files.length; _k < _len2; _k++) { - file = files[_k]; - if (!(file.upload.progress === 100 && file.upload.bytesSent === file.upload.total)) { - allFilesFinished = false; - } - file.upload.progress = progress; - file.upload.bytesSent = file.upload.total; - } - if (allFilesFinished) { - return; - } - } - _results = []; - for (_l = 0, _len3 = files.length; _l < _len3; _l++) { - file = files[_l]; - _results.push(_this.emit("uploadprogress", file, progress, file.upload.bytesSent)); - } - return _results; - }; - })(this); - xhr.onload = (function(_this) { - return function(e) { - var _ref; - if (files[0].status === Dropzone.CANCELED) { - return; - } - if (xhr.readyState !== 4) { - return; - } - response = xhr.responseText; - if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) { - try { - response = JSON.parse(response); - } catch (_error) { - e = _error; - response = "Invalid JSON response from server."; - } - } - updateProgress(); - if (!((200 <= (_ref = xhr.status) && _ref < 300))) { - return handleError(); - } else { - return _this._finished(files, response, e); - } - }; - })(this); - xhr.onerror = (function(_this) { - return function() { - if (files[0].status === Dropzone.CANCELED) { - return; - } - return handleError(); - }; - })(this); - progressObj = (_ref = xhr.upload) != null ? _ref : xhr; - progressObj.onprogress = updateProgress; - headers = { - "Accept": "application/json", - "Cache-Control": "no-cache", - "X-Requested-With": "XMLHttpRequest" - }; - if (this.options.headers) { - extend(headers, this.options.headers); - } - for (headerName in headers) { - headerValue = headers[headerName]; - if (headerValue) { - xhr.setRequestHeader(headerName, headerValue); - } - } - formData = new FormData(); - if (this.options.params) { - _ref1 = this.options.params; - for (key in _ref1) { - value = _ref1[key]; - formData.append(key, value); - } - } - for (_j = 0, _len1 = files.length; _j < _len1; _j++) { - file = files[_j]; - this.emit("sending", file, xhr, formData); - } - if (this.options.uploadMultiple) { - this.emit("sendingmultiple", files, xhr, formData); - } - if (this.element.tagName === "FORM") { - _ref2 = this.element.querySelectorAll("input, textarea, select, button"); - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - input = _ref2[_k]; - inputName = input.getAttribute("name"); - inputType = input.getAttribute("type"); - if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { - _ref3 = input.options; - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - option = _ref3[_l]; - if (option.selected) { - formData.append(inputName, option.value); - } - } - } else if (!inputType || ((_ref4 = inputType.toLowerCase()) !== "checkbox" && _ref4 !== "radio") || input.checked) { - formData.append(inputName, input.value); - } - } - } - for (i = _m = 0, _ref5 = files.length - 1; 0 <= _ref5 ? _m <= _ref5 : _m >= _ref5; i = 0 <= _ref5 ? ++_m : --_m) { - formData.append(this._getParamName(i), files[i], files[i].name); - } - return this.submitRequest(xhr, formData, files); - }; - - Dropzone.prototype.submitRequest = function(xhr, formData, files) { - return xhr.send(formData); - }; - - Dropzone.prototype._finished = function(files, responseText, e) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - file.status = Dropzone.SUCCESS; - this.emit("success", file, responseText, e); - this.emit("complete", file); - } - if (this.options.uploadMultiple) { - this.emit("successmultiple", files, responseText, e); - this.emit("completemultiple", files); - } - if (this.options.autoProcessQueue) { - return this.processQueue(); - } - }; - - Dropzone.prototype._errorProcessing = function(files, message, xhr) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - file.status = Dropzone.ERROR; - this.emit("error", file, message, xhr); - this.emit("complete", file); - } - if (this.options.uploadMultiple) { - this.emit("errormultiple", files, message, xhr); - this.emit("completemultiple", files); - } - if (this.options.autoProcessQueue) { - return this.processQueue(); - } - }; - - return Dropzone; - - })(Emitter); - - Dropzone.version = "4.2.0"; - - Dropzone.options = {}; - - Dropzone.optionsForElement = function(element) { - if (element.getAttribute("id")) { - return Dropzone.options[camelize(element.getAttribute("id"))]; - } else { - return void 0; - } - }; - - Dropzone.instances = []; - - Dropzone.forElement = function(element) { - if (typeof element === "string") { - element = document.querySelector(element); - } - if ((element != null ? element.dropzone : void 0) == null) { - throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); - } - return element.dropzone; - }; - - Dropzone.autoDiscover = true; - - Dropzone.discover = function() { - var checkElements, dropzone, dropzones, _i, _len, _results; - if (document.querySelectorAll) { - dropzones = document.querySelectorAll(".dropzone"); - } else { - dropzones = []; - checkElements = function(elements) { - var el, _i, _len, _results; - _results = []; - for (_i = 0, _len = elements.length; _i < _len; _i++) { - el = elements[_i]; - if (/(^| )dropzone($| )/.test(el.className)) { - _results.push(dropzones.push(el)); - } else { - _results.push(void 0); - } - } - return _results; - }; - checkElements(document.getElementsByTagName("div")); - checkElements(document.getElementsByTagName("form")); - } - _results = []; - for (_i = 0, _len = dropzones.length; _i < _len; _i++) { - dropzone = dropzones[_i]; - if (Dropzone.optionsForElement(dropzone) !== false) { - _results.push(new Dropzone(dropzone)); - } else { - _results.push(void 0); - } - } - return _results; - }; - - Dropzone.blacklistedBrowsers = [/opera.*Macintosh.*version\/12/i]; - - Dropzone.isBrowserSupported = function() { - var capableBrowser, regex, _i, _len, _ref; - capableBrowser = true; - if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) { - if (!("classList" in document.createElement("a"))) { - capableBrowser = false; - } else { - _ref = Dropzone.blacklistedBrowsers; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - regex = _ref[_i]; - if (regex.test(navigator.userAgent)) { - capableBrowser = false; - continue; - } - } - } - } else { - capableBrowser = false; - } - return capableBrowser; - }; - - without = function(list, rejectedItem) { - var item, _i, _len, _results; - _results = []; - for (_i = 0, _len = list.length; _i < _len; _i++) { - item = list[_i]; - if (item !== rejectedItem) { - _results.push(item); - } - } - return _results; - }; - - camelize = function(str) { - return str.replace(/[\-_](\w)/g, function(match) { - return match.charAt(1).toUpperCase(); - }); - }; - - Dropzone.createElement = function(string) { - var div; - div = document.createElement("div"); - div.innerHTML = string; - return div.childNodes[0]; - }; - - Dropzone.elementInside = function(element, container) { - if (element === container) { - return true; - } - while (element = element.parentNode) { - if (element === container) { - return true; - } - } - return false; - }; - - Dropzone.getElement = function(el, name) { - var element; - if (typeof el === "string") { - element = document.querySelector(el); - } else if (el.nodeType != null) { - element = el; - } - if (element == null) { - throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element."); - } - return element; - }; - - Dropzone.getElements = function(els, name) { - var e, el, elements, _i, _j, _len, _len1, _ref; - if (els instanceof Array) { - elements = []; - try { - for (_i = 0, _len = els.length; _i < _len; _i++) { - el = els[_i]; - elements.push(this.getElement(el, name)); - } - } catch (_error) { - e = _error; - elements = null; - } - } else if (typeof els === "string") { - elements = []; - _ref = document.querySelectorAll(els); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - el = _ref[_j]; - elements.push(el); - } - } else if (els.nodeType != null) { - elements = [els]; - } - if (!((elements != null) && elements.length)) { - throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those."); - } - return elements; - }; - - Dropzone.confirm = function(question, accepted, rejected) { - if (window.confirm(question)) { - return accepted(); - } else if (rejected != null) { - return rejected(); - } - }; - - Dropzone.isValidFile = function(file, acceptedFiles) { - var baseMimeType, mimeType, validType, _i, _len; - if (!acceptedFiles) { - return true; - } - acceptedFiles = acceptedFiles.split(","); - mimeType = file.type; - baseMimeType = mimeType.replace(/\/.*$/, ""); - for (_i = 0, _len = acceptedFiles.length; _i < _len; _i++) { - validType = acceptedFiles[_i]; - validType = validType.trim(); - if (validType.charAt(0) === ".") { - if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) { - return true; - } - } else if (/\/\*$/.test(validType)) { - if (baseMimeType === validType.replace(/\/.*$/, "")) { - return true; - } - } else { - if (mimeType === validType) { - return true; - } - } - } - return false; - }; - - if (typeof jQuery !== "undefined" && jQuery !== null) { - jQuery.fn.dropzone = function(options) { - return this.each(function() { - return new Dropzone(this, options); - }); - }; - } - - if (typeof module !== "undefined" && module !== null) { - module.exports = Dropzone; - } else { - window.Dropzone = Dropzone; - } - - Dropzone.ADDED = "added"; - - Dropzone.QUEUED = "queued"; - - Dropzone.ACCEPTED = Dropzone.QUEUED; - - Dropzone.UPLOADING = "uploading"; - - Dropzone.PROCESSING = Dropzone.UPLOADING; - - Dropzone.CANCELED = "canceled"; - - Dropzone.ERROR = "error"; - - Dropzone.SUCCESS = "success"; - - - /* - - Bugfix for iOS 6 and 7 - Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios - based on the work of https://github.com/stomita/ios-imagefile-megapixel - */ - - detectVerticalSquash = function(img) { - var alpha, canvas, ctx, data, ey, ih, iw, py, ratio, sy; - iw = img.naturalWidth; - ih = img.naturalHeight; - canvas = document.createElement("canvas"); - canvas.width = 1; - canvas.height = ih; - ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - data = ctx.getImageData(0, 0, 1, ih).data; - sy = 0; - ey = ih; - py = ih; - while (py > sy) { - alpha = data[(py - 1) * 4 + 3]; - if (alpha === 0) { - ey = py; - } else { - sy = py; - } - py = (ey + sy) >> 1; - } - ratio = py / ih; - if (ratio === 0) { - return 1; - } else { - return ratio; - } - }; - - drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { - var vertSquashRatio; - vertSquashRatio = detectVerticalSquash(img); - return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); - }; - - - /* - * contentloaded.js - * - * Author: Diego Perini (diego.perini at gmail.com) - * Summary: cross-browser wrapper for DOMContentLoaded - * Updated: 20101020 - * License: MIT - * Version: 1.2 - * - * URL: - * http://javascript.nwbox.com/ContentLoaded/ - * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE - */ - - contentLoaded = function(win, fn) { - var add, doc, done, init, poll, pre, rem, root, top; - done = false; - top = true; - doc = win.document; - root = doc.documentElement; - add = (doc.addEventListener ? "addEventListener" : "attachEvent"); - rem = (doc.addEventListener ? "removeEventListener" : "detachEvent"); - pre = (doc.addEventListener ? "" : "on"); - init = function(e) { - if (e.type === "readystatechange" && doc.readyState !== "complete") { - return; - } - (e.type === "load" ? win : doc)[rem](pre + e.type, init, false); - if (!done && (done = true)) { - return fn.call(win, e.type || e); - } - }; - poll = function() { - var e; - try { - root.doScroll("left"); - } catch (_error) { - e = _error; - setTimeout(poll, 50); - return; - } - return init("poll"); - }; - if (doc.readyState !== "complete") { - if (doc.createEventObject && root.doScroll) { - try { - top = !win.frameElement; - } catch (_error) {} - if (top) { - poll(); - } - } - doc[add](pre + "DOMContentLoaded", init, false); - doc[add](pre + "readystatechange", init, false); - return win[add](pre + "load", init, false); - } - }; - - Dropzone._autoDiscoverFunction = function() { - if (Dropzone.autoDiscover) { - return Dropzone.discover(); - } - }; - - contentLoaded(window, Dropzone._autoDiscoverFunction); - -}).call(this); diff --git a/public/plugins/highlight-9.6.0/default.css b/public/plugins/highlight-9.6.0/default.css deleted file mode 100644 index f1bfade31..000000000 --- a/public/plugins/highlight-9.6.0/default.css +++ /dev/null @@ -1,99 +0,0 @@ -/* - -Original highlight.js style (c) Ivan Sagalaev - -*/ - -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #F0F0F0; -} - - -/* Base color: saturation 0; */ - -.hljs, -.hljs-subst { - color: #444; -} - -.hljs-comment { - color: #888888; -} - -.hljs-keyword, -.hljs-attribute, -.hljs-selector-tag, -.hljs-meta-keyword, -.hljs-doctag, -.hljs-name { - font-weight: bold; -} - - -/* User color: hue: 0 */ - -.hljs-type, -.hljs-string, -.hljs-number, -.hljs-selector-id, -.hljs-selector-class, -.hljs-quote, -.hljs-template-tag, -.hljs-deletion { - color: #880000; -} - -.hljs-title, -.hljs-section { - color: #880000; - font-weight: bold; -} - -.hljs-regexp, -.hljs-symbol, -.hljs-variable, -.hljs-template-variable, -.hljs-link, -.hljs-selector-attr, -.hljs-selector-pseudo { - color: #BC6060; -} - - -/* Language color: hue: 90; */ - -.hljs-literal { - color: #78A960; -} - -.hljs-built_in, -.hljs-bullet, -.hljs-code, -.hljs-addition { - color: #397300; -} - - -/* Meta color: hue: 200 */ - -.hljs-meta { - color: #1f7199; -} - -.hljs-meta-string { - color: #4d99bf; -} - - -/* Misc effects */ - -.hljs-emphasis { - font-style: italic; -} - -.hljs-strong { - font-weight: bold; -} diff --git a/public/plugins/highlight-9.6.0/github.css b/public/plugins/highlight-9.6.0/github.css deleted file mode 100644 index 791932b87..000000000 --- a/public/plugins/highlight-9.6.0/github.css +++ /dev/null @@ -1,99 +0,0 @@ -/* - -github.com style (c) Vasily Polovnyov - -*/ - -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - color: #333; - background: #f8f8f8; -} - -.hljs-comment, -.hljs-quote { - color: #998; - font-style: italic; -} - -.hljs-keyword, -.hljs-selector-tag, -.hljs-subst { - color: #333; - font-weight: bold; -} - -.hljs-number, -.hljs-literal, -.hljs-variable, -.hljs-template-variable, -.hljs-tag .hljs-attr { - color: #008080; -} - -.hljs-string, -.hljs-doctag { - color: #d14; -} - -.hljs-title, -.hljs-section, -.hljs-selector-id { - color: #900; - font-weight: bold; -} - -.hljs-subst { - font-weight: normal; -} - -.hljs-type, -.hljs-class .hljs-title { - color: #458; - font-weight: bold; -} - -.hljs-tag, -.hljs-name, -.hljs-attribute { - color: #000080; - font-weight: normal; -} - -.hljs-regexp, -.hljs-link { - color: #009926; -} - -.hljs-symbol, -.hljs-bullet { - color: #990073; -} - -.hljs-built_in, -.hljs-builtin-name { - color: #0086b3; -} - -.hljs-meta { - color: #999; - font-weight: bold; -} - -.hljs-deletion { - background: #fdd; -} - -.hljs-addition { - background: #dfd; -} - -.hljs-emphasis { - font-style: italic; -} - -.hljs-strong { - font-weight: bold; -} diff --git a/public/plugins/highlight-9.6.0/highlight.pack.js b/public/plugins/highlight-9.6.0/highlight.pack.js deleted file mode 100644 index 962b62822..000000000 --- a/public/plugins/highlight-9.6.0/highlight.pack.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! highlight.js v9.6.0 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return R(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||R(i))return i}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){l+=""}function c(e){("start"===e.event?o:u)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=i();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(a.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):E(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"===e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function l(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var a=r?"":y.classPrefix,i='',i+n+o}function p(){var e,t,r,a;if(!E.k)return n(B);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(B);r;)a+=n(B.substr(t,r.index-t)),e=g(E,r),e?(M+=e[1],a+=h(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(B);return a+n(B.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!x[E.sL])return n(B);var t=e?l(E.sL,B,!0,L[E.sL]):f(B,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(L[E.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){k+=null!=E.sL?d():p(),B=""}function v(e){k+=e.cN?h(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(B+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?B+=n:(t.eB&&(B+=n),b(),t.rB||t.eB||(B=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?B+=n:(a.rE||a.eE||(B+=n),b(),a.eE&&(B=n));do E.cN&&(k+=C),E.skip||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return B+=n,n.length||1}var N=R(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var w,E=i||N,L={},k="";for(w=E;w!==N;w=w.parent)w.cN&&(k=h(w.cN,"",!0)+k);var B="",M=0;try{for(var I,j,O=0;;){if(E.t.lastIndex=O,I=E.t.exec(t),!I)break;j=m(t.substr(O,I.index-O),I[0]),O=I.index+j}for(m(t.substr(O)),w=E;w.parent;w=w.parent)w.cN&&(k+=C);return{r:M,value:k,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function f(e,t){t=t||y.languages||E(x);var r={r:0,value:n(e)},a=r;return t.filter(R).forEach(function(n){var t=l(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function g(e){return y.tabReplace||y.useBR?e.replace(M,function(e,n){return y.useBR&&"\n"===e?"
    ":y.tabReplace?n.replace(/\t/g,y.tabReplace):void 0}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n,t,r,o,s,p=i(e);a(p)||(y.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,s=n.textContent,r=p?l(p,s,!0):f(s),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),s)),r.value=g(r.value),e.innerHTML=r.value,e.className=h(e.className,p,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function d(e){y=o(y,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");w.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function N(){return E(x)}function R(e){return e=(e||"").toLowerCase(),x[e]||x[L[e]]}var w=[],E=Object.keys,x={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="
    ",y={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},I={"&":"&","<":"<",">":">"};return e.highlight=l,e.highlightAuto=f,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=R,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage("dns",function(d){return{aliases:["bind","zone"],k:{keyword:"IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT"},c:[d.C(";","$",{r:0}),{cN:"meta",b:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{cN:"number",b:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"},{cN:"number",b:"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"},d.inherit(d.NM,{b:/\b\d+[dhwm]?/})]}});hljs.registerLanguage("zephir",function(e){var i={cN:"string",c:[e.BE],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["zep"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var let while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally int uint long ulong char uchar double float bool boolean stringlikely unlikely",c:[e.CLCM,e.HCM,e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",e.CBCM,i,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},i,n]}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal dynamic default delegate do double else enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long when object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async nameof ascending descending from get group into join let orderby partial select set value var where yield",literal:"null false true"},r={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},t=e.inherit(r,{i:/\n/}),n={cN:"subst",b:"{",e:"}",k:i},c=e.inherit(n,{i:/\n/}),a={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,c]},s={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},n]},o=e.inherit(s,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},c]});n.c=[s,a,r,e.ASM,e.QSM,e.CNM,e.CBCM],c.c=[o,a,t,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\n/})];var l={v:[s,a,r,e.ASM,e.QSM]},b=e.IR+"(<"+e.IR+">)?(\\[\\])?";return{aliases:["csharp"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:""},{b:""}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},l,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+b+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("basic",function(E){return{cI:!0,i:"^.",l:"[a-zA-Z][a-zA-Z0-9_$%!#]*",k:{keyword:"ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO HEX$ IF|0 THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE WEND WIDTH WINDOW WRITE XOR"},c:[E.QSM,E.C("REM","$",{r:10}),E.C("'","$",{r:0}),{cN:"symbol",b:"^[0-9]+ ",r:10},{cN:"number",b:"\\b([0-9]+[0-9edED.]*[#!]?)",r:0},{cN:"number",b:"(&[hH][0-9a-fA-F]{1,4})"},{cN:"number",b:"(&[oO][0-7]{1,6})"}]}});hljs.registerLanguage("thrift",function(e){var t="bool byte i16 i32 i64 double string binary";return{k:{keyword:"namespace const typedef struct enum service exception void oneway set list map required optional",built_in:t,literal:"true false"},c:[e.QSM,e.NM,e.CLCM,e.CBCM,{cN:"class",bK:"struct enum service exception",e:/\{/,i:/\n/,c:[e.inherit(e.TM,{starts:{eW:!0,eE:!0}})]},{b:"\\b(set|list|map)\\s*<",e:">",k:t,c:["self"]}]}});hljs.registerLanguage("cos",function(e){var t={cN:"string",v:[{b:'"',e:'"',c:[{b:'""',r:0}]}]},r={cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)",r:0},s="property parameter class classmethod clientmethod extends as break catch close continue do d|0 else elseif for goto halt hang h|0 if job j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 tcommit throw trollback try tstart use view while write w|0 xecute x|0 zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit zsync ascii";return{cI:!0,aliases:["cos","cls"],k:s,c:[r,t,e.CLCM,e.CBCM,{cN:"comment",b:/;/,e:"$",r:0},{cN:"built_in",b:/(?:\$\$?|\.\.)\^?[a-zA-Z]+/},{cN:"built_in",b:/\$\$\$[a-zA-Z]+/},{cN:"built_in",b:/%[a-z]+(?:\.[a-z]+)*/},{cN:"symbol",b:/\^%?[a-zA-Z][\w]*/},{cN:"keyword",b:/##class|##super|#define|#dim/},{b:/&sql\(/,e:/\)/,eB:!0,eE:!0,sL:"sql"},{b:/&(js|jscript|javascript)/,eB:!0,eE:!0,sL:"javascript"},{b:/&html<\s*\s*>/,sL:"xml"}]}});hljs.registerLanguage("gherkin",function(e){return{aliases:["feature"],k:"Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",c:[{cN:"symbol",b:"\\*",r:0},{cN:"meta",b:"@[^@\\s]+"},{b:"\\|",e:"\\|\\w*$",c:[{cN:"string",b:"[^|]+"}]},{cN:"variable",b:"<",e:">"},e.HCM,{cN:"string",b:'"""',e:'"""'},e.QSM]}});hljs.registerLanguage("elixir",function(e){var r="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?",n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",b="and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote",c={cN:"subst",b:"#\\{",e:"}",l:r,k:b},a={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/}]},i={cN:"function",bK:"def defp defmacro",e:/\B\b/,c:[e.inherit(e.TM,{b:r,endsParent:!0})]},l=e.inherit(i,{cN:"class",bK:"defimpl defmodule defprotocol defrecord",e:/\bdo\b|$|;/}),s=[a,e.HCM,l,i,{cN:"symbol",b:":(?!\\s)",c:[a,{b:n}],r:0},{cN:"symbol",b:r+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"->"},{b:"("+e.RSR+")\\s*",c:[e.HCM,{cN:"regexp",i:"\\n",c:[e.BE,c],v:[{b:"/",e:"/[a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];return c.c=s,{l:r,k:b,c:s}});hljs.registerLanguage("csp",function(r){return{cI:!1,l:"[a-zA-Z][a-zA-Z0-9_-]*",k:{keyword:"base-uri child-src connect-src default-src font-src form-action frame-ancestors frame-src img-src media-src object-src plugin-types report-uri sandbox script-src style-src"},c:[{cN:"string",b:"'",e:"'"},{cN:"attribute",b:"^Content",e:":",eE:!0}]}});hljs.registerLanguage("d",function(e){var t={keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"},r="(0|[1-9][\\d_]*)",a="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",i="0[bB][01_]+",n="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",_="0[xX]"+n,c="([eE][+-]?"+a+")",d="("+a+"(\\.\\d*|"+c+")|\\d+\\."+a+a+"|\\."+r+c+"?)",o="(0[xX]("+n+"\\."+n+"|\\.?"+n+")[pP][+-]?"+a+")",s="("+r+"|"+i+"|"+_+")",l="("+o+"|"+d+")",u="\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};",b={cN:"number",b:"\\b"+s+"(L|u|U|Lu|LU|uL|UL)?",r:0},f={cN:"number",b:"\\b("+l+"([fF]|L|i|[fF]i|Li)?|"+s+"(i|[fF]i|Li))",r:0},g={cN:"string",b:"'("+u+"|.)",e:"'",i:"."},h={b:u,r:0},p={cN:"string",b:'"',c:[h],e:'"[cwd]?'},m={cN:"string",b:'[rq]"',e:'"[cwd]?',r:5},w={cN:"string",b:"`",e:"`[cwd]?"},N={cN:"string",b:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',r:10},A={cN:"string",b:'q"\\{',e:'\\}"'},F={cN:"meta",b:"^#!",e:"$",r:5},y={cN:"meta",b:"#(line)",e:"$",r:5},L={cN:"keyword",b:"@[a-zA-Z_][a-zA-Z_\\d]*"},v=e.C("\\/\\+","\\+\\/",{c:["self"],r:10});return{l:e.UIR,k:t,c:[e.CLCM,e.CBCM,v,N,p,m,w,A,f,b,g,F,y,L]}});hljs.registerLanguage("x86asm",function(s){return{cI:!0,l:"[.%]?"+s.IR,k:{keyword:"lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",built_in:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr",meta:"%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"},c:[s.C(";","$",{r:0}),{cN:"number",v:[{b:"\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*\\.?[0-9_]*(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",r:0},{b:"\\$[0-9][0-9A-Fa-f]*",r:0},{b:"\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b"},{b:"\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b"}]},s.QSM,{cN:"string",v:[{b:"'",e:"[^\\\\]'"},{b:"`",e:"[^\\\\]`"}],r:0},{cN:"symbol",v:[{b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)"},{b:"^\\s*%%[A-Za-z0-9_$#@~.?]*:"}],r:0},{cN:"subst",b:"%[0-9]+",r:0},{cN:"subst",b:"%!S+",r:0},{cN:"meta",b:/^\s*\.[\w_-]+/}]}});hljs.registerLanguage("pony",function(e){var r={keyword:"actor addressof and as be break class compile_error compile_intrinsicconsume continue delegate digestof do else elseif embed end errorfor fun if ifdef in interface is isnt lambda let match new not objector primitive recover repeat return struct then trait try type until use var where while with xor",meta:"iso val tag trn box ref",literal:"this false true"},t={cN:"string",b:'"""',e:'"""',r:10},c={cN:"string",b:'"',e:'"',c:[e.BE]},i={cN:"string",b:"'",e:"'",c:[e.BE],r:0},n={cN:"type",b:"\\b_?[A-Z][\\w]*",r:0},s={b:e.IR+"'",r:0},a={cN:"class",bK:"class actor",e:"$",c:[e.TM,e.CLCM]},o={cN:"function",bK:"new fun",e:"=>",c:[e.TM,{b:/\(/,e:/\)/,c:[n,s,e.CNM,e.CBCM]},{b:/:/,eW:!0,c:[n]},e.CLCM]};return{k:r,c:[a,o,n,t,c,i,s,e.CNM,e.CLCM,e.CBCM]}});hljs.registerLanguage("stata",function(e){return{aliases:["do","ado"],cI:!0,k:"if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d|0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e|0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate g|0 gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h|0 hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l|0 la lab labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m|0 ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize meqparse mer merg merge mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n|0 nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u|0 unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5",c:[{cN:"symbol",b:/`[a-zA-Z0-9_]+'/},{cN:"variable",b:/\$\{?[a-zA-Z0-9_]+\}?/},{cN:"string",v:[{b:'`"[^\r\n]*?"\''},{b:'"[^\r\n"]*"'}]},{cN:"built_in",v:[{b:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\(|$)"}]},e.C("^[ ]*\\*.*$",!1),e.CLCM,e.CBCM]}});hljs.registerLanguage("accesslog",function(T){return{c:[{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+\\b",r:0},{cN:"string",b:'"(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|PATCH|TRACE)',e:'"',k:"GET POST HEAD PUT DELETE CONNECT OPTIONS PATCH TRACE",i:"\\n",r:10},{cN:"string",b:/\[/,e:/\]/,i:"\\n"},{cN:"string",b:'"',e:'"',i:"\\n"}]}});hljs.registerLanguage("abnf",function(e){var r={ruleDeclaration:"^[a-zA-Z][a-zA-Z0-9-]*",unexpectedChars:"[!@#$^&',?+~`|:]"},a=["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],b=e.C(";","$"),c={cN:"symbol",b:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/},l={cN:"symbol",b:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/},n={cN:"symbol",b:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/},t={cN:"symbol",b:/%[si]/},s={b:r.ruleDeclaration+"\\s*=",rB:!0,e:/=/,r:0,c:[{cN:"attribute",b:r.ruleDeclaration}]};return{i:r.unexpectedChars,k:a.join(" "),c:[s,b,c,l,n,t,e.QSM,e.NM]}});hljs.registerLanguage("ruby",function(e){var r="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",b={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:b},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:b},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:r}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:r}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:b},{b:"("+e.RSR+")\\s*",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l="[>?]>",o="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",w=[{b:/^\s*=>/,starts:{e:"$",c:d}},{cN:"meta",b:"^("+l+"|"+o+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:b,i:/\/\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage("haml",function(s){return{cI:!0,c:[{cN:"meta",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},s.C("^\\s*(!=#|=#|-#|/).*$",!1,{r:0}),{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"selector-tag",b:"\\w+"},{cN:"selector-id",b:"#[\\w-]+"},{cN:"selector-class",b:"\\.[\\w-]+"},{b:"{\\s*",e:"\\s*}",c:[{b:":\\w+\\s*=>",e:",\\s+",rB:!0,eW:!0,c:[{cN:"attr",b:":\\w+"},s.ASM,s.QSM,{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:!0,c:[{b:"\\w+\\s*=",e:"\\s+",rB:!0,eW:!0,c:[{cN:"attr",b:"\\w+",r:0},s.ASM,s.QSM,{b:"\\w+",r:0}]}]}]},{b:"^\\s*[=~]\\s*"},{b:"#{",starts:{e:"}",sL:"ruby"}}]}});hljs.registerLanguage("ruleslanguage",function(T){return{k:{keyword:"BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM NUMDAYS READ_DATE STAGING",built_in:"IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME"},c:[T.CLCM,T.CBCM,T.ASM,T.QSM,T.CNM,{cN:"literal",v:[{b:"#\\s+[a-zA-Z\\ \\.]*",r:0},{b:"#[a-zA-Z\\ \\.]+"}]}]}});hljs.registerLanguage("crystal",function(e){function r(e,r){var b=[{b:e,e:r}];return b[0].c=b,b}var b="(_[uif](8|16|32|64))?",c="[a-zA-Z_]\\w*[!?=]?",n="!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",i="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\][=?]?",s={keyword:"abstract alias as asm begin break case class def do else elsif end ensure enum extend for fun if ifdef include instance_sizeof is_a? lib macro module next of out pointerof private protected rescue responds_to? return require self sizeof struct super then type typeof union unless until when while with yield __DIR__ __FILE__ __LINE__",literal:"false nil true"},t={cN:"subst",b:"#{",e:"}",k:s},a={cN:"template-variable",v:[{b:"\\{\\{",e:"\\}\\}"},{b:"\\{%",e:"%\\}"}],k:s},l={cN:"string",c:[e.BE,t],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%w?\\(",e:"\\)",c:r("\\(","\\)")},{b:"%w?\\[",e:"\\]",c:r("\\[","\\]")},{b:"%w?{",e:"}",c:r("{","}")},{b:"%w?<",e:">",c:r("<",">")},{b:"%w?/",e:"/"},{b:"%w?%",e:"%"},{b:"%w?-",e:"-"},{b:"%w?\\|",e:"\\|"}],r:0},u={b:"("+n+")\\s*",c:[{cN:"regexp",c:[e.BE,t],v:[{b:"//[a-z]*",r:0},{b:"/",e:"/[a-z]*"},{b:"%r\\(",e:"\\)",c:r("\\(","\\)")},{b:"%r\\[",e:"\\]",c:r("\\[","\\]")},{b:"%r{",e:"}",c:r("{","}")},{b:"%r<",e:">",c:r("<",">")},{b:"%r/",e:"/"},{b:"%r%",e:"%"},{b:"%r-",e:"-"},{b:"%r\\|",e:"\\|"}]}],r:0},o={cN:"regexp",c:[e.BE,t],v:[{b:"%r\\(",e:"\\)",c:r("\\(","\\)")},{b:"%r\\[",e:"\\]",c:r("\\[","\\]")},{b:"%r{",e:"}",c:r("{","}")},{b:"%r<",e:">",c:r("<",">")},{b:"%r/",e:"/"},{b:"%r%",e:"%"},{b:"%r-",e:"-"},{b:"%r\\|",e:"\\|"}],r:0},_={cN:"meta",b:"@\\[",e:"\\]",c:[e.inherit(e.QSM,{cN:"meta-string"})]},f=[a,l,u,o,_,e.HCM,{cN:"class",bK:"class module struct",e:"$|;",i:/=/,c:[e.HCM,e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<"}]},{cN:"class",bK:"lib enum union",e:"$|;",i:/=/,c:[e.HCM,e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"})],r:10},{cN:"function",bK:"def",e:/\B\b/,c:[e.inherit(e.TM,{b:i,endsParent:!0})]},{cN:"function",bK:"fun macro",e:/\B\b/,c:[e.inherit(e.TM,{b:i,endsParent:!0})],r:5},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[l,{b:i}],r:0},{cN:"number",v:[{b:"\\b0b([01_]*[01])"+b},{b:"\\b0o([0-7_]*[0-7])"+b},{b:"\\b0x([A-Fa-f0-9_]*[A-Fa-f0-9])"+b},{b:"\\b(([0-9][0-9_]*[0-9]|[0-9])(\\.[0-9_]*[0-9])?([eE][+-]?[0-9_]*[0-9])?)"+b}],r:0}];return t.c=f,a.c=f.slice(1),{aliases:["cr"],l:c,k:s,c:f}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=o,s.c=o,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:o}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0}]},{cN:"tag",b:"|$)",e:">",k:{name:"style"},c:[t],starts:{e:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"|$)",e:">",k:{name:"script"},c:[t],starts:{e:"",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"meta",v:[{b:/<\?xml/,e:/\?>/,r:10},{b:/<\?\w+/,e:/\?>/}]},{cN:"tag",b:"",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("crmsh",function(t){var e="primitive rsc_template",r="group clone ms master location colocation order fencing_topology rsc_ticket acl_target acl_group user role tag xml",s="property rsc_defaults op_defaults",a="params meta operations op rule attributes utilization",i="read write deny defined not_defined in_range date spec in ref reference attribute type xpath version and or lt gt tag lte gte eq ne \\",o="number string",n="Master Started Slave Stopped start promote demote stop monitor true false";return{aliases:["crm","pcmk"],cI:!0,k:{keyword:a+" "+i+" "+o,literal:n},c:[t.HCM,{bK:"node",starts:{e:"\\s*([\\w_-]+:)?",starts:{cN:"title",e:"\\s*[\\$\\w_][\\w_-]*"}}},{bK:e,starts:{cN:"title",e:"\\s*[\\$\\w_][\\w_-]*",starts:{e:"\\s*@?[\\w_][\\w_\\.:-]*"}}},{b:"\\b("+r.split(" ").join("|")+")\\s+",k:r,starts:{cN:"title",e:"[\\$\\w_][\\w_-]*"}},{bK:s,starts:{cN:"title",e:"\\s*([\\w_-]+:)?"}},t.QSM,{cN:"meta",b:"(ocf|systemd|service|lsb):[\\w_:-]+",r:0},{cN:"number",b:"\\b\\d+(\\.\\d+)?(ms|s|h|m)?",r:0},{cN:"literal",b:"[-]?(infinity|inf)",r:0},{cN:"attr",b:/([A-Za-z\$_\#][\w_-]+)=/,r:0},{cN:"tag",b:"",r:0}]}});hljs.registerLanguage("ebnf",function(a){var e=a.C(/\(\*/,/\*\)/),t={cN:"attribute",b:/^[ ]*[a-zA-Z][a-zA-Z-]*([\s-]+[a-zA-Z][a-zA-Z]*)*/},r={cN:"meta",b:/\?.*\?/},b={b:/=/,e:/;/,c:[e,r,a.ASM,a.QSM]};return{i:/\S/,c:[e,t,b]}});hljs.registerLanguage("matlab",function(e){var a=[e.CNM,{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]}],s={r:0,c:[{b:/'['\.]*/}]};return{k:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},i:'(//|"|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[e.UTM,{cN:"params",v:[{b:"\\(",e:"\\)"},{b:"\\[",e:"\\]"}]}]},{b:/[a-zA-Z_][a-zA-Z_0-9]*'['\.]*/,rB:!0,r:0,c:[{b:/[a-zA-Z_][a-zA-Z_0-9]*/,r:0},s.c[0]]},{b:"\\[",e:"\\]",c:a,r:0,starts:s},{b:"\\{",e:/}/,c:a,r:0,starts:s},{b:/\)/,r:0,starts:s},e.C("^\\s*\\%\\{\\s*$","^\\s*\\%\\}\\s*$"),e.C("\\%","$")].concat(a)}});hljs.registerLanguage("q",function(e){var s={keyword:"do while select delete by update from",literal:"0b 1b",built_in:"neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum",type:"`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid"};return{aliases:["k","kdb"],k:s,l:/(`?)[A-Za-z0-9_]+\b/,c:[e.CLCM,e.QSM,e.CNM]}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});hljs.registerLanguage("applescript",function(e){var t=e.inherit(e.QSM,{i:""}),r={cN:"params",b:"\\(",e:"\\)",c:["self",e.CNM,t]},i=e.C("--","$"),o=e.C("\\(\\*","\\*\\)",{c:["self",i]}),n=[i,o,e.HCM];return{aliases:["osascript"],k:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",literal:"AppleScript false linefeed return pi quote result space tab true",built_in:"alias application boolean class constant date file integer list number real record string text activate beep count delay launch log offset read round run say summarize write character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},c:[t,e.CNM,{cN:"built_in",b:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{cN:"literal",b:"\\b(text item delimiters|current application|missing value)\\b"},{cN:"keyword",b:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference)|POSIX file|POSIX path|(date|time) string|quoted form)\\b"},{bK:"on",i:"[${=;\\n]",c:[e.UTM,r]}].concat(n),i:"//|->|=>|\\[\\["}});hljs.registerLanguage("autohotkey",function(e){var r={b:/`[\s\S]/};return{cI:!0,k:{keyword:"Break Continue Else Gosub If Loop Return While",literal:"A|0 true false NOT AND OR",built_in:"ComSpec Clipboard ClipboardAll ErrorLevel"},c:[{cN:"built_in",b:"A_[a-zA-Z0-9]+"},r,e.inherit(e.QSM,{c:[r]}),e.C(";","$",{r:0}),{cN:"number",b:e.NR,r:0},{cN:"variable",b:"%",e:"%",i:"\\n",c:[r]},{cN:"symbol",c:[r],v:[{b:'^[^\\n";]+::(?!=)'},{b:'^[^\\n";]+:(?!=)',r:0}]},{b:",\\s*,"}]}});hljs.registerLanguage("moonscript",function(e){var t={keyword:"if then not for in while do return else elseif break continue switch and or unless when class extends super local import export from using",literal:"true false nil",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},r="[A-Za-z$_][0-9A-Za-z$_]*",s={cN:"subst",b:/#\{/,e:/}/,k:t},a=[e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'/,e:/'/,c:[e.BE]},{b:/"/,e:/"/,c:[e.BE,s]}]},{cN:"built_in",b:"@__"+e.IR},{b:"@"+e.IR},{b:e.IR+"\\\\"+e.IR}];s.c=a;var c=e.inherit(e.TM,{b:r}),n="(\\(.*\\))?\\s*\\B[-=]>",i={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:t,c:["self"].concat(a)}]};return{aliases:["moon"],k:t,i:/\/\*/,c:a.concat([e.C("--","$"),{cN:"function",b:"^\\s*"+r+"\\s*=\\s*"+n,e:"[-=]>",rB:!0,c:[c,i]},{b:/[\(,:=]\s*/,r:0,c:[{cN:"function",b:n,e:"[-=]>",rB:!0,c:[i]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[c]},c]},{cN:"name",b:r+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("xl",function(e){var t="ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts",o={keyword:"if then else do while until for loop import with is as where when by data constant integer real text name boolean symbol infix prefix postfix block tree",literal:"true false nil",built_in:"in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin acos atan exp expm1 log log2 log10 log1p pi at text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x mouse_?y mouse_buttons "+t},a={cN:"string",b:'"',e:'"',i:"\\n"},r={cN:"string",b:"'",e:"'",i:"\\n"},i={cN:"string",b:"<<",e:">>"},l={cN:"number",b:"[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?"},n={bK:"import",e:"$",k:o,c:[a]},s={cN:"function",b:/[a-z][^\n]*->/,rB:!0,e:/->/,c:[e.inherit(e.TM,{starts:{eW:!0,k:o}})]};return{aliases:["tao"],l:/[a-zA-Z][a-zA-Z0-9_?]*/,k:o,c:[e.CLCM,e.CBCM,a,r,i,s,n,l,e.NM]}});hljs.registerLanguage("avrasm",function(r){return{cI:!0,l:"\\.?"+r.IR,k:{keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",meta:".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"},c:[r.CBCM,r.C(";","$",{r:0}),r.CNM,r.BNM,{cN:"number",b:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},r.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"symbol",b:"^[A-Za-z0-9_.$]+:"},{cN:"meta",b:"#",e:"$"},{cN:"subst",b:"@[0-9]+"}]}});hljs.registerLanguage("vhdl",function(e){var r="\\d(_|\\d)*",t="[eE][-+]?"+r,o=r+"(\\."+r+")?("+t+")?",n="\\w+",i=r+"#"+n+"(\\."+n+")?#("+t+")?",a="\\b("+i+"|"+o+")";return{cI:!0,k:{keyword:"abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",built_in:"boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"},i:"{",c:[e.CBCM,e.C("--","$"),e.QSM,{cN:"number",b:a,r:0},{cN:"literal",b:"'(U|X|0|1|Z|W|L|H|-)'",c:[e.BE]},{cN:"symbol",b:"'[A-Za-z](_?[A-Za-z0-9])*",c:[e.BE]}]}});hljs.registerLanguage("erb",function(e){return{sL:"xml",c:[e.C("<%#","%>"),{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0}]}});hljs.registerLanguage("twig",function(e){var t={cN:"params",b:"\\(",e:"\\)"},a="attribute block constant cycle date dump include max min parent random range source template_from_string",r={bK:a,k:{name:a},r:0,c:[t]},c={b:/\|[A-Za-z_]+:?/,k:"abs batch capitalize convert_encoding date date_modify default escape first format join json_encode keys last length lower merge nl2br number_format raw replace reverse round slice sort split striptags title trim upper url_encode",c:[r]},s="autoescape block do embed extends filter flush for if import include macro sandbox set spaceless use verbatim";return s=s+" "+s.split(" ").map(function(e){return"end"+e}).join(" "),{aliases:["craftcms"],cI:!0,sL:"xml",c:[e.C(/\{#/,/#}/),{cN:"template-tag",b:/\{%/,e:/%}/,c:[{cN:"name",b:/\w+/,k:s,starts:{eW:!0,c:[c,r],r:0}}]},{cN:"template-variable",b:/\{\{/,e:/}}/,c:["self",c,r]}]}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:""},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("nsis",function(e){var t={cN:"variable",b:"\\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)"},i={cN:"variable",b:"\\$+{[a-zA-Z0-9_]+}"},n={cN:"variable",b:"\\$+[a-zA-Z0-9_]+",i:"\\(\\){}"},r={cN:"variable",b:"\\$+\\([a-zA-Z0-9_]+\\)"},l={cN:"built_in",b:"(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)"},o={cN:"keyword",b:"\\!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)"};return{cI:!1,k:{keyword:"Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileSeek FileWrite FileWriteByte FileWriteUTF16LE FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI FunctionEnd GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText IntCmp IntCmpU IntFmt IntOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PageExEnd Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionEnd SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionGroupEnd SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetPluginUnload SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption SubSectionEnd Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr WriteUninstaller XPStyle",literal:"admin all auto both colored current false force hide highest lastused leave listonly none normal notset off on open print show silent silentlog smooth textonly true user "},c:[e.HCM,e.CBCM,{cN:"string",b:'"',e:'"',i:"\\n",c:[{b:"\\$(\\\\(n|r|t)|\\$)"},t,i,n,r]},e.C(";","$",{r:0}),{cN:"function",bK:"Function PageEx Section SectionGroup SubSection",e:"$"},o,i,n,r,l,e.NM,{b:e.IR+"::"+e.IR}]}});hljs.registerLanguage("aspectj",function(e){var t="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",i="get set args call";return{k:t,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"aspect",e:/[{;=]/,eE:!0,i:/[:;"\[\]]/,c:[{bK:"extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton"},e.UTM,{b:/\([^\)]*/,e:/[)]+/,k:t+" "+i,eE:!1}]},{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,r:0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"pointcut after before around throwing returning",e:/[)]/,eE:!1,i:/["\[\]]/,c:[{b:e.UIR+"\\s*\\(",rB:!0,c:[e.UTM]}]},{b:/[:]/,rB:!0,e:/[{;]/,r:0,eE:!1,k:t,i:/["\[\]]/,c:[{b:e.UIR+"\\s*\\(",k:t+" "+i},e.QSM]},{bK:"new throw",r:0},{cN:"function",b:/\w+ +\w+(\.)?\w+\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,rB:!0,e:/[{;=]/,k:t,eE:!0,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,r:0,k:t,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},e.CNM,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U)?L?"',e:'"',i:"\\n",c:[t.BE]},{b:'(u8?|U)?R"',e:'"',c:[t.BE]},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01'_]+)"},{b:"\\b([\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:"<",e:">",i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e]},t.CLCM,t.CBCM,i]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("arduino",function(e){var t=e.getLanguage("cpp").exports;return{k:{keyword:"boolean byte word string String array "+t.k.keyword,built_in:"setup loop while catch for if do goto try switch case else default break continue return KeyboardController MouseController SoftwareSerial EthernetServer EthernetClient LiquidCrystal RobotControl GSMVoiceCall EthernetUDP EsploraTFT HttpClient RobotMotor WiFiClient GSMScanner FileSystem Scheduler GSMServer YunClient YunServer IPAddress GSMClient GSMModem Keyboard Ethernet Console GSMBand Esplora Stepper Process WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage Client Server GSMPIN FileIO Bridge Serial EEPROM Stream Mouse Audio Servo File Task GPRS WiFi Wire TFT GSM SPI SD runShellCommandAsynchronously analogWriteResolution retrieveCallingNumber printFirmwareVersion analogReadResolution sendDigitalPortPair noListenOnLocalhost readJoystickButton setFirmwareVersion readJoystickSwitch scrollDisplayRight getVoiceCallStatus scrollDisplayLeft writeMicroseconds delayMicroseconds beginTransmission getSignalStrength runAsynchronously getAsynchronously listenOnLocalhost getCurrentCarrier readAccelerometer messageAvailable sendDigitalPorts lineFollowConfig countryNameWrite runShellCommand readStringUntil rewindDirectory readTemperature setClockDivider readLightSensor endTransmission analogReference detachInterrupt countryNameRead attachInterrupt encryptionType readBytesUntil robotNameWrite readMicrophone robotNameRead cityNameWrite userNameWrite readJoystickY readJoystickX mouseReleased openNextFile scanNetworks noInterrupts digitalWrite beginSpeaker mousePressed isActionDone mouseDragged displayLogos noAutoscroll addParameter remoteNumber getModifiers keyboardRead userNameRead waitContinue processInput parseCommand printVersion readNetworks writeMessage blinkVersion cityNameRead readMessage setDataMode parsePacket isListening setBitOrder beginPacket isDirectory motorsWrite drawCompass digitalRead clearScreen serialEvent rightToLeft setTextSize leftToRight requestFrom keyReleased compassRead analogWrite interrupts WiFiServer disconnect playMelody parseFloat autoscroll getPINUsed setPINUsed setTimeout sendAnalog readSlider analogRead beginWrite createChar motorsStop keyPressed tempoWrite readButton subnetMask debugPrint macAddress writeGreen randomSeed attachGPRS readString sendString remotePort releaseAll mouseMoved background getXChange getYChange answerCall getResult voiceCall endPacket constrain getSocket writeJSON getButton available connected findUntil readBytes exitValue readGreen writeBlue startLoop IPAddress isPressed sendSysex pauseMode gatewayIP setCursor getOemKey tuneWrite noDisplay loadImage switchPIN onRequest onReceive changePIN playFile noBuffer parseInt overflow checkPIN knobRead beginTFT bitClear updateIR bitWrite position writeRGB highByte writeRed setSpeed readBlue noStroke remoteIP transfer shutdown hangCall beginSMS endWrite attached maintain noCursor checkReg checkPUK shiftOut isValid shiftIn pulseIn connect println localIP pinMode getIMEI display noBlink process getBand running beginSD drawBMP lowByte setBand release bitRead prepare pointTo readRed setMode noFill remove listen stroke detach attach noTone exists buffer height bitSet circle config cursor random IRread setDNS endSMS getKey micros millis begin print write ready flush width isPIN blink clear press mkdir rmdir close point yield image BSSID click delay read text move peek beep rect line open seek fill size turn stop home find step tone sqrt RSSI SSID end bit tan cos sin pow map abs max min get run put",literal:"DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL DEFAULT OUTPUT INPUT HIGH LOW"},c:[t.preprocessor,e.CLCM,e.CBCM,e.ASM,e.QSM,e.CNM]}});hljs.registerLanguage("stan",function(e){return{c:[e.HCM,e.CLCM,e.CBCM,{b:e.UIR,l:e.UIR,k:{name:"for in while repeat until if then else",symbol:"bernoulli bernoulli_logit binomial binomial_logit beta_binomial hypergeometric categorical categorical_logit ordered_logistic neg_binomial neg_binomial_2 neg_binomial_2_log poisson poisson_log multinomial normal exp_mod_normal skew_normal student_t cauchy double_exponential logistic gumbel lognormal chi_square inv_chi_square scaled_inv_chi_square exponential inv_gamma weibull frechet rayleigh wiener pareto pareto_type_2 von_mises uniform multi_normal multi_normal_prec multi_normal_cholesky multi_gp multi_gp_cholesky multi_student_t gaussian_dlm_obs dirichlet lkj_corr lkj_corr_cholesky wishart inv_wishart","selector-tag":"int real vector simplex unit_vector ordered positive_ordered row_vector matrix cholesky_factor_corr cholesky_factor_cov corr_matrix cov_matrix",title:"functions model data parameters quantities transformed generated",literal:"true false"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0}]}});hljs.registerLanguage("inform7",function(e){var r="\\[",o="\\]";return{aliases:["i7"],cI:!0,k:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},c:[{cN:"string",b:'"',e:'"',r:0,c:[{cN:"subst",b:r,e:o}]},{cN:"section",b:/^(Volume|Book|Part|Chapter|Section|Table)\b/,e:"$"},{b:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,e:":",c:[{b:"\\(This",e:"\\)"}]},{cN:"comment",b:r,e:o,c:["self"]}]}});hljs.registerLanguage("stylus",function(e){var t={cN:"variable",b:"\\$"+e.IR},o={cN:"number",b:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},i=["charset","css","debug","extend","font-face","for","import","include","media","mixin","page","warn","while"],r=["after","before","first-letter","first-line","active","first-child","focus","hover","lang","link","visited"],n=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],a="[\\.\\s\\n\\[\\:,]",l=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","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","clear","clip","clip-path","color","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","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-variant-ligatures","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"],d=["\\?","(\\bReturn\\b)","(\\bEnd\\b)","(\\bend\\b)","(\\bdef\\b)",";","#\\s","\\*\\s","===\\s","\\|","%"];return{aliases:["styl"],cI:!1,k:"if else for in",i:"("+d.join("|")+")",c:[e.QSM,e.ASM,e.CLCM,e.CBCM,o,{b:"\\.[a-zA-Z][a-zA-Z0-9_-]*"+a,rB:!0,c:[{cN:"selector-class",b:"\\.[a-zA-Z][a-zA-Z0-9_-]*"}]},{b:"\\#[a-zA-Z][a-zA-Z0-9_-]*"+a,rB:!0,c:[{cN:"selector-id",b:"\\#[a-zA-Z][a-zA-Z0-9_-]*"}]},{b:"\\b("+n.join("|")+")"+a,rB:!0,c:[{cN:"selector-tag",b:"\\b[a-zA-Z][a-zA-Z0-9_-]*"}]},{b:"&?:?:\\b("+r.join("|")+")"+a},{b:"@("+i.join("|")+")\\b"},t,e.CSSNM,e.NM,{cN:"function",b:"^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",i:"[\\n]",rB:!0,c:[{cN:"title",b:"\\b[a-zA-Z][a-zA-Z0-9_-]*"},{cN:"params",b:/\(/,e:/\)/,c:[o,t,e.ASM,e.CSSNM,e.NM,e.QSM]}]},{cN:"attribute",b:"\\b("+l.reverse().join("|")+")\\b",starts:{e:/;|$/,c:[o,t,e.ASM,e.QSM,e.CSSNM,e.NM,e.CBCM],i:/\./,r:0}}]}});hljs.registerLanguage("erlang-repl",function(e){return{k:{built_in:"spawn spawn_link self",keyword:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},c:[{cN:"meta",b:"^[0-9]+> ",r:10},e.C("%","$"),{cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0},e.ASM,e.QSM,{b:"\\?(::)?([A-Z]\\w*(::)?)+"},{b:"->"},{b:"ok"},{b:"!"},{b:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",r:0},{b:"[A-Z][a-zA-Z0-9_']*",r:0}]}});hljs.registerLanguage("groovy",function(e){return{k:{literal:"true false null",keyword:"byte short char int long boolean float double void def as in assert trait super this abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"},c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,{cN:"string",b:'"""',e:'"""'},{cN:"string",b:"'''",e:"'''"},{cN:"string",b:"\\$/",e:"/\\$",r:10},e.ASM,{cN:"regexp",b:/~?\/[^\/\n]+\//,c:[e.BE]},e.QSM,{cN:"meta",b:"^#!/usr/bin/env",e:"$",i:"\n"},e.BNM,{cN:"class",bK:"class interface trait enum",e:"{",i:":",c:[{bK:"extends implements"},e.UTM]},e.CNM,{cN:"meta",b:"@[A-Za-z]+"},{cN:"string",b:/[^\?]{0}[A-Za-z0-9_$]+ *:/},{b:/\?/,e:/\:/},{cN:"symbol",b:"^\\s*[A-Za-z0-9_$]+:",r:0}],i:/#|<\//}});hljs.registerLanguage("lisp",function(b){var e="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*",c="\\|[^]*?\\|",r="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?",a={cN:"meta",b:"^#!",e:"$"},l={cN:"literal",b:"\\b(t{1}|nil)\\b"},n={cN:"number",v:[{b:r,r:0},{b:"#(b|B)[0-1]+(/[0-1]+)?"},{b:"#(o|O)[0-7]+(/[0-7]+)?"},{b:"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?"},{b:"#(c|C)\\("+r+" +"+r,e:"\\)"}]},i=b.inherit(b.QSM,{i:null}),t=b.C(";","$",{r:0}),s={b:"\\*",e:"\\*"},u={cN:"symbol",b:"[:&]"+e},d={b:e,r:0},f={b:c},m={b:"\\(",e:"\\)",c:["self",l,i,n,d]},o={c:[n,i,s,u,m,d],v:[{b:"['`]\\(",e:"\\)"},{b:"\\(quote ",e:"\\)",k:{name:"quote"}},{b:"'"+c}]},v={v:[{b:"'"+e},{b:"#'"+e+"(::"+e+")*"}]},N={b:"\\(\\s*",e:"\\)"},A={eW:!0,r:0};return N.c=[{cN:"name",v:[{b:e},{b:c}]},A],A.c=[o,v,N,l,n,i,t,s,u,f,d],{i:/\S/,c:[n,a,l,i,t,o,v,N,d]}});hljs.registerLanguage("tex",function(c){var e={cN:"tag",b:/\\/,r:0,c:[{cN:"name",v:[{b:/[a-zA-Zа-яА-я]+[*]?/},{b:/[^a-zA-Zа-яА-я0-9]/}],starts:{eW:!0,r:0,c:[{cN:"string",v:[{b:/\[/,e:/\]/},{b:/\{/,e:/\}/}]},{b:/\s*=\s*/,eW:!0,r:0,c:[{cN:"number",b:/-?\d*\.?\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?/}]}]}}]};return{c:[e,{cN:"formula",c:[e],r:0,v:[{b:/\$\$/,e:/\$\$/},{b:/\$/,e:/\$/}]},c.C("%","$",{r:0})]}});hljs.registerLanguage("livescript",function(e){var t={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger case default function var with then unless until loop of by when and or is isnt not it that otherwise from to til fallthrough super case default function var void const let enum export import native __hasProp __extends __slice __bind __indexOf",literal:"true false null undefined yes no on off it that void",built_in:"npm require console print module global window document"},s="[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*",n=e.inherit(e.TM,{b:s}),i={cN:"subst",b:/#\{/,e:/}/,k:t},r={cN:"subst",b:/#[A-Za-z$_]/,e:/(?:\-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,k:t},c=[e.BNM,{cN:"number",b:"(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",r:0,starts:{e:"(\\s*/)?",r:0}},{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,i,r]},{b:/"/,e:/"/,c:[e.BE,i,r]},{b:/\\/,e:/(\s|$)/,eE:!0}]},{cN:"regexp",v:[{b:"//",e:"//[gim]*",c:[i,e.HCM]},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+s},{b:"``",e:"``",eB:!0,eE:!0,sL:"javascript"}];i.c=c;var a={cN:"params",b:"\\(",rB:!0,c:[{b:/\(/,e:/\)/,k:t,c:["self"].concat(c)}]};return{aliases:["ls"],k:t,i:/\/\*/,c:c.concat([e.C("\\/\\*","\\*\\/"),e.HCM,{cN:"function",c:[n,a],rB:!0,v:[{b:"("+s+"\\s*(?:=|:=)\\s*)?(\\(.*\\))?\\s*\\B\\->\\*?",e:"\\->\\*?"},{b:"("+s+"\\s*(?:=|:=)\\s*)?!?(\\(.*\\))?\\s*\\B[-~]{1,2}>\\*?",e:"[-~]{1,2}>\\*?"},{b:"("+s+"\\s*(?:=|:=)\\s*)?(\\(.*\\))?\\s*\\B!?[-~]{1,2}>\\*?",e:"!?[-~]{1,2}>\\*?"}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[n]},n]},{b:s+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("less",function(e){var r="[\\w-]+",t="("+r+"|@{"+r+"})",a=[],c=[],s=function(e){return{cN:"string",b:"~?"+e+".*?"+e}},b=function(e,r,t){return{cN:e,b:r,r:t}},n={b:"\\(",e:"\\)",c:c,r:0};c.push(e.CLCM,e.CBCM,s("'"),s('"'),e.CSSNM,{b:"(url|data-uri)\\(",starts:{cN:"string",e:"[\\)\\n]",eE:!0}},b("number","#[0-9A-Fa-f]+\\b"),n,b("variable","@@?"+r,10),b("variable","@{"+r+"}"),b("built_in","~?`[^`]*?`"),{cN:"attribute",b:r+"\\s*:",e:":",rB:!0,eE:!0},{cN:"meta",b:"!important"});var i=c.concat({b:"{",e:"}",c:a}),o={bK:"when",eW:!0,c:[{bK:"and not"}].concat(c)},u={b:t+"\\s*:",rB:!0,e:"[;}]",r:0,c:[{cN:"attribute",b:t,e:":",eE:!0,starts:{eW:!0,i:"[<=$]",r:0,c:c}}]},l={cN:"keyword",b:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{e:"[;{}]",rE:!0,c:c,r:0}},C={cN:"variable",v:[{b:"@"+r+"\\s*:",r:15},{b:"@"+r}],starts:{e:"[;}]",rE:!0,c:i}},p={v:[{b:"[\\.#:&\\[>]",e:"[;{}]"},{b:t+"[^;]*{",e:"{"}],rB:!0,rE:!0,i:"[<='$\"]",c:[e.CLCM,e.CBCM,o,b("keyword","all\\b"),b("variable","@{"+r+"}"),b("selector-tag",t+"%?",0),b("selector-id","#"+t),b("selector-class","\\."+t,0),b("selector-tag","&",0),{cN:"selector-attr",b:"\\[",e:"\\]"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"\\(",e:"\\)",c:i},{b:"!important"}]};return a.push(e.CLCM,e.CBCM,l,C,u,p),{cI:!0,i:"[=>'/<($\"]",c:a}});hljs.registerLanguage("dust",function(e){var t="if eq ne lt lte gt gte select default math sep";return{aliases:["dst"],cI:!0,sL:"xml",c:[{cN:"template-tag",b:/\{[#\/]/,e:/\}/,i:/;/,c:[{cN:"name",b:/[a-zA-Z\.-]+/,starts:{eW:!0,r:0,c:[e.QSM]}}]},{cN:"template-variable",b:/\{/,e:/\}/,i:/;/,k:t}]}});hljs.registerLanguage("verilog",function(e){var n={keyword:"accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf|0 bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate|5 genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor",literal:"null",built_in:"$finish $stop $exit $fatal $error $warning $info $realtime $time $printtimescale $bitstoreal $bitstoshortreal $itor $signed $cast $bits $stime $timeformat $realtobits $shortrealtobits $rtoi $unsigned $asserton $assertkill $assertpasson $assertfailon $assertnonvacuouson $assertoff $assertcontrol $assertpassoff $assertfailoff $assertvacuousoff $isunbounded $sampled $fell $changed $past_gclk $fell_gclk $changed_gclk $rising_gclk $steady_gclk $coverage_control $coverage_get $coverage_save $set_coverage_db_name $rose $stable $past $rose_gclk $stable_gclk $future_gclk $falling_gclk $changing_gclk $display $coverage_get_max $coverage_merge $get_coverage $load_coverage_db $typename $unpacked_dimensions $left $low $increment $clog2 $ln $log10 $exp $sqrt $pow $floor $ceil $sin $cos $tan $countbits $onehot $isunknown $fatal $warning $dimensions $right $high $size $asin $acos $atan $atan2 $hypot $sinh $cosh $tanh $asinh $acosh $atanh $countones $onehot0 $error $info $random $dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform $q_initialize $q_remove $q_exam $async$and$array $async$nand$array $async$or$array $async$nor$array $sync$and$array $sync$nand$array $sync$or$array $sync$nor$array $q_add $q_full $psprintf $async$and$plane $async$nand$plane $async$or$plane $async$nor$plane $sync$and$plane $sync$nand$plane $sync$or$plane $sync$nor$plane $system $display $displayb $displayh $displayo $strobe $strobeb $strobeh $strobeo $write $readmemb $readmemh $writememh $value$plusargs $dumpvars $dumpon $dumplimit $dumpports $dumpportson $dumpportslimit $writeb $writeh $writeo $monitor $monitorb $monitorh $monitoro $writememb $dumpfile $dumpoff $dumpall $dumpflush $dumpportsoff $dumpportsall $dumpportsflush $fclose $fdisplay $fdisplayb $fdisplayh $fdisplayo $fstrobe $fstrobeb $fstrobeh $fstrobeo $swrite $swriteb $swriteh $swriteo $fscanf $fread $fseek $fflush $feof $fopen $fwrite $fwriteb $fwriteh $fwriteo $fmonitor $fmonitorb $fmonitorh $fmonitoro $sformat $sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror"};return{aliases:["v","sv","svh"],cI:!1,k:n,l:/[\w\$]+/,c:[e.CBCM,e.CLCM,e.QSM,{cN:"number",c:[e.BE],v:[{b:"\\b((\\d+'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{b:"\\B(('(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{b:"\\b([0-9_])+",r:0}]},{cN:"variable",v:[{b:"#\\((?!parameter).+\\)"},{b:"\\.\\w+",r:0}]},{cN:"meta",b:"`",e:"$",k:{"meta-keyword":"define __FILE__ __LINE__ begin_keywords celldefine default_nettype define else elsif end_keywords endcelldefine endif ifdef ifndef include line nounconnected_drive pragma resetall timescale unconnected_drive undef undefineall"},r:0}]}});hljs.registerLanguage("php",function(e){var c={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"meta",b:/<\?(php)?|\?>/},t={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[i]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},i,{cN:"keyword",b:/\$this\b/},c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,t,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},t,a]}});hljs.registerLanguage("openscad",function(e){var r={cN:"keyword",b:"\\$(f[asn]|t|vp[rtd]|children)"},n={cN:"literal",b:"false|true|PI|undef"},o={cN:"number",b:"\\b\\d+(\\.\\d+)?(e-?\\d+)?",r:0},i=e.inherit(e.QSM,{i:null}),t={cN:"meta",k:{"meta-keyword":"include use"},b:"include|use <",e:">"},s={cN:"params",b:"\\(",e:"\\)",c:["self",o,i,r,n]},c={b:"[*!#%]",r:0},a={cN:"function",bK:"module function",e:"\\=|\\{",c:[s,e.UTM]};return{aliases:["scad"],k:{keyword:"function module include use for intersection_for if else \\%",literal:"false true PI undef",built_in:"circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign"},c:[e.CLCM,e.CBCM,o,t,i,r,c,a]}});hljs.registerLanguage("mathematica",function(e){return{aliases:["mma"],l:"(\\$|\\b)"+e.IR+"\\b",k:"AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine Transparent UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian XMLElement XMLObject Xnor Xor Yellow YuleDissimilarity ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform $Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber", -c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("maxima",function(e){var t="if then else elseif for thru do while unless step in and or not",a="true false unknown inf minf ind und %e %i %pi %phi %gamma",r=" abasep abs absint absolute_real_time acos acosh acot acoth acsc acsch activate addcol add_edge add_edges addmatrices addrow add_vertex add_vertices adjacency_matrix adjoin adjoint af agd airy airy_ai airy_bi airy_dai airy_dbi algsys alg_type alias allroots alphacharp alphanumericp amortization %and annuity_fv annuity_pv antid antidiff AntiDifference append appendfile apply apply1 apply2 applyb1 apropos args arit_amortization arithmetic arithsum array arrayapply arrayinfo arraymake arraysetapply ascii asec asech asin asinh askinteger asksign assoc assoc_legendre_p assoc_legendre_q assume assume_external_byte_order asympa at atan atan2 atanh atensimp atom atvalue augcoefmatrix augmented_lagrangian_method av average_degree backtrace bars barsplot barsplot_description base64 base64_decode bashindices batch batchload bc2 bdvac belln benefit_cost bern bernpoly bernstein_approx bernstein_expand bernstein_poly bessel bessel_i bessel_j bessel_k bessel_simplify bessel_y beta beta_incomplete beta_incomplete_generalized beta_incomplete_regularized bezout bfallroots bffac bf_find_root bf_fmin_cobyla bfhzeta bfloat bfloatp bfpsi bfpsi0 bfzeta biconnected_components bimetric binomial bipartition block blockmatrixp bode_gain bode_phase bothcoef box boxplot boxplot_description break bug_report build_info|10 buildq build_sample burn cabs canform canten cardinality carg cartan cartesian_product catch cauchy_matrix cbffac cdf_bernoulli cdf_beta cdf_binomial cdf_cauchy cdf_chi2 cdf_continuous_uniform cdf_discrete_uniform cdf_exp cdf_f cdf_gamma cdf_general_finite_discrete cdf_geometric cdf_gumbel cdf_hypergeometric cdf_laplace cdf_logistic cdf_lognormal cdf_negative_binomial cdf_noncentral_chi2 cdf_noncentral_student_t cdf_normal cdf_pareto cdf_poisson cdf_rank_sum cdf_rayleigh cdf_signed_rank cdf_student_t cdf_weibull cdisplay ceiling central_moment cequal cequalignore cf cfdisrep cfexpand cgeodesic cgreaterp cgreaterpignore changename changevar chaosgame charat charfun charfun2 charlist charp charpoly chdir chebyshev_t chebyshev_u checkdiv check_overlaps chinese cholesky christof chromatic_index chromatic_number cint circulant_graph clear_edge_weight clear_rules clear_vertex_label clebsch_gordan clebsch_graph clessp clesspignore close closefile cmetric coeff coefmatrix cograd col collapse collectterms columnop columnspace columnswap columnvector combination combine comp2pui compare compfile compile compile_file complement_graph complete_bipartite_graph complete_graph complex_number_p components compose_functions concan concat conjugate conmetderiv connected_components connect_vertices cons constant constantp constituent constvalue cont2part content continuous_freq contortion contour_plot contract contract_edge contragrad contrib_ode convert coord copy copy_file copy_graph copylist copymatrix cor cos cosh cot coth cov cov1 covdiff covect covers crc24sum create_graph create_list csc csch csetup cspline ctaylor ct_coordsys ctransform ctranspose cube_graph cuboctahedron_graph cunlisp cv cycle_digraph cycle_graph cylindrical days360 dblint deactivate declare declare_constvalue declare_dimensions declare_fundamental_dimensions declare_fundamental_units declare_qty declare_translated declare_unit_conversion declare_units declare_weights decsym defcon define define_alt_display define_variable defint defmatch defrule defstruct deftaylor degree_sequence del delete deleten delta demo demoivre denom depends derivdegree derivlist describe desolve determinant dfloat dgauss_a dgauss_b dgeev dgemm dgeqrf dgesv dgesvd diag diagmatrix diag_matrix diagmatrixp diameter diff digitcharp dimacs_export dimacs_import dimension dimensionless dimensions dimensions_as_list direct directory discrete_freq disjoin disjointp disolate disp dispcon dispform dispfun dispJordan display disprule dispterms distrib divide divisors divsum dkummer_m dkummer_u dlange dodecahedron_graph dotproduct dotsimp dpart draw draw2d draw3d drawdf draw_file draw_graph dscalar echelon edge_coloring edge_connectivity edges eigens_by_jacobi eigenvalues eigenvectors eighth einstein eivals eivects elapsed_real_time elapsed_run_time ele2comp ele2polynome ele2pui elem elementp elevation_grid elim elim_allbut eliminate eliminate_using ellipse elliptic_e elliptic_ec elliptic_eu elliptic_f elliptic_kc elliptic_pi ematrix empty_graph emptyp endcons entermatrix entertensor entier equal equalp equiv_classes erf erfc erf_generalized erfi errcatch error errormsg errors euler ev eval_string evenp every evolution evolution2d evundiff example exp expand expandwrt expandwrt_factored expint expintegral_chi expintegral_ci expintegral_e expintegral_e1 expintegral_ei expintegral_e_simplify expintegral_li expintegral_shi expintegral_si explicit explose exponentialize express expt exsec extdiff extract_linear_equations extremal_subset ezgcd %f f90 facsum factcomb factor factorfacsum factorial factorout factorsum facts fast_central_elements fast_linsolve fasttimes featurep fernfale fft fib fibtophi fifth filename_merge file_search file_type fillarray findde find_root find_root_abs find_root_error find_root_rel first fix flatten flength float floatnump floor flower_snark flush flush1deriv flushd flushnd flush_output fmin_cobyla forget fortran fourcos fourexpand fourier fourier_elim fourint fourintcos fourintsin foursimp foursin fourth fposition frame_bracket freeof freshline fresnel_c fresnel_s from_adjacency_matrix frucht_graph full_listify fullmap fullmapl fullratsimp fullratsubst fullsetify funcsolve fundamental_dimensions fundamental_units fundef funmake funp fv g0 g1 gamma gamma_greek gamma_incomplete gamma_incomplete_generalized gamma_incomplete_regularized gauss gauss_a gauss_b gaussprob gcd gcdex gcdivide gcfac gcfactor gd generalized_lambert_w genfact gen_laguerre genmatrix gensym geo_amortization geo_annuity_fv geo_annuity_pv geomap geometric geometric_mean geosum get getcurrentdirectory get_edge_weight getenv get_lu_factors get_output_stream_string get_pixel get_plot_option get_tex_environment get_tex_environment_default get_vertex_label gfactor gfactorsum ggf girth global_variances gn gnuplot_close gnuplot_replot gnuplot_reset gnuplot_restart gnuplot_start go Gosper GosperSum gr2d gr3d gradef gramschmidt graph6_decode graph6_encode graph6_export graph6_import graph_center graph_charpoly graph_eigenvalues graph_flow graph_order graph_periphery graph_product graph_size graph_union great_rhombicosidodecahedron_graph great_rhombicuboctahedron_graph grid_graph grind grobner_basis grotzch_graph hamilton_cycle hamilton_path hankel hankel_1 hankel_2 harmonic harmonic_mean hav heawood_graph hermite hessian hgfred hilbertmap hilbert_matrix hipow histogram histogram_description hodge horner hypergeometric i0 i1 %ibes ic1 ic2 ic_convert ichr1 ichr2 icosahedron_graph icosidodecahedron_graph icurvature ident identfor identity idiff idim idummy ieqn %if ifactors iframes ifs igcdex igeodesic_coords ilt image imagpart imetric implicit implicit_derivative implicit_plot indexed_tensor indices induced_subgraph inferencep inference_result infix info_display init_atensor init_ctensor in_neighbors innerproduct inpart inprod inrt integerp integer_partitions integrate intersect intersection intervalp intopois intosum invariant1 invariant2 inverse_fft inverse_jacobi_cd inverse_jacobi_cn inverse_jacobi_cs inverse_jacobi_dc inverse_jacobi_dn inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd inverse_jacobi_ns inverse_jacobi_sc inverse_jacobi_sd inverse_jacobi_sn invert invert_by_adjoint invert_by_lu inv_mod irr is is_biconnected is_bipartite is_connected is_digraph is_edge_in_graph is_graph is_graph_or_digraph ishow is_isomorphic isolate isomorphism is_planar isqrt isreal_p is_sconnected is_tree is_vertex_in_graph items_inference %j j0 j1 jacobi jacobian jacobi_cd jacobi_cn jacobi_cs jacobi_dc jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_p jacobi_sc jacobi_sd jacobi_sn JF jn join jordan julia julia_set julia_sin %k kdels kdelta kill killcontext kostka kron_delta kronecker_product kummer_m kummer_u kurtosis kurtosis_bernoulli kurtosis_beta kurtosis_binomial kurtosis_chi2 kurtosis_continuous_uniform kurtosis_discrete_uniform kurtosis_exp kurtosis_f kurtosis_gamma kurtosis_general_finite_discrete kurtosis_geometric kurtosis_gumbel kurtosis_hypergeometric kurtosis_laplace kurtosis_logistic kurtosis_lognormal kurtosis_negative_binomial kurtosis_noncentral_chi2 kurtosis_noncentral_student_t kurtosis_normal kurtosis_pareto kurtosis_poisson kurtosis_rayleigh kurtosis_student_t kurtosis_weibull label labels lagrange laguerre lambda lambert_w laplace laplacian_matrix last lbfgs lc2kdt lcharp lc_l lcm lc_u ldefint ldisp ldisplay legendre_p legendre_q leinstein length let letrules letsimp levi_civita lfreeof lgtreillis lhs li liediff limit Lindstedt linear linearinterpol linear_program linear_regression line_graph linsolve listarray list_correlations listify list_matrix_entries list_nc_monomials listoftens listofvars listp lmax lmin load loadfile local locate_matrix_entry log logcontract log_gamma lopow lorentz_gauge lowercasep lpart lratsubst lreduce lriemann lsquares_estimates lsquares_estimates_approximate lsquares_estimates_exact lsquares_mse lsquares_residual_mse lsquares_residuals lsum ltreillis lu_backsub lucas lu_factor %m macroexpand macroexpand1 make_array makebox makefact makegamma make_graph make_level_picture makelist makeOrders make_poly_continent make_poly_country make_polygon make_random_state make_rgb_picture makeset make_string_input_stream make_string_output_stream make_transform mandelbrot mandelbrot_set map mapatom maplist matchdeclare matchfix mat_cond mat_fullunblocker mat_function mathml_display mat_norm matrix matrixmap matrixp matrix_size mattrace mat_trace mat_unblocker max max_clique max_degree max_flow maximize_lp max_independent_set max_matching maybe md5sum mean mean_bernoulli mean_beta mean_binomial mean_chi2 mean_continuous_uniform mean_deviation mean_discrete_uniform mean_exp mean_f mean_gamma mean_general_finite_discrete mean_geometric mean_gumbel mean_hypergeometric mean_laplace mean_logistic mean_lognormal mean_negative_binomial mean_noncentral_chi2 mean_noncentral_student_t mean_normal mean_pareto mean_poisson mean_rayleigh mean_student_t mean_weibull median median_deviation member mesh metricexpandall mgf1_sha1 min min_degree min_edge_cut minfactorial minimalPoly minimize_lp minimum_spanning_tree minor minpack_lsquares minpack_solve min_vertex_cover min_vertex_cut mkdir mnewton mod mode_declare mode_identity ModeMatrix moebius mon2schur mono monomial_dimensions multibernstein_poly multi_display_for_texinfo multi_elem multinomial multinomial_coeff multi_orbit multiplot_mode multi_pui multsym multthru mycielski_graph nary natural_unit nc_degree ncexpt ncharpoly negative_picture neighbors new newcontext newdet new_graph newline newton new_variable next_prime nicedummies niceindices ninth nofix nonarray noncentral_moment nonmetricity nonnegintegerp nonscalarp nonzeroandfreeof notequal nounify nptetrad npv nroots nterms ntermst nthroot nullity nullspace num numbered_boundaries numberp number_to_octets num_distinct_partitions numerval numfactor num_partitions nusum nzeta nzetai nzetar octets_to_number octets_to_oid odd_girth oddp ode2 ode_check odelin oid_to_octets op opena opena_binary openr openr_binary openw openw_binary operatorp opsubst optimize %or orbit orbits ordergreat ordergreatp orderless orderlessp orthogonal_complement orthopoly_recur orthopoly_weight outermap out_neighbors outofpois pade parabolic_cylinder_d parametric parametric_surface parg parGosper parse_string parse_timedate part part2cont partfrac partition partition_set partpol path_digraph path_graph pathname_directory pathname_name pathname_type pdf_bernoulli pdf_beta pdf_binomial pdf_cauchy pdf_chi2 pdf_continuous_uniform pdf_discrete_uniform pdf_exp pdf_f pdf_gamma pdf_general_finite_discrete pdf_geometric pdf_gumbel pdf_hypergeometric pdf_laplace pdf_logistic pdf_lognormal pdf_negative_binomial pdf_noncentral_chi2 pdf_noncentral_student_t pdf_normal pdf_pareto pdf_poisson pdf_rank_sum pdf_rayleigh pdf_signed_rank pdf_student_t pdf_weibull pearson_skewness permanent permut permutation permutations petersen_graph petrov pickapart picture_equalp picturep piechart piechart_description planar_embedding playback plog plot2d plot3d plotdf ploteq plsquares pochhammer points poisdiff poisexpt poisint poismap poisplus poissimp poissubst poistimes poistrim polar polarform polartorect polar_to_xy poly_add poly_buchberger poly_buchberger_criterion poly_colon_ideal poly_content polydecomp poly_depends_p poly_elimination_ideal poly_exact_divide poly_expand poly_expt poly_gcd polygon poly_grobner poly_grobner_equal poly_grobner_member poly_grobner_subsetp poly_ideal_intersection poly_ideal_polysaturation poly_ideal_polysaturation1 poly_ideal_saturation poly_ideal_saturation1 poly_lcm poly_minimization polymod poly_multiply polynome2ele polynomialp poly_normal_form poly_normalize poly_normalize_list poly_polysaturation_extension poly_primitive_part poly_pseudo_divide poly_reduced_grobner poly_reduction poly_saturation_extension poly_s_polynomial poly_subtract polytocompanion pop postfix potential power_mod powerseries powerset prefix prev_prime primep primes principal_components print printf printfile print_graph printpois printprops prodrac product properties propvars psi psubst ptriangularize pui pui2comp pui2ele pui2polynome pui_direct puireduc push put pv qput qrange qty quad_control quad_qag quad_qagi quad_qagp quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quadrilateral quantile quantile_bernoulli quantile_beta quantile_binomial quantile_cauchy quantile_chi2 quantile_continuous_uniform quantile_discrete_uniform quantile_exp quantile_f quantile_gamma quantile_general_finite_discrete quantile_geometric quantile_gumbel quantile_hypergeometric quantile_laplace quantile_logistic quantile_lognormal quantile_negative_binomial quantile_noncentral_chi2 quantile_noncentral_student_t quantile_normal quantile_pareto quantile_poisson quantile_rayleigh quantile_student_t quantile_weibull quartile_skewness quit qunit quotient racah_v racah_w radcan radius random random_bernoulli random_beta random_binomial random_bipartite_graph random_cauchy random_chi2 random_continuous_uniform random_digraph random_discrete_uniform random_exp random_f random_gamma random_general_finite_discrete random_geometric random_graph random_graph1 random_gumbel random_hypergeometric random_laplace random_logistic random_lognormal random_negative_binomial random_network random_noncentral_chi2 random_noncentral_student_t random_normal random_pareto random_permutation random_poisson random_rayleigh random_regular_graph random_student_t random_tournament random_tree random_weibull range rank rat ratcoef ratdenom ratdiff ratdisrep ratexpand ratinterpol rational rationalize ratnumer ratnump ratp ratsimp ratsubst ratvars ratweight read read_array read_binary_array read_binary_list read_binary_matrix readbyte readchar read_hashed_array readline read_list read_matrix read_nested_list readonly read_xpm real_imagpart_to_conjugate realpart realroots rearray rectangle rectform rectform_log_if_constant recttopolar rediff reduce_consts reduce_order region region_boundaries region_boundaries_plus rem remainder remarray rembox remcomps remcon remcoord remfun remfunction remlet remove remove_constvalue remove_dimensions remove_edge remove_fundamental_dimensions remove_fundamental_units remove_plot_option remove_vertex rempart remrule remsym remvalue rename rename_file reset reset_displays residue resolvante resolvante_alternee1 resolvante_bipartite resolvante_diedrale resolvante_klein resolvante_klein3 resolvante_produit_sym resolvante_unitaire resolvante_vierer rest resultant return reveal reverse revert revert2 rgb2level rhs ricci riemann rinvariant risch rk rmdir rncombine romberg room rootscontract round row rowop rowswap rreduce run_testsuite %s save saving scalarp scaled_bessel_i scaled_bessel_i0 scaled_bessel_i1 scalefactors scanmap scatterplot scatterplot_description scene schur2comp sconcat scopy scsimp scurvature sdowncase sec sech second sequal sequalignore set_alt_display setdifference set_draw_defaults set_edge_weight setelmx setequalp setify setp set_partitions set_plot_option set_prompt set_random_state set_tex_environment set_tex_environment_default setunits setup_autoload set_up_dot_simplifications set_vertex_label seventh sexplode sf sha1sum sha256sum shortest_path shortest_weighted_path show showcomps showratvars sierpinskiale sierpinskimap sign signum similaritytransform simp_inequality simplify_sum simplode simpmetderiv simtran sin sinh sinsert sinvertcase sixth skewness skewness_bernoulli skewness_beta skewness_binomial skewness_chi2 skewness_continuous_uniform skewness_discrete_uniform skewness_exp skewness_f skewness_gamma skewness_general_finite_discrete skewness_geometric skewness_gumbel skewness_hypergeometric skewness_laplace skewness_logistic skewness_lognormal skewness_negative_binomial skewness_noncentral_chi2 skewness_noncentral_student_t skewness_normal skewness_pareto skewness_poisson skewness_rayleigh skewness_student_t skewness_weibull slength smake small_rhombicosidodecahedron_graph small_rhombicuboctahedron_graph smax smin smismatch snowmap snub_cube_graph snub_dodecahedron_graph solve solve_rec solve_rec_rat some somrac sort sparse6_decode sparse6_encode sparse6_export sparse6_import specint spherical spherical_bessel_j spherical_bessel_y spherical_hankel1 spherical_hankel2 spherical_harmonic spherical_to_xyz splice split sposition sprint sqfr sqrt sqrtdenest sremove sremovefirst sreverse ssearch ssort sstatus ssubst ssubstfirst staircase standardize standardize_inverse_trig starplot starplot_description status std std1 std_bernoulli std_beta std_binomial std_chi2 std_continuous_uniform std_discrete_uniform std_exp std_f std_gamma std_general_finite_discrete std_geometric std_gumbel std_hypergeometric std_laplace std_logistic std_lognormal std_negative_binomial std_noncentral_chi2 std_noncentral_student_t std_normal std_pareto std_poisson std_rayleigh std_student_t std_weibull stemplot stirling stirling1 stirling2 strim striml strimr string stringout stringp strong_components struve_h struve_l sublis sublist sublist_indices submatrix subsample subset subsetp subst substinpart subst_parallel substpart substring subvar subvarp sum sumcontract summand_to_rec supcase supcontext symbolp symmdifference symmetricp system take_channel take_inference tan tanh taylor taylorinfo taylorp taylor_simplifier taytorat tcl_output tcontract tellrat tellsimp tellsimpafter tentex tenth test_mean test_means_difference test_normality test_proportion test_proportions_difference test_rank_sum test_sign test_signed_rank test_variance test_variance_ratio tex tex1 tex_display texput %th third throw time timedate timer timer_info tldefint tlimit todd_coxeter toeplitz tokens to_lisp topological_sort to_poly to_poly_solve totaldisrep totalfourier totient tpartpol trace tracematrix trace_options transform_sample translate translate_file transpose treefale tree_reduce treillis treinat triangle triangularize trigexpand trigrat trigreduce trigsimp trunc truncate truncated_cube_graph truncated_dodecahedron_graph truncated_icosahedron_graph truncated_tetrahedron_graph tr_warnings_get tube tutte_graph ueivects uforget ultraspherical underlying_graph undiff union unique uniteigenvectors unitp units unit_step unitvector unorder unsum untellrat untimer untrace uppercasep uricci uriemann uvect vandermonde_matrix var var1 var_bernoulli var_beta var_binomial var_chi2 var_continuous_uniform var_discrete_uniform var_exp var_f var_gamma var_general_finite_discrete var_geometric var_gumbel var_hypergeometric var_laplace var_logistic var_lognormal var_negative_binomial var_noncentral_chi2 var_noncentral_student_t var_normal var_pareto var_poisson var_rayleigh var_student_t var_weibull vector vectorpotential vectorsimp verbify vers vertex_coloring vertex_connectivity vertex_degree vertex_distance vertex_eccentricity vertex_in_degree vertex_out_degree vertices vertices_to_cycle vertices_to_path %w weyl wheel_graph wiener_index wigner_3j wigner_6j wigner_9j with_stdout write_binary_data writebyte write_data writefile wronskian xreduce xthru %y Zeilberger zeroequiv zerofor zeromatrix zeromatrixp zeta zgeev zheev zlange zn_add_table zn_carmichael_lambda zn_characteristic_factors zn_determinant zn_factor_generators zn_invert_by_lu zn_log zn_mult_table absboxchar activecontexts adapt_depth additive adim aform algebraic algepsilon algexact aliases allbut all_dotsimp_denoms allocation allsym alphabetic animation antisymmetric arrays askexp assume_pos assume_pos_pred assumescalar asymbol atomgrad atrig1 axes axis_3d axis_bottom axis_left axis_right axis_top azimuth background background_color backsubst berlefact bernstein_explicit besselexpand beta_args_sum_to_integer beta_expand bftorat bftrunc bindtest border boundaries_array box boxchar breakup %c capping cauchysum cbrange cbtics center cflength cframe_flag cnonmet_flag color color_bar color_bar_tics colorbox columns commutative complex cone context contexts contour contour_levels cosnpiflag ctaypov ctaypt ctayswitch ctayvar ct_coords ctorsion_flag ctrgsimp cube current_let_rule_package cylinder data_file_name debugmode decreasing default_let_rule_package delay dependencies derivabbrev derivsubst detout diagmetric diff dim dimensions dispflag display2d|10 display_format_internal distribute_over doallmxops domain domxexpt domxmxops domxnctimes dontfactor doscmxops doscmxplus dot0nscsimp dot0simp dot1simp dotassoc dotconstrules dotdistrib dotexptsimp dotident dotscrules draw_graph_program draw_realpart edge_color edge_coloring edge_partition edge_type edge_width %edispflag elevation %emode endphi endtheta engineering_format_floats enhanced3d %enumer epsilon_lp erfflag erf_representation errormsg error_size error_syms error_type %e_to_numlog eval even evenfun evflag evfun ev_point expandwrt_denom expintexpand expintrep expon expop exptdispflag exptisolate exptsubst facexpand facsum_combine factlim factorflag factorial_expand factors_only fb feature features file_name file_output_append file_search_demo file_search_lisp file_search_maxima|10 file_search_tests file_search_usage file_type_lisp file_type_maxima|10 fill_color fill_density filled_func fixed_vertices flipflag float2bf font font_size fortindent fortspaces fpprec fpprintprec functions gamma_expand gammalim gdet genindex gensumnum GGFCFMAX GGFINFINITY globalsolve gnuplot_command gnuplot_curve_styles gnuplot_curve_titles gnuplot_default_term_command gnuplot_dumb_term_command gnuplot_file_args gnuplot_file_name gnuplot_out_file gnuplot_pdf_term_command gnuplot_pm3d gnuplot_png_term_command gnuplot_postamble gnuplot_preamble gnuplot_ps_term_command gnuplot_svg_term_command gnuplot_term gnuplot_view_args Gosper_in_Zeilberger gradefs grid grid2d grind halfangles head_angle head_both head_length head_type height hypergeometric_representation %iargs ibase icc1 icc2 icounter idummyx ieqnprint ifb ifc1 ifc2 ifg ifgi ifr iframe_bracket_form ifri igeowedge_flag ikt1 ikt2 imaginary inchar increasing infeval infinity inflag infolists inm inmc1 inmc2 intanalysis integer integervalued integrate_use_rootsof integration_constant integration_constant_counter interpolate_color intfaclim ip_grid ip_grid_in irrational isolate_wrt_times iterations itr julia_parameter %k1 %k2 keepfloat key key_pos kinvariant kt label label_alignment label_orientation labels lassociative lbfgs_ncorrections lbfgs_nfeval_max leftjust legend letrat let_rule_packages lfg lg lhospitallim limsubst linear linear_solver linechar linel|10 linenum line_type linewidth line_width linsolve_params linsolvewarn lispdisp listarith listconstvars listdummyvars lmxchar load_pathname loadprint logabs logarc logcb logconcoeffp logexpand lognegint logsimp logx logx_secondary logy logy_secondary logz lriem m1pbranch macroexpansion macros mainvar manual_demo maperror mapprint matrix_element_add matrix_element_mult matrix_element_transpose maxapplydepth maxapplyheight maxima_tempdir|10 maxima_userdir|10 maxnegex MAX_ORD maxposex maxpsifracdenom maxpsifracnum maxpsinegint maxpsiposint maxtayorder mesh_lines_color method mod_big_prime mode_check_errorp mode_checkp mode_check_warnp mod_test mod_threshold modular_linear_solver modulus multiplicative multiplicities myoptions nary negdistrib negsumdispflag newline newtonepsilon newtonmaxiter nextlayerfactor niceindicespref nm nmc noeval nolabels nonegative_lp noninteger nonscalar noun noundisp nouns np npi nticks ntrig numer numer_pbranch obase odd oddfun opacity opproperties opsubst optimprefix optionset orientation origin orthopoly_returns_intervals outative outchar packagefile palette partswitch pdf_file pfeformat phiresolution %piargs piece pivot_count_sx pivot_max_sx plot_format plot_options plot_realpart png_file pochhammer_max_index points pointsize point_size points_joined point_type poislim poisson poly_coefficient_ring poly_elimination_order polyfactor poly_grobner_algorithm poly_grobner_debug poly_monomial_order poly_primary_elimination_order poly_return_term_list poly_secondary_elimination_order poly_top_reduction_only posfun position powerdisp pred prederror primep_number_of_tests product_use_gamma program programmode promote_float_to_bigfloat prompt proportional_axes props psexpand ps_file radexpand radius radsubstflag rassociative ratalgdenom ratchristof ratdenomdivide rateinstein ratepsilon ratfac rational ratmx ratprint ratriemann ratsimpexpons ratvarswitch ratweights ratweyl ratwtlvl real realonly redraw refcheck resolution restart resultant ric riem rmxchar %rnum_list rombergabs rombergit rombergmin rombergtol rootsconmode rootsepsilon run_viewer same_xy same_xyz savedef savefactors scalar scalarmatrixp scale scale_lp setcheck setcheckbreak setval show_edge_color show_edges show_edge_type show_edge_width show_id show_label showtime show_vertex_color show_vertex_size show_vertex_type show_vertices show_weight simp simplified_output simplify_products simpproduct simpsum sinnpiflag solvedecomposes solveexplicit solvefactors solvenullwarn solveradcan solvetrigwarn space sparse sphere spring_embedding_depth sqrtdispflag stardisp startphi starttheta stats_numer stringdisp structures style sublis_apply_lambda subnumsimp sumexpand sumsplitfact surface surface_hide svg_file symmetric tab taylordepth taylor_logexpand taylor_order_coefficients taylor_truncate_polynomials tensorkill terminal testsuite_files thetaresolution timer_devalue title tlimswitch tr track transcompile transform transform_xy translate_fast_arrays transparent transrun tr_array_as_ref tr_bound_function_applyp tr_file_tty_messagesp tr_float_can_branch_complex tr_function_call_default trigexpandplus trigexpandtimes triginverses trigsign trivial_solutions tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars tr_warn_bad_function_calls tr_warn_fexpr tr_warn_meval tr_warn_mode tr_warn_undeclared tr_warn_undefined_variable tstep ttyoff tube_extremes ufg ug %unitexpand unit_vectors uric uriem use_fast_arrays user_preamble usersetunits values vect_cross verbose vertex_color vertex_coloring vertex_partition vertex_size vertex_type view warnings weyl width windowname windowtitle wired_surface wireframe xaxis xaxis_color xaxis_secondary xaxis_type xaxis_width xlabel xlabel_secondary xlength xrange xrange_secondary xtics xtics_axis xtics_rotate xtics_rotate_secondary xtics_secondary xtics_secondary_axis xu_grid x_voxel xy_file xyplane xy_scale yaxis yaxis_color yaxis_secondary yaxis_type yaxis_width ylabel ylabel_secondary ylength yrange yrange_secondary ytics ytics_axis ytics_rotate ytics_rotate_secondary ytics_secondary ytics_secondary_axis yv_grid y_voxel yx_ratio zaxis zaxis_color zaxis_type zaxis_width zeroa zerob zerobern zeta%pi zlabel zlabel_rotate zlength zmin zn_primroot_limit zn_primroot_pretest",i="_ __ %|0 %%|0";return{l:"[A-Za-z_%][0-9A-Za-z_%]*",k:{keyword:t,literal:a,built_in:r,symbol:i},c:[{cN:"comment",b:"/\\*",e:"\\*/",c:["self"]},e.QSM,{cN:"number",r:0,v:[{b:"\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Ee][-+]?\\d+\\b"},{b:"\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Bb][-+]?\\d+\\b",r:10},{b:"\\b(\\.\\d+|\\d+\\.\\d+)\\b"},{b:"\\b(\\d+|0[0-9A-Za-z]+)\\.?\\b"}]}],i:/@/}});hljs.registerLanguage("fsharp",function(e){var t={b:"<",e:">",c:[e.inherit(e.TM,{b:/'[a-zA-Z0-9_]+/})]};return{aliases:["fs"],k:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",i:/\/\*/,c:[{cN:"keyword",b:/\b(yield|return|let|do)!/},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},{cN:"string",b:'"""',e:'"""'},e.C("\\(\\*","\\*\\)"),{cN:"class",bK:"type",e:"\\(|=|$",eE:!0,c:[e.UTM,t]},{cN:"meta",b:"\\[<",e:">\\]",r:10},{cN:"symbol",b:"\\B('[A-Za-z])\\b",c:[e.BE]},e.CLCM,e.inherit(e.QSM,{i:null}),e.CNM]}});hljs.registerLanguage("processing",function(e){return{k:{keyword:"BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject Object StringDict StringList Table TableRow XML false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",literal:"P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI",title:"setup draw",built_in:"displayHeight displayWidth mouseY mouseX mousePressed pmouseX pmouseY key keyCode pixels focused frameCount frameRate height width size createGraphics beginDraw createShape loadShape PShape arc ellipse line point quad rect triangle bezier bezierDetail bezierPoint bezierTangent curve curveDetail curvePoint curveTangent curveTightness shape shapeMode beginContour beginShape bezierVertex curveVertex endContour endShape quadraticVertex vertex ellipseMode noSmooth rectMode smooth strokeCap strokeJoin strokeWeight mouseClicked mouseDragged mouseMoved mousePressed mouseReleased mouseWheel keyPressed keyPressedkeyReleased keyTyped print println save saveFrame day hour millis minute month second year background clear colorMode fill noFill noStroke stroke alpha blue brightness color green hue lerpColor red saturation modelX modelY modelZ screenX screenY screenZ ambient emissive shininess specular add createImage beginCamera camera endCamera frustum ortho perspective printCamera printProjection cursor frameRate noCursor exit loop noLoop popStyle pushStyle redraw binary boolean byte char float hex int str unbinary unhex join match matchAll nf nfc nfp nfs split splitTokens trim append arrayCopy concat expand reverse shorten sort splice subset box sphere sphereDetail createInput createReader loadBytes loadJSONArray loadJSONObject loadStrings loadTable loadXML open parseXML saveTable selectFolder selectInput beginRaw beginRecord createOutput createWriter endRaw endRecord PrintWritersaveBytes saveJSONArray saveJSONObject saveStream saveStrings saveXML selectOutput popMatrix printMatrix pushMatrix resetMatrix rotate rotateX rotateY rotateZ scale shearX shearY translate ambientLight directionalLight lightFalloff lights lightSpecular noLights normal pointLight spotLight image imageMode loadImage noTint requestImage tint texture textureMode textureWrap blend copy filter get loadPixels set updatePixels blendMode loadShader PShaderresetShader shader createFont loadFont text textFont textAlign textLeading textMode textSize textWidth textAscent textDescent abs ceil constrain dist exp floor lerp log mag map max min norm pow round sq sqrt acos asin atan atan2 cos degrees radians sin tan noise noiseDetail noiseSeed random randomGaussian randomSeed"},c:[e.CLCM,e.CBCM,e.ASM,e.QSM,e.CNM]}});hljs.registerLanguage("julia",function(e){var r={keyword:"in abstract baremodule begin bitstype break catch ccall const continue do else elseif end export finally for function global if immutable import importall let local macro module quote return try type typealias using while",literal:"true false ARGS CPU_CORES C_NULL DL_LOAD_PATH DevNull ENDIAN_BOM ENV I|0 Inf Inf16 Inf32 InsertionSort JULIA_HOME LOAD_PATH MS_ASYNC MS_INVALIDATE MS_SYNC MergeSort NaN NaN16 NaN32 OS_NAME QuickSort RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW RoundDown RoundFromZero RoundNearest RoundToZero RoundUp STDERR STDIN STDOUT VERSION WORD_SIZE catalan cglobal e|0 eu|0 eulergamma golden im nothing pi γ π φ Inf64 NaN64 RoundNearestTiesAway RoundNearestTiesUp ",built_in:"ANY ASCIIString AbstractArray AbstractRNG AbstractSparseArray Any ArgumentError Array Associative Base64Pipe Bidiagonal BigFloat BigInt BitArray BitMatrix BitVector Bool BoundsError Box CFILE Cchar Cdouble Cfloat Char CharString Cint Clong Clonglong ClusterManager Cmd Coff_t Colon Complex Complex128 Complex32 Complex64 Condition Cptrdiff_t Cshort Csize_t Cssize_t Cuchar Cuint Culong Culonglong Cushort Cwchar_t DArray DataType DenseArray Diagonal Dict DimensionMismatch DirectIndexString Display DivideError DomainError EOFError EachLine Enumerate ErrorException Exception Expr Factorization FileMonitor FileOffset Filter Float16 Float32 Float64 FloatRange FloatingPoint Function GetfieldNode GotoNode Hermitian IO IOBuffer IOStream IPv4 IPv6 InexactError Int Int128 Int16 Int32 Int64 Int8 IntSet Integer InterruptException IntrinsicFunction KeyError LabelNode LambdaStaticData LineNumberNode LoadError LocalProcess MIME MathConst MemoryError MersenneTwister Method MethodError MethodTable Module NTuple NewvarNode Nothing Number ObjectIdDict OrdinalRange OverflowError ParseError PollingFileWatcher ProcessExitedException ProcessGroup Ptr QuoteNode Range Range1 Ranges Rational RawFD Real Regex RegexMatch RemoteRef RepString RevString RopeString RoundingMode Set SharedArray Signed SparseMatrixCSC StackOverflowError Stat StatStruct StepRange String SubArray SubString SymTridiagonal Symbol SymbolNode Symmetric SystemError Task TextDisplay Timer TmStruct TopNode Triangular Tridiagonal Type TypeConstructor TypeError TypeName TypeVar UTF16String UTF32String UTF8String UdpSocket Uint Uint128 Uint16 Uint32 Uint64 Uint8 UndefRefError UndefVarError UniformScaling UnionType UnitRange Unsigned Vararg VersionNumber WString WeakKeyDict WeakRef Woodbury Zip AbstractChannel AbstractFloat AbstractString AssertionError Base64DecodePipe Base64EncodePipe BufferStream CapturedException CartesianIndex CartesianRange Channel Cintmax_t CompositeException Cstring Cuintmax_t Cwstring Date DateTime Dims Enum GenSym GlobalRef HTML InitError InvalidStateException Irrational LinSpace LowerTriangular NullException Nullable OutOfMemoryError Pair PartialQuickSort Pipe RandomDevice ReadOnlyMemoryError ReentrantLock Ref RemoteException SegmentationFault SerializationState SimpleVector TCPSocket Text Tuple UDPSocket UInt UInt128 UInt16 UInt32 UInt64 UInt8 UnicodeError Union UpperTriangular Val Void WorkerConfig AbstractMatrix AbstractSparseMatrix AbstractSparseVector AbstractVecOrMat AbstractVector DenseMatrix DenseVecOrMat DenseVector Matrix SharedMatrix SharedVector StridedArray StridedMatrix StridedVecOrMat StridedVector VecOrMat Vector "},t="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",a={l:t,k:r,i:/<\//},n={cN:"type",b:/::/},o={cN:"type",b:/<:/},i={cN:"number",b:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,r:0},l={cN:"string",b:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},c={cN:"subst",b:/\$\(/,e:/\)/,k:r},s={cN:"variable",b:"\\$"+t},d={cN:"string",c:[e.BE,c,s],v:[{b:/\w*"""/,e:/"""\w*/,r:10},{b:/\w*"/,e:/"\w*/}]},S={cN:"string",c:[e.BE,c,s],b:"`",e:"`"},u={cN:"meta",b:"@"+t},g={cN:"comment",v:[{b:"#=",e:"=#",r:10},{b:"#",e:"$"}]};return a.c=[i,l,n,o,d,S,u,g,e.HCM],c.c=a.c,a});hljs.registerLanguage("fix",function(u){return{c:[{b:/[^\u2401\u0001]+/,e:/[\u2401\u0001]/,eE:!0,rB:!0,rE:!1,c:[{b:/([^\u2401\u0001=]+)/,e:/=([^\u2401\u0001=]+)/,rE:!0,rB:!1,cN:"attr"},{b:/=/,e:/([\u2401\u0001])/,eE:!0,eB:!0,cN:"string"}]}],cI:!0}});hljs.registerLanguage("awk",function(e){var r={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},b="BEGIN END if else while do for in break continue delete next nextfile function func exit|10",n={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,r:10},{b:/(u|b)?r?"""/,e:/"""/,r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]};return{k:{keyword:b},c:[r,n,e.RM,e.HCM,e.NM]}});hljs.registerLanguage("puppet",function(e){var s={keyword:"and case default else elsif false if in import enherits node or true undef unless main settings $string ",literal:"alias audit before loglevel noop require subscribe tag owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check en_address ip_address realname command environment hour monute month monthday special target weekday creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey sslverify mounted",built_in:"architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version"},r=e.C("#","$"),a="([A-Za-z_]|::)(\\w|::)*",i=e.inherit(e.TM,{b:a}),o={cN:"variable",b:"\\$"+a},t={cN:"string",c:[e.BE,o],v:[{b:/'/,e:/'/},{b:/"/,e:/"/}]};return{aliases:["pp"],c:[r,o,t,{bK:"class",e:"\\{|;",i:/=/,c:[i,r]},{bK:"define",e:/\{/,c:[{cN:"section",b:e.IR,endsParent:!0}]},{b:e.IR+"\\s+\\{",rB:!0,e:/\S/,c:[{cN:"keyword",b:e.IR},{b:/\{/,e:/\}/,k:s,r:0,c:[t,r,{b:"[a-zA-Z_]+\\s*=>",rB:!0,e:"=>",c:[{cN:"attr",b:e.IR}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},o]}],r:0}]}});hljs.registerLanguage("cal",function(e){var r="div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to until while with var",t="false true",c=[e.CLCM,e.C(/\{/,/\}/,{r:0}),e.C(/\(\*/,/\*\)/,{r:10})],n={cN:"string",b:/'/,e:/'/,c:[{b:/''/}]},o={cN:"string",b:/(#\d+)+/},a={cN:"number",b:"\\b\\d+(\\.\\d+)?(DT|D|T)",r:0},i={cN:"string",b:'"',e:'"'},d={cN:"function",bK:"procedure",e:/[:;]/,k:"procedure|10",c:[e.TM,{cN:"params",b:/\(/,e:/\)/,k:r,c:[n,o]}].concat(c)},s={cN:"class",b:"OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)",rB:!0,c:[e.TM,d]};return{cI:!0,k:{keyword:r,literal:t},i:/\/\*/,c:[n,o,a,i,e.NM,s,d]}});hljs.registerLanguage("autoit",function(e){var t="ByRef Case Const ContinueCase ContinueLoop Default Dim Do Else ElseIf EndFunc EndIf EndSelect EndSwitch EndWith Enum Exit ExitLoop For Func Global If In Local Next ReDim Return Select Static Step Switch Then To Until Volatile WEnd While With",r="True False And Null Not Or",i="Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait",l={v:[e.C(";","$",{r:0}),e.C("#cs","#ce"),e.C("#comments-start","#comments-end")]},n={b:"\\$[A-z0-9_]+"},o={cN:"string",v:[{b:/"/,e:/"/,c:[{b:/""/,r:0}]},{b:/'/,e:/'/,c:[{b:/''/,r:0}]}]},a={v:[e.BNM,e.CNM]},S={cN:"meta",b:"#",e:"$",k:{"meta-keyword":"comments include include-once NoTrayIcon OnAutoItStartRegister pragma compile RequireAdmin"},c:[{b:/\\\n/,r:0},{bK:"include",k:{"meta-keyword":"include"},e:"$",c:[o,{cN:"meta-string",v:[{b:"<",e:">"},{b:/"/,e:/"/,c:[{b:/""/,r:0}]},{b:/'/,e:/'/,c:[{b:/''/,r:0}]}]}]},o,l]},C={cN:"symbol",b:"@[A-z0-9_]+"},s={cN:"function",bK:"Func",e:"$",i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:[n,o,a]}]};return{cI:!0,i:/\/\*/,k:{keyword:t,built_in:i,literal:r},c:[l,n,o,a,S,C,s]}});hljs.registerLanguage("mel",function(e){return{k:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",i:"",rB:!0,i:"\\(|#|//|/\\*|\\\\|:|;",c:[h,e.inherit(e.TM,{b:r})],starts:{e:";|\\.",k:b,c:u}},i,{b:"^-",e:"\\.",r:0,eE:!0,rB:!0,l:"-"+e.IR,k:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec",c:[h]},n,e.QSM,l,t,f,o,{b:/\.$/}]}});hljs.registerLanguage("glsl",function(e){return{k:{keyword:"break continue discard do else for if return whileattribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly",type:"atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBufferiimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void",built_in:"gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow",literal:"true false"},i:'"',c:[e.CLCM,e.CBCM,e.CNM,{cN:"meta",b:"#",e:"$"}]}});hljs.registerLanguage("roboconf",function(a){var e="[a-zA-Z-_][^\\n{]+\\{",n={cN:"attribute",b:/[a-zA-Z-_]+/,e:/\s*:/,eE:!0,starts:{e:";",r:0,c:[{cN:"variable",b:/\.[a-zA-Z-_]+/},{cN:"keyword",b:/\(optional\)/}]}};return{aliases:["graph","instances"],cI:!0,k:"import",c:[{b:"^facet "+e,e:"}",k:"facet",c:[n,a.HCM]},{b:"^\\s*instance of "+e,e:"}",k:"name count channels instance-data instance-state instance of",i:/\S/,c:["self",n,a.HCM]},{b:"^"+e,e:"}",c:[n,a.HCM]},a.HCM]}});hljs.registerLanguage("monkey",function(e){var n={cN:"number",r:0,v:[{b:"[$][a-fA-F0-9]+"},e.NM]};return{cI:!0,k:{keyword:"public private property continue exit extern new try catch eachin not abstract final select case default const local global field end if then else elseif endif while wend repeat until forever for to step next return module inline throw import",built_in:"DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI",literal:"true false null and or shl shr mod"},i:/\/\*/,c:[e.C("#rem","#end"),e.C("'","$",{r:0}),{cN:"function",bK:"function method",e:"[(=:]|$",i:/\n/,c:[e.UTM]},{cN:"class",bK:"class interface",e:"$",c:[{bK:"extends implements"},e.UTM]},{cN:"built_in",b:"\\b(self|super)\\b"},{cN:"meta",b:"\\s*#",e:"$",k:{"meta-keyword":"if else elseif endif end then"}},{cN:"meta",b:"^\\s*strict\\b"},{bK:"alias",e:"=",c:[e.UTM]},e.QSM,n]}});hljs.registerLanguage("coq",function(e){return{k:{keyword:"_ as at cofix else end exists exists2 fix for forall fun if IF in let match mod Prop return Set then Type using where with Abort About Add Admit Admitted All Arguments Assumptions Axiom Back BackTo Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture Conjectures Constant constr Constraint Constructors Context Corollary CreateHintDb Cut Declare Defined Definition Delimit Dependencies DependentDerive Drop eauto End Equality Eval Example Existential Existentials Existing Export exporting Extern Extract Extraction Fact Field Fields File Fixpoint Focus for From Function Functional Generalizable Global Goal Grab Grammar Graph Guarded Heap Hint HintDb Hints Hypotheses Hypothesis ident Identity If Immediate Implicit Import Include Inductive Infix Info Initial Inline Inspect Instance Instances Intro Intros Inversion Inversion_clear Language Left Lemma Let Libraries Library Load LoadPath Local Locate Ltac ML Mode Module Modules Monomorphic Morphism Next NoInline Notation Obligation Obligations Opaque Open Optimize Options Parameter Parameters Parametric Path Paths pattern Polymorphic Preterm Print Printing Program Projections Proof Proposition Pwd Qed Quit Rec Record Recursive Redirect Relation Remark Remove Require Reserved Reset Resolve Restart Rewrite Right Ring Rings Save Scheme Scope Scopes Script Search SearchAbout SearchHead SearchPattern SearchRewrite Section Separate Set Setoid Show Solve Sorted Step Strategies Strategy Structure SubClass Table Tables Tactic Term Test Theorem Time Timeout Transparent Type Typeclasses Types Undelimit Undo Unfocus Unfocused Unfold Universe Universes Unset Unshelve using Variable Variables Variant Verbose Visibility where with",built_in:"abstract absurd admit after apply as assert assumption at auto autorewrite autounfold before bottom btauto by case case_eq cbn cbv change classical_left classical_right clear clearbody cofix compare compute congruence constr_eq constructor contradict contradiction cut cutrewrite cycle decide decompose dependent destruct destruction dintuition discriminate discrR do double dtauto eapply eassumption eauto ecase econstructor edestruct ediscriminate eelim eexact eexists einduction einjection eleft elim elimtype enough equality erewrite eright esimplify_eq esplit evar exact exactly_once exfalso exists f_equal fail field field_simplify field_simplify_eq first firstorder fix fold fourier functional generalize generalizing gfail give_up has_evar hnf idtac in induction injection instantiate intro intro_pattern intros intuition inversion inversion_clear is_evar is_var lapply lazy left lia lra move native_compute nia nsatz omega once pattern pose progress proof psatz quote record red refine reflexivity remember rename repeat replace revert revgoals rewrite rewrite_strat right ring ring_simplify rtauto set setoid_reflexivity setoid_replace setoid_rewrite setoid_symmetry setoid_transitivity shelve shelve_unifiable simpl simple simplify_eq solve specialize split split_Rabs split_Rmult stepl stepr subst sum swap symmetry tactic tauto time timeout top transitivity trivial try tryif unfold unify until using vm_compute with"},c:[e.QSM,e.C("\\(\\*","\\*\\)"),e.CNM,{cN:"type",eB:!0,b:"\\|\\s*",e:"\\w+"},{b:/[-=]>/}]}});hljs.registerLanguage("mojolicious",function(e){return{sL:"xml",c:[{cN:"meta",b:"^__(END|DATA)__$"},{b:"^\\s*%{1,2}={0,2}",e:"$",sL:"perl"},{b:"<%{1,2}={0,2}",e:"={0,1}%>",sL:"perl",eB:!0,eE:!0}]}});hljs.registerLanguage("rsl",function(e){return{k:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},i:"",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(s)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:s.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+t,e:"[-=]>",rB:!0,c:[i,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:t,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("dos",function(e){var r=e.C(/^\s*@?rem\b/,/$/,{r:10}),t={cN:"symbol",b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",r:0};return{aliases:["bat","cmd"],cI:!0,i:/\/\*/,k:{keyword:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",built_in:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del"},c:[{cN:"variable",b:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{cN:"function",b:t.b,e:"goto:eof",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),r]},{cN:"number",b:"\\b\\d+",r:0},r]}});hljs.registerLanguage("lua",function(e){var t="\\[=*\\[",a="\\]=*\\]",r={b:t,e:a,c:["self"]},n=[e.C("--(?!"+t+")","$"),e.C("--"+t,a,{c:[r],r:10})];return{l:e.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:n.concat([{cN:"function",bK:"function",e:"\\)",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:!0,c:n}].concat(n)},e.CNM,e.ASM,e.QSM,{cN:"string",b:t,e:a,c:[r],r:5}])}});hljs.registerLanguage("brainfuck",function(r){var n={cN:"literal",b:"[\\+\\-]",r:0};return{aliases:["bf"],c:[r.C("[^\\[\\]\\.,\\+\\-<> \r\n]","[\\[\\]\\.,\\+\\-<> \r\n]",{rE:!0,r:0}),{cN:"title",b:"[\\[\\]]",r:0},{cN:"string",b:"[\\.,]",r:0},{b:/\+\+|\-\-/,rB:!0,c:[n]},n]}});hljs.registerLanguage("oxygene",function(e){var r="abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained",t=e.C("{","}",{r:0}),a=e.C("\\(\\*","\\*\\)",{r:10}),n={cN:"string",b:"'",e:"'",c:[{b:"''"}]},o={cN:"string",b:"(#\\d+)+"},i={cN:"function",bK:"function constructor destructor procedure method",e:"[:;]",k:"function constructor|10 destructor|10 procedure|10 method|10",c:[e.TM,{cN:"params",b:"\\(",e:"\\)",k:r,c:[n,o]},t,a]};return{cI:!0,l:/\.?\w+/,k:r,i:'("|\\$[G-Zg-z]|\\/\\*||->)',c:[t,a,e.CLCM,n,o,e.NM,i,{cN:"class",b:"=\\bclass\\b",e:"end;",k:r,c:[n,o,t,a,e.CLCM,i]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("dart",function(e){var t={cN:"subst",b:"\\$\\{",e:"}",k:"true false null this is new super"},r={cN:"string",v:[{b:"r'''",e:"'''"},{b:'r"""',e:'"""'},{b:"r'",e:"'",i:"\\n"},{b:'r"',e:'"',i:"\\n"},{b:"'''",e:"'''",c:[e.BE,t]},{b:'"""',e:'"""',c:[e.BE,t]},{b:"'",e:"'",i:"\\n",c:[e.BE,t]},{b:'"',e:'"',i:"\\n",c:[e.BE,t]}]};t.c=[e.CNM,r];var n={keyword:"assert async await break case catch class const continue default do else enum extends false final finally for if in is new null rethrow return super switch sync this throw true try var void while with yield abstract as dynamic export external factory get implements import library operator part set static typedef",built_in:"print Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double int num document window querySelector querySelectorAll Element ElementList"};return{k:n,c:[r,e.C("/\\*\\*","\\*/",{sL:"markdown"}),e.C("///","$",{sL:"markdown"}),e.CLCM,e.CBCM,{cN:"class",bK:"class interface",e:"{",eE:!0,c:[{bK:"extends implements"},e.UTM]},e.CNM,{cN:"meta",b:"@[A-Za-z]+"},{b:"=>"}]}});hljs.registerLanguage("fortran",function(e){var t={cN:"params",b:"\\(",e:"\\)"},n={literal:".False. .True.",keyword:"kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_ofacosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image"};return{cI:!0,aliases:["f90","f95"],k:n,i:/\/\*/,c:[e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{cN:"string",r:0}),{cN:"function",bK:"subroutine function program",i:"[${=\\n]",c:[e.UTM,t]},e.C("!","$",{r:0}),{cN:"number",b:"(?=\\b|\\+|\\-|\\.)(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*)(?:[de][+-]?\\d+)?\\b\\.?",r:0}]}});hljs.registerLanguage("pf",function(t){var o={cN:"variable",b:/\$[\w\d#@][\w\d_]*/},e={cN:"variable",b:/<(?!\/)/,e:/>/};return{aliases:["pf.conf"],l:/[a-z0-9_<>-]+/,k:{built_in:"block match pass load anchor|5 antispoof|10 set table",keyword:"in out log quick on rdomain inet inet6 proto from port os to routeallow-opts divert-packet divert-reply divert-to flags group icmp-typeicmp6-type label once probability recieved-on rtable prio queuetos tag tagged user keep fragment for os dropaf-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robinsource-hash static-portdup-to reply-to route-toparent bandwidth default min max qlimitblock-policy debug fingerprints hostid limit loginterface optimizationreassemble ruleset-optimization basic none profile skip state-defaultsstate-policy timeoutconst counters persistno modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppysource-track global rule max-src-nodes max-src-states max-src-connmax-src-conn-rate overload flushscrub|5 max-mss min-ttl no-df|10 random-id",literal:"all any no-route self urpf-failed egress|5 unknown"},c:[t.HCM,t.NM,t.QSM,o,e]}});hljs.registerLanguage("nimrod",function(t){return{aliases:["nim"],k:{keyword:"addr and as asm bind block break case cast const continue converter discard distinct div do elif else end enum except export finally for from generic if import in include interface is isnot iterator let macro method mixin mod nil not notin object of or out proc ptr raise ref return shl shr static template try tuple type using var when while with without xor yield",literal:"shared guarded stdin stdout stderr result true false",built_in:"int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool char string cstring pointer expr stmt void auto any range array openarray varargs seq set clong culong cchar cschar cshort cint csize clonglong cfloat cdouble clongdouble cuchar cushort cuint culonglong cstringarray semistatic"},c:[{cN:"meta",b:/{\./,e:/\.}/,r:10},{cN:"string",b:/[a-zA-Z]\w*"/,e:/"/,c:[{b:/""/}]},{cN:"string",b:/([a-zA-Z]\w*)?"""/,e:/"""/},t.QSM,{cN:"type",b:/\b[A-Z]\w+\b/,r:0},{cN:"number",r:0,v:[{b:/\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/},{b:/\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/},{b:/\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/},{b:/\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/}]},t.HCM]}});hljs.registerLanguage("java",function(e){var t=e.UIR+"(<"+e.UIR+"(\\s*,\\s*"+e.UIR+")*>)?",a="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports",r="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",s={cN:"number",b:r,r:0};return{aliases:["jsp"],k:a,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:a,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:a,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},s,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("javascript",function(e){return{aliases:["js","jsx"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b://,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:["self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[e.CLCM,e.CBCM]}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("qml",function(r){var e={keyword:"in of on if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await import",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Behavior bool color coordinate date double enumeration font geocircle georectangle geoshape int list matrix4x4 parent point quaternion real rect size string url var variant vector2d vector3d vector4dPromise"},t="[a-zA-Z_][a-zA-Z0-9\\._]*",a={cN:"keyword",b:"\\bproperty\\b",starts:{cN:"string",e:"(:|=|;|,|//|/\\*|$)",rE:!0}},n={cN:"keyword",b:"\\bsignal\\b",starts:{cN:"string",e:"(\\(|:|=|;|,|//|/\\*|$)",rE:!0}},o={cN:"attribute",b:"\\bid\\s*:",starts:{cN:"string",e:t,rE:!1}},i={b:t+"\\s*:",rB:!0,c:[{cN:"attribute",b:t,e:"\\s*:",eE:!0,r:0}],r:0},c={b:t+"\\s*{",e:"{",rB:!0,r:0,c:[r.inherit(r.TM,{b:t})]};return{aliases:["qt"],cI:!1,k:e,c:[{cN:"meta",b:/^\s*['"]use (strict|asm)['"]/},r.ASM,r.QSM,{cN:"string",b:"`",e:"`",c:[r.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},r.CLCM,r.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:r.CNR}],r:0},{b:"("+r.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[r.CLCM,r.CBCM,r.RM,{b:/\s*[);\]]/,r:0,sL:"xml"}],r:0},n,a,{cN:"function",bK:"function",e:/\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[r.CLCM,r.CBCM]}],i:/\[|%/},{b:"\\."+r.IR,r:0},o,i,c],i:/#/}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\._]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}});hljs.registerLanguage("dockerfile",function(e){return{aliases:["docker"],cI:!0,k:"from maintainer cmd expose add copy entrypoint volume user workdir onbuild run env label",c:[e.HCM,{k:"run cmd entrypoint volume add copy workdir onbuild label",b:/^ *(onbuild +)?(run|cmd|entrypoint|volume|add|copy|workdir|label) +/,starts:{e:/[^\\]\n/,sL:"bash"}},{k:"from maintainer expose env user onbuild",b:/^ *(onbuild +)?(from|maintainer|expose|env|user|onbuild) +/,e:/[^\\]\n/,c:[e.ASM,e.QSM,e.NM,e.HCM]}]}});hljs.registerLanguage("nix",function(e){var r={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},t={cN:"subst",b:/\$\{/,e:/}/,k:r},i={b:/[a-zA-Z0-9-_]+(\s*=)/,rB:!0,r:0,c:[{cN:"attr",b:/\S+/}]},s={cN:"string",c:[t],v:[{b:"''",e:"''"},{b:'"',e:'"'}]},a=[e.NM,e.HCM,e.CBCM,s,i];return t.c=a,{aliases:["nixos"],k:r,c:a}});hljs.registerLanguage("tp",function(O){var R={cN:"number",b:"[1-9][0-9]*",r:0},E={cN:"symbol",b:":[^\\]]+"},T={cN:"built_in",b:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER| TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",e:"\\]",c:["self",R,E]},N={cN:"built_in",b:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",e:"\\]",c:["self",R,O.QSM,E]};return{k:{keyword:"ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB DIV DETECT ELSE END ENDFOR ERR_NUM ERROR_PROG FINE FOR GP GUARD INC IF JMP LINEAR_MAX_SPEED LOCK MOD MONITOR OFFSET Offset OR OVERRIDE PAUSE PREG PTH RT_LD RUN SELECT SKIP Skip TA TB TO TOOL_OFFSET Tool_Offset UF UT UFRAME_NUM UTOOL_NUM UNLOCK WAIT X Y Z W P R STRLEN SUBSTR FINDSTR VOFFSET PROG ATTR MN POS",literal:"ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET"},c:[T,N,{cN:"keyword",b:"/(PROG|ATTR|MN|POS|END)\\b"},{cN:"keyword",b:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{cN:"keyword",b:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{cN:"number",b:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",r:0},O.C("//","[;$]"),O.C("!","[;$]"),O.C("--eg:","$"),O.QSM,{cN:"string",b:"'",e:"'"},O.CNM,{cN:"variable",b:"\\$[A-Za-z0-9_]+"}]}});hljs.registerLanguage("delphi",function(e){var r="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure",t=[e.CLCM,e.C(/\{/,/\}/,{r:0}),e.C(/\(\*/,/\*\)/,{r:10})],a={cN:"string",b:/'/,e:/'/,c:[{b:/''/}]},i={cN:"string",b:/(#\d+)+/},c={b:e.IR+"\\s*=\\s*class\\s*\\(",rB:!0,c:[e.TM]},o={cN:"function",bK:"function constructor destructor procedure",e:/[:;]/,k:"function constructor|10 destructor|10 procedure|10",c:[e.TM,{cN:"params",b:/\(/,e:/\)/,k:r,c:[a,i]}].concat(t)};return{aliases:["dpr","dfm","pas","pascal","freepascal","lazarus","lpr","lfm"],cI:!0,k:r,i:/"|\$[G-Zg-z]|\/\*|<\/|\|/,c:[a,i,e.NM,c,o].concat(t)}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("haxe",function(e){var a="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)";return{aliases:["hx"],k:{keyword:"break callback case cast catch class continue default do dynamic else enum extends extern for function here if implements import in inline interface never new override package private public return static super switch this throw trace try typedef untyped using var while",literal:"true false null"},c:[e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{cN:"class",bK:"class interface",e:"{",eE:!0,c:[{bK:"extends implements"},e.TM]},{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elseif end error"}},{cN:"function",bK:"function",e:"[{;]",eE:!0,i:"\\S",c:[e.TM,{cN:"params",b:"\\(",e:"\\)",c:[e.ASM,e.QSM,e.CLCM,e.CBCM]},{b:":\\s*"+a}]}]}});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("yaml",function(e){var a={literal:"{ } true false yes no Yes No True False null"},b="^[ \\-]*",r="[a-zA-Z_][\\w\\-]*",t={cN:"attr",v:[{b:b+r+":"},{b:b+'"'+r+'":'},{b:b+"'"+r+"':"}]},c={cN:"template-variable",v:[{b:"{{",e:"}}"},{b:"%{",e:"}"}]},l={cN:"string",r:0,v:[{b:/'/,e:/'/},{b:/"/,e:/"/}],c:[e.BE,c]};return{cI:!0,aliases:["yml","YAML","yaml"],c:[t,{cN:"meta",b:"^---s*$",r:10},{cN:"string",b:"[\\|>] *$",rE:!0,c:l.c,e:t.v[0].b},{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0,r:0},{cN:"type",b:"!!"+e.UIR},{cN:"meta",b:"&"+e.UIR+"$"},{cN:"meta",b:"\\*"+e.UIR+"$"},{cN:"bullet",b:"^ *-",r:0},l,e.HCM,e.CNM],k:a}});hljs.registerLanguage("smali",function(t){var s=["add","and","cmp","cmpg","cmpl","const","div","double","float","goto","if","int","long","move","mul","neg","new","nop","not","or","rem","return","shl","shr","sput","sub","throw","ushr","xor"],e=["aget","aput","array","check","execute","fill","filled","goto/16","goto/32","iget","instance","invoke","iput","monitor","packed","sget","sparse"],r=["transient","constructor","abstract","final","synthetic","public","private","protected","static","bridge","system"];return{aliases:["smali"],c:[{cN:"string",b:'"',e:'"',r:0},t.C("#","$",{r:0}),{cN:"keyword",v:[{b:"\\s*\\.end\\s[a-zA-Z0-9]*"},{b:"^[ ]*\\.[a-zA-Z]*",r:0},{b:"\\s:[a-zA-Z_0-9]*",r:0},{b:"\\s("+r.join("|")+")"}]},{cN:"built_in",v:[{b:"\\s("+s.join("|")+")\\s"},{b:"\\s("+s.join("|")+")((\\-|/)[a-zA-Z0-9]+)+\\s",r:10},{b:"\\s("+e.join("|")+")((\\-|/)[a-zA-Z0-9]+)*\\s",r:10}]},{cN:"class",b:"L[^(;:\n]*;",r:0},{b:"[vp][0-9]+"}]}});hljs.registerLanguage("ldif",function(e){return{c:[{cN:"attribute",b:"^dn",e:": ",eE:!0,starts:{e:"$",r:0},r:10},{cN:"attribute",b:"^\\w",e:": ",eE:!0,starts:{e:"$",r:0}},{cN:"literal",b:"^-",e:"$"},e.HCM]}});hljs.registerLanguage("livecodeserver",function(e){var r={b:"\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+",r:0},t=[e.CBCM,e.HCM,e.C("--","$"),e.C("[^:]//","$")],a=e.inherit(e.TM,{v:[{b:"\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*"},{b:"\\b_[a-z0-9\\-]+"}]}),o=e.inherit(e.TM,{b:"\\b([A-Za-z0-9_\\-]+)\\b"});return{cI:!1,k:{keyword:"$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",literal:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract union unload wait write"},c:[r,{cN:"keyword",b:"\\bend\\sif\\b"},{cN:"function",bK:"function",e:"$",c:[r,o,e.ASM,e.QSM,e.BNM,e.CNM,a]},{cN:"function",b:"\\bend\\s+",e:"$",k:"end",c:[o,a],r:0},{bK:"command on",e:"$",c:[r,o,e.ASM,e.QSM,e.BNM,e.CNM,a]},{cN:"meta",v:[{b:"<\\?(rev|lc|livecode)",r:10},{b:"<\\?"},{b:"\\?>"}]},e.ASM,e.QSM,e.BNM,e.CNM,a].concat(t),i:";$|^\\[|^=|&|{"}});hljs.registerLanguage("gams",function(e){var a={keyword:"abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",literal:"eps inf na","built-in":"abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"},o={cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0},r={cN:"symbol",v:[{b:/\=[lgenxc]=/},{b:/\$/}]},t={cN:"comment",v:[{b:"'",e:"'"},{b:'"',e:'"'}],i:"\\n",c:[e.BE]},i={b:"/",e:"/",k:a,c:[t,e.CLCM,e.CBCM,e.QSM,e.ASM,e.CNM]},l={b:/[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,eB:!0,e:"$",eW:!0,c:[t,i,{cN:"comment",b:/([ ]*[a-z0-9&#*=?@>\\<:\-,()$\[\]_.{}!+%^]+)+/,r:0}]};return{aliases:["gms"],cI:!0,k:a,c:[e.C(/^\$ontext/,/^\$offtext/),{cN:"meta",b:"^\\$[a-z0-9]+",e:"$",rB:!0,c:[{cN:"meta-keyword",b:"^\\$[a-z0-9]+"}]},e.C("^\\*","$"),e.CLCM,e.CBCM,e.QSM,e.ASM,{bK:"set sets parameter parameters variable variables scalar scalars equation equations",e:";",c:[e.C("^\\*","$"),e.CLCM,e.CBCM,e.QSM,e.ASM,i,l]},{bK:"table",e:";",rB:!0,c:[{bK:"table",e:"$",c:[l]},e.C("^\\*","$"),e.CLCM,e.CBCM,e.QSM,e.ASM,e.CNM]},{cN:"function",b:/^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,rB:!0,c:[{cN:"title",b:/^[a-z][a-z0-9_]+/},o,r]},e.CNM,r]}});hljs.registerLanguage("prolog",function(c){var b={b:/[a-z][A-Za-z0-9_]*/,r:0},r={cN:"symbol",v:[{b:/[A-Z][a-zA-Z0-9_]*/},{b:/_[A-Za-z0-9_]*/}],r:0},e={b:/\(/,e:/\)/,r:0},n={b:/\[/,e:/\]/},a={cN:"comment",b:/%/,e:/$/,c:[c.PWM]},t={cN:"string",b:/`/,e:/`/,c:[c.BE]},g={cN:"string",b:/0\'(\\\'|.)/},s={cN:"string",b:/0\'\\s/},o={b:/:-/},N=[b,r,e,o,n,a,c.CBCM,c.QSM,c.ASM,t,g,s,c.CNM];return e.c=N,n.c=N,{c:N.concat([{b:/\.$/}])}});hljs.registerLanguage("rust",function(e){var t="([uif](8|16|32|64|size))?",r=e.inherit(e.CBCM);r.c.push("self");var i="alignof as be box break const continue crate do else enum extern false fn for if impl in let loop match mod mut offsetof once priv proc pub pure ref return self Self sizeof static struct super trait true type typeof unsafe unsized use virtual while where yield move default int i8 i16 i32 i64 isize uint u8 u32 u64 usize float f32 f64 str char bool",n="Copy Send Sized Sync Drop Fn FnMut FnOnce drop Box ToOwned Clone PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator Option Result SliceConcatExt String ToString Vec assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules!";return{aliases:["rs"],k:{keyword:i,literal:"true false Some None Ok Err",built_in:n},l:e.IR+"!?",i:""}]}});hljs.registerLanguage("gradle",function(e){return{cI:!0,k:{keyword:"task project allprojects subprojects artifacts buildscript configurations dependencies repositories sourceSets description delete from into include exclude source classpath destinationDir includes options sourceCompatibility targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant def abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true antlrtask checkstyle codenarc copy boolean byte char class double float int interface long short void compile runTime file fileTree abs any append asList asWritable call collect compareTo count div dump each eachByte eachFile eachLine every find findAll flatten getAt getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter newReader newWriter next plus pop power previous print println push putAt read readBytes readLines reverse reverseEach round size sort splitEachLine step subMap times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader withStream withWriter withWriterAppend write writeLine"},c:[e.CLCM,e.CBCM,e.ASM,e.QSM,e.NM,e.RM]}});hljs.registerLanguage("golo",function(e){return{k:{keyword:"println readln print import module function local return let var while for foreach times in case when match with break continue augment augmentation each find filter reduce if then else otherwise try catch finally raise throw orIfNull DynamicObject|10 DynamicVariable struct Observable map set vector list array",literal:"true false null"},c:[e.HCM,e.QSM,e.CNM,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("vala",function(t){return{k:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object Gtk Posix",literal:"false true null"},c:[{cN:"class",bK:"class interface namespace",e:"{",eE:!0,i:"[^,:\\n\\s\\.]",c:[t.UTM]},t.CLCM,t.CBCM,{cN:"string",b:'"""',e:'"""',r:5},t.ASM,t.QSM,t.CNM,{cN:"meta",b:"^#",e:"$",r:2}]}});hljs.registerLanguage("capnproto",function(t){return{aliases:["capnp"],k:{keyword:"struct enum interface union group import using const annotation extends in of on as with from fixed",built_in:"Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Text Data AnyPointer AnyStruct Capability List",literal:"true false"},c:[t.QSM,t.NM,t.HCM,{cN:"meta",b:/@0x[\w\d]{16};/,i:/\n/},{cN:"symbol",b:/@\d+\b/},{cN:"class",bK:"struct enum",e:/\{/,i:/\n/,c:[t.inherit(t.TM,{starts:{eW:!0,eE:!0}})]},{cN:"class",bK:"interface",e:/\{/,i:/\n/,c:[t.inherit(t.TM,{starts:{eW:!0,eE:!0}})]}]}});hljs.registerLanguage("parser3",function(r){var e=r.C("{","}",{c:["self"]});return{sL:"xml",r:0,c:[r.C("^#","$"),r.C("\\^rem{","}",{r:10,c:[e]}),{cN:"meta",b:"^@(?:BASE|USE|CLASS|OPTIONS)$",r:10},{cN:"title",b:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{cN:"variable",b:"\\$\\{?[\\w\\-\\.\\:]+\\}?"},{cN:"keyword",b:"\\^[\\w\\-\\.\\:]+"},{cN:"number",b:"\\^#[0-9a-fA-F]+"},r.CNM]}});hljs.registerLanguage("1c",function(c){var e="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*",n="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт",b="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон",i={b:'""'},r={cN:"string",b:'"',e:'"|$',c:[i]},t={cN:"string",b:"\\|",e:'"|$',c:[i]};return{cI:!0,l:e,k:{keyword:n,built_in:b},c:[c.CLCM,c.NM,r,t,{cN:"function",b:"(процедура|функция)",e:"$",l:e,k:"процедура функция",c:[{b:"экспорт",eW:!0,l:e,k:"экспорт",c:[c.CLCM]},{cN:"params",b:"\\(",e:"\\)",l:e,k:"знач",c:[r,t]},c.CLCM,c.inherit(c.TM,{b:e})]},{cN:"meta",b:"#",e:"$"},{cN:"number",b:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}});hljs.registerLanguage("gauss",function(e){var t={keyword:"and bool break call callexe checkinterrupt clear clearg closeall cls comlog compile continue create debug declare delete disable dlibrary dllcall do dos ed edit else elseif enable end endfor endif endp endo errorlog errorlogat expr external fn for format goto gosub graph if keyword let lib library line load loadarray loadexe loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow matrix msym ndpclex new not open or output outwidth plot plotsym pop prcsn print printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen scroll setarray show sparse stop string struct system trace trap threadfor threadendfor threadbegin threadjoin threadstat threadend until use while winprint",built_in:"abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 indicesf indicesfn indnv indsav indx integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname threadBegin threadEnd threadEndFor threadFor threadJoin threadStat time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics",literal:"DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES DB_TRANSACTIONS DB_UNICODE DB_VIEWS"},a={cN:"meta",b:"#",e:"$",k:{"meta-keyword":"define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline"},c:[{b:/\\\n/,r:0},{bK:"include",e:"$",k:{"meta-keyword":"include"},c:[{cN:"meta-string",b:'"',e:'"',i:"\\n"}]},e.CLCM,e.CBCM]},r=e.UIR+"\\s*\\(?",o=[{cN:"params",b:/\(/,e:/\)/,k:t,r:0,c:[e.CNM,e.CLCM,e.CBCM]}];return{aliases:["gss"],cI:!0,k:t,i:"(\\{[%#]|[%#]\\})",c:[e.CNM,e.CLCM,e.CBCM,e.C("@","@"),a,{cN:"string",b:'"',e:'"',c:[e.BE]},{cN:"function",bK:"proc keyword",e:";",eE:!0,k:t,c:[{b:r,rB:!0,c:[e.UTM],r:0},e.CNM,e.CLCM,e.CBCM,a].concat(o)},{cN:"function",bK:"fn",e:";",eE:!0,k:t,c:[{b:r+e.IR+"\\)?\\s*\\=\\s*",rB:!0,c:[e.UTM],r:0},e.CNM,e.CLCM,e.CBCM].concat(o)},{cN:"function",b:"\\bexternal (proc|keyword|fn)\\s+",e:";",eE:!0,k:t,c:[{b:r,rB:!0,c:[e.UTM],r:0},e.CLCM,e.CBCM]},{cN:"function",b:"\\bexternal (matrix|string|array|sparse matrix|struct "+e.IR+")\\s+",e:";",eE:!0,k:t,c:[e.CLCM,e.CBCM]}]}});hljs.registerLanguage("haskell",function(e){var i={v:[e.C("--","$"),e.C("{-","-}",{c:["self"]})]},a={cN:"meta",b:"{-#",e:"#-}"},l={cN:"meta",b:"^#",e:"$"},c={cN:"type",b:"\\b[A-Z][\\w']*",r:0},n={b:"\\(",e:"\\)",i:'"',c:[a,l,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e.inherit(e.TM,{b:"[_a-z][\\w']*"}),i]},s={b:"{",e:"}",c:n.c};return{aliases:["hs"],k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{bK:"module",e:"where",k:"module where",c:[n,i],i:"\\W\\.|;"},{b:"\\bimport\\b",e:"$",k:"import qualified as hiding",c:[n,i],i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[c,n,i]},{cN:"class",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",c:[a,c,n,s,i]},{bK:"default",e:"$",c:[c,n,i]},{bK:"infix infixl infixr",e:"$",c:[e.CNM,i]},{b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[c,e.QSM,i]},{cN:"meta",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},a,l,e.QSM,e.CNM,c,e.inherit(e.TM,{b:"^[_a-z][\\w']*"}),i,{b:"->|<-"}]}});hljs.registerLanguage("clojure",function(e){var t={"builtin-name":"def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"},r="a-zA-Z_\\-!.?+*=<>&#'",n="["+r+"]["+r+"0-9/;:]*",a="[-+]?\\d+(\\.\\d+)?",o={b:n,r:0},s={cN:"number",b:a,r:0},i=e.inherit(e.QSM,{i:null}),c=e.C(";","$",{r:0}),d={cN:"literal",b:/\b(true|false|nil)\b/},l={b:"[\\[\\{]",e:"[\\]\\}]"},m={cN:"comment",b:"\\^"+n},p=e.C("\\^\\{","\\}"),u={cN:"symbol",b:"[:]{1,2}"+n},f={b:"\\(",e:"\\)"},h={eW:!0,r:0},y={k:t,l:n,cN:"name",b:n,starts:h},b=[f,i,m,p,c,u,l,s,d,o];return f.c=[e.C("comment",""),y,h],h.c=b,l.c=b,{aliases:["clj"],i:/\S/,c:[f,i,m,p,c,u,l,s,d]}});hljs.registerLanguage("clojure-repl",function(e){return{c:[{cN:"meta",b:/^([\w.-]+|\s*#_)=>/,starts:{e:/$/,sL:"clojure"}}]}});hljs.registerLanguage("python",function(e){var r={cN:"meta",b:/^(>>>|\.\.\.) /},b={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},a={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},l={cN:"params",b:/\(/,e:/\)/,c:["self",r,a,b]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[r,a,b,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,l,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("lasso",function(e){var r="[a-zA-Z_][\\w.]*",a="<\\?(lasso(script)?|=)",t="\\]|\\?>",n={literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},i=e.C("",{r:0}),s={cN:"meta",b:"\\[noprocess\\]",starts:{e:"\\[/noprocess\\]",rE:!0,c:[i]}},l={cN:"meta",b:"\\[/noprocess|"+a},o={cN:"symbol",b:"'"+r+"'"},c=[e.CLCM,e.CBCM,e.inherit(e.CNM,{b:e.CNR+"|(-?infinity|NaN)\\b"}),e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null}),{cN:"string",b:"`",e:"`"},{v:[{b:"[#$]"+r},{b:"#",e:"\\d+",i:"\\W"}]},{cN:"type",b:"::\\s*",e:r,i:"\\W"},{cN:"params",v:[{b:"-(?!infinity)"+r,r:0},{b:"(\\.\\.\\.)"}]},{b:/(->|\.)\s*/,r:0,c:[o]},{cN:"class",bK:"define",rE:!0,e:"\\(|=>",c:[e.inherit(e.TM,{b:r+"(=(?!>))?|[-+*/%](?!>)"})]}];return{aliases:["ls","lassoscript"],cI:!0,l:r+"|&[lg]t;",k:n,c:[{cN:"meta",b:t,r:0,starts:{e:"\\[|"+a,rE:!0,r:0,c:[i]}},s,l,{cN:"meta",b:"\\[no_square_brackets",starts:{e:"\\[/no_square_brackets\\]",l:r+"|&[lg]t;",k:n,c:[{cN:"meta",b:t,r:0,starts:{e:"\\[noprocess\\]|"+a,rE:!0,c:[i]}},s,l].concat(c)}},{cN:"meta",b:"\\[",r:0},{cN:"meta",b:"^#!",e:"lasso9$",r:10}].concat(c)}});hljs.registerLanguage("django",function(e){var t={b:/\|[A-Za-z]+:?/,k:{name:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone"},c:[e.QSM,e.ASM]};return{aliases:["jinja"],cI:!0,sL:"xml",c:[e.C(/\{%\s*comment\s*%}/,/\{%\s*endcomment\s*%}/),e.C(/\{#/,/#}/),{cN:"template-tag",b:/\{%/,e:/%}/,c:[{cN:"name",b:/\w+/,k:{name:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim"},starts:{eW:!0,k:"in by as",c:[t],r:0}}]},{cN:"template-variable",b:/\{\{/,e:/}}/,c:[t]}]}});hljs.registerLanguage("sqf",function(e){var t=e.getLanguage("cpp").exports,a={cN:"string",v:[{b:'"',e:'"',c:[{b:'""',r:0}]},{b:"'",e:"'",c:[{b:"''",r:0}]}]};return{aliases:["sqf"],cI:!0,k:{keyword:"case catch default do else exit exitWith for forEach from if switch then throw to try while with",built_in:"or plus abs accTime acos action actionKeys actionKeysImages actionKeysNames actionKeysNamesArray actionName activateAddons activatedAddons activateKey addAction addBackpack addBackpackCargo addBackpackCargoGlobal addBackpackGlobal addCamShake addCuratorAddons addCuratorCameraArea addCuratorEditableObjects addCuratorEditingArea addCuratorPoints addEditorObject addEventHandler addGoggles addGroupIcon addHandgunItem addHeadgear addItem addItemCargo addItemCargoGlobal addItemPool addItemToBackpack addItemToUniform addItemToVest addLiveStats addMagazine addMagazine array addMagazineAmmoCargo addMagazineCargo addMagazineCargoGlobal addMagazineGlobal addMagazinePool addMagazines addMagazineTurret addMenu addMenuItem addMissionEventHandler addMPEventHandler addMusicEventHandler addPrimaryWeaponItem addPublicVariableEventHandler addRating addResources addScore addScoreSide addSecondaryWeaponItem addSwitchableUnit addTeamMember addToRemainsCollector addUniform addVehicle addVest addWaypoint addWeapon addWeaponCargo addWeaponCargoGlobal addWeaponGlobal addWeaponPool addWeaponTurret agent agents AGLToASL aimedAtTarget aimPos airDensityRTD airportSide AISFinishHeal alive allControls allCurators allDead allDeadMen allDisplays allGroups allMapMarkers allMines allMissionObjects allow3DMode allowCrewInImmobile allowCuratorLogicIgnoreAreas allowDamage allowDammage allowFileOperations allowFleeing allowGetIn allPlayers allSites allTurrets allUnits allUnitsUAV allVariables ammo and animate animateDoor animationPhase animationState append armoryPoints arrayIntersect asin ASLToAGL ASLToATL assert assignAsCargo assignAsCargoIndex assignAsCommander assignAsDriver assignAsGunner assignAsTurret assignCurator assignedCargo assignedCommander assignedDriver assignedGunner assignedItems assignedTarget assignedTeam assignedVehicle assignedVehicleRole assignItem assignTeam assignToAirport atan atan2 atg ATLToASL attachedObject attachedObjects attachedTo attachObject attachTo attackEnabled backpack backpackCargo backpackContainer backpackItems backpackMagazines backpackSpaceFor behaviour benchmark binocular blufor boundingBox boundingBoxReal boundingCenter breakOut breakTo briefingName buildingExit buildingPos buttonAction buttonSetAction cadetMode call callExtension camCommand camCommit camCommitPrepared camCommitted camConstuctionSetParams camCreate camDestroy cameraEffect cameraEffectEnableHUD cameraInterest cameraOn cameraView campaignConfigFile camPreload camPreloaded camPrepareBank camPrepareDir camPrepareDive camPrepareFocus camPrepareFov camPrepareFovRange camPreparePos camPrepareRelPos camPrepareTarget camSetBank camSetDir camSetDive camSetFocus camSetFov camSetFovRange camSetPos camSetRelPos camSetTarget camTarget camUseNVG canAdd canAddItemToBackpack canAddItemToUniform canAddItemToVest cancelSimpleTaskDestination canFire canMove canSlingLoad canStand canUnloadInCombat captive captiveNum cbChecked cbSetChecked ceil cheatsEnabled checkAIFeature civilian className clearAllItemsFromBackpack clearBackpackCargo clearBackpackCargoGlobal clearGroupIcons clearItemCargo clearItemCargoGlobal clearItemPool clearMagazineCargo clearMagazineCargoGlobal clearMagazinePool clearOverlay clearRadio clearWeaponCargo clearWeaponCargoGlobal clearWeaponPool closeDialog closeDisplay closeOverlay collapseObjectTree combatMode commandArtilleryFire commandChat commander commandFire commandFollow commandFSM commandGetOut commandingMenu commandMove commandRadio commandStop commandTarget commandWatch comment commitOverlay compile compileFinal completedFSM composeText configClasses configFile configHierarchy configName configProperties configSourceMod configSourceModList connectTerminalToUAV controlNull controlsGroupCtrl copyFromClipboard copyToClipboard copyWaypoints cos count countEnemy countFriendly countSide countType countUnknown createAgent createCenter createDialog createDiaryLink createDiaryRecord createDiarySubject createDisplay createGearDialog createGroup createGuardedPoint createLocation createMarker createMarkerLocal createMenu createMine createMissionDisplay createSimpleTask createSite createSoundSource createTask createTeam createTrigger createUnit createUnit array createVehicle createVehicle array createVehicleCrew createVehicleLocal crew ctrlActivate ctrlAddEventHandler ctrlAutoScrollDelay ctrlAutoScrollRewind ctrlAutoScrollSpeed ctrlChecked ctrlClassName ctrlCommit ctrlCommitted ctrlCreate ctrlDelete ctrlEnable ctrlEnabled ctrlFade ctrlHTMLLoaded ctrlIDC ctrlIDD ctrlMapAnimAdd ctrlMapAnimClear ctrlMapAnimCommit ctrlMapAnimDone ctrlMapCursor ctrlMapMouseOver ctrlMapScale ctrlMapScreenToWorld ctrlMapWorldToScreen ctrlModel ctrlModelDirAndUp ctrlModelScale ctrlParent ctrlPosition ctrlRemoveAllEventHandlers ctrlRemoveEventHandler ctrlScale ctrlSetActiveColor ctrlSetAutoScrollDelay ctrlSetAutoScrollRewind ctrlSetAutoScrollSpeed ctrlSetBackgroundColor ctrlSetChecked ctrlSetEventHandler ctrlSetFade ctrlSetFocus ctrlSetFont ctrlSetFontH1 ctrlSetFontH1B ctrlSetFontH2 ctrlSetFontH2B ctrlSetFontH3 ctrlSetFontH3B ctrlSetFontH4 ctrlSetFontH4B ctrlSetFontH5 ctrlSetFontH5B ctrlSetFontH6 ctrlSetFontH6B ctrlSetFontHeight ctrlSetFontHeightH1 ctrlSetFontHeightH2 ctrlSetFontHeightH3 ctrlSetFontHeightH4 ctrlSetFontHeightH5 ctrlSetFontHeightH6 ctrlSetFontP ctrlSetFontPB ctrlSetForegroundColor ctrlSetModel ctrlSetModelDirAndUp ctrlSetModelScale ctrlSetPosition ctrlSetScale ctrlSetStructuredText ctrlSetText ctrlSetTextColor ctrlSetTooltip ctrlSetTooltipColorBox ctrlSetTooltipColorShade ctrlSetTooltipColorText ctrlShow ctrlShown ctrlText ctrlTextHeight ctrlType ctrlVisible curatorAddons curatorCamera curatorCameraArea curatorCameraAreaCeiling curatorCoef curatorEditableObjects curatorEditingArea curatorEditingAreaType curatorMouseOver curatorPoints curatorRegisteredObjects curatorSelected curatorWaypointCost currentChannel currentCommand currentMagazine currentMagazineDetail currentMagazineDetailTurret currentMagazineTurret currentMuzzle currentNamespace currentTask currentTasks currentThrowable currentVisionMode currentWaypoint currentWeapon currentWeaponMode currentWeaponTurret currentZeroing cursorTarget customChat customRadio cutFadeOut cutObj cutRsc cutText damage date dateToNumber daytime deActivateKey debriefingText debugFSM debugLog deg deleteAt deleteCenter deleteCollection deleteEditorObject deleteGroup deleteIdentity deleteLocation deleteMarker deleteMarkerLocal deleteRange deleteResources deleteSite deleteStatus deleteTeam deleteVehicle deleteVehicleCrew deleteWaypoint detach detectedMines diag activeMissionFSMs diag activeSQFScripts diag activeSQSScripts diag captureFrame diag captureSlowFrame diag fps diag fpsMin diag frameNo diag log diag logSlowFrame diag tickTime dialog diarySubjectExists didJIP didJIPOwner difficulty difficultyEnabled difficultyEnabledRTD direction directSay disableAI disableCollisionWith disableConversation disableDebriefingStats disableSerialization disableTIEquipment disableUAVConnectability disableUserInput displayAddEventHandler displayCtrl displayNull displayRemoveAllEventHandlers displayRemoveEventHandler displaySetEventHandler dissolveTeam distance distance2D distanceSqr distributionRegion doArtilleryFire doFire doFollow doFSM doGetOut doMove doorPhase doStop doTarget doWatch drawArrow drawEllipse drawIcon drawIcon3D drawLine drawLine3D drawLink drawLocation drawRectangle driver drop east echo editObject editorSetEventHandler effectiveCommander emptyPositions enableAI enableAIFeature enableAttack enableCamShake enableCaustics enableCollisionWith enableCopilot enableDebriefingStats enableDiagLegend enableEndDialog enableEngineArtillery enableEnvironment enableFatigue enableGunLights enableIRLasers enableMimics enablePersonTurret enableRadio enableReload enableRopeAttach enableSatNormalOnDetail enableSaving enableSentences enableSimulation enableSimulationGlobal enableTeamSwitch enableUAVConnectability enableUAVWaypoints endLoadingScreen endMission engineOn enginesIsOnRTD enginesRpmRTD enginesTorqueRTD entities estimatedEndServerTime estimatedTimeLeft evalObjectArgument everyBackpack everyContainer exec execEditorScript execFSM execVM exp expectedDestination eyeDirection eyePos face faction fadeMusic fadeRadio fadeSound fadeSpeech failMission fillWeaponsFromPool find findCover findDisplay findEditorObject findEmptyPosition findEmptyPositionReady findNearestEnemy finishMissionInit finite fire fireAtTarget firstBackpack flag flagOwner fleeing floor flyInHeight fog fogForecast fogParams forceAddUniform forceEnd forceMap forceRespawn forceSpeed forceWalk forceWeaponFire forceWeatherChange forEachMember forEachMemberAgent forEachMemberTeam format formation formationDirection formationLeader formationMembers formationPosition formationTask formatText formLeader freeLook fromEditor fuel fullCrew gearSlotAmmoCount gearSlotData getAllHitPointsDamage getAmmoCargo getArray getArtilleryAmmo getArtilleryComputerSettings getArtilleryETA getAssignedCuratorLogic getAssignedCuratorUnit getBackpackCargo getBleedingRemaining getBurningValue getCargoIndex getCenterOfMass getClientState getConnectedUAV getDammage getDescription getDir getDirVisual getDLCs getEditorCamera getEditorMode getEditorObjectScope getElevationOffset getFatigue getFriend getFSMVariable getFuelCargo getGroupIcon getGroupIconParams getGroupIcons getHideFrom getHit getHitIndex getHitPointDamage getItemCargo getMagazineCargo getMarkerColor getMarkerPos getMarkerSize getMarkerType getMass getModelInfo getNumber getObjectArgument getObjectChildren getObjectDLC getObjectMaterials getObjectProxy getObjectTextures getObjectType getObjectViewDistance getOxygenRemaining getPersonUsedDLCs getPlayerChannel getPlayerUID getPos getPosASL getPosASLVisual getPosASLW getPosATL getPosATLVisual getPosVisual getPosWorld getRepairCargo getResolution getShadowDistance getSlingLoad getSpeed getSuppression getTerrainHeightASL getText getVariable getWeaponCargo getWPPos glanceAt globalChat globalRadio goggles goto group groupChat groupFromNetId groupIconSelectable groupIconsVisible groupId groupOwner groupRadio groupSelectedUnits groupSelectUnit grpNull gunner gusts halt handgunItems handgunMagazine handgunWeapon handsHit hasInterface hasWeapon hcAllGroups hcGroupParams hcLeader hcRemoveAllGroups hcRemoveGroup hcSelected hcSelectGroup hcSetGroup hcShowBar hcShownBar headgear hideBody hideObject hideObjectGlobal hint hintC hintCadet hintSilent hmd hostMission htmlLoad HUDMovementLevels humidity image importAllGroups importance in incapacitatedState independent inflame inflamed inGameUISetEventHandler inheritsFrom initAmbientLife inputAction inRangeOfArtillery insertEditorObject intersect isAbleToBreathe isAgent isArray isAutoHoverOn isAutonomous isAutotest isBleeding isBurning isClass isCollisionLightOn isCopilotEnabled isDedicated isDLCAvailable isEngineOn isEqualTo isFlashlightOn isFlatEmpty isForcedWalk isFormationLeader isHidden isInRemainsCollector isInstructorFigureEnabled isIRLaserOn isKeyActive isKindOf isLightOn isLocalized isManualFire isMarkedForCollection isMultiplayer isNil isNull isNumber isObjectHidden isObjectRTD isOnRoad isPipEnabled isPlayer isRealTime isServer isShowing3DIcons isSteamMission isStreamFriendlyUIEnabled isText isTouchingGround isTurnedOut isTutHintsEnabled isUAVConnectable isUAVConnected isUniformAllowed isWalking isWeaponDeployed isWeaponRested itemCargo items itemsWithMagazines join joinAs joinAsSilent joinSilent joinString kbAddDatabase kbAddDatabaseTargets kbAddTopic kbHasTopic kbReact kbRemoveTopic kbTell kbWasSaid keyImage keyName knowsAbout land landAt landResult language laserTarget lbAdd lbClear lbColor lbCurSel lbData lbDelete lbIsSelected lbPicture lbSelection lbSetColor lbSetCurSel lbSetData lbSetPicture lbSetPictureColor lbSetPictureColorDisabled lbSetPictureColorSelected lbSetSelectColor lbSetSelectColorRight lbSetSelected lbSetTooltip lbSetValue lbSize lbSort lbSortByValue lbText lbValue leader leaderboardDeInit leaderboardGetRows leaderboardInit leaveVehicle libraryCredits libraryDisclaimers lifeState lightAttachObject lightDetachObject lightIsOn lightnings limitSpeed linearConversion lineBreak lineIntersects lineIntersectsObjs lineIntersectsSurfaces lineIntersectsWith linkItem list listObjects ln lnbAddArray lnbAddColumn lnbAddRow lnbClear lnbColor lnbCurSelRow lnbData lnbDeleteColumn lnbDeleteRow lnbGetColumnsPosition lnbPicture lnbSetColor lnbSetColumnsPos lnbSetCurSelRow lnbSetData lnbSetPicture lnbSetText lnbSetValue lnbSize lnbText lnbValue load loadAbs loadBackpack loadFile loadGame loadIdentity loadMagazine loadOverlay loadStatus loadUniform loadVest local localize locationNull locationPosition lock lockCameraTo lockCargo lockDriver locked lockedCargo lockedDriver lockedTurret lockTurret lockWP log logEntities lookAt lookAtPos magazineCargo magazines magazinesAllTurrets magazinesAmmo magazinesAmmoCargo magazinesAmmoFull magazinesDetail magazinesDetailBackpack magazinesDetailUniform magazinesDetailVest magazinesTurret magazineTurretAmmo mapAnimAdd mapAnimClear mapAnimCommit mapAnimDone mapCenterOnCamera mapGridPosition markAsFinishedOnSteam markerAlpha markerBrush markerColor markerDir markerPos markerShape markerSize markerText markerType max members min mineActive mineDetectedBy missionConfigFile missionName missionNamespace missionStart mod modelToWorld modelToWorldVisual moonIntensity morale move moveInAny moveInCargo moveInCommander moveInDriver moveInGunner moveInTurret moveObjectToEnd moveOut moveTime moveTo moveToCompleted moveToFailed musicVolume name name location nameSound nearEntities nearestBuilding nearestLocation nearestLocations nearestLocationWithDubbing nearestObject nearestObjects nearObjects nearObjectsReady nearRoads nearSupplies nearTargets needReload netId netObjNull newOverlay nextMenuItemIndex nextWeatherChange nMenuItems not numberToDate objectCurators objectFromNetId objectParent objNull objStatus onBriefingGroup onBriefingNotes onBriefingPlan onBriefingTeamSwitch onCommandModeChanged onDoubleClick onEachFrame onGroupIconClick onGroupIconOverEnter onGroupIconOverLeave onHCGroupSelectionChanged onMapSingleClick onPlayerConnected onPlayerDisconnected onPreloadFinished onPreloadStarted onShowNewObject onTeamSwitch openCuratorInterface openMap openYoutubeVideo opfor or orderGetIn overcast overcastForecast owner param params parseNumber parseText parsingNamespace particlesQuality pi pickWeaponPool pitch playableSlotsNumber playableUnits playAction playActionNow player playerRespawnTime playerSide playersNumber playGesture playMission playMove playMoveNow playMusic playScriptedMission playSound playSound3D position positionCameraToWorld posScreenToWorld posWorldToScreen ppEffectAdjust ppEffectCommit ppEffectCommitted ppEffectCreate ppEffectDestroy ppEffectEnable ppEffectForceInNVG precision preloadCamera preloadObject preloadSound preloadTitleObj preloadTitleRsc preprocessFile preprocessFileLineNumbers primaryWeapon primaryWeaponItems primaryWeaponMagazine priority private processDiaryLink productVersion profileName profileNamespace profileNameSteam progressLoadingScreen progressPosition progressSetPosition publicVariable publicVariableClient publicVariableServer pushBack putWeaponPool queryItemsPool queryMagazinePool queryWeaponPool rad radioChannelAdd radioChannelCreate radioChannelRemove radioChannelSetCallSign radioChannelSetLabel radioVolume rain rainbow random rank rankId rating rectangular registeredTasks registerTask reload reloadEnabled remoteControl remoteExec remoteExecCall removeAction removeAllActions removeAllAssignedItems removeAllContainers removeAllCuratorAddons removeAllCuratorCameraAreas removeAllCuratorEditingAreas removeAllEventHandlers removeAllHandgunItems removeAllItems removeAllItemsWithMagazines removeAllMissionEventHandlers removeAllMPEventHandlers removeAllMusicEventHandlers removeAllPrimaryWeaponItems removeAllWeapons removeBackpack removeBackpackGlobal removeCuratorAddons removeCuratorCameraArea removeCuratorEditableObjects removeCuratorEditingArea removeDrawIcon removeDrawLinks removeEventHandler removeFromRemainsCollector removeGoggles removeGroupIcon removeHandgunItem removeHeadgear removeItem removeItemFromBackpack removeItemFromUniform removeItemFromVest removeItems removeMagazine removeMagazineGlobal removeMagazines removeMagazinesTurret removeMagazineTurret removeMenuItem removeMissionEventHandler removeMPEventHandler removeMusicEventHandler removePrimaryWeaponItem removeSecondaryWeaponItem removeSimpleTask removeSwitchableUnit removeTeamMember removeUniform removeVest removeWeapon removeWeaponGlobal removeWeaponTurret requiredVersion resetCamShake resetSubgroupDirection resistance resize resources respawnVehicle restartEditorCamera reveal revealMine reverse reversedMouseY roadsConnectedTo roleDescription ropeAttachedObjects ropeAttachedTo ropeAttachEnabled ropeAttachTo ropeCreate ropeCut ropeEndPosition ropeLength ropes ropeUnwind ropeUnwound rotorsForcesRTD rotorsRpmRTD round runInitScript safeZoneH safeZoneW safeZoneWAbs safeZoneX safeZoneXAbs safeZoneY saveGame saveIdentity saveJoysticks saveOverlay saveProfileNamespace saveStatus saveVar savingEnabled say say2D say3D scopeName score scoreSide screenToWorld scriptDone scriptName scriptNull scudState secondaryWeapon secondaryWeaponItems secondaryWeaponMagazine select selectBestPlaces selectDiarySubject selectedEditorObjects selectEditorObject selectionPosition selectLeader selectNoPlayer selectPlayer selectWeapon selectWeaponTurret sendAUMessage sendSimpleCommand sendTask sendTaskResult sendUDPMessage serverCommand serverCommandAvailable serverCommandExecutable serverName serverTime set setAccTime setAirportSide setAmmo setAmmoCargo setAperture setApertureNew setArmoryPoints setAttributes setAutonomous setBehaviour setBleedingRemaining setCameraInterest setCamShakeDefParams setCamShakeParams setCamUseTi setCaptive setCenterOfMass setCollisionLight setCombatMode setCompassOscillation setCuratorCameraAreaCeiling setCuratorCoef setCuratorEditingAreaType setCuratorWaypointCost setCurrentChannel setCurrentTask setCurrentWaypoint setDamage setDammage setDate setDebriefingText setDefaultCamera setDestination setDetailMapBlendPars setDir setDirection setDrawIcon setDropInterval setEditorMode setEditorObjectScope setEffectCondition setFace setFaceAnimation setFatigue setFlagOwner setFlagSide setFlagTexture setFog setFog array setFormation setFormationTask setFormDir setFriend setFromEditor setFSMVariable setFuel setFuelCargo setGroupIcon setGroupIconParams setGroupIconsSelectable setGroupIconsVisible setGroupId setGroupIdGlobal setGroupOwner setGusts setHideBehind setHit setHitIndex setHitPointDamage setHorizonParallaxCoef setHUDMovementLevels setIdentity setImportance setLeader setLightAmbient setLightAttenuation setLightBrightness setLightColor setLightDayLight setLightFlareMaxDistance setLightFlareSize setLightIntensity setLightnings setLightUseFlare setLocalWindParams setMagazineTurretAmmo setMarkerAlpha setMarkerAlphaLocal setMarkerBrush setMarkerBrushLocal setMarkerColor setMarkerColorLocal setMarkerDir setMarkerDirLocal setMarkerPos setMarkerPosLocal setMarkerShape setMarkerShapeLocal setMarkerSize setMarkerSizeLocal setMarkerText setMarkerTextLocal setMarkerType setMarkerTypeLocal setMass setMimic setMousePosition setMusicEffect setMusicEventHandler setName setNameSound setObjectArguments setObjectMaterial setObjectProxy setObjectTexture setObjectTextureGlobal setObjectViewDistance setOvercast setOwner setOxygenRemaining setParticleCircle setParticleClass setParticleFire setParticleParams setParticleRandom setPilotLight setPiPEffect setPitch setPlayable setPlayerRespawnTime setPos setPosASL setPosASL2 setPosASLW setPosATL setPosition setPosWorld setRadioMsg setRain setRainbow setRandomLip setRank setRectangular setRepairCargo setShadowDistance setSide setSimpleTaskDescription setSimpleTaskDestination setSimpleTaskTarget setSimulWeatherLayers setSize setSkill setSkill array setSlingLoad setSoundEffect setSpeaker setSpeech setSpeedMode setStatValue setSuppression setSystemOfUnits setTargetAge setTaskResult setTaskState setTerrainGrid setText setTimeMultiplier setTitleEffect setTriggerActivation setTriggerArea setTriggerStatements setTriggerText setTriggerTimeout setTriggerType setType setUnconscious setUnitAbility setUnitPos setUnitPosWeak setUnitRank setUnitRecoilCoefficient setUnloadInCombat setUserActionText setVariable setVectorDir setVectorDirAndUp setVectorUp setVehicleAmmo setVehicleAmmoDef setVehicleArmor setVehicleId setVehicleLock setVehiclePosition setVehicleTiPars setVehicleVarName setVelocity setVelocityTransformation setViewDistance setVisibleIfTreeCollapsed setWaves setWaypointBehaviour setWaypointCombatMode setWaypointCompletionRadius setWaypointDescription setWaypointFormation setWaypointHousePosition setWaypointLoiterRadius setWaypointLoiterType setWaypointName setWaypointPosition setWaypointScript setWaypointSpeed setWaypointStatements setWaypointTimeout setWaypointType setWaypointVisible setWeaponReloadingTime setWind setWindDir setWindForce setWindStr setWPPos show3DIcons showChat showCinemaBorder showCommandingMenu showCompass showCuratorCompass showGPS showHUD showLegend showMap shownArtilleryComputer shownChat shownCompass shownCuratorCompass showNewEditorObject shownGPS shownHUD shownMap shownPad shownRadio shownUAVFeed shownWarrant shownWatch showPad showRadio showSubtitles showUAVFeed showWarrant showWatch showWaypoint side sideChat sideEnemy sideFriendly sideLogic sideRadio sideUnknown simpleTasks simulationEnabled simulCloudDensity simulCloudOcclusion simulInClouds simulWeatherSync sin size sizeOf skill skillFinal skipTime sleep sliderPosition sliderRange sliderSetPosition sliderSetRange sliderSetSpeed sliderSpeed slingLoadAssistantShown soldierMagazines someAmmo sort soundVolume spawn speaker speed speedMode splitString sqrt squadParams stance startLoadingScreen step stop stopped str sunOrMoon supportInfo suppressFor surfaceIsWater surfaceNormal surfaceType swimInDepth switchableUnits switchAction switchCamera switchGesture switchLight switchMove synchronizedObjects synchronizedTriggers synchronizedWaypoints synchronizeObjectsAdd synchronizeObjectsRemove synchronizeTrigger synchronizeWaypoint synchronizeWaypoint trigger systemChat systemOfUnits tan targetKnowledge targetsAggregate targetsQuery taskChildren taskCompleted taskDescription taskDestination taskHint taskNull taskParent taskResult taskState teamMember teamMemberNull teamName teams teamSwitch teamSwitchEnabled teamType terminate terrainIntersect terrainIntersectASL text text location textLog textLogFormat tg time timeMultiplier titleCut titleFadeOut titleObj titleRsc titleText toArray toLower toString toUpper triggerActivated triggerActivation triggerArea triggerAttachedVehicle triggerAttachObject triggerAttachVehicle triggerStatements triggerText triggerTimeout triggerTimeoutCurrent triggerType turretLocal turretOwner turretUnit tvAdd tvClear tvCollapse tvCount tvCurSel tvData tvDelete tvExpand tvPicture tvSetCurSel tvSetData tvSetPicture tvSetPictureColor tvSetTooltip tvSetValue tvSort tvSortByValue tvText tvValue type typeName typeOf UAVControl uiNamespace uiSleep unassignCurator unassignItem unassignTeam unassignVehicle underwater uniform uniformContainer uniformItems uniformMagazines unitAddons unitBackpack unitPos unitReady unitRecoilCoefficient units unitsBelowHeight unlinkItem unlockAchievement unregisterTask updateDrawIcon updateMenuItem updateObjectTree useAudioTimeForMoves vectorAdd vectorCos vectorCrossProduct vectorDiff vectorDir vectorDirVisual vectorDistance vectorDistanceSqr vectorDotProduct vectorFromTo vectorMagnitude vectorMagnitudeSqr vectorMultiply vectorNormalized vectorUp vectorUpVisual vehicle vehicleChat vehicleRadio vehicles vehicleVarName velocity velocityModelSpace verifySignature vest vestContainer vestItems vestMagazines viewDistance visibleCompass visibleGPS visibleMap visiblePosition visiblePositionASL visibleWatch waitUntil waves waypointAttachedObject waypointAttachedVehicle waypointAttachObject waypointAttachVehicle waypointBehaviour waypointCombatMode waypointCompletionRadius waypointDescription waypointFormation waypointHousePosition waypointLoiterRadius waypointLoiterType waypointName waypointPosition waypoints waypointScript waypointsEnabledUAV waypointShow waypointSpeed waypointStatements waypointTimeout waypointTimeoutCurrent waypointType waypointVisible weaponAccessories weaponCargo weaponDirection weaponLowered weapons weaponsItems weaponsItemsCargo weaponState weaponsTurret weightRTD west WFSideText wind windDir windStr wingsForcesRTD worldName worldSize worldToModel worldToModelVisual worldToScreen _forEachIndex _this _x",literal:"true false nil"},c:[e.CLCM,e.CBCM,e.NM,a,t.preprocessor],i:/#/}});hljs.registerLanguage("vim",function(e){return{l:/[!#@\w]+/,k:{keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"},i:/;/,c:[e.NM,e.ASM,{cN:"string",b:/"(\\"|\n\\|[^"\n])*"/},e.C('"',"$"),{cN:"variable",b:/[bwtglsav]:[\w\d_]*/},{cN:"function",bK:"function function!",e:"$",r:0,c:[e.TM,{cN:"params",b:"\\(",e:"\\)"}]},{cN:"symbol",b:/<[\w-]+>/}]}});hljs.registerLanguage("irpf90",function(e){var t={cN:"params",b:"\\(",e:"\\)"},n={literal:".False. .True.",keyword:"kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data begin_provider &begin_provider end_provider begin_shell end_shell begin_template end_template subst assert touch soft_touch provide no_dep free irp_if irp_else irp_endif irp_write irp_read",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_ofacosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image IRP_ALIGN irp_here"};return{cI:!0,k:n,i:/\/\*/,c:[e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{cN:"string",r:0}),{cN:"function",bK:"subroutine function program",i:"[${=\\n]",c:[e.UTM,t]},e.C("!","$",{r:0}),e.C("begin_doc","end_doc",{r:10}),{cN:"number",b:"(?=\\b|\\+|\\-|\\.)(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*)(?:[de][+-]?\\d+)?\\b\\.?",r:0}]}});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*#]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},_={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:_,l:i,i:""}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:i,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("swift",function(e){var t={keyword:"__COLUMN__ __FILE__ __FUNCTION__ __LINE__ as as! as? associativity break case catch class continue convenience default defer deinit didSet do dynamic dynamicType else enum extension fallthrough false final for func get guard if import in indirect infix init inout internal is lazy left let mutating nil none nonmutating operator optional override postfix precedence prefix private protocol Protocol public repeat required rethrows return right self Self set static struct subscript super switch throw throws true try try! try? Type typealias unowned var weak where while willSet",literal:"true false nil",built_in:"abs advance alignof alignofValue anyGenerator assert assertionFailure bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal fatalError filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare map max maxElement min minElement numericCast overlaps partition posix precondition preconditionFailure print println quickSort readLine reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith stride strideof strideofValue swap toString transcode underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers withUnsafePointer withUnsafePointers withVaList zip"},i={cN:"type",b:"\\b[A-Z][\\w']*",r:0},n=e.C("/\\*","\\*/",{c:["self"]}),r={cN:"subst",b:/\\\(/,e:"\\)",k:t,c:[]},a={cN:"number",b:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",r:0},o=e.inherit(e.QSM,{c:[r,e.BE]});return r.c=[a],{k:t,c:[o,e.CLCM,n,i,a,{cN:"function",bK:"func",e:"{",eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{b://},{cN:"params",b:/\(/,e:/\)/,endsParent:!0,k:t,c:["self",a,o,e.CBCM,{b:":"}],i:/["']/}],i:/\[|%/},{cN:"class",bK:"struct protocol class extension enum",k:t,e:"\\{",eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/})]},{cN:"meta",b:"(@warn_unused_result|@exported|@lazy|@noescape|@NSCopying|@NSManaged|@objc|@convention|@required|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix|@autoclosure|@testable|@available|@nonobjc|@NSApplicationMain|@UIApplicationMain)"},{bK:"import",e:/$/,c:[e.CLCM,n]}]}});hljs.registerLanguage("mizar",function(e){return{k:"environ vocabularies notations constructors definitions registrations theorems schemes requirements begin end definition registration cluster existence pred func defpred deffunc theorem proof let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from be being by means equals implies iff redefine define now not or attr is mode suppose per cases set thesis contradiction scheme reserve struct correctness compatibility coherence symmetry assymetry reflexivity irreflexivity connectedness uniqueness commutativity idempotence involutiveness projectivity",c:[e.C("::","$")]}});hljs.registerLanguage("dts",function(e){var a={cN:"string",v:[e.inherit(e.QSM,{b:'((u8?|U)|L)?"'}),{b:'(u8?|U)?R"',e:'"',c:[e.BE]},{b:"'\\\\?.",e:"'",i:"."}]},c={cN:"number",v:[{b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{b:e.CNR}],r:0},b={cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef ifdef ifndef"},c:[{b:/\\\n/,r:0},{bK:"include",e:"$",k:{"meta-keyword":"include"},c:[e.inherit(a,{cN:"meta-string"}),{cN:"meta-string",b:"<",e:">",i:"\\n"}]},a,e.CLCM,e.CBCM]},i={cN:"variable",b:"\\&[a-z\\d_]*\\b"},r={cN:"meta-keyword",b:"/[a-z][a-z\\d-]*/"},d={cN:"symbol",b:"^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"},n={cN:"params",b:"<",e:">",c:[c,i]},s={cN:"class",b:/[a-zA-Z_][a-zA-Z\d_@]*\s{/,e:/[{;=]/,rB:!0,eE:!0},t={cN:"class",b:"/\\s*{",e:"};",r:10,c:[i,r,d,s,n,e.CLCM,e.CBCM,c,a]};return{k:"",c:[t,i,r,d,s,n,e.CLCM,e.CBCM,c,a,b,{b:e.IR+"::",k:""}]}});hljs.registerLanguage("step21",function(e){var i="[A-Z_][A-Z0-9_.]*",r={keyword:"HEADER ENDSEC DATA"},t={cN:"meta",b:"ISO-10303-21;",r:10},n={cN:"meta",b:"END-ISO-10303-21;",r:10};return{aliases:["p21","step","stp"],cI:!0,l:i,k:r,c:[t,n,e.CLCM,e.CBCM,e.C("/\\*\\*!","\\*/"),e.CNM,e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null}),{cN:"string",b:"'",e:"'"},{cN:"symbol",v:[{b:"#",e:"\\d+",i:"\\W"}]}]}});hljs.registerLanguage("tap",function(b){return{cI:!0,c:[b.HCM,{cN:"meta",v:[{b:"^TAP version (\\d+)$"},{b:"^1\\.\\.(\\d+)$"}]},{b:"(s+)?---$",e:"\\.\\.\\.$",sL:"yaml",r:0},{cN:"number",b:" (\\d+) "},{cN:"symbol",v:[{b:"^ok"},{b:"^not ok"}]}]}});hljs.registerLanguage("rib",function(e){return{k:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",i:">/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:/\[(\|\|)?\]|\(\)/,r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*"},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("mipsasm",function(s){return{cI:!0,aliases:["mips"],l:"\\.?"+s.IR,k:{meta:".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .ltorg ",built_in:"$0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 zero at v0 v1 a0 a1 a2 a3 a4 a5 a6 a7 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 s0 s1 s2 s3 s4 s5 s6 s7 s8 k0 k1 gp sp fp ra $f0 $f1 $f2 $f2 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15 $f16 $f17 $f18 $f19 $f20 $f21 $f22 $f23 $f24 $f25 $f26 $f27 $f28 $f29 $f30 $f31 Context Random EntryLo0 EntryLo1 Context PageMask Wired EntryHi HWREna BadVAddr Count Compare SR IntCtl SRSCtl SRSMap Cause EPC PRId EBase Config Config1 Config2 Config3 LLAddr Debug DEPC DESAVE CacheErr ECC ErrorEPC TagLo DataLo TagHi DataHi WatchLo WatchHi PerfCtl PerfCnt "},c:[{cN:"keyword",b:"\\b(addi?u?|andi?|b(al)?|beql?|bgez(al)?l?|bgtzl?|blezl?|bltz(al)?l?|bnel?|cl[oz]|divu?|ext|ins|j(al)?|jalr(.hb)?|jr(.hb)?|lbu?|lhu?|ll|lui|lw[lr]?|maddu?|mfhi|mflo|movn|movz|move|msubu?|mthi|mtlo|mul|multu?|nop|nor|ori?|rotrv?|sb|sc|se[bh]|sh|sllv?|slti?u?|srav?|srlv?|subu?|sw[lr]?|xori?|wsbh|abs.[sd]|add.[sd]|alnv.ps|bc1[ft]l?|c.(s?f|un|u?eq|[ou]lt|[ou]le|ngle?|seq|l[et]|ng[et]).[sd]|(ceil|floor|round|trunc).[lw].[sd]|cfc1|cvt.d.[lsw]|cvt.l.[dsw]|cvt.ps.s|cvt.s.[dlw]|cvt.s.p[lu]|cvt.w.[dls]|div.[ds]|ldx?c1|luxc1|lwx?c1|madd.[sd]|mfc1|mov[fntz]?.[ds]|msub.[sd]|mth?c1|mul.[ds]|neg.[ds]|nmadd.[ds]|nmsub.[ds]|p[lu][lu].ps|recip.fmt|r?sqrt.[ds]|sdx?c1|sub.[ds]|suxc1|swx?c1|break|cache|d?eret|[de]i|ehb|mfc0|mtc0|pause|prefx?|rdhwr|rdpgpr|sdbbp|ssnop|synci?|syscall|teqi?|tgei?u?|tlb(p|r|w[ir])|tlti?u?|tnei?|wait|wrpgpr)",e:"\\s"},s.C("[;#]","$"),s.CBCM,s.QSM,{cN:"string",b:"'",e:"[^\\\\]'",r:0},{cN:"title",b:"\\|",e:"\\|",i:"\\n",r:0},{cN:"number",v:[{b:"0x[0-9a-f]+"},{b:"\\b-?\\d+"}],r:0},{cN:"symbol",v:[{b:"^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"},{b:"^\\s*[0-9]+:"},{b:"[0-9]+[bf]"}],r:0}],i:"/"}});hljs.registerLanguage("subunit",function(s){var r={cN:"string",b:"\\[\n(multipart)?",e:"\\]\n"},t={cN:"string",b:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},e={cN:"string",b:"(\\+|-)\\d+"},c={cN:"keyword",r:10,v:[{b:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{b:"^progress(:?)(\\s+)?(pop|push)?"},{b:"^tags:"},{b:"^time:"}]};return{cI:!0,c:[r,t,e,c]}});hljs.registerLanguage("vbscript",function(e){return{aliases:["vbs"],cI:!0,k:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:"lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",literal:"true false null nothing empty"},i:"//",c:[e.inherit(e.QSM,{c:[{b:'""'}]}),e.C(/'/,/$/,{r:0}),e.CNM]}});hljs.registerLanguage("vbscript-html",function(r){return{sL:"xml",c:[{b:"<%",e:"%>",sL:"vbscript"}]}});hljs.registerLanguage("typescript",function(e){var r={keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void"};return{aliases:["ts"],k:r,c:[{cN:"meta",b:/^\s*['"]use strict['"]/},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM],r:0},{cN:"function",b:"function",e:/[\{;]/,eE:!0,k:r,c:["self",e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:r,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/%/,r:0},{bK:"constructor",e:/\{/,eE:!0},{b:/module\./,k:{built_in:"module"},r:0},{bK:"module",e:/\{/,eE:!0},{bK:"interface",e:/\{/,eE:!0,k:"interface extends"},{b:/\$[(.]/},{b:"\\."+e.IR,r:0}]}});hljs.registerLanguage("tcl",function(e){return{aliases:["tk"],k:"after append apply array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent filename flush for foreach format gets glob global history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename return safe scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update uplevel upvar variable vwait while",c:[e.C(";[ \\t]*#","$"),e.C("^[ \\t]*#","$"),{bK:"proc",e:"[\\{]",eE:!0,c:[{cN:"title",b:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",e:"[ \\t\\n\\r]",eW:!0,eE:!0}]},{eE:!0,v:[{b:"\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*\\(([a-zA-Z0-9_])*\\)",e:"[^a-zA-Z0-9_\\}\\$]"},{b:"\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",e:"(\\))?[^a-zA-Z0-9_\\}\\$]"}]},{cN:"string",c:[e.BE],v:[e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},{cN:"number",v:[e.BNM,e.CNM]}]}});hljs.registerLanguage("axapta",function(e){return{k:"false int abstract private char boolean static null if for true while long throw finally protected final return void enum else break new catch byte super case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",c:[e.CLCM,e.CBCM,e.ASM,e.QSM,e.CNM,{cN:"meta",b:"#",e:"$"},{cN:"class",bK:"class interface",e:"{",eE:!0,i:":",c:[{bK:"extends implements"},e.UTM]}]}});hljs.registerLanguage("vbnet",function(e){return{aliases:["vb"],cI:!0,k:{keyword:"addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass namespace narrowing new next not notinheritable notoverridable of off on operator option optional or order orelse overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim rem removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly xor",built_in:"boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype date decimal directcast double gettype getxmlnamespace iif integer long object sbyte short single string trycast typeof uinteger ulong ushort",literal:"true false nothing"},i:"//|{|}|endif|gosub|variant|wend",c:[e.inherit(e.QSM,{c:[{b:'""'}]}),e.C("'","$",{rB:!0,c:[{cN:"doctag",b:"'''|",c:[e.PWM]},{cN:"doctag",b:"",c:[e.PWM]}]}),e.CNM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elseif end region externalsource"}}]}});hljs.registerLanguage("protobuf",function(e){return{k:{keyword:"package import option optional required repeated group",built_in:"double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes",literal:"true false"},c:[e.QSM,e.NM,e.CLCM,{cN:"class",bK:"message enum service",e:/\{/,i:/\n/,c:[e.inherit(e.TM,{starts:{eW:!0,eE:!0}})]},{cN:"function",bK:"rpc",e:/;/,eE:!0,k:"rpc returns"},{b:/^\s*[A-Z_]+/,e:/\s*=/,eE:!0}]}});hljs.registerLanguage("hsp",function(e){return{cI:!0,l:/[\w\._]+/,k:"goto gosub return break repeat loop continue wait await dim sdim foreach dimtype dup dupptr end stop newmod delmod mref run exgoto on mcall assert logmes newlab resume yield onexit onerror onkey onclick oncmd exist delete mkdir chdir dirlist bload bsave bcopy memfile if else poke wpoke lpoke getstr chdpm memexpand memcpy memset notesel noteadd notedel noteload notesave randomize noteunsel noteget split strrep setease button chgdisp exec dialog mmload mmplay mmstop mci pset pget syscolor mes print title pos circle cls font sysfont objsize picload color palcolor palette redraw width gsel gcopy gzoom gmode bmpsave hsvcolor getkey listbox chkbox combox input mesbox buffer screen bgscr mouse objsel groll line clrobj boxf objprm objmode stick grect grotate gsquare gradf objimage objskip objenable celload celdiv celput newcom querycom delcom cnvstow comres axobj winobj sendmsg comevent comevarg sarrayconv callfunc cnvwtos comevdisp libptr system hspstat hspver stat cnt err strsize looplev sublev iparam wparam lparam refstr refdval int rnd strlen length length2 length3 length4 vartype gettime peek wpeek lpeek varptr varuse noteinfo instr abs limit getease str strmid strf getpath strtrim sin cos tan atan sqrt double absf expf logf limitf powf geteasef mousex mousey mousew hwnd hinstance hdc ginfo objinfo dirinfo sysinfo thismod __hspver__ __hsp30__ __date__ __time__ __line__ __file__ _debug __hspdef__ and or xor not screen_normal screen_palette screen_hide screen_fixedsize screen_tool screen_frame gmode_gdi gmode_mem gmode_rgb0 gmode_alpha gmode_rgb0alpha gmode_add gmode_sub gmode_pixela ginfo_mx ginfo_my ginfo_act ginfo_sel ginfo_wx1 ginfo_wy1 ginfo_wx2 ginfo_wy2 ginfo_vx ginfo_vy ginfo_sizex ginfo_sizey ginfo_winx ginfo_winy ginfo_mesx ginfo_mesy ginfo_r ginfo_g ginfo_b ginfo_paluse ginfo_dispx ginfo_dispy ginfo_cx ginfo_cy ginfo_intid ginfo_newid ginfo_sx ginfo_sy objinfo_mode objinfo_bmscr objinfo_hwnd notemax notesize dir_cur dir_exe dir_win dir_sys dir_cmdline dir_desktop dir_mydoc dir_tv font_normal font_bold font_italic font_underline font_strikeout font_antialias objmode_normal objmode_guifont objmode_usefont gsquare_grad msgothic msmincho do until while wend for next _break _continue switch case default swbreak swend ddim ldim alloc m_pi rad2deg deg2rad ease_linear ease_quad_in ease_quad_out ease_quad_inout ease_cubic_in ease_cubic_out ease_cubic_inout ease_quartic_in ease_quartic_out ease_quartic_inout ease_bounce_in ease_bounce_out ease_bounce_inout ease_shake_in ease_shake_out ease_shake_inout ease_loop",c:[e.CLCM,e.CBCM,e.QSM,e.ASM,{cN:"string",b:'{"',e:'"}',c:[e.BE]},e.C(";","$",{r:0}),{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"addion cfunc cmd cmpopt comfunc const defcfunc deffunc define else endif enum epack func global if ifdef ifndef include modcfunc modfunc modinit modterm module pack packopt regcmd runtime undef usecom uselib"},c:[e.inherit(e.QSM,{cN:"meta-string"}),e.NM,e.CNM,e.CLCM,e.CBCM]},{cN:"symbol",b:"^\\*(\\w+|@)"},e.NM,e.CNM]}});hljs.registerLanguage("dsconfig",function(e){var i={cN:"string",b:/"/,e:/"/},r={cN:"string",b:/'/,e:/'/},s={cN:"string",b:"[\\w-?]+:\\w+",e:"\\W",r:0},t={cN:"string",b:"\\w+-?\\w+",e:"\\W",r:0};return{k:"dsconfig",c:[{cN:"keyword",b:"^dsconfig",e:"\\s",eE:!0,r:10},{cN:"built_in",b:"(list|create|get|set|delete)-(\\w+)",e:"\\s",eE:!0,i:"!@#$%^&*()",r:10},{cN:"built_in",b:"--(\\w+)",e:"\\s",eE:!0},i,r,s,t,e.HCM]}});hljs.registerLanguage("bnf",function(e){return{c:[{cN:"attribute",b://},{b:/::=/,starts:{e:/$/,c:[{b://},e.CLCM,e.CBCM,e.ASM,e.QSM]}}]}});hljs.registerLanguage("gcode",function(N){var e="[A-Z_][A-Z0-9_.]*",c="\\%",E="IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR",i={cN:"meta",b:"([O])([0-9]+)"},n=[N.CLCM,N.CBCM,N.C(/\(/,/\)/),N.inherit(N.CNM,{b:"([-+]?([0-9]*\\.?[0-9]+\\.?))|"+N.CNR}),N.inherit(N.ASM,{i:null}),N.inherit(N.QSM,{i:null}),{cN:"name",b:"([G])([0-9]+\\.?[0-9]?)"},{cN:"name",b:"([M])([0-9]+\\.?[0-9]?)"},{cN:"attr",b:"(VC|VS|#)",e:"(\\d+)"},{cN:"attr",b:"(VZOFX|VZOFY|VZOFZ)"},{cN:"built_in",b:"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",e:"([-+]?([0-9]*\\.?[0-9]+\\.?))(\\])"},{cN:"symbol",v:[{b:"N",e:"\\d+",i:"\\W"}]}];return{aliases:["nc"],cI:!0,l:e,k:E,c:[{cN:"meta",b:c},i].concat(n)}});hljs.registerLanguage("ada",function(e){var r="\\d(_|\\d)*",t="[eE][-+]?"+r,s=r+"(\\."+r+")?("+t+")?",n="\\w+",a=r+"#"+n+"(\\."+n+")?#("+t+")?",i="\\b("+a+"|"+s+")",c="[A-Za-z](_?[A-Za-z0-9.])*",o="[]{}%#'\"",b=e.C("--","$"),d={b:"\\s+:\\s+",e:"\\s*(:=|;|\\)|=>|$)",i:o,c:[{bK:"loop for declare others",endsParent:!0},{cN:"keyword",bK:"not null constant access function procedure in out aliased exception"},{cN:"type",b:c,endsParent:!0,r:0}]};return{cI:!0,k:{keyword:"abort else new return abs elsif not reverse abstract end accept entry select access exception of separate aliased exit or some all others subtype and for out synchronized array function overriding at tagged generic package task begin goto pragma terminate body private then if procedure type case in protected constant interface is raise use declare range delay limited record when delta loop rem while digits renames with do mod requeue xor",literal:"True False"},c:[b,{cN:"string",b:/"/,e:/"/,c:[{b:/""/,r:0}]},{cN:"string",b:/'.'/},{cN:"number",b:i,r:0},{cN:"symbol",b:"'"+c},{cN:"title",b:"(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",e:"(is|$)",k:"package body",eB:!0,eE:!0,i:o},{b:"(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",e:"(\\bis|\\bwith|\\brenames|\\)\\s*;)",k:"overriding function procedure with is renames return",rB:!0,c:[b,{cN:"title",b:"(\\bwith\\s+)?\\b(function|procedure)\\s+",e:"(\\(|\\s+|$)",eB:!0,eE:!0,i:o},d,{cN:"type",b:"\\breturn\\s+",e:"(\\s+|;|$)",k:"return",eB:!0,eE:!0,endsParent:!0,i:o}]},{cN:"type",b:"\\b(sub)?type\\s+",e:"\\s+",k:"type",eB:!0,i:o},d]}});hljs.registerLanguage("powershell",function(e){var t={b:"`[\\s\\S]",r:0},o={cN:"variable",v:[{b:/\$[\w\d][\w\d_:]*/}]},n={cN:"literal",b:/\$(null|true|false)\b/},r={cN:"string",v:[{b:/"/,e:/"/},{b:/@"/,e:/^"@/}],c:[t,o,{cN:"variable",b:/\$[A-z]/,e:/[^A-z]/}]},i={cN:"string",v:[{b:/'/,e:/'/},{b:/@'/,e:/^'@/}]},a={cN:"doctag",v:[{b:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{b:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]},s=e.inherit(e.C(null,null),{v:[{b:/#/,e:/$/},{b:/<#/,e:/#>/}],c:[a]});return{aliases:["ps"],l:/-?[A-z\.\-]+/,cI:!0,k:{keyword:"if else foreach return function do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch",built_in:"Add-Computer Add-Content Add-History Add-JobTrigger Add-Member Add-PSSnapin Add-Type Checkpoint-Computer Clear-Content Clear-EventLog Clear-History Clear-Host Clear-Item Clear-ItemProperty Clear-Variable Compare-Object Complete-Transaction Connect-PSSession Connect-WSMan Convert-Path ConvertFrom-Csv ConvertFrom-Json ConvertFrom-SecureString ConvertFrom-StringData ConvertTo-Csv ConvertTo-Html ConvertTo-Json ConvertTo-SecureString ConvertTo-Xml Copy-Item Copy-ItemProperty Debug-Process Disable-ComputerRestore Disable-JobTrigger Disable-PSBreakpoint Disable-PSRemoting Disable-PSSessionConfiguration Disable-WSManCredSSP Disconnect-PSSession Disconnect-WSMan Disable-ScheduledJob Enable-ComputerRestore Enable-JobTrigger Enable-PSBreakpoint Enable-PSRemoting Enable-PSSessionConfiguration Enable-ScheduledJob Enable-WSManCredSSP Enter-PSSession Exit-PSSession Export-Alias Export-Clixml Export-Console Export-Counter Export-Csv Export-FormatData Export-ModuleMember Export-PSSession ForEach-Object Format-Custom Format-List Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-ComputerRestorePoint Get-Content Get-ControlPanelItem Get-Counter Get-Credential Get-Culture Get-Date Get-Event Get-EventLog Get-EventSubscriber Get-ExecutionPolicy Get-FormatData Get-Host Get-HotFix Get-Help Get-History Get-IseSnippet Get-Item Get-ItemProperty Get-Job Get-JobTrigger Get-Location Get-Member Get-Module Get-PfxCertificate Get-Process Get-PSBreakpoint Get-PSCallStack Get-PSDrive Get-PSProvider Get-PSSession Get-PSSessionConfiguration Get-PSSnapin Get-Random Get-ScheduledJob Get-ScheduledJobOption Get-Service Get-TraceSource Get-Transaction Get-TypeData Get-UICulture Get-Unique Get-Variable Get-Verb Get-WinEvent Get-WmiObject Get-WSManCredSSP Get-WSManInstance Group-Object Import-Alias Import-Clixml Import-Counter Import-Csv Import-IseSnippet Import-LocalizedData Import-PSSession Import-Module Invoke-AsWorkflow Invoke-Command Invoke-Expression Invoke-History Invoke-Item Invoke-RestMethod Invoke-WebRequest Invoke-WmiMethod Invoke-WSManAction Join-Path Limit-EventLog Measure-Command Measure-Object Move-Item Move-ItemProperty New-Alias New-Event New-EventLog New-IseSnippet New-Item New-ItemProperty New-JobTrigger New-Object New-Module New-ModuleManifest New-PSDrive New-PSSession New-PSSessionConfigurationFile New-PSSessionOption New-PSTransportOption New-PSWorkflowExecutionOption New-PSWorkflowSession New-ScheduledJobOption New-Service New-TimeSpan New-Variable New-WebServiceProxy New-WinEvent New-WSManInstance New-WSManSessionOption Out-Default Out-File Out-GridView Out-Host Out-Null Out-Printer Out-String Pop-Location Push-Location Read-Host Receive-Job Register-EngineEvent Register-ObjectEvent Register-PSSessionConfiguration Register-ScheduledJob Register-WmiEvent Remove-Computer Remove-Event Remove-EventLog Remove-Item Remove-ItemProperty Remove-Job Remove-JobTrigger Remove-Module Remove-PSBreakpoint Remove-PSDrive Remove-PSSession Remove-PSSnapin Remove-TypeData Remove-Variable Remove-WmiObject Remove-WSManInstance Rename-Computer Rename-Item Rename-ItemProperty Reset-ComputerMachinePassword Resolve-Path Restart-Computer Restart-Service Restore-Computer Resume-Job Resume-Service Save-Help Select-Object Select-String Select-Xml Send-MailMessage Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-JobTrigger Set-Location Set-PSBreakpoint Set-PSDebug Set-PSSessionConfiguration Set-ScheduledJob Set-ScheduledJobOption Set-Service Set-StrictMode Set-TraceSource Set-Variable Set-WmiInstance Set-WSManInstance Set-WSManQuickConfig Show-Command Show-ControlPanelItem Show-EventLog Sort-Object Split-Path Start-Job Start-Process Start-Service Start-Sleep Start-Transaction Start-Transcript Stop-Computer Stop-Job Stop-Process Stop-Service Stop-Transcript Suspend-Job Suspend-Service Tee-Object Test-ComputerSecureChannel Test-Connection Test-ModuleManifest Test-Path Test-PSSessionConfigurationFile Trace-Command Unblock-File Undo-Transaction Unregister-Event Unregister-PSSessionConfiguration Unregister-ScheduledJob Update-FormatData Update-Help Update-List Update-TypeData Use-Transaction Wait-Event Wait-Job Wait-Process Where-Object Write-Debug Write-Error Write-EventLog Write-Host Write-Output Write-Progress Write-Verbose Write-Warning",nomarkup:"-ne -eq -lt -gt -ge -le -not -like -notlike -match -notmatch -contains -notcontains -in -notin -replace"},c:[t,e.NM,r,i,n,o,s]}});hljs.registerLanguage("ceylon",function(e){var a="assembly module package import alias class interface object given value assign void function new of extends satisfies abstracts in out return break continue throw assert dynamic if else switch case for while try catch finally then let this outer super is exists nonempty",t="shared abstract formal default actual variable late native deprecatedfinal sealed annotation suppressWarnings small",s="doc by license see throws tagged",n={cN:"subst",eB:!0,eE:!0,b:/``/,e:/``/,k:a,r:10},r=[{cN:"string",b:'"""',e:'"""',r:10},{cN:"string",b:'"',e:'"',c:[n]},{cN:"string",b:"'",e:"'"},{cN:"number",b:"#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?",r:0}];return n.c=r,{k:{keyword:a+" "+t,meta:s},i:"\\$[^01]|#[^0-9a-fA-F]",c:[e.CLCM,e.C("/\\*","\\*/",{c:["self"]}),{cN:"meta",b:'@[a-z]\\w*(?:\\:"[^"]*")?'}].concat(r)}});hljs.registerLanguage("go",function(e){var t={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:t,i:"",sL:"xml",r:0}],r:10},{cN:"bullet",b:"^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"},{cN:"symbol",b:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",r:10},{cN:"strong",b:"\\B\\*(?![\\*\\s])",e:"(\\n{2}|\\*)",c:[{b:"\\\\*\\w",r:0}]},{cN:"emphasis",b:"\\B'(?!['\\s])",e:"(\\n{2}|')",c:[{b:"\\\\'\\w",r:0}],r:0},{cN:"emphasis",b:"_(?![_\\s])",e:"(\\n{2}|_)",r:0},{cN:"string",v:[{b:"``.+?''"},{b:"`.+?'"}]},{cN:"code",b:"(`.+?`|\\+.+?\\+)",r:0},{cN:"code",b:"^[ \\t]",e:"$",r:0},{b:"^'{3,}[ \\t]*$",r:10},{b:"(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",rB:!0,c:[{b:"(link|image:?):",r:0},{cN:"link",b:"\\w",e:"[^\\[]+",r:0},{cN:"string",b:"\\[",e:"\\]",eB:!0,eE:!0,r:0}],r:10}]}});hljs.registerLanguage("purebasic",function(e){var r={cN:"string",b:'(~)?"',e:'"',i:"\\n"},t={cN:"symbol",b:"#[a-zA-Z_]\\w*\\$?"};return{aliases:["pb","pbi"],k:"And As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerEndIf CompilerEndSelect CompilerError CompilerIf CompilerSelect Continue Data DataSection EndDataSection Debug DebugLevel Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM EnableDebugger EnableExplicit End EndEnumeration EndIf EndImport EndInterface EndMacro EndProcedure EndSelect EndStructure EndStructureUnion EndWith Enumeration Extends FakeReturn For Next ForEach ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface Macro NewList Not Or ProcedureReturn Protected Prototype PrototypeC Read ReDim Repeat Until Restore Return Select Shared Static Step Structure StructureUnion Swap To Wend While With XIncludeFile XOr Procedure ProcedureC ProcedureCDLL ProcedureDLL Declare DeclareC DeclareCDLL DeclareDLL",c:[e.C(";","$",{r:0}),{cN:"function",b:"\\b(Procedure|Declare)(C|CDLL|DLL)?\\b",e:"\\(",eE:!0,rB:!0,c:[{cN:"keyword",b:"(Procedure|Declare)(C|CDLL|DLL)?",eE:!0},{cN:"type",b:"\\.\\w*"},e.UTM]},r,t]}});hljs.registerLanguage("scheme",function(e){var t="[^\\(\\)\\[\\]\\{\\}\",'`;#|\\\\\\s]+",r="(\\-|\\+)?\\d+([./]\\d+)?",a=r+"[+\\-]"+r+"i",i={"builtin-name":"case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules ' * + , ,@ - ... / ; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"},n={cN:"meta",b:"^#!",e:"$"},c={cN:"literal",b:"(#t|#f|#\\\\"+t+"|#\\\\.)"},l={cN:"number",v:[{b:r,r:0},{b:a,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"}]},s=e.QSM,o=[e.C(";","$",{r:0}),e.C("#\\|","\\|#")],u={b:t,r:0},p={cN:"symbol",b:"'"+t},d={eW:!0,r:0},m={b:/'/,c:[{b:"\\(",e:"\\)",c:["self",c,s,l,u,p]}]},g={cN:"name",b:t,l:t,k:i},h={b:/lambda/,eW:!0,rB:!0,c:[g,{b:/\(/,e:/\)/,endsParent:!0,c:[u]}]},b={v:[{b:"\\(",e:"\\)"},{b:"\\[",e:"\\]"}],c:[h,g,d]};return d.c=[c,l,s,u,p,m,b].concat(o),{i:/\S/,c:[n,l,s,p,m,b].concat(o)}});hljs.registerLanguage("scss",function(e){var t="[a-zA-Z-][a-zA-Z0-9_-]*",i={cN:"variable",b:"(\\$"+t+")\\b"},r={cN:"number",b:"#[0-9A-Fa-f]+"};({cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{eW:!0,eE:!0,c:[r,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"meta",b:"!important"}]}});return{cI:!0,i:"[=/|']",c:[e.CLCM,e.CBCM,{cN:"selector-id",b:"\\#[A-Za-z0-9_-]+",r:0},{cN:"selector-class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"selector-attr",b:"\\[",e:"\\]",i:"$"},{cN:"selector-tag",b:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",r:0},{b:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{b:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},i,{cN:"attribute",b:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",i:"[^\\s]"},{b:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{b:":",e:";",c:[i,r,e.CSSNM,e.QSM,e.ASM,{cN:"meta",b:"!important"}]},{b:"@",e:"[{;]",k:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",c:[i,e.QSM,e.ASM,r,e.CSSNM,{b:"\\s[A-Za-z0-9_.-]+",r:0}]}]}});hljs.registerLanguage("xquery",function(e){var t="for let if while then else return where group by xquery encoding versionmodule namespace boundary-space preserve strip default collation base-uri orderingcopy-namespaces order declare import schema namespace function option in allowing emptyat tumbling window sliding window start when only end when previous next stable ascendingdescending empty greatest least some every satisfies switch case typeswitch try catch andor to union intersect instance of treat as castable cast map array delete insert intoreplace value rename copy modify update",a="false true xs:string xs:integer element item xs:date xs:datetime xs:float xs:double xs:decimal QName xs:anyURI xs:long xs:int xs:short xs:byte attribute",s={b:/\$[a-zA-Z0-9\-]+/},n={cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},r={cN:"string",v:[{b:/"/,e:/"/,c:[{b:/""/,r:0}]},{b:/'/,e:/'/,c:[{b:/''/,r:0}]}]},i={cN:"meta",b:"%\\w+"},c={cN:"comment",b:"\\(:",e:":\\)",r:10,c:[{cN:"doctag",b:"@\\w+"}]},o={b:"{",e:"}"},l=[s,r,n,c,i,o];return o.c=l,{aliases:["xpath","xq"],cI:!1,l:/[a-zA-Z\$][a-zA-Z0-9_:\-]*/,i:/(proc)|(abstract)|(extends)|(until)|(#)/,k:{keyword:t,literal:a},c:l}});hljs.registerLanguage("taggerscript",function(e){var c={cN:"comment",b:/\$noop\(/,e:/\)/,c:[{b:/\(/,e:/\)/,c:["self",{b:/\\./}]}],r:10},r={cN:"keyword",b:/\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/,e:/\(/,eE:!0},a={cN:"variable",b:/%[_a-zA-Z0-9:]*/,e:"%"},b={cN:"symbol",b:/\\./};return{c:[c,r,a,b]}});hljs.registerLanguage("smalltalk",function(e){var s="[a-z][a-zA-Z0-9_]*",a={cN:"string",b:"\\$.{1}"},r={cN:"symbol",b:"#"+e.UIR};return{aliases:["st"],k:"self super nil true false thisContext",c:[e.C('"','"'),e.ASM,{cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},{b:s+":",r:0},e.CNM,r,a,{b:"\\|[ ]*"+s+"([ ]+"+s+")*[ ]*\\|",rB:!0,e:/\|/,i:/\S/,c:[{b:"(\\|[ ]*)?"+s}]},{b:"\\#\\(",e:"\\)",c:[e.ASM,a,e.CNM,r]}]}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("actionscript",function(e){var a="[a-zA-Z_$][a-zA-Z0-9_$]*",t="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)",c={cN:"rest_arg",b:"[.]{3}",e:a,r:10};return{aliases:["as"],k:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},c:[e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{cN:"class",bK:"package",e:"{",c:[e.TM]},{cN:"class",bK:"class interface",e:"{",eE:!0,c:[{bK:"extends implements"},e.TM]},{cN:"meta",bK:"import include",e:";",k:{"meta-keyword":"import include"}},{cN:"function",bK:"function",e:"[{;]",eE:!0,i:"\\S",c:[e.TM,{cN:"params",b:"\\(",e:"\\)",c:[e.ASM,e.QSM,e.CLCM,e.CBCM,c]},{b:":\\s*"+t}]},e.METHOD_GUARD],i:/#/}});hljs.registerLanguage("mercury",function(e){var i={keyword:"module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",meta:"inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing",built_in:"some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"},r=e.C("%","$"),t={cN:"number",b:"0'.\\|0[box][0-9a-fA-F]*"},_=e.inherit(e.ASM,{r:0}),n=e.inherit(e.QSM,{r:0}),a={cN:"subst",b:"\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",r:0};n.c.push(a);var o={cN:"built_in",v:[{b:"<=>"},{b:"<=",r:0},{b:"=>",r:0},{b:"/\\\\"},{b:"\\\\/"}]},l={cN:"built_in",v:[{b:":-\\|-->"},{b:"=",r:0}]};return{aliases:["m","moo"],k:i,c:[o,l,r,e.CBCM,t,e.NM,_,n,{b:/:-/}]}});hljs.registerLanguage("scilab",function(e){var s=[e.CNM,{cN:"string",b:"'|\"",e:"'|\"",c:[e.BE,{b:"''"}]}];return{aliases:["sci"],l:/%?\w+/,k:{keyword:"abort break case clear catch continue do elseif else endfunction end for function global if pause return resume select try then while",literal:"%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan type typename warning zeros matrix"},i:'("|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)"}]},{b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{b:"\\[",e:"\\]'*[\\.']*",r:0,c:s},e.C("//","$")].concat(s)}});hljs.registerLanguage("htmlbars",function(e){var a="action collection component concat debugger each each-in else get hash if input link-to loc log mut outlet partial query-params render textarea unbound unless with yield view",t={i:/\}\}/,b:/[a-zA-Z0-9_]+=/,rB:!0,r:0,c:[{cN:"attr",b:/[a-zA-Z0-9_]+/}]},i=({i:/\}\}/,b:/\)/,e:/\)/,c:[{b:/[a-zA-Z\.\-]+/,k:{built_in:a},starts:{eW:!0,r:0,c:[e.QSM]}}]},{eW:!0,r:0,k:{keyword:"as",built_in:a},c:[e.QSM,t,e.NM]});return{cI:!0,sL:"xml",c:[e.C("{{!(--)?","(--)?}}"),{cN:"template-tag",b:/\{\{[#\/]/,e:/\}\}/,c:[{cN:"name",b:/[a-zA-Z\.\-]+/,k:{"builtin-name":a},starts:i}]},{cN:"template-variable",b:/\{\{[a-zA-Z][a-zA-Z\-]+/,e:/\}\}/,k:{keyword:"as",built_in:a},c:[e.QSM]}]}});hljs.registerLanguage("kotlin",function(e){var t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline interface annotation data sealed internal infix operator out by constructor super trait volatile transient native default",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={cN:"keyword",b:/\b(break|continue|return|this)\b/,starts:{c:[{cN:"symbol",b:/@\w+/}]}},n={cN:"symbol",b:e.UIR+"@"},i={cN:"subst",v:[{b:"\\$"+e.UIR},{b:"\\${",e:"}",c:[e.ASM,e.CNM]}]},a={cN:"string",v:[{b:'"""',e:'"""',c:[i]},{b:"'",e:"'",i:/\n/,c:[e.BE]},{b:'"',e:'"',i:/\n/,c:[e.BE,i]}]},c={cN:"meta",b:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UIR+")?"},s={cN:"meta",b:"@"+e.UIR,c:[{b:/\(/,e:/\)/,c:[e.inherit(a,{cN:"meta-string"})]}]};return{k:t,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,r,n,c,s,{cN:"function",bK:"fun",e:"[(]|$",rB:!0,eE:!0,k:t,i:/fun\s+(<.*>)?[^\s\(]+(\s+[^\s\(]+)\s*=/,r:5,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"type",b://,k:"reified",r:0},{cN:"params",b:/\(/,e:/\)/,endsParent:!0,k:t,r:0,c:[{b:/:/,e:/[=,\/]/,eW:!0,c:[{cN:"type",b:e.UIR},e.CLCM,e.CBCM],r:0},e.CLCM,e.CBCM,c,s,a,e.CNM]},e.CBCM]},{cN:"class",bK:"class interface trait",e:/[:\{(]|$/,eE:!0,i:"extends implements",c:[{bK:"public protected internal private constructor"},e.UTM,{cN:"type",b://,eB:!0,eE:!0,r:0},{cN:"type",b:/[,:]\s*/,e:/[<\(,]|$/,eB:!0,rE:!0},c,s]},a,{cN:"meta",b:"^#!/usr/bin/env",e:"$",i:"\n"},e.CNM]}});hljs.registerLanguage("profile",function(e){return{c:[e.CNM,{b:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",e:":",eE:!0},{b:"(ncalls|tottime|cumtime)",e:"$",k:"ncalls tottime|10 cumtime|10 filename",r:10},{b:"function calls",e:"$",c:[e.CNM],r:10},e.ASM,e.QSM,{cN:"string",b:"\\(",e:"\\)$",eB:!0,eE:!0,r:0}]}});hljs.registerLanguage("cmake",function(e){return{aliases:["cmake.in"],cI:!0,k:{keyword:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or equal less greater strless strgreater strequal matches"},c:[{cN:"variable",b:"\\${",e:"}"},e.HCM,e.QSM,e.NM]}});hljs.registerLanguage("elm",function(e){var i={v:[e.C("--","$"),e.C("{-","-}",{c:["self"]})]},t={cN:"type",b:"\\b[A-Z][\\w']*",r:0},c={b:"\\(",e:"\\)",i:'"',c:[{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},i]},n={b:"{",e:"}",c:c.c};return{k:"let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription",c:[{bK:"port effect module",e:"exposing",k:"port effect module where command subscription exposing",c:[c,i],i:"\\W\\.|;"},{b:"import",e:"$",k:"import as exposing",c:[c,i],i:"\\W\\.|;"},{b:"type",e:"$",k:"type alias",c:[t,c,n,i]},{bK:"infix infixl infixr",e:"$",c:[e.CNM,i]},{b:"port",e:"$",k:"port",c:[i]},e.QSM,e.CNM,t,e.inherit(e.TM,{b:"^[_a-z][\\w']*"}),i,{b:"->|<-"}]}});hljs.registerLanguage("excel",function(E){return{aliases:["xlsx","xls"],cI:!0,l:/[a-zA-Z][\w\.]*/,k:{built_in:"ABS ACCRINT ACCRINTM ACOS ACOSH ACOT ACOTH AGGREGATE ADDRESS AMORDEGRC AMORLINC AND ARABIC AREAS ASC ASIN ASINH ATAN ATAN2 ATANH AVEDEV AVERAGE AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT BASE BESSELI BESSELJ BESSELK BESSELY BETADIST BETA.DIST BETAINV BETA.INV BIN2DEC BIN2HEX BIN2OCT BINOMDIST BINOM.DIST BINOM.DIST.RANGE BINOM.INV BITAND BITLSHIFT BITOR BITRSHIFT BITXOR CALL CEILING CEILING.MATH CEILING.PRECISE CELL CHAR CHIDIST CHIINV CHITEST CHISQ.DIST CHISQ.DIST.RT CHISQ.INV CHISQ.INV.RT CHISQ.TEST CHOOSE CLEAN CODE COLUMN COLUMNS COMBIN COMBINA COMPLEX CONCAT CONCATENATE CONFIDENCE CONFIDENCE.NORM CONFIDENCE.T CONVERT CORREL COS COSH COT COTH COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD COVAR COVARIANCE.P COVARIANCE.S CRITBINOM CSC CSCH CUBEKPIMEMBER CUBEMEMBER CUBEMEMBERPROPERTY CUBERANKEDMEMBER CUBESET CUBESETCOUNT CUBEVALUE CUMIPMT CUMPRINC DATE DATEDIF DATEVALUE DAVERAGE DAY DAYS DAYS360 DB DBCS DCOUNT DCOUNTA DDB DEC2BIN DEC2HEX DEC2OCT DECIMAL DEGREES DELTA DEVSQ DGET DISC DMAX DMIN DOLLAR DOLLARDE DOLLARFR DPRODUCT DSTDEV DSTDEVP DSUM DURATION DVAR DVARP EDATE EFFECT ENCODEURL EOMONTH ERF ERF.PRECISE ERFC ERFC.PRECISE ERROR.TYPE EUROCONVERT EVEN EXACT EXP EXPON.DIST EXPONDIST FACT FACTDOUBLE FALSE|0 F.DIST FDIST F.DIST.RT FILTERXML FIND FINDB F.INV F.INV.RT FINV FISHER FISHERINV FIXED FLOOR FLOOR.MATH FLOOR.PRECISE FORECAST FORECAST.ETS FORECAST.ETS.CONFINT FORECAST.ETS.SEASONALITY FORECAST.ETS.STAT FORECAST.LINEAR FORMULATEXT FREQUENCY F.TEST FTEST FV FVSCHEDULE GAMMA GAMMA.DIST GAMMADIST GAMMA.INV GAMMAINV GAMMALN GAMMALN.PRECISE GAUSS GCD GEOMEAN GESTEP GETPIVOTDATA GROWTH HARMEAN HEX2BIN HEX2DEC HEX2OCT HLOOKUP HOUR HYPERLINK HYPGEOM.DIST HYPGEOMDIST IF|0 IFERROR IFNA IFS IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMCOSH IMCOT IMCSC IMCSCH IMDIV IMEXP IMLN IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSEC IMSECH IMSIN IMSINH IMSQRT IMSUB IMSUM IMTAN INDEX INDIRECT INFO INT INTERCEPT INTRATE IPMT IRR ISBLANK ISERR ISERROR ISEVEN ISFORMULA ISLOGICAL ISNA ISNONTEXT ISNUMBER ISODD ISREF ISTEXT ISO.CEILING ISOWEEKNUM ISPMT JIS KURT LARGE LCM LEFT LEFTB LEN LENB LINEST LN LOG LOG10 LOGEST LOGINV LOGNORM.DIST LOGNORMDIST LOGNORM.INV LOOKUP LOWER MATCH MAX MAXA MAXIFS MDETERM MDURATION MEDIAN MID MIDBs MIN MINIFS MINA MINUTE MINVERSE MIRR MMULT MOD MODE MODE.MULT MODE.SNGL MONTH MROUND MULTINOMIAL MUNIT N NA NEGBINOM.DIST NEGBINOMDIST NETWORKDAYS NETWORKDAYS.INTL NOMINAL NORM.DIST NORMDIST NORMINV NORM.INV NORM.S.DIST NORMSDIST NORM.S.INV NORMSINV NOT NOW NPER NPV NUMBERVALUE OCT2BIN OCT2DEC OCT2HEX ODD ODDFPRICE ODDFYIELD ODDLPRICE ODDLYIELD OFFSET OR PDURATION PEARSON PERCENTILE.EXC PERCENTILE.INC PERCENTILE PERCENTRANK.EXC PERCENTRANK.INC PERCENTRANK PERMUT PERMUTATIONA PHI PHONETIC PI PMT POISSON.DIST POISSON POWER PPMT PRICE PRICEDISC PRICEMAT PROB PRODUCT PROPER PV QUARTILE QUARTILE.EXC QUARTILE.INC QUOTIENT RADIANS RAND RANDBETWEEN RANK.AVG RANK.EQ RANK RATE RECEIVED REGISTER.ID REPLACE REPLACEB REPT RIGHT RIGHTB ROMAN ROUND ROUNDDOWN ROUNDUP ROW ROWS RRI RSQ RTD SEARCH SEARCHB SEC SECH SECOND SERIESSUM SHEET SHEETS SIGN SIN SINH SKEW SKEW.P SLN SLOPE SMALL SQL.REQUEST SQRT SQRTPI STANDARDIZE STDEV STDEV.P STDEV.S STDEVA STDEVP STDEVPA STEYX SUBSTITUTE SUBTOTAL SUM SUMIF SUMIFS SUMPRODUCT SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 SWITCH SYD T TAN TANH TBILLEQ TBILLPRICE TBILLYIELD T.DIST T.DIST.2T T.DIST.RT TDIST TEXT TEXTJOIN TIME TIMEVALUE T.INV T.INV.2T TINV TODAY TRANSPOSE TREND TRIM TRIMMEAN TRUE|0 TRUNC T.TEST TTEST TYPE UNICHAR UNICODE UPPER VALUE VAR VAR.P VAR.S VARA VARP VARPA VDB VLOOKUP WEBSERVICE WEEKDAY WEEKNUM WEIBULL WEIBULL.DIST WORKDAY WORKDAY.INTL XIRR XNPV XOR YEAR YEARFRAC YIELD YIELDDISC YIELDMAT Z.TEST ZTEST"},c:[{b:/^=/,e:/[^=]/,rE:!0,i:/=/,r:10},{cN:"symbol",b:/\b[A-Z]{1,2}\d+\b/,e:/[^\d]/,eE:!0,r:0},{cN:"symbol",b:/[A-Z]{0,2}\d*:[A-Z]{0,2}\d*/,r:0},E.BE,E.QSM,{cN:"number",b:E.NR+"(%)?",r:0},E.C(/\bN\(/,/\)/,{eB:!0,eE:!0,i:/\n/})]}});hljs.registerLanguage("r",function(e){var r="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[e.HCM,{b:r,l:r,k:{keyword:"function if in break next repeat else for return switch while try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[e.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}}); \ No newline at end of file diff --git a/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css b/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css deleted file mode 100644 index a26fccec4..000000000 --- a/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css +++ /dev/null @@ -1,545 +0,0 @@ -.xdsoft_datetimepicker { - box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506); - background: #fff; - border-bottom: 1px solid #bbb; - border-left: 1px solid #ccc; - border-right: 1px solid #ccc; - border-top: 1px solid #ccc; - color: #333; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 8px; - padding-left: 0; - padding-top: 2px; - position: absolute; - z-index: 9999; - -moz-box-sizing: border-box; - box-sizing: border-box; - display: none; -} - -.xdsoft_datetimepicker iframe { - position: absolute; - left: 0; - top: 0; - width: 75px; - height: 210px; - background: transparent; - border: none; -} - -/*For IE8 or lower*/ -.xdsoft_datetimepicker button { - border: none !important; -} - -.xdsoft_noselect { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; -} - -.xdsoft_noselect::selection { background: transparent } -.xdsoft_noselect::-moz-selection { background: transparent } - -.xdsoft_datetimepicker.xdsoft_inline { - display: inline-block; - position: static; - box-shadow: none; -} - -.xdsoft_datetimepicker * { - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 0; - margin: 0; -} - -.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker { - display: none; -} - -.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active { - display: block; -} - -.xdsoft_datetimepicker .xdsoft_datepicker { - width: 224px; - float: left; - margin-left: 8px; -} - -.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker { - width: 256px; -} - -.xdsoft_datetimepicker .xdsoft_timepicker { - width: 58px; - float: left; - text-align: center; - margin-left: 8px; - margin-top: 0; -} - -.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker { - margin-top: 8px; - margin-bottom: 3px -} - -.xdsoft_datetimepicker .xdsoft_mounthpicker { - position: relative; - text-align: center; -} - -.xdsoft_datetimepicker .xdsoft_label i, -.xdsoft_datetimepicker .xdsoft_prev, -.xdsoft_datetimepicker .xdsoft_next, -.xdsoft_datetimepicker .xdsoft_today_button { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC); -} - -.xdsoft_datetimepicker .xdsoft_label i { - opacity: 0.5; - background-position: -92px -19px; - display: inline-block; - width: 9px; - height: 20px; - vertical-align: middle; -} - -.xdsoft_datetimepicker .xdsoft_prev { - float: left; - background-position: -20px 0; -} -.xdsoft_datetimepicker .xdsoft_today_button { - float: left; - background-position: -70px 0; - margin-left: 5px; -} - -.xdsoft_datetimepicker .xdsoft_next { - float: right; - background-position: 0 0; -} - -.xdsoft_datetimepicker .xdsoft_next, -.xdsoft_datetimepicker .xdsoft_prev , -.xdsoft_datetimepicker .xdsoft_today_button { - background-color: transparent; - background-repeat: no-repeat; - border: 0 none; - cursor: pointer; - display: block; - height: 30px; - opacity: 0.5; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - outline: medium none; - overflow: hidden; - padding: 0; - position: relative; - text-indent: 100%; - white-space: nowrap; - width: 20px; - min-width: 0; -} - -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next { - float: none; - background-position: -40px -15px; - height: 15px; - width: 30px; - display: block; - margin-left: 14px; - margin-top: 7px; -} - -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev { - background-position: -40px 0; - margin-bottom: 7px; - margin-top: 0; -} - -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box { - height: 151px; - overflow: hidden; - border-bottom: 1px solid #ddd; -} - -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div { - background: #f5f5f5; - border-top: 1px solid #ddd; - color: #666; - font-size: 12px; - text-align: center; - border-collapse: collapse; - cursor: pointer; - border-bottom-width: 0; - height: 25px; - line-height: 25px; -} - -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child { - border-top-width: 0; -} - -.xdsoft_datetimepicker .xdsoft_today_button:hover, -.xdsoft_datetimepicker .xdsoft_next:hover, -.xdsoft_datetimepicker .xdsoft_prev:hover { - opacity: 1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; -} - -.xdsoft_datetimepicker .xdsoft_label { - display: inline; - position: relative; - z-index: 9999; - margin: 0; - padding: 5px 3px; - font-size: 14px; - line-height: 20px; - font-weight: bold; - background-color: #fff; - float: left; - width: 182px; - text-align: center; - cursor: pointer; -} - -.xdsoft_datetimepicker .xdsoft_label:hover>span { - text-decoration: underline; -} - -.xdsoft_datetimepicker .xdsoft_label:hover i { - opacity: 1.0; -} - -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select { - border: 1px solid #ccc; - position: absolute; - right: 0; - top: 30px; - z-index: 101; - display: none; - background: #fff; - max-height: 160px; - overflow-y: hidden; -} - -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px } -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px } -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover { - color: #fff; - background: #ff8000; -} - -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option { - padding: 2px 10px 2px 5px; - text-decoration: none !important; -} - -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current { - background: #33aaff; - box-shadow: #178fe5 0 1px 3px 0 inset; - color: #fff; - font-weight: 700; -} - -.xdsoft_datetimepicker .xdsoft_month { - width: 100px; - text-align: right; -} - -.xdsoft_datetimepicker .xdsoft_calendar { - clear: both; -} - -.xdsoft_datetimepicker .xdsoft_year{ - width: 48px; - margin-left: 5px; -} - -.xdsoft_datetimepicker .xdsoft_calendar table { - border-collapse: collapse; - width: 100%; - -} - -.xdsoft_datetimepicker .xdsoft_calendar td > div { - padding-right: 5px; -} - -.xdsoft_datetimepicker .xdsoft_calendar th { - height: 25px; -} - -.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th { - width: 14.2857142%; - background: #f5f5f5; - border: 1px solid #ddd; - color: #666; - font-size: 12px; - text-align: right; - vertical-align: middle; - padding: 0; - border-collapse: collapse; - cursor: pointer; - height: 25px; -} -.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th { - width: 12.5%; -} - -.xdsoft_datetimepicker .xdsoft_calendar th { - background: #f1f1f1; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today { - color: #33aaff; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default { - background: #ffe9d2; - box-shadow: #ffb871 0 1px 4px 0 inset; - color: #000; -} -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint { - background: #c1ffc9; - box-shadow: #00dd1c 0 1px 4px 0 inset; - color: #000; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default, -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current { - background: #33aaff; - box-shadow: #178fe5 0 1px 3px 0 inset; - color: #fff; - font-weight: 700; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month, -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled, -.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled { - opacity: 0.5; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - cursor: default; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled { - opacity: 0.2; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"; -} - -.xdsoft_datetimepicker .xdsoft_calendar td:hover, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover { - color: #fff !important; - background: #ff8000 !important; - box-shadow: none !important; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover { - background: #33aaff !important; - box-shadow: #178fe5 0 1px 3px 0 inset !important; - color: #fff !important; -} - -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover { - color: inherit !important; - background: inherit !important; - box-shadow: inherit !important; -} - -.xdsoft_datetimepicker .xdsoft_calendar th { - font-weight: 700; - text-align: center; - color: #999; - cursor: default; -} - -.xdsoft_datetimepicker .xdsoft_copyright { - color: #ccc !important; - font-size: 10px; - clear: both; - float: none; - margin-left: 8px; -} - -.xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important } -.xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important } - -.xdsoft_time_box { - position: relative; - border: 1px solid #ccc; -} -.xdsoft_scrollbar >.xdsoft_scroller { - background: #ccc !important; - height: 20px; - border-radius: 3px; -} -.xdsoft_scrollbar { - position: absolute; - width: 7px; - right: 0; - top: 0; - bottom: 0; - cursor: pointer; -} -.xdsoft_scroller_box { - position: relative; -} - -.xdsoft_datetimepicker.xdsoft_dark { - box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506); - background: #000; - border-bottom: 1px solid #444; - border-left: 1px solid #333; - border-right: 1px solid #333; - border-top: 1px solid #333; - color: #ccc; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box { - border-bottom: 1px solid #222; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div { - background: #0a0a0a; - border-top: 1px solid #222; - color: #999; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label { - background-color: #000; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select { - border: 1px solid #333; - background: #000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover { - color: #000; - background: #007fff; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current { - background: #cc5500; - box-shadow: #b03e00 0 1px 3px 0 inset; - color: #000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==); -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th { - background: #0a0a0a; - border: 1px solid #222; - color: #999; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th { - background: #0e0e0e; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today { - color: #cc5500; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default { - background: #ffe9d2; - box-shadow: #ffb871 0 1px 4px 0 inset; - color:#000; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint { - background: #c1ffc9; - box-shadow: #00dd1c 0 1px 4px 0 inset; - color:#000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current { - background: #cc5500; - box-shadow: #b03e00 0 1px 3px 0 inset; - color: #000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover { - color: #000 !important; - background: #007fff !important; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th { - color: #666; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright { color: #333 !important } -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a { color: #111 !important } -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover { color: #555 !important } - -.xdsoft_dark .xdsoft_time_box { - border: 1px solid #333; -} - -.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller { - background: #333 !important; -} -.xdsoft_datetimepicker .xdsoft_save_selected { - display: block; - border: 1px solid #dddddd !important; - margin-top: 5px; - width: 100%; - color: #454551; - font-size: 13px; -} -.xdsoft_datetimepicker .blue-gradient-button { - font-family: "museo-sans", "Book Antiqua", sans-serif; - font-size: 12px; - font-weight: 300; - color: #82878c; - height: 28px; - position: relative; - padding: 4px 17px 4px 33px; - border: 1px solid #d7d8da; - background: -moz-linear-gradient(top, #fff 0%, #f4f8fa 73%); - /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(73%, #f4f8fa)); - /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #fff 0%, #f4f8fa 73%); - /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #fff 0%, #f4f8fa 73%); - /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #fff 0%, #f4f8fa 73%); - /* IE10+ */ - background: linear-gradient(to bottom, #fff 0%, #f4f8fa 73%); - /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa',GradientType=0 ); -/* IE6-9 */ -} -.xdsoft_datetimepicker .blue-gradient-button:hover, .xdsoft_datetimepicker .blue-gradient-button:focus, .xdsoft_datetimepicker .blue-gradient-button:hover span, .xdsoft_datetimepicker .blue-gradient-button:focus span { - color: #454551; - background: -moz-linear-gradient(top, #f4f8fa 0%, #FFF 73%); - /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f8fa), color-stop(73%, #FFF)); - /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #f4f8fa 0%, #FFF 73%); - /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #f4f8fa 0%, #FFF 73%); - /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #f4f8fa 0%, #FFF 73%); - /* IE10+ */ - background: linear-gradient(to bottom, #f4f8fa 0%, #FFF 73%); - /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF',GradientType=0 ); - /* IE6-9 */ -} diff --git a/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js b/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js deleted file mode 100644 index 9c00413c2..000000000 --- a/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js +++ /dev/null @@ -1,2073 +0,0 @@ -/** - * @preserve jQuery DateTimePicker plugin v2.4.5 - * @homepage http://xdsoft.net/jqplugins/datetimepicker/ - * (c) 2014, Chupurnov Valeriy. - */ -/*global document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/ -(function ($) { - 'use strict'; - var default_options = { - i18n: { - ar: { // Arabic - months: [ - "كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول" - ], - dayOfWeek: [ - "ن", "ث", "ع", "خ", "ج", "س", "ح" - ] - }, - ro: { // Romanian - months: [ - "ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie" - ], - dayOfWeek: [ - "l", "ma", "mi", "j", "v", "s", "d" - ] - }, - id: { // Indonesian - months: [ - "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" - ], - dayOfWeek: [ - "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" - ] - }, - is: { // Icelandic - months: [ - "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember" - ], - dayOfWeek: [ - "Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau" - ] - }, - bg: { // Bulgarian - months: [ - "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември" - ], - dayOfWeek: [ - "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ] - }, - fa: { // Persian/Farsi - months: [ - 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند' - ], - dayOfWeek: [ - 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' - ] - }, - ru: { // Russian - months: [ - 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' - ], - dayOfWeek: [ - "Вск", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ] - }, - uk: { // Ukrainian - months: [ - 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень' - ], - dayOfWeek: [ - "Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт" - ] - }, - en: { // English - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - dayOfWeek: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ] - }, - el: { // Ελληνικά - months: [ - "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος" - ], - dayOfWeek: [ - "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ" - ] - }, - de: { // German - months: [ - 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' - ], - dayOfWeek: [ - "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" - ] - }, - nl: { // Dutch - months: [ - "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" - ], - dayOfWeek: [ - "zo", "ma", "di", "wo", "do", "vr", "za" - ] - }, - tr: { // Turkish - months: [ - "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık" - ], - dayOfWeek: [ - "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts" - ] - }, - fr: { //French - months: [ - "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" - ], - dayOfWeek: [ - "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" - ] - }, - es: { // Spanish - months: [ - "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" - ], - dayOfWeek: [ - "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" - ] - }, - th: { // Thai - months: [ - 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม' - ], - dayOfWeek: [ - 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.' - ] - }, - pl: { // Polish - months: [ - "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień" - ], - dayOfWeek: [ - "nd", "pn", "wt", "śr", "cz", "pt", "sb" - ] - }, - pt: { // Portuguese - months: [ - "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" - ], - dayOfWeek: [ - "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" - ] - }, - ch: { // Simplified Chinese - months: [ - "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" - ], - dayOfWeek: [ - "日", "一", "二", "三", "四", "五", "六" - ] - }, - se: { // Swedish - months: [ - "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör" - ] - }, - kr: { // Korean - months: [ - "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월" - ], - dayOfWeek: [ - "일", "월", "화", "수", "목", "금", "토" - ] - }, - it: { // Italian - months: [ - "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" - ], - dayOfWeek: [ - "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" - ] - }, - da: { // Dansk - months: [ - "January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" - ] - }, - no: { // Norwegian - months: [ - "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" - ], - dayOfWeek: [ - "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" - ] - }, - ja: { // Japanese - months: [ - "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" - ], - dayOfWeek: [ - "日", "月", "火", "水", "木", "金", "土" - ] - }, - vi: { // Vietnamese - months: [ - "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12" - ], - dayOfWeek: [ - "CN", "T2", "T3", "T4", "T5", "T6", "T7" - ] - }, - sl: { // Slovenščina - months: [ - "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob" - ] - }, - cs: { // Čeština - months: [ - "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec" - ], - dayOfWeek: [ - "Ne", "Po", "Út", "St", "Čt", "Pá", "So" - ] - }, - hu: { // Hungarian - months: [ - "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" - ], - dayOfWeek: [ - "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo" - ] - }, - az: { //Azerbaijanian (Azeri) - months: [ - "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" - ], - dayOfWeek: [ - "B", "Be", "Ça", "Ç", "Ca", "C", "Ş" - ] - }, - bs: { //Bosanski - months: [ - "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" - ], - dayOfWeek: [ - "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub" - ] - }, - ca: { //Català - months: [ - "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" - ], - dayOfWeek: [ - "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds" - ] - }, - 'en-GB': { //English (British) - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - dayOfWeek: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ] - }, - et: { //"Eesti" - months: [ - "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" - ], - dayOfWeek: [ - "P", "E", "T", "K", "N", "R", "L" - ] - }, - eu: { //Euskara - months: [ - "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua" - ], - dayOfWeek: [ - "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La." - ] - }, - fi: { //Finnish (Suomi) - months: [ - "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" - ], - dayOfWeek: [ - "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" - ] - }, - gl: { //Galego - months: [ - "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec" - ], - dayOfWeek: [ - "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab" - ] - }, - hr: { //Hrvatski - months: [ - "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" - ], - dayOfWeek: [ - "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub" - ] - }, - ko: { //Korean (한국어) - months: [ - "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월" - ], - dayOfWeek: [ - "일", "월", "화", "수", "목", "금", "토" - ] - }, - lt: { //Lithuanian (lietuvių) - months: [ - "Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio" - ], - dayOfWeek: [ - "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš" - ] - }, - lv: { //Latvian (Latviešu) - months: [ - "Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" - ], - dayOfWeek: [ - "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St" - ] - }, - mk: { //Macedonian (Македонски) - months: [ - "јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември" - ], - dayOfWeek: [ - "нед", "пон", "вто", "сре", "чет", "пет", "саб" - ] - }, - mn: { //Mongolian (Монгол) - months: [ - "1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар" - ], - dayOfWeek: [ - "Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням" - ] - }, - 'pt-BR': { //Português(Brasil) - months: [ - "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" - ], - dayOfWeek: [ - "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb" - ] - }, - sk: { //Slovenčina - months: [ - "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" - ], - dayOfWeek: [ - "Ne", "Po", "Ut", "St", "Št", "Pi", "So" - ] - }, - sq: { //Albanian (Shqip) - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - dayOfWeek: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ] - }, - 'sr-YU': { //Serbian (Srpski) - months: [ - "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" - ], - dayOfWeek: [ - "Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub" - ] - }, - sr: { //Serbian Cyrillic (Српски) - months: [ - "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар" - ], - dayOfWeek: [ - "нед", "пон", "уто", "сре", "чет", "пет", "суб" - ] - }, - sv: { //Svenska - months: [ - "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör" - ] - }, - 'zh-TW': { //Traditional Chinese (繁體中文) - months: [ - "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" - ], - dayOfWeek: [ - "日", "一", "二", "三", "四", "五", "六" - ] - }, - zh: { //Simplified Chinese (简体中文) - months: [ - "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" - ], - dayOfWeek: [ - "日", "一", "二", "三", "四", "五", "六" - ] - }, - he: { //Hebrew (עברית) - months: [ - 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר' - ], - dayOfWeek: [ - 'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת' - ] - }, - hy: { // Armenian - months: [ - "Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր" - ], - dayOfWeek: [ - "Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ" - ] - }, - kg: { // Kyrgyz - months: [ - 'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы' - ], - dayOfWeek: [ - "Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише" - ] - } - }, - value: '', - lang: 'en', - - format: 'Y/m/d H:i', - formatTime: 'H:i', - formatDate: 'Y/m/d', - - startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', - step: 60, - monthChangeSpinner: true, - - closeOnDateSelect: false, - closeOnTimeSelect: true, - closeOnWithoutClick: true, - closeOnInputClick: true, - - timepicker: true, - datepicker: true, - weeks: false, - - defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i') - defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05') - - minDate: false, - maxDate: false, - minTime: false, - maxTime: false, - disabledMinTime: false, - disabledMaxTime: false, - - allowTimes: [], - opened: false, - initTime: true, - inline: false, - theme: '', - - onSelectDate: function () {}, - onSelectTime: function () {}, - onChangeMonth: function () {}, - onChangeYear: function () {}, - onChangeDateTime: function () {}, - onShow: function () {}, - onClose: function () {}, - onGenerate: function () {}, - - withoutCopyright: true, - inverseButton: false, - hours12: false, - next: 'xdsoft_next', - prev : 'xdsoft_prev', - dayOfWeekStart: 0, - parentID: 'body', - timeHeightInTimePicker: 25, - timepickerScrollbar: true, - todayButton: true, - prevButton: true, - nextButton: true, - defaultSelect: true, - - scrollMonth: true, - scrollTime: true, - scrollInput: true, - - lazyInit: false, - mask: false, - validateOnBlur: true, - allowBlank: true, - yearStart: 1950, - yearEnd: 2050, - monthStart: 0, - monthEnd: 11, - style: '', - id: '', - fixed: false, - roundTime: 'round', // ceil, floor - className: '', - weekends: [], - highlightedDates: [], - highlightedPeriods: [], - disabledDates : [], - disabledWeekDays: [], - yearOffset: 0, - beforeShowDay: null, - - enterLikeTab: true, - showApplyButton: false - }; - // fix for ie8 - if (!window.getComputedStyle) { - window.getComputedStyle = function (el, pseudo) { - this.el = el; - this.getPropertyValue = function (prop) { - var re = /(\-([a-z]){1})/g; - if (prop === 'float') { - prop = 'styleFloat'; - } - if (re.test(prop)) { - prop = prop.replace(re, function (a, b, c) { - return c.toUpperCase(); - }); - } - return el.currentStyle[prop] || null; - }; - return this; - }; - } - if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (obj, start) { - var i, j; - for (i = (start || 0), j = this.length; i < j; i += 1) { - if (this[i] === obj) { return i; } - } - return -1; - }; - } - Date.prototype.countDaysInMonth = function () { - return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); - }; - $.fn.xdsoftScroller = function (percent) { - return this.each(function () { - var timeboxparent = $(this), - pointerEventToXY = function (e) { - var out = {x: 0, y: 0}, - touch; - if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { - touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; - out.x = touch.clientX; - out.y = touch.clientY; - } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') { - out.x = e.clientX; - out.y = e.clientY; - } - return out; - }, - move = 0, - timebox, - parentHeight, - height, - scrollbar, - scroller, - maximumOffset = 100, - start = false, - startY = 0, - startTop = 0, - h1 = 0, - touchStart = false, - startTopScroll = 0, - calcOffset = function () {}; - if (percent === 'hide') { - timeboxparent.find('.xdsoft_scrollbar').hide(); - return; - } - if (!$(this).hasClass('xdsoft_scroller_box')) { - timebox = timeboxparent.children().eq(0); - parentHeight = timeboxparent[0].clientHeight; - height = timebox[0].offsetHeight; - scrollbar = $('
    '); - scroller = $('
    '); - scrollbar.append(scroller); - - timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar); - calcOffset = function calcOffset(event) { - var offset = pointerEventToXY(event).y - startY + startTopScroll; - if (offset < 0) { - offset = 0; - } - if (offset + scroller[0].offsetHeight > h1) { - offset = h1 - scroller[0].offsetHeight; - } - timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]); - }; - - scroller - .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) { - if (!parentHeight) { - timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); - } - - startY = pointerEventToXY(event).y; - startTopScroll = parseInt(scroller.css('margin-top'), 10); - h1 = scrollbar[0].offsetHeight; - - if (event.type === 'mousedown') { - if (document) { - $(document.body).addClass('xdsoft_noselect'); - } - $([document.body, window]).on('mouseup.xdsoft_scroller', function arguments_callee() { - $([document.body, window]).off('mouseup.xdsoft_scroller', arguments_callee) - .off('mousemove.xdsoft_scroller', calcOffset) - .removeClass('xdsoft_noselect'); - }); - $(document.body).on('mousemove.xdsoft_scroller', calcOffset); - } else { - touchStart = true; - event.stopPropagation(); - event.preventDefault(); - } - }) - .on('touchmove', function (event) { - if (touchStart) { - event.preventDefault(); - calcOffset(event); - } - }) - .on('touchend touchcancel', function (event) { - touchStart = false; - startTopScroll = 0; - }); - - timeboxparent - .on('scroll_element.xdsoft_scroller', function (event, percentage) { - if (!parentHeight) { - timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]); - } - percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage; - - scroller.css('margin-top', maximumOffset * percentage); - - setTimeout(function () { - timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10)); - }, 10); - }) - .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) { - var percent, sh; - parentHeight = timeboxparent[0].clientHeight; - height = timebox[0].offsetHeight; - percent = parentHeight / height; - sh = percent * scrollbar[0].offsetHeight; - if (percent > 1) { - scroller.hide(); - } else { - scroller.show(); - scroller.css('height', parseInt(sh > 10 ? sh : 10, 10)); - maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight; - if (noTriggerScroll !== true) { - timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]); - } - } - }); - - timeboxparent.on('mousewheel', function (event) { - var top = Math.abs(parseInt(timebox.css('marginTop'), 10)); - - top = top - (event.deltaY * 20); - if (top < 0) { - top = 0; - } - - timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]); - event.stopPropagation(); - return false; - }); - - timeboxparent.on('touchstart', function (event) { - start = pointerEventToXY(event); - startTop = Math.abs(parseInt(timebox.css('marginTop'), 10)); - }); - - timeboxparent.on('touchmove', function (event) { - if (start) { - event.preventDefault(); - var coord = pointerEventToXY(event); - timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]); - } - }); - - timeboxparent.on('touchend touchcancel', function (event) { - start = false; - startTop = 0; - }); - } - timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); - }); - }; - - $.fn.datetimepicker = function (opt) { - var KEY0 = 48, - KEY9 = 57, - _KEY0 = 96, - _KEY9 = 105, - CTRLKEY = 17, - DEL = 46, - ENTER = 13, - ESC = 27, - BACKSPACE = 8, - ARROWLEFT = 37, - ARROWUP = 38, - ARROWRIGHT = 39, - ARROWDOWN = 40, - TAB = 9, - F5 = 116, - AKEY = 65, - CKEY = 67, - VKEY = 86, - ZKEY = 90, - YKEY = 89, - ctrlDown = false, - options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options), - - lazyInitTimer = 0, - createDateTimePicker, - destroyDateTimePicker, - - lazyInit = function (input) { - input - .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function initOnActionCallback(event) { - if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) { - return; - } - clearTimeout(lazyInitTimer); - lazyInitTimer = setTimeout(function () { - - if (!input.data('xdsoft_datetimepicker')) { - createDateTimePicker(input); - } - input - .off('open.xdsoft focusin.xdsoft mousedown.xdsoft', initOnActionCallback) - .trigger('open.xdsoft'); - }, 100); - }); - }; - - createDateTimePicker = function (input) { - var datetimepicker = $('
    '), - xdsoft_copyright = $(''), - datepicker = $('
    '), - mounth_picker = $('
    ' + - '
    ' + - '
    ' + - '
    '), - calendar = $('
    '), - timepicker = $('
    '), - timeboxparent = timepicker.find('.xdsoft_time_box').eq(0), - timebox = $('
    '), - applyButton = $(''), - /*scrollbar = $('
    '), - scroller = $('
    '),*/ - monthselect = $('
    '), - yearselect = $('
    '), - triggerAfterOpen = false, - XDSoft_datetime, - //scroll_element, - xchangeTimer, - timerclick, - current_time_index, - setPos, - timer = 0, - timer1 = 0, - _xdsoft_datetime; - - if (options.id) { - datetimepicker.attr('id', options.id); - } - if (options.style) { - datetimepicker.attr('style', options.style); - } - if (options.weeks) { - datetimepicker.addClass('xdsoft_showweeks'); - } - - datetimepicker.addClass('xdsoft_' + options.theme); - datetimepicker.addClass(options.className); - - mounth_picker - .find('.xdsoft_month span') - .after(monthselect); - mounth_picker - .find('.xdsoft_year span') - .after(yearselect); - - mounth_picker - .find('.xdsoft_month,.xdsoft_year') - .on('mousedown.xdsoft', function (event) { - var select = $(this).find('.xdsoft_select').eq(0), - val = 0, - top = 0, - visible = select.is(':visible'), - items, - i; - - mounth_picker - .find('.xdsoft_select') - .hide(); - if (_xdsoft_datetime.currentTime) { - val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear'](); - } - - select[visible ? 'hide' : 'show'](); - for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) { - if (items.eq(i).data('value') === val) { - break; - } else { - top += items[0].offsetHeight; - } - } - - select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight))); - event.stopPropagation(); - return false; - }); - - mounth_picker - .find('.xdsoft_select') - .xdsoftScroller() - .on('mousedown.xdsoft', function (event) { - event.stopPropagation(); - event.preventDefault(); - }) - .on('mousedown.xdsoft', '.xdsoft_option', function (event) { - - if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { - _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); - } - - var year = _xdsoft_datetime.currentTime.getFullYear(); - if (_xdsoft_datetime && _xdsoft_datetime.currentTime) { - _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value')); - } - - $(this).parent().parent().hide(); - - datetimepicker.trigger('xchange.xdsoft'); - if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { - options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - - if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { - options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - }); - - datetimepicker.setOptions = function (_options) { - var highlightedDates = {}, - getCaretPos = function (input) { - try { - if (document.selection && document.selection.createRange) { - var range = document.selection.createRange(); - return range.getBookmark().charCodeAt(2) - 2; - } - if (input.setSelectionRange) { - return input.selectionStart; - } - } catch (e) { - return 0; - } - }, - setCaretPos = function (node, pos) { - node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node; - if (!node) { - return false; - } - if (node.createTextRange) { - var textRange = node.createTextRange(); - textRange.collapse(true); - textRange.moveEnd('character', pos); - textRange.moveStart('character', pos); - textRange.select(); - return true; - } - if (node.setSelectionRange) { - node.setSelectionRange(pos, pos); - return true; - } - return false; - }, - isValidValue = function (mask, value) { - var reg = mask - .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1') - .replace(/_/g, '{digit+}') - .replace(/([0-9]{1})/g, '{digit$1}') - .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}') - .replace(/\{digit[\+]\}/g, '[0-9_]{1}'); - return (new RegExp(reg)).test(value); - }; - options = $.extend(true, {}, options, _options); - - if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) { - options.allowTimes = $.extend(true, [], _options.allowTimes); - } - - if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) { - options.weekends = $.extend(true, [], _options.weekends); - } - - if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) { - $.each(_options.highlightedDates, function (index, value) { - var splitData = $.map(value.split(','), $.trim), - exDesc, - hDate = new HighlightedDate(Date.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style - keyDate = hDate.date.dateFormat(options.formatDate); - if (highlightedDates[keyDate] !== undefined) { - exDesc = highlightedDates[keyDate].desc; - if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { - highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; - } - } else { - highlightedDates[keyDate] = hDate; - } - }); - - options.highlightedDates = $.extend(true, [], highlightedDates); - } - - if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) { - highlightedDates = $.extend(true, [], options.highlightedDates); - $.each(_options.highlightedPeriods, function (index, value) { - var splitData = $.map(value.split(','), $.trim), - dateTest = Date.parseDate(splitData[0], options.formatDate), // start date - dateEnd = Date.parseDate(splitData[1], options.formatDate), - desc = splitData[2], - hDate, - keyDate, - exDesc, - style = splitData[3]; - - while (dateTest <= dateEnd) { - hDate = new HighlightedDate(dateTest, desc, style); - keyDate = dateTest.dateFormat(options.formatDate); - dateTest.setDate(dateTest.getDate() + 1); - if (highlightedDates[keyDate] !== undefined) { - exDesc = highlightedDates[keyDate].desc; - if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { - highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; - } - } else { - highlightedDates[keyDate] = hDate; - } - } - }); - - options.highlightedDates = $.extend(true, [], highlightedDates); - } - - if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) { - options.disabledDates = $.extend(true, [], _options.disabledDates); - } - - if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) { - options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays); - } - - if ((options.open || options.opened) && (!options.inline)) { - input.trigger('open.xdsoft'); - } - - if (options.inline) { - triggerAfterOpen = true; - datetimepicker.addClass('xdsoft_inline'); - input.after(datetimepicker).hide(); - } - - if (options.inverseButton) { - options.next = 'xdsoft_prev'; - options.prev = 'xdsoft_next'; - } - - if (options.datepicker) { - datepicker.addClass('active'); - } else { - datepicker.removeClass('active'); - } - - if (options.timepicker) { - timepicker.addClass('active'); - } else { - timepicker.removeClass('active'); - } - - if (options.value) { - _xdsoft_datetime.setCurrentTime(options.value); - if (input && input.val) { - input.val(_xdsoft_datetime.str); - } - } - - if (isNaN(options.dayOfWeekStart)) { - options.dayOfWeekStart = 0; - } else { - options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7; - } - - if (!options.timepickerScrollbar) { - timeboxparent.xdsoftScroller('hide'); - } - - if (options.minDate && /^-(.*)$/.test(options.minDate)) { - options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat(options.formatDate); - } - - if (options.maxDate && /^\+(.*)$/.test(options.maxDate)) { - options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat(options.formatDate); - } - - applyButton.toggle(options.showApplyButton); - - mounth_picker - .find('.xdsoft_today_button') - .css('visibility', !options.todayButton ? 'hidden' : 'visible'); - - mounth_picker - .find('.' + options.prev) - .css('visibility', !options.prevButton ? 'hidden' : 'visible'); - - mounth_picker - .find('.' + options.next) - .css('visibility', !options.nextButton ? 'hidden' : 'visible'); - - if (options.mask) { - input.off('keydown.xdsoft'); - - if (options.mask === true) { - options.mask = options.format - .replace(/Y/g, '9999') - .replace(/F/g, '9999') - .replace(/m/g, '19') - .replace(/d/g, '39') - .replace(/H/g, '29') - .replace(/i/g, '59') - .replace(/s/g, '59'); - } - - if ($.type(options.mask) === 'string') { - if (!isValidValue(options.mask, input.val())) { - input.val(options.mask.replace(/[0-9]/g, '_')); - } - - input.on('keydown.xdsoft', function (event) { - var val = this.value, - key = event.which, - pos, - digit; - - if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) { - pos = getCaretPos(this); - digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_'; - - if ((key === BACKSPACE || key === DEL) && pos) { - pos -= 1; - digit = '_'; - } - - while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { - pos += (key === BACKSPACE || key === DEL) ? -1 : 1; - } - - val = val.substr(0, pos) + digit + val.substr(pos + 1); - if ($.trim(val) === '') { - val = options.mask.replace(/[0-9]/g, '_'); - } else { - if (pos === options.mask.length) { - event.preventDefault(); - return false; - } - } - - pos += (key === BACKSPACE || key === DEL) ? 0 : 1; - while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { - pos += (key === BACKSPACE || key === DEL) ? -1 : 1; - } - - if (isValidValue(options.mask, val)) { - this.value = val; - setCaretPos(this, pos); - } else if ($.trim(val) === '') { - this.value = options.mask.replace(/[0-9]/g, '_'); - } else { - input.trigger('error_input.xdsoft'); - } - } else { - if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) { - return true; - } - } - - event.preventDefault(); - return false; - }); - } - } - if (options.validateOnBlur) { - input - .off('blur.xdsoft') - .on('blur.xdsoft', function () { - if (options.allowBlank && !$.trim($(this).val()).length) { - $(this).val(null); - datetimepicker.data('xdsoft_datetime').empty(); - } else if (!Date.parseDate($(this).val(), options.format)) { - var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')), - splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join('')); - - // parse the numbers as 0312 => 03:12 - if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) { - $(this).val([splittedHours, splittedMinutes].map(function (item) { - return item > 9 ? item : '0' + item; - }).join(':')); - } else { - $(this).val((_xdsoft_datetime.now()).dateFormat(options.format)); - } - - datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); - } else { - datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); - } - - datetimepicker.trigger('changedatetime.xdsoft'); - }); - } - options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1; - - datetimepicker - .trigger('xchange.xdsoft') - .trigger('afterOpen.xdsoft'); - }; - - datetimepicker - .data('options', options) - .on('mousedown.xdsoft', function (event) { - event.stopPropagation(); - event.preventDefault(); - yearselect.hide(); - monthselect.hide(); - return false; - }); - - //scroll_element = timepicker.find('.xdsoft_time_box'); - timeboxparent.append(timebox); - timeboxparent.xdsoftScroller(); - - datetimepicker.on('afterOpen.xdsoft', function () { - timeboxparent.xdsoftScroller(); - }); - - datetimepicker - .append(datepicker) - .append(timepicker); - - if (options.withoutCopyright !== true) { - datetimepicker - .append(xdsoft_copyright); - } - - datepicker - .append(mounth_picker) - .append(calendar) - .append(applyButton); - - $(options.parentID) - .append(datetimepicker); - - XDSoft_datetime = function () { - var _this = this; - _this.now = function (norecursion) { - var d = new Date(), - date, - time; - - if (!norecursion && options.defaultDate) { - date = _this.strToDateTime(options.defaultDate); - d.setFullYear(date.getFullYear()); - d.setMonth(date.getMonth()); - d.setDate(date.getDate()); - } - - if (options.yearOffset) { - d.setFullYear(d.getFullYear() + options.yearOffset); - } - - if (!norecursion && options.defaultTime) { - time = _this.strtotime(options.defaultTime); - d.setHours(time.getHours()); - d.setMinutes(time.getMinutes()); - } - return d; - }; - - _this.isValidDate = function (d) { - if (Object.prototype.toString.call(d) !== "[object Date]") { - return false; - } - return !isNaN(d.getTime()); - }; - - _this.setCurrentTime = function (dTime) { - _this.currentTime = (typeof dTime === 'string') ? _this.strToDateTime(dTime) : _this.isValidDate(dTime) ? dTime : _this.now(); - datetimepicker.trigger('xchange.xdsoft'); - }; - - _this.empty = function () { - _this.currentTime = null; - }; - - _this.getCurrentTime = function (dTime) { - return _this.currentTime; - }; - - _this.nextMonth = function () { - - if (_this.currentTime === undefined || _this.currentTime === null) { - _this.currentTime = _this.now(); - } - - var month = _this.currentTime.getMonth() + 1, - year; - if (month === 12) { - _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1); - month = 0; - } - - year = _this.currentTime.getFullYear(); - - _this.currentTime.setDate( - Math.min( - new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), - _this.currentTime.getDate() - ) - ); - _this.currentTime.setMonth(month); - - if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { - options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - - if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { - options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - - datetimepicker.trigger('xchange.xdsoft'); - return month; - }; - - _this.prevMonth = function () { - - if (_this.currentTime === undefined || _this.currentTime === null) { - _this.currentTime = _this.now(); - } - - var month = _this.currentTime.getMonth() - 1; - if (month === -1) { - _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1); - month = 11; - } - _this.currentTime.setDate( - Math.min( - new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), - _this.currentTime.getDate() - ) - ); - _this.currentTime.setMonth(month); - if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { - options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - datetimepicker.trigger('xchange.xdsoft'); - return month; - }; - - _this.getWeekOfYear = function (datetime) { - var onejan = new Date(datetime.getFullYear(), 0, 1); - return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); - }; - - _this.strToDateTime = function (sDateTime) { - var tmpDate = [], timeOffset, currentTime; - - if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) { - return sDateTime; - } - - tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime); - if (tmpDate) { - tmpDate[2] = Date.parseDate(tmpDate[2], options.formatDate); - } - if (tmpDate && tmpDate[2]) { - timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; - currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); - } else { - currentTime = sDateTime ? Date.parseDate(sDateTime, options.format) : _this.now(); - } - - if (!_this.isValidDate(currentTime)) { - currentTime = _this.now(); - } - - return currentTime; - }; - - _this.strToDate = function (sDate) { - if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) { - return sDate; - } - - var currentTime = sDate ? Date.parseDate(sDate, options.formatDate) : _this.now(true); - if (!_this.isValidDate(currentTime)) { - currentTime = _this.now(true); - } - return currentTime; - }; - - _this.strtotime = function (sTime) { - if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) { - return sTime; - } - var currentTime = sTime ? Date.parseDate(sTime, options.formatTime) : _this.now(true); - if (!_this.isValidDate(currentTime)) { - currentTime = _this.now(true); - } - return currentTime; - }; - - _this.str = function () { - return _this.currentTime.dateFormat(options.format); - }; - _this.currentTime = this.now(); - }; - - _xdsoft_datetime = new XDSoft_datetime(); - - applyButton.on('click', function (e) {//pathbrite - e.preventDefault(); - datetimepicker.data('changed', true); - _xdsoft_datetime.setCurrentTime(getCurrentValue()); - input.val(_xdsoft_datetime.str()); - datetimepicker.trigger('close.xdsoft'); - }); - mounth_picker - .find('.xdsoft_today_button') - .on('mousedown.xdsoft', function () { - datetimepicker.data('changed', true); - _xdsoft_datetime.setCurrentTime(0); - datetimepicker.trigger('afterOpen.xdsoft'); - }).on('dblclick.xdsoft', function () { - var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate; - currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()); - minDate = _xdsoft_datetime.strToDate(options.minDate); - minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); - if (currentDate < minDate) { - return; - } - maxDate = _xdsoft_datetime.strToDate(options.maxDate); - maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()); - if (currentDate > maxDate) { - return; - } - input.val(_xdsoft_datetime.str()); - datetimepicker.trigger('close.xdsoft'); - }); - mounth_picker - .find('.xdsoft_prev,.xdsoft_next') - .on('mousedown.xdsoft', function () { - var $this = $(this), - timer = 0, - stop = false; - - (function arguments_callee1(v) { - if ($this.hasClass(options.next)) { - _xdsoft_datetime.nextMonth(); - } else if ($this.hasClass(options.prev)) { - _xdsoft_datetime.prevMonth(); - } - if (options.monthChangeSpinner) { - if (!stop) { - timer = setTimeout(arguments_callee1, v || 100); - } - } - }(500)); - - $([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() { - clearTimeout(timer); - stop = true; - $([document.body, window]).off('mouseup.xdsoft', arguments_callee2); - }); - }); - - timepicker - .find('.xdsoft_prev,.xdsoft_next') - .on('mousedown.xdsoft', function () { - var $this = $(this), - timer = 0, - stop = false, - period = 110; - (function arguments_callee4(v) { - var pheight = timeboxparent[0].clientHeight, - height = timebox[0].offsetHeight, - top = Math.abs(parseInt(timebox.css('marginTop'), 10)); - if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) { - timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px'); - } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) { - timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px'); - } - timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox.css('marginTop'), 10) / (height - pheight))]); - period = (period > 10) ? 10 : period - 10; - if (!stop) { - timer = setTimeout(arguments_callee4, v || period); - } - }(500)); - $([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() { - clearTimeout(timer); - stop = true; - $([document.body, window]) - .off('mouseup.xdsoft', arguments_callee5); - }); - }); - - xchangeTimer = 0; - // base handler - generating a calendar and timepicker - datetimepicker - .on('xchange.xdsoft', function (event) { - clearTimeout(xchangeTimer); - xchangeTimer = setTimeout(function () { - - if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { - _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); - } - - var table = '', - start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0), - i = 0, - j, - today = _xdsoft_datetime.now(), - maxDate = false, - minDate = false, - hDate, - day, - d, - y, - m, - w, - classes = [], - customDateSettings, - newRow = true, - time = '', - h = '', - line_time, - description; - - while (start.getDay() !== options.dayOfWeekStart) { - start.setDate(start.getDate() - 1); - } - - table += '
  • '; - - if (options.weeks) { - table += ''; - } - - for (j = 0; j < 7; j += 1) { - table += ''; - } - - table += ''; - table += ''; - - if (options.maxDate !== false) { - maxDate = _xdsoft_datetime.strToDate(options.maxDate); - maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999); - } - - if (options.minDate !== false) { - minDate = _xdsoft_datetime.strToDate(options.minDate); - minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); - } - - while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { - classes = []; - i += 1; - - day = start.getDay(); - d = start.getDate(); - y = start.getFullYear(); - m = start.getMonth(); - w = _xdsoft_datetime.getWeekOfYear(start); - description = ''; - - classes.push('xdsoft_date'); - - if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) { - customDateSettings = options.beforeShowDay.call(datetimepicker, start); - } else { - customDateSettings = null; - } - - if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) { - classes.push('xdsoft_disabled'); - } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) { - classes.push('xdsoft_disabled'); - } else if (options.disabledWeekDays.indexOf(day) !== -1) { - classes.push('xdsoft_disabled'); - } - - if (customDateSettings && customDateSettings[1] !== "") { - classes.push(customDateSettings[1]); - } - - if (_xdsoft_datetime.currentTime.getMonth() !== m) { - classes.push('xdsoft_other_month'); - } - - if ((options.defaultSelect || datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) { - classes.push('xdsoft_current'); - } - - if (today.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) { - classes.push('xdsoft_today'); - } - - if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(start.dateFormat(options.formatDate)) !== -1) { - classes.push('xdsoft_weekend'); - } - - if (options.highlightedDates[start.dateFormat(options.formatDate)] !== undefined) { - hDate = options.highlightedDates[start.dateFormat(options.formatDate)]; - classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style); - description = hDate.desc === undefined ? '' : hDate.desc; - } - - if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) { - classes.push(options.beforeShowDay(start)); - } - - if (newRow) { - table += ''; - newRow = false; - if (options.weeks) { - table += ''; - } - } - - table += ''; - - if (start.getDay() === options.dayOfWeekStartPrev) { - table += ''; - newRow = true; - } - - start.setDate(d + 1); - } - table += '
    ' + options.i18n[options.lang].dayOfWeek[(j + options.dayOfWeekStart) % 7] + '
    ' + w + '' + - '
    ' + d + '
    ' + - '
    '; - - calendar.html(table); - - mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[options.lang].months[_xdsoft_datetime.currentTime.getMonth()]); - mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear()); - - // generate timebox - time = ''; - h = ''; - m = ''; - line_time = function line_time(h, m) { - var now = _xdsoft_datetime.now(), optionDateTime, current_time; - now.setHours(h); - h = parseInt(now.getHours(), 10); - now.setMinutes(m); - m = parseInt(now.getMinutes(), 10); - optionDateTime = new Date(_xdsoft_datetime.currentTime); - optionDateTime.setHours(h); - optionDateTime.setMinutes(m); - classes = []; - if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) { - classes.push('xdsoft_disabled'); - } - if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) { - classes.push('xdsoft_disabled'); - } - - current_time = new Date(_xdsoft_datetime.currentTime); - current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10)); - current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step); - - if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && (options.step > 59 || current_time.getMinutes() === parseInt(m, 10))) { - if (options.defaultSelect || datetimepicker.data('changed')) { - classes.push('xdsoft_current'); - } else if (options.initTime) { - classes.push('xdsoft_init_time'); - } - } - if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) { - classes.push('xdsoft_today'); - } - time += '
    ' + now.dateFormat(options.formatTime) + '
    '; - }; - - if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) { - for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) { - for (j = 0; j < 60; j += options.step) { - h = (i < 10 ? '0' : '') + i; - m = (j < 10 ? '0' : '') + j; - line_time(h, m); - } - } - } else { - for (i = 0; i < options.allowTimes.length; i += 1) { - h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours(); - m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes(); - line_time(h, m); - } - } - - timebox.html(time); - - opt = ''; - i = 0; - - for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) { - opt += '
    ' + i + '
    '; - } - yearselect.children().eq(0) - .html(opt); - - for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) { - opt += '
    ' + options.i18n[options.lang].months[i] + '
    '; - } - monthselect.children().eq(0).html(opt); - $(datetimepicker) - .trigger('generate.xdsoft'); - }, 10); - event.stopPropagation(); - }) - .on('afterOpen.xdsoft', function () { - if (options.timepicker) { - var classType, pheight, height, top; - if (timebox.find('.xdsoft_current').length) { - classType = '.xdsoft_current'; - } else if (timebox.find('.xdsoft_init_time').length) { - classType = '.xdsoft_init_time'; - } - if (classType) { - pheight = timeboxparent[0].clientHeight; - height = timebox[0].offsetHeight; - top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1; - if ((height - pheight) < top) { - top = height - pheight; - } - timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]); - } else { - timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]); - } - } - }); - - timerclick = 0; - calendar - .on('click.xdsoft', 'td', function (xdevent) { - xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap - timerclick += 1; - var $this = $(this), - currentTime = _xdsoft_datetime.currentTime; - - if (currentTime === undefined || currentTime === null) { - _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); - currentTime = _xdsoft_datetime.currentTime; - } - - if ($this.hasClass('xdsoft_disabled')) { - return false; - } - - currentTime.setDate(1); - currentTime.setFullYear($this.data('year')); - currentTime.setMonth($this.data('month')); - currentTime.setDate($this.data('date')); - - datetimepicker.trigger('select.xdsoft', [currentTime]); - - input.val(_xdsoft_datetime.str()); - if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) { - datetimepicker.trigger('close.xdsoft'); - } - - if (options.onSelectDate && $.isFunction(options.onSelectDate)) { - options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); - } - - datetimepicker.data('changed', true); - datetimepicker.trigger('xchange.xdsoft'); - datetimepicker.trigger('changedatetime.xdsoft'); - setTimeout(function () { - timerclick = 0; - }, 200); - }); - - timebox - .on('click.xdsoft', 'div', function (xdevent) { - xdevent.stopPropagation(); - var $this = $(this), - currentTime = _xdsoft_datetime.currentTime; - - if (currentTime === undefined || currentTime === null) { - _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); - currentTime = _xdsoft_datetime.currentTime; - } - - if ($this.hasClass('xdsoft_disabled')) { - return false; - } - currentTime.setHours($this.data('hour')); - currentTime.setMinutes($this.data('minute')); - datetimepicker.trigger('select.xdsoft', [currentTime]); - - datetimepicker.data('input').val(_xdsoft_datetime.str()); - - if (options.inline !== true && options.closeOnTimeSelect === true) { - datetimepicker.trigger('close.xdsoft'); - } - - if (options.onSelectTime && $.isFunction(options.onSelectTime)) { - options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); - } - datetimepicker.data('changed', true); - datetimepicker.trigger('xchange.xdsoft'); - datetimepicker.trigger('changedatetime.xdsoft'); - }); - - - datepicker - .on('mousewheel.xdsoft', function (event) { - if (!options.scrollMonth) { - return true; - } - if (event.deltaY < 0) { - _xdsoft_datetime.nextMonth(); - } else { - _xdsoft_datetime.prevMonth(); - } - return false; - }); - - input - .on('mousewheel.xdsoft', function (event) { - if (!options.scrollInput) { - return true; - } - if (!options.datepicker && options.timepicker) { - current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0; - if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) { - current_time_index += event.deltaY; - } - if (timebox.children().eq(current_time_index).length) { - timebox.children().eq(current_time_index).trigger('mousedown'); - } - return false; - } - if (options.datepicker && !options.timepicker) { - datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]); - if (input.val) { - input.val(_xdsoft_datetime.str()); - } - datetimepicker.trigger('changedatetime.xdsoft'); - return false; - } - }); - - datetimepicker - .on('changedatetime.xdsoft', function (event) { - if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) { - var $input = datetimepicker.data('input'); - options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event); - delete options.value; - $input.trigger('change'); - } - }) - .on('generate.xdsoft', function () { - if (options.onGenerate && $.isFunction(options.onGenerate)) { - options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - if (triggerAfterOpen) { - datetimepicker.trigger('afterOpen.xdsoft'); - triggerAfterOpen = false; - } - }) - .on('click.xdsoft', function (xdevent) { - xdevent.stopPropagation(); - }); - - current_time_index = 0; - - setPos = function () { - var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute", node; - if (options.fixed) { - top -= $(window).scrollTop(); - left -= $(window).scrollLeft(); - position = "fixed"; - } else { - if (top + datetimepicker[0].offsetHeight > $(window).height() + $(window).scrollTop()) { - top = offset.top - datetimepicker[0].offsetHeight + 1; - } - if (top < 0) { - top = 0; - } - if (left + datetimepicker[0].offsetWidth > $(window).width()) { - left = $(window).width() - datetimepicker[0].offsetWidth; - } - } - - node = datetimepicker[0]; - do { - node = node.parentNode; - if (window.getComputedStyle(node).getPropertyValue('position') === 'relative' && $(window).width() >= node.offsetWidth) { - left = left - (($(window).width() - node.offsetWidth) / 2); - break; - } - } while (node.nodeName !== 'HTML'); - datetimepicker.css({ - left: left, - top: top, - position: position - }); - }; - datetimepicker - .on('open.xdsoft', function (event) { - var onShow = true; - if (options.onShow && $.isFunction(options.onShow)) { - onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); - } - if (onShow !== false) { - datetimepicker.show(); - setPos(); - $(window) - .off('resize.xdsoft', setPos) - .on('resize.xdsoft', setPos); - - if (options.closeOnWithoutClick) { - $([document.body, window]).on('mousedown.xdsoft', function arguments_callee6() { - datetimepicker.trigger('close.xdsoft'); - $([document.body, window]).off('mousedown.xdsoft', arguments_callee6); - }); - } - } - }) - .on('close.xdsoft', function (event) { - var onClose = true; - mounth_picker - .find('.xdsoft_month,.xdsoft_year') - .find('.xdsoft_select') - .hide(); - if (options.onClose && $.isFunction(options.onClose)) { - onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); - } - if (onClose !== false && !options.opened && !options.inline) { - datetimepicker.hide(); - } - event.stopPropagation(); - }) - .on('toggle.xdsoft', function (event) { - if (datetimepicker.is(':visible')) { - datetimepicker.trigger('close.xdsoft'); - } else { - datetimepicker.trigger('open.xdsoft'); - } - }) - .data('input', input); - - timer = 0; - timer1 = 0; - - datetimepicker.data('xdsoft_datetime', _xdsoft_datetime); - datetimepicker.setOptions(options); - - function getCurrentValue() { - var ct = false, time; - - if (options.startDate) { - ct = _xdsoft_datetime.strToDate(options.startDate); - } else { - ct = options.value || ((input && input.val && input.val()) ? input.val() : ''); - if (ct) { - ct = _xdsoft_datetime.strToDateTime(ct); - } else if (options.defaultDate) { - ct = _xdsoft_datetime.strToDateTime(options.defaultDate); - if (options.defaultTime) { - time = _xdsoft_datetime.strtotime(options.defaultTime); - ct.setHours(time.getHours()); - ct.setMinutes(time.getMinutes()); - } - } - } - - if (ct && _xdsoft_datetime.isValidDate(ct)) { - datetimepicker.data('changed', true); - } else { - ct = ''; - } - - return ct || 0; - } - - _xdsoft_datetime.setCurrentTime(getCurrentValue()); - - input - .data('xdsoft_datetimepicker', datetimepicker) - .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function (event) { - if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) { - return; - } - clearTimeout(timer); - timer = setTimeout(function () { - if (input.is(':disabled')) { - return; - } - - triggerAfterOpen = true; - _xdsoft_datetime.setCurrentTime(getCurrentValue()); - - datetimepicker.trigger('open.xdsoft'); - }, 100); - }) - .on('keydown.xdsoft', function (event) { - var val = this.value, elementSelector, - key = event.which; - if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { - elementSelector = $("input:visible,textarea:visible"); - datetimepicker.trigger('close.xdsoft'); - elementSelector.eq(elementSelector.index(this) + 1).focus(); - return false; - } - if ([TAB].indexOf(key) !== -1) { - datetimepicker.trigger('close.xdsoft'); - return true; - } - }); - }; - destroyDateTimePicker = function (input) { - var datetimepicker = input.data('xdsoft_datetimepicker'); - if (datetimepicker) { - datetimepicker.data('xdsoft_datetime', null); - datetimepicker.remove(); - input - .data('xdsoft_datetimepicker', null) - .off('.xdsoft'); - $(window).off('resize.xdsoft'); - $([window, document.body]).off('mousedown.xdsoft'); - if (input.unmousewheel) { - input.unmousewheel(); - } - } - }; - $(document) - .off('keydown.xdsoftctrl keyup.xdsoftctrl') - .on('keydown.xdsoftctrl', function (e) { - if (e.keyCode === CTRLKEY) { - ctrlDown = true; - } - }) - .on('keyup.xdsoftctrl', function (e) { - if (e.keyCode === CTRLKEY) { - ctrlDown = false; - } - }); - return this.each(function () { - var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input; - if (datetimepicker) { - if ($.type(opt) === 'string') { - switch (opt) { - case 'show': - $(this).select().focus(); - datetimepicker.trigger('open.xdsoft'); - break; - case 'hide': - datetimepicker.trigger('close.xdsoft'); - break; - case 'toggle': - datetimepicker.trigger('toggle.xdsoft'); - break; - case 'destroy': - destroyDateTimePicker($(this)); - break; - case 'reset': - this.value = this.defaultValue; - if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(Date.parseDate(this.value, options.format))) { - datetimepicker.data('changed', false); - } - datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value); - break; - case 'validate': - $input = datetimepicker.data('input'); - $input.trigger('blur.xdsoft'); - break; - } - } else { - datetimepicker - .setOptions(opt); - } - return 0; - } - if ($.type(opt) !== 'string') { - if (!options.lazyInit || options.open || options.inline) { - createDateTimePicker($(this)); - } else { - lazyInit($(this)); - } - } - }); - }; - $.fn.datetimepicker.defaults = default_options; -}(jQuery)); - -function HighlightedDate(date, desc, style) { - "use strict"; - this.date = date; - this.desc = desc; - this.style = style; -} - -(function () { - -/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) - * Licensed under the MIT License (LICENSE.txt). - * - * Version: 3.1.12 - * - * Requires: jQuery 1.2.2+ - */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); - -// Parse and Format Library -//http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/ -/* - * Copyright (C) 2004 Baron Schwartz - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, version 2.1. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - */ -Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var codePrefix="Date.prototype."+funcName+" = function() {return ";var code="";var special=false;var ch="";for(var i=0;i 0) {";var regex="";var special=false;var ch="";for(var i=0;i 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$",'i');eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b div { - position: absolute; - top: 0; - left: 0; - width: 8px; - height: 8px; - border-radius: 8px; - border: solid 2px white; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} - -.minicolors-picker { - position: absolute; - top: 0; - left: 0; - width: 18px; - height: 2px; - background: white; - border: solid 1px black; - margin-top: -2px; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} - -/* Swatches */ -.minicolors-swatches,.minicolors-swatches li { - margin: 0; - padding: 0; - list-style: none; - overflow: hidden; - position: absolute; - top: 157px; - left: 5px; -} - -.minicolors-swatches .minicolors-swatch { - position: relative; - float: left; - cursor: pointer; - margin:0 4px 0 0; -} - -.minicolors-with-opacity .minicolors-swatches .minicolors-swatch { - margin-right:7px; -} - -.minicolors-swatch.selected { - border-color:#000; -} - -/* Inline controls */ -.minicolors-inline { - display: inline-block; -} - -.minicolors-inline .minicolors-input { - display: none !important; -} - -.minicolors-inline .minicolors-panel { - position: relative; - top: auto; - left: auto; - box-shadow: none; - z-index: auto; - display: inline-block; -} - -/* Default theme */ -.minicolors-theme-default .minicolors-swatch { - top: 5px; - left: 5px; - width: 18px; - height: 18px; -} -.minicolors-theme-default .minicolors-swatches .minicolors-swatch { - top: 0; - left: 0; - width: 18px; - height: 18px; -} -.minicolors-theme-default .minicolors-swatches { - height: 20px; -} -.minicolors-theme-default.minicolors-position-right .minicolors-swatch { - left: auto; - right: 5px; -} -.minicolors-theme-default.minicolors { - width: auto; - display: inline-block; -} -.minicolors-theme-default .minicolors-input { - height: 20px; - width: auto; - display: inline-block; - padding-left: 26px; -} -.minicolors-theme-default.minicolors-position-right .minicolors-input { - padding-right: 26px; - padding-left: inherit; -} - -/* Bootstrap theme */ -.minicolors-theme-bootstrap .minicolors-swatch { - z-index: 2; - top: 3px; - left: 3px; - width: 28px; - height: 28px; - border-radius: 3px; -} -.minicolors-theme-bootstrap .minicolors-swatches .minicolors-swatch { - top: 0; - left: 0; - width: 20px; - height: 20px; -} -.minicolors-theme-bootstrap .minicolors-swatch-color { - border-radius: inherit; -} -.minicolors-theme-bootstrap.minicolors-position-right .minicolors-swatch { - left: auto; - right: 3px; -} -.minicolors-theme-bootstrap .minicolors-input { - float: none; - padding-left: 44px; -} -.minicolors-theme-bootstrap.minicolors-position-right .minicolors-input { - padding-right: 44px; - padding-left: 12px; -} -.minicolors-theme-bootstrap .minicolors-input.input-lg + .minicolors-swatch { - top: 4px; - left: 4px; - width: 37px; - height: 37px; - border-radius: 5px; -} -.minicolors-theme-bootstrap .minicolors-input.input-sm + .minicolors-swatch { - width: 24px; - height: 24px; -} -.input-group .minicolors-theme-bootstrap:not(:first-child) .minicolors-input { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} diff --git a/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js b/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js deleted file mode 100644 index 5e5d7c9e3..000000000 --- a/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * jQuery MiniColors: A tiny color picker built on jQuery - * - * Copyright: Cory LaViska for A Beautiful Site, LLC: http://www.abeautifulsite.net/ - * - * Contribute: https://github.com/claviska/jquery-minicolors - * - * @license: http://opensource.org/licenses/MIT - * - */ -!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){"use strict";function i(i,t){var o=$('
    '),a=$.minicolors.defaults,s=i.attr("data-opacity"),n;i.data("minicolors-initialized")||(t=$.extend(!0,{},a,t),o.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris",t.dataUris!==!0),void 0!==t.position&&$.each(t.position.split(" "),function(){o.addClass("minicolors-position-"+this)}),n="rgb"===t.format?t.opacity?"25":"20":t.keywords?"11":"7",i.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",t).prop("size",n).wrap(o).after('
    '),t.inline||(i.after(''),i.next(".minicolors-swatch").on("click",function(t){t.preventDefault(),i.focus()})),i.parent().find(".minicolors-panel").on("selectstart",function(){return!1}).end(),t.inline&&i.parent().addClass("minicolors-inline"),r(i,!1),i.data("minicolors-initialized",!0))}function t(i){var t=i.parent();i.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(i).remove()}function o(i){var t=i.parent(),o=t.find(".minicolors-panel"),s=i.data("minicolors-settings");!i.data("minicolors-initialized")||i.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus")||(a(),t.addClass("minicolors-focus"),o.stop(!0,!0).fadeIn(s.showSpeed,function(){s.show&&s.show.call(i.get(0))}))}function a(){$(".minicolors-focus").each(function(){var i=$(this),t=i.find(".minicolors-input"),o=i.find(".minicolors-panel"),a=t.data("minicolors-settings");o.fadeOut(a.hideSpeed,function(){a.hide&&a.hide.call(t.get(0)),i.removeClass("minicolors-focus")})})}function s(i,t,o){var a=i.parents(".minicolors").find(".minicolors-input"),s=a.data("minicolors-settings"),r=i.find("[class$=-picker]"),e=i.offset().left,c=i.offset().top,l=Math.round(t.pageX-e),h=Math.round(t.pageY-c),d=o?s.animationSpeed:0,u,p,g,m;t.originalEvent.changedTouches&&(l=t.originalEvent.changedTouches[0].pageX-e,h=t.originalEvent.changedTouches[0].pageY-c),0>l&&(l=0),0>h&&(h=0),l>i.width()&&(l=i.width()),h>i.height()&&(h=i.height()),i.parent().is(".minicolors-slider-wheel")&&r.parent().is(".minicolors-grid")&&(u=75-l,p=75-h,g=Math.sqrt(u*u+p*p),m=Math.atan2(p,u),0>m&&(m+=2*Math.PI),g>75&&(g=75,l=75-75*Math.cos(m),h=75-75*Math.sin(m)),l=Math.round(l),h=Math.round(h)),i.is(".minicolors-grid")?r.stop(!0).animate({top:h+"px",left:l+"px"},d,s.animationEasing,function(){n(a,i)}):r.stop(!0).animate({top:h+"px"},d,s.animationEasing,function(){n(a,i)})}function n(i,t){function o(i,t){var o,a;return i.length&&t?(o=i.offset().left,a=i.offset().top,{x:o-t.offset().left+i.outerWidth()/2,y:a-t.offset().top+i.outerHeight()/2}):null}var a,s,n,r,c,l,d,u=i.val(),p=i.attr("data-opacity"),m,f=i.parent(),v=i.data("minicolors-settings"),b=f.find(".minicolors-swatch"),y=f.find(".minicolors-grid"),C=f.find(".minicolors-slider"),M=f.find(".minicolors-opacity-slider"),x=y.find("[class$=-picker]"),I=C.find("[class$=-picker]"),S=M.find("[class$=-picker]"),z=o(x,y),F=o(I,C),j=o(S,M);if(t.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")){switch(v.control){case"wheel":r=y.width()/2-z.x,c=y.height()/2-z.y,l=Math.sqrt(r*r+c*c),d=Math.atan2(c,r),0>d&&(d+=2*Math.PI),l>75&&(l=75,z.x=69-75*Math.cos(d),z.y=69-75*Math.sin(d)),s=g(l/.75,0,100),a=g(180*d/Math.PI,0,360),n=g(100-Math.floor(F.y*(100/C.height())),0,100),u=w({h:a,s:s,b:n}),C.css("backgroundColor",w({h:a,s:s,b:100}));break;case"saturation":a=g(parseInt(z.x*(360/y.width()),10),0,360),s=g(100-Math.floor(F.y*(100/C.height())),0,100),n=g(100-Math.floor(z.y*(100/y.height())),0,100),u=w({h:a,s:s,b:n}),C.css("backgroundColor",w({h:a,s:100,b:n})),f.find(".minicolors-grid-inner").css("opacity",s/100);break;case"brightness":a=g(parseInt(z.x*(360/y.width()),10),0,360),s=g(100-Math.floor(z.y*(100/y.height())),0,100),n=g(100-Math.floor(F.y*(100/C.height())),0,100),u=w({h:a,s:s,b:n}),C.css("backgroundColor",w({h:a,s:s,b:100})),f.find(".minicolors-grid-inner").css("opacity",1-n/100);break;default:a=g(360-parseInt(F.y*(360/C.height()),10),0,360),s=g(Math.floor(z.x*(100/y.width())),0,100),n=g(100-Math.floor(z.y*(100/y.height())),0,100),u=w({h:a,s:s,b:n}),y.css("backgroundColor",w({h:a,s:100,b:100}))}if(p=v.opacity?parseFloat(1-j.y/M.height()).toFixed(2):1,v.opacity&&i.attr("data-opacity",p),"rgb"===v.format){var D=k(u),p=""===i.attr("data-opacity")?1:g(parseFloat(i.attr("data-opacity")).toFixed(2),0,1);(isNaN(p)||!v.opacity)&&(p=1),m=i.minicolors("rgbObject").a<=1&&D&&v.opacity?"rgba("+D.r+", "+D.g+", "+D.b+", "+parseFloat(p)+")":"rgb("+D.r+", "+D.g+", "+D.b+")"}else m=h(u,v.letterCase);i.val(m)}b.find("span").css({backgroundColor:u,opacity:p}),e(i,m,p)}function r(i,t){var o,a,s,n,r,c,l,v,y,M,k=i.parent(),x=i.data("minicolors-settings"),I=k.find(".minicolors-swatch"),S=k.find(".minicolors-grid"),z=k.find(".minicolors-slider"),F=k.find(".minicolors-opacity-slider"),j=S.find("[class$=-picker]"),D=z.find("[class$=-picker]"),T=F.find("[class$=-picker]");switch(m(i.val())?(o=b(i.val()),r=g(parseFloat(f(i.val())).toFixed(2),0,1),r&&i.attr("data-opacity",r)):o=h(d(i.val(),!0),x.letterCase),o||(o=h(p(x.defaultValue,!0),x.letterCase)),a=C(o),n=x.keywords?$.map(x.keywords.split(","),function(i){return $.trim(i.toLowerCase())}):[],c=""!==i.val()&&$.inArray(i.val().toLowerCase(),n)>-1?h(i.val()):m(i.val())?u(i.val()):o,t||i.val(c),x.opacity&&(s=""===i.attr("data-opacity")?1:g(parseFloat(i.attr("data-opacity")).toFixed(2),0,1),isNaN(s)&&(s=1),i.attr("data-opacity",s),I.find("span").css("opacity",s),v=g(F.height()-F.height()*s,0,F.height()),T.css("top",v+"px")),"transparent"===i.val().toLowerCase()&&I.find("span").css("opacity",0),I.find("span").css("backgroundColor",o),x.control){case"wheel":y=g(Math.ceil(.75*a.s),0,S.height()/2),M=a.h*Math.PI/180,l=g(75-Math.cos(M)*y,0,S.width()),v=g(75-Math.sin(M)*y,0,S.height()),j.css({top:v+"px",left:l+"px"}),v=150-a.b/(100/S.height()),""===o&&(v=0),D.css("top",v+"px"),z.css("backgroundColor",w({h:a.h,s:a.s,b:100}));break;case"saturation":l=g(5*a.h/12,0,150),v=g(S.height()-Math.ceil(a.b/(100/S.height())),0,S.height()),j.css({top:v+"px",left:l+"px"}),v=g(z.height()-a.s*(z.height()/100),0,z.height()),D.css("top",v+"px"),z.css("backgroundColor",w({h:a.h,s:100,b:a.b})),k.find(".minicolors-grid-inner").css("opacity",a.s/100);break;case"brightness":l=g(5*a.h/12,0,150),v=g(S.height()-Math.ceil(a.s/(100/S.height())),0,S.height()),j.css({top:v+"px",left:l+"px"}),v=g(z.height()-a.b*(z.height()/100),0,z.height()),D.css("top",v+"px"),z.css("backgroundColor",w({h:a.h,s:a.s,b:100})),k.find(".minicolors-grid-inner").css("opacity",1-a.b/100);break;default:l=g(Math.ceil(a.s/(100/S.width())),0,S.width()),v=g(S.height()-Math.ceil(a.b/(100/S.height())),0,S.height()),j.css({top:v+"px",left:l+"px"}),v=g(z.height()-a.h/(360/z.height()),0,z.height()),D.css("top",v+"px"),S.css("backgroundColor",w({h:a.h,s:100,b:100}))}i.data("minicolors-initialized")&&e(i,c,s)}function e(i,t,o){var a=i.data("minicolors-settings"),s=i.data("minicolors-lastChange");s&&s.value===t&&s.opacity===o||(i.data("minicolors-lastChange",{value:t,opacity:o}),a.change&&(a.changeDelay?(clearTimeout(i.data("minicolors-changeTimeout")),i.data("minicolors-changeTimeout",setTimeout(function(){a.change.call(i.get(0),t,o)},a.changeDelay))):a.change.call(i.get(0),t,o)),i.trigger("change").trigger("input"))}function c(i){var t=d($(i).val(),!0),o=k(t),a=$(i).attr("data-opacity");return o?(void 0!==a&&$.extend(o,{a:parseFloat(a)}),o):null}function l(i,t){var o=d($(i).val(),!0),a=k(o),s=$(i).attr("data-opacity");return a?(void 0===s&&(s=1),t?"rgba("+a.r+", "+a.g+", "+a.b+", "+parseFloat(s)+")":"rgb("+a.r+", "+a.g+", "+a.b+")"):null}function h(i,t){return"uppercase"===t?i.toUpperCase():i.toLowerCase()}function d(i,t){return i=i.replace(/^#/g,""),i.match(/^[A-F0-9]{3,6}/gi)?3!==i.length&&6!==i.length?"":(3===i.length&&t&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),"#"+i):""}function u(i,t){var o=i.replace(/[^\d,.]/g,""),a=o.split(","),s;return a[0]=g(parseInt(a[0],10),0,255),a[1]=g(parseInt(a[1],10),0,255),a[2]=g(parseInt(a[2],10),0,255),a[3]&&(a[3]=g(parseFloat(a[3],10),0,1)),t?{r:a[0],g:a[1],b:a[2],a:a[3]?a[3]:null}:"undefined"!=typeof a[3]&&a[3]<=1?"rgba("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")":"rgb("+a[0]+", "+a[1]+", "+a[2]+")"}function p(i,t){return m(i)?u(i):d(i,t)}function g(i,t,o){return t>i&&(i=t),i>o&&(i=o),i}function m(i){var t=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return t&&4===t.length?!0:!1}function f(i){var i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);return i&&6===i.length?i[4]:"1"}function v(i){var t={},o=Math.round(i.h),a=Math.round(255*i.s/100),s=Math.round(255*i.b/100);if(0===a)t.r=t.g=t.b=s;else{var n=s,r=(255-a)*s/255,e=(n-r)*(o%60)/60;360===o&&(o=0),60>o?(t.r=n,t.b=r,t.g=r+e):120>o?(t.g=n,t.b=r,t.r=n-e):180>o?(t.g=n,t.r=r,t.b=r+e):240>o?(t.b=n,t.r=r,t.g=n-e):300>o?(t.b=n,t.g=r,t.r=r+e):360>o?(t.r=n,t.g=r,t.b=n-e):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function b(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i),i&&4===i.length?"#"+("0"+parseInt(i[1],10).toString(16)).slice(-2)+("0"+parseInt(i[2],10).toString(16)).slice(-2)+("0"+parseInt(i[3],10).toString(16)).slice(-2):""}function y(i){var t=[i.r.toString(16),i.g.toString(16),i.b.toString(16)];return $.each(t,function(i,o){1===o.length&&(t[i]="0"+o)}),"#"+t.join("")}function w(i){return y(v(i))}function C(i){var t=M(k(i));return 0===t.s&&(t.h=360),t}function M(i){var t={h:0,s:0,b:0},o=Math.min(i.r,i.g,i.b),a=Math.max(i.r,i.g,i.b),s=a-o;return t.b=a,t.s=0!==a?255*s/a:0,0!==t.s?i.r===a?t.h=(i.g-i.b)/s:i.g===a?t.h=2+(i.b-i.r)/s:t.h=4+(i.r-i.g)/s:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function k(i){return i=parseInt(i.indexOf("#")>-1?i.substring(1):i,16),{r:i>>16,g:(65280&i)>>8,b:255&i}}$.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",dataUris:!0,defaultValue:"",format:"hex",hide:null,hideSpeed:100,inline:!1,keywords:"",letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default"}},$.extend($.fn,{minicolors:function(s,n){switch(s){case"destroy":return $(this).each(function(){t($(this))}),$(this);case"hide":return a(),$(this);case"opacity":return void 0===n?$(this).attr("data-opacity"):($(this).each(function(){r($(this).attr("data-opacity",n))}),$(this));case"rgbObject":return c($(this),"rgbaObject"===s);case"rgbString":case"rgbaString":return l($(this),"rgbaString"===s);case"settings":return void 0===n?$(this).data("minicolors-settings"):($(this).each(function(){var i=$(this).data("minicolors-settings")||{};t($(this)),$(this).minicolors($.extend(!0,i,n))}),$(this));case"show":return o($(this).eq(0)),$(this);case"value":return void 0===n?$(this).val():($(this).each(function(){"object"==typeof n?(n.opacity&&$(this).attr("data-opacity",g(n.opacity,0,1)),n.color&&$(this).val(n.color)):$(this).val(n),r($(this))}),$(this));default:return"create"!==s&&(n=s),$(this).each(function(){i($(this),n)}),$(this)}}}),$(document).on("mousedown.minicolors touchstart.minicolors",function(i){$(i.target).parents().add(i.target).hasClass("minicolors")||a()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(i){var t=$(this);i.preventDefault(),$(document).data("minicolors-target",t),s(t,i,!0)}).on("mousemove.minicolors touchmove.minicolors",function(i){var t=$(document).data("minicolors-target");t&&s(t,i)}).on("mouseup.minicolors touchend.minicolors",function(){$(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(i){var t=$(this).parent().find(".minicolors-input");i.preventDefault(),o(t)}).on("focus.minicolors",".minicolors-input",function(){var i=$(this);i.data("minicolors-initialized")&&o(i)}).on("blur.minicolors",".minicolors-input",function(){var i=$(this),t=i.data("minicolors-settings"),o,a,s,n,r;i.data("minicolors-initialized")&&(o=t.keywords?$.map(t.keywords.split(","),function(i){return $.trim(i.toLowerCase())}):[],""!==i.val()&&$.inArray(i.val().toLowerCase(),o)>-1?r=i.val():(m(i.val())?s=u(i.val(),!0):(a=d(i.val(),!0),s=a?k(a):null),r=null===s?t.defaultValue:"rgb"===t.format?u(t.opacity?"rgba("+s.r+","+s.g+","+s.b+","+i.attr("data-opacity")+")":"rgb("+s.r+","+s.g+","+s.b+")"):y(s)),n=t.opacity?i.attr("data-opacity"):1,"transparent"===r.toLowerCase()&&(n=0),i.closest(".minicolors").find(".minicolors-swatch > span").css("opacity",n),i.val(r),""===i.val()&&i.val(p(t.defaultValue,!0)),i.val(h(i.val(),t.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(i){var t=$(this);if(t.data("minicolors-initialized"))switch(i.keyCode){case 9:a();break;case 13:case 27:a(),t.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var i=$(this);i.data("minicolors-initialized")&&r(i,!0)}).on("paste.minicolors",".minicolors-input",function(){var i=$(this);i.data("minicolors-initialized")&&setTimeout(function(){r(i,!0)},1)})}); \ No newline at end of file diff --git a/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.png b/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.png deleted file mode 100644 index bccc2012a..000000000 Binary files a/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/LICENSE b/public/plugins/pdfjs-1.4.20/LICENSE deleted file mode 100644 index f433b1a53..000000000 --- a/public/plugins/pdfjs-1.4.20/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/public/plugins/pdfjs-1.4.20/build/pdf.js b/public/plugins/pdfjs-1.4.20/build/pdf.js deleted file mode 100644 index c8877d510..000000000 --- a/public/plugins/pdfjs-1.4.20/build/pdf.js +++ /dev/null @@ -1,10375 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* jshint globalstrict: false */ -/* umdutils ignore */ - -(function (root, factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { -define('pdfjs-dist/build/pdf', ['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { -factory((root.pdfjsDistBuildPdf = {})); - } -}(this, function (exports) { - // Use strict in our context only - users might not want it - 'use strict'; - -var pdfjsVersion = '1.4.20'; -var pdfjsBuild = 'b15f335'; - - var pdfjsFilePath = - typeof document !== 'undefined' && document.currentScript ? - document.currentScript.src : null; - - var pdfjsLibs = {}; - - (function pdfjsWrapper() { - - - -(function (root, factory) { - { - factory((root.pdfjsSharedGlobal = {})); - } -}(this, function (exports) { - - var globalScope = (typeof window !== 'undefined') ? window : - (typeof global !== 'undefined') ? global : - (typeof self !== 'undefined') ? self : this; - - var isWorker = (typeof window === 'undefined'); - - // The global PDFJS object exposes the API - // In production, it will be declared outside a global wrapper - // In development, it will be declared here - if (!globalScope.PDFJS) { - globalScope.PDFJS = {}; - } - - if (typeof pdfjsVersion !== 'undefined') { - globalScope.PDFJS.version = pdfjsVersion; - } - if (typeof pdfjsVersion !== 'undefined') { - globalScope.PDFJS.build = pdfjsBuild; - } - - globalScope.PDFJS.pdfBug = false; - - exports.globalScope = globalScope; - exports.isWorker = isWorker; - exports.PDFJS = globalScope.PDFJS; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayDOMUtils = {}), root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedGlobal) { - -var PDFJS = sharedGlobal.PDFJS; - -/** - * Optimised CSS custom property getter/setter. - * @class - */ -var CustomStyle = (function CustomStyleClosure() { - - // As noted on: http://www.zachstronaut.com/posts/2009/02/17/ - // animate-css-transforms-firefox-webkit.html - // in some versions of IE9 it is critical that ms appear in this list - // before Moz - var prefixes = ['ms', 'Moz', 'Webkit', 'O']; - var _cache = {}; - - function CustomStyle() {} - - CustomStyle.getProp = function get(propName, element) { - // check cache only when no element is given - if (arguments.length === 1 && typeof _cache[propName] === 'string') { - return _cache[propName]; - } - - element = element || document.documentElement; - var style = element.style, prefixed, uPropName; - - // test standard property first - if (typeof style[propName] === 'string') { - return (_cache[propName] = propName); - } - - // capitalize - uPropName = propName.charAt(0).toUpperCase() + propName.slice(1); - - // test vendor specific properties - for (var i = 0, l = prefixes.length; i < l; i++) { - prefixed = prefixes[i] + uPropName; - if (typeof style[prefixed] === 'string') { - return (_cache[propName] = prefixed); - } - } - - //if all fails then set to undefined - return (_cache[propName] = 'undefined'); - }; - - CustomStyle.setProp = function set(propName, element, str) { - var prop = this.getProp(propName); - if (prop !== 'undefined') { - element.style[prop] = str; - } - }; - - return CustomStyle; -})(); - -PDFJS.CustomStyle = CustomStyle; - -exports.CustomStyle = CustomStyle; -})); - - -(function (root, factory) { - { - factory((root.pdfjsSharedUtil = {}), root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedGlobal) { - -var PDFJS = sharedGlobal.PDFJS; -var globalScope = sharedGlobal.globalScope; - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- treated as warnings. -function deprecated(details) { - warn('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - return new URL(url, baseUrl).href; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -/** - * Adds various attributes (href, title, target, rel) to hyperlinks. - * @param {HTMLLinkElement} link - The link element. - * @param {Object} params - An object with the properties: - * @param {string} params.url - An absolute URL. - */ -function addLinkAttributes(link, params) { - var url = params && params.url; - link.href = link.title = (url ? removeNullCharacters(url) : ''); - - if (url) { - if (isExternalLinkTargetSet()) { - link.target = LinkTargetStringMap[PDFJS.externalLinkTarget]; - } - // Strip referrer from the URL. - link.rel = PDFJS.externalLinkRel; - } -} -PDFJS.addLinkAttributes = addLinkAttributes; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var LinkTarget = PDFJS.LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -function isExternalLinkTargetSet() { - if (PDFJS.openExternalLinksInNewWindow) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - if (PDFJS.externalLinkTarget === LinkTarget.NONE) { - PDFJS.externalLinkTarget = LinkTarget.BLANK; - } - // Reset the deprecated parameter, to suppress further warnings. - PDFJS.openExternalLinksInNewWindow = false; - } - switch (PDFJS.externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } - warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - PDFJS.externalLinkTarget = LinkTarget.NONE; - return false; -} -PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - -var NullCharactersRegExp = /\x00/g; - -function removeNullCharacters(str) { - if (typeof str !== 'string') { - warn('The argument for removeNullCharacters must be a string.'); - return str; - } - return str.replace(NullCharactersRegExp, ''); -} -PDFJS.removeNullCharacters = removeNullCharacters; - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - - // Lazy test if the userAgent support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -exports.Uint32ArrayView = Uint32ArrayView; - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - var ROMAN_NUMBER_MAP = [ - '', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', - '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', - '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX' - ]; - /** - * Converts positive integers to (upper case) Roman numerals. - * @param {integer} number - The number that should be converted. - * @param {boolean} lowerCase - Indicates if the result should be converted - * to lower case letters. The default is false. - * @return {string} The resulting Roman number. - */ - Util.toRoman = function Util_toRoman(number, lowerCase) { - assert(isInt(number) && number > 0, - 'The number should be a positive integer.'); - var pos, romanBuf = []; - // Thousands - while (number >= 1000) { - number -= 1000; - romanBuf.push('M'); - } - // Hundreds - pos = (number / 100) | 0; - number %= 100; - romanBuf.push(ROMAN_NUMBER_MAP[pos]); - // Tens - pos = (number / 10) | 0; - number %= 10; - romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); - // Ones - romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); - - var romanStr = romanBuf.join(''); - return (lowerCase ? romanStr.toLowerCase() : romanStr); - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isArray(v) { - return v instanceof Array; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - /* jshint ignore:start */ - - // feature detect for URL constructor - var hasWorkingUrl = false; - try { - if (typeof URL === 'function' && - typeof URL.prototype === 'object' && - ('origin' in URL.prototype)) { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } - } catch(e) { } - - if (hasWorkingUrl) - return; - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' == h) { - invalid.call(this) - } - // XXX - return h.toLowerCase() - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF = undefined, - ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message) - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' == c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' == this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF == c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c) - break loop; - } - break; - - case 'scheme data': - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' == c && '/' == input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue - } - break; - - case 'relative': - this._isRelative = true; - if ('file' != this._scheme) - this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' == c || '\\' == c) { - if ('\\' == c) - err('\\ is an invalid code point.'); - state = 'relative slash'; - } else if ('?' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1] - var nextNextC = input[cursor+2] - if ( - 'file' != this._scheme || !ALPHA.test(c) || - (nextC != ':' && nextC != '|') || - (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' == c || '\\' == c) { - if ('\\' == c) { - err('\\ is an invalid code point.'); - } - if ('file' == this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' == c) { - state = 'authority second slash'; - } else { - err("Expected '/', got: " + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' != c && '\\' != c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' == c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' == cp || '\n' == cp || '\r' == cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' == cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - (null !== this._password) ? this._password += tempC : this._username += tempC; - } - buffer = ''; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { - state = 'relative path'; - } else if (buffer.length == 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' == c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' == stateOverride) { - break loop; - } - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' != c && '\n' != c && '\r' != c) { - if ('[' == c) { - seenBracket = true; - } else if (']' == c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { - if ('' != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' == c) - err("'\\' not allowed in path."); - state = 'relative path'; - if ('/' != c && '\\' != c) { - continue; - } - break; - - case 'relative path': - if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) { - if ('\\' == c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' == buffer) { - this._path.pop(); - if ('/' != c && '\\' != c) { - this._path.push(''); - } - } else if ('.' == buffer && '/' != c && '\\' != c) { - this._path.push(''); - } else if ('.' != buffer) { - if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' != c && '\n' != c && '\r' != c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function jURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof jURL)) - base = new jURL(String(base)); - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) - return this._url; - - var authority = ''; - if ('' != this._username || null != this._password) { - authority = this._username + - (null != this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) - return; - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) - return; - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' == this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) - return; - this._query = '?'; - if ('?' == search[0]) - search = search.slice(1); - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' == this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) - return; - this._fragment = '#'; - if ('#' == hash[0]) - hash = hash.slice(1); - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = jURL; - /* jshint ignore:end */ -})(globalScope); - -exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; -exports.IDENTITY_MATRIX = IDENTITY_MATRIX; -exports.OPS = OPS; -exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; -exports.AnnotationBorderStyleType = AnnotationBorderStyleType; -exports.AnnotationFlag = AnnotationFlag; -exports.AnnotationType = AnnotationType; -exports.FontType = FontType; -exports.ImageKind = ImageKind; -exports.InvalidPDFException = InvalidPDFException; -exports.LinkTarget = LinkTarget; -exports.LinkTargetStringMap = LinkTargetStringMap; -exports.MessageHandler = MessageHandler; -exports.MissingDataException = MissingDataException; -exports.MissingPDFException = MissingPDFException; -exports.NotImplementedException = NotImplementedException; -exports.PasswordException = PasswordException; -exports.PasswordResponses = PasswordResponses; -exports.StatTimer = StatTimer; -exports.StreamType = StreamType; -exports.TextRenderingMode = TextRenderingMode; -exports.UnexpectedResponseException = UnexpectedResponseException; -exports.UnknownErrorException = UnknownErrorException; -exports.Util = Util; -exports.XRefParseException = XRefParseException; -exports.assert = assert; -exports.bytesToString = bytesToString; -exports.combineUrl = combineUrl; -exports.createPromiseCapability = createPromiseCapability; -exports.deprecated = deprecated; -exports.error = error; -exports.info = info; -exports.isArray = isArray; -exports.isArrayBuffer = isArrayBuffer; -exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; -exports.isExternalLinkTargetSet = isExternalLinkTargetSet; -exports.isInt = isInt; -exports.isNum = isNum; -exports.isString = isString; -exports.isValidUrl = isValidUrl; -exports.addLinkAttributes = addLinkAttributes; -exports.loadJpegStream = loadJpegStream; -exports.log2 = log2; -exports.readInt8 = readInt8; -exports.readUint16 = readUint16; -exports.readUint32 = readUint32; -exports.removeNullCharacters = removeNullCharacters; -exports.shadow = shadow; -exports.string32 = string32; -exports.stringToBytes = stringToBytes; -exports.stringToPDFString = stringToPDFString; -exports.stringToUTF8String = stringToUTF8String; -exports.utf8StringToString = utf8StringToString; -exports.warn = warn; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayAnnotationLayer = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils); - } -}(this, function (exports, sharedUtil, displayDOMUtils) { - -var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; -var AnnotationType = sharedUtil.AnnotationType; -var Util = sharedUtil.Util; -var addLinkAttributes = sharedUtil.addLinkAttributes; -var warn = sharedUtil.warn; -var CustomStyle = displayDOMUtils.CustomStyle; - -/** - * @typedef {Object} AnnotationElementParameters - * @property {Object} data - * @property {HTMLDivElement} layer - * @property {PDFPage} page - * @property {PageViewport} viewport - * @property {IPDFLinkService} linkService - */ - -/** - * @class - * @alias AnnotationElementFactory - */ -function AnnotationElementFactory() {} -AnnotationElementFactory.prototype = - /** @lends AnnotationElementFactory.prototype */ { - /** - * @param {AnnotationElementParameters} parameters - * @returns {AnnotationElement} - */ - create: function AnnotationElementFactory_create(parameters) { - var subtype = parameters.data.annotationType; - - switch (subtype) { - case AnnotationType.LINK: - return new LinkAnnotationElement(parameters); - - case AnnotationType.TEXT: - return new TextAnnotationElement(parameters); - - case AnnotationType.WIDGET: - return new WidgetAnnotationElement(parameters); - - case AnnotationType.POPUP: - return new PopupAnnotationElement(parameters); - - case AnnotationType.HIGHLIGHT: - return new HighlightAnnotationElement(parameters); - - case AnnotationType.UNDERLINE: - return new UnderlineAnnotationElement(parameters); - - case AnnotationType.SQUIGGLY: - return new SquigglyAnnotationElement(parameters); - - case AnnotationType.STRIKEOUT: - return new StrikeOutAnnotationElement(parameters); - - default: - throw new Error('Unimplemented annotation type "' + subtype + '"'); - } - } -}; - -/** - * @class - * @alias AnnotationElement - */ -var AnnotationElement = (function AnnotationElementClosure() { - function AnnotationElement(parameters) { - this.data = parameters.data; - this.layer = parameters.layer; - this.page = parameters.page; - this.viewport = parameters.viewport; - this.linkService = parameters.linkService; - - this.container = this._createContainer(); - } - - AnnotationElement.prototype = /** @lends AnnotationElement.prototype */ { - /** - * Create an empty container for the annotation's HTML element. - * - * @private - * @memberof AnnotationElement - * @returns {HTMLSectionElement} - */ - _createContainer: function AnnotationElement_createContainer() { - var data = this.data, page = this.page, viewport = this.viewport; - var container = document.createElement('section'); - var width = data.rect[2] - data.rect[0]; - var height = data.rect[3] - data.rect[1]; - - container.setAttribute('data-annotation-id', data.id); - - // Do *not* modify `data.rect`, since that will corrupt the annotation - // position on subsequent calls to `_createContainer` (see issue 6804). - var rect = Util.normalizeRect([ - data.rect[0], - page.view[3] - data.rect[1] + page.view[1], - data.rect[2], - page.view[3] - data.rect[3] + page.view[1] - ]); - - CustomStyle.setProp('transform', container, - 'matrix(' + viewport.transform.join(',') + ')'); - CustomStyle.setProp('transformOrigin', container, - -rect[0] + 'px ' + -rect[1] + 'px'); - - if (data.borderStyle.width > 0) { - container.style.borderWidth = data.borderStyle.width + 'px'; - if (data.borderStyle.style !== AnnotationBorderStyleType.UNDERLINE) { - // Underline styles only have a bottom border, so we do not need - // to adjust for all borders. This yields a similar result as - // Adobe Acrobat/Reader. - width = width - 2 * data.borderStyle.width; - height = height - 2 * data.borderStyle.width; - } - - var horizontalRadius = data.borderStyle.horizontalCornerRadius; - var verticalRadius = data.borderStyle.verticalCornerRadius; - if (horizontalRadius > 0 || verticalRadius > 0) { - var radius = horizontalRadius + 'px / ' + verticalRadius + 'px'; - CustomStyle.setProp('borderRadius', container, radius); - } - - switch (data.borderStyle.style) { - case AnnotationBorderStyleType.SOLID: - container.style.borderStyle = 'solid'; - break; - - case AnnotationBorderStyleType.DASHED: - container.style.borderStyle = 'dashed'; - break; - - case AnnotationBorderStyleType.BEVELED: - warn('Unimplemented border style: beveled'); - break; - - case AnnotationBorderStyleType.INSET: - warn('Unimplemented border style: inset'); - break; - - case AnnotationBorderStyleType.UNDERLINE: - container.style.borderBottomStyle = 'solid'; - break; - - default: - break; - } - - if (data.color) { - container.style.borderColor = - Util.makeCssRgb(data.color[0] | 0, - data.color[1] | 0, - data.color[2] | 0); - } else { - // Transparent (invisible) border, so do not draw it at all. - container.style.borderWidth = 0; - } - } - - container.style.left = rect[0] + 'px'; - container.style.top = rect[1] + 'px'; - - container.style.width = width + 'px'; - container.style.height = height + 'px'; - - return container; - }, - - /** - * Render the annotation's HTML element in the empty container. - * - * @public - * @memberof AnnotationElement - */ - render: function AnnotationElement_render() { - throw new Error('Abstract method AnnotationElement.render called'); - } - }; - - return AnnotationElement; -})(); - -/** - * @class - * @alias LinkAnnotationElement - */ -var LinkAnnotationElement = (function LinkAnnotationElementClosure() { - function LinkAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(LinkAnnotationElement, AnnotationElement, { - /** - * Render the link annotation's HTML element in the empty container. - * - * @public - * @memberof LinkAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function LinkAnnotationElement_render() { - this.container.className = 'linkAnnotation'; - - var link = document.createElement('a'); - addLinkAttributes(link, { url: this.data.url }); - - if (!this.data.url) { - if (this.data.action) { - this._bindNamedAction(link, this.data.action); - } else { - this._bindLink(link, ('dest' in this.data) ? this.data.dest : null); - } - } - - this.container.appendChild(link); - return this.container; - }, - - /** - * Bind internal links to the link element. - * - * @private - * @param {Object} link - * @param {Object} destination - * @memberof LinkAnnotationElement - */ - _bindLink: function LinkAnnotationElement_bindLink(link, destination) { - var self = this; - - link.href = this.linkService.getDestinationHash(destination); - link.onclick = function() { - if (destination) { - self.linkService.navigateTo(destination); - } - return false; - }; - if (destination) { - link.className = 'internalLink'; - } - }, - - /** - * Bind named actions to the link element. - * - * @private - * @param {Object} link - * @param {Object} action - * @memberof LinkAnnotationElement - */ - _bindNamedAction: - function LinkAnnotationElement_bindNamedAction(link, action) { - var self = this; - - link.href = this.linkService.getAnchorUrl(''); - link.onclick = function() { - self.linkService.executeNamedAction(action); - return false; - }; - link.className = 'internalLink'; - } - }); - - return LinkAnnotationElement; -})(); - -/** - * @class - * @alias TextAnnotationElement - */ -var TextAnnotationElement = (function TextAnnotationElementClosure() { - function TextAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(TextAnnotationElement, AnnotationElement, { - /** - * Render the text annotation's HTML element in the empty container. - * - * @public - * @memberof TextAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function TextAnnotationElement_render() { - this.container.className = 'textAnnotation'; - - var image = document.createElement('img'); - image.style.height = this.container.style.height; - image.style.width = this.container.style.width; - image.src = PDFJS.imageResourcesPath + 'annotation-' + - this.data.name.toLowerCase() + '.svg'; - image.alt = '[{{type}} Annotation]'; - image.dataset.l10nId = 'text_annotation_type'; - image.dataset.l10nArgs = JSON.stringify({type: this.data.name}); - - if (!this.data.hasPopup) { - var popupElement = new PopupElement({ - container: this.container, - trigger: image, - color: this.data.color, - title: this.data.title, - contents: this.data.contents, - hideWrapper: true - }); - var popup = popupElement.render(); - - // Position the popup next to the Text annotation's container. - popup.style.left = image.style.width; - - this.container.appendChild(popup); - } - - this.container.appendChild(image); - return this.container; - } - }); - - return TextAnnotationElement; -})(); - -/** - * @class - * @alias WidgetAnnotationElement - */ -var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() { - function WidgetAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(WidgetAnnotationElement, AnnotationElement, { - /** - * Render the widget annotation's HTML element in the empty container. - * - * @public - * @memberof WidgetAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function WidgetAnnotationElement_render() { - var content = document.createElement('div'); - content.textContent = this.data.fieldValue; - var textAlignment = this.data.textAlignment; - content.style.textAlign = ['left', 'center', 'right'][textAlignment]; - content.style.verticalAlign = 'middle'; - content.style.display = 'table-cell'; - - var font = (this.data.fontRefName ? - this.page.commonObjs.getData(this.data.fontRefName) : null); - this._setTextStyle(content, font); - - this.container.appendChild(content); - return this.container; - }, - - /** - * Apply text styles to the text in the element. - * - * @private - * @param {HTMLDivElement} element - * @param {Object} font - * @memberof WidgetAnnotationElement - */ - _setTextStyle: - function WidgetAnnotationElement_setTextStyle(element, font) { - // TODO: This duplicates some of the logic in CanvasGraphics.setFont(). - var style = element.style; - style.fontSize = this.data.fontSize + 'px'; - style.direction = (this.data.fontDirection < 0 ? 'rtl': 'ltr'); - - if (!font) { - return; - } - - style.fontWeight = (font.black ? - (font.bold ? '900' : 'bold') : - (font.bold ? 'bold' : 'normal')); - style.fontStyle = (font.italic ? 'italic' : 'normal'); - - // Use a reasonable default font if the font doesn't specify a fallback. - var fontFamily = font.loadedName ? '"' + font.loadedName + '", ' : ''; - var fallbackName = font.fallbackName || 'Helvetica, sans-serif'; - style.fontFamily = fontFamily + fallbackName; - } - }); - - return WidgetAnnotationElement; -})(); - -/** - * @class - * @alias PopupAnnotationElement - */ -var PopupAnnotationElement = (function PopupAnnotationElementClosure() { - function PopupAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(PopupAnnotationElement, AnnotationElement, { - /** - * Render the popup annotation's HTML element in the empty container. - * - * @public - * @memberof PopupAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function PopupAnnotationElement_render() { - this.container.className = 'popupAnnotation'; - - var selector = '[data-annotation-id="' + this.data.parentId + '"]'; - var parentElement = this.layer.querySelector(selector); - if (!parentElement) { - return this.container; - } - - var popup = new PopupElement({ - container: this.container, - trigger: parentElement, - color: this.data.color, - title: this.data.title, - contents: this.data.contents - }); - - // Position the popup next to the parent annotation's container. - // PDF viewers ignore a popup annotation's rectangle. - var parentLeft = parseFloat(parentElement.style.left); - var parentWidth = parseFloat(parentElement.style.width); - CustomStyle.setProp('transformOrigin', this.container, - -(parentLeft + parentWidth) + 'px -' + - parentElement.style.top); - this.container.style.left = (parentLeft + parentWidth) + 'px'; - - this.container.appendChild(popup.render()); - return this.container; - } - }); - - return PopupAnnotationElement; -})(); - -/** - * @class - * @alias PopupElement - */ -var PopupElement = (function PopupElementClosure() { - var BACKGROUND_ENLIGHT = 0.7; - - function PopupElement(parameters) { - this.container = parameters.container; - this.trigger = parameters.trigger; - this.color = parameters.color; - this.title = parameters.title; - this.contents = parameters.contents; - this.hideWrapper = parameters.hideWrapper || false; - - this.pinned = false; - } - - PopupElement.prototype = /** @lends PopupElement.prototype */ { - /** - * Render the popup's HTML element. - * - * @public - * @memberof PopupElement - * @returns {HTMLSectionElement} - */ - render: function PopupElement_render() { - var wrapper = document.createElement('div'); - wrapper.className = 'popupWrapper'; - - // For Popup annotations we hide the entire section because it contains - // only the popup. However, for Text annotations without a separate Popup - // annotation, we cannot hide the entire container as the image would - // disappear too. In that special case, hiding the wrapper suffices. - this.hideElement = (this.hideWrapper ? wrapper : this.container); - this.hideElement.setAttribute('hidden', true); - - var popup = document.createElement('div'); - popup.className = 'popup'; - - var color = this.color; - if (color) { - // Enlighten the color. - var r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0]; - var g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1]; - var b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2]; - popup.style.backgroundColor = Util.makeCssRgb(r | 0, g | 0, b | 0); - } - - var contents = this._formatContents(this.contents); - var title = document.createElement('h1'); - title.textContent = this.title; - - // Attach the event listeners to the trigger element. - this.trigger.addEventListener('click', this._toggle.bind(this)); - this.trigger.addEventListener('mouseover', this._show.bind(this, false)); - this.trigger.addEventListener('mouseout', this._hide.bind(this, false)); - popup.addEventListener('click', this._hide.bind(this, true)); - - popup.appendChild(title); - popup.appendChild(contents); - wrapper.appendChild(popup); - return wrapper; - }, - - /** - * Format the contents of the popup by adding newlines where necessary. - * - * @private - * @param {string} contents - * @memberof PopupElement - * @returns {HTMLParagraphElement} - */ - _formatContents: function PopupElement_formatContents(contents) { - var p = document.createElement('p'); - var lines = contents.split(/(?:\r\n?|\n)/); - for (var i = 0, ii = lines.length; i < ii; ++i) { - var line = lines[i]; - p.appendChild(document.createTextNode(line)); - if (i < (ii - 1)) { - p.appendChild(document.createElement('br')); - } - } - return p; - }, - - /** - * Toggle the visibility of the popup. - * - * @private - * @memberof PopupElement - */ - _toggle: function PopupElement_toggle() { - if (this.pinned) { - this._hide(true); - } else { - this._show(true); - } - }, - - /** - * Show the popup. - * - * @private - * @param {boolean} pin - * @memberof PopupElement - */ - _show: function PopupElement_show(pin) { - if (pin) { - this.pinned = true; - } - if (this.hideElement.hasAttribute('hidden')) { - this.hideElement.removeAttribute('hidden'); - this.container.style.zIndex += 1; - } - }, - - /** - * Hide the popup. - * - * @private - * @param {boolean} unpin - * @memberof PopupElement - */ - _hide: function PopupElement_hide(unpin) { - if (unpin) { - this.pinned = false; - } - if (!this.hideElement.hasAttribute('hidden') && !this.pinned) { - this.hideElement.setAttribute('hidden', true); - this.container.style.zIndex -= 1; - } - } - }; - - return PopupElement; -})(); - -/** - * @class - * @alias HighlightAnnotationElement - */ -var HighlightAnnotationElement = ( - function HighlightAnnotationElementClosure() { - function HighlightAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(HighlightAnnotationElement, AnnotationElement, { - /** - * Render the highlight annotation's HTML element in the empty container. - * - * @public - * @memberof HighlightAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function HighlightAnnotationElement_render() { - this.container.className = 'highlightAnnotation'; - return this.container; - } - }); - - return HighlightAnnotationElement; -})(); - -/** - * @class - * @alias UnderlineAnnotationElement - */ -var UnderlineAnnotationElement = ( - function UnderlineAnnotationElementClosure() { - function UnderlineAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(UnderlineAnnotationElement, AnnotationElement, { - /** - * Render the underline annotation's HTML element in the empty container. - * - * @public - * @memberof UnderlineAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function UnderlineAnnotationElement_render() { - this.container.className = 'underlineAnnotation'; - return this.container; - } - }); - - return UnderlineAnnotationElement; -})(); - -/** - * @class - * @alias SquigglyAnnotationElement - */ -var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() { - function SquigglyAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(SquigglyAnnotationElement, AnnotationElement, { - /** - * Render the squiggly annotation's HTML element in the empty container. - * - * @public - * @memberof SquigglyAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function SquigglyAnnotationElement_render() { - this.container.className = 'squigglyAnnotation'; - return this.container; - } - }); - - return SquigglyAnnotationElement; -})(); - -/** - * @class - * @alias StrikeOutAnnotationElement - */ -var StrikeOutAnnotationElement = ( - function StrikeOutAnnotationElementClosure() { - function StrikeOutAnnotationElement(parameters) { - AnnotationElement.call(this, parameters); - } - - Util.inherit(StrikeOutAnnotationElement, AnnotationElement, { - /** - * Render the strikeout annotation's HTML element in the empty container. - * - * @public - * @memberof StrikeOutAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function StrikeOutAnnotationElement_render() { - this.container.className = 'strikeoutAnnotation'; - return this.container; - } - }); - - return StrikeOutAnnotationElement; -})(); - -/** - * @typedef {Object} AnnotationLayerParameters - * @property {PageViewport} viewport - * @property {HTMLDivElement} div - * @property {Array} annotations - * @property {PDFPage} page - * @property {IPDFLinkService} linkService - */ - -/** - * @class - * @alias AnnotationLayer - */ -var AnnotationLayer = (function AnnotationLayerClosure() { - return { - /** - * Render a new annotation layer with all annotation elements. - * - * @public - * @param {AnnotationLayerParameters} parameters - * @memberof AnnotationLayer - */ - render: function AnnotationLayer_render(parameters) { - var annotationElementFactory = new AnnotationElementFactory(); - - for (var i = 0, ii = parameters.annotations.length; i < ii; i++) { - var data = parameters.annotations[i]; - if (!data || !data.hasHtml) { - continue; - } - - var properties = { - data: data, - layer: parameters.div, - page: parameters.page, - viewport: parameters.viewport, - linkService: parameters.linkService - }; - var element = annotationElementFactory.create(properties); - parameters.div.appendChild(element.render()); - } - }, - - /** - * Update the annotation elements on existing annotation layer. - * - * @public - * @param {AnnotationLayerParameters} parameters - * @memberof AnnotationLayer - */ - update: function AnnotationLayer_update(parameters) { - for (var i = 0, ii = parameters.annotations.length; i < ii; i++) { - var data = parameters.annotations[i]; - var element = parameters.div.querySelector( - '[data-annotation-id="' + data.id + '"]'); - if (element) { - CustomStyle.setProp('transform', element, - 'matrix(' + parameters.viewport.transform.join(',') + ')'); - } - } - parameters.div.removeAttribute('hidden'); - } - }; -})(); - -PDFJS.AnnotationLayer = AnnotationLayer; - -exports.AnnotationLayer = AnnotationLayer; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayFontLoader = {}), root.pdfjsSharedUtil, - root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedUtil, sharedGlobal) { - -var assert = sharedUtil.assert; -var bytesToString = sharedUtil.bytesToString; -var string32 = sharedUtil.string32; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; - -var PDFJS = sharedGlobal.PDFJS; -var globalScope = sharedGlobal.globalScope; -var isWorker = sharedGlobal.isWorker; - -function FontLoader(docId) { - this.docId = docId; - this.styleElement = null; - this.nativeFontFaces = []; - this.loadTestFontId = 0; - this.loadingContext = { - requests: [], - nextRequestId: 0 - }; -} -FontLoader.prototype = { - insertRule: function fontLoaderInsertRule(rule) { - var styleElement = this.styleElement; - if (!styleElement) { - styleElement = this.styleElement = document.createElement('style'); - styleElement.id = 'PDFJS_FONT_STYLE_TAG_' + this.docId; - document.documentElement.getElementsByTagName('head')[0].appendChild( - styleElement); - } - - var styleSheet = styleElement.sheet; - styleSheet.insertRule(rule, styleSheet.cssRules.length); - }, - - clear: function fontLoaderClear() { - var styleElement = this.styleElement; - if (styleElement) { - styleElement.parentNode.removeChild(styleElement); - styleElement = this.styleElement = null; - } - this.nativeFontFaces.forEach(function(nativeFontFace) { - document.fonts.delete(nativeFontFace); - }); - this.nativeFontFaces.length = 0; - }, - get loadTestFont() { - // This is a CFF font with 1 glyph for '.' that fills its entire width and - // height. - return shadow(this, 'loadTestFont', atob( - 'T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQ' + - 'AABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwA' + - 'AAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbm' + - 'FtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAA' + - 'AADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6A' + - 'ABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAA' + - 'MQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAA' + - 'AAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAA' + - 'AAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQ' + - 'AAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMA' + - 'AQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAA' + - 'EAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAA' + - 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAA' + - 'AAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgc' + - 'A/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF' + - 'hYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQA' + - 'AAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAg' + - 'ABAAAAAAAAAAAD6AAAAAAAAA==' - )); - }, - - addNativeFontFace: function fontLoader_addNativeFontFace(nativeFontFace) { - this.nativeFontFaces.push(nativeFontFace); - document.fonts.add(nativeFontFace); - }, - - bind: function fontLoaderBind(fonts, callback) { - assert(!isWorker, 'bind() shall be called from main thread'); - - var rules = []; - var fontsToLoad = []; - var fontLoadPromises = []; - var getNativeFontPromise = function(nativeFontFace) { - // Return a promise that is always fulfilled, even when the font fails to - // load. - return nativeFontFace.loaded.catch(function(e) { - warn('Failed to load font "' + nativeFontFace.family + '": ' + e); - }); - }; - for (var i = 0, ii = fonts.length; i < ii; i++) { - var font = fonts[i]; - - // Add the font to the DOM only once or skip if the font - // is already loaded. - if (font.attached || font.loading === false) { - continue; - } - font.attached = true; - - if (FontLoader.isFontLoadingAPISupported) { - var nativeFontFace = font.createNativeFontFace(); - if (nativeFontFace) { - this.addNativeFontFace(nativeFontFace); - fontLoadPromises.push(getNativeFontPromise(nativeFontFace)); - } - } else { - var rule = font.createFontFaceRule(); - if (rule) { - this.insertRule(rule); - rules.push(rule); - fontsToLoad.push(font); - } - } - } - - var request = this.queueLoadingCallback(callback); - if (FontLoader.isFontLoadingAPISupported) { - Promise.all(fontLoadPromises).then(function() { - request.complete(); - }); - } else if (rules.length > 0 && !FontLoader.isSyncFontLoadingSupported) { - this.prepareFontLoadEvent(rules, fontsToLoad, request); - } else { - request.complete(); - } - }, - - queueLoadingCallback: function FontLoader_queueLoadingCallback(callback) { - function LoadLoader_completeRequest() { - assert(!request.end, 'completeRequest() cannot be called twice'); - request.end = Date.now(); - - // sending all completed requests in order how they were queued - while (context.requests.length > 0 && context.requests[0].end) { - var otherRequest = context.requests.shift(); - setTimeout(otherRequest.callback, 0); - } - } - - var context = this.loadingContext; - var requestId = 'pdfjs-font-loading-' + (context.nextRequestId++); - var request = { - id: requestId, - complete: LoadLoader_completeRequest, - callback: callback, - started: Date.now() - }; - context.requests.push(request); - return request; - }, - - prepareFontLoadEvent: function fontLoaderPrepareFontLoadEvent(rules, - fonts, - request) { - /** Hack begin */ - // There's currently no event when a font has finished downloading so the - // following code is a dirty hack to 'guess' when a font is - // ready. It's assumed fonts are loaded in order, so add a known test - // font after the desired fonts and then test for the loading of that - // test font. - - function int32(data, offset) { - return (data.charCodeAt(offset) << 24) | - (data.charCodeAt(offset + 1) << 16) | - (data.charCodeAt(offset + 2) << 8) | - (data.charCodeAt(offset + 3) & 0xff); - } - - function spliceString(s, offset, remove, insert) { - var chunk1 = s.substr(0, offset); - var chunk2 = s.substr(offset + remove); - return chunk1 + insert + chunk2; - } - - var i, ii; - - var canvas = document.createElement('canvas'); - canvas.width = 1; - canvas.height = 1; - var ctx = canvas.getContext('2d'); - - var called = 0; - function isFontReady(name, callback) { - called++; - // With setTimeout clamping this gives the font ~100ms to load. - if(called > 30) { - warn('Load test font never loaded.'); - callback(); - return; - } - ctx.font = '30px ' + name; - ctx.fillText('.', 0, 20); - var imageData = ctx.getImageData(0, 0, 1, 1); - if (imageData.data[3] > 0) { - callback(); - return; - } - setTimeout(isFontReady.bind(null, name, callback)); - } - - var loadTestFontId = 'lt' + Date.now() + this.loadTestFontId++; - // Chromium seems to cache fonts based on a hash of the actual font data, - // so the font must be modified for each load test else it will appear to - // be loaded already. - // TODO: This could maybe be made faster by avoiding the btoa of the full - // font by splitting it in chunks before hand and padding the font id. - var data = this.loadTestFont; - var COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum) - data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, - loadTestFontId); - // CFF checksum is important for IE, adjusting it - var CFF_CHECKSUM_OFFSET = 16; - var XXXX_VALUE = 0x58585858; // the "comment" filled with 'X' - var checksum = int32(data, CFF_CHECKSUM_OFFSET); - for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { - checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0; - } - if (i < loadTestFontId.length) { // align to 4 bytes boundary - checksum = (checksum - XXXX_VALUE + - int32(loadTestFontId + 'XXX', i)) | 0; - } - data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); - - var url = 'url(data:font/opentype;base64,' + btoa(data) + ');'; - var rule = '@font-face { font-family:"' + loadTestFontId + '";src:' + - url + '}'; - this.insertRule(rule); - - var names = []; - for (i = 0, ii = fonts.length; i < ii; i++) { - names.push(fonts[i].loadedName); - } - names.push(loadTestFontId); - - var div = document.createElement('div'); - div.setAttribute('style', - 'visibility: hidden;' + - 'width: 10px; height: 10px;' + - 'position: absolute; top: 0px; left: 0px;'); - for (i = 0, ii = names.length; i < ii; ++i) { - var span = document.createElement('span'); - span.textContent = 'Hi'; - span.style.fontFamily = names[i]; - div.appendChild(span); - } - document.body.appendChild(div); - - isFontReady(loadTestFontId, function() { - document.body.removeChild(div); - request.complete(); - }); - /** Hack end */ - } -}; -FontLoader.isFontLoadingAPISupported = (!isWorker && - typeof document !== 'undefined' && !!document.fonts); -Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', { - get: function () { - var supported = false; - - // User agent string sniffing is bad, but there is no reliable way to tell - // if font is fully loaded and ready to be used with canvas. - var userAgent = window.navigator.userAgent; - var m = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(userAgent); - if (m && m[1] >= 14) { - supported = true; - } - // TODO other browsers - if (userAgent === 'node') { - supported = true; - } - return shadow(FontLoader, 'isSyncFontLoadingSupported', supported); - }, - enumerable: true, - configurable: true -}); - -var FontFaceObject = (function FontFaceObjectClosure() { - function FontFaceObject(translatedData) { - this.compiledGlyphs = {}; - // importing translated data - for (var i in translatedData) { - this[i] = translatedData[i]; - } - } - Object.defineProperty(FontFaceObject, 'isEvalSupported', { - get: function () { - var evalSupport = false; - if (PDFJS.isEvalSupported) { - try { - /* jshint evil: true */ - new Function(''); - evalSupport = true; - } catch (e) {} - } - return shadow(this, 'isEvalSupported', evalSupport); - }, - enumerable: true, - configurable: true - }); - FontFaceObject.prototype = { - createNativeFontFace: function FontFaceObject_createNativeFontFace() { - if (!this.data) { - return null; - } - - if (PDFJS.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var nativeFontFace = new FontFace(this.loadedName, this.data, {}); - - if (PDFJS.pdfBug && 'FontInspector' in globalScope && - globalScope['FontInspector'].enabled) { - globalScope['FontInspector'].fontAdded(this); - } - return nativeFontFace; - }, - - createFontFaceRule: function FontFaceObject_createFontFaceRule() { - if (!this.data) { - return null; - } - - if (PDFJS.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var data = bytesToString(new Uint8Array(this.data)); - var fontName = this.loadedName; - - // Add the font-face rule to the document - var url = ('url(data:' + this.mimetype + ';base64,' + - window.btoa(data) + ');'); - var rule = '@font-face { font-family:"' + fontName + '";src:' + url + '}'; - - if (PDFJS.pdfBug && 'FontInspector' in globalScope && - globalScope['FontInspector'].enabled) { - globalScope['FontInspector'].fontAdded(this, url); - } - - return rule; - }, - - getPathGenerator: - function FontFaceObject_getPathGenerator(objs, character) { - if (!(character in this.compiledGlyphs)) { - var cmds = objs.get(this.loadedName + '_path_' + character); - var current, i, len; - - // If we can, compile cmds into JS for MAXIMUM SPEED - if (FontFaceObject.isEvalSupported) { - var args, js = ''; - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.args !== undefined) { - args = current.args.join(','); - } else { - args = ''; - } - - js += 'c.' + current.cmd + '(' + args + ');\n'; - } - /* jshint -W054 */ - this.compiledGlyphs[character] = new Function('c', 'size', js); - } else { - // But fall back on using Function.prototype.apply() if we're - // blocked from using eval() for whatever reason (like CSP policies) - this.compiledGlyphs[character] = function(c, size) { - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.cmd === 'scale') { - current.args = [size, -size]; - } - - c[current.cmd].apply(c, current.args); - } - }; - } - } - return this.compiledGlyphs[character]; - } - }; - return FontFaceObject; -})(); - -exports.FontFaceObject = FontFaceObject; -exports.FontLoader = FontLoader; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayMetadata = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var error = sharedUtil.error; - -var Metadata = PDFJS.Metadata = (function MetadataClosure() { - function fixMetadata(meta) { - return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) { - var bytes = codes.replace(/\\([0-3])([0-7])([0-7])/g, - function(code, d1, d2, d3) { - return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); - }); - var chars = ''; - for (var i = 0; i < bytes.length; i += 2) { - var code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); - chars += code >= 32 && code < 127 && code !== 60 && code !== 62 && - code !== 38 && false ? String.fromCharCode(code) : - '&#x' + (0x10000 + code).toString(16).substring(1) + ';'; - } - return '>' + chars; - }); - } - - function Metadata(meta) { - if (typeof meta === 'string') { - // Ghostscript produces invalid metadata - meta = fixMetadata(meta); - - var parser = new DOMParser(); - meta = parser.parseFromString(meta, 'application/xml'); - } else if (!(meta instanceof Document)) { - error('Metadata: Invalid metadata object'); - } - - this.metaDocument = meta; - this.metadata = {}; - this.parse(); - } - - Metadata.prototype = { - parse: function Metadata_parse() { - var doc = this.metaDocument; - var rdf = doc.documentElement; - - if (rdf.nodeName.toLowerCase() !== 'rdf:rdf') { // Wrapped in - rdf = rdf.firstChild; - while (rdf && rdf.nodeName.toLowerCase() !== 'rdf:rdf') { - rdf = rdf.nextSibling; - } - } - - var nodeName = (rdf) ? rdf.nodeName.toLowerCase() : null; - if (!rdf || nodeName !== 'rdf:rdf' || !rdf.hasChildNodes()) { - return; - } - - var children = rdf.childNodes, desc, entry, name, i, ii, length, iLength; - for (i = 0, length = children.length; i < length; i++) { - desc = children[i]; - if (desc.nodeName.toLowerCase() !== 'rdf:description') { - continue; - } - - for (ii = 0, iLength = desc.childNodes.length; ii < iLength; ii++) { - if (desc.childNodes[ii].nodeName.toLowerCase() !== '#text') { - entry = desc.childNodes[ii]; - name = entry.nodeName.toLowerCase(); - this.metadata[name] = entry.textContent.trim(); - } - } - } - }, - - get: function Metadata_get(name) { - return this.metadata[name] || null; - }, - - has: function Metadata_has(name) { - return typeof this.metadata[name] !== 'undefined'; - } - }; - - return Metadata; -})(); - -exports.Metadata = Metadata; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplaySVG = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; -var ImageKind = sharedUtil.ImageKind; -var OPS = sharedUtil.OPS; -var Util = sharedUtil.Util; -var isNum = sharedUtil.isNum; -var isArray = sharedUtil.isArray; -var warn = sharedUtil.warn; - -var SVG_DEFAULTS = { - fontStyle: 'normal', - fontWeight: 'normal', - fillColor: '#000000' -}; - -var convertImgDataToPng = (function convertImgDataToPngClosure() { - var PNG_HEADER = - new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); - - var CHUNK_WRAPPER_SIZE = 12; - - var crcTable = new Int32Array(256); - for (var i = 0; i < 256; i++) { - var c = i; - for (var h = 0; h < 8; h++) { - if (c & 1) { - c = 0xedB88320 ^ ((c >> 1) & 0x7fffffff); - } else { - c = (c >> 1) & 0x7fffffff; - } - } - crcTable[i] = c; - } - - function crc32(data, start, end) { - var crc = -1; - for (var i = start; i < end; i++) { - var a = (crc ^ data[i]) & 0xff; - var b = crcTable[a]; - crc = (crc >>> 8) ^ b; - } - return crc ^ -1; - } - - function writePngChunk(type, body, data, offset) { - var p = offset; - var len = body.length; - - data[p] = len >> 24 & 0xff; - data[p + 1] = len >> 16 & 0xff; - data[p + 2] = len >> 8 & 0xff; - data[p + 3] = len & 0xff; - p += 4; - - data[p] = type.charCodeAt(0) & 0xff; - data[p + 1] = type.charCodeAt(1) & 0xff; - data[p + 2] = type.charCodeAt(2) & 0xff; - data[p + 3] = type.charCodeAt(3) & 0xff; - p += 4; - - data.set(body, p); - p += body.length; - - var crc = crc32(data, offset + 4, p); - - data[p] = crc >> 24 & 0xff; - data[p + 1] = crc >> 16 & 0xff; - data[p + 2] = crc >> 8 & 0xff; - data[p + 3] = crc & 0xff; - } - - function adler32(data, start, end) { - var a = 1; - var b = 0; - for (var i = start; i < end; ++i) { - a = (a + (data[i] & 0xff)) % 65521; - b = (b + a) % 65521; - } - return (b << 16) | a; - } - - function encode(imgData, kind) { - var width = imgData.width; - var height = imgData.height; - var bitDepth, colorType, lineSize; - var bytes = imgData.data; - - switch (kind) { - case ImageKind.GRAYSCALE_1BPP: - colorType = 0; - bitDepth = 1; - lineSize = (width + 7) >> 3; - break; - case ImageKind.RGB_24BPP: - colorType = 2; - bitDepth = 8; - lineSize = width * 3; - break; - case ImageKind.RGBA_32BPP: - colorType = 6; - bitDepth = 8; - lineSize = width * 4; - break; - default: - throw new Error('invalid format'); - } - - // prefix every row with predictor 0 - var literals = new Uint8Array((1 + lineSize) * height); - var offsetLiterals = 0, offsetBytes = 0; - var y, i; - for (y = 0; y < height; ++y) { - literals[offsetLiterals++] = 0; // no prediction - literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), - offsetLiterals); - offsetBytes += lineSize; - offsetLiterals += lineSize; - } - - if (kind === ImageKind.GRAYSCALE_1BPP) { - // inverting for B/W - offsetLiterals = 0; - for (y = 0; y < height; y++) { - offsetLiterals++; // skipping predictor - for (i = 0; i < lineSize; i++) { - literals[offsetLiterals++] ^= 0xFF; - } - } - } - - var ihdr = new Uint8Array([ - width >> 24 & 0xff, - width >> 16 & 0xff, - width >> 8 & 0xff, - width & 0xff, - height >> 24 & 0xff, - height >> 16 & 0xff, - height >> 8 & 0xff, - height & 0xff, - bitDepth, // bit depth - colorType, // color type - 0x00, // compression method - 0x00, // filter method - 0x00 // interlace method - ]); - - var len = literals.length; - var maxBlockLength = 0xFFFF; - - var deflateBlocks = Math.ceil(len / maxBlockLength); - var idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4); - var pi = 0; - idat[pi++] = 0x78; // compression method and flags - idat[pi++] = 0x9c; // flags - - var pos = 0; - while (len > maxBlockLength) { - // writing non-final DEFLATE blocks type 0 and length of 65535 - idat[pi++] = 0x00; - idat[pi++] = 0xff; - idat[pi++] = 0xff; - idat[pi++] = 0x00; - idat[pi++] = 0x00; - idat.set(literals.subarray(pos, pos + maxBlockLength), pi); - pi += maxBlockLength; - pos += maxBlockLength; - len -= maxBlockLength; - } - - // writing non-final DEFLATE blocks type 0 - idat[pi++] = 0x01; - idat[pi++] = len & 0xff; - idat[pi++] = len >> 8 & 0xff; - idat[pi++] = (~len & 0xffff) & 0xff; - idat[pi++] = (~len & 0xffff) >> 8 & 0xff; - idat.set(literals.subarray(pos), pi); - pi += literals.length - pos; - - var adler = adler32(literals, 0, literals.length); // checksum - idat[pi++] = adler >> 24 & 0xff; - idat[pi++] = adler >> 16 & 0xff; - idat[pi++] = adler >> 8 & 0xff; - idat[pi++] = adler & 0xff; - - // PNG will consists: header, IHDR+data, IDAT+data, and IEND. - var pngLength = PNG_HEADER.length + (CHUNK_WRAPPER_SIZE * 3) + - ihdr.length + idat.length; - var data = new Uint8Array(pngLength); - var offset = 0; - data.set(PNG_HEADER, offset); - offset += PNG_HEADER.length; - writePngChunk('IHDR', ihdr, data, offset); - offset += CHUNK_WRAPPER_SIZE + ihdr.length; - writePngChunk('IDATA', idat, data, offset); - offset += CHUNK_WRAPPER_SIZE + idat.length; - writePngChunk('IEND', new Uint8Array(0), data, offset); - - return PDFJS.createObjectURL(data, 'image/png'); - } - - return function convertImgDataToPng(imgData) { - var kind = (imgData.kind === undefined ? - ImageKind.GRAYSCALE_1BPP : imgData.kind); - return encode(imgData, kind); - }; -})(); - -var SVGExtraState = (function SVGExtraStateClosure() { - function SVGExtraState() { - this.fontSizeScale = 1; - this.fontWeight = SVG_DEFAULTS.fontWeight; - this.fontSize = 0; - - this.textMatrix = IDENTITY_MATRIX; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRise = 0; - - // Default foreground and background colors - this.fillColor = SVG_DEFAULTS.fillColor; - this.strokeColor = '#000000'; - - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.lineJoin = ''; - this.lineCap = ''; - this.miterLimit = 0; - - this.dashArray = []; - this.dashPhase = 0; - - this.dependencies = []; - - // Clipping - this.clipId = ''; - this.pendingClip = false; - - this.maskId = ''; - } - - SVGExtraState.prototype = { - clone: function SVGExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function SVGExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return SVGExtraState; -})(); - -var SVGGraphics = (function SVGGraphicsClosure() { - function createScratchSVG(width, height) { - var NS = 'http://www.w3.org/2000/svg'; - var svg = document.createElementNS(NS, 'svg:svg'); - svg.setAttributeNS(null, 'version', '1.1'); - svg.setAttributeNS(null, 'width', width + 'px'); - svg.setAttributeNS(null, 'height', height + 'px'); - svg.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height); - return svg; - } - - function opListToTree(opList) { - var opTree = []; - var tmp = []; - var opListLen = opList.length; - - for (var x = 0; x < opListLen; x++) { - if (opList[x].fn === 'save') { - opTree.push({'fnId': 92, 'fn': 'group', 'items': []}); - tmp.push(opTree); - opTree = opTree[opTree.length - 1].items; - continue; - } - - if(opList[x].fn === 'restore') { - opTree = tmp.pop(); - } else { - opTree.push(opList[x]); - } - } - return opTree; - } - - /** - * Formats float number. - * @param value {number} number to format. - * @returns {string} - */ - function pf(value) { - if (value === (value | 0)) { // integer number - return value.toString(); - } - var s = value.toFixed(10); - var i = s.length - 1; - if (s[i] !== '0') { - return s; - } - // removing trailing zeros - do { - i--; - } while (s[i] === '0'); - return s.substr(0, s[i] === '.' ? i : i + 1); - } - - /** - * Formats transform matrix. The standard rotation, scale and translate - * matrices are replaced by their shorter forms, and for identity matrix - * returns empty string to save the memory. - * @param m {Array} matrix to format. - * @returns {string} - */ - function pm(m) { - if (m[4] === 0 && m[5] === 0) { - if (m[1] === 0 && m[2] === 0) { - if (m[0] === 1 && m[3] === 1) { - return ''; - } - return 'scale(' + pf(m[0]) + ' ' + pf(m[3]) + ')'; - } - if (m[0] === m[3] && m[1] === -m[2]) { - var a = Math.acos(m[0]) * 180 / Math.PI; - return 'rotate(' + pf(a) + ')'; - } - } else { - if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) { - return 'translate(' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - } - return 'matrix(' + pf(m[0]) + ' ' + pf(m[1]) + ' ' + pf(m[2]) + ' ' + - pf(m[3]) + ' ' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - - function SVGGraphics(commonObjs, objs) { - this.current = new SVGExtraState(); - this.transformMatrix = IDENTITY_MATRIX; // Graphics state matrix - this.transformStack = []; - this.extraStack = []; - this.commonObjs = commonObjs; - this.objs = objs; - this.pendingEOFill = false; - - this.embedFonts = false; - this.embeddedFonts = {}; - this.cssStyle = null; - } - - var NS = 'http://www.w3.org/2000/svg'; - var XML_NS = 'http://www.w3.org/XML/1998/namespace'; - var XLINK_NS = 'http://www.w3.org/1999/xlink'; - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var clipCount = 0; - var maskCount = 0; - - SVGGraphics.prototype = { - save: function SVGGraphics_save() { - this.transformStack.push(this.transformMatrix); - var old = this.current; - this.extraStack.push(old); - this.current = old.clone(); - }, - - restore: function SVGGraphics_restore() { - this.transformMatrix = this.transformStack.pop(); - this.current = this.extraStack.pop(); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.pgrp.appendChild(this.tgrp); - }, - - group: function SVGGraphics_group(items) { - this.save(); - this.executeOpTree(items); - this.restore(); - }, - - loadDependencies: function SVGGraphics_loadDependencies(operatorList) { - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var argsArray = operatorList.argsArray; - - var self = this; - for (var i = 0; i < fnArrayLen; i++) { - if (OPS.dependency === fnArray[i]) { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var obj = deps[n]; - var common = obj.substring(0, 2) === 'g_'; - var promise; - if (common) { - promise = new Promise(function(resolve) { - self.commonObjs.get(obj, resolve); - }); - } else { - promise = new Promise(function(resolve) { - self.objs.get(obj, resolve); - }); - } - this.current.dependencies.push(promise); - } - } - } - return Promise.all(this.current.dependencies); - }, - - transform: function SVGGraphics_transform(a, b, c, d, e, f) { - var transformMatrix = [a, b, c, d, e, f]; - this.transformMatrix = PDFJS.Util.transform(this.transformMatrix, - transformMatrix); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - getSVG: function SVGGraphics_getSVG(operatorList, viewport) { - this.svg = createScratchSVG(viewport.width, viewport.height); - this.viewport = viewport; - - return this.loadDependencies(operatorList).then(function () { - this.transformMatrix = IDENTITY_MATRIX; - this.pgrp = document.createElementNS(NS, 'svg:g'); // Parent group - this.pgrp.setAttributeNS(null, 'transform', pm(viewport.transform)); - this.tgrp = document.createElementNS(NS, 'svg:g'); // Transform group - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.defs = document.createElementNS(NS, 'svg:defs'); - this.pgrp.appendChild(this.defs); - this.pgrp.appendChild(this.tgrp); - this.svg.appendChild(this.pgrp); - var opTree = this.convertOpList(operatorList); - this.executeOpTree(opTree); - return this.svg; - }.bind(this)); - }, - - convertOpList: function SVGGraphics_convertOpList(operatorList) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var REVOPS = []; - var opList = []; - - for (var op in OPS) { - REVOPS[OPS[op]] = op; - } - - for (var x = 0; x < fnArrayLen; x++) { - var fnId = fnArray[x]; - opList.push({'fnId' : fnId, 'fn': REVOPS[fnId], 'args': argsArray[x]}); - } - return opListToTree(opList); - }, - - executeOpTree: function SVGGraphics_executeOpTree(opTree) { - var opTreeLen = opTree.length; - for(var x = 0; x < opTreeLen; x++) { - var fn = opTree[x].fn; - var fnId = opTree[x].fnId; - var args = opTree[x].args; - - switch (fnId | 0) { - case OPS.beginText: - this.beginText(); - break; - case OPS.setLeading: - this.setLeading(args); - break; - case OPS.setLeadingMoveText: - this.setLeadingMoveText(args[0], args[1]); - break; - case OPS.setFont: - this.setFont(args); - break; - case OPS.showText: - this.showText(args[0]); - break; - case OPS.showSpacedText: - this.showText(args[0]); - break; - case OPS.endText: - this.endText(); - break; - case OPS.moveText: - this.moveText(args[0], args[1]); - break; - case OPS.setCharSpacing: - this.setCharSpacing(args[0]); - break; - case OPS.setWordSpacing: - this.setWordSpacing(args[0]); - break; - case OPS.setHScale: - this.setHScale(args[0]); - break; - case OPS.setTextMatrix: - this.setTextMatrix(args[0], args[1], args[2], - args[3], args[4], args[5]); - break; - case OPS.setLineWidth: - this.setLineWidth(args[0]); - break; - case OPS.setLineJoin: - this.setLineJoin(args[0]); - break; - case OPS.setLineCap: - this.setLineCap(args[0]); - break; - case OPS.setMiterLimit: - this.setMiterLimit(args[0]); - break; - case OPS.setFillRGBColor: - this.setFillRGBColor(args[0], args[1], args[2]); - break; - case OPS.setStrokeRGBColor: - this.setStrokeRGBColor(args[0], args[1], args[2]); - break; - case OPS.setDash: - this.setDash(args[0], args[1]); - break; - case OPS.setGState: - this.setGState(args[0]); - break; - case OPS.fill: - this.fill(); - break; - case OPS.eoFill: - this.eoFill(); - break; - case OPS.stroke: - this.stroke(); - break; - case OPS.fillStroke: - this.fillStroke(); - break; - case OPS.eoFillStroke: - this.eoFillStroke(); - break; - case OPS.clip: - this.clip('nonzero'); - break; - case OPS.eoClip: - this.clip('evenodd'); - break; - case OPS.paintSolidColorImageMask: - this.paintSolidColorImageMask(); - break; - case OPS.paintJpegXObject: - this.paintJpegXObject(args[0], args[1], args[2]); - break; - case OPS.paintImageXObject: - this.paintImageXObject(args[0]); - break; - case OPS.paintInlineImageXObject: - this.paintInlineImageXObject(args[0]); - break; - case OPS.paintImageMaskXObject: - this.paintImageMaskXObject(args[0]); - break; - case OPS.paintFormXObjectBegin: - this.paintFormXObjectBegin(args[0], args[1]); - break; - case OPS.paintFormXObjectEnd: - this.paintFormXObjectEnd(); - break; - case OPS.closePath: - this.closePath(); - break; - case OPS.closeStroke: - this.closeStroke(); - break; - case OPS.closeFillStroke: - this.closeFillStroke(); - break; - case OPS.nextLine: - this.nextLine(); - break; - case OPS.transform: - this.transform(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.constructPath: - this.constructPath(args[0], args[1]); - break; - case OPS.endPath: - this.endPath(); - break; - case 92: - this.group(opTree[x].items); - break; - default: - warn('Unimplemented method '+ fn); - break; - } - } - }, - - setWordSpacing: function SVGGraphics_setWordSpacing(wordSpacing) { - this.current.wordSpacing = wordSpacing; - }, - - setCharSpacing: function SVGGraphics_setCharSpacing(charSpacing) { - this.current.charSpacing = charSpacing; - }, - - nextLine: function SVGGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - setTextMatrix: function SVGGraphics_setTextMatrix(a, b, c, d, e, f) { - var current = this.current; - this.current.textMatrix = this.current.lineMatrix = [a, b, c, d, e, f]; - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - - current.txtElement = document.createElementNS(NS, 'svg:text'); - current.txtElement.appendChild(current.tspan); - }, - - beginText: function SVGGraphics_beginText() { - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - this.current.textMatrix = IDENTITY_MATRIX; - this.current.lineMatrix = IDENTITY_MATRIX; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.txtElement = document.createElementNS(NS, 'svg:text'); - this.current.txtgrp = document.createElementNS(NS, 'svg:g'); - this.current.xcoords = []; - }, - - moveText: function SVGGraphics_moveText(x, y) { - var current = this.current; - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - }, - - showText: function SVGGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - - if (fontSize === 0) { - return; - } - - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (glyph === null) { - // word break - x += fontDirection * wordSpacing; - continue; - } else if (isNum(glyph)) { - x += -glyph * fontSize * 0.001; - continue; - } - current.xcoords.push(current.x + x * textHScale); - - var width = glyph.width; - var character = glyph.fontChar; - var charWidth = width * widthAdvanceScale + charSpacing * fontDirection; - x += charWidth; - - current.tspan.textContent += character; - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - - current.tspan.setAttributeNS(null, 'x', - current.xcoords.map(pf).join(' ')); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - if (current.fontStyle !== SVG_DEFAULTS.fontStyle) { - current.tspan.setAttributeNS(null, 'font-style', current.fontStyle); - } - if (current.fontWeight !== SVG_DEFAULTS.fontWeight) { - current.tspan.setAttributeNS(null, 'font-weight', current.fontWeight); - } - if (current.fillColor !== SVG_DEFAULTS.fillColor) { - current.tspan.setAttributeNS(null, 'fill', current.fillColor); - } - - current.txtElement.setAttributeNS(null, 'transform', - pm(current.textMatrix) + - ' scale(1, -1)' ); - current.txtElement.setAttributeNS(XML_NS, 'xml:space', 'preserve'); - current.txtElement.appendChild(current.tspan); - current.txtgrp.appendChild(current.txtElement); - - this.tgrp.appendChild(current.txtElement); - - }, - - setLeadingMoveText: function SVGGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - - addFontStyle: function SVGGraphics_addFontStyle(fontObj) { - if (!this.cssStyle) { - this.cssStyle = document.createElementNS(NS, 'svg:style'); - this.cssStyle.setAttributeNS(null, 'type', 'text/css'); - this.defs.appendChild(this.cssStyle); - } - - var url = PDFJS.createObjectURL(fontObj.data, fontObj.mimetype); - this.cssStyle.textContent += - '@font-face { font-family: "' + fontObj.loadedName + '";' + - ' src: url(' + url + '); }\n'; - }, - - setFont: function SVGGraphics_setFont(details) { - var current = this.current; - var fontObj = this.commonObjs.get(details[0]); - var size = details[1]; - this.current.font = fontObj; - - if (this.embedFonts && fontObj.data && - !this.embeddedFonts[fontObj.loadedName]) { - this.addFontStyle(fontObj); - this.embeddedFonts[fontObj.loadedName] = fontObj; - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - var italic = fontObj.italic ? 'italic' : 'normal'; - - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - current.fontSize = size; - current.fontFamily = fontObj.loadedName; - current.fontWeight = bold; - current.fontStyle = italic; - - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.xcoords = []; - }, - - endText: function SVGGraphics_endText() { - if (this.current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - // Path properties - setLineWidth: function SVGGraphics_setLineWidth(width) { - this.current.lineWidth = width; - }, - setLineCap: function SVGGraphics_setLineCap(style) { - this.current.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function SVGGraphics_setLineJoin(style) { - this.current.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function SVGGraphics_setMiterLimit(limit) { - this.current.miterLimit = limit; - }, - setStrokeRGBColor: function SVGGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.strokeColor = color; - }, - setFillRGBColor: function SVGGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.fillColor = color; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.xcoords = []; - }, - setDash: function SVGGraphics_setDash(dashArray, dashPhase) { - this.current.dashArray = dashArray; - this.current.dashPhase = dashPhase; - }, - - constructPath: function SVGGraphics_constructPath(ops, args) { - var current = this.current; - var x = current.x, y = current.y; - current.path = document.createElementNS(NS, 'svg:path'); - var d = []; - var opLength = ops.length; - - for (var i = 0, j = 0; i < opLength; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - var xw = x + width; - var yh = y + height; - d.push('M', pf(x), pf(y), 'L', pf(xw) , pf(y), 'L', pf(xw), pf(yh), - 'L', pf(x), pf(yh), 'Z'); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - d.push('M', pf(x), pf(y)); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - d.push('L', pf(x) , pf(y)); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), - pf(args[j + 3]), pf(x), pf(y)); - j += 6; - break; - case OPS.curveTo2: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(x), pf(y), pf(args[j]), pf(args[j + 1]), - pf(args[j + 2]), pf(args[j + 3])); - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(x), pf(y), - pf(x), pf(y)); - j += 4; - break; - case OPS.closePath: - d.push('Z'); - break; - } - } - current.path.setAttributeNS(null, 'd', d.join(' ')); - current.path.setAttributeNS(null, 'stroke-miterlimit', - pf(current.miterLimit)); - current.path.setAttributeNS(null, 'stroke-linecap', current.lineCap); - current.path.setAttributeNS(null, 'stroke-linejoin', current.lineJoin); - current.path.setAttributeNS(null, 'stroke-width', - pf(current.lineWidth) + 'px'); - current.path.setAttributeNS(null, 'stroke-dasharray', - current.dashArray.map(pf).join(' ')); - current.path.setAttributeNS(null, 'stroke-dashoffset', - pf(current.dashPhase) + 'px'); - current.path.setAttributeNS(null, 'fill', 'none'); - - this.tgrp.appendChild(current.path); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - // Saving a reference in current.element so that it can be addressed - // in 'fill' and 'stroke' - current.element = current.path; - current.setCurrentPoint(x, y); - }, - - endPath: function SVGGraphics_endPath() { - var current = this.current; - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - clip: function SVGGraphics_clip(type) { - var current = this.current; - // Add current path to clipping path - current.clipId = 'clippath' + clipCount; - clipCount++; - this.clippath = document.createElementNS(NS, 'svg:clipPath'); - this.clippath.setAttributeNS(null, 'id', current.clipId); - var clipElement = current.element.cloneNode(); - if (type === 'evenodd') { - clipElement.setAttributeNS(null, 'clip-rule', 'evenodd'); - } else { - clipElement.setAttributeNS(null, 'clip-rule', 'nonzero'); - } - this.clippath.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.clippath.appendChild(clipElement); - this.defs.appendChild(this.clippath); - - // Create a new group with that attribute - current.pendingClip = true; - this.cgrp = document.createElementNS(NS, 'svg:g'); - this.cgrp.setAttributeNS(null, 'clip-path', - 'url(#' + current.clipId + ')'); - this.pgrp.appendChild(this.cgrp); - }, - - closePath: function SVGGraphics_closePath() { - var current = this.current; - var d = current.path.getAttributeNS(null, 'd'); - d += 'Z'; - current.path.setAttributeNS(null, 'd', d); - }, - - setLeading: function SVGGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - - setTextRise: function SVGGraphics_setTextRise(textRise) { - this.current.textRise = textRise; - }, - - setHScale: function SVGGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - - setGState: function SVGGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - break; - case 'FL': - break; - case 'Font': - this.setFont(value); - break; - case 'CA': - break; - case 'ca': - break; - case 'BM': - break; - case 'SMask': - break; - } - } - }, - - fill: function SVGGraphics_fill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - }, - - stroke: function SVGGraphics_stroke() { - var current = this.current; - current.element.setAttributeNS(null, 'stroke', current.strokeColor); - current.element.setAttributeNS(null, 'fill', 'none'); - }, - - eoFill: function SVGGraphics_eoFill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - }, - - fillStroke: function SVGGraphics_fillStroke() { - // Order is important since stroke wants fill to be none. - // First stroke, then if fill needed, it will be overwritten. - this.stroke(); - this.fill(); - }, - - eoFillStroke: function SVGGraphics_eoFillStroke() { - this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - this.fillStroke(); - }, - - closeStroke: function SVGGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - - closeFillStroke: function SVGGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - - paintSolidColorImageMask: - function SVGGraphics_paintSolidColorImageMask() { - var current = this.current; - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', '1px'); - rect.setAttributeNS(null, 'height', '1px'); - rect.setAttributeNS(null, 'fill', current.fillColor); - this.tgrp.appendChild(rect); - }, - - paintJpegXObject: function SVGGraphics_paintJpegXObject(objId, w, h) { - var current = this.current; - var imgObj = this.objs.get(objId); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgObj.src); - imgEl.setAttributeNS(null, 'width', imgObj.width + 'px'); - imgEl.setAttributeNS(null, 'height', imgObj.height + 'px'); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-h)); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / w) + ' ' + pf(-1 / h) + ')'); - - this.tgrp.appendChild(imgEl); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageXObject: function SVGGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - this.paintInlineImageXObject(imgData); - }, - - paintInlineImageXObject: - function SVGGraphics_paintInlineImageXObject(imgData, mask) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - - var imgSrc = convertImgDataToPng(imgData); - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', '0'); - cliprect.setAttributeNS(null, 'y', '0'); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - current.element = cliprect; - this.clip('nonzero'); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgSrc); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-height)); - imgEl.setAttributeNS(null, 'width', pf(width) + 'px'); - imgEl.setAttributeNS(null, 'height', pf(height) + 'px'); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / width) + ' ' + - pf(-1 / height) + ')'); - if (mask) { - mask.appendChild(imgEl); - } else { - this.tgrp.appendChild(imgEl); - } - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageMaskXObject: - function SVGGraphics_paintImageMaskXObject(imgData) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - var fillColor = current.fillColor; - - current.maskId = 'mask' + maskCount++; - var mask = document.createElementNS(NS, 'svg:mask'); - mask.setAttributeNS(null, 'id', current.maskId); - - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', pf(width)); - rect.setAttributeNS(null, 'height', pf(height)); - rect.setAttributeNS(null, 'fill', fillColor); - rect.setAttributeNS(null, 'mask', 'url(#' + current.maskId +')'); - this.defs.appendChild(mask); - this.tgrp.appendChild(rect); - - this.paintInlineImageXObject(imgData, mask); - }, - - paintFormXObjectBegin: - function SVGGraphics_paintFormXObjectBegin(matrix, bbox) { - this.save(); - - if (isArray(matrix) && matrix.length === 6) { - this.transform(matrix[0], matrix[1], matrix[2], - matrix[3], matrix[4], matrix[5]); - } - - if (isArray(bbox) && bbox.length === 4) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', bbox[0]); - cliprect.setAttributeNS(null, 'y', bbox[1]); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - this.current.element = cliprect; - this.clip('nonzero'); - this.endPath(); - } - }, - - paintFormXObjectEnd: - function SVGGraphics_paintFormXObjectEnd() { - this.restore(); - } - }; - return SVGGraphics; -})(); - -PDFJS.SVGGraphics = SVGGraphics; - -exports.SVGGraphics = SVGGraphics; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayTextLayer = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils, root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedUtil, displayDOMUtils, sharedGlobal) { - -var Util = sharedUtil.Util; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var CustomStyle = displayDOMUtils.CustomStyle; -var PDFJS = sharedGlobal.PDFJS; - -/** - * Text layer render parameters. - * - * @typedef {Object} TextLayerRenderParameters - * @property {TextContent} textContent - Text content to render (the object is - * returned by the page's getTextContent() method). - * @property {HTMLElement} container - HTML element that will contain text runs. - * @property {PDFJS.PageViewport} viewport - The target viewport to properly - * layout the text runs. - * @property {Array} textDivs - (optional) HTML elements that are correspond - * the text items of the textContent input. This is output and shall be - * initially be set to empty array. - * @property {number} timeout - (optional) Delay in milliseconds before - * rendering of the text runs occurs. - */ -var renderTextLayer = (function renderTextLayerClosure() { - var MAX_TEXT_DIVS_TO_RENDER = 100000; - - var NonWhitespaceRegexp = /\S/; - - function isAllWhitespace(str) { - return !NonWhitespaceRegexp.test(str); - } - - function appendText(textDivs, viewport, geom, styles) { - var style = styles[geom.fontName]; - var textDiv = document.createElement('div'); - textDivs.push(textDiv); - if (isAllWhitespace(geom.str)) { - textDiv.dataset.isWhitespace = true; - return; - } - var tx = Util.transform(viewport.transform, geom.transform); - var angle = Math.atan2(tx[1], tx[0]); - if (style.vertical) { - angle += Math.PI / 2; - } - var fontHeight = Math.sqrt((tx[2] * tx[2]) + (tx[3] * tx[3])); - var fontAscent = fontHeight; - if (style.ascent) { - fontAscent = style.ascent * fontAscent; - } else if (style.descent) { - fontAscent = (1 + style.descent) * fontAscent; - } - - var left; - var top; - if (angle === 0) { - left = tx[4]; - top = tx[5] - fontAscent; - } else { - left = tx[4] + (fontAscent * Math.sin(angle)); - top = tx[5] - (fontAscent * Math.cos(angle)); - } - textDiv.style.left = left + 'px'; - textDiv.style.top = top + 'px'; - textDiv.style.fontSize = fontHeight + 'px'; - textDiv.style.fontFamily = style.fontFamily; - - textDiv.textContent = geom.str; - // |fontName| is only used by the Font Inspector. This test will succeed - // when e.g. the Font Inspector is off but the Stepper is on, but it's - // not worth the effort to do a more accurate test. - if (PDFJS.pdfBug) { - textDiv.dataset.fontName = geom.fontName; - } - // Storing into dataset will convert number into string. - if (angle !== 0) { - textDiv.dataset.angle = angle * (180 / Math.PI); - } - // We don't bother scaling single-char text divs, because it has very - // little effect on text highlighting. This makes scrolling on docs with - // lots of such divs a lot faster. - if (geom.str.length > 1) { - if (style.vertical) { - textDiv.dataset.canvasWidth = geom.height * viewport.scale; - } else { - textDiv.dataset.canvasWidth = geom.width * viewport.scale; - } - } - } - - function render(task) { - if (task._canceled) { - return; - } - var textLayerFrag = task._container; - var textDivs = task._textDivs; - var capability = task._capability; - var textDivsLength = textDivs.length; - - // No point in rendering many divs as it would make the browser - // unusable even after the divs are rendered. - if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { - capability.resolve(); - return; - } - - var canvas = document.createElement('canvas'); - canvas.mozOpaque = true; - var ctx = canvas.getContext('2d', {alpha: false}); - - var lastFontSize; - var lastFontFamily; - for (var i = 0; i < textDivsLength; i++) { - var textDiv = textDivs[i]; - if (textDiv.dataset.isWhitespace !== undefined) { - continue; - } - - var fontSize = textDiv.style.fontSize; - var fontFamily = textDiv.style.fontFamily; - - // Only build font string and set to context if different from last. - if (fontSize !== lastFontSize || fontFamily !== lastFontFamily) { - ctx.font = fontSize + ' ' + fontFamily; - lastFontSize = fontSize; - lastFontFamily = fontFamily; - } - - var width = ctx.measureText(textDiv.textContent).width; - if (width > 0) { - textLayerFrag.appendChild(textDiv); - var transform; - if (textDiv.dataset.canvasWidth !== undefined) { - // Dataset values come of type string. - var textScale = textDiv.dataset.canvasWidth / width; - transform = 'scaleX(' + textScale + ')'; - } else { - transform = ''; - } - var rotation = textDiv.dataset.angle; - if (rotation) { - transform = 'rotate(' + rotation + 'deg) ' + transform; - } - if (transform) { - CustomStyle.setProp('transform' , textDiv, transform); - } - } - } - capability.resolve(); - } - - /** - * Text layer rendering task. - * - * @param {TextContent} textContent - * @param {HTMLElement} container - * @param {PDFJS.PageViewport} viewport - * @param {Array} textDivs - * @private - */ - function TextLayerRenderTask(textContent, container, viewport, textDivs) { - this._textContent = textContent; - this._container = container; - this._viewport = viewport; - textDivs = textDivs || []; - this._textDivs = textDivs; - this._canceled = false; - this._capability = createPromiseCapability(); - this._renderTimer = null; - } - TextLayerRenderTask.prototype = { - get promise() { - return this._capability.promise; - }, - - cancel: function TextLayer_cancel() { - this._canceled = true; - if (this._renderTimer !== null) { - clearTimeout(this._renderTimer); - this._renderTimer = null; - } - this._capability.reject('canceled'); - }, - - _render: function TextLayer_render(timeout) { - var textItems = this._textContent.items; - var styles = this._textContent.styles; - var textDivs = this._textDivs; - var viewport = this._viewport; - for (var i = 0, len = textItems.length; i < len; i++) { - appendText(textDivs, viewport, textItems[i], styles); - } - - if (!timeout) { // Render right away - render(this); - } else { // Schedule - var self = this; - this._renderTimer = setTimeout(function() { - render(self); - self._renderTimer = null; - }, timeout); - } - } - }; - - - /** - * Starts rendering of the text layer. - * - * @param {TextLayerRenderParameters} renderParameters - * @returns {TextLayerRenderTask} - */ - function renderTextLayer(renderParameters) { - var task = new TextLayerRenderTask(renderParameters.textContent, - renderParameters.container, - renderParameters.viewport, - renderParameters.textDivs); - task._render(renderParameters.timeout); - return task; - } - - return renderTextLayer; -})(); - -PDFJS.renderTextLayer = renderTextLayer; - -exports.renderTextLayer = renderTextLayer; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayWebGL = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var shadow = sharedUtil.shadow; - -var WebGLUtils = (function WebGLUtilsClosure() { - function loadShader(gl, code, shaderType) { - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, code); - gl.compileShader(shader); - var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - if (!compiled) { - var errorMsg = gl.getShaderInfoLog(shader); - throw new Error('Error during shader compilation: ' + errorMsg); - } - return shader; - } - function createVertexShader(gl, code) { - return loadShader(gl, code, gl.VERTEX_SHADER); - } - function createFragmentShader(gl, code) { - return loadShader(gl, code, gl.FRAGMENT_SHADER); - } - function createProgram(gl, shaders) { - var program = gl.createProgram(); - for (var i = 0, ii = shaders.length; i < ii; ++i) { - gl.attachShader(program, shaders[i]); - } - gl.linkProgram(program); - var linked = gl.getProgramParameter(program, gl.LINK_STATUS); - if (!linked) { - var errorMsg = gl.getProgramInfoLog(program); - throw new Error('Error during program linking: ' + errorMsg); - } - return program; - } - function createTexture(gl, image, textureId) { - gl.activeTexture(textureId); - var texture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, texture); - - // Set the parameters so we can render any size image. - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - - // Upload the image into the texture. - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); - return texture; - } - - var currentGL, currentCanvas; - function generateGL() { - if (currentGL) { - return; - } - currentCanvas = document.createElement('canvas'); - currentGL = currentCanvas.getContext('webgl', - { premultipliedalpha: false }); - } - - var smaskVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec2 a_texCoord; \ - \ - uniform vec2 u_resolution; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_texCoord = a_texCoord; \ - } '; - - var smaskFragmentShaderCode = '\ - precision mediump float; \ - \ - uniform vec4 u_backdrop; \ - uniform int u_subtype; \ - uniform sampler2D u_image; \ - uniform sampler2D u_mask; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec4 imageColor = texture2D(u_image, v_texCoord); \ - vec4 maskColor = texture2D(u_mask, v_texCoord); \ - if (u_backdrop.a > 0.0) { \ - maskColor.rgb = maskColor.rgb * maskColor.a + \ - u_backdrop.rgb * (1.0 - maskColor.a); \ - } \ - float lum; \ - if (u_subtype == 0) { \ - lum = maskColor.a; \ - } else { \ - lum = maskColor.r * 0.3 + maskColor.g * 0.59 + \ - maskColor.b * 0.11; \ - } \ - imageColor.a *= lum; \ - imageColor.rgb *= imageColor.a; \ - gl_FragColor = imageColor; \ - } '; - - var smaskCache = null; - - function initSmaskGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, smaskVertexShaderCode); - var fragmentShader = createFragmentShader(gl, smaskFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.backdropLocation = gl.getUniformLocation(program, 'u_backdrop'); - cache.subtypeLocation = gl.getUniformLocation(program, 'u_subtype'); - - var texCoordLocation = gl.getAttribLocation(program, 'a_texCoord'); - var texLayerLocation = gl.getUniformLocation(program, 'u_image'); - var texMaskLocation = gl.getUniformLocation(program, 'u_mask'); - - // provide texture coordinates for the rectangle. - var texCoordBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 0.0, 1.0, - 1.0, 0.0, - 1.0, 1.0]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(texCoordLocation); - gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0); - - gl.uniform1i(texLayerLocation, 0); - gl.uniform1i(texMaskLocation, 1); - - smaskCache = cache; - } - - function composeSMask(layer, mask, properties) { - var width = layer.width, height = layer.height; - - if (!smaskCache) { - initSmaskGL(); - } - var cache = smaskCache,canvas = cache.canvas, gl = cache.gl; - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - if (properties.backdrop) { - gl.uniform4f(cache.resolutionLocation, properties.backdrop[0], - properties.backdrop[1], properties.backdrop[2], 1); - } else { - gl.uniform4f(cache.resolutionLocation, 0, 0, 0, 0); - } - gl.uniform1i(cache.subtypeLocation, - properties.subtype === 'Luminosity' ? 1 : 0); - - // Create a textures - var texture = createTexture(gl, layer, gl.TEXTURE0); - var maskTexture = createTexture(gl, mask, gl.TEXTURE1); - - - // Create a buffer and put a single clipspace rectangle in - // it (2 triangles) - var buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0, 0, - width, 0, - 0, height, - 0, height, - width, 0, - width, height]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - // draw - gl.clearColor(0, 0, 0, 0); - gl.enable(gl.BLEND); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.drawArrays(gl.TRIANGLES, 0, 6); - - gl.flush(); - - gl.deleteTexture(texture); - gl.deleteTexture(maskTexture); - gl.deleteBuffer(buffer); - - return canvas; - } - - var figuresVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec3 a_color; \ - \ - uniform vec2 u_resolution; \ - uniform vec2 u_scale; \ - uniform vec2 u_offset; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - vec2 position = (a_position + u_offset) * u_scale; \ - vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_color = vec4(a_color / 255.0, 1.0); \ - } '; - - var figuresFragmentShaderCode = '\ - precision mediump float; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - gl_FragColor = v_color; \ - } '; - - var figuresCache = null; - - function initFiguresGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, figuresVertexShaderCode); - var fragmentShader = createFragmentShader(gl, figuresFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.scaleLocation = gl.getUniformLocation(program, 'u_scale'); - cache.offsetLocation = gl.getUniformLocation(program, 'u_offset'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.colorLocation = gl.getAttribLocation(program, 'a_color'); - - figuresCache = cache; - } - - function drawFigures(width, height, backgroundColor, figures, context) { - if (!figuresCache) { - initFiguresGL(); - } - var cache = figuresCache, canvas = cache.canvas, gl = cache.gl; - - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - // count triangle points - var count = 0; - var i, ii, rows; - for (i = 0, ii = figures.length; i < ii; i++) { - switch (figures[i].type) { - case 'lattice': - rows = (figures[i].coords.length / figures[i].verticesPerRow) | 0; - count += (rows - 1) * (figures[i].verticesPerRow - 1) * 6; - break; - case 'triangles': - count += figures[i].coords.length; - break; - } - } - // transfer data - var coords = new Float32Array(count * 2); - var colors = new Uint8Array(count * 3); - var coordsMap = context.coords, colorsMap = context.colors; - var pIndex = 0, cIndex = 0; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - switch (figure.type) { - case 'lattice': - var cols = figure.verticesPerRow; - rows = (ps.length / cols) | 0; - for (var row = 1; row < rows; row++) { - var offset = row * cols + 1; - for (var col = 1; col < cols; col++, offset++) { - coords[pIndex] = coordsMap[ps[offset - cols - 1]]; - coords[pIndex + 1] = coordsMap[ps[offset - cols - 1] + 1]; - coords[pIndex + 2] = coordsMap[ps[offset - cols]]; - coords[pIndex + 3] = coordsMap[ps[offset - cols] + 1]; - coords[pIndex + 4] = coordsMap[ps[offset - 1]]; - coords[pIndex + 5] = coordsMap[ps[offset - 1] + 1]; - colors[cIndex] = colorsMap[cs[offset - cols - 1]]; - colors[cIndex + 1] = colorsMap[cs[offset - cols - 1] + 1]; - colors[cIndex + 2] = colorsMap[cs[offset - cols - 1] + 2]; - colors[cIndex + 3] = colorsMap[cs[offset - cols]]; - colors[cIndex + 4] = colorsMap[cs[offset - cols] + 1]; - colors[cIndex + 5] = colorsMap[cs[offset - cols] + 2]; - colors[cIndex + 6] = colorsMap[cs[offset - 1]]; - colors[cIndex + 7] = colorsMap[cs[offset - 1] + 1]; - colors[cIndex + 8] = colorsMap[cs[offset - 1] + 2]; - - coords[pIndex + 6] = coords[pIndex + 2]; - coords[pIndex + 7] = coords[pIndex + 3]; - coords[pIndex + 8] = coords[pIndex + 4]; - coords[pIndex + 9] = coords[pIndex + 5]; - coords[pIndex + 10] = coordsMap[ps[offset]]; - coords[pIndex + 11] = coordsMap[ps[offset] + 1]; - colors[cIndex + 9] = colors[cIndex + 3]; - colors[cIndex + 10] = colors[cIndex + 4]; - colors[cIndex + 11] = colors[cIndex + 5]; - colors[cIndex + 12] = colors[cIndex + 6]; - colors[cIndex + 13] = colors[cIndex + 7]; - colors[cIndex + 14] = colors[cIndex + 8]; - colors[cIndex + 15] = colorsMap[cs[offset]]; - colors[cIndex + 16] = colorsMap[cs[offset] + 1]; - colors[cIndex + 17] = colorsMap[cs[offset] + 2]; - pIndex += 12; - cIndex += 18; - } - } - break; - case 'triangles': - for (var j = 0, jj = ps.length; j < jj; j++) { - coords[pIndex] = coordsMap[ps[j]]; - coords[pIndex + 1] = coordsMap[ps[j] + 1]; - colors[cIndex] = colorsMap[cs[j]]; - colors[cIndex + 1] = colorsMap[cs[j] + 1]; - colors[cIndex + 2] = colorsMap[cs[j] + 2]; - pIndex += 2; - cIndex += 3; - } - break; - } - } - - // draw - if (backgroundColor) { - gl.clearColor(backgroundColor[0] / 255, backgroundColor[1] / 255, - backgroundColor[2] / 255, 1.0); - } else { - gl.clearColor(0, 0, 0, 0); - } - gl.clear(gl.COLOR_BUFFER_BIT); - - var coordsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, coordsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, coords, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - var colorsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, colorsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.colorLocation); - gl.vertexAttribPointer(cache.colorLocation, 3, gl.UNSIGNED_BYTE, false, - 0, 0); - - gl.uniform2f(cache.scaleLocation, context.scaleX, context.scaleY); - gl.uniform2f(cache.offsetLocation, context.offsetX, context.offsetY); - - gl.drawArrays(gl.TRIANGLES, 0, count); - - gl.flush(); - - gl.deleteBuffer(coordsBuffer); - gl.deleteBuffer(colorsBuffer); - - return canvas; - } - - function cleanup() { - if (smaskCache && smaskCache.canvas) { - smaskCache.canvas.width = 0; - smaskCache.canvas.height = 0; - } - if (figuresCache && figuresCache.canvas) { - figuresCache.canvas.width = 0; - figuresCache.canvas.height = 0; - } - smaskCache = null; - figuresCache = null; - } - - return { - get isEnabled() { - if (PDFJS.disableWebGL) { - return false; - } - var enabled = false; - try { - generateGL(); - enabled = !!currentGL; - } catch (e) { } - return shadow(this, 'isEnabled', enabled); - }, - composeSMask: composeSMask, - drawFigures: drawFigures, - clear: cleanup - }; -})(); - -exports.WebGLUtils = WebGLUtils; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayPatternHelper = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayWebGL); - } -}(this, function (exports, sharedUtil, displayWebGL) { - -var Util = sharedUtil.Util; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var error = sharedUtil.error; -var WebGLUtils = displayWebGL.WebGLUtils; - -var ShadingIRs = {}; - -ShadingIRs.RadialAxial = { - fromIR: function RadialAxial_fromIR(raw) { - var type = raw[1]; - var colorStops = raw[2]; - var p0 = raw[3]; - var p1 = raw[4]; - var r0 = raw[5]; - var r1 = raw[6]; - return { - type: 'Pattern', - getPattern: function RadialAxial_getPattern(ctx) { - var grad; - if (type === 'axial') { - grad = ctx.createLinearGradient(p0[0], p0[1], p1[0], p1[1]); - } else if (type === 'radial') { - grad = ctx.createRadialGradient(p0[0], p0[1], r0, p1[0], p1[1], r1); - } - - for (var i = 0, ii = colorStops.length; i < ii; ++i) { - var c = colorStops[i]; - grad.addColorStop(c[0], c[1]); - } - return grad; - } - }; - } -}; - -var createMeshCanvas = (function createMeshCanvasClosure() { - function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { - // Very basic Gouraud-shaded triangle rasterization algorithm. - var coords = context.coords, colors = context.colors; - var bytes = data.data, rowSize = data.width * 4; - var tmp; - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - if (coords[p2 + 1] > coords[p3 + 1]) { - tmp = p2; p2 = p3; p3 = tmp; tmp = c2; c2 = c3; c3 = tmp; - } - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - var x1 = (coords[p1] + context.offsetX) * context.scaleX; - var y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; - var x2 = (coords[p2] + context.offsetX) * context.scaleX; - var y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; - var x3 = (coords[p3] + context.offsetX) * context.scaleX; - var y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; - if (y1 >= y3) { - return; - } - var c1r = colors[c1], c1g = colors[c1 + 1], c1b = colors[c1 + 2]; - var c2r = colors[c2], c2g = colors[c2 + 1], c2b = colors[c2 + 2]; - var c3r = colors[c3], c3g = colors[c3 + 1], c3b = colors[c3 + 2]; - - var minY = Math.round(y1), maxY = Math.round(y3); - var xa, car, cag, cab; - var xb, cbr, cbg, cbb; - var k; - for (var y = minY; y <= maxY; y++) { - if (y < y2) { - k = y < y1 ? 0 : y1 === y2 ? 1 : (y1 - y) / (y1 - y2); - xa = x1 - (x1 - x2) * k; - car = c1r - (c1r - c2r) * k; - cag = c1g - (c1g - c2g) * k; - cab = c1b - (c1b - c2b) * k; - } else { - k = y > y3 ? 1 : y2 === y3 ? 0 : (y2 - y) / (y2 - y3); - xa = x2 - (x2 - x3) * k; - car = c2r - (c2r - c3r) * k; - cag = c2g - (c2g - c3g) * k; - cab = c2b - (c2b - c3b) * k; - } - k = y < y1 ? 0 : y > y3 ? 1 : (y1 - y) / (y1 - y3); - xb = x1 - (x1 - x3) * k; - cbr = c1r - (c1r - c3r) * k; - cbg = c1g - (c1g - c3g) * k; - cbb = c1b - (c1b - c3b) * k; - var x1_ = Math.round(Math.min(xa, xb)); - var x2_ = Math.round(Math.max(xa, xb)); - var j = rowSize * y + x1_ * 4; - for (var x = x1_; x <= x2_; x++) { - k = (xa - x) / (xa - xb); - k = k < 0 ? 0 : k > 1 ? 1 : k; - bytes[j++] = (car - (car - cbr) * k) | 0; - bytes[j++] = (cag - (cag - cbg) * k) | 0; - bytes[j++] = (cab - (cab - cbb) * k) | 0; - bytes[j++] = 255; - } - } - } - - function drawFigure(data, figure, context) { - var ps = figure.coords; - var cs = figure.colors; - var i, ii; - switch (figure.type) { - case 'lattice': - var verticesPerRow = figure.verticesPerRow; - var rows = Math.floor(ps.length / verticesPerRow) - 1; - var cols = verticesPerRow - 1; - for (i = 0; i < rows; i++) { - var q = i * verticesPerRow; - for (var j = 0; j < cols; j++, q++) { - drawTriangle(data, context, - ps[q], ps[q + 1], ps[q + verticesPerRow], - cs[q], cs[q + 1], cs[q + verticesPerRow]); - drawTriangle(data, context, - ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], - cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); - } - } - break; - case 'triangles': - for (i = 0, ii = ps.length; i < ii; i += 3) { - drawTriangle(data, context, - ps[i], ps[i + 1], ps[i + 2], - cs[i], cs[i + 1], cs[i + 2]); - } - break; - default: - error('illigal figure'); - break; - } - } - - function createMeshCanvas(bounds, combinesScale, coords, colors, figures, - backgroundColor, cachedCanvases) { - // we will increase scale on some weird factor to let antialiasing take - // care of "rough" edges - var EXPECTED_SCALE = 1.1; - // MAX_PATTERN_SIZE is used to avoid OOM situation. - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var boundsWidth = Math.ceil(bounds[2]) - offsetX; - var boundsHeight = Math.ceil(bounds[3]) - offsetY; - - var width = Math.min(Math.ceil(Math.abs(boundsWidth * combinesScale[0] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var height = Math.min(Math.ceil(Math.abs(boundsHeight * combinesScale[1] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var scaleX = boundsWidth / width; - var scaleY = boundsHeight / height; - - var context = { - coords: coords, - colors: colors, - offsetX: -offsetX, - offsetY: -offsetY, - scaleX: 1 / scaleX, - scaleY: 1 / scaleY - }; - - var canvas, tmpCanvas, i, ii; - if (WebGLUtils.isEnabled) { - canvas = WebGLUtils.drawFigures(width, height, backgroundColor, - figures, context); - - // https://bugzilla.mozilla.org/show_bug.cgi?id=972126 - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - tmpCanvas.context.drawImage(canvas, 0, 0); - canvas = tmpCanvas.canvas; - } else { - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - var tmpCtx = tmpCanvas.context; - - var data = tmpCtx.createImageData(width, height); - if (backgroundColor) { - var bytes = data.data; - for (i = 0, ii = bytes.length; i < ii; i += 4) { - bytes[i] = backgroundColor[0]; - bytes[i + 1] = backgroundColor[1]; - bytes[i + 2] = backgroundColor[2]; - bytes[i + 3] = 255; - } - } - for (i = 0; i < figures.length; i++) { - drawFigure(data, figures[i], context); - } - tmpCtx.putImageData(data, 0, 0); - canvas = tmpCanvas.canvas; - } - - return {canvas: canvas, offsetX: offsetX, offsetY: offsetY, - scaleX: scaleX, scaleY: scaleY}; - } - return createMeshCanvas; -})(); - -ShadingIRs.Mesh = { - fromIR: function Mesh_fromIR(raw) { - //var type = raw[1]; - var coords = raw[2]; - var colors = raw[3]; - var figures = raw[4]; - var bounds = raw[5]; - var matrix = raw[6]; - //var bbox = raw[7]; - var background = raw[8]; - return { - type: 'Pattern', - getPattern: function Mesh_getPattern(ctx, owner, shadingFill) { - var scale; - if (shadingFill) { - scale = Util.singularValueDecompose2dScale(ctx.mozCurrentTransform); - } else { - // Obtain scale from matrix and current transformation matrix. - scale = Util.singularValueDecompose2dScale(owner.baseTransform); - if (matrix) { - var matrixScale = Util.singularValueDecompose2dScale(matrix); - scale = [scale[0] * matrixScale[0], - scale[1] * matrixScale[1]]; - } - } - - - // Rasterizing on the main thread since sending/queue large canvases - // might cause OOM. - var temporaryPatternCanvas = createMeshCanvas(bounds, scale, coords, - colors, figures, shadingFill ? null : background, - owner.cachedCanvases); - - if (!shadingFill) { - ctx.setTransform.apply(ctx, owner.baseTransform); - if (matrix) { - ctx.transform.apply(ctx, matrix); - } - } - - ctx.translate(temporaryPatternCanvas.offsetX, - temporaryPatternCanvas.offsetY); - ctx.scale(temporaryPatternCanvas.scaleX, - temporaryPatternCanvas.scaleY); - - return ctx.createPattern(temporaryPatternCanvas.canvas, 'no-repeat'); - } - }; - } -}; - -ShadingIRs.Dummy = { - fromIR: function Dummy_fromIR() { - return { - type: 'Pattern', - getPattern: function Dummy_fromIR_getPattern() { - return 'hotpink'; - } - }; - } -}; - -function getShadingPatternFromIR(raw) { - var shadingIR = ShadingIRs[raw[0]]; - if (!shadingIR) { - error('Unknown IR type: ' + raw[0]); - } - return shadingIR.fromIR(raw); -} - -var TilingPattern = (function TilingPatternClosure() { - var PaintType = { - COLORED: 1, - UNCOLORED: 2 - }; - - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - function TilingPattern(IR, color, ctx, canvasGraphicsFactory, baseTransform) { - this.operatorList = IR[2]; - this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; - this.bbox = IR[4]; - this.xstep = IR[5]; - this.ystep = IR[6]; - this.paintType = IR[7]; - this.tilingType = IR[8]; - this.color = color; - this.canvasGraphicsFactory = canvasGraphicsFactory; - this.baseTransform = baseTransform; - this.type = 'Pattern'; - this.ctx = ctx; - } - - TilingPattern.prototype = { - createPatternCanvas: function TilinPattern_createPatternCanvas(owner) { - var operatorList = this.operatorList; - var bbox = this.bbox; - var xstep = this.xstep; - var ystep = this.ystep; - var paintType = this.paintType; - var tilingType = this.tilingType; - var color = this.color; - var canvasGraphicsFactory = this.canvasGraphicsFactory; - - info('TilingType: ' + tilingType); - - var x0 = bbox[0], y0 = bbox[1], x1 = bbox[2], y1 = bbox[3]; - - var topLeft = [x0, y0]; - // we want the canvas to be as large as the step size - var botRight = [x0 + xstep, y0 + ystep]; - - var width = botRight[0] - topLeft[0]; - var height = botRight[1] - topLeft[1]; - - // Obtain scale from matrix and current transformation matrix. - var matrixScale = Util.singularValueDecompose2dScale(this.matrix); - var curMatrixScale = Util.singularValueDecompose2dScale( - this.baseTransform); - var combinedScale = [matrixScale[0] * curMatrixScale[0], - matrixScale[1] * curMatrixScale[1]]; - - // MAX_PATTERN_SIZE is used to avoid OOM situation. - // Use width and height values that are as close as possible to the end - // result when the pattern is used. Too low value makes the pattern look - // blurry. Too large value makes it look too crispy. - width = Math.min(Math.ceil(Math.abs(width * combinedScale[0])), - MAX_PATTERN_SIZE); - - height = Math.min(Math.ceil(Math.abs(height * combinedScale[1])), - MAX_PATTERN_SIZE); - - var tmpCanvas = owner.cachedCanvases.getCanvas('pattern', - width, height, true); - var tmpCtx = tmpCanvas.context; - var graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); - graphics.groupLevel = owner.groupLevel; - - this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color); - - this.setScale(width, height, xstep, ystep); - this.transformToScale(graphics); - - // transform coordinates to pattern space - var tmpTranslate = [1, 0, 0, 1, -topLeft[0], -topLeft[1]]; - graphics.transform.apply(graphics, tmpTranslate); - - this.clipBbox(graphics, bbox, x0, y0, x1, y1); - - graphics.executeOperatorList(operatorList); - return tmpCanvas.canvas; - }, - - setScale: function TilingPattern_setScale(width, height, xstep, ystep) { - this.scale = [width / xstep, height / ystep]; - }, - - transformToScale: function TilingPattern_transformToScale(graphics) { - var scale = this.scale; - var tmpScale = [scale[0], 0, 0, scale[1], 0, 0]; - graphics.transform.apply(graphics, tmpScale); - }, - - scaleToContext: function TilingPattern_scaleToContext() { - var scale = this.scale; - this.ctx.scale(1 / scale[0], 1 / scale[1]); - }, - - clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) { - if (bbox && isArray(bbox) && bbox.length === 4) { - var bboxWidth = x1 - x0; - var bboxHeight = y1 - y0; - graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); - graphics.clip(); - graphics.endPath(); - } - }, - - setFillAndStrokeStyleToContext: - function setFillAndStrokeStyleToContext(context, paintType, color) { - switch (paintType) { - case PaintType.COLORED: - var ctx = this.ctx; - context.fillStyle = ctx.fillStyle; - context.strokeStyle = ctx.strokeStyle; - break; - case PaintType.UNCOLORED: - var cssColor = Util.makeCssRgb(color[0], color[1], color[2]); - context.fillStyle = cssColor; - context.strokeStyle = cssColor; - break; - default: - error('Unsupported paint type: ' + paintType); - } - }, - - getPattern: function TilingPattern_getPattern(ctx, owner) { - var temporaryPatternCanvas = this.createPatternCanvas(owner); - - ctx = this.ctx; - ctx.setTransform.apply(ctx, this.baseTransform); - ctx.transform.apply(ctx, this.matrix); - this.scaleToContext(); - - return ctx.createPattern(temporaryPatternCanvas, 'repeat'); - } - }; - - return TilingPattern; -})(); - -exports.getShadingPatternFromIR = getShadingPatternFromIR; -exports.TilingPattern = TilingPattern; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayCanvas = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayPatternHelper, root.pdfjsDisplayWebGL); - } -}(this, function (exports, sharedUtil, displayPatternHelper, displayWebGL) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; -var ImageKind = sharedUtil.ImageKind; -var OPS = sharedUtil.OPS; -var TextRenderingMode = sharedUtil.TextRenderingMode; -var Uint32ArrayView = sharedUtil.Uint32ArrayView; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var info = sharedUtil.info; -var isNum = sharedUtil.isNum; -var isArray = sharedUtil.isArray; -var error = sharedUtil.error; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; -var TilingPattern = displayPatternHelper.TilingPattern; -var getShadingPatternFromIR = displayPatternHelper.getShadingPatternFromIR; -var WebGLUtils = displayWebGL.WebGLUtils; - -// contexts store most of the state we need natively. -// However, PDF needs a bit more state, which we store here. - -// Minimal font size that would be used during canvas fillText operations. -var MIN_FONT_SIZE = 16; -// Maximum font size that would be used during canvas fillText operations. -var MAX_FONT_SIZE = 100; -var MAX_GROUP_SIZE = 4096; - -// Heuristic value used when enforcing minimum line widths. -var MIN_WIDTH_FACTOR = 0.65; - -var COMPILE_TYPE3_GLYPHS = true; -var MAX_SIZE_TO_COMPILE = 1000; - -var FULL_CHUNK_HEIGHT = 16; - -function createScratchCanvas(width, height) { - var canvas = document.createElement('canvas'); - canvas.width = width; - canvas.height = height; - return canvas; -} - -function addContextCurrentTransform(ctx) { - // If the context doesn't expose a `mozCurrentTransform`, add a JS based one. - if (!ctx.mozCurrentTransform) { - ctx._originalSave = ctx.save; - ctx._originalRestore = ctx.restore; - ctx._originalRotate = ctx.rotate; - ctx._originalScale = ctx.scale; - ctx._originalTranslate = ctx.translate; - ctx._originalTransform = ctx.transform; - ctx._originalSetTransform = ctx.setTransform; - - ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; - ctx._transformStack = []; - - Object.defineProperty(ctx, 'mozCurrentTransform', { - get: function getCurrentTransform() { - return this._transformMatrix; - } - }); - - Object.defineProperty(ctx, 'mozCurrentTransformInverse', { - get: function getCurrentTransformInverse() { - // Calculation done using WolframAlpha: - // http://www.wolframalpha.com/input/? - // i=Inverse+{{a%2C+c%2C+e}%2C+{b%2C+d%2C+f}%2C+{0%2C+0%2C+1}} - - var m = this._transformMatrix; - var a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5]; - - var ad_bc = a * d - b * c; - var bc_ad = b * c - a * d; - - return [ - d / ad_bc, - b / bc_ad, - c / bc_ad, - a / ad_bc, - (d * e - c * f) / bc_ad, - (b * e - a * f) / ad_bc - ]; - } - }); - - ctx.save = function ctxSave() { - var old = this._transformMatrix; - this._transformStack.push(old); - this._transformMatrix = old.slice(0, 6); - - this._originalSave(); - }; - - ctx.restore = function ctxRestore() { - var prev = this._transformStack.pop(); - if (prev) { - this._transformMatrix = prev; - this._originalRestore(); - } - }; - - ctx.translate = function ctxTranslate(x, y) { - var m = this._transformMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - - this._originalTranslate(x, y); - }; - - ctx.scale = function ctxScale(x, y) { - var m = this._transformMatrix; - m[0] = m[0] * x; - m[1] = m[1] * x; - m[2] = m[2] * y; - m[3] = m[3] * y; - - this._originalScale(x, y); - }; - - ctx.transform = function ctxTransform(a, b, c, d, e, f) { - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * a + m[2] * b, - m[1] * a + m[3] * b, - m[0] * c + m[2] * d, - m[1] * c + m[3] * d, - m[0] * e + m[2] * f + m[4], - m[1] * e + m[3] * f + m[5] - ]; - - ctx._originalTransform(a, b, c, d, e, f); - }; - - ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { - this._transformMatrix = [a, b, c, d, e, f]; - - ctx._originalSetTransform(a, b, c, d, e, f); - }; - - ctx.rotate = function ctxRotate(angle) { - var cosValue = Math.cos(angle); - var sinValue = Math.sin(angle); - - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * cosValue + m[2] * sinValue, - m[1] * cosValue + m[3] * sinValue, - m[0] * (-sinValue) + m[2] * cosValue, - m[1] * (-sinValue) + m[3] * cosValue, - m[4], - m[5] - ]; - - this._originalRotate(angle); - }; - } -} - -var CachedCanvases = (function CachedCanvasesClosure() { - function CachedCanvases() { - this.cache = Object.create(null); - } - CachedCanvases.prototype = { - getCanvas: function CachedCanvases_getCanvas(id, width, height, - trackTransform) { - var canvasEntry; - if (this.cache[id] !== undefined) { - canvasEntry = this.cache[id]; - canvasEntry.canvas.width = width; - canvasEntry.canvas.height = height; - // reset canvas transform for emulated mozCurrentTransform, if needed - canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0); - } else { - var canvas = createScratchCanvas(width, height); - var ctx = canvas.getContext('2d'); - if (trackTransform) { - addContextCurrentTransform(ctx); - } - this.cache[id] = canvasEntry = {canvas: canvas, context: ctx}; - } - return canvasEntry; - }, - clear: function () { - for (var id in this.cache) { - var canvasEntry = this.cache[id]; - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - canvasEntry.canvas.width = 0; - canvasEntry.canvas.height = 0; - delete this.cache[id]; - } - } - }; - return CachedCanvases; -})(); - -function compileType3Glyph(imgData) { - var POINT_TO_PROCESS_LIMIT = 1000; - - var width = imgData.width, height = imgData.height; - var i, j, j0, width1 = width + 1; - var points = new Uint8Array(width1 * (height + 1)); - var POINT_TYPES = - new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); - - // decodes bit-packed mask data - var lineSize = (width + 7) & ~7, data0 = imgData.data; - var data = new Uint8Array(lineSize * height), pos = 0, ii; - for (i = 0, ii = data0.length; i < ii; i++) { - var mask = 128, elem = data0[i]; - while (mask > 0) { - data[pos++] = (elem & mask) ? 0 : 255; - mask >>= 1; - } - } - - // finding iteresting points: every point is located between mask pixels, - // so there will be points of the (width + 1)x(height + 1) grid. Every point - // will have flags assigned based on neighboring mask pixels: - // 4 | 8 - // --P-- - // 2 | 1 - // We are interested only in points with the flags: - // - outside corners: 1, 2, 4, 8; - // - inside corners: 7, 11, 13, 14; - // - and, intersections: 5, 10. - var count = 0; - pos = 0; - if (data[pos] !== 0) { - points[0] = 1; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j] = data[pos] ? 2 : 1; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j] = 2; - ++count; - } - for (i = 1; i < height; i++) { - pos = i * lineSize; - j0 = i * width1; - if (data[pos - lineSize] !== data[pos]) { - points[j0] = data[pos] ? 1 : 8; - ++count; - } - // 'sum' is the position of the current pixel configuration in the 'TYPES' - // array (in order 8-1-2-4, so we can use '>>2' to shift the column). - var sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); - for (j = 1; j < width; j++) { - sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + - (data[pos - lineSize + 1] ? 8 : 0); - if (POINT_TYPES[sum]) { - points[j0 + j] = POINT_TYPES[sum]; - ++count; - } - pos++; - } - if (data[pos - lineSize] !== data[pos]) { - points[j0 + j] = data[pos] ? 2 : 4; - ++count; - } - - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - } - - pos = lineSize * (height - 1); - j0 = i * width1; - if (data[pos] !== 0) { - points[j0] = 8; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j0 + j] = data[pos] ? 4 : 8; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j0 + j] = 4; - ++count; - } - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - - // building outlines - var steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); - var outlines = []; - for (i = 0; count && i <= height; i++) { - var p = i * width1; - var end = p + width; - while (p < end && !points[p]) { - p++; - } - if (p === end) { - continue; - } - var coords = [p % width1, i]; - - var type = points[p], p0 = p, pp; - do { - var step = steps[type]; - do { - p += step; - } while (!points[p]); - - pp = points[p]; - if (pp !== 5 && pp !== 10) { - // set new direction - type = pp; - // delete mark - points[p] = 0; - } else { // type is 5 or 10, ie, a crossing - // set new direction - type = pp & ((0x33 * type) >> 4); - // set new type for "future hit" - points[p] &= (type >> 2 | type << 2); - } - - coords.push(p % width1); - coords.push((p / width1) | 0); - --count; - } while (p0 !== p); - outlines.push(coords); - --i; - } - - var drawOutline = function(c) { - c.save(); - // the path shall be painted in [0..1]x[0..1] space - c.scale(1 / width, -1 / height); - c.translate(0, -height); - c.beginPath(); - for (var i = 0, ii = outlines.length; i < ii; i++) { - var o = outlines[i]; - c.moveTo(o[0], o[1]); - for (var j = 2, jj = o.length; j < jj; j += 2) { - c.lineTo(o[j], o[j+1]); - } - } - c.fill(); - c.beginPath(); - c.restore(); - }; - - return drawOutline; -} - -var CanvasExtraState = (function CanvasExtraStateClosure() { - function CanvasExtraState(old) { - // Are soft masks and alpha values shapes or opacities? - this.alphaIsShape = false; - this.fontSize = 0; - this.fontSizeScale = 1; - this.textMatrix = IDENTITY_MATRIX; - this.textMatrixScale = 1; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRenderingMode = TextRenderingMode.FILL; - this.textRise = 0; - // Default fore and background colors - this.fillColor = '#000000'; - this.strokeColor = '#000000'; - this.patternFill = false; - // Note: fill alpha applies to all non-stroking operations - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.activeSMask = null; // nonclonable field (see the save method below) - - this.old = old; - } - - CanvasExtraState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function CanvasExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return CanvasExtraState; -})(); - -var CanvasGraphics = (function CanvasGraphicsClosure() { - // Defines the time the executeOperatorList is going to be executing - // before it stops and shedules a continue of execution. - var EXECUTION_TIME = 15; - // Defines the number of steps before checking the execution time - var EXECUTION_STEPS = 10; - - function CanvasGraphics(canvasCtx, commonObjs, objs, imageLayer) { - this.ctx = canvasCtx; - this.current = new CanvasExtraState(); - this.stateStack = []; - this.pendingClip = null; - this.pendingEOFill = false; - this.res = null; - this.xobjs = null; - this.commonObjs = commonObjs; - this.objs = objs; - this.imageLayer = imageLayer; - this.groupStack = []; - this.processingType3 = null; - // Patterns are painted relative to the initial page/form transform, see pdf - // spec 8.7.2 NOTE 1. - this.baseTransform = null; - this.baseTransformStack = []; - this.groupLevel = 0; - this.smaskStack = []; - this.smaskCounter = 0; - this.tempSMask = null; - this.cachedCanvases = new CachedCanvases(); - if (canvasCtx) { - // NOTE: if mozCurrentTransform is polyfilled, then the current state of - // the transformation must already be set in canvasCtx._transformMatrix. - addContextCurrentTransform(canvasCtx); - } - this.cachedGetSinglePixelWidth = null; - } - - function putBinaryImageData(ctx, imgData) { - if (typeof ImageData !== 'undefined' && imgData instanceof ImageData) { - ctx.putImageData(imgData, 0, 0); - return; - } - - // Put the image data to the canvas in chunks, rather than putting the - // whole image at once. This saves JS memory, because the ImageData object - // is smaller. It also possibly saves C++ memory within the implementation - // of putImageData(). (E.g. in Firefox we make two short-lived copies of - // the data passed to putImageData()). |n| shouldn't be too small, however, - // because too many putImageData() calls will slow things down. - // - // Note: as written, if the last chunk is partial, the putImageData() call - // will (conceptually) put pixels past the bounds of the canvas. But - // that's ok; any such pixels are ignored. - - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0, destPos; - var src = imgData.data; - var dest = chunkImgData.data; - var i, j, thisChunkHeight, elemsInThisChunk; - - // There are multiple forms in which the pixel data can be passed, and - // imgData.kind tells us which one this is. - if (imgData.kind === ImageKind.GRAYSCALE_1BPP) { - // Grayscale, 1 bit per pixel (i.e. black-and-white). - var srcLength = src.byteLength; - var dest32 = PDFJS.hasCanvasTypedArrays ? new Uint32Array(dest.buffer) : - new Uint32ArrayView(dest); - var dest32DataLength = dest32.length; - var fullSrcDiff = (width + 7) >> 3; - var white = 0xFFFFFFFF; - var black = (PDFJS.isLittleEndian || !PDFJS.hasCanvasTypedArrays) ? - 0xFF000000 : 0x000000FF; - for (i = 0; i < totalChunks; i++) { - thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - destPos = 0; - for (j = 0; j < thisChunkHeight; j++) { - var srcDiff = srcLength - srcPos; - var k = 0; - var kEnd = (srcDiff > fullSrcDiff) ? width : srcDiff * 8 - 7; - var kEndUnrolled = kEnd & ~7; - var mask = 0; - var srcByte = 0; - for (; k < kEndUnrolled; k += 8) { - srcByte = src[srcPos++]; - dest32[destPos++] = (srcByte & 128) ? white : black; - dest32[destPos++] = (srcByte & 64) ? white : black; - dest32[destPos++] = (srcByte & 32) ? white : black; - dest32[destPos++] = (srcByte & 16) ? white : black; - dest32[destPos++] = (srcByte & 8) ? white : black; - dest32[destPos++] = (srcByte & 4) ? white : black; - dest32[destPos++] = (srcByte & 2) ? white : black; - dest32[destPos++] = (srcByte & 1) ? white : black; - } - for (; k < kEnd; k++) { - if (mask === 0) { - srcByte = src[srcPos++]; - mask = 128; - } - - dest32[destPos++] = (srcByte & mask) ? white : black; - mask >>= 1; - } - } - // We ran out of input. Make all remaining pixels transparent. - while (destPos < dest32DataLength) { - dest32[destPos++] = 0; - } - - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else if (imgData.kind === ImageKind.RGBA_32BPP) { - // RGBA, 32-bits per pixel. - - j = 0; - elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; - for (i = 0; i < fullChunks; i++) { - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - srcPos += elemsInThisChunk; - - ctx.putImageData(chunkImgData, 0, j); - j += FULL_CHUNK_HEIGHT; - } - if (i < totalChunks) { - elemsInThisChunk = width * partialChunkHeight * 4; - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - ctx.putImageData(chunkImgData, 0, j); - } - - } else if (imgData.kind === ImageKind.RGB_24BPP) { - // RGB, 24-bits per pixel. - thisChunkHeight = FULL_CHUNK_HEIGHT; - elemsInThisChunk = width * thisChunkHeight; - for (i = 0; i < totalChunks; i++) { - if (i >= fullChunks) { - thisChunkHeight = partialChunkHeight; - elemsInThisChunk = width * thisChunkHeight; - } - - destPos = 0; - for (j = elemsInThisChunk; j--;) { - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = 255; - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else { - error('bad image kind: ' + imgData.kind); - } - } - - function putBinaryImageMask(ctx, imgData) { - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0; - var src = imgData.data; - var dest = chunkImgData.data; - - for (var i = 0; i < totalChunks; i++) { - var thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - - // Expand the mask so it can be used by the canvas. Any required - // inversion has already been handled. - var destPos = 3; // alpha component offset - for (var j = 0; j < thisChunkHeight; j++) { - var mask = 0; - for (var k = 0; k < width; k++) { - if (!mask) { - var elem = src[srcPos++]; - mask = 128; - } - dest[destPos] = (elem & mask) ? 0 : 255; - destPos += 4; - mask >>= 1; - } - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } - - function copyCtxState(sourceCtx, destCtx) { - var properties = ['strokeStyle', 'fillStyle', 'fillRule', 'globalAlpha', - 'lineWidth', 'lineCap', 'lineJoin', 'miterLimit', - 'globalCompositeOperation', 'font']; - for (var i = 0, ii = properties.length; i < ii; i++) { - var property = properties[i]; - if (sourceCtx[property] !== undefined) { - destCtx[property] = sourceCtx[property]; - } - } - if (sourceCtx.setLineDash !== undefined) { - destCtx.setLineDash(sourceCtx.getLineDash()); - destCtx.lineDashOffset = sourceCtx.lineDashOffset; - } else if (sourceCtx.mozDashOffset !== undefined) { - destCtx.mozDash = sourceCtx.mozDash; - destCtx.mozDashOffset = sourceCtx.mozDashOffset; - } - } - - function composeSMaskBackdrop(bytes, r0, g0, b0) { - var length = bytes.length; - for (var i = 3; i < length; i += 4) { - var alpha = bytes[i]; - if (alpha === 0) { - bytes[i - 3] = r0; - bytes[i - 2] = g0; - bytes[i - 1] = b0; - } else if (alpha < 255) { - var alpha_ = 255 - alpha; - bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8; - bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8; - bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8; - } - } - } - - function composeSMaskAlpha(maskData, layerData, transferMap) { - var length = maskData.length; - var scale = 1 / 255; - for (var i = 3; i < length; i += 4) { - var alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; - layerData[i] = (layerData[i] * alpha * scale) | 0; - } - } - - function composeSMaskLuminosity(maskData, layerData, transferMap) { - var length = maskData.length; - for (var i = 3; i < length; i += 4) { - var y = (maskData[i - 3] * 77) + // * 0.3 / 255 * 0x10000 - (maskData[i - 2] * 152) + // * 0.59 .... - (maskData[i - 1] * 28); // * 0.11 .... - layerData[i] = transferMap ? - (layerData[i] * transferMap[y >> 8]) >> 8 : - (layerData[i] * y) >> 16; - } - } - - function genericComposeSMask(maskCtx, layerCtx, width, height, - subtype, backdrop, transferMap) { - var hasBackdrop = !!backdrop; - var r0 = hasBackdrop ? backdrop[0] : 0; - var g0 = hasBackdrop ? backdrop[1] : 0; - var b0 = hasBackdrop ? backdrop[2] : 0; - - var composeFn; - if (subtype === 'Luminosity') { - composeFn = composeSMaskLuminosity; - } else { - composeFn = composeSMaskAlpha; - } - - // processing image in chunks to save memory - var PIXELS_TO_PROCESS = 1048576; - var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); - for (var row = 0; row < height; row += chunkSize) { - var chunkHeight = Math.min(chunkSize, height - row); - var maskData = maskCtx.getImageData(0, row, width, chunkHeight); - var layerData = layerCtx.getImageData(0, row, width, chunkHeight); - - if (hasBackdrop) { - composeSMaskBackdrop(maskData.data, r0, g0, b0); - } - composeFn(maskData.data, layerData.data, transferMap); - - maskCtx.putImageData(layerData, 0, row); - } - } - - function composeSMask(ctx, smask, layerCtx) { - var mask = smask.canvas; - var maskCtx = smask.context; - - ctx.setTransform(smask.scaleX, 0, 0, smask.scaleY, - smask.offsetX, smask.offsetY); - - var backdrop = smask.backdrop || null; - if (!smask.transferMap && WebGLUtils.isEnabled) { - var composed = WebGLUtils.composeSMask(layerCtx.canvas, mask, - {subtype: smask.subtype, backdrop: backdrop}); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(composed, smask.offsetX, smask.offsetY); - return; - } - genericComposeSMask(maskCtx, layerCtx, mask.width, mask.height, - smask.subtype, backdrop, smask.transferMap); - ctx.drawImage(mask, 0, 0); - } - - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var NORMAL_CLIP = {}; - var EO_CLIP = {}; - - CanvasGraphics.prototype = { - - beginDrawing: function CanvasGraphics_beginDrawing(transform, viewport, - transparency) { - // For pdfs that use blend modes we have to clear the canvas else certain - // blend modes can look wrong since we'd be blending with a white - // backdrop. The problem with a transparent backdrop though is we then - // don't get sub pixel anti aliasing on text, creating temporary - // transparent canvas when we have blend modes. - var width = this.ctx.canvas.width; - var height = this.ctx.canvas.height; - - this.ctx.save(); - this.ctx.fillStyle = 'rgb(255, 255, 255)'; - this.ctx.fillRect(0, 0, width, height); - this.ctx.restore(); - - if (transparency) { - var transparentCanvas = this.cachedCanvases.getCanvas( - 'transparent', width, height, true); - this.compositeCtx = this.ctx; - this.transparentCanvas = transparentCanvas.canvas; - this.ctx = transparentCanvas.context; - this.ctx.save(); - // The transform can be applied before rendering, transferring it to - // the new canvas. - this.ctx.transform.apply(this.ctx, - this.compositeCtx.mozCurrentTransform); - } - - this.ctx.save(); - if (transform) { - this.ctx.transform.apply(this.ctx, transform); - } - this.ctx.transform.apply(this.ctx, viewport.transform); - - this.baseTransform = this.ctx.mozCurrentTransform.slice(); - - if (this.imageLayer) { - this.imageLayer.beginLayout(); - } - }, - - executeOperatorList: function CanvasGraphics_executeOperatorList( - operatorList, - executionStartIdx, continueCallback, - stepper) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var i = executionStartIdx || 0; - var argsArrayLen = argsArray.length; - - // Sometimes the OperatorList to execute is empty. - if (argsArrayLen === i) { - return i; - } - - var chunkOperations = (argsArrayLen - i > EXECUTION_STEPS && - typeof continueCallback === 'function'); - var endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; - var steps = 0; - - var commonObjs = this.commonObjs; - var objs = this.objs; - var fnId; - - while (true) { - if (stepper !== undefined && i === stepper.nextBreakPoint) { - stepper.breakIt(i, continueCallback); - return i; - } - - fnId = fnArray[i]; - - if (fnId !== OPS.dependency) { - this[fnId].apply(this, argsArray[i]); - } else { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var depObjId = deps[n]; - var common = depObjId[0] === 'g' && depObjId[1] === '_'; - var objsPool = common ? commonObjs : objs; - - // If the promise isn't resolved yet, add the continueCallback - // to the promise and bail out. - if (!objsPool.isResolved(depObjId)) { - objsPool.get(depObjId, continueCallback); - return i; - } - } - } - - i++; - - // If the entire operatorList was executed, stop as were done. - if (i === argsArrayLen) { - return i; - } - - // If the execution took longer then a certain amount of time and - // `continueCallback` is specified, interrupt the execution. - if (chunkOperations && ++steps > EXECUTION_STEPS) { - if (Date.now() > endTime) { - continueCallback(); - return i; - } - steps = 0; - } - - // If the operatorList isn't executed completely yet OR the execution - // time was short enough, do another execution round. - } - }, - - endDrawing: function CanvasGraphics_endDrawing() { - this.ctx.restore(); - - if (this.transparentCanvas) { - this.ctx = this.compositeCtx; - this.ctx.drawImage(this.transparentCanvas, 0, 0); - this.transparentCanvas = null; - } - - this.cachedCanvases.clear(); - WebGLUtils.clear(); - - if (this.imageLayer) { - this.imageLayer.endLayout(); - } - }, - - // Graphics state - setLineWidth: function CanvasGraphics_setLineWidth(width) { - this.current.lineWidth = width; - this.ctx.lineWidth = width; - }, - setLineCap: function CanvasGraphics_setLineCap(style) { - this.ctx.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function CanvasGraphics_setLineJoin(style) { - this.ctx.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function CanvasGraphics_setMiterLimit(limit) { - this.ctx.miterLimit = limit; - }, - setDash: function CanvasGraphics_setDash(dashArray, dashPhase) { - var ctx = this.ctx; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashPhase; - } else { - ctx.mozDash = dashArray; - ctx.mozDashOffset = dashPhase; - } - }, - setRenderingIntent: function CanvasGraphics_setRenderingIntent(intent) { - // Maybe if we one day fully support color spaces this will be important - // for now we can ignore. - // TODO set rendering intent? - }, - setFlatness: function CanvasGraphics_setFlatness(flatness) { - // There's no way to control this with canvas, but we can safely ignore. - // TODO set flatness? - }, - setGState: function CanvasGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - this.setRenderingIntent(value); - break; - case 'FL': - this.setFlatness(value); - break; - case 'Font': - this.setFont(value[0], value[1]); - break; - case 'CA': - this.current.strokeAlpha = state[1]; - break; - case 'ca': - this.current.fillAlpha = state[1]; - this.ctx.globalAlpha = state[1]; - break; - case 'BM': - if (value && value.name && (value.name !== 'Normal')) { - var mode = value.name.replace(/([A-Z])/g, - function(c) { - return '-' + c.toLowerCase(); - } - ).substring(1); - this.ctx.globalCompositeOperation = mode; - if (this.ctx.globalCompositeOperation !== mode) { - warn('globalCompositeOperation "' + mode + - '" is not supported'); - } - } else { - this.ctx.globalCompositeOperation = 'source-over'; - } - break; - case 'SMask': - if (this.current.activeSMask) { - this.endSMaskGroup(); - } - this.current.activeSMask = value ? this.tempSMask : null; - if (this.current.activeSMask) { - this.beginSMaskGroup(); - } - this.tempSMask = null; - break; - } - } - }, - beginSMaskGroup: function CanvasGraphics_beginSMaskGroup() { - - var activeSMask = this.current.activeSMask; - var drawnWidth = activeSMask.canvas.width; - var drawnHeight = activeSMask.canvas.height; - var cacheId = 'smaskGroupAt' + this.groupLevel; - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - - var currentCtx = this.ctx; - var currentTransform = currentCtx.mozCurrentTransform; - this.ctx.save(); - - var groupCtx = scratchCanvas.context; - groupCtx.scale(1 / activeSMask.scaleX, 1 / activeSMask.scaleY); - groupCtx.translate(-activeSMask.offsetX, -activeSMask.offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - endSMaskGroup: function CanvasGraphics_endSMaskGroup() { - var groupCtx = this.ctx; - this.groupLevel--; - this.ctx = this.groupStack.pop(); - - composeSMask(this.ctx, this.current.activeSMask, groupCtx); - this.ctx.restore(); - copyCtxState(groupCtx, this.ctx); - }, - save: function CanvasGraphics_save() { - this.ctx.save(); - var old = this.current; - this.stateStack.push(old); - this.current = old.clone(); - this.current.activeSMask = null; - }, - restore: function CanvasGraphics_restore() { - if (this.stateStack.length !== 0) { - if (this.current.activeSMask !== null) { - this.endSMaskGroup(); - } - - this.current = this.stateStack.pop(); - this.ctx.restore(); - - // Ensure that the clipping path is reset (fixes issue6413.pdf). - this.pendingClip = null; - - this.cachedGetSinglePixelWidth = null; - } - }, - transform: function CanvasGraphics_transform(a, b, c, d, e, f) { - this.ctx.transform(a, b, c, d, e, f); - - this.cachedGetSinglePixelWidth = null; - }, - - // Path - constructPath: function CanvasGraphics_constructPath(ops, args) { - var ctx = this.ctx; - var current = this.current; - var x = current.x, y = current.y; - for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - if (width === 0) { - width = this.getSinglePixelWidth(); - } - if (height === 0) { - height = this.getSinglePixelWidth(); - } - var xw = x + width; - var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - ctx.moveTo(x, y); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - ctx.lineTo(x, y); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], - x, y); - j += 6; - break; - case OPS.curveTo2: - ctx.bezierCurveTo(x, y, args[j], args[j + 1], - args[j + 2], args[j + 3]); - x = args[j + 2]; - y = args[j + 3]; - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); - j += 4; - break; - case OPS.closePath: - ctx.closePath(); - break; - } - } - current.setCurrentPoint(x, y); - }, - closePath: function CanvasGraphics_closePath() { - this.ctx.closePath(); - }, - stroke: function CanvasGraphics_stroke(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var strokeColor = this.current.strokeColor; - // Prevent drawing too thin lines by enforcing a minimum line width. - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, - this.current.lineWidth); - // For stroke we want to temporarily change the global alpha to the - // stroking alpha. - ctx.globalAlpha = this.current.strokeAlpha; - if (strokeColor && strokeColor.hasOwnProperty('type') && - strokeColor.type === 'Pattern') { - // for patterns, we transform to pattern space, calculate - // the pattern, call stroke, and restore to user space - ctx.save(); - ctx.strokeStyle = strokeColor.getPattern(ctx, this); - ctx.stroke(); - ctx.restore(); - } else { - ctx.stroke(); - } - if (consumePath) { - this.consumePath(); - } - // Restore the global alpha to the fill alpha - ctx.globalAlpha = this.current.fillAlpha; - }, - closeStroke: function CanvasGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - fill: function CanvasGraphics_fill(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - var needRestore = false; - - if (isPatternFill) { - ctx.save(); - if (this.baseTransform) { - ctx.setTransform.apply(ctx, this.baseTransform); - } - ctx.fillStyle = fillColor.getPattern(ctx, this); - needRestore = true; - } - - if (this.pendingEOFill) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.fill(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.fill('evenodd'); - } - this.pendingEOFill = false; - } else { - ctx.fill(); - } - - if (needRestore) { - ctx.restore(); - } - if (consumePath) { - this.consumePath(); - } - }, - eoFill: function CanvasGraphics_eoFill() { - this.pendingEOFill = true; - this.fill(); - }, - fillStroke: function CanvasGraphics_fillStroke() { - this.fill(false); - this.stroke(false); - - this.consumePath(); - }, - eoFillStroke: function CanvasGraphics_eoFillStroke() { - this.pendingEOFill = true; - this.fillStroke(); - }, - closeFillStroke: function CanvasGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - closeEOFillStroke: function CanvasGraphics_closeEOFillStroke() { - this.pendingEOFill = true; - this.closePath(); - this.fillStroke(); - }, - endPath: function CanvasGraphics_endPath() { - this.consumePath(); - }, - - // Clipping - clip: function CanvasGraphics_clip() { - this.pendingClip = NORMAL_CLIP; - }, - eoClip: function CanvasGraphics_eoClip() { - this.pendingClip = EO_CLIP; - }, - - // Text - beginText: function CanvasGraphics_beginText() { - this.current.textMatrix = IDENTITY_MATRIX; - this.current.textMatrixScale = 1; - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - endText: function CanvasGraphics_endText() { - var paths = this.pendingTextPaths; - var ctx = this.ctx; - if (paths === undefined) { - ctx.beginPath(); - return; - } - - ctx.save(); - ctx.beginPath(); - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - ctx.setTransform.apply(ctx, path.transform); - ctx.translate(path.x, path.y); - path.addToPath(ctx, path.fontSize); - } - ctx.restore(); - ctx.clip(); - ctx.beginPath(); - delete this.pendingTextPaths; - }, - setCharSpacing: function CanvasGraphics_setCharSpacing(spacing) { - this.current.charSpacing = spacing; - }, - setWordSpacing: function CanvasGraphics_setWordSpacing(spacing) { - this.current.wordSpacing = spacing; - }, - setHScale: function CanvasGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - setLeading: function CanvasGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - setFont: function CanvasGraphics_setFont(fontRefName, size) { - var fontObj = this.commonObjs.get(fontRefName); - var current = this.current; - - if (!fontObj) { - error('Can\'t find font for ' + fontRefName); - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - // A valid matrix needs all main diagonal elements to be non-zero - // This also ensures we bypass FF bugzilla bug #719844. - if (current.fontMatrix[0] === 0 || - current.fontMatrix[3] === 0) { - warn('Invalid font matrix for font ' + fontRefName); - } - - // The spec for Tf (setFont) says that 'size' specifies the font 'scale', - // and in some docs this can be negative (inverted x-y axes). - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - - this.current.font = fontObj; - this.current.fontSize = size; - - if (fontObj.isType3Font) { - return; // we don't need ctx.font for Type3 fonts - } - - var name = fontObj.loadedName || 'sans-serif'; - var bold = fontObj.black ? (fontObj.bold ? '900' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - - var italic = fontObj.italic ? 'italic' : 'normal'; - var typeface = '"' + name + '", ' + fontObj.fallbackName; - - // Some font backends cannot handle fonts below certain size. - // Keeping the font at minimal size and using the fontSizeScale to change - // the current transformation matrix before the fillText/strokeText. - // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227 - var browserFontSize = size < MIN_FONT_SIZE ? MIN_FONT_SIZE : - size > MAX_FONT_SIZE ? MAX_FONT_SIZE : size; - this.current.fontSizeScale = size / browserFontSize; - - var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface; - this.ctx.font = rule; - }, - setTextRenderingMode: function CanvasGraphics_setTextRenderingMode(mode) { - this.current.textRenderingMode = mode; - }, - setTextRise: function CanvasGraphics_setTextRise(rise) { - this.current.textRise = rise; - }, - moveText: function CanvasGraphics_moveText(x, y) { - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - }, - setLeadingMoveText: function CanvasGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - setTextMatrix: function CanvasGraphics_setTextMatrix(a, b, c, d, e, f) { - this.current.textMatrix = [a, b, c, d, e, f]; - this.current.textMatrixScale = Math.sqrt(a * a + b * b); - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - nextLine: function CanvasGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - paintChar: function CanvasGraphics_paintChar(character, x, y) { - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var textRenderingMode = current.textRenderingMode; - var fontSize = current.fontSize / current.fontSizeScale; - var fillStrokeMode = textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - var isAddToPathSet = !!(textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - - var addToPath; - if (font.disableFontFace || isAddToPathSet) { - addToPath = font.getPathGenerator(this.commonObjs, character); - } - - if (font.disableFontFace) { - ctx.save(); - ctx.translate(x, y); - ctx.beginPath(); - addToPath(ctx, fontSize); - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fill(); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.stroke(); - } - ctx.restore(); - } else { - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fillText(character, x, y); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.strokeText(character, x, y); - } - } - - if (isAddToPathSet) { - var paths = this.pendingTextPaths || (this.pendingTextPaths = []); - paths.push({ - transform: ctx.mozCurrentTransform, - x: x, - y: y, - fontSize: fontSize, - addToPath: addToPath - }); - } - }, - - get isFontSubpixelAAEnabled() { - // Checks if anti-aliasing is enabled when scaled text is painted. - // On Windows GDI scaled fonts looks bad. - var ctx = document.createElement('canvas').getContext('2d'); - ctx.scale(1.5, 1); - ctx.fillText('I', 0, 10); - var data = ctx.getImageData(0, 0, 10, 10).data; - var enabled = false; - for (var i = 3; i < data.length; i += 4) { - if (data[i] > 0 && data[i] < 255) { - enabled = true; - break; - } - } - return shadow(this, 'isFontSubpixelAAEnabled', enabled); - }, - - showText: function CanvasGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - if (font.isType3Font) { - return this.showType3Text(glyphs); - } - - var fontSize = current.fontSize; - if (fontSize === 0) { - return; - } - - var ctx = this.ctx; - var fontSizeScale = current.fontSizeScale; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var spacingDir = vertical ? 1 : -1; - var defaultVMetrics = font.defaultVMetrics; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var simpleFillText = - current.textRenderingMode === TextRenderingMode.FILL && - !font.disableFontFace; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y + current.textRise); - - if (current.patternFill) { - // TODO: Some shading patterns are not applied correctly to text, - // e.g. issues 3988 and 5432, and ShowText-ShadingPattern.pdf. - ctx.fillStyle = current.fillColor.getPattern(ctx, this); - } - - if (fontDirection > 0) { - ctx.scale(textHScale, -1); - } else { - ctx.scale(textHScale, 1); - } - - var lineWidth = current.lineWidth; - var scale = current.textMatrixScale; - if (scale === 0 || lineWidth === 0) { - var fillStrokeMode = current.textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - this.cachedGetSinglePixelWidth = null; - lineWidth = this.getSinglePixelWidth() * MIN_WIDTH_FACTOR; - } - } else { - lineWidth /= scale; - } - - if (fontSizeScale !== 1.0) { - ctx.scale(fontSizeScale, fontSizeScale); - lineWidth /= fontSizeScale; - } - - ctx.lineWidth = lineWidth; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (isNum(glyph)) { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - - var restoreNeeded = false; - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var character = glyph.fontChar; - var accent = glyph.accent; - var scaledX, scaledY, scaledAccentX, scaledAccentY; - var width = glyph.width; - if (vertical) { - var vmetric, vx, vy; - vmetric = glyph.vmetric || defaultVMetrics; - vx = glyph.vmetric ? vmetric[1] : width * 0.5; - vx = -vx * widthAdvanceScale; - vy = vmetric[2] * widthAdvanceScale; - - width = vmetric ? -vmetric[0] : width; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - - if (font.remeasure && width > 0) { - // Some standard fonts may not have the exact width: rescale per - // character if measured width is greater than expected glyph width - // and subpixel-aa is enabled, otherwise just center the glyph. - var measuredWidth = ctx.measureText(character).width * 1000 / - fontSize * fontSizeScale; - if (width < measuredWidth && this.isFontSubpixelAAEnabled) { - var characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; - } else if (width !== measuredWidth) { - scaledX += (width - measuredWidth) / 2000 * - fontSize / fontSizeScale; - } - } - - if (simpleFillText && !accent) { - // common case - ctx.fillText(character, scaledX, scaledY); - } else { - this.paintChar(character, scaledX, scaledY); - if (accent) { - scaledAccentX = scaledX + accent.offset.x / fontSizeScale; - scaledAccentY = scaledY - accent.offset.y / fontSizeScale; - this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY); - } - } - - var charWidth = width * widthAdvanceScale + spacing * fontDirection; - x += charWidth; - - if (restoreNeeded) { - ctx.restore(); - } - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - ctx.restore(); - }, - - showType3Text: function CanvasGraphics_showType3Text(glyphs) { - // Type3 fonts - each glyph is a "mini-PDF" - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - var fontDirection = current.fontDirection; - var spacingDir = font.vertical ? 1 : -1; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var textHScale = current.textHScale * fontDirection; - var fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; - var glyphsLength = glyphs.length; - var isTextInvisible = - current.textRenderingMode === TextRenderingMode.INVISIBLE; - var i, glyph, width, spacingLength; - - if (isTextInvisible || fontSize === 0) { - return; - } - this.cachedGetSinglePixelWidth = null; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y); - - ctx.scale(textHScale, fontDirection); - - for (i = 0; i < glyphsLength; ++i) { - glyph = glyphs[i]; - if (isNum(glyph)) { - spacingLength = spacingDir * glyph * fontSize / 1000; - this.ctx.translate(spacingLength, 0); - current.x += spacingLength * textHScale; - continue; - } - - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var operatorList = font.charProcOperatorList[glyph.operatorListId]; - if (!operatorList) { - warn('Type3 character \"' + glyph.operatorListId + - '\" is not available'); - continue; - } - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform.apply(ctx, fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); - - var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); - width = transformed[0] * fontSize + spacing; - - ctx.translate(width, 0); - current.x += width * textHScale; - } - ctx.restore(); - this.processingType3 = null; - }, - - // Type3 fonts - setCharWidth: function CanvasGraphics_setCharWidth(xWidth, yWidth) { - // We can safely ignore this since the width should be the same - // as the width in the Widths array. - }, - setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth, - yWidth, - llx, - lly, - urx, - ury) { - // TODO According to the spec we're also suppose to ignore any operators - // that set color or include images while processing this type3 font. - this.ctx.rect(llx, lly, urx - llx, ury - lly); - this.clip(); - this.endPath(); - }, - - // Color - getColorN_Pattern: function CanvasGraphics_getColorN_Pattern(IR) { - var pattern; - if (IR[0] === 'TilingPattern') { - var color = IR[1]; - var baseTransform = this.baseTransform || - this.ctx.mozCurrentTransform.slice(); - var self = this; - var canvasGraphicsFactory = { - createCanvasGraphics: function (ctx) { - return new CanvasGraphics(ctx, self.commonObjs, self.objs); - } - }; - pattern = new TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, - baseTransform); - } else { - pattern = getShadingPatternFromIR(IR); - } - return pattern; - }, - setStrokeColorN: function CanvasGraphics_setStrokeColorN(/*...*/) { - this.current.strokeColor = this.getColorN_Pattern(arguments); - }, - setFillColorN: function CanvasGraphics_setFillColorN(/*...*/) { - this.current.fillColor = this.getColorN_Pattern(arguments); - this.current.patternFill = true; - }, - setStrokeRGBColor: function CanvasGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.strokeStyle = color; - this.current.strokeColor = color; - }, - setFillRGBColor: function CanvasGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.fillStyle = color; - this.current.fillColor = color; - this.current.patternFill = false; - }, - - shadingFill: function CanvasGraphics_shadingFill(patternIR) { - var ctx = this.ctx; - - this.save(); - var pattern = getShadingPatternFromIR(patternIR); - ctx.fillStyle = pattern.getPattern(ctx, this, true); - - var inv = ctx.mozCurrentTransformInverse; - if (inv) { - var canvas = ctx.canvas; - var width = canvas.width; - var height = canvas.height; - - var bl = Util.applyTransform([0, 0], inv); - var br = Util.applyTransform([0, height], inv); - var ul = Util.applyTransform([width, 0], inv); - var ur = Util.applyTransform([width, height], inv); - - var x0 = Math.min(bl[0], br[0], ul[0], ur[0]); - var y0 = Math.min(bl[1], br[1], ul[1], ur[1]); - var x1 = Math.max(bl[0], br[0], ul[0], ur[0]); - var y1 = Math.max(bl[1], br[1], ul[1], ur[1]); - - this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); - } else { - // HACK to draw the gradient onto an infinite rectangle. - // PDF gradients are drawn across the entire image while - // Canvas only allows gradients to be drawn in a rectangle - // The following bug should allow us to remove this. - // https://bugzilla.mozilla.org/show_bug.cgi?id=664884 - - this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); - } - - this.restore(); - }, - - // Images - beginInlineImage: function CanvasGraphics_beginInlineImage() { - error('Should not call beginInlineImage'); - }, - beginImageData: function CanvasGraphics_beginImageData() { - error('Should not call beginImageData'); - }, - - paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, - bbox) { - this.save(); - this.baseTransformStack.push(this.baseTransform); - - if (isArray(matrix) && 6 === matrix.length) { - this.transform.apply(this, matrix); - } - - this.baseTransform = this.ctx.mozCurrentTransform; - - if (isArray(bbox) && 4 === bbox.length) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - this.ctx.rect(bbox[0], bbox[1], width, height); - this.clip(); - this.endPath(); - } - }, - - paintFormXObjectEnd: function CanvasGraphics_paintFormXObjectEnd() { - this.restore(); - this.baseTransform = this.baseTransformStack.pop(); - }, - - beginGroup: function CanvasGraphics_beginGroup(group) { - this.save(); - var currentCtx = this.ctx; - // TODO non-isolated groups - according to Rik at adobe non-isolated - // group results aren't usually that different and they even have tools - // that ignore this setting. Notes from Rik on implmenting: - // - When you encounter an transparency group, create a new canvas with - // the dimensions of the bbox - // - copy the content from the previous canvas to the new canvas - // - draw as usual - // - remove the backdrop alpha: - // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha - // value of your transparency group and 'alphaBackdrop' the alpha of the - // backdrop - // - remove background color: - // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) - if (!group.isolated) { - info('TODO: Support non-isolated groups.'); - } - - // TODO knockout - supposedly possible with the clever use of compositing - // modes. - if (group.knockout) { - warn('Knockout groups not supported.'); - } - - var currentTransform = currentCtx.mozCurrentTransform; - if (group.matrix) { - currentCtx.transform.apply(currentCtx, group.matrix); - } - assert(group.bbox, 'Bounding box is required.'); - - // Based on the current transform figure out how big the bounding box - // will actually be. - var bounds = Util.getAxialAlignedBoundingBox( - group.bbox, - currentCtx.mozCurrentTransform); - // Clip the bounding box to the current canvas. - var canvasBounds = [0, - 0, - currentCtx.canvas.width, - currentCtx.canvas.height]; - bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; - // Use ceil in case we're between sizes so we don't create canvas that is - // too small and make the canvas at least 1x1 pixels. - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); - var drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); - var scaleX = 1, scaleY = 1; - if (drawnWidth > MAX_GROUP_SIZE) { - scaleX = drawnWidth / MAX_GROUP_SIZE; - drawnWidth = MAX_GROUP_SIZE; - } - if (drawnHeight > MAX_GROUP_SIZE) { - scaleY = drawnHeight / MAX_GROUP_SIZE; - drawnHeight = MAX_GROUP_SIZE; - } - - var cacheId = 'groupAt' + this.groupLevel; - if (group.smask) { - // Using two cache entries is case if masks are used one after another. - cacheId += '_smask_' + ((this.smaskCounter++) % 2); - } - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - var groupCtx = scratchCanvas.context; - - // Since we created a new canvas that is just the size of the bounding box - // we have to translate the group ctx. - groupCtx.scale(1 / scaleX, 1 / scaleY); - groupCtx.translate(-offsetX, -offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - if (group.smask) { - // Saving state and cached mask to be used in setGState. - this.smaskStack.push({ - canvas: scratchCanvas.canvas, - context: groupCtx, - offsetX: offsetX, - offsetY: offsetY, - scaleX: scaleX, - scaleY: scaleY, - subtype: group.smask.subtype, - backdrop: group.smask.backdrop, - transferMap: group.smask.transferMap || null - }); - } else { - // Setup the current ctx so when the group is popped we draw it at the - // right location. - currentCtx.setTransform(1, 0, 0, 1, 0, 0); - currentCtx.translate(offsetX, offsetY); - currentCtx.scale(scaleX, scaleY); - } - // The transparency group inherits all off the current graphics state - // except the blend mode, soft mask, and alpha constants. - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - - endGroup: function CanvasGraphics_endGroup(group) { - this.groupLevel--; - var groupCtx = this.ctx; - this.ctx = this.groupStack.pop(); - // Turn off image smoothing to avoid sub pixel interpolation which can - // look kind of blurry for some pdfs. - if (this.ctx.imageSmoothingEnabled !== undefined) { - this.ctx.imageSmoothingEnabled = false; - } else { - this.ctx.mozImageSmoothingEnabled = false; - } - if (group.smask) { - this.tempSMask = this.smaskStack.pop(); - } else { - this.ctx.drawImage(groupCtx.canvas, 0, 0); - } - this.restore(); - }, - - beginAnnotations: function CanvasGraphics_beginAnnotations() { - this.save(); - this.current = new CanvasExtraState(); - - if (this.baseTransform) { - this.ctx.setTransform.apply(this.ctx, this.baseTransform); - } - }, - - endAnnotations: function CanvasGraphics_endAnnotations() { - this.restore(); - }, - - beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform, - matrix) { - this.save(); - - if (isArray(rect) && 4 === rect.length) { - var width = rect[2] - rect[0]; - var height = rect[3] - rect[1]; - this.ctx.rect(rect[0], rect[1], width, height); - this.clip(); - this.endPath(); - } - - this.transform.apply(this, transform); - this.transform.apply(this, matrix); - }, - - endAnnotation: function CanvasGraphics_endAnnotation() { - this.restore(); - }, - - paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) { - var domImage = this.objs.get(objId); - if (!domImage) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.save(); - - var ctx = this.ctx; - // scale the image to the unit square - ctx.scale(1 / w, -1 / h); - - ctx.drawImage(domImage, 0, 0, domImage.width, domImage.height, - 0, -h, w, h); - if (this.imageLayer) { - var currentTransform = ctx.mozCurrentTransformInverse; - var position = this.getCanvasPosition(0, 0); - this.imageLayer.appendImage({ - objId: objId, - left: position[0], - top: position[1], - width: w / currentTransform[0], - height: h / currentTransform[3] - }); - } - this.restore(); - }, - - paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) { - var ctx = this.ctx; - var width = img.width, height = img.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var glyph = this.processingType3; - - if (COMPILE_TYPE3_GLYPHS && glyph && glyph.compiled === undefined) { - if (width <= MAX_SIZE_TO_COMPILE && height <= MAX_SIZE_TO_COMPILE) { - glyph.compiled = - compileType3Glyph({data: img.data, width: width, height: height}); - } else { - glyph.compiled = null; - } - } - - if (glyph && glyph.compiled) { - glyph.compiled(ctx); - return; - } - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, img); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - this.paintInlineImageXObject(maskCanvas.canvas); - }, - - paintImageMaskXObjectRepeat: - function CanvasGraphics_paintImageMaskXObjectRepeat(imgData, scaleX, - scaleY, positions) { - var width = imgData.width; - var height = imgData.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, imgData); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - var ctx = this.ctx; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - ctx.save(); - ctx.transform(scaleX, 0, 0, scaleY, positions[i], positions[i + 1]); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageMaskXObjectGroup: - function CanvasGraphics_paintImageMaskXObjectGroup(images) { - var ctx = this.ctx; - - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - for (var i = 0, ii = images.length; i < ii; i++) { - var image = images[i]; - var width = image.width, height = image.height; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, image); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - ctx.save(); - ctx.transform.apply(ctx, image.transform); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageXObject: function CanvasGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.paintInlineImageXObject(imgData); - }, - - paintImageXObjectRepeat: - function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, - positions) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - var width = imgData.width; - var height = imgData.height; - var map = []; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - map.push({transform: [scaleX, 0, 0, scaleY, positions[i], - positions[i + 1]], x: 0, y: 0, w: width, h: height}); - } - this.paintInlineImageXObjectGroup(imgData, map); - }, - - paintInlineImageXObject: - function CanvasGraphics_paintInlineImageXObject(imgData) { - var width = imgData.width; - var height = imgData.height; - var ctx = this.ctx; - - this.save(); - // scale the image to the unit square - ctx.scale(1 / width, -1 / height); - - var currentTransform = ctx.mozCurrentTransformInverse; - var a = currentTransform[0], b = currentTransform[1]; - var widthScale = Math.max(Math.sqrt(a * a + b * b), 1); - var c = currentTransform[2], d = currentTransform[3]; - var heightScale = Math.max(Math.sqrt(c * c + d * d), 1); - - var imgToPaint, tmpCanvas; - // instanceof HTMLElement does not work in jsdom node.js module - if (imgData instanceof HTMLElement || !imgData.data) { - imgToPaint = imgData; - } else { - tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', - width, height); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - imgToPaint = tmpCanvas.canvas; - } - - var paintWidth = width, paintHeight = height; - var tmpCanvasId = 'prescale1'; - // Vertial or horizontal scaling shall not be more than 2 to not loose the - // pixels during drawImage operation, painting on the temporary canvas(es) - // that are twice smaller in size - while ((widthScale > 2 && paintWidth > 1) || - (heightScale > 2 && paintHeight > 1)) { - var newWidth = paintWidth, newHeight = paintHeight; - if (widthScale > 2 && paintWidth > 1) { - newWidth = Math.ceil(paintWidth / 2); - widthScale /= paintWidth / newWidth; - } - if (heightScale > 2 && paintHeight > 1) { - newHeight = Math.ceil(paintHeight / 2); - heightScale /= paintHeight / newHeight; - } - tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, - newWidth, newHeight); - tmpCtx = tmpCanvas.context; - tmpCtx.clearRect(0, 0, newWidth, newHeight); - tmpCtx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, 0, newWidth, newHeight); - imgToPaint = tmpCanvas.canvas; - paintWidth = newWidth; - paintHeight = newHeight; - tmpCanvasId = tmpCanvasId === 'prescale1' ? 'prescale2' : 'prescale1'; - } - ctx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, -height, width, height); - - if (this.imageLayer) { - var position = this.getCanvasPosition(0, -height); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: width / currentTransform[0], - height: height / currentTransform[3] - }); - } - this.restore(); - }, - - paintInlineImageXObjectGroup: - function CanvasGraphics_paintInlineImageXObjectGroup(imgData, map) { - var ctx = this.ctx; - var w = imgData.width; - var h = imgData.height; - - var tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', w, h); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - - for (var i = 0, ii = map.length; i < ii; i++) { - var entry = map[i]; - ctx.save(); - ctx.transform.apply(ctx, entry.transform); - ctx.scale(1, -1); - ctx.drawImage(tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, - 0, -1, 1, 1); - if (this.imageLayer) { - var position = this.getCanvasPosition(entry.x, entry.y); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: w, - height: h - }); - } - ctx.restore(); - } - }, - - paintSolidColorImageMask: - function CanvasGraphics_paintSolidColorImageMask() { - this.ctx.fillRect(0, 0, 1, 1); - }, - - paintXObject: function CanvasGraphics_paintXObject() { - warn('Unsupported \'paintXObject\' command.'); - }, - - // Marked content - - markPoint: function CanvasGraphics_markPoint(tag) { - // TODO Marked content. - }, - markPointProps: function CanvasGraphics_markPointProps(tag, properties) { - // TODO Marked content. - }, - beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) { - // TODO Marked content. - }, - beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps( - tag, properties) { - // TODO Marked content. - }, - endMarkedContent: function CanvasGraphics_endMarkedContent() { - // TODO Marked content. - }, - - // Compatibility - - beginCompat: function CanvasGraphics_beginCompat() { - // TODO ignore undefined operators (should we do that anyway?) - }, - endCompat: function CanvasGraphics_endCompat() { - // TODO stop ignoring undefined operators - }, - - // Helper functions - - consumePath: function CanvasGraphics_consumePath() { - var ctx = this.ctx; - if (this.pendingClip) { - if (this.pendingClip === EO_CLIP) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.clip(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.clip('evenodd'); - } - } else { - ctx.clip(); - } - this.pendingClip = null; - } - ctx.beginPath(); - }, - getSinglePixelWidth: function CanvasGraphics_getSinglePixelWidth(scale) { - if (this.cachedGetSinglePixelWidth === null) { - var inverse = this.ctx.mozCurrentTransformInverse; - // max of the current horizontal and vertical scale - this.cachedGetSinglePixelWidth = Math.sqrt(Math.max( - (inverse[0] * inverse[0] + inverse[1] * inverse[1]), - (inverse[2] * inverse[2] + inverse[3] * inverse[3]))); - } - return this.cachedGetSinglePixelWidth; - }, - getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) { - var transform = this.ctx.mozCurrentTransform; - return [ - transform[0] * x + transform[2] * y + transform[4], - transform[1] * x + transform[3] * y + transform[5] - ]; - } - }; - - for (var op in OPS) { - CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; - } - - return CanvasGraphics; -})(); - -exports.CanvasGraphics = CanvasGraphics; -exports.createScratchCanvas = createScratchCanvas; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayAPI = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayFontLoader, root.pdfjsDisplayCanvas, - root.pdfjsDisplayMetadata, root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedUtil, displayFontLoader, displayCanvas, - displayMetadata, sharedGlobal, amdRequire) { - -var InvalidPDFException = sharedUtil.InvalidPDFException; -var MessageHandler = sharedUtil.MessageHandler; -var MissingPDFException = sharedUtil.MissingPDFException; -var PasswordResponses = sharedUtil.PasswordResponses; -var PasswordException = sharedUtil.PasswordException; -var StatTimer = sharedUtil.StatTimer; -var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; -var UnknownErrorException = sharedUtil.UnknownErrorException; -var Util = sharedUtil.Util; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var combineUrl = sharedUtil.combineUrl; -var error = sharedUtil.error; -var deprecated = sharedUtil.deprecated; -var info = sharedUtil.info; -var isArrayBuffer = sharedUtil.isArrayBuffer; -var loadJpegStream = sharedUtil.loadJpegStream; -var stringToBytes = sharedUtil.stringToBytes; -var warn = sharedUtil.warn; -var FontFaceObject = displayFontLoader.FontFaceObject; -var FontLoader = displayFontLoader.FontLoader; -var CanvasGraphics = displayCanvas.CanvasGraphics; -var createScratchCanvas = displayCanvas.createScratchCanvas; -var Metadata = displayMetadata.Metadata; -var PDFJS = sharedGlobal.PDFJS; -var globalScope = sharedGlobal.globalScope; - -var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 - - -var useRequireEnsure = false; -if (typeof module !== 'undefined' && module.require) { - // node.js - disable worker and set require.ensure. - PDFJS.disableWorker = true; - if (typeof require.ensure === 'undefined') { - require.ensure = require('node-ensure'); - } - useRequireEnsure = true; -} -if (typeof __webpack_require__ !== 'undefined') { - // Webpack - get/bundle pdf.worker.js as additional file. - PDFJS.workerSrc = require('entry?name=[hash]-worker.js!./pdf.worker.js'); - useRequireEnsure = true; -} -if (typeof requirejs !== 'undefined' && requirejs.toUrl) { - PDFJS.workerSrc = requirejs.toUrl('pdfjs-dist/build/pdf.worker.js'); -} -var fakeWorkerFilesLoader = useRequireEnsure ? (function (callback) { - require.ensure([], function () { - require('./pdf.worker.js'); - callback(); - }); -}) : (typeof requirejs !== 'undefined') ? (function (callback) { - requirejs(['pdfjs-dist/build/pdf.worker'], function (worker) { - callback(); - }); -}) : null; - - -/** - * The maximum allowed image size in total pixels e.g. width * height. Images - * above this value will not be drawn. Use -1 for no limit. - * @var {number} - */ -PDFJS.maxImageSize = (PDFJS.maxImageSize === undefined ? - -1 : PDFJS.maxImageSize); - -/** - * The url of where the predefined Adobe CMaps are located. Include trailing - * slash. - * @var {string} - */ -PDFJS.cMapUrl = (PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl); - -/** - * Specifies if CMaps are binary packed. - * @var {boolean} - */ -PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked; - -/** - * By default fonts are converted to OpenType fonts and loaded via font face - * rules. If disabled, the font will be rendered using a built in font renderer - * that constructs the glyphs with primitive path commands. - * @var {boolean} - */ -PDFJS.disableFontFace = (PDFJS.disableFontFace === undefined ? - false : PDFJS.disableFontFace); - -/** - * Path for image resources, mainly for annotation icons. Include trailing - * slash. - * @var {string} - */ -PDFJS.imageResourcesPath = (PDFJS.imageResourcesPath === undefined ? - '' : PDFJS.imageResourcesPath); - -/** - * Disable the web worker and run all code on the main thread. This will happen - * automatically if the browser doesn't support workers or sending typed arrays - * to workers. - * @var {boolean} - */ -PDFJS.disableWorker = (PDFJS.disableWorker === undefined ? - false : PDFJS.disableWorker); - -/** - * Path and filename of the worker file. Required when the worker is enabled in - * development mode. If unspecified in the production build, the worker will be - * loaded based on the location of the pdf.js file. It is recommended that - * the workerSrc is set in a custom application to prevent issues caused by - * third-party frameworks and libraries. - * @var {string} - */ -PDFJS.workerSrc = (PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc); - -/** - * Disable range request loading of PDF files. When enabled and if the server - * supports partial content requests then the PDF will be fetched in chunks. - * Enabled (false) by default. - * @var {boolean} - */ -PDFJS.disableRange = (PDFJS.disableRange === undefined ? - false : PDFJS.disableRange); - -/** - * Disable streaming of PDF file data. By default PDF.js attempts to load PDF - * in chunks. This default behavior can be disabled. - * @var {boolean} - */ -PDFJS.disableStream = (PDFJS.disableStream === undefined ? - false : PDFJS.disableStream); - -/** - * Disable pre-fetching of PDF file data. When range requests are enabled PDF.js - * will automatically keep fetching more data even if it isn't needed to display - * the current page. This default behavior can be disabled. - * - * NOTE: It is also necessary to disable streaming, see above, - * in order for disabling of pre-fetching to work correctly. - * @var {boolean} - */ -PDFJS.disableAutoFetch = (PDFJS.disableAutoFetch === undefined ? - false : PDFJS.disableAutoFetch); - -/** - * Enables special hooks for debugging PDF.js. - * @var {boolean} - */ -PDFJS.pdfBug = (PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug); - -/** - * Enables transfer usage in postMessage for ArrayBuffers. - * @var {boolean} - */ -PDFJS.postMessageTransfers = (PDFJS.postMessageTransfers === undefined ? - true : PDFJS.postMessageTransfers); - -/** - * Disables URL.createObjectURL usage. - * @var {boolean} - */ -PDFJS.disableCreateObjectURL = (PDFJS.disableCreateObjectURL === undefined ? - false : PDFJS.disableCreateObjectURL); - -/** - * Disables WebGL usage. - * @var {boolean} - */ -PDFJS.disableWebGL = (PDFJS.disableWebGL === undefined ? - true : PDFJS.disableWebGL); - -/** - * Disables fullscreen support, and by extension Presentation Mode, - * in browsers which support the fullscreen API. - * @var {boolean} - */ -PDFJS.disableFullscreen = (PDFJS.disableFullscreen === undefined ? - false : PDFJS.disableFullscreen); - -/** - * Enables CSS only zooming. - * @var {boolean} - */ -PDFJS.useOnlyCssZoom = (PDFJS.useOnlyCssZoom === undefined ? - false : PDFJS.useOnlyCssZoom); - -/** - * Controls the logging level. - * The constants from PDFJS.VERBOSITY_LEVELS should be used: - * - errors - * - warnings [default] - * - infos - * @var {number} - */ -PDFJS.verbosity = (PDFJS.verbosity === undefined ? - PDFJS.VERBOSITY_LEVELS.warnings : PDFJS.verbosity); - -/** - * The maximum supported canvas size in total pixels e.g. width * height. - * The default value is 4096 * 4096. Use -1 for no limit. - * @var {number} - */ -PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ? - 16777216 : PDFJS.maxCanvasPixels); - -/** - * (Deprecated) Opens external links in a new window if enabled. - * The default behavior opens external links in the PDF.js window. - * - * NOTE: This property has been deprecated, please use - * `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK` instead. - * @var {boolean} - */ -PDFJS.openExternalLinksInNewWindow = ( - PDFJS.openExternalLinksInNewWindow === undefined ? - false : PDFJS.openExternalLinksInNewWindow); - -/** - * Specifies the |target| attribute for external links. - * The constants from PDFJS.LinkTarget should be used: - * - NONE [default] - * - SELF - * - BLANK - * - PARENT - * - TOP - * @var {number} - */ -PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ? - PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget); - -/** - * Specifies the |rel| attribute for external links. Defaults to stripping - * the referrer. - * @var {string} - */ -PDFJS.externalLinkRel = (PDFJS.externalLinkRel === undefined ? - 'noreferrer' : PDFJS.externalLinkRel); - -/** - * Determines if we can eval strings as JS. Primarily used to improve - * performance for font rendering. - * @var {boolean} - */ -PDFJS.isEvalSupported = (PDFJS.isEvalSupported === undefined ? - true : PDFJS.isEvalSupported); - -/** - * Document initialization / loading parameters object. - * - * @typedef {Object} DocumentInitParameters - * @property {string} url - The URL of the PDF. - * @property {TypedArray|Array|string} data - Binary PDF data. Use typed arrays - * (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, - * use atob() to convert it to a binary string first. - * @property {Object} httpHeaders - Basic authentication headers. - * @property {boolean} withCredentials - Indicates whether or not cross-site - * Access-Control requests should be made using credentials such as cookies - * or authorization headers. The default is false. - * @property {string} password - For decrypting password-protected PDFs. - * @property {TypedArray} initialData - A typed array with the first portion or - * all of the pdf data. Used by the extension since some data is already - * loaded before the switch to range requests. - * @property {number} length - The PDF file length. It's used for progress - * reports and range requests operations. - * @property {PDFDataRangeTransport} range - * @property {number} rangeChunkSize - Optional parameter to specify - * maximum number of bytes fetched per range request. The default value is - * 2^16 = 65536. - * @property {PDFWorker} worker - The worker that will be used for the loading - * and parsing of the PDF data. - */ - -/** - * @typedef {Object} PDFDocumentStats - * @property {Array} streamTypes - Used stream types in the document (an item - * is set to true if specific stream ID was used in the document). - * @property {Array} fontTypes - Used font type in the document (an item is set - * to true if specific font ID was used in the document). - */ - -/** - * This is the main entry point for loading a PDF and interacting with it. - * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) - * is used, which means it must follow the same origin rules that any XHR does - * e.g. No cross domain requests without CORS. - * - * @param {string|TypedArray|DocumentInitParameters|PDFDataRangeTransport} src - * Can be a url to where a PDF is located, a typed array (Uint8Array) - * already populated with data or parameter object. - * - * @param {PDFDataRangeTransport} pdfDataRangeTransport (deprecated) It is used - * if you want to manually serve range requests for data in the PDF. - * - * @param {function} passwordCallback (deprecated) It is used to request a - * password if wrong or no password was provided. The callback receives two - * parameters: function that needs to be called with new password and reason - * (see {PasswordResponses}). - * - * @param {function} progressCallback (deprecated) It is used to be able to - * monitor the loading progress of the PDF file (necessary to implement e.g. - * a loading bar). The callback receives an {Object} with the properties: - * {number} loaded and {number} total. - * - * @return {PDFDocumentLoadingTask} - */ -PDFJS.getDocument = function getDocument(src, - pdfDataRangeTransport, - passwordCallback, - progressCallback) { - var task = new PDFDocumentLoadingTask(); - - // Support of the obsolete arguments (for compatibility with API v1.0) - if (arguments.length > 1) { - deprecated('getDocument is called with pdfDataRangeTransport, ' + - 'passwordCallback or progressCallback argument'); - } - if (pdfDataRangeTransport) { - if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) { - // Not a PDFDataRangeTransport instance, trying to add missing properties. - pdfDataRangeTransport = Object.create(pdfDataRangeTransport); - pdfDataRangeTransport.length = src.length; - pdfDataRangeTransport.initialData = src.initialData; - if (!pdfDataRangeTransport.abort) { - pdfDataRangeTransport.abort = function () {}; - } - } - src = Object.create(src); - src.range = pdfDataRangeTransport; - } - task.onPassword = passwordCallback || null; - task.onProgress = progressCallback || null; - - var source; - if (typeof src === 'string') { - source = { url: src }; - } else if (isArrayBuffer(src)) { - source = { data: src }; - } else if (src instanceof PDFDataRangeTransport) { - source = { range: src }; - } else { - if (typeof src !== 'object') { - error('Invalid parameter in getDocument, need either Uint8Array, ' + - 'string or a parameter object'); - } - if (!src.url && !src.data && !src.range) { - error('Invalid parameter object: need either .data, .range or .url'); - } - - source = src; - } - - var params = {}; - var rangeTransport = null; - var worker = null; - for (var key in source) { - if (key === 'url' && typeof window !== 'undefined') { - // The full path is required in the 'url' field. - params[key] = combineUrl(window.location.href, source[key]); - continue; - } else if (key === 'range') { - rangeTransport = source[key]; - continue; - } else if (key === 'worker') { - worker = source[key]; - continue; - } else if (key === 'data' && !(source[key] instanceof Uint8Array)) { - // Converting string or array-like data to Uint8Array. - var pdfBytes = source[key]; - if (typeof pdfBytes === 'string') { - params[key] = stringToBytes(pdfBytes); - } else if (typeof pdfBytes === 'object' && pdfBytes !== null && - !isNaN(pdfBytes.length)) { - params[key] = new Uint8Array(pdfBytes); - } else if (isArrayBuffer(pdfBytes)) { - params[key] = new Uint8Array(pdfBytes); - } else { - error('Invalid PDF binary data: either typed array, string or ' + - 'array-like object is expected in the data property.'); - } - continue; - } - params[key] = source[key]; - } - - params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; - - if (!worker) { - // Worker was not provided -- creating and owning our own. - worker = new PDFWorker(); - task._worker = worker; - } - var docId = task.docId; - worker.promise.then(function () { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - return _fetchDocument(worker, params, rangeTransport, docId).then( - function (workerId) { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - var messageHandler = new MessageHandler(docId, workerId, worker.port); - messageHandler.send('Ready', null); - var transport = new WorkerTransport(messageHandler, task, rangeTransport); - task._transport = transport; - }); - }).catch(task._capability.reject); - - return task; -}; - -/** - * Starts fetching of specified PDF document/data. - * @param {PDFWorker} worker - * @param {Object} source - * @param {PDFDataRangeTransport} pdfDataRangeTransport - * @param {string} docId Unique document id, used as MessageHandler id. - * @returns {Promise} The promise, which is resolved when worker id of - * MessageHandler is known. - * @private - */ -function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { - if (worker.destroyed) { - return Promise.reject(new Error('Worker was destroyed')); - } - - source.disableAutoFetch = PDFJS.disableAutoFetch; - source.disableStream = PDFJS.disableStream; - source.chunkedViewerLoading = !!pdfDataRangeTransport; - if (pdfDataRangeTransport) { - source.length = pdfDataRangeTransport.length; - source.initialData = pdfDataRangeTransport.initialData; - } - return worker.messageHandler.sendWithPromise('GetDocRequest', { - docId: docId, - source: source, - disableRange: PDFJS.disableRange, - maxImageSize: PDFJS.maxImageSize, - cMapUrl: PDFJS.cMapUrl, - cMapPacked: PDFJS.cMapPacked, - disableFontFace: PDFJS.disableFontFace, - disableCreateObjectURL: PDFJS.disableCreateObjectURL, - verbosity: PDFJS.verbosity - }).then(function (workerId) { - if (worker.destroyed) { - throw new Error('Worker was destroyed'); - } - return workerId; - }); -} - -/** - * PDF document loading operation. - * @class - * @alias PDFDocumentLoadingTask - */ -var PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() { - var nextDocumentId = 0; - - /** @constructs PDFDocumentLoadingTask */ - function PDFDocumentLoadingTask() { - this._capability = createPromiseCapability(); - this._transport = null; - this._worker = null; - - /** - * Unique document loading task id -- used in MessageHandlers. - * @type {string} - */ - this.docId = 'd' + (nextDocumentId++); - - /** - * Shows if loading task is destroyed. - * @type {boolean} - */ - this.destroyed = false; - - /** - * Callback to request a password if wrong or no password was provided. - * The callback receives two parameters: function that needs to be called - * with new password and reason (see {PasswordResponses}). - */ - this.onPassword = null; - - /** - * Callback to be able to monitor the loading progress of the PDF file - * (necessary to implement e.g. a loading bar). The callback receives - * an {Object} with the properties: {number} loaded and {number} total. - */ - this.onProgress = null; - - /** - * Callback to when unsupported feature is used. The callback receives - * an {PDFJS.UNSUPPORTED_FEATURES} argument. - */ - this.onUnsupportedFeature = null; - } - - PDFDocumentLoadingTask.prototype = - /** @lends PDFDocumentLoadingTask.prototype */ { - /** - * @return {Promise} - */ - get promise() { - return this._capability.promise; - }, - - /** - * Aborts all network requests and destroys worker. - * @return {Promise} A promise that is resolved after destruction activity - * is completed. - */ - destroy: function () { - this.destroyed = true; - - var transportDestroyed = !this._transport ? Promise.resolve() : - this._transport.destroy(); - return transportDestroyed.then(function () { - this._transport = null; - if (this._worker) { - this._worker.destroy(); - this._worker = null; - } - }.bind(this)); - }, - - /** - * Registers callbacks to indicate the document loading completion. - * - * @param {function} onFulfilled The callback for the loading completion. - * @param {function} onRejected The callback for the loading failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function PDFDocumentLoadingTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return PDFDocumentLoadingTask; -})(); - -/** - * Abstract class to support range requests file loading. - * @class - * @alias PDFJS.PDFDataRangeTransport - * @param {number} length - * @param {Uint8Array} initialData - */ -var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() { - function PDFDataRangeTransport(length, initialData) { - this.length = length; - this.initialData = initialData; - - this._rangeListeners = []; - this._progressListeners = []; - this._progressiveReadListeners = []; - this._readyCapability = createPromiseCapability(); - } - PDFDataRangeTransport.prototype = - /** @lends PDFDataRangeTransport.prototype */ { - addRangeListener: - function PDFDataRangeTransport_addRangeListener(listener) { - this._rangeListeners.push(listener); - }, - - addProgressListener: - function PDFDataRangeTransport_addProgressListener(listener) { - this._progressListeners.push(listener); - }, - - addProgressiveReadListener: - function PDFDataRangeTransport_addProgressiveReadListener(listener) { - this._progressiveReadListeners.push(listener); - }, - - onDataRange: function PDFDataRangeTransport_onDataRange(begin, chunk) { - var listeners = this._rangeListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](begin, chunk); - } - }, - - onDataProgress: function PDFDataRangeTransport_onDataProgress(loaded) { - this._readyCapability.promise.then(function () { - var listeners = this._progressListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](loaded); - } - }.bind(this)); - }, - - onDataProgressiveRead: - function PDFDataRangeTransport_onDataProgress(chunk) { - this._readyCapability.promise.then(function () { - var listeners = this._progressiveReadListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](chunk); - } - }.bind(this)); - }, - - transportReady: function PDFDataRangeTransport_transportReady() { - this._readyCapability.resolve(); - }, - - requestDataRange: - function PDFDataRangeTransport_requestDataRange(begin, end) { - throw new Error('Abstract method PDFDataRangeTransport.requestDataRange'); - }, - - abort: function PDFDataRangeTransport_abort() { - } - }; - return PDFDataRangeTransport; -})(); - -PDFJS.PDFDataRangeTransport = PDFDataRangeTransport; - -/** - * Proxy to a PDFDocument in the worker thread. Also, contains commonly used - * properties that can be read synchronously. - * @class - * @alias PDFDocumentProxy - */ -var PDFDocumentProxy = (function PDFDocumentProxyClosure() { - function PDFDocumentProxy(pdfInfo, transport, loadingTask) { - this.pdfInfo = pdfInfo; - this.transport = transport; - this.loadingTask = loadingTask; - } - PDFDocumentProxy.prototype = /** @lends PDFDocumentProxy.prototype */ { - /** - * @return {number} Total number of pages the PDF contains. - */ - get numPages() { - return this.pdfInfo.numPages; - }, - /** - * @return {string} A unique ID to identify a PDF. Not guaranteed to be - * unique. - */ - get fingerprint() { - return this.pdfInfo.fingerprint; - }, - /** - * @param {number} pageNumber The page number to get. The first page is 1. - * @return {Promise} A promise that is resolved with a {@link PDFPageProxy} - * object. - */ - getPage: function PDFDocumentProxy_getPage(pageNumber) { - return this.transport.getPage(pageNumber); - }, - /** - * @param {{num: number, gen: number}} ref The page reference. Must have - * the 'num' and 'gen' properties. - * @return {Promise} A promise that is resolved with the page index that is - * associated with the reference. - */ - getPageIndex: function PDFDocumentProxy_getPageIndex(ref) { - return this.transport.getPageIndex(ref); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named destinations to reference numbers. - * - * This can be slow for large documents: use getDestination instead - */ - getDestinations: function PDFDocumentProxy_getDestinations() { - return this.transport.getDestinations(); - }, - /** - * @param {string} id The named destination to get. - * @return {Promise} A promise that is resolved with all information - * of the given named destination. - */ - getDestination: function PDFDocumentProxy_getDestination(id) { - return this.transport.getDestination(id); - }, - /** - * @return {Promise} A promise that is resolved with: - * an Array containing the pageLabels that correspond to the pageIndexes, - * or `null` when no pageLabels are present in the PDF file. - */ - getPageLabels: function PDFDocumentProxy_getPageLabels() { - return this.transport.getPageLabels(); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named attachments to their content. - */ - getAttachments: function PDFDocumentProxy_getAttachments() { - return this.transport.getAttachments(); - }, - /** - * @return {Promise} A promise that is resolved with an array of all the - * JavaScript strings in the name tree. - */ - getJavaScript: function PDFDocumentProxy_getJavaScript() { - return this.transport.getJavaScript(); - }, - /** - * @return {Promise} A promise that is resolved with an {Array} that is a - * tree outline (if it has one) of the PDF. The tree is in the format of: - * [ - * { - * title: string, - * bold: boolean, - * italic: boolean, - * color: rgb array, - * dest: dest obj, - * url: string, - * items: array of more items like this - * }, - * ... - * ]. - */ - getOutline: function PDFDocumentProxy_getOutline() { - return this.transport.getOutline(); - }, - /** - * @return {Promise} A promise that is resolved with an {Object} that has - * info and metadata properties. Info is an {Object} filled with anything - * available in the information dictionary and similarly metadata is a - * {Metadata} object with information from the metadata section of the PDF. - */ - getMetadata: function PDFDocumentProxy_getMetadata() { - return this.transport.getMetadata(); - }, - /** - * @return {Promise} A promise that is resolved with a TypedArray that has - * the raw data from the PDF. - */ - getData: function PDFDocumentProxy_getData() { - return this.transport.getData(); - }, - /** - * @return {Promise} A promise that is resolved when the document's data - * is loaded. It is resolved with an {Object} that contains the length - * property that indicates size of the PDF data in bytes. - */ - getDownloadInfo: function PDFDocumentProxy_getDownloadInfo() { - return this.transport.downloadInfoCapability.promise; - }, - /** - * @return {Promise} A promise this is resolved with current stats about - * document structures (see {@link PDFDocumentStats}). - */ - getStats: function PDFDocumentProxy_getStats() { - return this.transport.getStats(); - }, - /** - * Cleans up resources allocated by the document, e.g. created @font-face. - */ - cleanup: function PDFDocumentProxy_cleanup() { - this.transport.startCleanup(); - }, - /** - * Destroys current document instance and terminates worker. - */ - destroy: function PDFDocumentProxy_destroy() { - return this.loadingTask.destroy(); - } - }; - return PDFDocumentProxy; -})(); - -/** - * Page getTextContent parameters. - * - * @typedef {Object} getTextContentParameters - * @param {boolean} normalizeWhitespace - replaces all occurrences of - * whitespace with standard spaces (0x20). The default value is `false`. - */ - -/** - * Page text content. - * - * @typedef {Object} TextContent - * @property {array} items - array of {@link TextItem} - * @property {Object} styles - {@link TextStyles} objects, indexed by font - * name. - */ - -/** - * Page text content part. - * - * @typedef {Object} TextItem - * @property {string} str - text content. - * @property {string} dir - text direction: 'ttb', 'ltr' or 'rtl'. - * @property {array} transform - transformation matrix. - * @property {number} width - width in device space. - * @property {number} height - height in device space. - * @property {string} fontName - font name used by pdf.js for converted font. - */ - -/** - * Text style. - * - * @typedef {Object} TextStyle - * @property {number} ascent - font ascent. - * @property {number} descent - font descent. - * @property {boolean} vertical - text is in vertical mode. - * @property {string} fontFamily - possible font family - */ - -/** - * Page annotation parameters. - * - * @typedef {Object} GetAnnotationsParameters - * @param {string} intent - Determines the annotations that will be fetched, - * can be either 'display' (viewable annotations) or 'print' - * (printable annotations). - * If the parameter is omitted, all annotations are fetched. - */ - -/** - * Page render parameters. - * - * @typedef {Object} RenderParameters - * @property {Object} canvasContext - A 2D context of a DOM Canvas object. - * @property {PDFJS.PageViewport} viewport - Rendering viewport obtained by - * calling of PDFPage.getViewport method. - * @property {string} intent - Rendering intent, can be 'display' or 'print' - * (default value is 'display'). - * @property {Array} transform - (optional) Additional transform, applied - * just before viewport transform. - * @property {Object} imageLayer - (optional) An object that has beginLayout, - * endLayout and appendImage functions. - * @property {function} continueCallback - (deprecated) A function that will be - * called each time the rendering is paused. To continue - * rendering call the function that is the first argument - * to the callback. - */ - -/** - * PDF page operator list. - * - * @typedef {Object} PDFOperatorList - * @property {Array} fnArray - Array containing the operator functions. - * @property {Array} argsArray - Array containing the arguments of the - * functions. - */ - -/** - * Proxy to a PDFPage in the worker thread. - * @class - * @alias PDFPageProxy - */ -var PDFPageProxy = (function PDFPageProxyClosure() { - function PDFPageProxy(pageIndex, pageInfo, transport) { - this.pageIndex = pageIndex; - this.pageInfo = pageInfo; - this.transport = transport; - this.stats = new StatTimer(); - this.stats.enabled = !!globalScope.PDFJS.enableStats; - this.commonObjs = transport.commonObjs; - this.objs = new PDFObjects(); - this.cleanupAfterRender = false; - this.pendingCleanup = false; - this.intentStates = {}; - this.destroyed = false; - } - PDFPageProxy.prototype = /** @lends PDFPageProxy.prototype */ { - /** - * @return {number} Page number of the page. First page is 1. - */ - get pageNumber() { - return this.pageIndex + 1; - }, - /** - * @return {number} The number of degrees the page is rotated clockwise. - */ - get rotate() { - return this.pageInfo.rotate; - }, - /** - * @return {Object} The reference that points to this page. It has 'num' and - * 'gen' properties. - */ - get ref() { - return this.pageInfo.ref; - }, - /** - * @return {Array} An array of the visible portion of the PDF page in the - * user space units - [x1, y1, x2, y2]. - */ - get view() { - return this.pageInfo.view; - }, - /** - * @param {number} scale The desired scale of the viewport. - * @param {number} rotate Degrees to rotate the viewport. If omitted this - * defaults to the page rotation. - * @return {PDFJS.PageViewport} Contains 'width' and 'height' properties - * along with transforms required for rendering. - */ - getViewport: function PDFPageProxy_getViewport(scale, rotate) { - if (arguments.length < 2) { - rotate = this.rotate; - } - return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0); - }, - /** - * @param {GetAnnotationsParameters} params - Annotation parameters. - * @return {Promise} A promise that is resolved with an {Array} of the - * annotation objects. - */ - getAnnotations: function PDFPageProxy_getAnnotations(params) { - var intent = (params && params.intent) || null; - - if (!this.annotationsPromise || this.annotationsIntent !== intent) { - this.annotationsPromise = this.transport.getAnnotations(this.pageIndex, - intent); - this.annotationsIntent = intent; - } - return this.annotationsPromise; - }, - /** - * Begins the process of rendering a page to the desired context. - * @param {RenderParameters} params Page render parameters. - * @return {RenderTask} An object that contains the promise, which - * is resolved when the page finishes rendering. - */ - render: function PDFPageProxy_render(params) { - var stats = this.stats; - stats.time('Overall'); - - // If there was a pending destroy cancel it so no cleanup happens during - // this call to render. - this.pendingCleanup = false; - - var renderingIntent = (params.intent === 'print' ? 'print' : 'display'); - - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = {}; - } - var intentState = this.intentStates[renderingIntent]; - - // If there's no displayReadyCapability yet, then the operatorList - // was never requested before. Make the request and create the promise. - if (!intentState.displayReadyCapability) { - intentState.receivingOperatorList = true; - intentState.displayReadyCapability = createPromiseCapability(); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.stats.time('Page Request'); - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageNumber - 1, - intent: renderingIntent - }); - } - - var internalRenderTask = new InternalRenderTask(complete, params, - this.objs, - this.commonObjs, - intentState.operatorList, - this.pageNumber); - internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print'; - if (!intentState.renderTasks) { - intentState.renderTasks = []; - } - intentState.renderTasks.push(internalRenderTask); - var renderTask = internalRenderTask.task; - - // Obsolete parameter support - if (params.continueCallback) { - deprecated('render is used with continueCallback parameter'); - renderTask.onContinue = params.continueCallback; - } - - var self = this; - intentState.displayReadyCapability.promise.then( - function pageDisplayReadyPromise(transparency) { - if (self.pendingCleanup) { - complete(); - return; - } - stats.time('Rendering'); - internalRenderTask.initalizeGraphics(transparency); - internalRenderTask.operatorListChanged(); - }, - function pageDisplayReadPromiseError(reason) { - complete(reason); - } - ); - - function complete(error) { - var i = intentState.renderTasks.indexOf(internalRenderTask); - if (i >= 0) { - intentState.renderTasks.splice(i, 1); - } - - if (self.cleanupAfterRender) { - self.pendingCleanup = true; - } - self._tryCleanup(); - - if (error) { - internalRenderTask.capability.reject(error); - } else { - internalRenderTask.capability.resolve(); - } - stats.timeEnd('Rendering'); - stats.timeEnd('Overall'); - } - - return renderTask; - }, - - /** - * @return {Promise} A promise resolved with an {@link PDFOperatorList} - * object that represents page's operator list. - */ - getOperatorList: function PDFPageProxy_getOperatorList() { - function operatorListChanged() { - if (intentState.operatorList.lastChunk) { - intentState.opListReadCapability.resolve(intentState.operatorList); - } - } - - var renderingIntent = 'oplist'; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = {}; - } - var intentState = this.intentStates[renderingIntent]; - - if (!intentState.opListReadCapability) { - var opListTask = {}; - opListTask.operatorListChanged = operatorListChanged; - intentState.receivingOperatorList = true; - intentState.opListReadCapability = createPromiseCapability(); - intentState.renderTasks = []; - intentState.renderTasks.push(opListTask); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageIndex, - intent: renderingIntent - }); - } - return intentState.opListReadCapability.promise; - }, - - /** - * @param {getTextContentParameters} params - getTextContent parameters. - * @return {Promise} That is resolved a {@link TextContent} - * object that represent the page text content. - */ - getTextContent: function PDFPageProxy_getTextContent(params) { - var normalizeWhitespace = (params && params.normalizeWhitespace) || false; - - return this.transport.messageHandler.sendWithPromise('GetTextContent', { - pageIndex: this.pageNumber - 1, - normalizeWhitespace: normalizeWhitespace, - }); - }, - - /** - * Destroys page object. - */ - _destroy: function PDFPageProxy_destroy() { - this.destroyed = true; - this.transport.pageCache[this.pageIndex] = null; - - var waitOn = []; - Object.keys(this.intentStates).forEach(function(intent) { - var intentState = this.intentStates[intent]; - intentState.renderTasks.forEach(function(renderTask) { - var renderCompleted = renderTask.capability.promise. - catch(function () {}); // ignoring failures - waitOn.push(renderCompleted); - renderTask.cancel(); - }); - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - return Promise.all(waitOn); - }, - - /** - * Cleans up resources allocated by the page. (deprecated) - */ - destroy: function() { - deprecated('page destroy method, use cleanup() instead'); - this.cleanup(); - }, - - /** - * Cleans up resources allocated by the page. - */ - cleanup: function PDFPageProxy_cleanup() { - this.pendingCleanup = true; - this._tryCleanup(); - }, - /** - * For internal use only. Attempts to clean up if rendering is in a state - * where that's possible. - * @ignore - */ - _tryCleanup: function PDFPageProxy_tryCleanup() { - if (!this.pendingCleanup || - Object.keys(this.intentStates).some(function(intent) { - var intentState = this.intentStates[intent]; - return (intentState.renderTasks.length !== 0 || - intentState.receivingOperatorList); - }, this)) { - return; - } - - Object.keys(this.intentStates).forEach(function(intent) { - delete this.intentStates[intent]; - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - }, - /** - * For internal use only. - * @ignore - */ - _startRenderPage: function PDFPageProxy_startRenderPage(transparency, - intent) { - var intentState = this.intentStates[intent]; - // TODO Refactor RenderPageRequest to separate rendering - // and operator list logic - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.resolve(transparency); - } - }, - /** - * For internal use only. - * @ignore - */ - _renderPageChunk: function PDFPageProxy_renderPageChunk(operatorListChunk, - intent) { - var intentState = this.intentStates[intent]; - var i, ii; - // Add the new chunk to the current operator list. - for (i = 0, ii = operatorListChunk.length; i < ii; i++) { - intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); - intentState.operatorList.argsArray.push( - operatorListChunk.argsArray[i]); - } - intentState.operatorList.lastChunk = operatorListChunk.lastChunk; - - // Notify all the rendering tasks there are more operators to be consumed. - for (i = 0; i < intentState.renderTasks.length; i++) { - intentState.renderTasks[i].operatorListChanged(); - } - - if (operatorListChunk.lastChunk) { - intentState.receivingOperatorList = false; - this._tryCleanup(); - } - } - }; - return PDFPageProxy; -})(); - -/** - * PDF.js web worker abstraction, it controls instantiation of PDF documents and - * WorkerTransport for them. If creation of a web worker is not possible, - * a "fake" worker will be used instead. - * @class - */ -var PDFWorker = (function PDFWorkerClosure() { - var nextFakeWorkerId = 0; - - function getWorkerSrc() { - if (PDFJS.workerSrc) { - return PDFJS.workerSrc; - } - if (pdfjsFilePath) { - return pdfjsFilePath.replace(/\.js$/i, '.worker.js'); - } - error('No PDFJS.workerSrc specified'); - } - - // Loads worker code into main thread. - function setupFakeWorkerGlobal() { - if (!PDFJS.fakeWorkerFilesLoadedCapability) { - PDFJS.fakeWorkerFilesLoadedCapability = createPromiseCapability(); - // In the developer build load worker_loader which in turn loads all the - // other files and resolves the promise. In production only the - // pdf.worker.js file is needed. - var loader = fakeWorkerFilesLoader || function (callback) { - Util.loadScript(getWorkerSrc(), callback); - }; - loader(function () { - PDFJS.fakeWorkerFilesLoadedCapability.resolve(); - }); - } - return PDFJS.fakeWorkerFilesLoadedCapability.promise; - } - - function PDFWorker(name) { - this.name = name; - this.destroyed = false; - - this._readyCapability = createPromiseCapability(); - this._port = null; - this._webWorker = null; - this._messageHandler = null; - this._initialize(); - } - - PDFWorker.prototype = /** @lends PDFWorker.prototype */ { - get promise() { - return this._readyCapability.promise; - }, - - get port() { - return this._port; - }, - - get messageHandler() { - return this._messageHandler; - }, - - _initialize: function PDFWorker_initialize() { - // If worker support isn't disabled explicit and the browser has worker - // support, create a new web worker and test if it/the browser fullfills - // all requirements to run parts of pdf.js in a web worker. - // Right now, the requirement is, that an Uint8Array is still an - // Uint8Array as it arrives on the worker. (Chrome added this with v.15.) - if (!globalScope.PDFJS.disableWorker && typeof Worker !== 'undefined') { - var workerSrc = getWorkerSrc(); - - try { - // Some versions of FF can't create a worker on localhost, see: - // https://bugzilla.mozilla.org/show_bug.cgi?id=683280 - var worker = new Worker(workerSrc); - var messageHandler = new MessageHandler('main', 'worker', worker); - messageHandler.on('test', function PDFWorker_test(data) { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - messageHandler.destroy(); - worker.terminate(); - return; // worker was destroyed - } - var supportTypedArray = data && data.supportTypedArray; - if (supportTypedArray) { - this._messageHandler = messageHandler; - this._port = worker; - this._webWorker = worker; - if (!data.supportTransfers) { - PDFJS.postMessageTransfers = false; - } - this._readyCapability.resolve(); - } else { - this._setupFakeWorker(); - messageHandler.destroy(); - worker.terminate(); - } - }.bind(this)); - - messageHandler.on('console_log', function (data) { - console.log.apply(console, data); - }); - messageHandler.on('console_error', function (data) { - console.error.apply(console, data); - }); - - messageHandler.on('ready', function (data) { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - messageHandler.destroy(); - worker.terminate(); - return; // worker was destroyed - } - try { - sendTest(); - } catch (e) { - // We need fallback to a faked worker. - this._setupFakeWorker(); - } - }.bind(this)); - - var sendTest = function () { - var testObj = new Uint8Array( - [PDFJS.postMessageTransfers ? 255 : 0]); - // Some versions of Opera throw a DATA_CLONE_ERR on serializing the - // typed array. Also, checking if we can use transfers. - try { - messageHandler.send('test', testObj, [testObj.buffer]); - } catch (ex) { - info('Cannot use postMessage transfers'); - testObj[0] = 0; - messageHandler.send('test', testObj); - } - }; - - // It might take time for worker to initialize (especially when AMD - // loader is used). We will try to send test immediately, and then - // when 'ready' message will arrive. The worker shall process only - // first received 'test'. - sendTest(); - return; - } catch (e) { - info('The worker has been disabled.'); - } - } - // Either workers are disabled, not supported or have thrown an exception. - // Thus, we fallback to a faked worker. - this._setupFakeWorker(); - }, - - _setupFakeWorker: function PDFWorker_setupFakeWorker() { - if (!globalScope.PDFJS.disableWorker) { - warn('Setting up fake worker.'); - globalScope.PDFJS.disableWorker = true; - } - - setupFakeWorkerGlobal().then(function () { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - return; - } - - // If we don't use a worker, just post/sendMessage to the main thread. - var port = { - _listeners: [], - postMessage: function (obj) { - var e = {data: obj}; - this._listeners.forEach(function (listener) { - listener.call(this, e); - }, this); - }, - addEventListener: function (name, listener) { - this._listeners.push(listener); - }, - removeEventListener: function (name, listener) { - var i = this._listeners.indexOf(listener); - this._listeners.splice(i, 1); - }, - terminate: function () {} - }; - this._port = port; - - // All fake workers use the same port, making id unique. - var id = 'fake' + (nextFakeWorkerId++); - - // If the main thread is our worker, setup the handling for the - // messages -- the main thread sends to it self. - var workerHandler = new MessageHandler(id + '_worker', id, port); - PDFJS.WorkerMessageHandler.setup(workerHandler, port); - - var messageHandler = new MessageHandler(id, id + '_worker', port); - this._messageHandler = messageHandler; - this._readyCapability.resolve(); - }.bind(this)); - }, - - /** - * Destroys the worker instance. - */ - destroy: function PDFWorker_destroy() { - this.destroyed = true; - if (this._webWorker) { - // We need to terminate only web worker created resource. - this._webWorker.terminate(); - this._webWorker = null; - } - this._port = null; - if (this._messageHandler) { - this._messageHandler.destroy(); - this._messageHandler = null; - } - } - }; - - return PDFWorker; -})(); -PDFJS.PDFWorker = PDFWorker; - -/** - * For internal use only. - * @ignore - */ -var WorkerTransport = (function WorkerTransportClosure() { - function WorkerTransport(messageHandler, loadingTask, pdfDataRangeTransport) { - this.messageHandler = messageHandler; - this.loadingTask = loadingTask; - this.pdfDataRangeTransport = pdfDataRangeTransport; - this.commonObjs = new PDFObjects(); - this.fontLoader = new FontLoader(loadingTask.docId); - - this.destroyed = false; - this.destroyCapability = null; - - this.pageCache = []; - this.pagePromises = []; - this.downloadInfoCapability = createPromiseCapability(); - - this.setupMessageHandler(); - } - WorkerTransport.prototype = { - destroy: function WorkerTransport_destroy() { - if (this.destroyCapability) { - return this.destroyCapability.promise; - } - - this.destroyed = true; - this.destroyCapability = createPromiseCapability(); - - var waitOn = []; - // We need to wait for all renderings to be completed, e.g. - // timeout/rAF can take a long time. - this.pageCache.forEach(function (page) { - if (page) { - waitOn.push(page._destroy()); - } - }); - this.pageCache = []; - this.pagePromises = []; - var self = this; - // We also need to wait for the worker to finish its long running tasks. - var terminated = this.messageHandler.sendWithPromise('Terminate', null); - waitOn.push(terminated); - Promise.all(waitOn).then(function () { - self.fontLoader.clear(); - if (self.pdfDataRangeTransport) { - self.pdfDataRangeTransport.abort(); - self.pdfDataRangeTransport = null; - } - if (self.messageHandler) { - self.messageHandler.destroy(); - self.messageHandler = null; - } - self.destroyCapability.resolve(); - }, this.destroyCapability.reject); - return this.destroyCapability.promise; - }, - - setupMessageHandler: - function WorkerTransport_setupMessageHandler() { - var messageHandler = this.messageHandler; - - function updatePassword(password) { - messageHandler.send('UpdatePassword', password); - } - - var pdfDataRangeTransport = this.pdfDataRangeTransport; - if (pdfDataRangeTransport) { - pdfDataRangeTransport.addRangeListener(function(begin, chunk) { - messageHandler.send('OnDataRange', { - begin: begin, - chunk: chunk - }); - }); - - pdfDataRangeTransport.addProgressListener(function(loaded) { - messageHandler.send('OnDataProgress', { - loaded: loaded - }); - }); - - pdfDataRangeTransport.addProgressiveReadListener(function(chunk) { - messageHandler.send('OnDataRange', { - chunk: chunk - }); - }); - - messageHandler.on('RequestDataRange', - function transportDataRange(data) { - pdfDataRangeTransport.requestDataRange(data.begin, data.end); - }, this); - } - - messageHandler.on('GetDoc', function transportDoc(data) { - var pdfInfo = data.pdfInfo; - this.numPages = data.pdfInfo.numPages; - var loadingTask = this.loadingTask; - var pdfDocument = new PDFDocumentProxy(pdfInfo, this, loadingTask); - this.pdfDocument = pdfDocument; - loadingTask._capability.resolve(pdfDocument); - }, this); - - messageHandler.on('NeedPassword', - function transportNeedPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.NEED_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('IncorrectPassword', - function transportIncorrectPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.INCORRECT_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('InvalidPDF', function transportInvalidPDF(exception) { - this.loadingTask._capability.reject( - new InvalidPDFException(exception.message)); - }, this); - - messageHandler.on('MissingPDF', function transportMissingPDF(exception) { - this.loadingTask._capability.reject( - new MissingPDFException(exception.message)); - }, this); - - messageHandler.on('UnexpectedResponse', - function transportUnexpectedResponse(exception) { - this.loadingTask._capability.reject( - new UnexpectedResponseException(exception.message, exception.status)); - }, this); - - messageHandler.on('UnknownError', - function transportUnknownError(exception) { - this.loadingTask._capability.reject( - new UnknownErrorException(exception.message, exception.details)); - }, this); - - messageHandler.on('DataLoaded', function transportPage(data) { - this.downloadInfoCapability.resolve(data); - }, this); - - messageHandler.on('PDFManagerReady', function transportPage(data) { - if (this.pdfDataRangeTransport) { - this.pdfDataRangeTransport.transportReady(); - } - }, this); - - messageHandler.on('StartRenderPage', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page.stats.timeEnd('Page Request'); - page._startRenderPage(data.transparency, data.intent); - }, this); - - messageHandler.on('RenderPageChunk', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page._renderPageChunk(data.operatorList, data.intent); - }, this); - - messageHandler.on('commonobj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var type = data[1]; - if (this.commonObjs.hasData(id)) { - return; - } - - switch (type) { - case 'Font': - var exportedData = data[2]; - - var font; - if ('error' in exportedData) { - var error = exportedData.error; - warn('Error during font loading: ' + error); - this.commonObjs.resolve(id, error); - break; - } else { - font = new FontFaceObject(exportedData); - } - - this.fontLoader.bind( - [font], - function fontReady(fontObjs) { - this.commonObjs.resolve(id, font); - }.bind(this) - ); - break; - case 'FontPath': - this.commonObjs.resolve(id, data[2]); - break; - default: - error('Got unknown common object type ' + type); - } - }, this); - - messageHandler.on('obj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var pageIndex = data[1]; - var type = data[2]; - var pageProxy = this.pageCache[pageIndex]; - var imageData; - if (pageProxy.objs.hasData(id)) { - return; - } - - switch (type) { - case 'JpegStream': - imageData = data[3]; - loadJpegStream(id, imageData, pageProxy.objs); - break; - case 'Image': - imageData = data[3]; - pageProxy.objs.resolve(id, imageData); - - // heuristics that will allow not to store large data - var MAX_IMAGE_SIZE_TO_STORE = 8000000; - if (imageData && 'data' in imageData && - imageData.data.length > MAX_IMAGE_SIZE_TO_STORE) { - pageProxy.cleanupAfterRender = true; - } - break; - default: - error('Got unknown object type ' + type); - } - }, this); - - messageHandler.on('DocProgress', function transportDocProgress(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var loadingTask = this.loadingTask; - if (loadingTask.onProgress) { - loadingTask.onProgress({ - loaded: data.loaded, - total: data.total - }); - } - }, this); - - messageHandler.on('PageError', function transportError(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var page = this.pageCache[data.pageNum - 1]; - var intentState = page.intentStates[data.intent]; - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.reject(data.error); - } else { - error(data.error); - } - }, this); - - messageHandler.on('UnsupportedFeature', - function transportUnsupportedFeature(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var featureId = data.featureId; - var loadingTask = this.loadingTask; - if (loadingTask.onUnsupportedFeature) { - loadingTask.onUnsupportedFeature(featureId); - } - PDFJS.UnsupportedManager.notify(featureId); - }, this); - - messageHandler.on('JpegDecode', function(data) { - if (this.destroyed) { - return Promise.reject('Worker was terminated'); - } - - var imageUrl = data[0]; - var components = data[1]; - if (components !== 3 && components !== 1) { - return Promise.reject( - new Error('Only 3 components or 1 component can be returned')); - } - - return new Promise(function (resolve, reject) { - var img = new Image(); - img.onload = function () { - var width = img.width; - var height = img.height; - var size = width * height; - var rgbaLength = size * 4; - var buf = new Uint8Array(size * components); - var tmpCanvas = createScratchCanvas(width, height); - var tmpCtx = tmpCanvas.getContext('2d'); - tmpCtx.drawImage(img, 0, 0); - var data = tmpCtx.getImageData(0, 0, width, height).data; - var i, j; - - if (components === 3) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j += 3) { - buf[j] = data[i]; - buf[j + 1] = data[i + 1]; - buf[j + 2] = data[i + 2]; - } - } else if (components === 1) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j++) { - buf[j] = data[i]; - } - } - resolve({ data: buf, width: width, height: height}); - }; - img.onerror = function () { - reject(new Error('JpegDecode failed to load image')); - }; - img.src = imageUrl; - }); - }, this); - }, - - getData: function WorkerTransport_getData() { - return this.messageHandler.sendWithPromise('GetData', null); - }, - - getPage: function WorkerTransport_getPage(pageNumber, capability) { - if (pageNumber <= 0 || pageNumber > this.numPages || - (pageNumber|0) !== pageNumber) { - return Promise.reject(new Error('Invalid page request')); - } - - var pageIndex = pageNumber - 1; - if (pageIndex in this.pagePromises) { - return this.pagePromises[pageIndex]; - } - var promise = this.messageHandler.sendWithPromise('GetPage', { - pageIndex: pageIndex - }).then(function (pageInfo) { - if (this.destroyed) { - throw new Error('Transport destroyed'); - } - var page = new PDFPageProxy(pageIndex, pageInfo, this); - this.pageCache[pageIndex] = page; - return page; - }.bind(this)); - this.pagePromises[pageIndex] = promise; - return promise; - }, - - getPageIndex: function WorkerTransport_getPageIndexByRef(ref) { - return this.messageHandler.sendWithPromise('GetPageIndex', { ref: ref }); - }, - - getAnnotations: function WorkerTransport_getAnnotations(pageIndex, intent) { - return this.messageHandler.sendWithPromise('GetAnnotations', { - pageIndex: pageIndex, - intent: intent, - }); - }, - - getDestinations: function WorkerTransport_getDestinations() { - return this.messageHandler.sendWithPromise('GetDestinations', null); - }, - - getDestination: function WorkerTransport_getDestination(id) { - return this.messageHandler.sendWithPromise('GetDestination', { id: id }); - }, - - getPageLabels: function WorkerTransport_getPageLabels() { - return this.messageHandler.sendWithPromise('GetPageLabels', null); - }, - - getAttachments: function WorkerTransport_getAttachments() { - return this.messageHandler.sendWithPromise('GetAttachments', null); - }, - - getJavaScript: function WorkerTransport_getJavaScript() { - return this.messageHandler.sendWithPromise('GetJavaScript', null); - }, - - getOutline: function WorkerTransport_getOutline() { - return this.messageHandler.sendWithPromise('GetOutline', null); - }, - - getMetadata: function WorkerTransport_getMetadata() { - return this.messageHandler.sendWithPromise('GetMetadata', null). - then(function transportMetadata(results) { - return { - info: results[0], - metadata: (results[1] ? new Metadata(results[1]) : null) - }; - }); - }, - - getStats: function WorkerTransport_getStats() { - return this.messageHandler.sendWithPromise('GetStats', null); - }, - - startCleanup: function WorkerTransport_startCleanup() { - this.messageHandler.sendWithPromise('Cleanup', null). - then(function endCleanup() { - for (var i = 0, ii = this.pageCache.length; i < ii; i++) { - var page = this.pageCache[i]; - if (page) { - page.cleanup(); - } - } - this.commonObjs.clear(); - this.fontLoader.clear(); - }.bind(this)); - } - }; - return WorkerTransport; - -})(); - -/** - * A PDF document and page is built of many objects. E.g. there are objects - * for fonts, images, rendering code and such. These objects might get processed - * inside of a worker. The `PDFObjects` implements some basic functions to - * manage these objects. - * @ignore - */ -var PDFObjects = (function PDFObjectsClosure() { - function PDFObjects() { - this.objs = {}; - } - - PDFObjects.prototype = { - /** - * Internal function. - * Ensures there is an object defined for `objId`. - */ - ensureObj: function PDFObjects_ensureObj(objId) { - if (this.objs[objId]) { - return this.objs[objId]; - } - - var obj = { - capability: createPromiseCapability(), - data: null, - resolved: false - }; - this.objs[objId] = obj; - - return obj; - }, - - /** - * If called *without* callback, this returns the data of `objId` but the - * object needs to be resolved. If it isn't, this function throws. - * - * If called *with* a callback, the callback is called with the data of the - * object once the object is resolved. That means, if you call this - * function and the object is already resolved, the callback gets called - * right away. - */ - get: function PDFObjects_get(objId, callback) { - // If there is a callback, then the get can be async and the object is - // not required to be resolved right now - if (callback) { - this.ensureObj(objId).capability.promise.then(callback); - return null; - } - - // If there isn't a callback, the user expects to get the resolved data - // directly. - var obj = this.objs[objId]; - - // If there isn't an object yet or the object isn't resolved, then the - // data isn't ready yet! - if (!obj || !obj.resolved) { - error('Requesting object that isn\'t resolved yet ' + objId); - } - - return obj.data; - }, - - /** - * Resolves the object `objId` with optional `data`. - */ - resolve: function PDFObjects_resolve(objId, data) { - var obj = this.ensureObj(objId); - - obj.resolved = true; - obj.data = data; - obj.capability.resolve(data); - }, - - isResolved: function PDFObjects_isResolved(objId) { - var objs = this.objs; - - if (!objs[objId]) { - return false; - } else { - return objs[objId].resolved; - } - }, - - hasData: function PDFObjects_hasData(objId) { - return this.isResolved(objId); - }, - - /** - * Returns the data of `objId` if object exists, null otherwise. - */ - getData: function PDFObjects_getData(objId) { - var objs = this.objs; - if (!objs[objId] || !objs[objId].resolved) { - return null; - } else { - return objs[objId].data; - } - }, - - clear: function PDFObjects_clear() { - this.objs = {}; - } - }; - return PDFObjects; -})(); - -/** - * Allows controlling of the rendering tasks. - * @class - * @alias RenderTask - */ -var RenderTask = (function RenderTaskClosure() { - function RenderTask(internalRenderTask) { - this._internalRenderTask = internalRenderTask; - - /** - * Callback for incremental rendering -- a function that will be called - * each time the rendering is paused. To continue rendering call the - * function that is the first argument to the callback. - * @type {function} - */ - this.onContinue = null; - } - - RenderTask.prototype = /** @lends RenderTask.prototype */ { - /** - * Promise for rendering task completion. - * @return {Promise} - */ - get promise() { - return this._internalRenderTask.capability.promise; - }, - - /** - * Cancels the rendering task. If the task is currently rendering it will - * not be cancelled until graphics pauses with a timeout. The promise that - * this object extends will resolved when cancelled. - */ - cancel: function RenderTask_cancel() { - this._internalRenderTask.cancel(); - }, - - /** - * Registers callbacks to indicate the rendering task completion. - * - * @param {function} onFulfilled The callback for the rendering completion. - * @param {function} onRejected The callback for the rendering failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function RenderTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return RenderTask; -})(); - -/** - * For internal use only. - * @ignore - */ -var InternalRenderTask = (function InternalRenderTaskClosure() { - - function InternalRenderTask(callback, params, objs, commonObjs, operatorList, - pageNumber) { - this.callback = callback; - this.params = params; - this.objs = objs; - this.commonObjs = commonObjs; - this.operatorListIdx = null; - this.operatorList = operatorList; - this.pageNumber = pageNumber; - this.running = false; - this.graphicsReadyCallback = null; - this.graphicsReady = false; - this.useRequestAnimationFrame = false; - this.cancelled = false; - this.capability = createPromiseCapability(); - this.task = new RenderTask(this); - // caching this-bound methods - this._continueBound = this._continue.bind(this); - this._scheduleNextBound = this._scheduleNext.bind(this); - this._nextBound = this._next.bind(this); - } - - InternalRenderTask.prototype = { - - initalizeGraphics: - function InternalRenderTask_initalizeGraphics(transparency) { - - if (this.cancelled) { - return; - } - if (PDFJS.pdfBug && 'StepperManager' in globalScope && - globalScope.StepperManager.enabled) { - this.stepper = globalScope.StepperManager.create(this.pageNumber - 1); - this.stepper.init(this.operatorList); - this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); - } - - var params = this.params; - this.gfx = new CanvasGraphics(params.canvasContext, this.commonObjs, - this.objs, params.imageLayer); - - this.gfx.beginDrawing(params.transform, params.viewport, transparency); - this.operatorListIdx = 0; - this.graphicsReady = true; - if (this.graphicsReadyCallback) { - this.graphicsReadyCallback(); - } - }, - - cancel: function InternalRenderTask_cancel() { - this.running = false; - this.cancelled = true; - this.callback('cancelled'); - }, - - operatorListChanged: function InternalRenderTask_operatorListChanged() { - if (!this.graphicsReady) { - if (!this.graphicsReadyCallback) { - this.graphicsReadyCallback = this._continueBound; - } - return; - } - - if (this.stepper) { - this.stepper.updateOperatorList(this.operatorList); - } - - if (this.running) { - return; - } - this._continue(); - }, - - _continue: function InternalRenderTask__continue() { - this.running = true; - if (this.cancelled) { - return; - } - if (this.task.onContinue) { - this.task.onContinue.call(this.task, this._scheduleNextBound); - } else { - this._scheduleNext(); - } - }, - - _scheduleNext: function InternalRenderTask__scheduleNext() { - if (this.useRequestAnimationFrame) { - window.requestAnimationFrame(this._nextBound); - } else { - Promise.resolve(undefined).then(this._nextBound); - } - }, - - _next: function InternalRenderTask__next() { - if (this.cancelled) { - return; - } - this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, - this.operatorListIdx, - this._continueBound, - this.stepper); - if (this.operatorListIdx === this.operatorList.argsArray.length) { - this.running = false; - if (this.operatorList.lastChunk) { - this.gfx.endDrawing(); - this.callback(); - } - } - } - - }; - - return InternalRenderTask; -})(); - -/** - * (Deprecated) Global observer of unsupported feature usages. Use - * onUnsupportedFeature callback of the {PDFDocumentLoadingTask} instance. - */ -PDFJS.UnsupportedManager = (function UnsupportedManagerClosure() { - var listeners = []; - return { - listen: function (cb) { - deprecated('Global UnsupportedManager.listen is used: ' + - ' use PDFDocumentLoadingTask.onUnsupportedFeature instead'); - listeners.push(cb); - }, - notify: function (featureId) { - for (var i = 0, ii = listeners.length; i < ii; i++) { - listeners[i](featureId); - } - } - }; -})(); - -exports.getDocument = PDFJS.getDocument; -exports.PDFDataRangeTransport = PDFDataRangeTransport; -exports.PDFDocumentProxy = PDFDocumentProxy; -exports.PDFPageProxy = PDFPageProxy; -})); - - - }).call(pdfjsLibs); - - exports.PDFJS = pdfjsLibs.pdfjsSharedGlobal.PDFJS; - - exports.getDocument = pdfjsLibs.pdfjsDisplayAPI.getDocument; - exports.PDFDataRangeTransport = - pdfjsLibs.pdfjsDisplayAPI.PDFDataRangeTransport; - exports.renderTextLayer = pdfjsLibs.pdfjsDisplayTextLayer.renderTextLayer; - exports.AnnotationLayer = - pdfjsLibs.pdfjsDisplayAnnotationLayer.AnnotationLayer; - exports.CustomStyle = pdfjsLibs.pdfjsDisplayDOMUtils.CustomStyle; - exports.PasswordResponses = pdfjsLibs.pdfjsSharedUtil.PasswordResponses; - exports.InvalidPDFException = pdfjsLibs.pdfjsSharedUtil.InvalidPDFException; - exports.MissingPDFException = pdfjsLibs.pdfjsSharedUtil.MissingPDFException; - exports.UnexpectedResponseException = - pdfjsLibs.pdfjsSharedUtil.UnexpectedResponseException; -})); - - diff --git a/public/plugins/pdfjs-1.4.20/build/pdf.worker.js b/public/plugins/pdfjs-1.4.20/build/pdf.worker.js deleted file mode 100644 index 821ceac93..000000000 --- a/public/plugins/pdfjs-1.4.20/build/pdf.worker.js +++ /dev/null @@ -1,42034 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* jshint globalstrict: false */ -/* umdutils ignore */ - -(function (root, factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { -define('pdfjs-dist/build/pdf.worker', ['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { -factory((root.pdfjsDistBuildPdfWorker = {})); - } -}(this, function (exports) { - // Use strict in our context only - users might not want it - 'use strict'; - -var pdfjsVersion = '1.4.20'; -var pdfjsBuild = 'b15f335'; - - var pdfjsFilePath = - typeof document !== 'undefined' && document.currentScript ? - document.currentScript.src : null; - - var pdfjsLibs = {}; - - (function pdfjsWrapper() { - - - -(function (root, factory) { - { - factory((root.pdfjsCoreArithmeticDecoder = {})); - } -}(this, function (exports) { - -/* This class implements the QM Coder decoding as defined in - * JPEG 2000 Part I Final Committee Draft Version 1.0 - * Annex C.3 Arithmetic decoding procedure - * available at http://www.jpeg.org/public/fcd15444-1.pdf - * - * The arithmetic decoder is used in conjunction with context models to decode - * JPEG2000 and JBIG2 streams. - */ -var ArithmeticDecoder = (function ArithmeticDecoderClosure() { - // Table C-2 - var QeTable = [ - {qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1}, - {qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0}, - {qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0}, - {qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0}, - {qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0}, - {qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0}, - {qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1}, - {qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0}, - {qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0}, - {qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0}, - {qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0}, - {qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0}, - {qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0}, - {qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0}, - {qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1}, - {qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0}, - {qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0}, - {qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0}, - {qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0}, - {qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0}, - {qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0}, - {qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0}, - {qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0}, - {qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0}, - {qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0}, - {qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0}, - {qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0}, - {qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0}, - {qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0}, - {qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0}, - {qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0}, - {qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0}, - {qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0}, - {qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0}, - {qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0}, - {qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0}, - {qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0}, - {qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0}, - {qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0}, - {qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0}, - {qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0}, - {qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0}, - {qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0}, - {qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0}, - {qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0}, - {qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0}, - {qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0} - ]; - - // C.3.5 Initialisation of the decoder (INITDEC) - function ArithmeticDecoder(data, start, end) { - this.data = data; - this.bp = start; - this.dataEnd = end; - - this.chigh = data[start]; - this.clow = 0; - - this.byteIn(); - - this.chigh = ((this.chigh << 7) & 0xFFFF) | ((this.clow >> 9) & 0x7F); - this.clow = (this.clow << 7) & 0xFFFF; - this.ct -= 7; - this.a = 0x8000; - } - - ArithmeticDecoder.prototype = { - // C.3.4 Compressed data input (BYTEIN) - byteIn: function ArithmeticDecoder_byteIn() { - var data = this.data; - var bp = this.bp; - if (data[bp] === 0xFF) { - var b1 = data[bp + 1]; - if (b1 > 0x8F) { - this.clow += 0xFF00; - this.ct = 8; - } else { - bp++; - this.clow += (data[bp] << 9); - this.ct = 7; - this.bp = bp; - } - } else { - bp++; - this.clow += bp < this.dataEnd ? (data[bp] << 8) : 0xFF00; - this.ct = 8; - this.bp = bp; - } - if (this.clow > 0xFFFF) { - this.chigh += (this.clow >> 16); - this.clow &= 0xFFFF; - } - }, - // C.3.2 Decoding a decision (DECODE) - readBit: function ArithmeticDecoder_readBit(contexts, pos) { - // contexts are packed into 1 byte: - // highest 7 bits carry cx.index, lowest bit carries cx.mps - var cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1; - var qeTableIcx = QeTable[cx_index]; - var qeIcx = qeTableIcx.qe; - var d; - var a = this.a - qeIcx; - - if (this.chigh < qeIcx) { - // exchangeLps - if (a < qeIcx) { - a = qeIcx; - d = cx_mps; - cx_index = qeTableIcx.nmps; - } else { - a = qeIcx; - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } - } else { - this.chigh -= qeIcx; - if ((a & 0x8000) !== 0) { - this.a = a; - return cx_mps; - } - // exchangeMps - if (a < qeIcx) { - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } else { - d = cx_mps; - cx_index = qeTableIcx.nmps; - } - } - // C.3.3 renormD; - do { - if (this.ct === 0) { - this.byteIn(); - } - - a <<= 1; - this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1); - this.clow = (this.clow << 1) & 0xFFFF; - this.ct--; - } while ((a & 0x8000) === 0); - this.a = a; - - contexts[pos] = cx_index << 1 | cx_mps; - return d; - } - }; - - return ArithmeticDecoder; -})(); - -exports.ArithmeticDecoder = ArithmeticDecoder; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCharsets = {})); - } -}(this, function (exports) { - -var ISOAdobeCharset = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', - 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', - 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', - 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', - 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', - 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', - 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', - 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', - 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', - 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', - 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', - 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', - 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', - 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', - 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', - 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', - 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', - 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', - 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', - 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', - 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', - 'ugrave', 'yacute', 'ydieresis', 'zcaron' -]; - -var ExpertCharset = [ - '.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', - 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', - 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', - 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', - 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', - 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', - 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', - 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall' -]; - -var ExpertSubsetCharset = [ - '.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', - 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', - 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', - 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', - 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior' -]; - -exports.ISOAdobeCharset = ISOAdobeCharset; -exports.ExpertCharset = ExpertCharset; -exports.ExpertSubsetCharset = ExpertSubsetCharset; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreGlyphList = {})); - } -}(this, function (exports) { - -var GlyphsUnicode = { - A: 0x0041, - AE: 0x00C6, - AEacute: 0x01FC, - AEmacron: 0x01E2, - AEsmall: 0xF7E6, - Aacute: 0x00C1, - Aacutesmall: 0xF7E1, - Abreve: 0x0102, - Abreveacute: 0x1EAE, - Abrevecyrillic: 0x04D0, - Abrevedotbelow: 0x1EB6, - Abrevegrave: 0x1EB0, - Abrevehookabove: 0x1EB2, - Abrevetilde: 0x1EB4, - Acaron: 0x01CD, - Acircle: 0x24B6, - Acircumflex: 0x00C2, - Acircumflexacute: 0x1EA4, - Acircumflexdotbelow: 0x1EAC, - Acircumflexgrave: 0x1EA6, - Acircumflexhookabove: 0x1EA8, - Acircumflexsmall: 0xF7E2, - Acircumflextilde: 0x1EAA, - Acute: 0xF6C9, - Acutesmall: 0xF7B4, - Acyrillic: 0x0410, - Adblgrave: 0x0200, - Adieresis: 0x00C4, - Adieresiscyrillic: 0x04D2, - Adieresismacron: 0x01DE, - Adieresissmall: 0xF7E4, - Adotbelow: 0x1EA0, - Adotmacron: 0x01E0, - Agrave: 0x00C0, - Agravesmall: 0xF7E0, - Ahookabove: 0x1EA2, - Aiecyrillic: 0x04D4, - Ainvertedbreve: 0x0202, - Alpha: 0x0391, - Alphatonos: 0x0386, - Amacron: 0x0100, - Amonospace: 0xFF21, - Aogonek: 0x0104, - Aring: 0x00C5, - Aringacute: 0x01FA, - Aringbelow: 0x1E00, - Aringsmall: 0xF7E5, - Asmall: 0xF761, - Atilde: 0x00C3, - Atildesmall: 0xF7E3, - Aybarmenian: 0x0531, - B: 0x0042, - Bcircle: 0x24B7, - Bdotaccent: 0x1E02, - Bdotbelow: 0x1E04, - Becyrillic: 0x0411, - Benarmenian: 0x0532, - Beta: 0x0392, - Bhook: 0x0181, - Blinebelow: 0x1E06, - Bmonospace: 0xFF22, - Brevesmall: 0xF6F4, - Bsmall: 0xF762, - Btopbar: 0x0182, - C: 0x0043, - Caarmenian: 0x053E, - Cacute: 0x0106, - Caron: 0xF6CA, - Caronsmall: 0xF6F5, - Ccaron: 0x010C, - Ccedilla: 0x00C7, - Ccedillaacute: 0x1E08, - Ccedillasmall: 0xF7E7, - Ccircle: 0x24B8, - Ccircumflex: 0x0108, - Cdot: 0x010A, - Cdotaccent: 0x010A, - Cedillasmall: 0xF7B8, - Chaarmenian: 0x0549, - Cheabkhasiancyrillic: 0x04BC, - Checyrillic: 0x0427, - Chedescenderabkhasiancyrillic: 0x04BE, - Chedescendercyrillic: 0x04B6, - Chedieresiscyrillic: 0x04F4, - Cheharmenian: 0x0543, - Chekhakassiancyrillic: 0x04CB, - Cheverticalstrokecyrillic: 0x04B8, - Chi: 0x03A7, - Chook: 0x0187, - Circumflexsmall: 0xF6F6, - Cmonospace: 0xFF23, - Coarmenian: 0x0551, - Csmall: 0xF763, - D: 0x0044, - DZ: 0x01F1, - DZcaron: 0x01C4, - Daarmenian: 0x0534, - Dafrican: 0x0189, - Dcaron: 0x010E, - Dcedilla: 0x1E10, - Dcircle: 0x24B9, - Dcircumflexbelow: 0x1E12, - Dcroat: 0x0110, - Ddotaccent: 0x1E0A, - Ddotbelow: 0x1E0C, - Decyrillic: 0x0414, - Deicoptic: 0x03EE, - Delta: 0x2206, - Deltagreek: 0x0394, - Dhook: 0x018A, - Dieresis: 0xF6CB, - DieresisAcute: 0xF6CC, - DieresisGrave: 0xF6CD, - Dieresissmall: 0xF7A8, - Digammagreek: 0x03DC, - Djecyrillic: 0x0402, - Dlinebelow: 0x1E0E, - Dmonospace: 0xFF24, - Dotaccentsmall: 0xF6F7, - Dslash: 0x0110, - Dsmall: 0xF764, - Dtopbar: 0x018B, - Dz: 0x01F2, - Dzcaron: 0x01C5, - Dzeabkhasiancyrillic: 0x04E0, - Dzecyrillic: 0x0405, - Dzhecyrillic: 0x040F, - E: 0x0045, - Eacute: 0x00C9, - Eacutesmall: 0xF7E9, - Ebreve: 0x0114, - Ecaron: 0x011A, - Ecedillabreve: 0x1E1C, - Echarmenian: 0x0535, - Ecircle: 0x24BA, - Ecircumflex: 0x00CA, - Ecircumflexacute: 0x1EBE, - Ecircumflexbelow: 0x1E18, - Ecircumflexdotbelow: 0x1EC6, - Ecircumflexgrave: 0x1EC0, - Ecircumflexhookabove: 0x1EC2, - Ecircumflexsmall: 0xF7EA, - Ecircumflextilde: 0x1EC4, - Ecyrillic: 0x0404, - Edblgrave: 0x0204, - Edieresis: 0x00CB, - Edieresissmall: 0xF7EB, - Edot: 0x0116, - Edotaccent: 0x0116, - Edotbelow: 0x1EB8, - Efcyrillic: 0x0424, - Egrave: 0x00C8, - Egravesmall: 0xF7E8, - Eharmenian: 0x0537, - Ehookabove: 0x1EBA, - Eightroman: 0x2167, - Einvertedbreve: 0x0206, - Eiotifiedcyrillic: 0x0464, - Elcyrillic: 0x041B, - Elevenroman: 0x216A, - Emacron: 0x0112, - Emacronacute: 0x1E16, - Emacrongrave: 0x1E14, - Emcyrillic: 0x041C, - Emonospace: 0xFF25, - Encyrillic: 0x041D, - Endescendercyrillic: 0x04A2, - Eng: 0x014A, - Enghecyrillic: 0x04A4, - Enhookcyrillic: 0x04C7, - Eogonek: 0x0118, - Eopen: 0x0190, - Epsilon: 0x0395, - Epsilontonos: 0x0388, - Ercyrillic: 0x0420, - Ereversed: 0x018E, - Ereversedcyrillic: 0x042D, - Escyrillic: 0x0421, - Esdescendercyrillic: 0x04AA, - Esh: 0x01A9, - Esmall: 0xF765, - Eta: 0x0397, - Etarmenian: 0x0538, - Etatonos: 0x0389, - Eth: 0x00D0, - Ethsmall: 0xF7F0, - Etilde: 0x1EBC, - Etildebelow: 0x1E1A, - Euro: 0x20AC, - Ezh: 0x01B7, - Ezhcaron: 0x01EE, - Ezhreversed: 0x01B8, - F: 0x0046, - Fcircle: 0x24BB, - Fdotaccent: 0x1E1E, - Feharmenian: 0x0556, - Feicoptic: 0x03E4, - Fhook: 0x0191, - Fitacyrillic: 0x0472, - Fiveroman: 0x2164, - Fmonospace: 0xFF26, - Fourroman: 0x2163, - Fsmall: 0xF766, - G: 0x0047, - GBsquare: 0x3387, - Gacute: 0x01F4, - Gamma: 0x0393, - Gammaafrican: 0x0194, - Gangiacoptic: 0x03EA, - Gbreve: 0x011E, - Gcaron: 0x01E6, - Gcedilla: 0x0122, - Gcircle: 0x24BC, - Gcircumflex: 0x011C, - Gcommaaccent: 0x0122, - Gdot: 0x0120, - Gdotaccent: 0x0120, - Gecyrillic: 0x0413, - Ghadarmenian: 0x0542, - Ghemiddlehookcyrillic: 0x0494, - Ghestrokecyrillic: 0x0492, - Gheupturncyrillic: 0x0490, - Ghook: 0x0193, - Gimarmenian: 0x0533, - Gjecyrillic: 0x0403, - Gmacron: 0x1E20, - Gmonospace: 0xFF27, - Grave: 0xF6CE, - Gravesmall: 0xF760, - Gsmall: 0xF767, - Gsmallhook: 0x029B, - Gstroke: 0x01E4, - H: 0x0048, - H18533: 0x25CF, - H18543: 0x25AA, - H18551: 0x25AB, - H22073: 0x25A1, - HPsquare: 0x33CB, - Haabkhasiancyrillic: 0x04A8, - Hadescendercyrillic: 0x04B2, - Hardsigncyrillic: 0x042A, - Hbar: 0x0126, - Hbrevebelow: 0x1E2A, - Hcedilla: 0x1E28, - Hcircle: 0x24BD, - Hcircumflex: 0x0124, - Hdieresis: 0x1E26, - Hdotaccent: 0x1E22, - Hdotbelow: 0x1E24, - Hmonospace: 0xFF28, - Hoarmenian: 0x0540, - Horicoptic: 0x03E8, - Hsmall: 0xF768, - Hungarumlaut: 0xF6CF, - Hungarumlautsmall: 0xF6F8, - Hzsquare: 0x3390, - I: 0x0049, - IAcyrillic: 0x042F, - IJ: 0x0132, - IUcyrillic: 0x042E, - Iacute: 0x00CD, - Iacutesmall: 0xF7ED, - Ibreve: 0x012C, - Icaron: 0x01CF, - Icircle: 0x24BE, - Icircumflex: 0x00CE, - Icircumflexsmall: 0xF7EE, - Icyrillic: 0x0406, - Idblgrave: 0x0208, - Idieresis: 0x00CF, - Idieresisacute: 0x1E2E, - Idieresiscyrillic: 0x04E4, - Idieresissmall: 0xF7EF, - Idot: 0x0130, - Idotaccent: 0x0130, - Idotbelow: 0x1ECA, - Iebrevecyrillic: 0x04D6, - Iecyrillic: 0x0415, - Ifraktur: 0x2111, - Igrave: 0x00CC, - Igravesmall: 0xF7EC, - Ihookabove: 0x1EC8, - Iicyrillic: 0x0418, - Iinvertedbreve: 0x020A, - Iishortcyrillic: 0x0419, - Imacron: 0x012A, - Imacroncyrillic: 0x04E2, - Imonospace: 0xFF29, - Iniarmenian: 0x053B, - Iocyrillic: 0x0401, - Iogonek: 0x012E, - Iota: 0x0399, - Iotaafrican: 0x0196, - Iotadieresis: 0x03AA, - Iotatonos: 0x038A, - Ismall: 0xF769, - Istroke: 0x0197, - Itilde: 0x0128, - Itildebelow: 0x1E2C, - Izhitsacyrillic: 0x0474, - Izhitsadblgravecyrillic: 0x0476, - J: 0x004A, - Jaarmenian: 0x0541, - Jcircle: 0x24BF, - Jcircumflex: 0x0134, - Jecyrillic: 0x0408, - Jheharmenian: 0x054B, - Jmonospace: 0xFF2A, - Jsmall: 0xF76A, - K: 0x004B, - KBsquare: 0x3385, - KKsquare: 0x33CD, - Kabashkircyrillic: 0x04A0, - Kacute: 0x1E30, - Kacyrillic: 0x041A, - Kadescendercyrillic: 0x049A, - Kahookcyrillic: 0x04C3, - Kappa: 0x039A, - Kastrokecyrillic: 0x049E, - Kaverticalstrokecyrillic: 0x049C, - Kcaron: 0x01E8, - Kcedilla: 0x0136, - Kcircle: 0x24C0, - Kcommaaccent: 0x0136, - Kdotbelow: 0x1E32, - Keharmenian: 0x0554, - Kenarmenian: 0x053F, - Khacyrillic: 0x0425, - Kheicoptic: 0x03E6, - Khook: 0x0198, - Kjecyrillic: 0x040C, - Klinebelow: 0x1E34, - Kmonospace: 0xFF2B, - Koppacyrillic: 0x0480, - Koppagreek: 0x03DE, - Ksicyrillic: 0x046E, - Ksmall: 0xF76B, - L: 0x004C, - LJ: 0x01C7, - LL: 0xF6BF, - Lacute: 0x0139, - Lambda: 0x039B, - Lcaron: 0x013D, - Lcedilla: 0x013B, - Lcircle: 0x24C1, - Lcircumflexbelow: 0x1E3C, - Lcommaaccent: 0x013B, - Ldot: 0x013F, - Ldotaccent: 0x013F, - Ldotbelow: 0x1E36, - Ldotbelowmacron: 0x1E38, - Liwnarmenian: 0x053C, - Lj: 0x01C8, - Ljecyrillic: 0x0409, - Llinebelow: 0x1E3A, - Lmonospace: 0xFF2C, - Lslash: 0x0141, - Lslashsmall: 0xF6F9, - Lsmall: 0xF76C, - M: 0x004D, - MBsquare: 0x3386, - Macron: 0xF6D0, - Macronsmall: 0xF7AF, - Macute: 0x1E3E, - Mcircle: 0x24C2, - Mdotaccent: 0x1E40, - Mdotbelow: 0x1E42, - Menarmenian: 0x0544, - Mmonospace: 0xFF2D, - Msmall: 0xF76D, - Mturned: 0x019C, - Mu: 0x039C, - N: 0x004E, - NJ: 0x01CA, - Nacute: 0x0143, - Ncaron: 0x0147, - Ncedilla: 0x0145, - Ncircle: 0x24C3, - Ncircumflexbelow: 0x1E4A, - Ncommaaccent: 0x0145, - Ndotaccent: 0x1E44, - Ndotbelow: 0x1E46, - Nhookleft: 0x019D, - Nineroman: 0x2168, - Nj: 0x01CB, - Njecyrillic: 0x040A, - Nlinebelow: 0x1E48, - Nmonospace: 0xFF2E, - Nowarmenian: 0x0546, - Nsmall: 0xF76E, - Ntilde: 0x00D1, - Ntildesmall: 0xF7F1, - Nu: 0x039D, - O: 0x004F, - OE: 0x0152, - OEsmall: 0xF6FA, - Oacute: 0x00D3, - Oacutesmall: 0xF7F3, - Obarredcyrillic: 0x04E8, - Obarreddieresiscyrillic: 0x04EA, - Obreve: 0x014E, - Ocaron: 0x01D1, - Ocenteredtilde: 0x019F, - Ocircle: 0x24C4, - Ocircumflex: 0x00D4, - Ocircumflexacute: 0x1ED0, - Ocircumflexdotbelow: 0x1ED8, - Ocircumflexgrave: 0x1ED2, - Ocircumflexhookabove: 0x1ED4, - Ocircumflexsmall: 0xF7F4, - Ocircumflextilde: 0x1ED6, - Ocyrillic: 0x041E, - Odblacute: 0x0150, - Odblgrave: 0x020C, - Odieresis: 0x00D6, - Odieresiscyrillic: 0x04E6, - Odieresissmall: 0xF7F6, - Odotbelow: 0x1ECC, - Ogoneksmall: 0xF6FB, - Ograve: 0x00D2, - Ogravesmall: 0xF7F2, - Oharmenian: 0x0555, - Ohm: 0x2126, - Ohookabove: 0x1ECE, - Ohorn: 0x01A0, - Ohornacute: 0x1EDA, - Ohorndotbelow: 0x1EE2, - Ohorngrave: 0x1EDC, - Ohornhookabove: 0x1EDE, - Ohorntilde: 0x1EE0, - Ohungarumlaut: 0x0150, - Oi: 0x01A2, - Oinvertedbreve: 0x020E, - Omacron: 0x014C, - Omacronacute: 0x1E52, - Omacrongrave: 0x1E50, - Omega: 0x2126, - Omegacyrillic: 0x0460, - Omegagreek: 0x03A9, - Omegaroundcyrillic: 0x047A, - Omegatitlocyrillic: 0x047C, - Omegatonos: 0x038F, - Omicron: 0x039F, - Omicrontonos: 0x038C, - Omonospace: 0xFF2F, - Oneroman: 0x2160, - Oogonek: 0x01EA, - Oogonekmacron: 0x01EC, - Oopen: 0x0186, - Oslash: 0x00D8, - Oslashacute: 0x01FE, - Oslashsmall: 0xF7F8, - Osmall: 0xF76F, - Ostrokeacute: 0x01FE, - Otcyrillic: 0x047E, - Otilde: 0x00D5, - Otildeacute: 0x1E4C, - Otildedieresis: 0x1E4E, - Otildesmall: 0xF7F5, - P: 0x0050, - Pacute: 0x1E54, - Pcircle: 0x24C5, - Pdotaccent: 0x1E56, - Pecyrillic: 0x041F, - Peharmenian: 0x054A, - Pemiddlehookcyrillic: 0x04A6, - Phi: 0x03A6, - Phook: 0x01A4, - Pi: 0x03A0, - Piwrarmenian: 0x0553, - Pmonospace: 0xFF30, - Psi: 0x03A8, - Psicyrillic: 0x0470, - Psmall: 0xF770, - Q: 0x0051, - Qcircle: 0x24C6, - Qmonospace: 0xFF31, - Qsmall: 0xF771, - R: 0x0052, - Raarmenian: 0x054C, - Racute: 0x0154, - Rcaron: 0x0158, - Rcedilla: 0x0156, - Rcircle: 0x24C7, - Rcommaaccent: 0x0156, - Rdblgrave: 0x0210, - Rdotaccent: 0x1E58, - Rdotbelow: 0x1E5A, - Rdotbelowmacron: 0x1E5C, - Reharmenian: 0x0550, - Rfraktur: 0x211C, - Rho: 0x03A1, - Ringsmall: 0xF6FC, - Rinvertedbreve: 0x0212, - Rlinebelow: 0x1E5E, - Rmonospace: 0xFF32, - Rsmall: 0xF772, - Rsmallinverted: 0x0281, - Rsmallinvertedsuperior: 0x02B6, - S: 0x0053, - SF010000: 0x250C, - SF020000: 0x2514, - SF030000: 0x2510, - SF040000: 0x2518, - SF050000: 0x253C, - SF060000: 0x252C, - SF070000: 0x2534, - SF080000: 0x251C, - SF090000: 0x2524, - SF100000: 0x2500, - SF110000: 0x2502, - SF190000: 0x2561, - SF200000: 0x2562, - SF210000: 0x2556, - SF220000: 0x2555, - SF230000: 0x2563, - SF240000: 0x2551, - SF250000: 0x2557, - SF260000: 0x255D, - SF270000: 0x255C, - SF280000: 0x255B, - SF360000: 0x255E, - SF370000: 0x255F, - SF380000: 0x255A, - SF390000: 0x2554, - SF400000: 0x2569, - SF410000: 0x2566, - SF420000: 0x2560, - SF430000: 0x2550, - SF440000: 0x256C, - SF450000: 0x2567, - SF460000: 0x2568, - SF470000: 0x2564, - SF480000: 0x2565, - SF490000: 0x2559, - SF500000: 0x2558, - SF510000: 0x2552, - SF520000: 0x2553, - SF530000: 0x256B, - SF540000: 0x256A, - Sacute: 0x015A, - Sacutedotaccent: 0x1E64, - Sampigreek: 0x03E0, - Scaron: 0x0160, - Scarondotaccent: 0x1E66, - Scaronsmall: 0xF6FD, - Scedilla: 0x015E, - Schwa: 0x018F, - Schwacyrillic: 0x04D8, - Schwadieresiscyrillic: 0x04DA, - Scircle: 0x24C8, - Scircumflex: 0x015C, - Scommaaccent: 0x0218, - Sdotaccent: 0x1E60, - Sdotbelow: 0x1E62, - Sdotbelowdotaccent: 0x1E68, - Seharmenian: 0x054D, - Sevenroman: 0x2166, - Shaarmenian: 0x0547, - Shacyrillic: 0x0428, - Shchacyrillic: 0x0429, - Sheicoptic: 0x03E2, - Shhacyrillic: 0x04BA, - Shimacoptic: 0x03EC, - Sigma: 0x03A3, - Sixroman: 0x2165, - Smonospace: 0xFF33, - Softsigncyrillic: 0x042C, - Ssmall: 0xF773, - Stigmagreek: 0x03DA, - T: 0x0054, - Tau: 0x03A4, - Tbar: 0x0166, - Tcaron: 0x0164, - Tcedilla: 0x0162, - Tcircle: 0x24C9, - Tcircumflexbelow: 0x1E70, - Tcommaaccent: 0x0162, - Tdotaccent: 0x1E6A, - Tdotbelow: 0x1E6C, - Tecyrillic: 0x0422, - Tedescendercyrillic: 0x04AC, - Tenroman: 0x2169, - Tetsecyrillic: 0x04B4, - Theta: 0x0398, - Thook: 0x01AC, - Thorn: 0x00DE, - Thornsmall: 0xF7FE, - Threeroman: 0x2162, - Tildesmall: 0xF6FE, - Tiwnarmenian: 0x054F, - Tlinebelow: 0x1E6E, - Tmonospace: 0xFF34, - Toarmenian: 0x0539, - Tonefive: 0x01BC, - Tonesix: 0x0184, - Tonetwo: 0x01A7, - Tretroflexhook: 0x01AE, - Tsecyrillic: 0x0426, - Tshecyrillic: 0x040B, - Tsmall: 0xF774, - Twelveroman: 0x216B, - Tworoman: 0x2161, - U: 0x0055, - Uacute: 0x00DA, - Uacutesmall: 0xF7FA, - Ubreve: 0x016C, - Ucaron: 0x01D3, - Ucircle: 0x24CA, - Ucircumflex: 0x00DB, - Ucircumflexbelow: 0x1E76, - Ucircumflexsmall: 0xF7FB, - Ucyrillic: 0x0423, - Udblacute: 0x0170, - Udblgrave: 0x0214, - Udieresis: 0x00DC, - Udieresisacute: 0x01D7, - Udieresisbelow: 0x1E72, - Udieresiscaron: 0x01D9, - Udieresiscyrillic: 0x04F0, - Udieresisgrave: 0x01DB, - Udieresismacron: 0x01D5, - Udieresissmall: 0xF7FC, - Udotbelow: 0x1EE4, - Ugrave: 0x00D9, - Ugravesmall: 0xF7F9, - Uhookabove: 0x1EE6, - Uhorn: 0x01AF, - Uhornacute: 0x1EE8, - Uhorndotbelow: 0x1EF0, - Uhorngrave: 0x1EEA, - Uhornhookabove: 0x1EEC, - Uhorntilde: 0x1EEE, - Uhungarumlaut: 0x0170, - Uhungarumlautcyrillic: 0x04F2, - Uinvertedbreve: 0x0216, - Ukcyrillic: 0x0478, - Umacron: 0x016A, - Umacroncyrillic: 0x04EE, - Umacrondieresis: 0x1E7A, - Umonospace: 0xFF35, - Uogonek: 0x0172, - Upsilon: 0x03A5, - Upsilon1: 0x03D2, - Upsilonacutehooksymbolgreek: 0x03D3, - Upsilonafrican: 0x01B1, - Upsilondieresis: 0x03AB, - Upsilondieresishooksymbolgreek: 0x03D4, - Upsilonhooksymbol: 0x03D2, - Upsilontonos: 0x038E, - Uring: 0x016E, - Ushortcyrillic: 0x040E, - Usmall: 0xF775, - Ustraightcyrillic: 0x04AE, - Ustraightstrokecyrillic: 0x04B0, - Utilde: 0x0168, - Utildeacute: 0x1E78, - Utildebelow: 0x1E74, - V: 0x0056, - Vcircle: 0x24CB, - Vdotbelow: 0x1E7E, - Vecyrillic: 0x0412, - Vewarmenian: 0x054E, - Vhook: 0x01B2, - Vmonospace: 0xFF36, - Voarmenian: 0x0548, - Vsmall: 0xF776, - Vtilde: 0x1E7C, - W: 0x0057, - Wacute: 0x1E82, - Wcircle: 0x24CC, - Wcircumflex: 0x0174, - Wdieresis: 0x1E84, - Wdotaccent: 0x1E86, - Wdotbelow: 0x1E88, - Wgrave: 0x1E80, - Wmonospace: 0xFF37, - Wsmall: 0xF777, - X: 0x0058, - Xcircle: 0x24CD, - Xdieresis: 0x1E8C, - Xdotaccent: 0x1E8A, - Xeharmenian: 0x053D, - Xi: 0x039E, - Xmonospace: 0xFF38, - Xsmall: 0xF778, - Y: 0x0059, - Yacute: 0x00DD, - Yacutesmall: 0xF7FD, - Yatcyrillic: 0x0462, - Ycircle: 0x24CE, - Ycircumflex: 0x0176, - Ydieresis: 0x0178, - Ydieresissmall: 0xF7FF, - Ydotaccent: 0x1E8E, - Ydotbelow: 0x1EF4, - Yericyrillic: 0x042B, - Yerudieresiscyrillic: 0x04F8, - Ygrave: 0x1EF2, - Yhook: 0x01B3, - Yhookabove: 0x1EF6, - Yiarmenian: 0x0545, - Yicyrillic: 0x0407, - Yiwnarmenian: 0x0552, - Ymonospace: 0xFF39, - Ysmall: 0xF779, - Ytilde: 0x1EF8, - Yusbigcyrillic: 0x046A, - Yusbigiotifiedcyrillic: 0x046C, - Yuslittlecyrillic: 0x0466, - Yuslittleiotifiedcyrillic: 0x0468, - Z: 0x005A, - Zaarmenian: 0x0536, - Zacute: 0x0179, - Zcaron: 0x017D, - Zcaronsmall: 0xF6FF, - Zcircle: 0x24CF, - Zcircumflex: 0x1E90, - Zdot: 0x017B, - Zdotaccent: 0x017B, - Zdotbelow: 0x1E92, - Zecyrillic: 0x0417, - Zedescendercyrillic: 0x0498, - Zedieresiscyrillic: 0x04DE, - Zeta: 0x0396, - Zhearmenian: 0x053A, - Zhebrevecyrillic: 0x04C1, - Zhecyrillic: 0x0416, - Zhedescendercyrillic: 0x0496, - Zhedieresiscyrillic: 0x04DC, - Zlinebelow: 0x1E94, - Zmonospace: 0xFF3A, - Zsmall: 0xF77A, - Zstroke: 0x01B5, - a: 0x0061, - aabengali: 0x0986, - aacute: 0x00E1, - aadeva: 0x0906, - aagujarati: 0x0A86, - aagurmukhi: 0x0A06, - aamatragurmukhi: 0x0A3E, - aarusquare: 0x3303, - aavowelsignbengali: 0x09BE, - aavowelsigndeva: 0x093E, - aavowelsigngujarati: 0x0ABE, - abbreviationmarkarmenian: 0x055F, - abbreviationsigndeva: 0x0970, - abengali: 0x0985, - abopomofo: 0x311A, - abreve: 0x0103, - abreveacute: 0x1EAF, - abrevecyrillic: 0x04D1, - abrevedotbelow: 0x1EB7, - abrevegrave: 0x1EB1, - abrevehookabove: 0x1EB3, - abrevetilde: 0x1EB5, - acaron: 0x01CE, - acircle: 0x24D0, - acircumflex: 0x00E2, - acircumflexacute: 0x1EA5, - acircumflexdotbelow: 0x1EAD, - acircumflexgrave: 0x1EA7, - acircumflexhookabove: 0x1EA9, - acircumflextilde: 0x1EAB, - acute: 0x00B4, - acutebelowcmb: 0x0317, - acutecmb: 0x0301, - acutecomb: 0x0301, - acutedeva: 0x0954, - acutelowmod: 0x02CF, - acutetonecmb: 0x0341, - acyrillic: 0x0430, - adblgrave: 0x0201, - addakgurmukhi: 0x0A71, - adeva: 0x0905, - adieresis: 0x00E4, - adieresiscyrillic: 0x04D3, - adieresismacron: 0x01DF, - adotbelow: 0x1EA1, - adotmacron: 0x01E1, - ae: 0x00E6, - aeacute: 0x01FD, - aekorean: 0x3150, - aemacron: 0x01E3, - afii00208: 0x2015, - afii08941: 0x20A4, - afii10017: 0x0410, - afii10018: 0x0411, - afii10019: 0x0412, - afii10020: 0x0413, - afii10021: 0x0414, - afii10022: 0x0415, - afii10023: 0x0401, - afii10024: 0x0416, - afii10025: 0x0417, - afii10026: 0x0418, - afii10027: 0x0419, - afii10028: 0x041A, - afii10029: 0x041B, - afii10030: 0x041C, - afii10031: 0x041D, - afii10032: 0x041E, - afii10033: 0x041F, - afii10034: 0x0420, - afii10035: 0x0421, - afii10036: 0x0422, - afii10037: 0x0423, - afii10038: 0x0424, - afii10039: 0x0425, - afii10040: 0x0426, - afii10041: 0x0427, - afii10042: 0x0428, - afii10043: 0x0429, - afii10044: 0x042A, - afii10045: 0x042B, - afii10046: 0x042C, - afii10047: 0x042D, - afii10048: 0x042E, - afii10049: 0x042F, - afii10050: 0x0490, - afii10051: 0x0402, - afii10052: 0x0403, - afii10053: 0x0404, - afii10054: 0x0405, - afii10055: 0x0406, - afii10056: 0x0407, - afii10057: 0x0408, - afii10058: 0x0409, - afii10059: 0x040A, - afii10060: 0x040B, - afii10061: 0x040C, - afii10062: 0x040E, - afii10063: 0xF6C4, - afii10064: 0xF6C5, - afii10065: 0x0430, - afii10066: 0x0431, - afii10067: 0x0432, - afii10068: 0x0433, - afii10069: 0x0434, - afii10070: 0x0435, - afii10071: 0x0451, - afii10072: 0x0436, - afii10073: 0x0437, - afii10074: 0x0438, - afii10075: 0x0439, - afii10076: 0x043A, - afii10077: 0x043B, - afii10078: 0x043C, - afii10079: 0x043D, - afii10080: 0x043E, - afii10081: 0x043F, - afii10082: 0x0440, - afii10083: 0x0441, - afii10084: 0x0442, - afii10085: 0x0443, - afii10086: 0x0444, - afii10087: 0x0445, - afii10088: 0x0446, - afii10089: 0x0447, - afii10090: 0x0448, - afii10091: 0x0449, - afii10092: 0x044A, - afii10093: 0x044B, - afii10094: 0x044C, - afii10095: 0x044D, - afii10096: 0x044E, - afii10097: 0x044F, - afii10098: 0x0491, - afii10099: 0x0452, - afii10100: 0x0453, - afii10101: 0x0454, - afii10102: 0x0455, - afii10103: 0x0456, - afii10104: 0x0457, - afii10105: 0x0458, - afii10106: 0x0459, - afii10107: 0x045A, - afii10108: 0x045B, - afii10109: 0x045C, - afii10110: 0x045E, - afii10145: 0x040F, - afii10146: 0x0462, - afii10147: 0x0472, - afii10148: 0x0474, - afii10192: 0xF6C6, - afii10193: 0x045F, - afii10194: 0x0463, - afii10195: 0x0473, - afii10196: 0x0475, - afii10831: 0xF6C7, - afii10832: 0xF6C8, - afii10846: 0x04D9, - afii299: 0x200E, - afii300: 0x200F, - afii301: 0x200D, - afii57381: 0x066A, - afii57388: 0x060C, - afii57392: 0x0660, - afii57393: 0x0661, - afii57394: 0x0662, - afii57395: 0x0663, - afii57396: 0x0664, - afii57397: 0x0665, - afii57398: 0x0666, - afii57399: 0x0667, - afii57400: 0x0668, - afii57401: 0x0669, - afii57403: 0x061B, - afii57407: 0x061F, - afii57409: 0x0621, - afii57410: 0x0622, - afii57411: 0x0623, - afii57412: 0x0624, - afii57413: 0x0625, - afii57414: 0x0626, - afii57415: 0x0627, - afii57416: 0x0628, - afii57417: 0x0629, - afii57418: 0x062A, - afii57419: 0x062B, - afii57420: 0x062C, - afii57421: 0x062D, - afii57422: 0x062E, - afii57423: 0x062F, - afii57424: 0x0630, - afii57425: 0x0631, - afii57426: 0x0632, - afii57427: 0x0633, - afii57428: 0x0634, - afii57429: 0x0635, - afii57430: 0x0636, - afii57431: 0x0637, - afii57432: 0x0638, - afii57433: 0x0639, - afii57434: 0x063A, - afii57440: 0x0640, - afii57441: 0x0641, - afii57442: 0x0642, - afii57443: 0x0643, - afii57444: 0x0644, - afii57445: 0x0645, - afii57446: 0x0646, - afii57448: 0x0648, - afii57449: 0x0649, - afii57450: 0x064A, - afii57451: 0x064B, - afii57452: 0x064C, - afii57453: 0x064D, - afii57454: 0x064E, - afii57455: 0x064F, - afii57456: 0x0650, - afii57457: 0x0651, - afii57458: 0x0652, - afii57470: 0x0647, - afii57505: 0x06A4, - afii57506: 0x067E, - afii57507: 0x0686, - afii57508: 0x0698, - afii57509: 0x06AF, - afii57511: 0x0679, - afii57512: 0x0688, - afii57513: 0x0691, - afii57514: 0x06BA, - afii57519: 0x06D2, - afii57534: 0x06D5, - afii57636: 0x20AA, - afii57645: 0x05BE, - afii57658: 0x05C3, - afii57664: 0x05D0, - afii57665: 0x05D1, - afii57666: 0x05D2, - afii57667: 0x05D3, - afii57668: 0x05D4, - afii57669: 0x05D5, - afii57670: 0x05D6, - afii57671: 0x05D7, - afii57672: 0x05D8, - afii57673: 0x05D9, - afii57674: 0x05DA, - afii57675: 0x05DB, - afii57676: 0x05DC, - afii57677: 0x05DD, - afii57678: 0x05DE, - afii57679: 0x05DF, - afii57680: 0x05E0, - afii57681: 0x05E1, - afii57682: 0x05E2, - afii57683: 0x05E3, - afii57684: 0x05E4, - afii57685: 0x05E5, - afii57686: 0x05E6, - afii57687: 0x05E7, - afii57688: 0x05E8, - afii57689: 0x05E9, - afii57690: 0x05EA, - afii57694: 0xFB2A, - afii57695: 0xFB2B, - afii57700: 0xFB4B, - afii57705: 0xFB1F, - afii57716: 0x05F0, - afii57717: 0x05F1, - afii57718: 0x05F2, - afii57723: 0xFB35, - afii57793: 0x05B4, - afii57794: 0x05B5, - afii57795: 0x05B6, - afii57796: 0x05BB, - afii57797: 0x05B8, - afii57798: 0x05B7, - afii57799: 0x05B0, - afii57800: 0x05B2, - afii57801: 0x05B1, - afii57802: 0x05B3, - afii57803: 0x05C2, - afii57804: 0x05C1, - afii57806: 0x05B9, - afii57807: 0x05BC, - afii57839: 0x05BD, - afii57841: 0x05BF, - afii57842: 0x05C0, - afii57929: 0x02BC, - afii61248: 0x2105, - afii61289: 0x2113, - afii61352: 0x2116, - afii61573: 0x202C, - afii61574: 0x202D, - afii61575: 0x202E, - afii61664: 0x200C, - afii63167: 0x066D, - afii64937: 0x02BD, - agrave: 0x00E0, - agujarati: 0x0A85, - agurmukhi: 0x0A05, - ahiragana: 0x3042, - ahookabove: 0x1EA3, - aibengali: 0x0990, - aibopomofo: 0x311E, - aideva: 0x0910, - aiecyrillic: 0x04D5, - aigujarati: 0x0A90, - aigurmukhi: 0x0A10, - aimatragurmukhi: 0x0A48, - ainarabic: 0x0639, - ainfinalarabic: 0xFECA, - aininitialarabic: 0xFECB, - ainmedialarabic: 0xFECC, - ainvertedbreve: 0x0203, - aivowelsignbengali: 0x09C8, - aivowelsigndeva: 0x0948, - aivowelsigngujarati: 0x0AC8, - akatakana: 0x30A2, - akatakanahalfwidth: 0xFF71, - akorean: 0x314F, - alef: 0x05D0, - alefarabic: 0x0627, - alefdageshhebrew: 0xFB30, - aleffinalarabic: 0xFE8E, - alefhamzaabovearabic: 0x0623, - alefhamzaabovefinalarabic: 0xFE84, - alefhamzabelowarabic: 0x0625, - alefhamzabelowfinalarabic: 0xFE88, - alefhebrew: 0x05D0, - aleflamedhebrew: 0xFB4F, - alefmaddaabovearabic: 0x0622, - alefmaddaabovefinalarabic: 0xFE82, - alefmaksuraarabic: 0x0649, - alefmaksurafinalarabic: 0xFEF0, - alefmaksurainitialarabic: 0xFEF3, - alefmaksuramedialarabic: 0xFEF4, - alefpatahhebrew: 0xFB2E, - alefqamatshebrew: 0xFB2F, - aleph: 0x2135, - allequal: 0x224C, - alpha: 0x03B1, - alphatonos: 0x03AC, - amacron: 0x0101, - amonospace: 0xFF41, - ampersand: 0x0026, - ampersandmonospace: 0xFF06, - ampersandsmall: 0xF726, - amsquare: 0x33C2, - anbopomofo: 0x3122, - angbopomofo: 0x3124, - angbracketleft: 0x3008, // This glyph is missing from Adobe's original list. - angbracketright: 0x3009, // This glyph is missing from Adobe's original list. - angkhankhuthai: 0x0E5A, - angle: 0x2220, - anglebracketleft: 0x3008, - anglebracketleftvertical: 0xFE3F, - anglebracketright: 0x3009, - anglebracketrightvertical: 0xFE40, - angleleft: 0x2329, - angleright: 0x232A, - angstrom: 0x212B, - anoteleia: 0x0387, - anudattadeva: 0x0952, - anusvarabengali: 0x0982, - anusvaradeva: 0x0902, - anusvaragujarati: 0x0A82, - aogonek: 0x0105, - apaatosquare: 0x3300, - aparen: 0x249C, - apostrophearmenian: 0x055A, - apostrophemod: 0x02BC, - apple: 0xF8FF, - approaches: 0x2250, - approxequal: 0x2248, - approxequalorimage: 0x2252, - approximatelyequal: 0x2245, - araeaekorean: 0x318E, - araeakorean: 0x318D, - arc: 0x2312, - arighthalfring: 0x1E9A, - aring: 0x00E5, - aringacute: 0x01FB, - aringbelow: 0x1E01, - arrowboth: 0x2194, - arrowdashdown: 0x21E3, - arrowdashleft: 0x21E0, - arrowdashright: 0x21E2, - arrowdashup: 0x21E1, - arrowdblboth: 0x21D4, - arrowdbldown: 0x21D3, - arrowdblleft: 0x21D0, - arrowdblright: 0x21D2, - arrowdblup: 0x21D1, - arrowdown: 0x2193, - arrowdownleft: 0x2199, - arrowdownright: 0x2198, - arrowdownwhite: 0x21E9, - arrowheaddownmod: 0x02C5, - arrowheadleftmod: 0x02C2, - arrowheadrightmod: 0x02C3, - arrowheadupmod: 0x02C4, - arrowhorizex: 0xF8E7, - arrowleft: 0x2190, - arrowleftdbl: 0x21D0, - arrowleftdblstroke: 0x21CD, - arrowleftoverright: 0x21C6, - arrowleftwhite: 0x21E6, - arrowright: 0x2192, - arrowrightdblstroke: 0x21CF, - arrowrightheavy: 0x279E, - arrowrightoverleft: 0x21C4, - arrowrightwhite: 0x21E8, - arrowtableft: 0x21E4, - arrowtabright: 0x21E5, - arrowup: 0x2191, - arrowupdn: 0x2195, - arrowupdnbse: 0x21A8, - arrowupdownbase: 0x21A8, - arrowupleft: 0x2196, - arrowupleftofdown: 0x21C5, - arrowupright: 0x2197, - arrowupwhite: 0x21E7, - arrowvertex: 0xF8E6, - asciicircum: 0x005E, - asciicircummonospace: 0xFF3E, - asciitilde: 0x007E, - asciitildemonospace: 0xFF5E, - ascript: 0x0251, - ascriptturned: 0x0252, - asmallhiragana: 0x3041, - asmallkatakana: 0x30A1, - asmallkatakanahalfwidth: 0xFF67, - asterisk: 0x002A, - asteriskaltonearabic: 0x066D, - asteriskarabic: 0x066D, - asteriskmath: 0x2217, - asteriskmonospace: 0xFF0A, - asterisksmall: 0xFE61, - asterism: 0x2042, - asuperior: 0xF6E9, - asymptoticallyequal: 0x2243, - at: 0x0040, - atilde: 0x00E3, - atmonospace: 0xFF20, - atsmall: 0xFE6B, - aturned: 0x0250, - aubengali: 0x0994, - aubopomofo: 0x3120, - audeva: 0x0914, - augujarati: 0x0A94, - augurmukhi: 0x0A14, - aulengthmarkbengali: 0x09D7, - aumatragurmukhi: 0x0A4C, - auvowelsignbengali: 0x09CC, - auvowelsigndeva: 0x094C, - auvowelsigngujarati: 0x0ACC, - avagrahadeva: 0x093D, - aybarmenian: 0x0561, - ayin: 0x05E2, - ayinaltonehebrew: 0xFB20, - ayinhebrew: 0x05E2, - b: 0x0062, - babengali: 0x09AC, - backslash: 0x005C, - backslashmonospace: 0xFF3C, - badeva: 0x092C, - bagujarati: 0x0AAC, - bagurmukhi: 0x0A2C, - bahiragana: 0x3070, - bahtthai: 0x0E3F, - bakatakana: 0x30D0, - bar: 0x007C, - barmonospace: 0xFF5C, - bbopomofo: 0x3105, - bcircle: 0x24D1, - bdotaccent: 0x1E03, - bdotbelow: 0x1E05, - beamedsixteenthnotes: 0x266C, - because: 0x2235, - becyrillic: 0x0431, - beharabic: 0x0628, - behfinalarabic: 0xFE90, - behinitialarabic: 0xFE91, - behiragana: 0x3079, - behmedialarabic: 0xFE92, - behmeeminitialarabic: 0xFC9F, - behmeemisolatedarabic: 0xFC08, - behnoonfinalarabic: 0xFC6D, - bekatakana: 0x30D9, - benarmenian: 0x0562, - bet: 0x05D1, - beta: 0x03B2, - betasymbolgreek: 0x03D0, - betdagesh: 0xFB31, - betdageshhebrew: 0xFB31, - bethebrew: 0x05D1, - betrafehebrew: 0xFB4C, - bhabengali: 0x09AD, - bhadeva: 0x092D, - bhagujarati: 0x0AAD, - bhagurmukhi: 0x0A2D, - bhook: 0x0253, - bihiragana: 0x3073, - bikatakana: 0x30D3, - bilabialclick: 0x0298, - bindigurmukhi: 0x0A02, - birusquare: 0x3331, - blackcircle: 0x25CF, - blackdiamond: 0x25C6, - blackdownpointingtriangle: 0x25BC, - blackleftpointingpointer: 0x25C4, - blackleftpointingtriangle: 0x25C0, - blacklenticularbracketleft: 0x3010, - blacklenticularbracketleftvertical: 0xFE3B, - blacklenticularbracketright: 0x3011, - blacklenticularbracketrightvertical: 0xFE3C, - blacklowerlefttriangle: 0x25E3, - blacklowerrighttriangle: 0x25E2, - blackrectangle: 0x25AC, - blackrightpointingpointer: 0x25BA, - blackrightpointingtriangle: 0x25B6, - blacksmallsquare: 0x25AA, - blacksmilingface: 0x263B, - blacksquare: 0x25A0, - blackstar: 0x2605, - blackupperlefttriangle: 0x25E4, - blackupperrighttriangle: 0x25E5, - blackuppointingsmalltriangle: 0x25B4, - blackuppointingtriangle: 0x25B2, - blank: 0x2423, - blinebelow: 0x1E07, - block: 0x2588, - bmonospace: 0xFF42, - bobaimaithai: 0x0E1A, - bohiragana: 0x307C, - bokatakana: 0x30DC, - bparen: 0x249D, - bqsquare: 0x33C3, - braceex: 0xF8F4, - braceleft: 0x007B, - braceleftbt: 0xF8F3, - braceleftmid: 0xF8F2, - braceleftmonospace: 0xFF5B, - braceleftsmall: 0xFE5B, - bracelefttp: 0xF8F1, - braceleftvertical: 0xFE37, - braceright: 0x007D, - bracerightbt: 0xF8FE, - bracerightmid: 0xF8FD, - bracerightmonospace: 0xFF5D, - bracerightsmall: 0xFE5C, - bracerighttp: 0xF8FC, - bracerightvertical: 0xFE38, - bracketleft: 0x005B, - bracketleftbt: 0xF8F0, - bracketleftex: 0xF8EF, - bracketleftmonospace: 0xFF3B, - bracketlefttp: 0xF8EE, - bracketright: 0x005D, - bracketrightbt: 0xF8FB, - bracketrightex: 0xF8FA, - bracketrightmonospace: 0xFF3D, - bracketrighttp: 0xF8F9, - breve: 0x02D8, - brevebelowcmb: 0x032E, - brevecmb: 0x0306, - breveinvertedbelowcmb: 0x032F, - breveinvertedcmb: 0x0311, - breveinverteddoublecmb: 0x0361, - bridgebelowcmb: 0x032A, - bridgeinvertedbelowcmb: 0x033A, - brokenbar: 0x00A6, - bstroke: 0x0180, - bsuperior: 0xF6EA, - btopbar: 0x0183, - buhiragana: 0x3076, - bukatakana: 0x30D6, - bullet: 0x2022, - bulletinverse: 0x25D8, - bulletoperator: 0x2219, - bullseye: 0x25CE, - c: 0x0063, - caarmenian: 0x056E, - cabengali: 0x099A, - cacute: 0x0107, - cadeva: 0x091A, - cagujarati: 0x0A9A, - cagurmukhi: 0x0A1A, - calsquare: 0x3388, - candrabindubengali: 0x0981, - candrabinducmb: 0x0310, - candrabindudeva: 0x0901, - candrabindugujarati: 0x0A81, - capslock: 0x21EA, - careof: 0x2105, - caron: 0x02C7, - caronbelowcmb: 0x032C, - caroncmb: 0x030C, - carriagereturn: 0x21B5, - cbopomofo: 0x3118, - ccaron: 0x010D, - ccedilla: 0x00E7, - ccedillaacute: 0x1E09, - ccircle: 0x24D2, - ccircumflex: 0x0109, - ccurl: 0x0255, - cdot: 0x010B, - cdotaccent: 0x010B, - cdsquare: 0x33C5, - cedilla: 0x00B8, - cedillacmb: 0x0327, - cent: 0x00A2, - centigrade: 0x2103, - centinferior: 0xF6DF, - centmonospace: 0xFFE0, - centoldstyle: 0xF7A2, - centsuperior: 0xF6E0, - chaarmenian: 0x0579, - chabengali: 0x099B, - chadeva: 0x091B, - chagujarati: 0x0A9B, - chagurmukhi: 0x0A1B, - chbopomofo: 0x3114, - cheabkhasiancyrillic: 0x04BD, - checkmark: 0x2713, - checyrillic: 0x0447, - chedescenderabkhasiancyrillic: 0x04BF, - chedescendercyrillic: 0x04B7, - chedieresiscyrillic: 0x04F5, - cheharmenian: 0x0573, - chekhakassiancyrillic: 0x04CC, - cheverticalstrokecyrillic: 0x04B9, - chi: 0x03C7, - chieuchacirclekorean: 0x3277, - chieuchaparenkorean: 0x3217, - chieuchcirclekorean: 0x3269, - chieuchkorean: 0x314A, - chieuchparenkorean: 0x3209, - chochangthai: 0x0E0A, - chochanthai: 0x0E08, - chochingthai: 0x0E09, - chochoethai: 0x0E0C, - chook: 0x0188, - cieucacirclekorean: 0x3276, - cieucaparenkorean: 0x3216, - cieuccirclekorean: 0x3268, - cieuckorean: 0x3148, - cieucparenkorean: 0x3208, - cieucuparenkorean: 0x321C, - circle: 0x25CB, - circlecopyrt: 0x00A9, // This glyph is missing from Adobe's original list. - circlemultiply: 0x2297, - circleot: 0x2299, - circleplus: 0x2295, - circlepostalmark: 0x3036, - circlewithlefthalfblack: 0x25D0, - circlewithrighthalfblack: 0x25D1, - circumflex: 0x02C6, - circumflexbelowcmb: 0x032D, - circumflexcmb: 0x0302, - clear: 0x2327, - clickalveolar: 0x01C2, - clickdental: 0x01C0, - clicklateral: 0x01C1, - clickretroflex: 0x01C3, - club: 0x2663, - clubsuitblack: 0x2663, - clubsuitwhite: 0x2667, - cmcubedsquare: 0x33A4, - cmonospace: 0xFF43, - cmsquaredsquare: 0x33A0, - coarmenian: 0x0581, - colon: 0x003A, - colonmonetary: 0x20A1, - colonmonospace: 0xFF1A, - colonsign: 0x20A1, - colonsmall: 0xFE55, - colontriangularhalfmod: 0x02D1, - colontriangularmod: 0x02D0, - comma: 0x002C, - commaabovecmb: 0x0313, - commaaboverightcmb: 0x0315, - commaaccent: 0xF6C3, - commaarabic: 0x060C, - commaarmenian: 0x055D, - commainferior: 0xF6E1, - commamonospace: 0xFF0C, - commareversedabovecmb: 0x0314, - commareversedmod: 0x02BD, - commasmall: 0xFE50, - commasuperior: 0xF6E2, - commaturnedabovecmb: 0x0312, - commaturnedmod: 0x02BB, - compass: 0x263C, - congruent: 0x2245, - contourintegral: 0x222E, - control: 0x2303, - controlACK: 0x0006, - controlBEL: 0x0007, - controlBS: 0x0008, - controlCAN: 0x0018, - controlCR: 0x000D, - controlDC1: 0x0011, - controlDC2: 0x0012, - controlDC3: 0x0013, - controlDC4: 0x0014, - controlDEL: 0x007F, - controlDLE: 0x0010, - controlEM: 0x0019, - controlENQ: 0x0005, - controlEOT: 0x0004, - controlESC: 0x001B, - controlETB: 0x0017, - controlETX: 0x0003, - controlFF: 0x000C, - controlFS: 0x001C, - controlGS: 0x001D, - controlHT: 0x0009, - controlLF: 0x000A, - controlNAK: 0x0015, - controlRS: 0x001E, - controlSI: 0x000F, - controlSO: 0x000E, - controlSOT: 0x0002, - controlSTX: 0x0001, - controlSUB: 0x001A, - controlSYN: 0x0016, - controlUS: 0x001F, - controlVT: 0x000B, - copyright: 0x00A9, - copyrightsans: 0xF8E9, - copyrightserif: 0xF6D9, - cornerbracketleft: 0x300C, - cornerbracketlefthalfwidth: 0xFF62, - cornerbracketleftvertical: 0xFE41, - cornerbracketright: 0x300D, - cornerbracketrighthalfwidth: 0xFF63, - cornerbracketrightvertical: 0xFE42, - corporationsquare: 0x337F, - cosquare: 0x33C7, - coverkgsquare: 0x33C6, - cparen: 0x249E, - cruzeiro: 0x20A2, - cstretched: 0x0297, - curlyand: 0x22CF, - curlyor: 0x22CE, - currency: 0x00A4, - cyrBreve: 0xF6D1, - cyrFlex: 0xF6D2, - cyrbreve: 0xF6D4, - cyrflex: 0xF6D5, - d: 0x0064, - daarmenian: 0x0564, - dabengali: 0x09A6, - dadarabic: 0x0636, - dadeva: 0x0926, - dadfinalarabic: 0xFEBE, - dadinitialarabic: 0xFEBF, - dadmedialarabic: 0xFEC0, - dagesh: 0x05BC, - dageshhebrew: 0x05BC, - dagger: 0x2020, - daggerdbl: 0x2021, - dagujarati: 0x0AA6, - dagurmukhi: 0x0A26, - dahiragana: 0x3060, - dakatakana: 0x30C0, - dalarabic: 0x062F, - dalet: 0x05D3, - daletdagesh: 0xFB33, - daletdageshhebrew: 0xFB33, - dalethebrew: 0x05D3, - dalfinalarabic: 0xFEAA, - dammaarabic: 0x064F, - dammalowarabic: 0x064F, - dammatanaltonearabic: 0x064C, - dammatanarabic: 0x064C, - danda: 0x0964, - dargahebrew: 0x05A7, - dargalefthebrew: 0x05A7, - dasiapneumatacyrilliccmb: 0x0485, - dblGrave: 0xF6D3, - dblanglebracketleft: 0x300A, - dblanglebracketleftvertical: 0xFE3D, - dblanglebracketright: 0x300B, - dblanglebracketrightvertical: 0xFE3E, - dblarchinvertedbelowcmb: 0x032B, - dblarrowleft: 0x21D4, - dblarrowright: 0x21D2, - dbldanda: 0x0965, - dblgrave: 0xF6D6, - dblgravecmb: 0x030F, - dblintegral: 0x222C, - dbllowline: 0x2017, - dbllowlinecmb: 0x0333, - dbloverlinecmb: 0x033F, - dblprimemod: 0x02BA, - dblverticalbar: 0x2016, - dblverticallineabovecmb: 0x030E, - dbopomofo: 0x3109, - dbsquare: 0x33C8, - dcaron: 0x010F, - dcedilla: 0x1E11, - dcircle: 0x24D3, - dcircumflexbelow: 0x1E13, - dcroat: 0x0111, - ddabengali: 0x09A1, - ddadeva: 0x0921, - ddagujarati: 0x0AA1, - ddagurmukhi: 0x0A21, - ddalarabic: 0x0688, - ddalfinalarabic: 0xFB89, - dddhadeva: 0x095C, - ddhabengali: 0x09A2, - ddhadeva: 0x0922, - ddhagujarati: 0x0AA2, - ddhagurmukhi: 0x0A22, - ddotaccent: 0x1E0B, - ddotbelow: 0x1E0D, - decimalseparatorarabic: 0x066B, - decimalseparatorpersian: 0x066B, - decyrillic: 0x0434, - degree: 0x00B0, - dehihebrew: 0x05AD, - dehiragana: 0x3067, - deicoptic: 0x03EF, - dekatakana: 0x30C7, - deleteleft: 0x232B, - deleteright: 0x2326, - delta: 0x03B4, - deltaturned: 0x018D, - denominatorminusonenumeratorbengali: 0x09F8, - dezh: 0x02A4, - dhabengali: 0x09A7, - dhadeva: 0x0927, - dhagujarati: 0x0AA7, - dhagurmukhi: 0x0A27, - dhook: 0x0257, - dialytikatonos: 0x0385, - dialytikatonoscmb: 0x0344, - diamond: 0x2666, - diamondsuitwhite: 0x2662, - dieresis: 0x00A8, - dieresisacute: 0xF6D7, - dieresisbelowcmb: 0x0324, - dieresiscmb: 0x0308, - dieresisgrave: 0xF6D8, - dieresistonos: 0x0385, - dihiragana: 0x3062, - dikatakana: 0x30C2, - dittomark: 0x3003, - divide: 0x00F7, - divides: 0x2223, - divisionslash: 0x2215, - djecyrillic: 0x0452, - dkshade: 0x2593, - dlinebelow: 0x1E0F, - dlsquare: 0x3397, - dmacron: 0x0111, - dmonospace: 0xFF44, - dnblock: 0x2584, - dochadathai: 0x0E0E, - dodekthai: 0x0E14, - dohiragana: 0x3069, - dokatakana: 0x30C9, - dollar: 0x0024, - dollarinferior: 0xF6E3, - dollarmonospace: 0xFF04, - dollaroldstyle: 0xF724, - dollarsmall: 0xFE69, - dollarsuperior: 0xF6E4, - dong: 0x20AB, - dorusquare: 0x3326, - dotaccent: 0x02D9, - dotaccentcmb: 0x0307, - dotbelowcmb: 0x0323, - dotbelowcomb: 0x0323, - dotkatakana: 0x30FB, - dotlessi: 0x0131, - dotlessj: 0xF6BE, - dotlessjstrokehook: 0x0284, - dotmath: 0x22C5, - dottedcircle: 0x25CC, - doubleyodpatah: 0xFB1F, - doubleyodpatahhebrew: 0xFB1F, - downtackbelowcmb: 0x031E, - downtackmod: 0x02D5, - dparen: 0x249F, - dsuperior: 0xF6EB, - dtail: 0x0256, - dtopbar: 0x018C, - duhiragana: 0x3065, - dukatakana: 0x30C5, - dz: 0x01F3, - dzaltone: 0x02A3, - dzcaron: 0x01C6, - dzcurl: 0x02A5, - dzeabkhasiancyrillic: 0x04E1, - dzecyrillic: 0x0455, - dzhecyrillic: 0x045F, - e: 0x0065, - eacute: 0x00E9, - earth: 0x2641, - ebengali: 0x098F, - ebopomofo: 0x311C, - ebreve: 0x0115, - ecandradeva: 0x090D, - ecandragujarati: 0x0A8D, - ecandravowelsigndeva: 0x0945, - ecandravowelsigngujarati: 0x0AC5, - ecaron: 0x011B, - ecedillabreve: 0x1E1D, - echarmenian: 0x0565, - echyiwnarmenian: 0x0587, - ecircle: 0x24D4, - ecircumflex: 0x00EA, - ecircumflexacute: 0x1EBF, - ecircumflexbelow: 0x1E19, - ecircumflexdotbelow: 0x1EC7, - ecircumflexgrave: 0x1EC1, - ecircumflexhookabove: 0x1EC3, - ecircumflextilde: 0x1EC5, - ecyrillic: 0x0454, - edblgrave: 0x0205, - edeva: 0x090F, - edieresis: 0x00EB, - edot: 0x0117, - edotaccent: 0x0117, - edotbelow: 0x1EB9, - eegurmukhi: 0x0A0F, - eematragurmukhi: 0x0A47, - efcyrillic: 0x0444, - egrave: 0x00E8, - egujarati: 0x0A8F, - eharmenian: 0x0567, - ehbopomofo: 0x311D, - ehiragana: 0x3048, - ehookabove: 0x1EBB, - eibopomofo: 0x311F, - eight: 0x0038, - eightarabic: 0x0668, - eightbengali: 0x09EE, - eightcircle: 0x2467, - eightcircleinversesansserif: 0x2791, - eightdeva: 0x096E, - eighteencircle: 0x2471, - eighteenparen: 0x2485, - eighteenperiod: 0x2499, - eightgujarati: 0x0AEE, - eightgurmukhi: 0x0A6E, - eighthackarabic: 0x0668, - eighthangzhou: 0x3028, - eighthnotebeamed: 0x266B, - eightideographicparen: 0x3227, - eightinferior: 0x2088, - eightmonospace: 0xFF18, - eightoldstyle: 0xF738, - eightparen: 0x247B, - eightperiod: 0x248F, - eightpersian: 0x06F8, - eightroman: 0x2177, - eightsuperior: 0x2078, - eightthai: 0x0E58, - einvertedbreve: 0x0207, - eiotifiedcyrillic: 0x0465, - ekatakana: 0x30A8, - ekatakanahalfwidth: 0xFF74, - ekonkargurmukhi: 0x0A74, - ekorean: 0x3154, - elcyrillic: 0x043B, - element: 0x2208, - elevencircle: 0x246A, - elevenparen: 0x247E, - elevenperiod: 0x2492, - elevenroman: 0x217A, - ellipsis: 0x2026, - ellipsisvertical: 0x22EE, - emacron: 0x0113, - emacronacute: 0x1E17, - emacrongrave: 0x1E15, - emcyrillic: 0x043C, - emdash: 0x2014, - emdashvertical: 0xFE31, - emonospace: 0xFF45, - emphasismarkarmenian: 0x055B, - emptyset: 0x2205, - enbopomofo: 0x3123, - encyrillic: 0x043D, - endash: 0x2013, - endashvertical: 0xFE32, - endescendercyrillic: 0x04A3, - eng: 0x014B, - engbopomofo: 0x3125, - enghecyrillic: 0x04A5, - enhookcyrillic: 0x04C8, - enspace: 0x2002, - eogonek: 0x0119, - eokorean: 0x3153, - eopen: 0x025B, - eopenclosed: 0x029A, - eopenreversed: 0x025C, - eopenreversedclosed: 0x025E, - eopenreversedhook: 0x025D, - eparen: 0x24A0, - epsilon: 0x03B5, - epsilontonos: 0x03AD, - equal: 0x003D, - equalmonospace: 0xFF1D, - equalsmall: 0xFE66, - equalsuperior: 0x207C, - equivalence: 0x2261, - erbopomofo: 0x3126, - ercyrillic: 0x0440, - ereversed: 0x0258, - ereversedcyrillic: 0x044D, - escyrillic: 0x0441, - esdescendercyrillic: 0x04AB, - esh: 0x0283, - eshcurl: 0x0286, - eshortdeva: 0x090E, - eshortvowelsigndeva: 0x0946, - eshreversedloop: 0x01AA, - eshsquatreversed: 0x0285, - esmallhiragana: 0x3047, - esmallkatakana: 0x30A7, - esmallkatakanahalfwidth: 0xFF6A, - estimated: 0x212E, - esuperior: 0xF6EC, - eta: 0x03B7, - etarmenian: 0x0568, - etatonos: 0x03AE, - eth: 0x00F0, - etilde: 0x1EBD, - etildebelow: 0x1E1B, - etnahtafoukhhebrew: 0x0591, - etnahtafoukhlefthebrew: 0x0591, - etnahtahebrew: 0x0591, - etnahtalefthebrew: 0x0591, - eturned: 0x01DD, - eukorean: 0x3161, - euro: 0x20AC, - evowelsignbengali: 0x09C7, - evowelsigndeva: 0x0947, - evowelsigngujarati: 0x0AC7, - exclam: 0x0021, - exclamarmenian: 0x055C, - exclamdbl: 0x203C, - exclamdown: 0x00A1, - exclamdownsmall: 0xF7A1, - exclammonospace: 0xFF01, - exclamsmall: 0xF721, - existential: 0x2203, - ezh: 0x0292, - ezhcaron: 0x01EF, - ezhcurl: 0x0293, - ezhreversed: 0x01B9, - ezhtail: 0x01BA, - f: 0x0066, - fadeva: 0x095E, - fagurmukhi: 0x0A5E, - fahrenheit: 0x2109, - fathaarabic: 0x064E, - fathalowarabic: 0x064E, - fathatanarabic: 0x064B, - fbopomofo: 0x3108, - fcircle: 0x24D5, - fdotaccent: 0x1E1F, - feharabic: 0x0641, - feharmenian: 0x0586, - fehfinalarabic: 0xFED2, - fehinitialarabic: 0xFED3, - fehmedialarabic: 0xFED4, - feicoptic: 0x03E5, - female: 0x2640, - ff: 0xFB00, - ffi: 0xFB03, - ffl: 0xFB04, - fi: 0xFB01, - fifteencircle: 0x246E, - fifteenparen: 0x2482, - fifteenperiod: 0x2496, - figuredash: 0x2012, - filledbox: 0x25A0, - filledrect: 0x25AC, - finalkaf: 0x05DA, - finalkafdagesh: 0xFB3A, - finalkafdageshhebrew: 0xFB3A, - finalkafhebrew: 0x05DA, - finalmem: 0x05DD, - finalmemhebrew: 0x05DD, - finalnun: 0x05DF, - finalnunhebrew: 0x05DF, - finalpe: 0x05E3, - finalpehebrew: 0x05E3, - finaltsadi: 0x05E5, - finaltsadihebrew: 0x05E5, - firsttonechinese: 0x02C9, - fisheye: 0x25C9, - fitacyrillic: 0x0473, - five: 0x0035, - fivearabic: 0x0665, - fivebengali: 0x09EB, - fivecircle: 0x2464, - fivecircleinversesansserif: 0x278E, - fivedeva: 0x096B, - fiveeighths: 0x215D, - fivegujarati: 0x0AEB, - fivegurmukhi: 0x0A6B, - fivehackarabic: 0x0665, - fivehangzhou: 0x3025, - fiveideographicparen: 0x3224, - fiveinferior: 0x2085, - fivemonospace: 0xFF15, - fiveoldstyle: 0xF735, - fiveparen: 0x2478, - fiveperiod: 0x248C, - fivepersian: 0x06F5, - fiveroman: 0x2174, - fivesuperior: 0x2075, - fivethai: 0x0E55, - fl: 0xFB02, - florin: 0x0192, - fmonospace: 0xFF46, - fmsquare: 0x3399, - fofanthai: 0x0E1F, - fofathai: 0x0E1D, - fongmanthai: 0x0E4F, - forall: 0x2200, - four: 0x0034, - fourarabic: 0x0664, - fourbengali: 0x09EA, - fourcircle: 0x2463, - fourcircleinversesansserif: 0x278D, - fourdeva: 0x096A, - fourgujarati: 0x0AEA, - fourgurmukhi: 0x0A6A, - fourhackarabic: 0x0664, - fourhangzhou: 0x3024, - fourideographicparen: 0x3223, - fourinferior: 0x2084, - fourmonospace: 0xFF14, - fournumeratorbengali: 0x09F7, - fouroldstyle: 0xF734, - fourparen: 0x2477, - fourperiod: 0x248B, - fourpersian: 0x06F4, - fourroman: 0x2173, - foursuperior: 0x2074, - fourteencircle: 0x246D, - fourteenparen: 0x2481, - fourteenperiod: 0x2495, - fourthai: 0x0E54, - fourthtonechinese: 0x02CB, - fparen: 0x24A1, - fraction: 0x2044, - franc: 0x20A3, - g: 0x0067, - gabengali: 0x0997, - gacute: 0x01F5, - gadeva: 0x0917, - gafarabic: 0x06AF, - gaffinalarabic: 0xFB93, - gafinitialarabic: 0xFB94, - gafmedialarabic: 0xFB95, - gagujarati: 0x0A97, - gagurmukhi: 0x0A17, - gahiragana: 0x304C, - gakatakana: 0x30AC, - gamma: 0x03B3, - gammalatinsmall: 0x0263, - gammasuperior: 0x02E0, - gangiacoptic: 0x03EB, - gbopomofo: 0x310D, - gbreve: 0x011F, - gcaron: 0x01E7, - gcedilla: 0x0123, - gcircle: 0x24D6, - gcircumflex: 0x011D, - gcommaaccent: 0x0123, - gdot: 0x0121, - gdotaccent: 0x0121, - gecyrillic: 0x0433, - gehiragana: 0x3052, - gekatakana: 0x30B2, - geometricallyequal: 0x2251, - gereshaccenthebrew: 0x059C, - gereshhebrew: 0x05F3, - gereshmuqdamhebrew: 0x059D, - germandbls: 0x00DF, - gershayimaccenthebrew: 0x059E, - gershayimhebrew: 0x05F4, - getamark: 0x3013, - ghabengali: 0x0998, - ghadarmenian: 0x0572, - ghadeva: 0x0918, - ghagujarati: 0x0A98, - ghagurmukhi: 0x0A18, - ghainarabic: 0x063A, - ghainfinalarabic: 0xFECE, - ghaininitialarabic: 0xFECF, - ghainmedialarabic: 0xFED0, - ghemiddlehookcyrillic: 0x0495, - ghestrokecyrillic: 0x0493, - gheupturncyrillic: 0x0491, - ghhadeva: 0x095A, - ghhagurmukhi: 0x0A5A, - ghook: 0x0260, - ghzsquare: 0x3393, - gihiragana: 0x304E, - gikatakana: 0x30AE, - gimarmenian: 0x0563, - gimel: 0x05D2, - gimeldagesh: 0xFB32, - gimeldageshhebrew: 0xFB32, - gimelhebrew: 0x05D2, - gjecyrillic: 0x0453, - glottalinvertedstroke: 0x01BE, - glottalstop: 0x0294, - glottalstopinverted: 0x0296, - glottalstopmod: 0x02C0, - glottalstopreversed: 0x0295, - glottalstopreversedmod: 0x02C1, - glottalstopreversedsuperior: 0x02E4, - glottalstopstroke: 0x02A1, - glottalstopstrokereversed: 0x02A2, - gmacron: 0x1E21, - gmonospace: 0xFF47, - gohiragana: 0x3054, - gokatakana: 0x30B4, - gparen: 0x24A2, - gpasquare: 0x33AC, - gradient: 0x2207, - grave: 0x0060, - gravebelowcmb: 0x0316, - gravecmb: 0x0300, - gravecomb: 0x0300, - gravedeva: 0x0953, - gravelowmod: 0x02CE, - gravemonospace: 0xFF40, - gravetonecmb: 0x0340, - greater: 0x003E, - greaterequal: 0x2265, - greaterequalorless: 0x22DB, - greatermonospace: 0xFF1E, - greaterorequivalent: 0x2273, - greaterorless: 0x2277, - greateroverequal: 0x2267, - greatersmall: 0xFE65, - gscript: 0x0261, - gstroke: 0x01E5, - guhiragana: 0x3050, - guillemotleft: 0x00AB, - guillemotright: 0x00BB, - guilsinglleft: 0x2039, - guilsinglright: 0x203A, - gukatakana: 0x30B0, - guramusquare: 0x3318, - gysquare: 0x33C9, - h: 0x0068, - haabkhasiancyrillic: 0x04A9, - haaltonearabic: 0x06C1, - habengali: 0x09B9, - hadescendercyrillic: 0x04B3, - hadeva: 0x0939, - hagujarati: 0x0AB9, - hagurmukhi: 0x0A39, - haharabic: 0x062D, - hahfinalarabic: 0xFEA2, - hahinitialarabic: 0xFEA3, - hahiragana: 0x306F, - hahmedialarabic: 0xFEA4, - haitusquare: 0x332A, - hakatakana: 0x30CF, - hakatakanahalfwidth: 0xFF8A, - halantgurmukhi: 0x0A4D, - hamzaarabic: 0x0621, - hamzalowarabic: 0x0621, - hangulfiller: 0x3164, - hardsigncyrillic: 0x044A, - harpoonleftbarbup: 0x21BC, - harpoonrightbarbup: 0x21C0, - hasquare: 0x33CA, - hatafpatah: 0x05B2, - hatafpatah16: 0x05B2, - hatafpatah23: 0x05B2, - hatafpatah2f: 0x05B2, - hatafpatahhebrew: 0x05B2, - hatafpatahnarrowhebrew: 0x05B2, - hatafpatahquarterhebrew: 0x05B2, - hatafpatahwidehebrew: 0x05B2, - hatafqamats: 0x05B3, - hatafqamats1b: 0x05B3, - hatafqamats28: 0x05B3, - hatafqamats34: 0x05B3, - hatafqamatshebrew: 0x05B3, - hatafqamatsnarrowhebrew: 0x05B3, - hatafqamatsquarterhebrew: 0x05B3, - hatafqamatswidehebrew: 0x05B3, - hatafsegol: 0x05B1, - hatafsegol17: 0x05B1, - hatafsegol24: 0x05B1, - hatafsegol30: 0x05B1, - hatafsegolhebrew: 0x05B1, - hatafsegolnarrowhebrew: 0x05B1, - hatafsegolquarterhebrew: 0x05B1, - hatafsegolwidehebrew: 0x05B1, - hbar: 0x0127, - hbopomofo: 0x310F, - hbrevebelow: 0x1E2B, - hcedilla: 0x1E29, - hcircle: 0x24D7, - hcircumflex: 0x0125, - hdieresis: 0x1E27, - hdotaccent: 0x1E23, - hdotbelow: 0x1E25, - he: 0x05D4, - heart: 0x2665, - heartsuitblack: 0x2665, - heartsuitwhite: 0x2661, - hedagesh: 0xFB34, - hedageshhebrew: 0xFB34, - hehaltonearabic: 0x06C1, - heharabic: 0x0647, - hehebrew: 0x05D4, - hehfinalaltonearabic: 0xFBA7, - hehfinalalttwoarabic: 0xFEEA, - hehfinalarabic: 0xFEEA, - hehhamzaabovefinalarabic: 0xFBA5, - hehhamzaaboveisolatedarabic: 0xFBA4, - hehinitialaltonearabic: 0xFBA8, - hehinitialarabic: 0xFEEB, - hehiragana: 0x3078, - hehmedialaltonearabic: 0xFBA9, - hehmedialarabic: 0xFEEC, - heiseierasquare: 0x337B, - hekatakana: 0x30D8, - hekatakanahalfwidth: 0xFF8D, - hekutaarusquare: 0x3336, - henghook: 0x0267, - herutusquare: 0x3339, - het: 0x05D7, - hethebrew: 0x05D7, - hhook: 0x0266, - hhooksuperior: 0x02B1, - hieuhacirclekorean: 0x327B, - hieuhaparenkorean: 0x321B, - hieuhcirclekorean: 0x326D, - hieuhkorean: 0x314E, - hieuhparenkorean: 0x320D, - hihiragana: 0x3072, - hikatakana: 0x30D2, - hikatakanahalfwidth: 0xFF8B, - hiriq: 0x05B4, - hiriq14: 0x05B4, - hiriq21: 0x05B4, - hiriq2d: 0x05B4, - hiriqhebrew: 0x05B4, - hiriqnarrowhebrew: 0x05B4, - hiriqquarterhebrew: 0x05B4, - hiriqwidehebrew: 0x05B4, - hlinebelow: 0x1E96, - hmonospace: 0xFF48, - hoarmenian: 0x0570, - hohipthai: 0x0E2B, - hohiragana: 0x307B, - hokatakana: 0x30DB, - hokatakanahalfwidth: 0xFF8E, - holam: 0x05B9, - holam19: 0x05B9, - holam26: 0x05B9, - holam32: 0x05B9, - holamhebrew: 0x05B9, - holamnarrowhebrew: 0x05B9, - holamquarterhebrew: 0x05B9, - holamwidehebrew: 0x05B9, - honokhukthai: 0x0E2E, - hookabovecomb: 0x0309, - hookcmb: 0x0309, - hookpalatalizedbelowcmb: 0x0321, - hookretroflexbelowcmb: 0x0322, - hoonsquare: 0x3342, - horicoptic: 0x03E9, - horizontalbar: 0x2015, - horncmb: 0x031B, - hotsprings: 0x2668, - house: 0x2302, - hparen: 0x24A3, - hsuperior: 0x02B0, - hturned: 0x0265, - huhiragana: 0x3075, - huiitosquare: 0x3333, - hukatakana: 0x30D5, - hukatakanahalfwidth: 0xFF8C, - hungarumlaut: 0x02DD, - hungarumlautcmb: 0x030B, - hv: 0x0195, - hyphen: 0x002D, - hypheninferior: 0xF6E5, - hyphenmonospace: 0xFF0D, - hyphensmall: 0xFE63, - hyphensuperior: 0xF6E6, - hyphentwo: 0x2010, - i: 0x0069, - iacute: 0x00ED, - iacyrillic: 0x044F, - ibengali: 0x0987, - ibopomofo: 0x3127, - ibreve: 0x012D, - icaron: 0x01D0, - icircle: 0x24D8, - icircumflex: 0x00EE, - icyrillic: 0x0456, - idblgrave: 0x0209, - ideographearthcircle: 0x328F, - ideographfirecircle: 0x328B, - ideographicallianceparen: 0x323F, - ideographiccallparen: 0x323A, - ideographiccentrecircle: 0x32A5, - ideographicclose: 0x3006, - ideographiccomma: 0x3001, - ideographiccommaleft: 0xFF64, - ideographiccongratulationparen: 0x3237, - ideographiccorrectcircle: 0x32A3, - ideographicearthparen: 0x322F, - ideographicenterpriseparen: 0x323D, - ideographicexcellentcircle: 0x329D, - ideographicfestivalparen: 0x3240, - ideographicfinancialcircle: 0x3296, - ideographicfinancialparen: 0x3236, - ideographicfireparen: 0x322B, - ideographichaveparen: 0x3232, - ideographichighcircle: 0x32A4, - ideographiciterationmark: 0x3005, - ideographiclaborcircle: 0x3298, - ideographiclaborparen: 0x3238, - ideographicleftcircle: 0x32A7, - ideographiclowcircle: 0x32A6, - ideographicmedicinecircle: 0x32A9, - ideographicmetalparen: 0x322E, - ideographicmoonparen: 0x322A, - ideographicnameparen: 0x3234, - ideographicperiod: 0x3002, - ideographicprintcircle: 0x329E, - ideographicreachparen: 0x3243, - ideographicrepresentparen: 0x3239, - ideographicresourceparen: 0x323E, - ideographicrightcircle: 0x32A8, - ideographicsecretcircle: 0x3299, - ideographicselfparen: 0x3242, - ideographicsocietyparen: 0x3233, - ideographicspace: 0x3000, - ideographicspecialparen: 0x3235, - ideographicstockparen: 0x3231, - ideographicstudyparen: 0x323B, - ideographicsunparen: 0x3230, - ideographicsuperviseparen: 0x323C, - ideographicwaterparen: 0x322C, - ideographicwoodparen: 0x322D, - ideographiczero: 0x3007, - ideographmetalcircle: 0x328E, - ideographmooncircle: 0x328A, - ideographnamecircle: 0x3294, - ideographsuncircle: 0x3290, - ideographwatercircle: 0x328C, - ideographwoodcircle: 0x328D, - ideva: 0x0907, - idieresis: 0x00EF, - idieresisacute: 0x1E2F, - idieresiscyrillic: 0x04E5, - idotbelow: 0x1ECB, - iebrevecyrillic: 0x04D7, - iecyrillic: 0x0435, - ieungacirclekorean: 0x3275, - ieungaparenkorean: 0x3215, - ieungcirclekorean: 0x3267, - ieungkorean: 0x3147, - ieungparenkorean: 0x3207, - igrave: 0x00EC, - igujarati: 0x0A87, - igurmukhi: 0x0A07, - ihiragana: 0x3044, - ihookabove: 0x1EC9, - iibengali: 0x0988, - iicyrillic: 0x0438, - iideva: 0x0908, - iigujarati: 0x0A88, - iigurmukhi: 0x0A08, - iimatragurmukhi: 0x0A40, - iinvertedbreve: 0x020B, - iishortcyrillic: 0x0439, - iivowelsignbengali: 0x09C0, - iivowelsigndeva: 0x0940, - iivowelsigngujarati: 0x0AC0, - ij: 0x0133, - ikatakana: 0x30A4, - ikatakanahalfwidth: 0xFF72, - ikorean: 0x3163, - ilde: 0x02DC, - iluyhebrew: 0x05AC, - imacron: 0x012B, - imacroncyrillic: 0x04E3, - imageorapproximatelyequal: 0x2253, - imatragurmukhi: 0x0A3F, - imonospace: 0xFF49, - increment: 0x2206, - infinity: 0x221E, - iniarmenian: 0x056B, - integral: 0x222B, - integralbottom: 0x2321, - integralbt: 0x2321, - integralex: 0xF8F5, - integraltop: 0x2320, - integraltp: 0x2320, - intersection: 0x2229, - intisquare: 0x3305, - invbullet: 0x25D8, - invcircle: 0x25D9, - invsmileface: 0x263B, - iocyrillic: 0x0451, - iogonek: 0x012F, - iota: 0x03B9, - iotadieresis: 0x03CA, - iotadieresistonos: 0x0390, - iotalatin: 0x0269, - iotatonos: 0x03AF, - iparen: 0x24A4, - irigurmukhi: 0x0A72, - ismallhiragana: 0x3043, - ismallkatakana: 0x30A3, - ismallkatakanahalfwidth: 0xFF68, - issharbengali: 0x09FA, - istroke: 0x0268, - isuperior: 0xF6ED, - iterationhiragana: 0x309D, - iterationkatakana: 0x30FD, - itilde: 0x0129, - itildebelow: 0x1E2D, - iubopomofo: 0x3129, - iucyrillic: 0x044E, - ivowelsignbengali: 0x09BF, - ivowelsigndeva: 0x093F, - ivowelsigngujarati: 0x0ABF, - izhitsacyrillic: 0x0475, - izhitsadblgravecyrillic: 0x0477, - j: 0x006A, - jaarmenian: 0x0571, - jabengali: 0x099C, - jadeva: 0x091C, - jagujarati: 0x0A9C, - jagurmukhi: 0x0A1C, - jbopomofo: 0x3110, - jcaron: 0x01F0, - jcircle: 0x24D9, - jcircumflex: 0x0135, - jcrossedtail: 0x029D, - jdotlessstroke: 0x025F, - jecyrillic: 0x0458, - jeemarabic: 0x062C, - jeemfinalarabic: 0xFE9E, - jeeminitialarabic: 0xFE9F, - jeemmedialarabic: 0xFEA0, - jeharabic: 0x0698, - jehfinalarabic: 0xFB8B, - jhabengali: 0x099D, - jhadeva: 0x091D, - jhagujarati: 0x0A9D, - jhagurmukhi: 0x0A1D, - jheharmenian: 0x057B, - jis: 0x3004, - jmonospace: 0xFF4A, - jparen: 0x24A5, - jsuperior: 0x02B2, - k: 0x006B, - kabashkircyrillic: 0x04A1, - kabengali: 0x0995, - kacute: 0x1E31, - kacyrillic: 0x043A, - kadescendercyrillic: 0x049B, - kadeva: 0x0915, - kaf: 0x05DB, - kafarabic: 0x0643, - kafdagesh: 0xFB3B, - kafdageshhebrew: 0xFB3B, - kaffinalarabic: 0xFEDA, - kafhebrew: 0x05DB, - kafinitialarabic: 0xFEDB, - kafmedialarabic: 0xFEDC, - kafrafehebrew: 0xFB4D, - kagujarati: 0x0A95, - kagurmukhi: 0x0A15, - kahiragana: 0x304B, - kahookcyrillic: 0x04C4, - kakatakana: 0x30AB, - kakatakanahalfwidth: 0xFF76, - kappa: 0x03BA, - kappasymbolgreek: 0x03F0, - kapyeounmieumkorean: 0x3171, - kapyeounphieuphkorean: 0x3184, - kapyeounpieupkorean: 0x3178, - kapyeounssangpieupkorean: 0x3179, - karoriisquare: 0x330D, - kashidaautoarabic: 0x0640, - kashidaautonosidebearingarabic: 0x0640, - kasmallkatakana: 0x30F5, - kasquare: 0x3384, - kasraarabic: 0x0650, - kasratanarabic: 0x064D, - kastrokecyrillic: 0x049F, - katahiraprolongmarkhalfwidth: 0xFF70, - kaverticalstrokecyrillic: 0x049D, - kbopomofo: 0x310E, - kcalsquare: 0x3389, - kcaron: 0x01E9, - kcedilla: 0x0137, - kcircle: 0x24DA, - kcommaaccent: 0x0137, - kdotbelow: 0x1E33, - keharmenian: 0x0584, - kehiragana: 0x3051, - kekatakana: 0x30B1, - kekatakanahalfwidth: 0xFF79, - kenarmenian: 0x056F, - kesmallkatakana: 0x30F6, - kgreenlandic: 0x0138, - khabengali: 0x0996, - khacyrillic: 0x0445, - khadeva: 0x0916, - khagujarati: 0x0A96, - khagurmukhi: 0x0A16, - khaharabic: 0x062E, - khahfinalarabic: 0xFEA6, - khahinitialarabic: 0xFEA7, - khahmedialarabic: 0xFEA8, - kheicoptic: 0x03E7, - khhadeva: 0x0959, - khhagurmukhi: 0x0A59, - khieukhacirclekorean: 0x3278, - khieukhaparenkorean: 0x3218, - khieukhcirclekorean: 0x326A, - khieukhkorean: 0x314B, - khieukhparenkorean: 0x320A, - khokhaithai: 0x0E02, - khokhonthai: 0x0E05, - khokhuatthai: 0x0E03, - khokhwaithai: 0x0E04, - khomutthai: 0x0E5B, - khook: 0x0199, - khorakhangthai: 0x0E06, - khzsquare: 0x3391, - kihiragana: 0x304D, - kikatakana: 0x30AD, - kikatakanahalfwidth: 0xFF77, - kiroguramusquare: 0x3315, - kiromeetorusquare: 0x3316, - kirosquare: 0x3314, - kiyeokacirclekorean: 0x326E, - kiyeokaparenkorean: 0x320E, - kiyeokcirclekorean: 0x3260, - kiyeokkorean: 0x3131, - kiyeokparenkorean: 0x3200, - kiyeoksioskorean: 0x3133, - kjecyrillic: 0x045C, - klinebelow: 0x1E35, - klsquare: 0x3398, - kmcubedsquare: 0x33A6, - kmonospace: 0xFF4B, - kmsquaredsquare: 0x33A2, - kohiragana: 0x3053, - kohmsquare: 0x33C0, - kokaithai: 0x0E01, - kokatakana: 0x30B3, - kokatakanahalfwidth: 0xFF7A, - kooposquare: 0x331E, - koppacyrillic: 0x0481, - koreanstandardsymbol: 0x327F, - koroniscmb: 0x0343, - kparen: 0x24A6, - kpasquare: 0x33AA, - ksicyrillic: 0x046F, - ktsquare: 0x33CF, - kturned: 0x029E, - kuhiragana: 0x304F, - kukatakana: 0x30AF, - kukatakanahalfwidth: 0xFF78, - kvsquare: 0x33B8, - kwsquare: 0x33BE, - l: 0x006C, - labengali: 0x09B2, - lacute: 0x013A, - ladeva: 0x0932, - lagujarati: 0x0AB2, - lagurmukhi: 0x0A32, - lakkhangyaothai: 0x0E45, - lamaleffinalarabic: 0xFEFC, - lamalefhamzaabovefinalarabic: 0xFEF8, - lamalefhamzaaboveisolatedarabic: 0xFEF7, - lamalefhamzabelowfinalarabic: 0xFEFA, - lamalefhamzabelowisolatedarabic: 0xFEF9, - lamalefisolatedarabic: 0xFEFB, - lamalefmaddaabovefinalarabic: 0xFEF6, - lamalefmaddaaboveisolatedarabic: 0xFEF5, - lamarabic: 0x0644, - lambda: 0x03BB, - lambdastroke: 0x019B, - lamed: 0x05DC, - lameddagesh: 0xFB3C, - lameddageshhebrew: 0xFB3C, - lamedhebrew: 0x05DC, - lamfinalarabic: 0xFEDE, - lamhahinitialarabic: 0xFCCA, - laminitialarabic: 0xFEDF, - lamjeeminitialarabic: 0xFCC9, - lamkhahinitialarabic: 0xFCCB, - lamlamhehisolatedarabic: 0xFDF2, - lammedialarabic: 0xFEE0, - lammeemhahinitialarabic: 0xFD88, - lammeeminitialarabic: 0xFCCC, - largecircle: 0x25EF, - lbar: 0x019A, - lbelt: 0x026C, - lbopomofo: 0x310C, - lcaron: 0x013E, - lcedilla: 0x013C, - lcircle: 0x24DB, - lcircumflexbelow: 0x1E3D, - lcommaaccent: 0x013C, - ldot: 0x0140, - ldotaccent: 0x0140, - ldotbelow: 0x1E37, - ldotbelowmacron: 0x1E39, - leftangleabovecmb: 0x031A, - lefttackbelowcmb: 0x0318, - less: 0x003C, - lessequal: 0x2264, - lessequalorgreater: 0x22DA, - lessmonospace: 0xFF1C, - lessorequivalent: 0x2272, - lessorgreater: 0x2276, - lessoverequal: 0x2266, - lesssmall: 0xFE64, - lezh: 0x026E, - lfblock: 0x258C, - lhookretroflex: 0x026D, - lira: 0x20A4, - liwnarmenian: 0x056C, - lj: 0x01C9, - ljecyrillic: 0x0459, - ll: 0xF6C0, - lladeva: 0x0933, - llagujarati: 0x0AB3, - llinebelow: 0x1E3B, - llladeva: 0x0934, - llvocalicbengali: 0x09E1, - llvocalicdeva: 0x0961, - llvocalicvowelsignbengali: 0x09E3, - llvocalicvowelsigndeva: 0x0963, - lmiddletilde: 0x026B, - lmonospace: 0xFF4C, - lmsquare: 0x33D0, - lochulathai: 0x0E2C, - logicaland: 0x2227, - logicalnot: 0x00AC, - logicalnotreversed: 0x2310, - logicalor: 0x2228, - lolingthai: 0x0E25, - longs: 0x017F, - lowlinecenterline: 0xFE4E, - lowlinecmb: 0x0332, - lowlinedashed: 0xFE4D, - lozenge: 0x25CA, - lparen: 0x24A7, - lslash: 0x0142, - lsquare: 0x2113, - lsuperior: 0xF6EE, - ltshade: 0x2591, - luthai: 0x0E26, - lvocalicbengali: 0x098C, - lvocalicdeva: 0x090C, - lvocalicvowelsignbengali: 0x09E2, - lvocalicvowelsigndeva: 0x0962, - lxsquare: 0x33D3, - m: 0x006D, - mabengali: 0x09AE, - macron: 0x00AF, - macronbelowcmb: 0x0331, - macroncmb: 0x0304, - macronlowmod: 0x02CD, - macronmonospace: 0xFFE3, - macute: 0x1E3F, - madeva: 0x092E, - magujarati: 0x0AAE, - magurmukhi: 0x0A2E, - mahapakhhebrew: 0x05A4, - mahapakhlefthebrew: 0x05A4, - mahiragana: 0x307E, - maichattawalowleftthai: 0xF895, - maichattawalowrightthai: 0xF894, - maichattawathai: 0x0E4B, - maichattawaupperleftthai: 0xF893, - maieklowleftthai: 0xF88C, - maieklowrightthai: 0xF88B, - maiekthai: 0x0E48, - maiekupperleftthai: 0xF88A, - maihanakatleftthai: 0xF884, - maihanakatthai: 0x0E31, - maitaikhuleftthai: 0xF889, - maitaikhuthai: 0x0E47, - maitholowleftthai: 0xF88F, - maitholowrightthai: 0xF88E, - maithothai: 0x0E49, - maithoupperleftthai: 0xF88D, - maitrilowleftthai: 0xF892, - maitrilowrightthai: 0xF891, - maitrithai: 0x0E4A, - maitriupperleftthai: 0xF890, - maiyamokthai: 0x0E46, - makatakana: 0x30DE, - makatakanahalfwidth: 0xFF8F, - male: 0x2642, - mansyonsquare: 0x3347, - maqafhebrew: 0x05BE, - mars: 0x2642, - masoracirclehebrew: 0x05AF, - masquare: 0x3383, - mbopomofo: 0x3107, - mbsquare: 0x33D4, - mcircle: 0x24DC, - mcubedsquare: 0x33A5, - mdotaccent: 0x1E41, - mdotbelow: 0x1E43, - meemarabic: 0x0645, - meemfinalarabic: 0xFEE2, - meeminitialarabic: 0xFEE3, - meemmedialarabic: 0xFEE4, - meemmeeminitialarabic: 0xFCD1, - meemmeemisolatedarabic: 0xFC48, - meetorusquare: 0x334D, - mehiragana: 0x3081, - meizierasquare: 0x337E, - mekatakana: 0x30E1, - mekatakanahalfwidth: 0xFF92, - mem: 0x05DE, - memdagesh: 0xFB3E, - memdageshhebrew: 0xFB3E, - memhebrew: 0x05DE, - menarmenian: 0x0574, - merkhahebrew: 0x05A5, - merkhakefulahebrew: 0x05A6, - merkhakefulalefthebrew: 0x05A6, - merkhalefthebrew: 0x05A5, - mhook: 0x0271, - mhzsquare: 0x3392, - middledotkatakanahalfwidth: 0xFF65, - middot: 0x00B7, - mieumacirclekorean: 0x3272, - mieumaparenkorean: 0x3212, - mieumcirclekorean: 0x3264, - mieumkorean: 0x3141, - mieumpansioskorean: 0x3170, - mieumparenkorean: 0x3204, - mieumpieupkorean: 0x316E, - mieumsioskorean: 0x316F, - mihiragana: 0x307F, - mikatakana: 0x30DF, - mikatakanahalfwidth: 0xFF90, - minus: 0x2212, - minusbelowcmb: 0x0320, - minuscircle: 0x2296, - minusmod: 0x02D7, - minusplus: 0x2213, - minute: 0x2032, - miribaarusquare: 0x334A, - mirisquare: 0x3349, - mlonglegturned: 0x0270, - mlsquare: 0x3396, - mmcubedsquare: 0x33A3, - mmonospace: 0xFF4D, - mmsquaredsquare: 0x339F, - mohiragana: 0x3082, - mohmsquare: 0x33C1, - mokatakana: 0x30E2, - mokatakanahalfwidth: 0xFF93, - molsquare: 0x33D6, - momathai: 0x0E21, - moverssquare: 0x33A7, - moverssquaredsquare: 0x33A8, - mparen: 0x24A8, - mpasquare: 0x33AB, - mssquare: 0x33B3, - msuperior: 0xF6EF, - mturned: 0x026F, - mu: 0x00B5, - mu1: 0x00B5, - muasquare: 0x3382, - muchgreater: 0x226B, - muchless: 0x226A, - mufsquare: 0x338C, - mugreek: 0x03BC, - mugsquare: 0x338D, - muhiragana: 0x3080, - mukatakana: 0x30E0, - mukatakanahalfwidth: 0xFF91, - mulsquare: 0x3395, - multiply: 0x00D7, - mumsquare: 0x339B, - munahhebrew: 0x05A3, - munahlefthebrew: 0x05A3, - musicalnote: 0x266A, - musicalnotedbl: 0x266B, - musicflatsign: 0x266D, - musicsharpsign: 0x266F, - mussquare: 0x33B2, - muvsquare: 0x33B6, - muwsquare: 0x33BC, - mvmegasquare: 0x33B9, - mvsquare: 0x33B7, - mwmegasquare: 0x33BF, - mwsquare: 0x33BD, - n: 0x006E, - nabengali: 0x09A8, - nabla: 0x2207, - nacute: 0x0144, - nadeva: 0x0928, - nagujarati: 0x0AA8, - nagurmukhi: 0x0A28, - nahiragana: 0x306A, - nakatakana: 0x30CA, - nakatakanahalfwidth: 0xFF85, - napostrophe: 0x0149, - nasquare: 0x3381, - nbopomofo: 0x310B, - nbspace: 0x00A0, - ncaron: 0x0148, - ncedilla: 0x0146, - ncircle: 0x24DD, - ncircumflexbelow: 0x1E4B, - ncommaaccent: 0x0146, - ndotaccent: 0x1E45, - ndotbelow: 0x1E47, - nehiragana: 0x306D, - nekatakana: 0x30CD, - nekatakanahalfwidth: 0xFF88, - newsheqelsign: 0x20AA, - nfsquare: 0x338B, - ngabengali: 0x0999, - ngadeva: 0x0919, - ngagujarati: 0x0A99, - ngagurmukhi: 0x0A19, - ngonguthai: 0x0E07, - nhiragana: 0x3093, - nhookleft: 0x0272, - nhookretroflex: 0x0273, - nieunacirclekorean: 0x326F, - nieunaparenkorean: 0x320F, - nieuncieuckorean: 0x3135, - nieuncirclekorean: 0x3261, - nieunhieuhkorean: 0x3136, - nieunkorean: 0x3134, - nieunpansioskorean: 0x3168, - nieunparenkorean: 0x3201, - nieunsioskorean: 0x3167, - nieuntikeutkorean: 0x3166, - nihiragana: 0x306B, - nikatakana: 0x30CB, - nikatakanahalfwidth: 0xFF86, - nikhahitleftthai: 0xF899, - nikhahitthai: 0x0E4D, - nine: 0x0039, - ninearabic: 0x0669, - ninebengali: 0x09EF, - ninecircle: 0x2468, - ninecircleinversesansserif: 0x2792, - ninedeva: 0x096F, - ninegujarati: 0x0AEF, - ninegurmukhi: 0x0A6F, - ninehackarabic: 0x0669, - ninehangzhou: 0x3029, - nineideographicparen: 0x3228, - nineinferior: 0x2089, - ninemonospace: 0xFF19, - nineoldstyle: 0xF739, - nineparen: 0x247C, - nineperiod: 0x2490, - ninepersian: 0x06F9, - nineroman: 0x2178, - ninesuperior: 0x2079, - nineteencircle: 0x2472, - nineteenparen: 0x2486, - nineteenperiod: 0x249A, - ninethai: 0x0E59, - nj: 0x01CC, - njecyrillic: 0x045A, - nkatakana: 0x30F3, - nkatakanahalfwidth: 0xFF9D, - nlegrightlong: 0x019E, - nlinebelow: 0x1E49, - nmonospace: 0xFF4E, - nmsquare: 0x339A, - nnabengali: 0x09A3, - nnadeva: 0x0923, - nnagujarati: 0x0AA3, - nnagurmukhi: 0x0A23, - nnnadeva: 0x0929, - nohiragana: 0x306E, - nokatakana: 0x30CE, - nokatakanahalfwidth: 0xFF89, - nonbreakingspace: 0x00A0, - nonenthai: 0x0E13, - nonuthai: 0x0E19, - noonarabic: 0x0646, - noonfinalarabic: 0xFEE6, - noonghunnaarabic: 0x06BA, - noonghunnafinalarabic: 0xFB9F, - nooninitialarabic: 0xFEE7, - noonjeeminitialarabic: 0xFCD2, - noonjeemisolatedarabic: 0xFC4B, - noonmedialarabic: 0xFEE8, - noonmeeminitialarabic: 0xFCD5, - noonmeemisolatedarabic: 0xFC4E, - noonnoonfinalarabic: 0xFC8D, - notcontains: 0x220C, - notelement: 0x2209, - notelementof: 0x2209, - notequal: 0x2260, - notgreater: 0x226F, - notgreaternorequal: 0x2271, - notgreaternorless: 0x2279, - notidentical: 0x2262, - notless: 0x226E, - notlessnorequal: 0x2270, - notparallel: 0x2226, - notprecedes: 0x2280, - notsubset: 0x2284, - notsucceeds: 0x2281, - notsuperset: 0x2285, - nowarmenian: 0x0576, - nparen: 0x24A9, - nssquare: 0x33B1, - nsuperior: 0x207F, - ntilde: 0x00F1, - nu: 0x03BD, - nuhiragana: 0x306C, - nukatakana: 0x30CC, - nukatakanahalfwidth: 0xFF87, - nuktabengali: 0x09BC, - nuktadeva: 0x093C, - nuktagujarati: 0x0ABC, - nuktagurmukhi: 0x0A3C, - numbersign: 0x0023, - numbersignmonospace: 0xFF03, - numbersignsmall: 0xFE5F, - numeralsigngreek: 0x0374, - numeralsignlowergreek: 0x0375, - numero: 0x2116, - nun: 0x05E0, - nundagesh: 0xFB40, - nundageshhebrew: 0xFB40, - nunhebrew: 0x05E0, - nvsquare: 0x33B5, - nwsquare: 0x33BB, - nyabengali: 0x099E, - nyadeva: 0x091E, - nyagujarati: 0x0A9E, - nyagurmukhi: 0x0A1E, - o: 0x006F, - oacute: 0x00F3, - oangthai: 0x0E2D, - obarred: 0x0275, - obarredcyrillic: 0x04E9, - obarreddieresiscyrillic: 0x04EB, - obengali: 0x0993, - obopomofo: 0x311B, - obreve: 0x014F, - ocandradeva: 0x0911, - ocandragujarati: 0x0A91, - ocandravowelsigndeva: 0x0949, - ocandravowelsigngujarati: 0x0AC9, - ocaron: 0x01D2, - ocircle: 0x24DE, - ocircumflex: 0x00F4, - ocircumflexacute: 0x1ED1, - ocircumflexdotbelow: 0x1ED9, - ocircumflexgrave: 0x1ED3, - ocircumflexhookabove: 0x1ED5, - ocircumflextilde: 0x1ED7, - ocyrillic: 0x043E, - odblacute: 0x0151, - odblgrave: 0x020D, - odeva: 0x0913, - odieresis: 0x00F6, - odieresiscyrillic: 0x04E7, - odotbelow: 0x1ECD, - oe: 0x0153, - oekorean: 0x315A, - ogonek: 0x02DB, - ogonekcmb: 0x0328, - ograve: 0x00F2, - ogujarati: 0x0A93, - oharmenian: 0x0585, - ohiragana: 0x304A, - ohookabove: 0x1ECF, - ohorn: 0x01A1, - ohornacute: 0x1EDB, - ohorndotbelow: 0x1EE3, - ohorngrave: 0x1EDD, - ohornhookabove: 0x1EDF, - ohorntilde: 0x1EE1, - ohungarumlaut: 0x0151, - oi: 0x01A3, - oinvertedbreve: 0x020F, - okatakana: 0x30AA, - okatakanahalfwidth: 0xFF75, - okorean: 0x3157, - olehebrew: 0x05AB, - omacron: 0x014D, - omacronacute: 0x1E53, - omacrongrave: 0x1E51, - omdeva: 0x0950, - omega: 0x03C9, - omega1: 0x03D6, - omegacyrillic: 0x0461, - omegalatinclosed: 0x0277, - omegaroundcyrillic: 0x047B, - omegatitlocyrillic: 0x047D, - omegatonos: 0x03CE, - omgujarati: 0x0AD0, - omicron: 0x03BF, - omicrontonos: 0x03CC, - omonospace: 0xFF4F, - one: 0x0031, - onearabic: 0x0661, - onebengali: 0x09E7, - onecircle: 0x2460, - onecircleinversesansserif: 0x278A, - onedeva: 0x0967, - onedotenleader: 0x2024, - oneeighth: 0x215B, - onefitted: 0xF6DC, - onegujarati: 0x0AE7, - onegurmukhi: 0x0A67, - onehackarabic: 0x0661, - onehalf: 0x00BD, - onehangzhou: 0x3021, - oneideographicparen: 0x3220, - oneinferior: 0x2081, - onemonospace: 0xFF11, - onenumeratorbengali: 0x09F4, - oneoldstyle: 0xF731, - oneparen: 0x2474, - oneperiod: 0x2488, - onepersian: 0x06F1, - onequarter: 0x00BC, - oneroman: 0x2170, - onesuperior: 0x00B9, - onethai: 0x0E51, - onethird: 0x2153, - oogonek: 0x01EB, - oogonekmacron: 0x01ED, - oogurmukhi: 0x0A13, - oomatragurmukhi: 0x0A4B, - oopen: 0x0254, - oparen: 0x24AA, - openbullet: 0x25E6, - option: 0x2325, - ordfeminine: 0x00AA, - ordmasculine: 0x00BA, - orthogonal: 0x221F, - oshortdeva: 0x0912, - oshortvowelsigndeva: 0x094A, - oslash: 0x00F8, - oslashacute: 0x01FF, - osmallhiragana: 0x3049, - osmallkatakana: 0x30A9, - osmallkatakanahalfwidth: 0xFF6B, - ostrokeacute: 0x01FF, - osuperior: 0xF6F0, - otcyrillic: 0x047F, - otilde: 0x00F5, - otildeacute: 0x1E4D, - otildedieresis: 0x1E4F, - oubopomofo: 0x3121, - overline: 0x203E, - overlinecenterline: 0xFE4A, - overlinecmb: 0x0305, - overlinedashed: 0xFE49, - overlinedblwavy: 0xFE4C, - overlinewavy: 0xFE4B, - overscore: 0x00AF, - ovowelsignbengali: 0x09CB, - ovowelsigndeva: 0x094B, - ovowelsigngujarati: 0x0ACB, - p: 0x0070, - paampssquare: 0x3380, - paasentosquare: 0x332B, - pabengali: 0x09AA, - pacute: 0x1E55, - padeva: 0x092A, - pagedown: 0x21DF, - pageup: 0x21DE, - pagujarati: 0x0AAA, - pagurmukhi: 0x0A2A, - pahiragana: 0x3071, - paiyannoithai: 0x0E2F, - pakatakana: 0x30D1, - palatalizationcyrilliccmb: 0x0484, - palochkacyrillic: 0x04C0, - pansioskorean: 0x317F, - paragraph: 0x00B6, - parallel: 0x2225, - parenleft: 0x0028, - parenleftaltonearabic: 0xFD3E, - parenleftbt: 0xF8ED, - parenleftex: 0xF8EC, - parenleftinferior: 0x208D, - parenleftmonospace: 0xFF08, - parenleftsmall: 0xFE59, - parenleftsuperior: 0x207D, - parenlefttp: 0xF8EB, - parenleftvertical: 0xFE35, - parenright: 0x0029, - parenrightaltonearabic: 0xFD3F, - parenrightbt: 0xF8F8, - parenrightex: 0xF8F7, - parenrightinferior: 0x208E, - parenrightmonospace: 0xFF09, - parenrightsmall: 0xFE5A, - parenrightsuperior: 0x207E, - parenrighttp: 0xF8F6, - parenrightvertical: 0xFE36, - partialdiff: 0x2202, - paseqhebrew: 0x05C0, - pashtahebrew: 0x0599, - pasquare: 0x33A9, - patah: 0x05B7, - patah11: 0x05B7, - patah1d: 0x05B7, - patah2a: 0x05B7, - patahhebrew: 0x05B7, - patahnarrowhebrew: 0x05B7, - patahquarterhebrew: 0x05B7, - patahwidehebrew: 0x05B7, - pazerhebrew: 0x05A1, - pbopomofo: 0x3106, - pcircle: 0x24DF, - pdotaccent: 0x1E57, - pe: 0x05E4, - pecyrillic: 0x043F, - pedagesh: 0xFB44, - pedageshhebrew: 0xFB44, - peezisquare: 0x333B, - pefinaldageshhebrew: 0xFB43, - peharabic: 0x067E, - peharmenian: 0x057A, - pehebrew: 0x05E4, - pehfinalarabic: 0xFB57, - pehinitialarabic: 0xFB58, - pehiragana: 0x307A, - pehmedialarabic: 0xFB59, - pekatakana: 0x30DA, - pemiddlehookcyrillic: 0x04A7, - perafehebrew: 0xFB4E, - percent: 0x0025, - percentarabic: 0x066A, - percentmonospace: 0xFF05, - percentsmall: 0xFE6A, - period: 0x002E, - periodarmenian: 0x0589, - periodcentered: 0x00B7, - periodhalfwidth: 0xFF61, - periodinferior: 0xF6E7, - periodmonospace: 0xFF0E, - periodsmall: 0xFE52, - periodsuperior: 0xF6E8, - perispomenigreekcmb: 0x0342, - perpendicular: 0x22A5, - perthousand: 0x2030, - peseta: 0x20A7, - pfsquare: 0x338A, - phabengali: 0x09AB, - phadeva: 0x092B, - phagujarati: 0x0AAB, - phagurmukhi: 0x0A2B, - phi: 0x03C6, - phi1: 0x03D5, - phieuphacirclekorean: 0x327A, - phieuphaparenkorean: 0x321A, - phieuphcirclekorean: 0x326C, - phieuphkorean: 0x314D, - phieuphparenkorean: 0x320C, - philatin: 0x0278, - phinthuthai: 0x0E3A, - phisymbolgreek: 0x03D5, - phook: 0x01A5, - phophanthai: 0x0E1E, - phophungthai: 0x0E1C, - phosamphaothai: 0x0E20, - pi: 0x03C0, - pieupacirclekorean: 0x3273, - pieupaparenkorean: 0x3213, - pieupcieuckorean: 0x3176, - pieupcirclekorean: 0x3265, - pieupkiyeokkorean: 0x3172, - pieupkorean: 0x3142, - pieupparenkorean: 0x3205, - pieupsioskiyeokkorean: 0x3174, - pieupsioskorean: 0x3144, - pieupsiostikeutkorean: 0x3175, - pieupthieuthkorean: 0x3177, - pieuptikeutkorean: 0x3173, - pihiragana: 0x3074, - pikatakana: 0x30D4, - pisymbolgreek: 0x03D6, - piwrarmenian: 0x0583, - plus: 0x002B, - plusbelowcmb: 0x031F, - pluscircle: 0x2295, - plusminus: 0x00B1, - plusmod: 0x02D6, - plusmonospace: 0xFF0B, - plussmall: 0xFE62, - plussuperior: 0x207A, - pmonospace: 0xFF50, - pmsquare: 0x33D8, - pohiragana: 0x307D, - pointingindexdownwhite: 0x261F, - pointingindexleftwhite: 0x261C, - pointingindexrightwhite: 0x261E, - pointingindexupwhite: 0x261D, - pokatakana: 0x30DD, - poplathai: 0x0E1B, - postalmark: 0x3012, - postalmarkface: 0x3020, - pparen: 0x24AB, - precedes: 0x227A, - prescription: 0x211E, - primemod: 0x02B9, - primereversed: 0x2035, - product: 0x220F, - projective: 0x2305, - prolongedkana: 0x30FC, - propellor: 0x2318, - propersubset: 0x2282, - propersuperset: 0x2283, - proportion: 0x2237, - proportional: 0x221D, - psi: 0x03C8, - psicyrillic: 0x0471, - psilipneumatacyrilliccmb: 0x0486, - pssquare: 0x33B0, - puhiragana: 0x3077, - pukatakana: 0x30D7, - pvsquare: 0x33B4, - pwsquare: 0x33BA, - q: 0x0071, - qadeva: 0x0958, - qadmahebrew: 0x05A8, - qafarabic: 0x0642, - qaffinalarabic: 0xFED6, - qafinitialarabic: 0xFED7, - qafmedialarabic: 0xFED8, - qamats: 0x05B8, - qamats10: 0x05B8, - qamats1a: 0x05B8, - qamats1c: 0x05B8, - qamats27: 0x05B8, - qamats29: 0x05B8, - qamats33: 0x05B8, - qamatsde: 0x05B8, - qamatshebrew: 0x05B8, - qamatsnarrowhebrew: 0x05B8, - qamatsqatanhebrew: 0x05B8, - qamatsqatannarrowhebrew: 0x05B8, - qamatsqatanquarterhebrew: 0x05B8, - qamatsqatanwidehebrew: 0x05B8, - qamatsquarterhebrew: 0x05B8, - qamatswidehebrew: 0x05B8, - qarneyparahebrew: 0x059F, - qbopomofo: 0x3111, - qcircle: 0x24E0, - qhook: 0x02A0, - qmonospace: 0xFF51, - qof: 0x05E7, - qofdagesh: 0xFB47, - qofdageshhebrew: 0xFB47, - qofhebrew: 0x05E7, - qparen: 0x24AC, - quarternote: 0x2669, - qubuts: 0x05BB, - qubuts18: 0x05BB, - qubuts25: 0x05BB, - qubuts31: 0x05BB, - qubutshebrew: 0x05BB, - qubutsnarrowhebrew: 0x05BB, - qubutsquarterhebrew: 0x05BB, - qubutswidehebrew: 0x05BB, - question: 0x003F, - questionarabic: 0x061F, - questionarmenian: 0x055E, - questiondown: 0x00BF, - questiondownsmall: 0xF7BF, - questiongreek: 0x037E, - questionmonospace: 0xFF1F, - questionsmall: 0xF73F, - quotedbl: 0x0022, - quotedblbase: 0x201E, - quotedblleft: 0x201C, - quotedblmonospace: 0xFF02, - quotedblprime: 0x301E, - quotedblprimereversed: 0x301D, - quotedblright: 0x201D, - quoteleft: 0x2018, - quoteleftreversed: 0x201B, - quotereversed: 0x201B, - quoteright: 0x2019, - quoterightn: 0x0149, - quotesinglbase: 0x201A, - quotesingle: 0x0027, - quotesinglemonospace: 0xFF07, - r: 0x0072, - raarmenian: 0x057C, - rabengali: 0x09B0, - racute: 0x0155, - radeva: 0x0930, - radical: 0x221A, - radicalex: 0xF8E5, - radoverssquare: 0x33AE, - radoverssquaredsquare: 0x33AF, - radsquare: 0x33AD, - rafe: 0x05BF, - rafehebrew: 0x05BF, - ragujarati: 0x0AB0, - ragurmukhi: 0x0A30, - rahiragana: 0x3089, - rakatakana: 0x30E9, - rakatakanahalfwidth: 0xFF97, - ralowerdiagonalbengali: 0x09F1, - ramiddlediagonalbengali: 0x09F0, - ramshorn: 0x0264, - ratio: 0x2236, - rbopomofo: 0x3116, - rcaron: 0x0159, - rcedilla: 0x0157, - rcircle: 0x24E1, - rcommaaccent: 0x0157, - rdblgrave: 0x0211, - rdotaccent: 0x1E59, - rdotbelow: 0x1E5B, - rdotbelowmacron: 0x1E5D, - referencemark: 0x203B, - reflexsubset: 0x2286, - reflexsuperset: 0x2287, - registered: 0x00AE, - registersans: 0xF8E8, - registerserif: 0xF6DA, - reharabic: 0x0631, - reharmenian: 0x0580, - rehfinalarabic: 0xFEAE, - rehiragana: 0x308C, - rekatakana: 0x30EC, - rekatakanahalfwidth: 0xFF9A, - resh: 0x05E8, - reshdageshhebrew: 0xFB48, - reshhebrew: 0x05E8, - reversedtilde: 0x223D, - reviahebrew: 0x0597, - reviamugrashhebrew: 0x0597, - revlogicalnot: 0x2310, - rfishhook: 0x027E, - rfishhookreversed: 0x027F, - rhabengali: 0x09DD, - rhadeva: 0x095D, - rho: 0x03C1, - rhook: 0x027D, - rhookturned: 0x027B, - rhookturnedsuperior: 0x02B5, - rhosymbolgreek: 0x03F1, - rhotichookmod: 0x02DE, - rieulacirclekorean: 0x3271, - rieulaparenkorean: 0x3211, - rieulcirclekorean: 0x3263, - rieulhieuhkorean: 0x3140, - rieulkiyeokkorean: 0x313A, - rieulkiyeoksioskorean: 0x3169, - rieulkorean: 0x3139, - rieulmieumkorean: 0x313B, - rieulpansioskorean: 0x316C, - rieulparenkorean: 0x3203, - rieulphieuphkorean: 0x313F, - rieulpieupkorean: 0x313C, - rieulpieupsioskorean: 0x316B, - rieulsioskorean: 0x313D, - rieulthieuthkorean: 0x313E, - rieultikeutkorean: 0x316A, - rieulyeorinhieuhkorean: 0x316D, - rightangle: 0x221F, - righttackbelowcmb: 0x0319, - righttriangle: 0x22BF, - rihiragana: 0x308A, - rikatakana: 0x30EA, - rikatakanahalfwidth: 0xFF98, - ring: 0x02DA, - ringbelowcmb: 0x0325, - ringcmb: 0x030A, - ringhalfleft: 0x02BF, - ringhalfleftarmenian: 0x0559, - ringhalfleftbelowcmb: 0x031C, - ringhalfleftcentered: 0x02D3, - ringhalfright: 0x02BE, - ringhalfrightbelowcmb: 0x0339, - ringhalfrightcentered: 0x02D2, - rinvertedbreve: 0x0213, - rittorusquare: 0x3351, - rlinebelow: 0x1E5F, - rlongleg: 0x027C, - rlonglegturned: 0x027A, - rmonospace: 0xFF52, - rohiragana: 0x308D, - rokatakana: 0x30ED, - rokatakanahalfwidth: 0xFF9B, - roruathai: 0x0E23, - rparen: 0x24AD, - rrabengali: 0x09DC, - rradeva: 0x0931, - rragurmukhi: 0x0A5C, - rreharabic: 0x0691, - rrehfinalarabic: 0xFB8D, - rrvocalicbengali: 0x09E0, - rrvocalicdeva: 0x0960, - rrvocalicgujarati: 0x0AE0, - rrvocalicvowelsignbengali: 0x09C4, - rrvocalicvowelsigndeva: 0x0944, - rrvocalicvowelsigngujarati: 0x0AC4, - rsuperior: 0xF6F1, - rtblock: 0x2590, - rturned: 0x0279, - rturnedsuperior: 0x02B4, - ruhiragana: 0x308B, - rukatakana: 0x30EB, - rukatakanahalfwidth: 0xFF99, - rupeemarkbengali: 0x09F2, - rupeesignbengali: 0x09F3, - rupiah: 0xF6DD, - ruthai: 0x0E24, - rvocalicbengali: 0x098B, - rvocalicdeva: 0x090B, - rvocalicgujarati: 0x0A8B, - rvocalicvowelsignbengali: 0x09C3, - rvocalicvowelsigndeva: 0x0943, - rvocalicvowelsigngujarati: 0x0AC3, - s: 0x0073, - sabengali: 0x09B8, - sacute: 0x015B, - sacutedotaccent: 0x1E65, - sadarabic: 0x0635, - sadeva: 0x0938, - sadfinalarabic: 0xFEBA, - sadinitialarabic: 0xFEBB, - sadmedialarabic: 0xFEBC, - sagujarati: 0x0AB8, - sagurmukhi: 0x0A38, - sahiragana: 0x3055, - sakatakana: 0x30B5, - sakatakanahalfwidth: 0xFF7B, - sallallahoualayhewasallamarabic: 0xFDFA, - samekh: 0x05E1, - samekhdagesh: 0xFB41, - samekhdageshhebrew: 0xFB41, - samekhhebrew: 0x05E1, - saraaathai: 0x0E32, - saraaethai: 0x0E41, - saraaimaimalaithai: 0x0E44, - saraaimaimuanthai: 0x0E43, - saraamthai: 0x0E33, - saraathai: 0x0E30, - saraethai: 0x0E40, - saraiileftthai: 0xF886, - saraiithai: 0x0E35, - saraileftthai: 0xF885, - saraithai: 0x0E34, - saraothai: 0x0E42, - saraueeleftthai: 0xF888, - saraueethai: 0x0E37, - saraueleftthai: 0xF887, - sarauethai: 0x0E36, - sarauthai: 0x0E38, - sarauuthai: 0x0E39, - sbopomofo: 0x3119, - scaron: 0x0161, - scarondotaccent: 0x1E67, - scedilla: 0x015F, - schwa: 0x0259, - schwacyrillic: 0x04D9, - schwadieresiscyrillic: 0x04DB, - schwahook: 0x025A, - scircle: 0x24E2, - scircumflex: 0x015D, - scommaaccent: 0x0219, - sdotaccent: 0x1E61, - sdotbelow: 0x1E63, - sdotbelowdotaccent: 0x1E69, - seagullbelowcmb: 0x033C, - second: 0x2033, - secondtonechinese: 0x02CA, - section: 0x00A7, - seenarabic: 0x0633, - seenfinalarabic: 0xFEB2, - seeninitialarabic: 0xFEB3, - seenmedialarabic: 0xFEB4, - segol: 0x05B6, - segol13: 0x05B6, - segol1f: 0x05B6, - segol2c: 0x05B6, - segolhebrew: 0x05B6, - segolnarrowhebrew: 0x05B6, - segolquarterhebrew: 0x05B6, - segoltahebrew: 0x0592, - segolwidehebrew: 0x05B6, - seharmenian: 0x057D, - sehiragana: 0x305B, - sekatakana: 0x30BB, - sekatakanahalfwidth: 0xFF7E, - semicolon: 0x003B, - semicolonarabic: 0x061B, - semicolonmonospace: 0xFF1B, - semicolonsmall: 0xFE54, - semivoicedmarkkana: 0x309C, - semivoicedmarkkanahalfwidth: 0xFF9F, - sentisquare: 0x3322, - sentosquare: 0x3323, - seven: 0x0037, - sevenarabic: 0x0667, - sevenbengali: 0x09ED, - sevencircle: 0x2466, - sevencircleinversesansserif: 0x2790, - sevendeva: 0x096D, - seveneighths: 0x215E, - sevengujarati: 0x0AED, - sevengurmukhi: 0x0A6D, - sevenhackarabic: 0x0667, - sevenhangzhou: 0x3027, - sevenideographicparen: 0x3226, - seveninferior: 0x2087, - sevenmonospace: 0xFF17, - sevenoldstyle: 0xF737, - sevenparen: 0x247A, - sevenperiod: 0x248E, - sevenpersian: 0x06F7, - sevenroman: 0x2176, - sevensuperior: 0x2077, - seventeencircle: 0x2470, - seventeenparen: 0x2484, - seventeenperiod: 0x2498, - seventhai: 0x0E57, - sfthyphen: 0x00AD, - shaarmenian: 0x0577, - shabengali: 0x09B6, - shacyrillic: 0x0448, - shaddaarabic: 0x0651, - shaddadammaarabic: 0xFC61, - shaddadammatanarabic: 0xFC5E, - shaddafathaarabic: 0xFC60, - shaddakasraarabic: 0xFC62, - shaddakasratanarabic: 0xFC5F, - shade: 0x2592, - shadedark: 0x2593, - shadelight: 0x2591, - shademedium: 0x2592, - shadeva: 0x0936, - shagujarati: 0x0AB6, - shagurmukhi: 0x0A36, - shalshelethebrew: 0x0593, - shbopomofo: 0x3115, - shchacyrillic: 0x0449, - sheenarabic: 0x0634, - sheenfinalarabic: 0xFEB6, - sheeninitialarabic: 0xFEB7, - sheenmedialarabic: 0xFEB8, - sheicoptic: 0x03E3, - sheqel: 0x20AA, - sheqelhebrew: 0x20AA, - sheva: 0x05B0, - sheva115: 0x05B0, - sheva15: 0x05B0, - sheva22: 0x05B0, - sheva2e: 0x05B0, - shevahebrew: 0x05B0, - shevanarrowhebrew: 0x05B0, - shevaquarterhebrew: 0x05B0, - shevawidehebrew: 0x05B0, - shhacyrillic: 0x04BB, - shimacoptic: 0x03ED, - shin: 0x05E9, - shindagesh: 0xFB49, - shindageshhebrew: 0xFB49, - shindageshshindot: 0xFB2C, - shindageshshindothebrew: 0xFB2C, - shindageshsindot: 0xFB2D, - shindageshsindothebrew: 0xFB2D, - shindothebrew: 0x05C1, - shinhebrew: 0x05E9, - shinshindot: 0xFB2A, - shinshindothebrew: 0xFB2A, - shinsindot: 0xFB2B, - shinsindothebrew: 0xFB2B, - shook: 0x0282, - sigma: 0x03C3, - sigma1: 0x03C2, - sigmafinal: 0x03C2, - sigmalunatesymbolgreek: 0x03F2, - sihiragana: 0x3057, - sikatakana: 0x30B7, - sikatakanahalfwidth: 0xFF7C, - siluqhebrew: 0x05BD, - siluqlefthebrew: 0x05BD, - similar: 0x223C, - sindothebrew: 0x05C2, - siosacirclekorean: 0x3274, - siosaparenkorean: 0x3214, - sioscieuckorean: 0x317E, - sioscirclekorean: 0x3266, - sioskiyeokkorean: 0x317A, - sioskorean: 0x3145, - siosnieunkorean: 0x317B, - siosparenkorean: 0x3206, - siospieupkorean: 0x317D, - siostikeutkorean: 0x317C, - six: 0x0036, - sixarabic: 0x0666, - sixbengali: 0x09EC, - sixcircle: 0x2465, - sixcircleinversesansserif: 0x278F, - sixdeva: 0x096C, - sixgujarati: 0x0AEC, - sixgurmukhi: 0x0A6C, - sixhackarabic: 0x0666, - sixhangzhou: 0x3026, - sixideographicparen: 0x3225, - sixinferior: 0x2086, - sixmonospace: 0xFF16, - sixoldstyle: 0xF736, - sixparen: 0x2479, - sixperiod: 0x248D, - sixpersian: 0x06F6, - sixroman: 0x2175, - sixsuperior: 0x2076, - sixteencircle: 0x246F, - sixteencurrencydenominatorbengali: 0x09F9, - sixteenparen: 0x2483, - sixteenperiod: 0x2497, - sixthai: 0x0E56, - slash: 0x002F, - slashmonospace: 0xFF0F, - slong: 0x017F, - slongdotaccent: 0x1E9B, - smileface: 0x263A, - smonospace: 0xFF53, - sofpasuqhebrew: 0x05C3, - softhyphen: 0x00AD, - softsigncyrillic: 0x044C, - sohiragana: 0x305D, - sokatakana: 0x30BD, - sokatakanahalfwidth: 0xFF7F, - soliduslongoverlaycmb: 0x0338, - solidusshortoverlaycmb: 0x0337, - sorusithai: 0x0E29, - sosalathai: 0x0E28, - sosothai: 0x0E0B, - sosuathai: 0x0E2A, - space: 0x0020, - spacehackarabic: 0x0020, - spade: 0x2660, - spadesuitblack: 0x2660, - spadesuitwhite: 0x2664, - sparen: 0x24AE, - squarebelowcmb: 0x033B, - squarecc: 0x33C4, - squarecm: 0x339D, - squarediagonalcrosshatchfill: 0x25A9, - squarehorizontalfill: 0x25A4, - squarekg: 0x338F, - squarekm: 0x339E, - squarekmcapital: 0x33CE, - squareln: 0x33D1, - squarelog: 0x33D2, - squaremg: 0x338E, - squaremil: 0x33D5, - squaremm: 0x339C, - squaremsquared: 0x33A1, - squareorthogonalcrosshatchfill: 0x25A6, - squareupperlefttolowerrightfill: 0x25A7, - squareupperrighttolowerleftfill: 0x25A8, - squareverticalfill: 0x25A5, - squarewhitewithsmallblack: 0x25A3, - srsquare: 0x33DB, - ssabengali: 0x09B7, - ssadeva: 0x0937, - ssagujarati: 0x0AB7, - ssangcieuckorean: 0x3149, - ssanghieuhkorean: 0x3185, - ssangieungkorean: 0x3180, - ssangkiyeokkorean: 0x3132, - ssangnieunkorean: 0x3165, - ssangpieupkorean: 0x3143, - ssangsioskorean: 0x3146, - ssangtikeutkorean: 0x3138, - ssuperior: 0xF6F2, - sterling: 0x00A3, - sterlingmonospace: 0xFFE1, - strokelongoverlaycmb: 0x0336, - strokeshortoverlaycmb: 0x0335, - subset: 0x2282, - subsetnotequal: 0x228A, - subsetorequal: 0x2286, - succeeds: 0x227B, - suchthat: 0x220B, - suhiragana: 0x3059, - sukatakana: 0x30B9, - sukatakanahalfwidth: 0xFF7D, - sukunarabic: 0x0652, - summation: 0x2211, - sun: 0x263C, - superset: 0x2283, - supersetnotequal: 0x228B, - supersetorequal: 0x2287, - svsquare: 0x33DC, - syouwaerasquare: 0x337C, - t: 0x0074, - tabengali: 0x09A4, - tackdown: 0x22A4, - tackleft: 0x22A3, - tadeva: 0x0924, - tagujarati: 0x0AA4, - tagurmukhi: 0x0A24, - taharabic: 0x0637, - tahfinalarabic: 0xFEC2, - tahinitialarabic: 0xFEC3, - tahiragana: 0x305F, - tahmedialarabic: 0xFEC4, - taisyouerasquare: 0x337D, - takatakana: 0x30BF, - takatakanahalfwidth: 0xFF80, - tatweelarabic: 0x0640, - tau: 0x03C4, - tav: 0x05EA, - tavdages: 0xFB4A, - tavdagesh: 0xFB4A, - tavdageshhebrew: 0xFB4A, - tavhebrew: 0x05EA, - tbar: 0x0167, - tbopomofo: 0x310A, - tcaron: 0x0165, - tccurl: 0x02A8, - tcedilla: 0x0163, - tcheharabic: 0x0686, - tchehfinalarabic: 0xFB7B, - tchehinitialarabic: 0xFB7C, - tchehmedialarabic: 0xFB7D, - tcircle: 0x24E3, - tcircumflexbelow: 0x1E71, - tcommaaccent: 0x0163, - tdieresis: 0x1E97, - tdotaccent: 0x1E6B, - tdotbelow: 0x1E6D, - tecyrillic: 0x0442, - tedescendercyrillic: 0x04AD, - teharabic: 0x062A, - tehfinalarabic: 0xFE96, - tehhahinitialarabic: 0xFCA2, - tehhahisolatedarabic: 0xFC0C, - tehinitialarabic: 0xFE97, - tehiragana: 0x3066, - tehjeeminitialarabic: 0xFCA1, - tehjeemisolatedarabic: 0xFC0B, - tehmarbutaarabic: 0x0629, - tehmarbutafinalarabic: 0xFE94, - tehmedialarabic: 0xFE98, - tehmeeminitialarabic: 0xFCA4, - tehmeemisolatedarabic: 0xFC0E, - tehnoonfinalarabic: 0xFC73, - tekatakana: 0x30C6, - tekatakanahalfwidth: 0xFF83, - telephone: 0x2121, - telephoneblack: 0x260E, - telishagedolahebrew: 0x05A0, - telishaqetanahebrew: 0x05A9, - tencircle: 0x2469, - tenideographicparen: 0x3229, - tenparen: 0x247D, - tenperiod: 0x2491, - tenroman: 0x2179, - tesh: 0x02A7, - tet: 0x05D8, - tetdagesh: 0xFB38, - tetdageshhebrew: 0xFB38, - tethebrew: 0x05D8, - tetsecyrillic: 0x04B5, - tevirhebrew: 0x059B, - tevirlefthebrew: 0x059B, - thabengali: 0x09A5, - thadeva: 0x0925, - thagujarati: 0x0AA5, - thagurmukhi: 0x0A25, - thalarabic: 0x0630, - thalfinalarabic: 0xFEAC, - thanthakhatlowleftthai: 0xF898, - thanthakhatlowrightthai: 0xF897, - thanthakhatthai: 0x0E4C, - thanthakhatupperleftthai: 0xF896, - theharabic: 0x062B, - thehfinalarabic: 0xFE9A, - thehinitialarabic: 0xFE9B, - thehmedialarabic: 0xFE9C, - thereexists: 0x2203, - therefore: 0x2234, - theta: 0x03B8, - theta1: 0x03D1, - thetasymbolgreek: 0x03D1, - thieuthacirclekorean: 0x3279, - thieuthaparenkorean: 0x3219, - thieuthcirclekorean: 0x326B, - thieuthkorean: 0x314C, - thieuthparenkorean: 0x320B, - thirteencircle: 0x246C, - thirteenparen: 0x2480, - thirteenperiod: 0x2494, - thonangmonthothai: 0x0E11, - thook: 0x01AD, - thophuthaothai: 0x0E12, - thorn: 0x00FE, - thothahanthai: 0x0E17, - thothanthai: 0x0E10, - thothongthai: 0x0E18, - thothungthai: 0x0E16, - thousandcyrillic: 0x0482, - thousandsseparatorarabic: 0x066C, - thousandsseparatorpersian: 0x066C, - three: 0x0033, - threearabic: 0x0663, - threebengali: 0x09E9, - threecircle: 0x2462, - threecircleinversesansserif: 0x278C, - threedeva: 0x0969, - threeeighths: 0x215C, - threegujarati: 0x0AE9, - threegurmukhi: 0x0A69, - threehackarabic: 0x0663, - threehangzhou: 0x3023, - threeideographicparen: 0x3222, - threeinferior: 0x2083, - threemonospace: 0xFF13, - threenumeratorbengali: 0x09F6, - threeoldstyle: 0xF733, - threeparen: 0x2476, - threeperiod: 0x248A, - threepersian: 0x06F3, - threequarters: 0x00BE, - threequartersemdash: 0xF6DE, - threeroman: 0x2172, - threesuperior: 0x00B3, - threethai: 0x0E53, - thzsquare: 0x3394, - tihiragana: 0x3061, - tikatakana: 0x30C1, - tikatakanahalfwidth: 0xFF81, - tikeutacirclekorean: 0x3270, - tikeutaparenkorean: 0x3210, - tikeutcirclekorean: 0x3262, - tikeutkorean: 0x3137, - tikeutparenkorean: 0x3202, - tilde: 0x02DC, - tildebelowcmb: 0x0330, - tildecmb: 0x0303, - tildecomb: 0x0303, - tildedoublecmb: 0x0360, - tildeoperator: 0x223C, - tildeoverlaycmb: 0x0334, - tildeverticalcmb: 0x033E, - timescircle: 0x2297, - tipehahebrew: 0x0596, - tipehalefthebrew: 0x0596, - tippigurmukhi: 0x0A70, - titlocyrilliccmb: 0x0483, - tiwnarmenian: 0x057F, - tlinebelow: 0x1E6F, - tmonospace: 0xFF54, - toarmenian: 0x0569, - tohiragana: 0x3068, - tokatakana: 0x30C8, - tokatakanahalfwidth: 0xFF84, - tonebarextrahighmod: 0x02E5, - tonebarextralowmod: 0x02E9, - tonebarhighmod: 0x02E6, - tonebarlowmod: 0x02E8, - tonebarmidmod: 0x02E7, - tonefive: 0x01BD, - tonesix: 0x0185, - tonetwo: 0x01A8, - tonos: 0x0384, - tonsquare: 0x3327, - topatakthai: 0x0E0F, - tortoiseshellbracketleft: 0x3014, - tortoiseshellbracketleftsmall: 0xFE5D, - tortoiseshellbracketleftvertical: 0xFE39, - tortoiseshellbracketright: 0x3015, - tortoiseshellbracketrightsmall: 0xFE5E, - tortoiseshellbracketrightvertical: 0xFE3A, - totaothai: 0x0E15, - tpalatalhook: 0x01AB, - tparen: 0x24AF, - trademark: 0x2122, - trademarksans: 0xF8EA, - trademarkserif: 0xF6DB, - tretroflexhook: 0x0288, - triagdn: 0x25BC, - triaglf: 0x25C4, - triagrt: 0x25BA, - triagup: 0x25B2, - ts: 0x02A6, - tsadi: 0x05E6, - tsadidagesh: 0xFB46, - tsadidageshhebrew: 0xFB46, - tsadihebrew: 0x05E6, - tsecyrillic: 0x0446, - tsere: 0x05B5, - tsere12: 0x05B5, - tsere1e: 0x05B5, - tsere2b: 0x05B5, - tserehebrew: 0x05B5, - tserenarrowhebrew: 0x05B5, - tserequarterhebrew: 0x05B5, - tserewidehebrew: 0x05B5, - tshecyrillic: 0x045B, - tsuperior: 0xF6F3, - ttabengali: 0x099F, - ttadeva: 0x091F, - ttagujarati: 0x0A9F, - ttagurmukhi: 0x0A1F, - tteharabic: 0x0679, - ttehfinalarabic: 0xFB67, - ttehinitialarabic: 0xFB68, - ttehmedialarabic: 0xFB69, - tthabengali: 0x09A0, - tthadeva: 0x0920, - tthagujarati: 0x0AA0, - tthagurmukhi: 0x0A20, - tturned: 0x0287, - tuhiragana: 0x3064, - tukatakana: 0x30C4, - tukatakanahalfwidth: 0xFF82, - tusmallhiragana: 0x3063, - tusmallkatakana: 0x30C3, - tusmallkatakanahalfwidth: 0xFF6F, - twelvecircle: 0x246B, - twelveparen: 0x247F, - twelveperiod: 0x2493, - twelveroman: 0x217B, - twentycircle: 0x2473, - twentyhangzhou: 0x5344, - twentyparen: 0x2487, - twentyperiod: 0x249B, - two: 0x0032, - twoarabic: 0x0662, - twobengali: 0x09E8, - twocircle: 0x2461, - twocircleinversesansserif: 0x278B, - twodeva: 0x0968, - twodotenleader: 0x2025, - twodotleader: 0x2025, - twodotleadervertical: 0xFE30, - twogujarati: 0x0AE8, - twogurmukhi: 0x0A68, - twohackarabic: 0x0662, - twohangzhou: 0x3022, - twoideographicparen: 0x3221, - twoinferior: 0x2082, - twomonospace: 0xFF12, - twonumeratorbengali: 0x09F5, - twooldstyle: 0xF732, - twoparen: 0x2475, - twoperiod: 0x2489, - twopersian: 0x06F2, - tworoman: 0x2171, - twostroke: 0x01BB, - twosuperior: 0x00B2, - twothai: 0x0E52, - twothirds: 0x2154, - u: 0x0075, - uacute: 0x00FA, - ubar: 0x0289, - ubengali: 0x0989, - ubopomofo: 0x3128, - ubreve: 0x016D, - ucaron: 0x01D4, - ucircle: 0x24E4, - ucircumflex: 0x00FB, - ucircumflexbelow: 0x1E77, - ucyrillic: 0x0443, - udattadeva: 0x0951, - udblacute: 0x0171, - udblgrave: 0x0215, - udeva: 0x0909, - udieresis: 0x00FC, - udieresisacute: 0x01D8, - udieresisbelow: 0x1E73, - udieresiscaron: 0x01DA, - udieresiscyrillic: 0x04F1, - udieresisgrave: 0x01DC, - udieresismacron: 0x01D6, - udotbelow: 0x1EE5, - ugrave: 0x00F9, - ugujarati: 0x0A89, - ugurmukhi: 0x0A09, - uhiragana: 0x3046, - uhookabove: 0x1EE7, - uhorn: 0x01B0, - uhornacute: 0x1EE9, - uhorndotbelow: 0x1EF1, - uhorngrave: 0x1EEB, - uhornhookabove: 0x1EED, - uhorntilde: 0x1EEF, - uhungarumlaut: 0x0171, - uhungarumlautcyrillic: 0x04F3, - uinvertedbreve: 0x0217, - ukatakana: 0x30A6, - ukatakanahalfwidth: 0xFF73, - ukcyrillic: 0x0479, - ukorean: 0x315C, - umacron: 0x016B, - umacroncyrillic: 0x04EF, - umacrondieresis: 0x1E7B, - umatragurmukhi: 0x0A41, - umonospace: 0xFF55, - underscore: 0x005F, - underscoredbl: 0x2017, - underscoremonospace: 0xFF3F, - underscorevertical: 0xFE33, - underscorewavy: 0xFE4F, - union: 0x222A, - universal: 0x2200, - uogonek: 0x0173, - uparen: 0x24B0, - upblock: 0x2580, - upperdothebrew: 0x05C4, - upsilon: 0x03C5, - upsilondieresis: 0x03CB, - upsilondieresistonos: 0x03B0, - upsilonlatin: 0x028A, - upsilontonos: 0x03CD, - uptackbelowcmb: 0x031D, - uptackmod: 0x02D4, - uragurmukhi: 0x0A73, - uring: 0x016F, - ushortcyrillic: 0x045E, - usmallhiragana: 0x3045, - usmallkatakana: 0x30A5, - usmallkatakanahalfwidth: 0xFF69, - ustraightcyrillic: 0x04AF, - ustraightstrokecyrillic: 0x04B1, - utilde: 0x0169, - utildeacute: 0x1E79, - utildebelow: 0x1E75, - uubengali: 0x098A, - uudeva: 0x090A, - uugujarati: 0x0A8A, - uugurmukhi: 0x0A0A, - uumatragurmukhi: 0x0A42, - uuvowelsignbengali: 0x09C2, - uuvowelsigndeva: 0x0942, - uuvowelsigngujarati: 0x0AC2, - uvowelsignbengali: 0x09C1, - uvowelsigndeva: 0x0941, - uvowelsigngujarati: 0x0AC1, - v: 0x0076, - vadeva: 0x0935, - vagujarati: 0x0AB5, - vagurmukhi: 0x0A35, - vakatakana: 0x30F7, - vav: 0x05D5, - vavdagesh: 0xFB35, - vavdagesh65: 0xFB35, - vavdageshhebrew: 0xFB35, - vavhebrew: 0x05D5, - vavholam: 0xFB4B, - vavholamhebrew: 0xFB4B, - vavvavhebrew: 0x05F0, - vavyodhebrew: 0x05F1, - vcircle: 0x24E5, - vdotbelow: 0x1E7F, - vecyrillic: 0x0432, - veharabic: 0x06A4, - vehfinalarabic: 0xFB6B, - vehinitialarabic: 0xFB6C, - vehmedialarabic: 0xFB6D, - vekatakana: 0x30F9, - venus: 0x2640, - verticalbar: 0x007C, - verticallineabovecmb: 0x030D, - verticallinebelowcmb: 0x0329, - verticallinelowmod: 0x02CC, - verticallinemod: 0x02C8, - vewarmenian: 0x057E, - vhook: 0x028B, - vikatakana: 0x30F8, - viramabengali: 0x09CD, - viramadeva: 0x094D, - viramagujarati: 0x0ACD, - visargabengali: 0x0983, - visargadeva: 0x0903, - visargagujarati: 0x0A83, - vmonospace: 0xFF56, - voarmenian: 0x0578, - voicediterationhiragana: 0x309E, - voicediterationkatakana: 0x30FE, - voicedmarkkana: 0x309B, - voicedmarkkanahalfwidth: 0xFF9E, - vokatakana: 0x30FA, - vparen: 0x24B1, - vtilde: 0x1E7D, - vturned: 0x028C, - vuhiragana: 0x3094, - vukatakana: 0x30F4, - w: 0x0077, - wacute: 0x1E83, - waekorean: 0x3159, - wahiragana: 0x308F, - wakatakana: 0x30EF, - wakatakanahalfwidth: 0xFF9C, - wakorean: 0x3158, - wasmallhiragana: 0x308E, - wasmallkatakana: 0x30EE, - wattosquare: 0x3357, - wavedash: 0x301C, - wavyunderscorevertical: 0xFE34, - wawarabic: 0x0648, - wawfinalarabic: 0xFEEE, - wawhamzaabovearabic: 0x0624, - wawhamzaabovefinalarabic: 0xFE86, - wbsquare: 0x33DD, - wcircle: 0x24E6, - wcircumflex: 0x0175, - wdieresis: 0x1E85, - wdotaccent: 0x1E87, - wdotbelow: 0x1E89, - wehiragana: 0x3091, - weierstrass: 0x2118, - wekatakana: 0x30F1, - wekorean: 0x315E, - weokorean: 0x315D, - wgrave: 0x1E81, - whitebullet: 0x25E6, - whitecircle: 0x25CB, - whitecircleinverse: 0x25D9, - whitecornerbracketleft: 0x300E, - whitecornerbracketleftvertical: 0xFE43, - whitecornerbracketright: 0x300F, - whitecornerbracketrightvertical: 0xFE44, - whitediamond: 0x25C7, - whitediamondcontainingblacksmalldiamond: 0x25C8, - whitedownpointingsmalltriangle: 0x25BF, - whitedownpointingtriangle: 0x25BD, - whiteleftpointingsmalltriangle: 0x25C3, - whiteleftpointingtriangle: 0x25C1, - whitelenticularbracketleft: 0x3016, - whitelenticularbracketright: 0x3017, - whiterightpointingsmalltriangle: 0x25B9, - whiterightpointingtriangle: 0x25B7, - whitesmallsquare: 0x25AB, - whitesmilingface: 0x263A, - whitesquare: 0x25A1, - whitestar: 0x2606, - whitetelephone: 0x260F, - whitetortoiseshellbracketleft: 0x3018, - whitetortoiseshellbracketright: 0x3019, - whiteuppointingsmalltriangle: 0x25B5, - whiteuppointingtriangle: 0x25B3, - wihiragana: 0x3090, - wikatakana: 0x30F0, - wikorean: 0x315F, - wmonospace: 0xFF57, - wohiragana: 0x3092, - wokatakana: 0x30F2, - wokatakanahalfwidth: 0xFF66, - won: 0x20A9, - wonmonospace: 0xFFE6, - wowaenthai: 0x0E27, - wparen: 0x24B2, - wring: 0x1E98, - wsuperior: 0x02B7, - wturned: 0x028D, - wynn: 0x01BF, - x: 0x0078, - xabovecmb: 0x033D, - xbopomofo: 0x3112, - xcircle: 0x24E7, - xdieresis: 0x1E8D, - xdotaccent: 0x1E8B, - xeharmenian: 0x056D, - xi: 0x03BE, - xmonospace: 0xFF58, - xparen: 0x24B3, - xsuperior: 0x02E3, - y: 0x0079, - yaadosquare: 0x334E, - yabengali: 0x09AF, - yacute: 0x00FD, - yadeva: 0x092F, - yaekorean: 0x3152, - yagujarati: 0x0AAF, - yagurmukhi: 0x0A2F, - yahiragana: 0x3084, - yakatakana: 0x30E4, - yakatakanahalfwidth: 0xFF94, - yakorean: 0x3151, - yamakkanthai: 0x0E4E, - yasmallhiragana: 0x3083, - yasmallkatakana: 0x30E3, - yasmallkatakanahalfwidth: 0xFF6C, - yatcyrillic: 0x0463, - ycircle: 0x24E8, - ycircumflex: 0x0177, - ydieresis: 0x00FF, - ydotaccent: 0x1E8F, - ydotbelow: 0x1EF5, - yeharabic: 0x064A, - yehbarreearabic: 0x06D2, - yehbarreefinalarabic: 0xFBAF, - yehfinalarabic: 0xFEF2, - yehhamzaabovearabic: 0x0626, - yehhamzaabovefinalarabic: 0xFE8A, - yehhamzaaboveinitialarabic: 0xFE8B, - yehhamzaabovemedialarabic: 0xFE8C, - yehinitialarabic: 0xFEF3, - yehmedialarabic: 0xFEF4, - yehmeeminitialarabic: 0xFCDD, - yehmeemisolatedarabic: 0xFC58, - yehnoonfinalarabic: 0xFC94, - yehthreedotsbelowarabic: 0x06D1, - yekorean: 0x3156, - yen: 0x00A5, - yenmonospace: 0xFFE5, - yeokorean: 0x3155, - yeorinhieuhkorean: 0x3186, - yerahbenyomohebrew: 0x05AA, - yerahbenyomolefthebrew: 0x05AA, - yericyrillic: 0x044B, - yerudieresiscyrillic: 0x04F9, - yesieungkorean: 0x3181, - yesieungpansioskorean: 0x3183, - yesieungsioskorean: 0x3182, - yetivhebrew: 0x059A, - ygrave: 0x1EF3, - yhook: 0x01B4, - yhookabove: 0x1EF7, - yiarmenian: 0x0575, - yicyrillic: 0x0457, - yikorean: 0x3162, - yinyang: 0x262F, - yiwnarmenian: 0x0582, - ymonospace: 0xFF59, - yod: 0x05D9, - yoddagesh: 0xFB39, - yoddageshhebrew: 0xFB39, - yodhebrew: 0x05D9, - yodyodhebrew: 0x05F2, - yodyodpatahhebrew: 0xFB1F, - yohiragana: 0x3088, - yoikorean: 0x3189, - yokatakana: 0x30E8, - yokatakanahalfwidth: 0xFF96, - yokorean: 0x315B, - yosmallhiragana: 0x3087, - yosmallkatakana: 0x30E7, - yosmallkatakanahalfwidth: 0xFF6E, - yotgreek: 0x03F3, - yoyaekorean: 0x3188, - yoyakorean: 0x3187, - yoyakthai: 0x0E22, - yoyingthai: 0x0E0D, - yparen: 0x24B4, - ypogegrammeni: 0x037A, - ypogegrammenigreekcmb: 0x0345, - yr: 0x01A6, - yring: 0x1E99, - ysuperior: 0x02B8, - ytilde: 0x1EF9, - yturned: 0x028E, - yuhiragana: 0x3086, - yuikorean: 0x318C, - yukatakana: 0x30E6, - yukatakanahalfwidth: 0xFF95, - yukorean: 0x3160, - yusbigcyrillic: 0x046B, - yusbigiotifiedcyrillic: 0x046D, - yuslittlecyrillic: 0x0467, - yuslittleiotifiedcyrillic: 0x0469, - yusmallhiragana: 0x3085, - yusmallkatakana: 0x30E5, - yusmallkatakanahalfwidth: 0xFF6D, - yuyekorean: 0x318B, - yuyeokorean: 0x318A, - yyabengali: 0x09DF, - yyadeva: 0x095F, - z: 0x007A, - zaarmenian: 0x0566, - zacute: 0x017A, - zadeva: 0x095B, - zagurmukhi: 0x0A5B, - zaharabic: 0x0638, - zahfinalarabic: 0xFEC6, - zahinitialarabic: 0xFEC7, - zahiragana: 0x3056, - zahmedialarabic: 0xFEC8, - zainarabic: 0x0632, - zainfinalarabic: 0xFEB0, - zakatakana: 0x30B6, - zaqefgadolhebrew: 0x0595, - zaqefqatanhebrew: 0x0594, - zarqahebrew: 0x0598, - zayin: 0x05D6, - zayindagesh: 0xFB36, - zayindageshhebrew: 0xFB36, - zayinhebrew: 0x05D6, - zbopomofo: 0x3117, - zcaron: 0x017E, - zcircle: 0x24E9, - zcircumflex: 0x1E91, - zcurl: 0x0291, - zdot: 0x017C, - zdotaccent: 0x017C, - zdotbelow: 0x1E93, - zecyrillic: 0x0437, - zedescendercyrillic: 0x0499, - zedieresiscyrillic: 0x04DF, - zehiragana: 0x305C, - zekatakana: 0x30BC, - zero: 0x0030, - zeroarabic: 0x0660, - zerobengali: 0x09E6, - zerodeva: 0x0966, - zerogujarati: 0x0AE6, - zerogurmukhi: 0x0A66, - zerohackarabic: 0x0660, - zeroinferior: 0x2080, - zeromonospace: 0xFF10, - zerooldstyle: 0xF730, - zeropersian: 0x06F0, - zerosuperior: 0x2070, - zerothai: 0x0E50, - zerowidthjoiner: 0xFEFF, - zerowidthnonjoiner: 0x200C, - zerowidthspace: 0x200B, - zeta: 0x03B6, - zhbopomofo: 0x3113, - zhearmenian: 0x056A, - zhebrevecyrillic: 0x04C2, - zhecyrillic: 0x0436, - zhedescendercyrillic: 0x0497, - zhedieresiscyrillic: 0x04DD, - zihiragana: 0x3058, - zikatakana: 0x30B8, - zinorhebrew: 0x05AE, - zlinebelow: 0x1E95, - zmonospace: 0xFF5A, - zohiragana: 0x305E, - zokatakana: 0x30BE, - zparen: 0x24B5, - zretroflexhook: 0x0290, - zstroke: 0x01B6, - zuhiragana: 0x305A, - zukatakana: 0x30BA, - '.notdef': 0x0000 -}; - -var DingbatsGlyphsUnicode = { - space: 0x0020, - a1: 0x2701, - a2: 0x2702, - a202: 0x2703, - a3: 0x2704, - a4: 0x260E, - a5: 0x2706, - a119: 0x2707, - a118: 0x2708, - a117: 0x2709, - a11: 0x261B, - a12: 0x261E, - a13: 0x270C, - a14: 0x270D, - a15: 0x270E, - a16: 0x270F, - a105: 0x2710, - a17: 0x2711, - a18: 0x2712, - a19: 0x2713, - a20: 0x2714, - a21: 0x2715, - a22: 0x2716, - a23: 0x2717, - a24: 0x2718, - a25: 0x2719, - a26: 0x271A, - a27: 0x271B, - a28: 0x271C, - a6: 0x271D, - a7: 0x271E, - a8: 0x271F, - a9: 0x2720, - a10: 0x2721, - a29: 0x2722, - a30: 0x2723, - a31: 0x2724, - a32: 0x2725, - a33: 0x2726, - a34: 0x2727, - a35: 0x2605, - a36: 0x2729, - a37: 0x272A, - a38: 0x272B, - a39: 0x272C, - a40: 0x272D, - a41: 0x272E, - a42: 0x272F, - a43: 0x2730, - a44: 0x2731, - a45: 0x2732, - a46: 0x2733, - a47: 0x2734, - a48: 0x2735, - a49: 0x2736, - a50: 0x2737, - a51: 0x2738, - a52: 0x2739, - a53: 0x273A, - a54: 0x273B, - a55: 0x273C, - a56: 0x273D, - a57: 0x273E, - a58: 0x273F, - a59: 0x2740, - a60: 0x2741, - a61: 0x2742, - a62: 0x2743, - a63: 0x2744, - a64: 0x2745, - a65: 0x2746, - a66: 0x2747, - a67: 0x2748, - a68: 0x2749, - a69: 0x274A, - a70: 0x274B, - a71: 0x25CF, - a72: 0x274D, - a73: 0x25A0, - a74: 0x274F, - a203: 0x2750, - a75: 0x2751, - a204: 0x2752, - a76: 0x25B2, - a77: 0x25BC, - a78: 0x25C6, - a79: 0x2756, - a81: 0x25D7, - a82: 0x2758, - a83: 0x2759, - a84: 0x275A, - a97: 0x275B, - a98: 0x275C, - a99: 0x275D, - a100: 0x275E, - a101: 0x2761, - a102: 0x2762, - a103: 0x2763, - a104: 0x2764, - a106: 0x2765, - a107: 0x2766, - a108: 0x2767, - a112: 0x2663, - a111: 0x2666, - a110: 0x2665, - a109: 0x2660, - a120: 0x2460, - a121: 0x2461, - a122: 0x2462, - a123: 0x2463, - a124: 0x2464, - a125: 0x2465, - a126: 0x2466, - a127: 0x2467, - a128: 0x2468, - a129: 0x2469, - a130: 0x2776, - a131: 0x2777, - a132: 0x2778, - a133: 0x2779, - a134: 0x277A, - a135: 0x277B, - a136: 0x277C, - a137: 0x277D, - a138: 0x277E, - a139: 0x277F, - a140: 0x2780, - a141: 0x2781, - a142: 0x2782, - a143: 0x2783, - a144: 0x2784, - a145: 0x2785, - a146: 0x2786, - a147: 0x2787, - a148: 0x2788, - a149: 0x2789, - a150: 0x278A, - a151: 0x278B, - a152: 0x278C, - a153: 0x278D, - a154: 0x278E, - a155: 0x278F, - a156: 0x2790, - a157: 0x2791, - a158: 0x2792, - a159: 0x2793, - a160: 0x2794, - a161: 0x2192, - a163: 0x2194, - a164: 0x2195, - a196: 0x2798, - a165: 0x2799, - a192: 0x279A, - a166: 0x279B, - a167: 0x279C, - a168: 0x279D, - a169: 0x279E, - a170: 0x279F, - a171: 0x27A0, - a172: 0x27A1, - a173: 0x27A2, - a162: 0x27A3, - a174: 0x27A4, - a175: 0x27A5, - a176: 0x27A6, - a177: 0x27A7, - a178: 0x27A8, - a179: 0x27A9, - a193: 0x27AA, - a180: 0x27AB, - a199: 0x27AC, - a181: 0x27AD, - a200: 0x27AE, - a182: 0x27AF, - a201: 0x27B1, - a183: 0x27B2, - a184: 0x27B3, - a197: 0x27B4, - a185: 0x27B5, - a194: 0x27B6, - a198: 0x27B7, - a186: 0x27B8, - a195: 0x27B9, - a187: 0x27BA, - a188: 0x27BB, - a189: 0x27BC, - a190: 0x27BD, - a191: 0x27BE, - a89: 0x2768, // 0xF8D7 - a90: 0x2769, // 0xF8D8 - a93: 0x276A, // 0xF8D9 - a94: 0x276B, // 0xF8DA - a91: 0x276C, // 0xF8DB - a92: 0x276D, // 0xF8DC - a205: 0x276E, // 0xF8DD - a85: 0x276F, // 0xF8DE - a206: 0x2770, // 0xF8DF - a86: 0x2771, // 0xF8E0 - a87: 0x2772, // 0xF8E1 - a88: 0x2773, // 0xF8E2 - a95: 0x2774, // 0xF8E3 - a96: 0x2775, // 0xF8E4 - '.notdef': 0x0000 -}; - -exports.GlyphsUnicode = GlyphsUnicode; -exports.DingbatsGlyphsUnicode = DingbatsGlyphsUnicode; -})); - - - -(function (root, factory) { - { - factory((root.pdfjsCoreJpg = {})); - } -}(this, function (exports) { - -/* -This code was forked from https://github.com/notmasteryet/jpgjs. The original -version was created by github user notmasteryet - -- The JPEG specification can be found in the ITU CCITT Recommendation T.81 - (www.w3.org/Graphics/JPEG/itu-t81.pdf) -- The JFIF specification can be found in the JPEG File Interchange Format - (www.w3.org/Graphics/JPEG/jfif3.pdf) -- The Adobe Application-Specific JPEG markers in the Supporting the DCT Filters - in PostScript Level 2, Technical Note #5116 - (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf) -*/ - -var JpegImage = (function jpegImage() { - var dctZigZag = new Uint8Array([ - 0, - 1, 8, - 16, 9, 2, - 3, 10, 17, 24, - 32, 25, 18, 11, 4, - 5, 12, 19, 26, 33, 40, - 48, 41, 34, 27, 20, 13, 6, - 7, 14, 21, 28, 35, 42, 49, 56, - 57, 50, 43, 36, 29, 22, 15, - 23, 30, 37, 44, 51, 58, - 59, 52, 45, 38, 31, - 39, 46, 53, 60, - 61, 54, 47, - 55, 62, - 63 - ]); - - var dctCos1 = 4017; // cos(pi/16) - var dctSin1 = 799; // sin(pi/16) - var dctCos3 = 3406; // cos(3*pi/16) - var dctSin3 = 2276; // sin(3*pi/16) - var dctCos6 = 1567; // cos(6*pi/16) - var dctSin6 = 3784; // sin(6*pi/16) - var dctSqrt2 = 5793; // sqrt(2) - var dctSqrt1d2 = 2896; // sqrt(2) / 2 - - function constructor() { - } - - function buildHuffmanTable(codeLengths, values) { - var k = 0, code = [], i, j, length = 16; - while (length > 0 && !codeLengths[length - 1]) { - length--; - } - code.push({children: [], index: 0}); - var p = code[0], q; - for (i = 0; i < length; i++) { - for (j = 0; j < codeLengths[i]; j++) { - p = code.pop(); - p.children[p.index] = values[k]; - while (p.index > 0) { - p = code.pop(); - } - p.index++; - code.push(p); - while (code.length <= i) { - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - k++; - } - if (i + 1 < length) { - // p here points to last code - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - } - return code[0].children; - } - - function getBlockBufferOffset(component, row, col) { - return 64 * ((component.blocksPerLine + 1) * row + col); - } - - function decodeScan(data, offset, frame, components, resetInterval, - spectralStart, spectralEnd, successivePrev, successive) { - var mcusPerLine = frame.mcusPerLine; - var progressive = frame.progressive; - - var startOffset = offset, bitsData = 0, bitsCount = 0; - - function readBit() { - if (bitsCount > 0) { - bitsCount--; - return (bitsData >> bitsCount) & 1; - } - bitsData = data[offset++]; - if (bitsData === 0xFF) { - var nextByte = data[offset++]; - if (nextByte) { - throw 'unexpected marker: ' + - ((bitsData << 8) | nextByte).toString(16); - } - // unstuff 0 - } - bitsCount = 7; - return bitsData >>> 7; - } - - function decodeHuffman(tree) { - var node = tree; - while (true) { - node = node[readBit()]; - if (typeof node === 'number') { - return node; - } - if (typeof node !== 'object') { - throw 'invalid huffman sequence'; - } - } - } - - function receive(length) { - var n = 0; - while (length > 0) { - n = (n << 1) | readBit(); - length--; - } - return n; - } - - function receiveAndExtend(length) { - if (length === 1) { - return readBit() === 1 ? 1 : -1; - } - var n = receive(length); - if (n >= 1 << (length - 1)) { - return n; - } - return n + (-1 << length) + 1; - } - - function decodeBaseline(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : receiveAndExtend(t); - component.blockData[offset] = (component.pred += diff); - var k = 1; - while (k < 64) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = receiveAndExtend(s); - k++; - } - } - - function decodeDCFirst(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive); - component.blockData[offset] = (component.pred += diff); - } - - function decodeDCSuccessive(component, offset) { - component.blockData[offset] |= readBit() << successive; - } - - var eobrun = 0; - function decodeACFirst(component, offset) { - if (eobrun > 0) { - eobrun--; - return; - } - var k = spectralStart, e = spectralEnd; - while (k <= e) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r) - 1; - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = - receiveAndExtend(s) * (1 << successive); - k++; - } - } - - var successiveACState = 0, successiveACNextValue; - function decodeACSuccessive(component, offset) { - var k = spectralStart; - var e = spectralEnd; - var r = 0; - var s; - var rs; - while (k <= e) { - var z = dctZigZag[k]; - switch (successiveACState) { - case 0: // initial state - rs = decodeHuffman(component.huffmanTableAC); - s = rs & 15; - r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r); - successiveACState = 4; - } else { - r = 16; - successiveACState = 1; - } - } else { - if (s !== 1) { - throw 'invalid ACn encoding'; - } - successiveACNextValue = receiveAndExtend(s); - successiveACState = r ? 2 : 3; - } - continue; - case 1: // skipping r zero items - case 2: - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - r--; - if (r === 0) { - successiveACState = successiveACState === 2 ? 3 : 0; - } - } - break; - case 3: // set value for a zero item - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - component.blockData[offset + z] = - successiveACNextValue << successive; - successiveACState = 0; - } - break; - case 4: // eob - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } - break; - } - k++; - } - if (successiveACState === 4) { - eobrun--; - if (eobrun === 0) { - successiveACState = 0; - } - } - } - - function decodeMcu(component, decode, mcu, row, col) { - var mcuRow = (mcu / mcusPerLine) | 0; - var mcuCol = mcu % mcusPerLine; - var blockRow = mcuRow * component.v + row; - var blockCol = mcuCol * component.h + col; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - function decodeBlock(component, decode, mcu) { - var blockRow = (mcu / component.blocksPerLine) | 0; - var blockCol = mcu % component.blocksPerLine; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - var componentsLength = components.length; - var component, i, j, k, n; - var decodeFn; - if (progressive) { - if (spectralStart === 0) { - decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; - } else { - decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; - } - } else { - decodeFn = decodeBaseline; - } - - var mcu = 0, marker; - var mcuExpected; - if (componentsLength === 1) { - mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; - } else { - mcuExpected = mcusPerLine * frame.mcusPerColumn; - } - if (!resetInterval) { - resetInterval = mcuExpected; - } - - var h, v; - while (mcu < mcuExpected) { - // reset interval stuff - for (i = 0; i < componentsLength; i++) { - components[i].pred = 0; - } - eobrun = 0; - - if (componentsLength === 1) { - component = components[0]; - for (n = 0; n < resetInterval; n++) { - decodeBlock(component, decodeFn, mcu); - mcu++; - } - } else { - for (n = 0; n < resetInterval; n++) { - for (i = 0; i < componentsLength; i++) { - component = components[i]; - h = component.h; - v = component.v; - for (j = 0; j < v; j++) { - for (k = 0; k < h; k++) { - decodeMcu(component, decodeFn, mcu, j, k); - } - } - } - mcu++; - } - } - - // find marker - bitsCount = 0; - marker = (data[offset] << 8) | data[offset + 1]; - if (marker <= 0xFF00) { - throw 'marker was not found'; - } - - if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx - offset += 2; - } else { - break; - } - } - - return offset - startOffset; - } - - // A port of poppler's IDCT method which in turn is taken from: - // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, - // 'Practical Fast 1-D DCT Algorithms with 11 Multiplications', - // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, - // 988-991. - function quantizeAndInverse(component, blockBufferOffset, p) { - var qt = component.quantizationTable, blockData = component.blockData; - var v0, v1, v2, v3, v4, v5, v6, v7; - var p0, p1, p2, p3, p4, p5, p6, p7; - var t; - - // inverse DCT on rows - for (var row = 0; row < 64; row += 8) { - // gather block data - p0 = blockData[blockBufferOffset + row]; - p1 = blockData[blockBufferOffset + row + 1]; - p2 = blockData[blockBufferOffset + row + 2]; - p3 = blockData[blockBufferOffset + row + 3]; - p4 = blockData[blockBufferOffset + row + 4]; - p5 = blockData[blockBufferOffset + row + 5]; - p6 = blockData[blockBufferOffset + row + 6]; - p7 = blockData[blockBufferOffset + row + 7]; - - // dequant p0 - p0 *= qt[row]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 512) >> 10; - p[row] = t; - p[row + 1] = t; - p[row + 2] = t; - p[row + 3] = t; - p[row + 4] = t; - p[row + 5] = t; - p[row + 6] = t; - p[row + 7] = t; - continue; - } - // dequant p1 ... p7 - p1 *= qt[row + 1]; - p2 *= qt[row + 2]; - p3 *= qt[row + 3]; - p4 *= qt[row + 4]; - p5 *= qt[row + 5]; - p6 *= qt[row + 6]; - p7 *= qt[row + 7]; - - // stage 4 - v0 = (dctSqrt2 * p0 + 128) >> 8; - v1 = (dctSqrt2 * p4 + 128) >> 8; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8; - v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8; - v5 = p3 << 4; - v6 = p5 << 4; - - // stage 3 - v0 = (v0 + v1 + 1) >> 1; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p[row] = v0 + v7; - p[row + 7] = v0 - v7; - p[row + 1] = v1 + v6; - p[row + 6] = v1 - v6; - p[row + 2] = v2 + v5; - p[row + 5] = v2 - v5; - p[row + 3] = v3 + v4; - p[row + 4] = v3 - v4; - } - - // inverse DCT on columns - for (var col = 0; col < 8; ++col) { - p0 = p[col]; - p1 = p[col + 8]; - p2 = p[col + 16]; - p3 = p[col + 24]; - p4 = p[col + 32]; - p5 = p[col + 40]; - p6 = p[col + 48]; - p7 = p[col + 56]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 8192) >> 14; - // convert to 8 bit - t = (t < -2040) ? 0 : (t >= 2024) ? 255 : (t + 2056) >> 4; - blockData[blockBufferOffset + col] = t; - blockData[blockBufferOffset + col + 8] = t; - blockData[blockBufferOffset + col + 16] = t; - blockData[blockBufferOffset + col + 24] = t; - blockData[blockBufferOffset + col + 32] = t; - blockData[blockBufferOffset + col + 40] = t; - blockData[blockBufferOffset + col + 48] = t; - blockData[blockBufferOffset + col + 56] = t; - continue; - } - - // stage 4 - v0 = (dctSqrt2 * p0 + 2048) >> 12; - v1 = (dctSqrt2 * p4 + 2048) >> 12; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12; - v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12; - v5 = p3; - v6 = p5; - - // stage 3 - // Shift v0 by 128.5 << 5 here, so we don't need to shift p0...p7 when - // converting to UInt8 range later. - v0 = ((v0 + v1 + 1) >> 1) + 4112; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p0 = v0 + v7; - p7 = v0 - v7; - p1 = v1 + v6; - p6 = v1 - v6; - p2 = v2 + v5; - p5 = v2 - v5; - p3 = v3 + v4; - p4 = v3 - v4; - - // convert to 8-bit integers - p0 = (p0 < 16) ? 0 : (p0 >= 4080) ? 255 : p0 >> 4; - p1 = (p1 < 16) ? 0 : (p1 >= 4080) ? 255 : p1 >> 4; - p2 = (p2 < 16) ? 0 : (p2 >= 4080) ? 255 : p2 >> 4; - p3 = (p3 < 16) ? 0 : (p3 >= 4080) ? 255 : p3 >> 4; - p4 = (p4 < 16) ? 0 : (p4 >= 4080) ? 255 : p4 >> 4; - p5 = (p5 < 16) ? 0 : (p5 >= 4080) ? 255 : p5 >> 4; - p6 = (p6 < 16) ? 0 : (p6 >= 4080) ? 255 : p6 >> 4; - p7 = (p7 < 16) ? 0 : (p7 >= 4080) ? 255 : p7 >> 4; - - // store block data - blockData[blockBufferOffset + col] = p0; - blockData[blockBufferOffset + col + 8] = p1; - blockData[blockBufferOffset + col + 16] = p2; - blockData[blockBufferOffset + col + 24] = p3; - blockData[blockBufferOffset + col + 32] = p4; - blockData[blockBufferOffset + col + 40] = p5; - blockData[blockBufferOffset + col + 48] = p6; - blockData[blockBufferOffset + col + 56] = p7; - } - } - - function buildComponentData(frame, component) { - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var computationBuffer = new Int16Array(64); - - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var offset = getBlockBufferOffset(component, blockRow, blockCol); - quantizeAndInverse(component, offset, computationBuffer); - } - } - return component.blockData; - } - - function clamp0to255(a) { - return a <= 0 ? 0 : a >= 255 ? 255 : a; - } - - constructor.prototype = { - parse: function parse(data) { - - function readUint16() { - var value = (data[offset] << 8) | data[offset + 1]; - offset += 2; - return value; - } - - function readDataBlock() { - var length = readUint16(); - var array = data.subarray(offset, offset + length - 2); - offset += array.length; - return array; - } - - function prepareComponents(frame) { - var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); - var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); - for (var i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * - component.h / frame.maxH); - var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * - component.v / frame.maxV); - var blocksPerLineForMcu = mcusPerLine * component.h; - var blocksPerColumnForMcu = mcusPerColumn * component.v; - - var blocksBufferSize = 64 * blocksPerColumnForMcu * - (blocksPerLineForMcu + 1); - component.blockData = new Int16Array(blocksBufferSize); - component.blocksPerLine = blocksPerLine; - component.blocksPerColumn = blocksPerColumn; - } - frame.mcusPerLine = mcusPerLine; - frame.mcusPerColumn = mcusPerColumn; - } - - var offset = 0; - var jfif = null; - var adobe = null; - var frame, resetInterval; - var quantizationTables = []; - var huffmanTablesAC = [], huffmanTablesDC = []; - var fileMarker = readUint16(); - if (fileMarker !== 0xFFD8) { // SOI (Start of Image) - throw 'SOI not found'; - } - - fileMarker = readUint16(); - while (fileMarker !== 0xFFD9) { // EOI (End of image) - var i, j, l; - switch(fileMarker) { - case 0xFFE0: // APP0 (Application Specific) - case 0xFFE1: // APP1 - case 0xFFE2: // APP2 - case 0xFFE3: // APP3 - case 0xFFE4: // APP4 - case 0xFFE5: // APP5 - case 0xFFE6: // APP6 - case 0xFFE7: // APP7 - case 0xFFE8: // APP8 - case 0xFFE9: // APP9 - case 0xFFEA: // APP10 - case 0xFFEB: // APP11 - case 0xFFEC: // APP12 - case 0xFFED: // APP13 - case 0xFFEE: // APP14 - case 0xFFEF: // APP15 - case 0xFFFE: // COM (Comment) - var appData = readDataBlock(); - - if (fileMarker === 0xFFE0) { - if (appData[0] === 0x4A && appData[1] === 0x46 && - appData[2] === 0x49 && appData[3] === 0x46 && - appData[4] === 0) { // 'JFIF\x00' - jfif = { - version: { major: appData[5], minor: appData[6] }, - densityUnits: appData[7], - xDensity: (appData[8] << 8) | appData[9], - yDensity: (appData[10] << 8) | appData[11], - thumbWidth: appData[12], - thumbHeight: appData[13], - thumbData: appData.subarray(14, 14 + - 3 * appData[12] * appData[13]) - }; - } - } - // TODO APP1 - Exif - if (fileMarker === 0xFFEE) { - if (appData[0] === 0x41 && appData[1] === 0x64 && - appData[2] === 0x6F && appData[3] === 0x62 && - appData[4] === 0x65) { // 'Adobe' - adobe = { - version: (appData[5] << 8) | appData[6], - flags0: (appData[7] << 8) | appData[8], - flags1: (appData[9] << 8) | appData[10], - transformCode: appData[11] - }; - } - } - break; - - case 0xFFDB: // DQT (Define Quantization Tables) - var quantizationTablesLength = readUint16(); - var quantizationTablesEnd = quantizationTablesLength + offset - 2; - var z; - while (offset < quantizationTablesEnd) { - var quantizationTableSpec = data[offset++]; - var tableData = new Uint16Array(64); - if ((quantizationTableSpec >> 4) === 0) { // 8 bit values - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = data[offset++]; - } - } else if ((quantizationTableSpec >> 4) === 1) { //16 bit - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = readUint16(); - } - } else { - throw 'DQT: invalid table spec'; - } - quantizationTables[quantizationTableSpec & 15] = tableData; - } - break; - - case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT) - case 0xFFC1: // SOF1 (Start of Frame, Extended DCT) - case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT) - if (frame) { - throw 'Only single frame JPEGs supported'; - } - readUint16(); // skip data length - frame = {}; - frame.extended = (fileMarker === 0xFFC1); - frame.progressive = (fileMarker === 0xFFC2); - frame.precision = data[offset++]; - frame.scanLines = readUint16(); - frame.samplesPerLine = readUint16(); - frame.components = []; - frame.componentIds = {}; - var componentsCount = data[offset++], componentId; - var maxH = 0, maxV = 0; - for (i = 0; i < componentsCount; i++) { - componentId = data[offset]; - var h = data[offset + 1] >> 4; - var v = data[offset + 1] & 15; - if (maxH < h) { - maxH = h; - } - if (maxV < v) { - maxV = v; - } - var qId = data[offset + 2]; - l = frame.components.push({ - h: h, - v: v, - quantizationTable: quantizationTables[qId] - }); - frame.componentIds[componentId] = l - 1; - offset += 3; - } - frame.maxH = maxH; - frame.maxV = maxV; - prepareComponents(frame); - break; - - case 0xFFC4: // DHT (Define Huffman Tables) - var huffmanLength = readUint16(); - for (i = 2; i < huffmanLength;) { - var huffmanTableSpec = data[offset++]; - var codeLengths = new Uint8Array(16); - var codeLengthSum = 0; - for (j = 0; j < 16; j++, offset++) { - codeLengthSum += (codeLengths[j] = data[offset]); - } - var huffmanValues = new Uint8Array(codeLengthSum); - for (j = 0; j < codeLengthSum; j++, offset++) { - huffmanValues[j] = data[offset]; - } - i += 17 + codeLengthSum; - - ((huffmanTableSpec >> 4) === 0 ? - huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = - buildHuffmanTable(codeLengths, huffmanValues); - } - break; - - case 0xFFDD: // DRI (Define Restart Interval) - readUint16(); // skip data length - resetInterval = readUint16(); - break; - - case 0xFFDA: // SOS (Start of Scan) - var scanLength = readUint16(); - var selectorsCount = data[offset++]; - var components = [], component; - for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; - component = frame.components[componentIndex]; - var tableSpec = data[offset++]; - component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; - component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; - components.push(component); - } - var spectralStart = data[offset++]; - var spectralEnd = data[offset++]; - var successiveApproximation = data[offset++]; - var processed = decodeScan(data, offset, - frame, components, resetInterval, - spectralStart, spectralEnd, - successiveApproximation >> 4, successiveApproximation & 15); - offset += processed; - break; - - case 0xFFFF: // Fill bytes - if (data[offset] !== 0xFF) { // Avoid skipping a valid marker. - offset--; - } - break; - - default: - if (data[offset - 3] === 0xFF && - data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { - // could be incorrect encoding -- last 0xFF byte of the previous - // block was eaten by the encoder - offset -= 3; - break; - } - throw 'unknown JPEG marker ' + fileMarker.toString(16); - } - fileMarker = readUint16(); - } - - this.width = frame.samplesPerLine; - this.height = frame.scanLines; - this.jfif = jfif; - this.adobe = adobe; - this.components = []; - for (i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - this.components.push({ - output: buildComponentData(frame, component), - scaleX: component.h / frame.maxH, - scaleY: component.v / frame.maxV, - blocksPerLine: component.blocksPerLine, - blocksPerColumn: component.blocksPerColumn - }); - } - this.numComponents = this.components.length; - }, - - _getLinearizedBlockData: function getLinearizedBlockData(width, height) { - var scaleX = this.width / width, scaleY = this.height / height; - - var component, componentScaleX, componentScaleY, blocksPerScanline; - var x, y, i, j, k; - var index; - var offset = 0; - var output; - var numComponents = this.components.length; - var dataLength = width * height * numComponents; - var data = new Uint8Array(dataLength); - var xScaleBlockOffset = new Uint32Array(width); - var mask3LSB = 0xfffffff8; // used to clear the 3 LSBs - - for (i = 0; i < numComponents; i++) { - component = this.components[i]; - componentScaleX = component.scaleX * scaleX; - componentScaleY = component.scaleY * scaleY; - offset = i; - output = component.output; - blocksPerScanline = (component.blocksPerLine + 1) << 3; - // precalculate the xScaleBlockOffset - for (x = 0; x < width; x++) { - j = 0 | (x * componentScaleX); - xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7); - } - // linearize the blocks of the component - for (y = 0; y < height; y++) { - j = 0 | (y * componentScaleY); - index = blocksPerScanline * (j & mask3LSB) | ((j & 7) << 3); - for (x = 0; x < width; x++) { - data[offset] = output[index + xScaleBlockOffset[x]]; - offset += numComponents; - } - } - } - - // decodeTransform contains pairs of multiplier (-256..256) and additive - var transform = this.decodeTransform; - if (transform) { - for (i = 0; i < dataLength;) { - for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { - data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1]; - } - } - } - return data; - }, - - _isColorConversionNeeded: function isColorConversionNeeded() { - if (this.adobe && this.adobe.transformCode) { - // The adobe transform marker overrides any previous setting - return true; - } else if (this.numComponents === 3) { - return true; - } else { - return false; - } - }, - - _convertYccToRgb: function convertYccToRgb(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 3) { - Y = data[i ]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(Y - 179.456 + 1.402 * Cr); - data[i + 1] = clamp0to255(Y + 135.459 - 0.344 * Cb - 0.714 * Cr); - data[i + 2] = clamp0to255(Y - 226.816 + 1.772 * Cb); - } - return data; - }, - - _convertYcckToRgb: function convertYcckToRgb(data) { - var Y, Cb, Cr, k; - var offset = 0; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - k = data[i + 3]; - - var r = -122.67195406894 + - Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - - 0.154362151871126) + - Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - - 0.00477271405408747 * k + 1.53380253221734) + - Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + - 0.48357088451265) + - k * (-0.000336197177618394 * k + 0.484791561490776); - - var g = 107.268039397724 + - Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + - 0.000659397001245577 * Y + 0.000426105652938837 * k - - 0.176491792462875) + - Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + - 0.000770482631801132 * k - 0.151051492775562) + - Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + - 0.25802910206845) + - k * (-0.000318913117588328 * k - 0.213742400323665); - - var b = -20.810012546947 + - Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + - 0.0020741088115012 * Y - 0.00288260236853442 * k + - 0.814272968359295) + - Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + - 0.000560833691242812 * k - 0.195152027534049) + - Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + - 0.116935020465145) + - k * (-0.000343531996510555 * k + 0.24165260232407); - - data[offset++] = clamp0to255(r); - data[offset++] = clamp0to255(g); - data[offset++] = clamp0to255(b); - } - return data; - }, - - _convertYcckToCmyk: function convertYcckToCmyk(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(434.456 - Y - 1.402 * Cr); - data[i + 1] = clamp0to255(119.541 - Y + 0.344 * Cb + 0.714 * Cr); - data[i + 2] = clamp0to255(481.816 - Y - 1.772 * Cb); - // K in data[i + 3] is unchanged - } - return data; - }, - - _convertCmykToRgb: function convertCmykToRgb(data) { - var c, m, y, k; - var offset = 0; - var min = -255 * 255 * 255; - var scale = 1 / 255 / 255; - for (var i = 0, length = data.length; i < length; i += 4) { - c = data[i]; - m = data[i + 1]; - y = data[i + 2]; - k = data[i + 3]; - - var r = - c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k - - 72734.4411664936) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y - - 17.873870861415444 * k - 1401.7366389350734) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 4465.541406466231) - - k * (21.86122147463605 * k + 48317.86113160301); - var g = - c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k - - 20220.756542821975) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 48691.05921601825) + - y * (4.444339102852739 * y + 9.8632861493405 * k - - 6341.191035517494) - - k * (20.737325471181034 * k + 47890.15695978492); - var b = - c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k - - 3616.812083916688) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 28620.90484698408) + - y * (0.03296041114873217 * y + 115.60384449646641 * k - - 49363.43385999684) - - k * (22.33816807309886 * k + 45932.16563550634); - - data[offset++] = r >= 0 ? 255 : r <= min ? 0 : 255 + r * scale | 0; - data[offset++] = g >= 0 ? 255 : g <= min ? 0 : 255 + g * scale | 0; - data[offset++] = b >= 0 ? 255 : b <= min ? 0 : 255 + b * scale | 0; - } - return data; - }, - - getData: function getData(width, height, forceRGBoutput) { - if (this.numComponents > 4) { - throw 'Unsupported color mode'; - } - // type of data: Uint8Array(width * height * numComponents) - var data = this._getLinearizedBlockData(width, height); - - if (this.numComponents === 3) { - return this._convertYccToRgb(data); - } else if (this.numComponents === 4) { - if (this._isColorConversionNeeded()) { - if (forceRGBoutput) { - return this._convertYcckToRgb(data); - } else { - return this._convertYcckToCmyk(data); - } - } else if (forceRGBoutput) { - return this._convertCmykToRgb(data); - } - } - return data; - } - }; - - return constructor; -})(); - -exports.JpegImage = JpegImage; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreMetrics = {})); - } -}(this, function (exports) { - -// The Metrics object contains glyph widths (in glyph space units). -// As per PDF spec, for most fonts (Type 3 being an exception) a glyph -// space unit corresponds to 1/1000th of text space unit. -var Metrics = { - 'Courier': 600, - 'Courier-Bold': 600, - 'Courier-BoldOblique': 600, - 'Courier-Oblique': 600, - 'Helvetica' : { - 'space': 278, - 'exclam': 278, - 'quotedbl': 355, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 667, - 'quoteright': 222, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 278, - 'semicolon': 278, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 556, - 'at': 1015, - 'A': 667, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 500, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 278, - 'backslash': 278, - 'bracketright': 278, - 'asciicircum': 469, - 'underscore': 556, - 'quoteleft': 222, - 'a': 556, - 'b': 556, - 'c': 500, - 'd': 556, - 'e': 556, - 'f': 278, - 'g': 556, - 'h': 556, - 'i': 222, - 'j': 222, - 'k': 500, - 'l': 222, - 'm': 833, - 'n': 556, - 'o': 556, - 'p': 556, - 'q': 556, - 'r': 333, - 's': 500, - 't': 278, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 500, - 'braceleft': 334, - 'bar': 260, - 'braceright': 334, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 191, - 'quotedblleft': 333, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 537, - 'bullet': 350, - 'quotesinglbase': 222, - 'quotedblbase': 333, - 'quotedblright': 333, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 556, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 222, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 556, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 667, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 500, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 500, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 222, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 500, - 'scedilla': 500, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 556, - 'Amacron': 667, - 'rcaron': 333, - 'ccedilla': 500, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 643, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 584, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 500, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 260, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 333, - 'omacron': 556, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 222, - 'tcaron': 317, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 222, - 'Oacute': 778, - 'oacute': 556, - 'amacron': 556, - 'sacute': 500, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 556, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 299, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 556, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 556, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 556, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 556, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 556, - 'Rcommaaccent': 722, - 'Lcommaaccent': 556, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 500, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 584, - 'odieresis': 556, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 556, - 'eth': 556, - 'zcaron': 500, - 'ncommaaccent': 556, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-Bold': { - 'space': 278, - 'exclam': 333, - 'quotedbl': 474, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 722, - 'quoteright': 278, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 333, - 'semicolon': 333, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 611, - 'at': 975, - 'A': 722, - 'B': 722, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 556, - 'K': 722, - 'L': 611, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 584, - 'underscore': 556, - 'quoteleft': 278, - 'a': 556, - 'b': 611, - 'c': 556, - 'd': 611, - 'e': 556, - 'f': 333, - 'g': 611, - 'h': 611, - 'i': 278, - 'j': 278, - 'k': 556, - 'l': 278, - 'm': 889, - 'n': 611, - 'o': 611, - 'p': 611, - 'q': 611, - 'r': 389, - 's': 556, - 't': 333, - 'u': 611, - 'v': 556, - 'w': 778, - 'x': 556, - 'y': 556, - 'z': 500, - 'braceleft': 389, - 'bar': 280, - 'braceright': 389, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 238, - 'quotedblleft': 500, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 611, - 'fl': 611, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 556, - 'bullet': 350, - 'quotesinglbase': 278, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 611, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 611, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 722, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 556, - 'scommaaccent': 556, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 611, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 556, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 556, - 'scedilla': 556, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 611, - 'acircumflex': 556, - 'Amacron': 722, - 'rcaron': 389, - 'ccedilla': 556, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 743, - 'Umacron': 722, - 'uring': 611, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 584, - 'uacute': 611, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 556, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 556, - 'nacute': 611, - 'umacron': 611, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 280, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 611, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 389, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 611, - 'amacron': 556, - 'sacute': 556, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 611, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 611, - 'igrave': 278, - 'ohungarumlaut': 611, - 'Eogonek': 667, - 'dcroat': 611, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 400, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 611, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 611, - 'ntilde': 611, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 611, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 611, - 'Ccaron': 722, - 'ugrave': 611, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 611, - 'Rcommaaccent': 722, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 556, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 611, - 'tcommaaccent': 333, - 'logicalnot': 584, - 'odieresis': 611, - 'udieresis': 611, - 'notequal': 549, - 'gcommaaccent': 611, - 'eth': 611, - 'zcaron': 500, - 'ncommaaccent': 611, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-BoldOblique': { - 'space': 278, - 'exclam': 333, - 'quotedbl': 474, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 722, - 'quoteright': 278, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 333, - 'semicolon': 333, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 611, - 'at': 975, - 'A': 722, - 'B': 722, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 556, - 'K': 722, - 'L': 611, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 584, - 'underscore': 556, - 'quoteleft': 278, - 'a': 556, - 'b': 611, - 'c': 556, - 'd': 611, - 'e': 556, - 'f': 333, - 'g': 611, - 'h': 611, - 'i': 278, - 'j': 278, - 'k': 556, - 'l': 278, - 'm': 889, - 'n': 611, - 'o': 611, - 'p': 611, - 'q': 611, - 'r': 389, - 's': 556, - 't': 333, - 'u': 611, - 'v': 556, - 'w': 778, - 'x': 556, - 'y': 556, - 'z': 500, - 'braceleft': 389, - 'bar': 280, - 'braceright': 389, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 238, - 'quotedblleft': 500, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 611, - 'fl': 611, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 556, - 'bullet': 350, - 'quotesinglbase': 278, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 611, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 611, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 722, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 556, - 'scommaaccent': 556, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 611, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 556, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 556, - 'scedilla': 556, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 611, - 'acircumflex': 556, - 'Amacron': 722, - 'rcaron': 389, - 'ccedilla': 556, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 743, - 'Umacron': 722, - 'uring': 611, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 584, - 'uacute': 611, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 556, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 556, - 'nacute': 611, - 'umacron': 611, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 280, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 611, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 389, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 611, - 'amacron': 556, - 'sacute': 556, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 611, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 611, - 'igrave': 278, - 'ohungarumlaut': 611, - 'Eogonek': 667, - 'dcroat': 611, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 400, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 611, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 611, - 'ntilde': 611, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 611, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 611, - 'Ccaron': 722, - 'ugrave': 611, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 611, - 'Rcommaaccent': 722, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 556, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 611, - 'tcommaaccent': 333, - 'logicalnot': 584, - 'odieresis': 611, - 'udieresis': 611, - 'notequal': 549, - 'gcommaaccent': 611, - 'eth': 611, - 'zcaron': 500, - 'ncommaaccent': 611, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-Oblique' : { - 'space': 278, - 'exclam': 278, - 'quotedbl': 355, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 667, - 'quoteright': 222, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 278, - 'semicolon': 278, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 556, - 'at': 1015, - 'A': 667, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 500, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 278, - 'backslash': 278, - 'bracketright': 278, - 'asciicircum': 469, - 'underscore': 556, - 'quoteleft': 222, - 'a': 556, - 'b': 556, - 'c': 500, - 'd': 556, - 'e': 556, - 'f': 278, - 'g': 556, - 'h': 556, - 'i': 222, - 'j': 222, - 'k': 500, - 'l': 222, - 'm': 833, - 'n': 556, - 'o': 556, - 'p': 556, - 'q': 556, - 'r': 333, - 's': 500, - 't': 278, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 500, - 'braceleft': 334, - 'bar': 260, - 'braceright': 334, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 191, - 'quotedblleft': 333, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 537, - 'bullet': 350, - 'quotesinglbase': 222, - 'quotedblbase': 333, - 'quotedblright': 333, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 556, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 222, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 556, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 667, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 500, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 500, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 222, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 500, - 'scedilla': 500, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 556, - 'Amacron': 667, - 'rcaron': 333, - 'ccedilla': 500, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 643, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 584, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 500, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 260, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 333, - 'omacron': 556, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 222, - 'tcaron': 317, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 222, - 'Oacute': 778, - 'oacute': 556, - 'amacron': 556, - 'sacute': 500, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 556, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 299, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 556, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 556, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 556, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 556, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 556, - 'Rcommaaccent': 722, - 'Lcommaaccent': 556, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 500, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 584, - 'odieresis': 556, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 556, - 'eth': 556, - 'zcaron': 500, - 'ncommaaccent': 556, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Symbol': { - 'space': 250, - 'exclam': 333, - 'universal': 713, - 'numbersign': 500, - 'existential': 549, - 'percent': 833, - 'ampersand': 778, - 'suchthat': 439, - 'parenleft': 333, - 'parenright': 333, - 'asteriskmath': 500, - 'plus': 549, - 'comma': 250, - 'minus': 549, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 278, - 'semicolon': 278, - 'less': 549, - 'equal': 549, - 'greater': 549, - 'question': 444, - 'congruent': 549, - 'Alpha': 722, - 'Beta': 667, - 'Chi': 722, - 'Delta': 612, - 'Epsilon': 611, - 'Phi': 763, - 'Gamma': 603, - 'Eta': 722, - 'Iota': 333, - 'theta1': 631, - 'Kappa': 722, - 'Lambda': 686, - 'Mu': 889, - 'Nu': 722, - 'Omicron': 722, - 'Pi': 768, - 'Theta': 741, - 'Rho': 556, - 'Sigma': 592, - 'Tau': 611, - 'Upsilon': 690, - 'sigma1': 439, - 'Omega': 768, - 'Xi': 645, - 'Psi': 795, - 'Zeta': 611, - 'bracketleft': 333, - 'therefore': 863, - 'bracketright': 333, - 'perpendicular': 658, - 'underscore': 500, - 'radicalex': 500, - 'alpha': 631, - 'beta': 549, - 'chi': 549, - 'delta': 494, - 'epsilon': 439, - 'phi': 521, - 'gamma': 411, - 'eta': 603, - 'iota': 329, - 'phi1': 603, - 'kappa': 549, - 'lambda': 549, - 'mu': 576, - 'nu': 521, - 'omicron': 549, - 'pi': 549, - 'theta': 521, - 'rho': 549, - 'sigma': 603, - 'tau': 439, - 'upsilon': 576, - 'omega1': 713, - 'omega': 686, - 'xi': 493, - 'psi': 686, - 'zeta': 494, - 'braceleft': 480, - 'bar': 200, - 'braceright': 480, - 'similar': 549, - 'Euro': 750, - 'Upsilon1': 620, - 'minute': 247, - 'lessequal': 549, - 'fraction': 167, - 'infinity': 713, - 'florin': 500, - 'club': 753, - 'diamond': 753, - 'heart': 753, - 'spade': 753, - 'arrowboth': 1042, - 'arrowleft': 987, - 'arrowup': 603, - 'arrowright': 987, - 'arrowdown': 603, - 'degree': 400, - 'plusminus': 549, - 'second': 411, - 'greaterequal': 549, - 'multiply': 549, - 'proportional': 713, - 'partialdiff': 494, - 'bullet': 460, - 'divide': 549, - 'notequal': 549, - 'equivalence': 549, - 'approxequal': 549, - 'ellipsis': 1000, - 'arrowvertex': 603, - 'arrowhorizex': 1000, - 'carriagereturn': 658, - 'aleph': 823, - 'Ifraktur': 686, - 'Rfraktur': 795, - 'weierstrass': 987, - 'circlemultiply': 768, - 'circleplus': 768, - 'emptyset': 823, - 'intersection': 768, - 'union': 768, - 'propersuperset': 713, - 'reflexsuperset': 713, - 'notsubset': 713, - 'propersubset': 713, - 'reflexsubset': 713, - 'element': 713, - 'notelement': 713, - 'angle': 768, - 'gradient': 713, - 'registerserif': 790, - 'copyrightserif': 790, - 'trademarkserif': 890, - 'product': 823, - 'radical': 549, - 'dotmath': 250, - 'logicalnot': 713, - 'logicaland': 603, - 'logicalor': 603, - 'arrowdblboth': 1042, - 'arrowdblleft': 987, - 'arrowdblup': 603, - 'arrowdblright': 987, - 'arrowdbldown': 603, - 'lozenge': 494, - 'angleleft': 329, - 'registersans': 790, - 'copyrightsans': 790, - 'trademarksans': 786, - 'summation': 713, - 'parenlefttp': 384, - 'parenleftex': 384, - 'parenleftbt': 384, - 'bracketlefttp': 384, - 'bracketleftex': 384, - 'bracketleftbt': 384, - 'bracelefttp': 494, - 'braceleftmid': 494, - 'braceleftbt': 494, - 'braceex': 494, - 'angleright': 329, - 'integral': 274, - 'integraltp': 686, - 'integralex': 686, - 'integralbt': 686, - 'parenrighttp': 384, - 'parenrightex': 384, - 'parenrightbt': 384, - 'bracketrighttp': 384, - 'bracketrightex': 384, - 'bracketrightbt': 384, - 'bracerighttp': 494, - 'bracerightmid': 494, - 'bracerightbt': 494, - 'apple': 790 - }, - 'Times-Roman': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 408, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 564, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 278, - 'semicolon': 278, - 'less': 564, - 'equal': 564, - 'greater': 564, - 'question': 444, - 'at': 921, - 'A': 722, - 'B': 667, - 'C': 667, - 'D': 722, - 'E': 611, - 'F': 556, - 'G': 722, - 'H': 722, - 'I': 333, - 'J': 389, - 'K': 722, - 'L': 611, - 'M': 889, - 'N': 722, - 'O': 722, - 'P': 556, - 'Q': 722, - 'R': 667, - 'S': 556, - 'T': 611, - 'U': 722, - 'V': 722, - 'W': 944, - 'X': 722, - 'Y': 722, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 469, - 'underscore': 500, - 'quoteleft': 333, - 'a': 444, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 500, - 'i': 278, - 'j': 278, - 'k': 500, - 'l': 278, - 'm': 778, - 'n': 500, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 333, - 's': 389, - 't': 278, - 'u': 500, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 444, - 'braceleft': 480, - 'bar': 200, - 'braceright': 480, - 'asciitilde': 541, - 'exclamdown': 333, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 180, - 'quotedblleft': 444, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 453, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 444, - 'quotedblright': 444, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 444, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 889, - 'ordfeminine': 276, - 'Lslash': 611, - 'Oslash': 722, - 'OE': 889, - 'ordmasculine': 310, - 'ae': 667, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 500, - 'Idieresis': 333, - 'eacute': 444, - 'abreve': 444, - 'uhungarumlaut': 500, - 'ecaron': 444, - 'Ydieresis': 722, - 'divide': 564, - 'Yacute': 722, - 'Acircumflex': 722, - 'aacute': 444, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 444, - 'Uacute': 722, - 'uogonek': 500, - 'Edieresis': 611, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 760, - 'Emacron': 611, - 'ccaron': 444, - 'aring': 444, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 444, - 'Tcommaaccent': 611, - 'Cacute': 667, - 'atilde': 444, - 'Edotaccent': 611, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 667, - 'Gcommaaccent': 722, - 'ucircumflex': 500, - 'acircumflex': 444, - 'Amacron': 722, - 'rcaron': 333, - 'ccedilla': 444, - 'Zdotaccent': 611, - 'Thorn': 556, - 'Omacron': 722, - 'Racute': 667, - 'Sacute': 556, - 'dcaron': 588, - 'Umacron': 722, - 'uring': 500, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 564, - 'uacute': 500, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 611, - 'adieresis': 444, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 500, - 'umacron': 500, - 'Ncaron': 722, - 'Iacute': 333, - 'plusminus': 564, - 'brokenbar': 200, - 'registered': 760, - 'Gbreve': 722, - 'Idotaccent': 333, - 'summation': 600, - 'Egrave': 611, - 'racute': 333, - 'omacron': 500, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 326, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 444, - 'zacute': 444, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 444, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 500, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 611, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 344, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 980, - 'edotaccent': 444, - 'Igrave': 333, - 'Imacron': 333, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 500, - 'Uhungarumlaut': 722, - 'Eacute': 611, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 500, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 667, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 722, - 'zdotaccent': 444, - 'Ecaron': 611, - 'Iogonek': 333, - 'kcommaaccent': 500, - 'minus': 564, - 'Icircumflex': 333, - 'ncaron': 500, - 'tcommaaccent': 278, - 'logicalnot': 564, - 'odieresis': 500, - 'udieresis': 500, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 444, - 'ncommaaccent': 500, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-Bold': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 555, - 'numbersign': 500, - 'dollar': 500, - 'percent': 1000, - 'ampersand': 833, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 570, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 570, - 'equal': 570, - 'greater': 570, - 'question': 500, - 'at': 930, - 'A': 722, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 778, - 'I': 389, - 'J': 500, - 'K': 778, - 'L': 667, - 'M': 944, - 'N': 722, - 'O': 778, - 'P': 611, - 'Q': 778, - 'R': 722, - 'S': 556, - 'T': 667, - 'U': 722, - 'V': 722, - 'W': 1000, - 'X': 722, - 'Y': 722, - 'Z': 667, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 581, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 556, - 'c': 444, - 'd': 556, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 556, - 'i': 278, - 'j': 333, - 'k': 556, - 'l': 278, - 'm': 833, - 'n': 556, - 'o': 500, - 'p': 556, - 'q': 556, - 'r': 444, - 's': 389, - 't': 333, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 444, - 'braceleft': 394, - 'bar': 220, - 'braceright': 394, - 'asciitilde': 520, - 'exclamdown': 333, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 278, - 'quotedblleft': 500, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 540, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 300, - 'Lslash': 667, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 330, - 'ae': 722, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 556, - 'Idieresis': 389, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 556, - 'ecaron': 444, - 'Ydieresis': 722, - 'divide': 570, - 'Yacute': 722, - 'Acircumflex': 722, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 747, - 'Emacron': 667, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 667, - 'Cacute': 722, - 'atilde': 500, - 'Edotaccent': 667, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 500, - 'Amacron': 722, - 'rcaron': 444, - 'ccedilla': 444, - 'Zdotaccent': 667, - 'Thorn': 611, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 556, - 'dcaron': 672, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 300, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 570, - 'uacute': 556, - 'Tcaron': 667, - 'partialdiff': 494, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 389, - 'plusminus': 570, - 'brokenbar': 220, - 'registered': 747, - 'Gbreve': 778, - 'Idotaccent': 389, - 'summation': 600, - 'Egrave': 667, - 'racute': 444, - 'omacron': 500, - 'Zacute': 667, - 'Zcaron': 667, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 416, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 444, - 'zacute': 444, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 300, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 394, - 'Kcommaaccent': 778, - 'Lacute': 667, - 'trademark': 1000, - 'edotaccent': 444, - 'Igrave': 389, - 'Imacron': 389, - 'Lcaron': 667, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 444, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 722, - 'Lcommaaccent': 667, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 444, - 'Ecaron': 667, - 'Iogonek': 389, - 'kcommaaccent': 556, - 'minus': 570, - 'Icircumflex': 389, - 'ncaron': 556, - 'tcommaaccent': 333, - 'logicalnot': 570, - 'odieresis': 500, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 444, - 'ncommaaccent': 556, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-BoldItalic': { - 'space': 250, - 'exclam': 389, - 'quotedbl': 555, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 570, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 570, - 'equal': 570, - 'greater': 570, - 'question': 500, - 'at': 832, - 'A': 667, - 'B': 667, - 'C': 667, - 'D': 722, - 'E': 667, - 'F': 667, - 'G': 722, - 'H': 778, - 'I': 389, - 'J': 500, - 'K': 667, - 'L': 611, - 'M': 889, - 'N': 722, - 'O': 722, - 'P': 611, - 'Q': 722, - 'R': 667, - 'S': 556, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 889, - 'X': 667, - 'Y': 611, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 570, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 556, - 'i': 278, - 'j': 278, - 'k': 500, - 'l': 278, - 'm': 778, - 'n': 556, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 389, - 's': 389, - 't': 278, - 'u': 556, - 'v': 444, - 'w': 667, - 'x': 500, - 'y': 444, - 'z': 389, - 'braceleft': 348, - 'bar': 220, - 'braceright': 348, - 'asciitilde': 570, - 'exclamdown': 389, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 278, - 'quotedblleft': 500, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 500, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 944, - 'ordfeminine': 266, - 'Lslash': 611, - 'Oslash': 722, - 'OE': 944, - 'ordmasculine': 300, - 'ae': 722, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 500, - 'Idieresis': 389, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 556, - 'ecaron': 444, - 'Ydieresis': 611, - 'divide': 570, - 'Yacute': 611, - 'Acircumflex': 667, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 444, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 747, - 'Emacron': 667, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 611, - 'Cacute': 667, - 'atilde': 500, - 'Edotaccent': 667, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 667, - 'Gcommaaccent': 722, - 'ucircumflex': 556, - 'acircumflex': 500, - 'Amacron': 667, - 'rcaron': 389, - 'ccedilla': 444, - 'Zdotaccent': 611, - 'Thorn': 611, - 'Omacron': 722, - 'Racute': 667, - 'Sacute': 556, - 'dcaron': 608, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 570, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 444, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 389, - 'plusminus': 570, - 'brokenbar': 220, - 'registered': 747, - 'Gbreve': 722, - 'Idotaccent': 389, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 500, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 366, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 444, - 'zacute': 389, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 576, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 667, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 382, - 'Kcommaaccent': 667, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 444, - 'Igrave': 389, - 'Imacron': 389, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 556, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 667, - 'Lcommaaccent': 611, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 722, - 'zdotaccent': 389, - 'Ecaron': 667, - 'Iogonek': 389, - 'kcommaaccent': 500, - 'minus': 606, - 'Icircumflex': 389, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 606, - 'odieresis': 500, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 389, - 'ncommaaccent': 556, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-Italic': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 420, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 675, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 675, - 'equal': 675, - 'greater': 675, - 'question': 500, - 'at': 920, - 'A': 611, - 'B': 611, - 'C': 667, - 'D': 722, - 'E': 611, - 'F': 611, - 'G': 722, - 'H': 722, - 'I': 333, - 'J': 444, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 667, - 'O': 722, - 'P': 611, - 'Q': 722, - 'R': 611, - 'S': 500, - 'T': 556, - 'U': 722, - 'V': 611, - 'W': 833, - 'X': 611, - 'Y': 556, - 'Z': 556, - 'bracketleft': 389, - 'backslash': 278, - 'bracketright': 389, - 'asciicircum': 422, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 278, - 'g': 500, - 'h': 500, - 'i': 278, - 'j': 278, - 'k': 444, - 'l': 278, - 'm': 722, - 'n': 500, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 389, - 's': 389, - 't': 278, - 'u': 500, - 'v': 444, - 'w': 667, - 'x': 444, - 'y': 444, - 'z': 389, - 'braceleft': 400, - 'bar': 275, - 'braceright': 400, - 'asciitilde': 541, - 'exclamdown': 389, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 214, - 'quotedblleft': 556, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 523, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 556, - 'quotedblright': 556, - 'guillemotright': 500, - 'ellipsis': 889, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 889, - 'AE': 889, - 'ordfeminine': 276, - 'Lslash': 556, - 'Oslash': 722, - 'OE': 944, - 'ordmasculine': 310, - 'ae': 667, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 667, - 'germandbls': 500, - 'Idieresis': 333, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 500, - 'ecaron': 444, - 'Ydieresis': 556, - 'divide': 675, - 'Yacute': 556, - 'Acircumflex': 611, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 444, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 500, - 'Edieresis': 611, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 760, - 'Emacron': 611, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 667, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 556, - 'Cacute': 667, - 'atilde': 500, - 'Edotaccent': 611, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 611, - 'Gcommaaccent': 722, - 'ucircumflex': 500, - 'acircumflex': 500, - 'Amacron': 611, - 'rcaron': 389, - 'ccedilla': 444, - 'Zdotaccent': 556, - 'Thorn': 611, - 'Omacron': 722, - 'Racute': 611, - 'Sacute': 500, - 'dcaron': 544, - 'Umacron': 722, - 'uring': 500, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 611, - 'Abreve': 611, - 'multiply': 675, - 'uacute': 500, - 'Tcaron': 556, - 'partialdiff': 476, - 'ydieresis': 444, - 'Nacute': 667, - 'icircumflex': 278, - 'Ecircumflex': 611, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 500, - 'umacron': 500, - 'Ncaron': 667, - 'Iacute': 333, - 'plusminus': 675, - 'brokenbar': 275, - 'registered': 760, - 'Gbreve': 722, - 'Idotaccent': 333, - 'summation': 600, - 'Egrave': 611, - 'racute': 389, - 'omacron': 500, - 'Zacute': 556, - 'Zcaron': 556, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 300, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 611, - 'Adieresis': 611, - 'egrave': 444, - 'zacute': 389, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 500, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 611, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 500, - 'lcaron': 300, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 980, - 'edotaccent': 444, - 'Igrave': 333, - 'Imacron': 333, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 500, - 'Uhungarumlaut': 722, - 'Eacute': 611, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 500, - 'Scommaaccent': 500, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 500, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 667, - 'otilde': 500, - 'Rcommaaccent': 611, - 'Lcommaaccent': 556, - 'Atilde': 611, - 'Aogonek': 611, - 'Aring': 611, - 'Otilde': 722, - 'zdotaccent': 389, - 'Ecaron': 611, - 'Iogonek': 333, - 'kcommaaccent': 444, - 'minus': 675, - 'Icircumflex': 333, - 'ncaron': 500, - 'tcommaaccent': 278, - 'logicalnot': 675, - 'odieresis': 500, - 'udieresis': 500, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 389, - 'ncommaaccent': 500, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'ZapfDingbats': { - 'space': 278, - 'a1': 974, - 'a2': 961, - 'a202': 974, - 'a3': 980, - 'a4': 719, - 'a5': 789, - 'a119': 790, - 'a118': 791, - 'a117': 690, - 'a11': 960, - 'a12': 939, - 'a13': 549, - 'a14': 855, - 'a15': 911, - 'a16': 933, - 'a105': 911, - 'a17': 945, - 'a18': 974, - 'a19': 755, - 'a20': 846, - 'a21': 762, - 'a22': 761, - 'a23': 571, - 'a24': 677, - 'a25': 763, - 'a26': 760, - 'a27': 759, - 'a28': 754, - 'a6': 494, - 'a7': 552, - 'a8': 537, - 'a9': 577, - 'a10': 692, - 'a29': 786, - 'a30': 788, - 'a31': 788, - 'a32': 790, - 'a33': 793, - 'a34': 794, - 'a35': 816, - 'a36': 823, - 'a37': 789, - 'a38': 841, - 'a39': 823, - 'a40': 833, - 'a41': 816, - 'a42': 831, - 'a43': 923, - 'a44': 744, - 'a45': 723, - 'a46': 749, - 'a47': 790, - 'a48': 792, - 'a49': 695, - 'a50': 776, - 'a51': 768, - 'a52': 792, - 'a53': 759, - 'a54': 707, - 'a55': 708, - 'a56': 682, - 'a57': 701, - 'a58': 826, - 'a59': 815, - 'a60': 789, - 'a61': 789, - 'a62': 707, - 'a63': 687, - 'a64': 696, - 'a65': 689, - 'a66': 786, - 'a67': 787, - 'a68': 713, - 'a69': 791, - 'a70': 785, - 'a71': 791, - 'a72': 873, - 'a73': 761, - 'a74': 762, - 'a203': 762, - 'a75': 759, - 'a204': 759, - 'a76': 892, - 'a77': 892, - 'a78': 788, - 'a79': 784, - 'a81': 438, - 'a82': 138, - 'a83': 277, - 'a84': 415, - 'a97': 392, - 'a98': 392, - 'a99': 668, - 'a100': 668, - 'a89': 390, - 'a90': 390, - 'a93': 317, - 'a94': 317, - 'a91': 276, - 'a92': 276, - 'a205': 509, - 'a85': 509, - 'a206': 410, - 'a86': 410, - 'a87': 234, - 'a88': 234, - 'a95': 334, - 'a96': 334, - 'a101': 732, - 'a102': 544, - 'a103': 544, - 'a104': 910, - 'a106': 667, - 'a107': 760, - 'a108': 760, - 'a112': 776, - 'a111': 595, - 'a110': 694, - 'a109': 626, - 'a120': 788, - 'a121': 788, - 'a122': 788, - 'a123': 788, - 'a124': 788, - 'a125': 788, - 'a126': 788, - 'a127': 788, - 'a128': 788, - 'a129': 788, - 'a130': 788, - 'a131': 788, - 'a132': 788, - 'a133': 788, - 'a134': 788, - 'a135': 788, - 'a136': 788, - 'a137': 788, - 'a138': 788, - 'a139': 788, - 'a140': 788, - 'a141': 788, - 'a142': 788, - 'a143': 788, - 'a144': 788, - 'a145': 788, - 'a146': 788, - 'a147': 788, - 'a148': 788, - 'a149': 788, - 'a150': 788, - 'a151': 788, - 'a152': 788, - 'a153': 788, - 'a154': 788, - 'a155': 788, - 'a156': 788, - 'a157': 788, - 'a158': 788, - 'a159': 788, - 'a160': 894, - 'a161': 838, - 'a163': 1016, - 'a164': 458, - 'a196': 748, - 'a165': 924, - 'a192': 748, - 'a166': 918, - 'a167': 927, - 'a168': 928, - 'a169': 928, - 'a170': 834, - 'a171': 873, - 'a172': 828, - 'a173': 924, - 'a162': 924, - 'a174': 917, - 'a175': 930, - 'a176': 931, - 'a177': 463, - 'a178': 883, - 'a179': 836, - 'a193': 836, - 'a180': 867, - 'a199': 867, - 'a181': 696, - 'a200': 696, - 'a182': 874, - 'a201': 874, - 'a183': 760, - 'a184': 946, - 'a197': 771, - 'a185': 865, - 'a194': 771, - 'a198': 888, - 'a186': 967, - 'a195': 888, - 'a187': 831, - 'a188': 873, - 'a189': 927, - 'a190': 970, - 'a191': 918 - } -}; - -exports.Metrics = Metrics; -})); - - - - -var NetworkManager = (function NetworkManagerClosure() { - - var OK_RESPONSE = 200; - var PARTIAL_CONTENT_RESPONSE = 206; - - function NetworkManager(url, args) { - this.url = url; - args = args || {}; - this.isHttp = /^https?:/i.test(url); - this.httpHeaders = (this.isHttp && args.httpHeaders) || {}; - this.withCredentials = args.withCredentials || false; - this.getXhr = args.getXhr || - function NetworkManager_getXhr() { - return new XMLHttpRequest(); - }; - - this.currXhrId = 0; - this.pendingRequests = {}; - this.loadedRequests = {}; - } - - function getArrayBuffer(xhr) { - var data = xhr.response; - if (typeof data !== 'string') { - return data; - } - var length = data.length; - var array = new Uint8Array(length); - for (var i = 0; i < length; i++) { - array[i] = data.charCodeAt(i) & 0xFF; - } - return array.buffer; - } - - var supportsMozChunked = (function supportsMozChunkedClosure() { - try { - var x = new XMLHttpRequest(); - // Firefox 37- required .open() to be called before setting responseType. - // https://bugzilla.mozilla.org/show_bug.cgi?id=707484 - // Even though the URL is not visited, .open() could fail if the URL is - // blocked, e.g. via the connect-src CSP directive or the NoScript addon. - // When this error occurs, this feature detection method will mistakenly - // report that moz-chunked-arraybuffer is not supported in Firefox 37-. - x.open('GET', 'https://example.com'); - x.responseType = 'moz-chunked-arraybuffer'; - return x.responseType === 'moz-chunked-arraybuffer'; - } catch (e) { - return false; - } - })(); - - NetworkManager.prototype = { - requestRange: function NetworkManager_requestRange(begin, end, listeners) { - var args = { - begin: begin, - end: end - }; - for (var prop in listeners) { - args[prop] = listeners[prop]; - } - return this.request(args); - }, - - requestFull: function NetworkManager_requestFull(listeners) { - return this.request(listeners); - }, - - request: function NetworkManager_request(args) { - var xhr = this.getXhr(); - var xhrId = this.currXhrId++; - var pendingRequest = this.pendingRequests[xhrId] = { - xhr: xhr - }; - - xhr.open('GET', this.url); - xhr.withCredentials = this.withCredentials; - for (var property in this.httpHeaders) { - var value = this.httpHeaders[property]; - if (typeof value === 'undefined') { - continue; - } - xhr.setRequestHeader(property, value); - } - if (this.isHttp && 'begin' in args && 'end' in args) { - var rangeStr = args.begin + '-' + (args.end - 1); - xhr.setRequestHeader('Range', 'bytes=' + rangeStr); - pendingRequest.expectedStatus = 206; - } else { - pendingRequest.expectedStatus = 200; - } - - var useMozChunkedLoading = supportsMozChunked && !!args.onProgressiveData; - if (useMozChunkedLoading) { - xhr.responseType = 'moz-chunked-arraybuffer'; - pendingRequest.onProgressiveData = args.onProgressiveData; - pendingRequest.mozChunked = true; - } else { - xhr.responseType = 'arraybuffer'; - } - - if (args.onError) { - xhr.onerror = function(evt) { - args.onError(xhr.status); - }; - } - xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); - xhr.onprogress = this.onProgress.bind(this, xhrId); - - pendingRequest.onHeadersReceived = args.onHeadersReceived; - pendingRequest.onDone = args.onDone; - pendingRequest.onError = args.onError; - pendingRequest.onProgress = args.onProgress; - - xhr.send(null); - - return xhrId; - }, - - onProgress: function NetworkManager_onProgress(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - if (pendingRequest.mozChunked) { - var chunk = getArrayBuffer(pendingRequest.xhr); - pendingRequest.onProgressiveData(chunk); - } - - var onProgress = pendingRequest.onProgress; - if (onProgress) { - onProgress(evt); - } - }, - - onStateChange: function NetworkManager_onStateChange(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - var xhr = pendingRequest.xhr; - if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { - pendingRequest.onHeadersReceived(); - delete pendingRequest.onHeadersReceived; - } - - if (xhr.readyState !== 4) { - return; - } - - if (!(xhrId in this.pendingRequests)) { - // The XHR request might have been aborted in onHeadersReceived() - // callback, in which case we should abort request - return; - } - - delete this.pendingRequests[xhrId]; - - // success status == 0 can be on ftp, file and other protocols - if (xhr.status === 0 && this.isHttp) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - var xhrStatus = xhr.status || OK_RESPONSE; - - // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2: - // "A server MAY ignore the Range header". This means it's possible to - // get a 200 rather than a 206 response from a range request. - var ok_response_on_range_request = - xhrStatus === OK_RESPONSE && - pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; - - if (!ok_response_on_range_request && - xhrStatus !== pendingRequest.expectedStatus) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - - this.loadedRequests[xhrId] = true; - - var chunk = getArrayBuffer(xhr); - if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { - var rangeHeader = xhr.getResponseHeader('Content-Range'); - var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); - var begin = parseInt(matches[1], 10); - pendingRequest.onDone({ - begin: begin, - chunk: chunk - }); - } else if (pendingRequest.onProgressiveData) { - pendingRequest.onDone(null); - } else if (chunk) { - pendingRequest.onDone({ - begin: 0, - chunk: chunk - }); - } else if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - }, - - hasPendingRequests: function NetworkManager_hasPendingRequests() { - for (var xhrId in this.pendingRequests) { - return true; - } - return false; - }, - - getRequestXhr: function NetworkManager_getXhr(xhrId) { - return this.pendingRequests[xhrId].xhr; - }, - - isStreamingRequest: function NetworkManager_isStreamingRequest(xhrId) { - return !!(this.pendingRequests[xhrId].onProgressiveData); - }, - - isPendingRequest: function NetworkManager_isPendingRequest(xhrId) { - return xhrId in this.pendingRequests; - }, - - isLoadedRequest: function NetworkManager_isLoadedRequest(xhrId) { - return xhrId in this.loadedRequests; - }, - - abortAllRequests: function NetworkManager_abortAllRequests() { - for (var xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - }, - - abortRequest: function NetworkManager_abortRequest(xhrId) { - var xhr = this.pendingRequests[xhrId].xhr; - delete this.pendingRequests[xhrId]; - xhr.abort(); - } - }; - - return NetworkManager; -})(); - -(function (root, factory) { - { - factory((root.pdfjsCoreNetwork = {})); - } -}(this, function (exports) { - exports.NetworkManager = NetworkManager; -})); - - -(function (root, factory) { - { - factory((root.pdfjsSharedGlobal = {})); - } -}(this, function (exports) { - - var globalScope = (typeof window !== 'undefined') ? window : - (typeof global !== 'undefined') ? global : - (typeof self !== 'undefined') ? self : this; - - var isWorker = (typeof window === 'undefined'); - - // The global PDFJS object exposes the API - // In production, it will be declared outside a global wrapper - // In development, it will be declared here - if (!globalScope.PDFJS) { - globalScope.PDFJS = {}; - } - - if (typeof pdfjsVersion !== 'undefined') { - globalScope.PDFJS.version = pdfjsVersion; - } - if (typeof pdfjsVersion !== 'undefined') { - globalScope.PDFJS.build = pdfjsBuild; - } - - globalScope.PDFJS.pdfBug = false; - - exports.globalScope = globalScope; - exports.isWorker = isWorker; - exports.PDFJS = globalScope.PDFJS; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreBidi = {}), root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedGlobal) { - -var PDFJS = sharedGlobal.PDFJS; - -var bidi = PDFJS.bidi = (function bidiClosure() { - // Character types for symbols from 0000 to 00FF. - var baseTypes = [ - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S', 'WS', - 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET', 'ET', 'ET', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ON', 'CS', 'ON', 'CS', 'ON', 'EN', 'EN', 'EN', - 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'ON', 'ON', 'ON', 'ON', 'ON', - 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', - 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'ON', 'ON', 'ON', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'CS', 'ON', 'ET', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'L', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ET', 'ET', 'EN', 'EN', 'ON', 'L', 'ON', 'ON', 'ON', - 'EN', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L' - ]; - - // Character types for symbols from 0600 to 06FF - var arabicTypes = [ - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', - 'AN', 'ET', 'AN', 'AN', 'AL', 'AL', 'AL', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'ON', 'NSM', - 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL' - ]; - - function isOdd(i) { - return (i & 1) !== 0; - } - - function isEven(i) { - return (i & 1) === 0; - } - - function findUnequal(arr, start, value) { - for (var j = start, jj = arr.length; j < jj; ++j) { - if (arr[j] !== value) { - return j; - } - } - return j; - } - - function setValues(arr, start, end, value) { - for (var j = start; j < end; ++j) { - arr[j] = value; - } - } - - function reverseValues(arr, start, end) { - for (var i = start, j = end - 1; i < j; ++i, --j) { - var temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - } - - function createBidiText(str, isLTR, vertical) { - return { - str: str, - dir: (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl')) - }; - } - - // These are used in bidi(), which is called frequently. We re-use them on - // each call to avoid unnecessary allocations. - var chars = []; - var types = []; - - function bidi(str, startLevel, vertical) { - var isLTR = true; - var strLength = str.length; - if (strLength === 0 || vertical) { - return createBidiText(str, isLTR, vertical); - } - - // Get types and fill arrays - chars.length = strLength; - types.length = strLength; - var numBidi = 0; - - var i, ii; - for (i = 0; i < strLength; ++i) { - chars[i] = str.charAt(i); - - var charCode = str.charCodeAt(i); - var charType = 'L'; - if (charCode <= 0x00ff) { - charType = baseTypes[charCode]; - } else if (0x0590 <= charCode && charCode <= 0x05f4) { - charType = 'R'; - } else if (0x0600 <= charCode && charCode <= 0x06ff) { - charType = arabicTypes[charCode & 0xff]; - } else if (0x0700 <= charCode && charCode <= 0x08AC) { - charType = 'AL'; - } - if (charType === 'R' || charType === 'AL' || charType === 'AN') { - numBidi++; - } - types[i] = charType; - } - - // Detect the bidi method - // - If there are no rtl characters then no bidi needed - // - If less than 30% chars are rtl then string is primarily ltr - // - If more than 30% chars are rtl then string is primarily rtl - if (numBidi === 0) { - isLTR = true; - return createBidiText(str, isLTR); - } - - if (startLevel === -1) { - if ((strLength / numBidi) < 0.3) { - isLTR = true; - startLevel = 0; - } else { - isLTR = false; - startLevel = 1; - } - } - - var levels = []; - for (i = 0; i < strLength; ++i) { - levels[i] = startLevel; - } - - /* - X1-X10: skip most of this, since we are NOT doing the embeddings. - */ - var e = (isOdd(startLevel) ? 'R' : 'L'); - var sor = e; - var eor = sor; - - /* - W1. Examine each non-spacing mark (NSM) in the level run, and change the - type of the NSM to the type of the previous character. If the NSM is at the - start of the level run, it will get the type of sor. - */ - var lastType = sor; - for (i = 0; i < strLength; ++i) { - if (types[i] === 'NSM') { - types[i] = lastType; - } else { - lastType = types[i]; - } - } - - /* - W2. Search backwards from each instance of a European number until the - first strong type (R, L, AL, or sor) is found. If an AL is found, change - the type of the European number to Arabic number. - */ - lastType = sor; - var t; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = (lastType === 'AL') ? 'AN' : 'EN'; - } else if (t === 'R' || t === 'L' || t === 'AL') { - lastType = t; - } - } - - /* - W3. Change all ALs to R. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'AL') { - types[i] = 'R'; - } - } - - /* - W4. A single European separator between two European numbers changes to a - European number. A single common separator between two numbers of the same - type changes to that type: - */ - for (i = 1; i < strLength - 1; ++i) { - if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { - types[i] = 'EN'; - } - if (types[i] === 'CS' && - (types[i - 1] === 'EN' || types[i - 1] === 'AN') && - types[i + 1] === types[i - 1]) { - types[i] = types[i - 1]; - } - } - - /* - W5. A sequence of European terminators adjacent to European numbers changes - to all European numbers: - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'EN') { - // do before - var j; - for (j = i - 1; j >= 0; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - // do after - for (j = i + 1; j < strLength; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - } - } - - /* - W6. Otherwise, separators and terminators change to Other Neutral: - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { - types[i] = 'ON'; - } - } - - /* - W7. Search backwards from each instance of a European number until the - first strong type (R, L, or sor) is found. If an L is found, then change - the type of the European number to L. - */ - lastType = sor; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = ((lastType === 'L') ? 'L' : 'EN'); - } else if (t === 'R' || t === 'L') { - lastType = t; - } - } - - /* - N1. A sequence of neutrals takes the direction of the surrounding strong - text if the text on both sides has the same direction. European and Arabic - numbers are treated as though they were R. Start-of-level-run (sor) and - end-of-level-run (eor) are used at level run boundaries. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - var end = findUnequal(types, i + 1, 'ON'); - var before = sor; - if (i > 0) { - before = types[i - 1]; - } - - var after = eor; - if (end + 1 < strLength) { - after = types[end + 1]; - } - if (before !== 'L') { - before = 'R'; - } - if (after !== 'L') { - after = 'R'; - } - if (before === after) { - setValues(types, i, end, before); - } - i = end - 1; // reset to end (-1 so next iteration is ok) - } - } - - /* - N2. Any remaining neutrals take the embedding direction. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - types[i] = e; - } - } - - /* - I1. For all characters with an even (left-to-right) embedding direction, - those of type R go up one level and those of type AN or EN go up two - levels. - I2. For all characters with an odd (right-to-left) embedding direction, - those of type L, EN or AN go up one level. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (isEven(levels[i])) { - if (t === 'R') { - levels[i] += 1; - } else if (t === 'AN' || t === 'EN') { - levels[i] += 2; - } - } else { // isOdd - if (t === 'L' || t === 'AN' || t === 'EN') { - levels[i] += 1; - } - } - } - - /* - L1. On each line, reset the embedding level of the following characters to - the paragraph embedding level: - - segment separators, - paragraph separators, - any sequence of whitespace characters preceding a segment separator or - paragraph separator, and any sequence of white space characters at the end - of the line. - */ - - // don't bother as text is only single line - - /* - L2. From the highest level found in the text to the lowest odd level on - each line, reverse any contiguous sequence of characters that are at that - level or higher. - */ - - // find highest level & lowest odd level - var highestLevel = -1; - var lowestOddLevel = 99; - var level; - for (i = 0, ii = levels.length; i < ii; ++i) { - level = levels[i]; - if (highestLevel < level) { - highestLevel = level; - } - if (lowestOddLevel > level && isOdd(level)) { - lowestOddLevel = level; - } - } - - // now reverse between those limits - for (level = highestLevel; level >= lowestOddLevel; --level) { - // find segments to reverse - var start = -1; - for (i = 0, ii = levels.length; i < ii; ++i) { - if (levels[i] < level) { - if (start >= 0) { - reverseValues(chars, start, i); - start = -1; - } - } else if (start < 0) { - start = i; - } - } - if (start >= 0) { - reverseValues(chars, start, levels.length); - } - } - - /* - L3. Combining marks applied to a right-to-left base character will at this - point precede their base character. If the rendering engine expects them to - follow the base characters in the final display process, then the ordering - of the marks and the base character must be reversed. - */ - - // don't bother for now - - /* - L4. A character that possesses the mirrored property as specified by - Section 4.7, Mirrored, must be depicted by a mirrored glyph if the resolved - directionality of that character is R. - */ - - // don't mirror as characters are already mirrored in the pdf - - // Finally, return string - for (i = 0, ii = chars.length; i < ii; ++i) { - var ch = chars[i]; - if (ch === '<' || ch === '>') { - chars[i] = ''; - } - } - return createBidiText(chars.join(''), isLTR); - } - - return bidi; -})(); - -exports.bidi = bidi; -})); - - -(function (root, factory) { - { - factory((root.pdfjsSharedUtil = {}), root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedGlobal) { - -var PDFJS = sharedGlobal.PDFJS; -var globalScope = sharedGlobal.globalScope; - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- treated as warnings. -function deprecated(details) { - warn('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - return new URL(url, baseUrl).href; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -/** - * Adds various attributes (href, title, target, rel) to hyperlinks. - * @param {HTMLLinkElement} link - The link element. - * @param {Object} params - An object with the properties: - * @param {string} params.url - An absolute URL. - */ -function addLinkAttributes(link, params) { - var url = params && params.url; - link.href = link.title = (url ? removeNullCharacters(url) : ''); - - if (url) { - if (isExternalLinkTargetSet()) { - link.target = LinkTargetStringMap[PDFJS.externalLinkTarget]; - } - // Strip referrer from the URL. - link.rel = PDFJS.externalLinkRel; - } -} -PDFJS.addLinkAttributes = addLinkAttributes; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var LinkTarget = PDFJS.LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -function isExternalLinkTargetSet() { - if (PDFJS.openExternalLinksInNewWindow) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - if (PDFJS.externalLinkTarget === LinkTarget.NONE) { - PDFJS.externalLinkTarget = LinkTarget.BLANK; - } - // Reset the deprecated parameter, to suppress further warnings. - PDFJS.openExternalLinksInNewWindow = false; - } - switch (PDFJS.externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } - warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - PDFJS.externalLinkTarget = LinkTarget.NONE; - return false; -} -PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - -var NullCharactersRegExp = /\x00/g; - -function removeNullCharacters(str) { - if (typeof str !== 'string') { - warn('The argument for removeNullCharacters must be a string.'); - return str; - } - return str.replace(NullCharactersRegExp, ''); -} -PDFJS.removeNullCharacters = removeNullCharacters; - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - - // Lazy test if the userAgent support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -exports.Uint32ArrayView = Uint32ArrayView; - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - var ROMAN_NUMBER_MAP = [ - '', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', - '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', - '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX' - ]; - /** - * Converts positive integers to (upper case) Roman numerals. - * @param {integer} number - The number that should be converted. - * @param {boolean} lowerCase - Indicates if the result should be converted - * to lower case letters. The default is false. - * @return {string} The resulting Roman number. - */ - Util.toRoman = function Util_toRoman(number, lowerCase) { - assert(isInt(number) && number > 0, - 'The number should be a positive integer.'); - var pos, romanBuf = []; - // Thousands - while (number >= 1000) { - number -= 1000; - romanBuf.push('M'); - } - // Hundreds - pos = (number / 100) | 0; - number %= 100; - romanBuf.push(ROMAN_NUMBER_MAP[pos]); - // Tens - pos = (number / 10) | 0; - number %= 10; - romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); - // Ones - romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); - - var romanStr = romanBuf.join(''); - return (lowerCase ? romanStr.toLowerCase() : romanStr); - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isArray(v) { - return v instanceof Array; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - /* jshint ignore:start */ - - // feature detect for URL constructor - var hasWorkingUrl = false; - try { - if (typeof URL === 'function' && - typeof URL.prototype === 'object' && - ('origin' in URL.prototype)) { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } - } catch(e) { } - - if (hasWorkingUrl) - return; - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' == h) { - invalid.call(this) - } - // XXX - return h.toLowerCase() - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF = undefined, - ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message) - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' == c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' == this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF == c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c) - break loop; - } - break; - - case 'scheme data': - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' == c && '/' == input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue - } - break; - - case 'relative': - this._isRelative = true; - if ('file' != this._scheme) - this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' == c || '\\' == c) { - if ('\\' == c) - err('\\ is an invalid code point.'); - state = 'relative slash'; - } else if ('?' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1] - var nextNextC = input[cursor+2] - if ( - 'file' != this._scheme || !ALPHA.test(c) || - (nextC != ':' && nextC != '|') || - (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' == c || '\\' == c) { - if ('\\' == c) { - err('\\ is an invalid code point.'); - } - if ('file' == this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' == c) { - state = 'authority second slash'; - } else { - err("Expected '/', got: " + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' != c && '\\' != c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' == c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' == cp || '\n' == cp || '\r' == cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' == cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - (null !== this._password) ? this._password += tempC : this._username += tempC; - } - buffer = ''; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { - state = 'relative path'; - } else if (buffer.length == 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' == c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' == stateOverride) { - break loop; - } - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' != c && '\n' != c && '\r' != c) { - if ('[' == c) { - seenBracket = true; - } else if (']' == c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { - if ('' != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' == c) - err("'\\' not allowed in path."); - state = 'relative path'; - if ('/' != c && '\\' != c) { - continue; - } - break; - - case 'relative path': - if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) { - if ('\\' == c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' == buffer) { - this._path.pop(); - if ('/' != c && '\\' != c) { - this._path.push(''); - } - } else if ('.' == buffer && '/' != c && '\\' != c) { - this._path.push(''); - } else if ('.' != buffer) { - if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' != c && '\n' != c && '\r' != c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function jURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof jURL)) - base = new jURL(String(base)); - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) - return this._url; - - var authority = ''; - if ('' != this._username || null != this._password) { - authority = this._username + - (null != this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) - return; - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) - return; - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' == this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) - return; - this._query = '?'; - if ('?' == search[0]) - search = search.slice(1); - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' == this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) - return; - this._fragment = '#'; - if ('#' == hash[0]) - hash = hash.slice(1); - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = jURL; - /* jshint ignore:end */ -})(globalScope); - -exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; -exports.IDENTITY_MATRIX = IDENTITY_MATRIX; -exports.OPS = OPS; -exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; -exports.AnnotationBorderStyleType = AnnotationBorderStyleType; -exports.AnnotationFlag = AnnotationFlag; -exports.AnnotationType = AnnotationType; -exports.FontType = FontType; -exports.ImageKind = ImageKind; -exports.InvalidPDFException = InvalidPDFException; -exports.LinkTarget = LinkTarget; -exports.LinkTargetStringMap = LinkTargetStringMap; -exports.MessageHandler = MessageHandler; -exports.MissingDataException = MissingDataException; -exports.MissingPDFException = MissingPDFException; -exports.NotImplementedException = NotImplementedException; -exports.PasswordException = PasswordException; -exports.PasswordResponses = PasswordResponses; -exports.StatTimer = StatTimer; -exports.StreamType = StreamType; -exports.TextRenderingMode = TextRenderingMode; -exports.UnexpectedResponseException = UnexpectedResponseException; -exports.UnknownErrorException = UnknownErrorException; -exports.Util = Util; -exports.XRefParseException = XRefParseException; -exports.assert = assert; -exports.bytesToString = bytesToString; -exports.combineUrl = combineUrl; -exports.createPromiseCapability = createPromiseCapability; -exports.deprecated = deprecated; -exports.error = error; -exports.info = info; -exports.isArray = isArray; -exports.isArrayBuffer = isArrayBuffer; -exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; -exports.isExternalLinkTargetSet = isExternalLinkTargetSet; -exports.isInt = isInt; -exports.isNum = isNum; -exports.isString = isString; -exports.isValidUrl = isValidUrl; -exports.addLinkAttributes = addLinkAttributes; -exports.loadJpegStream = loadJpegStream; -exports.log2 = log2; -exports.readInt8 = readInt8; -exports.readUint16 = readUint16; -exports.readUint32 = readUint32; -exports.removeNullCharacters = removeNullCharacters; -exports.shadow = shadow; -exports.string32 = string32; -exports.stringToBytes = stringToBytes; -exports.stringToPDFString = stringToPDFString; -exports.stringToUTF8String = stringToUTF8String; -exports.utf8StringToString = utf8StringToString; -exports.warn = warn; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreChunkedStream = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var MissingDataException = sharedUtil.MissingDataException; -var assert = sharedUtil.assert; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var isInt = sharedUtil.isInt; -var isEmptyObj = sharedUtil.isEmptyObj; - -var ChunkedStream = (function ChunkedStreamClosure() { - function ChunkedStream(length, chunkSize, manager) { - this.bytes = new Uint8Array(length); - this.start = 0; - this.pos = 0; - this.end = length; - this.chunkSize = chunkSize; - this.loadedChunks = []; - this.numChunksLoaded = 0; - this.numChunks = Math.ceil(length / chunkSize); - this.manager = manager; - this.progressiveDataLength = 0; - this.lastSuccessfulEnsureByteChunk = -1; // a single-entry cache - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - ChunkedStream.prototype = { - - getMissingChunks: function ChunkedStream_getMissingChunks() { - var chunks = []; - for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { - if (!this.loadedChunks[chunk]) { - chunks.push(chunk); - } - } - return chunks; - }, - - getBaseStreams: function ChunkedStream_getBaseStreams() { - return [this]; - }, - - allChunksLoaded: function ChunkedStream_allChunksLoaded() { - return this.numChunksLoaded === this.numChunks; - }, - - onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { - var end = begin + chunk.byteLength; - - assert(begin % this.chunkSize === 0, 'Bad begin offset: ' + begin); - // Using this.length is inaccurate here since this.start can be moved - // See ChunkedStream.moveStart() - var length = this.bytes.length; - assert(end % this.chunkSize === 0 || end === length, - 'Bad end offset: ' + end); - - this.bytes.set(new Uint8Array(chunk), begin); - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - var curChunk; - - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - onReceiveProgressiveData: - function ChunkedStream_onReceiveProgressiveData(data) { - var position = this.progressiveDataLength; - var beginChunk = Math.floor(position / this.chunkSize); - - this.bytes.set(new Uint8Array(data), position); - position += data.byteLength; - this.progressiveDataLength = position; - var endChunk = position >= this.end ? this.numChunks : - Math.floor(position / this.chunkSize); - var curChunk; - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - ensureByte: function ChunkedStream_ensureByte(pos) { - var chunk = Math.floor(pos / this.chunkSize); - if (chunk === this.lastSuccessfulEnsureByteChunk) { - return; - } - - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(pos, pos + 1); - } - this.lastSuccessfulEnsureByteChunk = chunk; - }, - - ensureRange: function ChunkedStream_ensureRange(begin, end) { - if (begin >= end) { - return; - } - - if (end <= this.progressiveDataLength) { - return; - } - - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(begin, end); - } - } - }, - - nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { - var chunk, numChunks = this.numChunks; - for (var i = 0; i < numChunks; ++i) { - chunk = (beginChunk + i) % numChunks; // Wrap around to beginning - if (!this.loadedChunks[chunk]) { - return chunk; - } - } - return null; - }, - - hasChunk: function ChunkedStream_hasChunk(chunk) { - return !!this.loadedChunks[chunk]; - }, - - get length() { - return this.end - this.start; - }, - - get isEmpty() { - return this.length === 0; - }, - - getByte: function ChunkedStream_getByte() { - var pos = this.pos; - if (pos >= this.end) { - return -1; - } - this.ensureByte(pos); - return this.bytes[this.pos++]; - }, - - getUint16: function ChunkedStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - - getInt32: function ChunkedStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - - // returns subarray of original buffer - // should only be read - getBytes: function ChunkedStream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - this.ensureRange(pos, strEnd); - return bytes.subarray(pos, strEnd); - } - - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.ensureRange(pos, end); - - this.pos = end; - return bytes.subarray(pos, end); - }, - - peekByte: function ChunkedStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - - peekBytes: function ChunkedStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - - getByteRange: function ChunkedStream_getBytes(begin, end) { - this.ensureRange(begin, end); - return this.bytes.subarray(begin, end); - }, - - skip: function ChunkedStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - - reset: function ChunkedStream_reset() { - this.pos = this.start; - }, - - moveStart: function ChunkedStream_moveStart() { - this.start = this.pos; - }, - - makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { - this.ensureRange(start, start + length); - - function ChunkedStreamSubstream() {} - ChunkedStreamSubstream.prototype = Object.create(this); - ChunkedStreamSubstream.prototype.getMissingChunks = function() { - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(this.start / chunkSize); - var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; - var missingChunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - missingChunks.push(chunk); - } - } - return missingChunks; - }; - var subStream = new ChunkedStreamSubstream(); - subStream.pos = subStream.start = start; - subStream.end = start + length || this.end; - subStream.dict = dict; - return subStream; - }, - - isStream: true - }; - - return ChunkedStream; -})(); - -var ChunkedStreamManager = (function ChunkedStreamManagerClosure() { - - function ChunkedStreamManager(length, chunkSize, url, args) { - this.stream = new ChunkedStream(length, chunkSize, this); - this.length = length; - this.chunkSize = chunkSize; - this.url = url; - this.disableAutoFetch = args.disableAutoFetch; - var msgHandler = this.msgHandler = args.msgHandler; - - if (args.chunkedViewerLoading) { - msgHandler.on('OnDataRange', this.onReceiveData.bind(this)); - msgHandler.on('OnDataProgress', this.onProgress.bind(this)); - this.sendRequest = function ChunkedStreamManager_sendRequest(begin, end) { - msgHandler.send('RequestDataRange', { begin: begin, end: end }); - }; - } else { - - var getXhr = function getXhr() { - return new XMLHttpRequest(); - }; - this.networkManager = new NetworkManager(this.url, { - getXhr: getXhr, - httpHeaders: args.httpHeaders, - withCredentials: args.withCredentials - }); - this.sendRequest = function ChunkedStreamManager_sendRequest(begin, end) { - this.networkManager.requestRange(begin, end, { - onDone: this.onReceiveData.bind(this), - onProgress: this.onProgress.bind(this) - }); - }; - } - - this.currRequestId = 0; - - this.chunksNeededByRequest = {}; - this.requestsByChunk = {}; - this.promisesByRequest = {}; - this.progressiveDataLength = 0; - - this._loadedStreamCapability = createPromiseCapability(); - - if (args.initialData) { - this.onReceiveData({chunk: args.initialData}); - } - } - - ChunkedStreamManager.prototype = { - onLoadedStream: function ChunkedStreamManager_getLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - // Get all the chunks that are not yet loaded and groups them into - // contiguous ranges to load in as few requests as possible - requestAllChunks: function ChunkedStreamManager_requestAllChunks() { - var missingChunks = this.stream.getMissingChunks(); - this._requestChunks(missingChunks); - return this._loadedStreamCapability.promise; - }, - - _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { - var requestId = this.currRequestId++; - - var chunksNeeded; - var i, ii; - this.chunksNeededByRequest[requestId] = chunksNeeded = {}; - for (i = 0, ii = chunks.length; i < ii; i++) { - if (!this.stream.hasChunk(chunks[i])) { - chunksNeeded[chunks[i]] = true; - } - } - - if (isEmptyObj(chunksNeeded)) { - return Promise.resolve(); - } - - var capability = createPromiseCapability(); - this.promisesByRequest[requestId] = capability; - - var chunksToRequest = []; - for (var chunk in chunksNeeded) { - chunk = chunk | 0; - if (!(chunk in this.requestsByChunk)) { - this.requestsByChunk[chunk] = []; - chunksToRequest.push(chunk); - } - this.requestsByChunk[chunk].push(requestId); - } - - if (!chunksToRequest.length) { - return capability.promise; - } - - var groupedChunksToRequest = this.groupChunks(chunksToRequest); - - for (i = 0; i < groupedChunksToRequest.length; ++i) { - var groupedChunk = groupedChunksToRequest[i]; - var begin = groupedChunk.beginChunk * this.chunkSize; - var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); - this.sendRequest(begin, end); - } - - return capability.promise; - }, - - getStream: function ChunkedStreamManager_getStream() { - return this.stream; - }, - - // Loads any chunks in the requested range that are not yet loaded - requestRange: function ChunkedStreamManager_requestRange(begin, end) { - - end = Math.min(end, this.length); - - var beginChunk = this.getBeginChunk(begin); - var endChunk = this.getEndChunk(end); - - var chunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - chunks.push(chunk); - } - - return this._requestChunks(chunks); - }, - - requestRanges: function ChunkedStreamManager_requestRanges(ranges) { - ranges = ranges || []; - var chunksToRequest = []; - - for (var i = 0; i < ranges.length; i++) { - var beginChunk = this.getBeginChunk(ranges[i].begin); - var endChunk = this.getEndChunk(ranges[i].end); - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (chunksToRequest.indexOf(chunk) < 0) { - chunksToRequest.push(chunk); - } - } - } - - chunksToRequest.sort(function(a, b) { return a - b; }); - return this._requestChunks(chunksToRequest); - }, - - // Groups a sorted array of chunks into as few contiguous larger - // chunks as possible - groupChunks: function ChunkedStreamManager_groupChunks(chunks) { - var groupedChunks = []; - var beginChunk = -1; - var prevChunk = -1; - for (var i = 0; i < chunks.length; ++i) { - var chunk = chunks[i]; - - if (beginChunk < 0) { - beginChunk = chunk; - } - - if (prevChunk >= 0 && prevChunk + 1 !== chunk) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: prevChunk + 1 }); - beginChunk = chunk; - } - if (i + 1 === chunks.length) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: chunk + 1 }); - } - - prevChunk = chunk; - } - return groupedChunks; - }, - - onProgress: function ChunkedStreamManager_onProgress(args) { - var bytesLoaded = (this.stream.numChunksLoaded * this.chunkSize + - args.loaded); - this.msgHandler.send('DocProgress', { - loaded: bytesLoaded, - total: this.length - }); - }, - - onReceiveData: function ChunkedStreamManager_onReceiveData(args) { - var chunk = args.chunk; - var isProgressive = args.begin === undefined; - var begin = isProgressive ? this.progressiveDataLength : args.begin; - var end = begin + chunk.byteLength; - - var beginChunk = Math.floor(begin / this.chunkSize); - var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : - Math.ceil(end / this.chunkSize); - - if (isProgressive) { - this.stream.onReceiveProgressiveData(chunk); - this.progressiveDataLength = end; - } else { - this.stream.onReceiveData(begin, chunk); - } - - if (this.stream.allChunksLoaded()) { - this._loadedStreamCapability.resolve(this.stream); - } - - var loadedRequests = []; - var i, requestId; - for (chunk = beginChunk; chunk < endChunk; ++chunk) { - // The server might return more chunks than requested - var requestIds = this.requestsByChunk[chunk] || []; - delete this.requestsByChunk[chunk]; - - for (i = 0; i < requestIds.length; ++i) { - requestId = requestIds[i]; - var chunksNeeded = this.chunksNeededByRequest[requestId]; - if (chunk in chunksNeeded) { - delete chunksNeeded[chunk]; - } - - if (!isEmptyObj(chunksNeeded)) { - continue; - } - - loadedRequests.push(requestId); - } - } - - // If there are no pending requests, automatically fetch the next - // unfetched chunk of the PDF - if (!this.disableAutoFetch && isEmptyObj(this.requestsByChunk)) { - var nextEmptyChunk; - if (this.stream.numChunksLoaded === 1) { - // This is a special optimization so that after fetching the first - // chunk, rather than fetching the second chunk, we fetch the last - // chunk. - var lastChunk = this.stream.numChunks - 1; - if (!this.stream.hasChunk(lastChunk)) { - nextEmptyChunk = lastChunk; - } - } else { - nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); - } - if (isInt(nextEmptyChunk)) { - this._requestChunks([nextEmptyChunk]); - } - } - - for (i = 0; i < loadedRequests.length; ++i) { - requestId = loadedRequests[i]; - var capability = this.promisesByRequest[requestId]; - delete this.promisesByRequest[requestId]; - capability.resolve(); - } - - this.msgHandler.send('DocProgress', { - loaded: this.stream.numChunksLoaded * this.chunkSize, - total: this.length - }); - }, - - onError: function ChunkedStreamManager_onError(err) { - this._loadedStreamCapability.reject(err); - }, - - getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { - var chunk = Math.floor(begin / this.chunkSize); - return chunk; - }, - - getEndChunk: function ChunkedStreamManager_getEndChunk(end) { - var chunk = Math.floor((end - 1) / this.chunkSize) + 1; - return chunk; - }, - - abort: function ChunkedStreamManager_abort() { - if (this.networkManager) { - this.networkManager.abortAllRequests(); - } - for(var requestId in this.promisesByRequest) { - var capability = this.promisesByRequest[requestId]; - capability.reject(new Error('Request was aborted')); - } - } - }; - - return ChunkedStreamManager; -})(); - -exports.ChunkedStream = ChunkedStream; -exports.ChunkedStreamManager = ChunkedStreamManager; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreJbig2 = {}), root.pdfjsSharedUtil, - root.pdfjsCoreArithmeticDecoder); - } -}(this, function (exports, sharedUtil, coreArithmeticDecoder) { - -var error = sharedUtil.error; -var log2 = sharedUtil.log2; -var readInt8 = sharedUtil.readInt8; -var readUint16 = sharedUtil.readUint16; -var readUint32 = sharedUtil.readUint32; -var shadow = sharedUtil.shadow; -var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder; - -var Jbig2Image = (function Jbig2ImageClosure() { - // Utility data structures - function ContextCache() {} - - ContextCache.prototype = { - getContexts: function(id) { - if (id in this) { - return this[id]; - } - return (this[id] = new Int8Array(1 << 16)); - } - }; - - function DecodingContext(data, start, end) { - this.data = data; - this.start = start; - this.end = end; - } - - DecodingContext.prototype = { - get decoder() { - var decoder = new ArithmeticDecoder(this.data, this.start, this.end); - return shadow(this, 'decoder', decoder); - }, - get contextCache() { - var cache = new ContextCache(); - return shadow(this, 'contextCache', cache); - } - }; - - // Annex A. Arithmetic Integer Decoding Procedure - // A.2 Procedure for decoding values - function decodeInteger(contextCache, procedure, decoder) { - var contexts = contextCache.getContexts(procedure); - var prev = 1; - - function readBits(length) { - var v = 0; - for (var i = 0; i < length; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev < 256 ? (prev << 1) | bit : - (((prev << 1) | bit) & 511) | 256); - v = (v << 1) | bit; - } - return v >>> 0; - } - - var sign = readBits(1); - var value = readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(32) + 4436) : - readBits(12) + 340) : - readBits(8) + 84) : - readBits(6) + 20) : - readBits(4) + 4) : - readBits(2); - return (sign === 0 ? value : (value > 0 ? -value : null)); - } - - // A.3 The IAID decoding procedure - function decodeIAID(contextCache, decoder, codeLength) { - var contexts = contextCache.getContexts('IAID'); - - var prev = 1; - for (var i = 0; i < codeLength; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev << 1) | bit; - } - if (codeLength < 31) { - return prev & ((1 << codeLength) - 1); - } - return prev & 0x7FFFFFFF; - } - - // 7.3 Segment types - var SegmentTypes = [ - 'SymbolDictionary', null, null, null, 'IntermediateTextRegion', null, - 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null, - null, null, null, null, null, 'patternDictionary', null, null, null, - 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion', - 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null, - null, null, null, null, null, 'IntermediateGenericRegion', null, - 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion', - 'IntermediateGenericRefinementRegion', null, - 'ImmediateGenericRefinementRegion', - 'ImmediateLosslessGenericRefinementRegion', null, null, null, null, - 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles', - 'Tables', null, null, null, null, null, null, null, null, - 'Extension' - ]; - - var CodingTemplates = [ - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: 2, y: -1}, - {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: 2, y: -2}, - {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, - {x: 2, y: -1}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -2, y: 0}, - {x: -1, y: 0}], - [{x: -3, y: -1}, {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, - {x: 1, y: -1}, {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}] - ]; - - var RefinementTemplates = [ - { - coding: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, - {x: 1, y: 0}, {x: -1, y: 1}, {x: 0, y: 1}, {x: 1, y: 1}] - }, - { - coding: [{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, {x: 1, y: 0}, - {x: 0, y: 1}, {x: 1, y: 1}] - } - ]; - - // See 6.2.5.7 Decoding the bitmap. - var ReusedContexts = [ - 0x9B25, // 10011 0110010 0101 - 0x0795, // 0011 110010 101 - 0x00E5, // 001 11001 01 - 0x0195 // 011001 0101 - ]; - - var RefinementReusedContexts = [ - 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference) - 0x0008 // '0000' + '001000' - ]; - - function decodeBitmapTemplate0(width, height, decodingContext) { - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - var contextLabel, i, j, pixel, row, row1, row2, bitmap = []; - - // ...ooooo.... - // ..ooooooo... Context template for current pixel (X) - // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel) - var OLD_PIXEL_MASK = 0x7BF7; // 01111 0111111 0111 - - for (i = 0; i < height; i++) { - row = bitmap[i] = new Uint8Array(width); - row1 = (i < 1) ? row : bitmap[i - 1]; - row2 = (i < 2) ? row : bitmap[i - 2]; - - // At the beginning of each row: - // Fill contextLabel with pixels that are above/right of (X) - contextLabel = (row2[0] << 13) | (row2[1] << 12) | (row2[2] << 11) | - (row1[0] << 7) | (row1[1] << 6) | (row1[2] << 5) | - (row1[3] << 4); - - for (j = 0; j < width; j++) { - row[j] = pixel = decoder.readBit(contexts, contextLabel); - - // At each pixel: Clear contextLabel pixels that are shifted - // out of the context, then add new ones. - contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) | - (j + 3 < width ? row2[j + 3] << 11 : 0) | - (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; - } - } - - return bitmap; - } - - // 6.2 Generic Region Decoding Procedure - function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, - decodingContext) { - if (mmr) { - error('JBIG2 error: MMR encoding is not supported'); - } - - // Use optimized version for the most common case - if (templateIndex === 0 && !skip && !prediction && at.length === 4 && - at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && - at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { - return decodeBitmapTemplate0(width, height, decodingContext); - } - - var useskip = !!skip; - var template = CodingTemplates[templateIndex].concat(at); - - // Sorting is non-standard, and it is not required. But sorting increases - // the number of template bits that can be reused from the previous - // contextLabel in the main loop. - template.sort(function (a, b) { - return (a.y - b.y) || (a.x - b.x); - }); - - var templateLength = template.length; - var templateX = new Int8Array(templateLength); - var templateY = new Int8Array(templateLength); - var changingTemplateEntries = []; - var reuseMask = 0, minX = 0, maxX = 0, minY = 0; - var c, k; - - for (k = 0; k < templateLength; k++) { - templateX[k] = template[k].x; - templateY[k] = template[k].y; - minX = Math.min(minX, template[k].x); - maxX = Math.max(maxX, template[k].x); - minY = Math.min(minY, template[k].y); - // Check if the template pixel appears in two consecutive context labels, - // so it can be reused. Otherwise, we add it to the list of changing - // template entries. - if (k < templateLength - 1 && - template[k].y === template[k + 1].y && - template[k].x === template[k + 1].x - 1) { - reuseMask |= 1 << (templateLength - 1 - k); - } else { - changingTemplateEntries.push(k); - } - } - var changingEntriesLength = changingTemplateEntries.length; - - var changingTemplateX = new Int8Array(changingEntriesLength); - var changingTemplateY = new Int8Array(changingEntriesLength); - var changingTemplateBit = new Uint16Array(changingEntriesLength); - for (c = 0; c < changingEntriesLength; c++) { - k = changingTemplateEntries[c]; - changingTemplateX[c] = template[k].x; - changingTemplateY[c] = template[k].y; - changingTemplateBit[c] = 1 << (templateLength - 1 - k); - } - - // Get the safe bounding box edges from the width, height, minX, maxX, minY - var sbb_left = -minX; - var sbb_top = -minY; - var sbb_right = width - maxX; - - var pseudoPixelContext = ReusedContexts[templateIndex]; - var row = new Uint8Array(width); - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - - var ltp = 0, j, i0, j0, contextLabel = 0, bit, shift; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - bitmap.push(row); // duplicate previous row - continue; - } - } - row = new Uint8Array(row); - bitmap.push(row); - for (j = 0; j < width; j++) { - if (useskip && skip[i][j]) { - row[j] = 0; - continue; - } - // Are we in the middle of a scanline, so we can reuse contextLabel - // bits? - if (j >= sbb_left && j < sbb_right && i >= sbb_top) { - // If yes, we can just shift the bits that are reusable and only - // fetch the remaining ones. - contextLabel = (contextLabel << 1) & reuseMask; - for (k = 0; k < changingEntriesLength; k++) { - i0 = i + changingTemplateY[k]; - j0 = j + changingTemplateX[k]; - bit = bitmap[i0][j0]; - if (bit) { - bit = changingTemplateBit[k]; - contextLabel |= bit; - } - } - } else { - // compute the contextLabel from scratch - contextLabel = 0; - shift = templateLength - 1; - for (k = 0; k < templateLength; k++, shift--) { - j0 = j + templateX[k]; - if (j0 >= 0 && j0 < width) { - i0 = i + templateY[k]; - if (i0 >= 0) { - bit = bitmap[i0][j0]; - if (bit) { - contextLabel |= bit << shift; - } - } - } - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - return bitmap; - } - - // 6.3.2 Generic Refinement Region Decoding Procedure - function decodeRefinement(width, height, templateIndex, referenceBitmap, - offsetX, offsetY, prediction, at, - decodingContext) { - var codingTemplate = RefinementTemplates[templateIndex].coding; - if (templateIndex === 0) { - codingTemplate = codingTemplate.concat([at[0]]); - } - var codingTemplateLength = codingTemplate.length; - var codingTemplateX = new Int32Array(codingTemplateLength); - var codingTemplateY = new Int32Array(codingTemplateLength); - var k; - for (k = 0; k < codingTemplateLength; k++) { - codingTemplateX[k] = codingTemplate[k].x; - codingTemplateY[k] = codingTemplate[k].y; - } - - var referenceTemplate = RefinementTemplates[templateIndex].reference; - if (templateIndex === 0) { - referenceTemplate = referenceTemplate.concat([at[1]]); - } - var referenceTemplateLength = referenceTemplate.length; - var referenceTemplateX = new Int32Array(referenceTemplateLength); - var referenceTemplateY = new Int32Array(referenceTemplateLength); - for (k = 0; k < referenceTemplateLength; k++) { - referenceTemplateX[k] = referenceTemplate[k].x; - referenceTemplateY[k] = referenceTemplate[k].y; - } - var referenceWidth = referenceBitmap[0].length; - var referenceHeight = referenceBitmap.length; - - var pseudoPixelContext = RefinementReusedContexts[templateIndex]; - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GR'); - - var ltp = 0; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - error('JBIG2 error: prediction is not supported'); - } - } - var row = new Uint8Array(width); - bitmap.push(row); - for (var j = 0; j < width; j++) { - var i0, j0; - var contextLabel = 0; - for (k = 0; k < codingTemplateLength; k++) { - i0 = i + codingTemplateY[k]; - j0 = j + codingTemplateX[k]; - if (i0 < 0 || j0 < 0 || j0 >= width) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | bitmap[i0][j0]; - } - } - for (k = 0; k < referenceTemplateLength; k++) { - i0 = i + referenceTemplateY[k] + offsetY; - j0 = j + referenceTemplateX[k] + offsetX; - if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || - j0 >= referenceWidth) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0]; - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - - return bitmap; - } - - // 6.5.5 Decoding the symbol dictionary - function decodeSymbolDictionary(huffman, refinement, symbols, - numberOfNewSymbols, numberOfExportedSymbols, - huffmanTables, templateIndex, at, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - var newSymbols = []; - var currentHeight = 0; - var symbolCodeLength = log2(symbols.length + numberOfNewSymbols); - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - - while (newSymbols.length < numberOfNewSymbols) { - var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); // 6.5.6 - currentHeight += deltaHeight; - var currentWidth = 0; - var totalWidth = 0; - while (true) { - var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); // 6.5.7 - if (deltaWidth === null) { - break; // OOB - } - currentWidth += deltaWidth; - totalWidth += currentWidth; - var bitmap; - if (refinement) { - // 6.5.8.2 Refinement/aggregate-coded symbol bitmap - var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); - if (numberOfInstances > 1) { - bitmap = decodeTextRegion(huffman, refinement, - currentWidth, currentHeight, 0, - numberOfInstances, 1, //strip size - symbols.concat(newSymbols), - symbolCodeLength, - 0, //transposed - 0, //ds offset - 1, //top left 7.4.3.1.1 - 0, //OR operator - huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext); - } else { - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - var symbol = (symbolId < symbols.length ? symbols[symbolId] : - newSymbols[symbolId - symbols.length]); - bitmap = decodeRefinement(currentWidth, currentHeight, - refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, - decodingContext); - } - } else { - // 6.5.8.1 Direct-coded symbol bitmap - bitmap = decodeBitmap(false, currentWidth, currentHeight, - templateIndex, false, null, at, decodingContext); - } - newSymbols.push(bitmap); - } - } - // 6.5.10 Exported symbols - var exportedSymbols = []; - var flags = [], currentFlag = false; - var totalSymbolsLength = symbols.length + numberOfNewSymbols; - while (flags.length < totalSymbolsLength) { - var runLength = decodeInteger(contextCache, 'IAEX', decoder); - while (runLength--) { - flags.push(currentFlag); - } - currentFlag = !currentFlag; - } - for (var i = 0, ii = symbols.length; i < ii; i++) { - if (flags[i]) { - exportedSymbols.push(symbols[i]); - } - } - for (var j = 0; j < numberOfNewSymbols; i++, j++) { - if (flags[i]) { - exportedSymbols.push(newSymbols[j]); - } - } - return exportedSymbols; - } - - function decodeTextRegion(huffman, refinement, width, height, - defaultPixelValue, numberOfSymbolInstances, - stripSize, inputSymbols, symbolCodeLength, - transposed, dsOffset, referenceCorner, - combinationOperator, huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Prepare bitmap - var bitmap = []; - var i, row; - for (i = 0; i < height; i++) { - row = new Uint8Array(width); - if (defaultPixelValue) { - for (var j = 0; j < width; j++) { - row[j] = defaultPixelValue; - } - } - bitmap.push(row); - } - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - var stripT = -decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - var firstS = 0; - i = 0; - while (i < numberOfSymbolInstances) { - var deltaT = decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - stripT += deltaT; - - var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); // 6.4.7 - firstS += deltaFirstS; - var currentS = firstS; - do { - var currentT = (stripSize === 1 ? 0 : - decodeInteger(contextCache, 'IAIT', decoder)); // 6.4.9 - var t = stripSize * stripT + currentT; - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var applyRefinement = (refinement && - decodeInteger(contextCache, 'IARI', decoder)); - var symbolBitmap = inputSymbols[symbolId]; - var symbolWidth = symbolBitmap[0].length; - var symbolHeight = symbolBitmap.length; - if (applyRefinement) { - var rdw = decodeInteger(contextCache, 'IARDW', decoder); // 6.4.11.1 - var rdh = decodeInteger(contextCache, 'IARDH', decoder); // 6.4.11.2 - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - symbolWidth += rdw; - symbolHeight += rdh; - symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, - refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, - (rdh >> 1) + rdy, false, refinementAt, - decodingContext); - } - var offsetT = t - ((referenceCorner & 1) ? 0 : symbolHeight); - var offsetS = currentS - ((referenceCorner & 2) ? symbolWidth : 0); - var s2, t2, symbolRow; - if (transposed) { - // Place Symbol Bitmap from T1,S1 - for (s2 = 0; s2 < symbolHeight; s2++) { - row = bitmap[offsetS + s2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[s2]; - // To ignore Parts of Symbol bitmap which goes - // outside bitmap region - var maxWidth = Math.min(width - offsetT, symbolWidth); - switch (combinationOperator) { - case 0: // OR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] |= symbolRow[t2]; - } - break; - case 2: // XOR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] ^= symbolRow[t2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolHeight - 1; - } else { - for (t2 = 0; t2 < symbolHeight; t2++) { - row = bitmap[offsetT + t2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[t2]; - switch (combinationOperator) { - case 0: // OR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] |= symbolRow[s2]; - } - break; - case 2: // XOR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] ^= symbolRow[s2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolWidth - 1; - } - i++; - var deltaS = decodeInteger(contextCache, 'IADS', decoder); // 6.4.8 - if (deltaS === null) { - break; // OOB - } - currentS += deltaS + dsOffset; - } while (true); - } - return bitmap; - } - - function readSegmentHeader(data, start) { - var segmentHeader = {}; - segmentHeader.number = readUint32(data, start); - var flags = data[start + 4]; - var segmentType = flags & 0x3F; - if (!SegmentTypes[segmentType]) { - error('JBIG2 error: invalid segment type: ' + segmentType); - } - segmentHeader.type = segmentType; - segmentHeader.typeName = SegmentTypes[segmentType]; - segmentHeader.deferredNonRetain = !!(flags & 0x80); - - var pageAssociationFieldSize = !!(flags & 0x40); - var referredFlags = data[start + 5]; - var referredToCount = (referredFlags >> 5) & 7; - var retainBits = [referredFlags & 31]; - var position = start + 6; - if (referredFlags === 7) { - referredToCount = readUint32(data, position - 1) & 0x1FFFFFFF; - position += 3; - var bytes = (referredToCount + 7) >> 3; - retainBits[0] = data[position++]; - while (--bytes > 0) { - retainBits.push(data[position++]); - } - } else if (referredFlags === 5 || referredFlags === 6) { - error('JBIG2 error: invalid referred-to flags'); - } - - segmentHeader.retainBits = retainBits; - var referredToSegmentNumberSize = (segmentHeader.number <= 256 ? 1 : - (segmentHeader.number <= 65536 ? 2 : 4)); - var referredTo = []; - var i, ii; - for (i = 0; i < referredToCount; i++) { - var number = (referredToSegmentNumberSize === 1 ? data[position] : - (referredToSegmentNumberSize === 2 ? readUint16(data, position) : - readUint32(data, position))); - referredTo.push(number); - position += referredToSegmentNumberSize; - } - segmentHeader.referredTo = referredTo; - if (!pageAssociationFieldSize) { - segmentHeader.pageAssociation = data[position++]; - } else { - segmentHeader.pageAssociation = readUint32(data, position); - position += 4; - } - segmentHeader.length = readUint32(data, position); - position += 4; - - if (segmentHeader.length === 0xFFFFFFFF) { - // 7.2.7 Segment data length, unknown segment length - if (segmentType === 38) { // ImmediateGenericRegion - var genericRegionInfo = readRegionSegmentInformation(data, position); - var genericRegionSegmentFlags = data[position + - RegionSegmentInformationFieldLength]; - var genericRegionMmr = !!(genericRegionSegmentFlags & 1); - // searching for the segment end - var searchPatternLength = 6; - var searchPattern = new Uint8Array(searchPatternLength); - if (!genericRegionMmr) { - searchPattern[0] = 0xFF; - searchPattern[1] = 0xAC; - } - searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xFF; - searchPattern[3] = (genericRegionInfo.height >> 16) & 0xFF; - searchPattern[4] = (genericRegionInfo.height >> 8) & 0xFF; - searchPattern[5] = genericRegionInfo.height & 0xFF; - for (i = position, ii = data.length; i < ii; i++) { - var j = 0; - while (j < searchPatternLength && searchPattern[j] === data[i + j]) { - j++; - } - if (j === searchPatternLength) { - segmentHeader.length = i + searchPatternLength; - break; - } - } - if (segmentHeader.length === 0xFFFFFFFF) { - error('JBIG2 error: segment end was not found'); - } - } else { - error('JBIG2 error: invalid unknown segment length'); - } - } - segmentHeader.headerEnd = position; - return segmentHeader; - } - - function readSegments(header, data, start, end) { - var segments = []; - var position = start; - while (position < end) { - var segmentHeader = readSegmentHeader(data, position); - position = segmentHeader.headerEnd; - var segment = { - header: segmentHeader, - data: data - }; - if (!header.randomAccess) { - segment.start = position; - position += segmentHeader.length; - segment.end = position; - } - segments.push(segment); - if (segmentHeader.type === 51) { - break; // end of file is found - } - } - if (header.randomAccess) { - for (var i = 0, ii = segments.length; i < ii; i++) { - segments[i].start = position; - position += segments[i].header.length; - segments[i].end = position; - } - } - return segments; - } - - // 7.4.1 Region segment information field - function readRegionSegmentInformation(data, start) { - return { - width: readUint32(data, start), - height: readUint32(data, start + 4), - x: readUint32(data, start + 8), - y: readUint32(data, start + 12), - combinationOperator: data[start + 16] & 7 - }; - } - var RegionSegmentInformationFieldLength = 17; - - function processSegment(segment, visitor) { - var header = segment.header; - - var data = segment.data, position = segment.start, end = segment.end; - var args, at, i, atLength; - switch (header.type) { - case 0: // SymbolDictionary - // 7.4.2 Symbol dictionary segment syntax - var dictionary = {}; - var dictionaryFlags = readUint16(data, position); // 7.4.2.1.1 - dictionary.huffman = !!(dictionaryFlags & 1); - dictionary.refinement = !!(dictionaryFlags & 2); - dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3; - dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3; - dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1; - dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1; - dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); - dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); - dictionary.template = (dictionaryFlags >> 10) & 3; - dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1; - position += 2; - if (!dictionary.huffman) { - atLength = dictionary.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.at = at; - } - if (dictionary.refinement && !dictionary.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.refinementAt = at; - } - dictionary.numberOfExportedSymbols = readUint32(data, position); - position += 4; - dictionary.numberOfNewSymbols = readUint32(data, position); - position += 4; - args = [dictionary, header.number, header.referredTo, - data, position, end]; - break; - case 6: // ImmediateTextRegion - case 7: // ImmediateLosslessTextRegion - var textRegion = {}; - textRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var textRegionSegmentFlags = readUint16(data, position); - position += 2; - textRegion.huffman = !!(textRegionSegmentFlags & 1); - textRegion.refinement = !!(textRegionSegmentFlags & 2); - textRegion.stripSize = 1 << ((textRegionSegmentFlags >> 2) & 3); - textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3; - textRegion.transposed = !!(textRegionSegmentFlags & 64); - textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3; - textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1; - textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27; - textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1; - if (textRegion.huffman) { - var textRegionHuffmanFlags = readUint16(data, position); - position += 2; - textRegion.huffmanFS = (textRegionHuffmanFlags) & 3; - textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3; - textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3; - textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3; - textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3; - textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3; - textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3; - textRegion.huffmanRefinementSizeSelector = - !!(textRegionHuffmanFlags & 14); - } - if (textRegion.refinement && !textRegion.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - textRegion.refinementAt = at; - } - textRegion.numberOfSymbolInstances = readUint32(data, position); - position += 4; - // TODO 7.4.3.1.7 Symbol ID Huffman table decoding - if (textRegion.huffman) { - error('JBIG2 error: huffman is not supported'); - } - args = [textRegion, header.referredTo, data, position, end]; - break; - case 38: // ImmediateGenericRegion - case 39: // ImmediateLosslessGenericRegion - var genericRegion = {}; - genericRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var genericRegionSegmentFlags = data[position++]; - genericRegion.mmr = !!(genericRegionSegmentFlags & 1); - genericRegion.template = (genericRegionSegmentFlags >> 1) & 3; - genericRegion.prediction = !!(genericRegionSegmentFlags & 8); - if (!genericRegion.mmr) { - atLength = genericRegion.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - genericRegion.at = at; - } - args = [genericRegion, data, position, end]; - break; - case 48: // PageInformation - var pageInfo = { - width: readUint32(data, position), - height: readUint32(data, position + 4), - resolutionX: readUint32(data, position + 8), - resolutionY: readUint32(data, position + 12) - }; - if (pageInfo.height === 0xFFFFFFFF) { - delete pageInfo.height; - } - var pageSegmentFlags = data[position + 16]; - var pageStripingInformation = readUint16(data, position + 17); - pageInfo.lossless = !!(pageSegmentFlags & 1); - pageInfo.refinement = !!(pageSegmentFlags & 2); - pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1; - pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3; - pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); - pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); - args = [pageInfo]; - break; - case 49: // EndOfPage - break; - case 50: // EndOfStripe - break; - case 51: // EndOfFile - break; - case 62: // 7.4.15 defines 2 extension types which - // are comments and can be ignored. - break; - default: - error('JBIG2 error: segment type ' + header.typeName + '(' + - header.type + ') is not implemented'); - } - var callbackName = 'on' + header.typeName; - if (callbackName in visitor) { - visitor[callbackName].apply(visitor, args); - } - } - - function processSegments(segments, visitor) { - for (var i = 0, ii = segments.length; i < ii; i++) { - processSegment(segments[i], visitor); - } - } - - function parseJbig2(data, start, end) { - var position = start; - if (data[position] !== 0x97 || data[position + 1] !== 0x4A || - data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || - data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || - data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { - error('JBIG2 error: invalid header'); - } - var header = {}; - position += 8; - var flags = data[position++]; - header.randomAccess = !(flags & 1); - if (!(flags & 2)) { - header.numberOfPages = readUint32(data, position); - position += 4; - } - var segments = readSegments(header, data, position, end); - error('Not implemented'); - // processSegments(segments, new SimpleSegmentVisitor()); - } - - function parseJbig2Chunks(chunks) { - var visitor = new SimpleSegmentVisitor(); - for (var i = 0, ii = chunks.length; i < ii; i++) { - var chunk = chunks[i]; - var segments = readSegments({}, chunk.data, chunk.start, chunk.end); - processSegments(segments, visitor); - } - return visitor.buffer; - } - - function SimpleSegmentVisitor() {} - - SimpleSegmentVisitor.prototype = { - onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { - this.currentPageInfo = info; - var rowSize = (info.width + 7) >> 3; - var buffer = new Uint8Array(rowSize * info.height); - // The contents of ArrayBuffers are initialized to 0. - // Fill the buffer with 0xFF only if info.defaultPixelValue is set - if (info.defaultPixelValue) { - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = 0xFF; - } - } - this.buffer = buffer; - }, - drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { - var pageInfo = this.currentPageInfo; - var width = regionInfo.width, height = regionInfo.height; - var rowSize = (pageInfo.width + 7) >> 3; - var combinationOperator = pageInfo.combinationOperatorOverride ? - regionInfo.combinationOperator : pageInfo.combinationOperator; - var buffer = this.buffer; - var mask0 = 128 >> (regionInfo.x & 7); - var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); - var i, j, mask, offset; - switch (combinationOperator) { - case 0: // OR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] |= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - case 2: // XOR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] ^= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - }, - onImmediateGenericRegion: - function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, - start, end) { - var regionInfo = region.info; - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, - region.template, region.prediction, null, - region.at, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessGenericRegion: - function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { - this.onImmediateGenericRegion.apply(this, arguments); - }, - onSymbolDictionary: - function SimpleSegmentVisitor_onSymbolDictionary(dictionary, - currentSegment, - referredSegments, - data, start, end) { - var huffmanTables; - if (dictionary.huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - if (!symbols) { - this.symbols = symbols = {}; - } - - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - - var decodingContext = new DecodingContext(data, start, end); - symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, - dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, - dictionary.numberOfExportedSymbols, huffmanTables, - dictionary.template, dictionary.at, - dictionary.refinementTemplate, dictionary.refinementAt, - decodingContext); - }, - onImmediateTextRegion: - function SimpleSegmentVisitor_onImmediateTextRegion(region, - referredSegments, - data, start, end) { - var regionInfo = region.info; - var huffmanTables; - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - var symbolCodeLength = log2(inputSymbols.length); - - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeTextRegion(region.huffman, region.refinement, - regionInfo.width, regionInfo.height, region.defaultPixelValue, - region.numberOfSymbolInstances, region.stripSize, inputSymbols, - symbolCodeLength, region.transposed, region.dsOffset, - region.referenceCorner, region.combinationOperator, huffmanTables, - region.refinementTemplate, region.refinementAt, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessTextRegion: - function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { - this.onImmediateTextRegion.apply(this, arguments); - } - }; - - function Jbig2Image() {} - - Jbig2Image.prototype = { - parseChunks: function Jbig2Image_parseChunks(chunks) { - return parseJbig2Chunks(chunks); - } - }; - - return Jbig2Image; -})(); - -exports.Jbig2Image = Jbig2Image; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreJpx = {}), root.pdfjsSharedUtil, - root.pdfjsCoreArithmeticDecoder); - } -}(this, function (exports, sharedUtil, coreArithmeticDecoder) { - -var info = sharedUtil.info; -var log2 = sharedUtil.log2; -var readUint16 = sharedUtil.readUint16; -var readUint32 = sharedUtil.readUint32; -var warn = sharedUtil.warn; -var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder; - -var JpxImage = (function JpxImageClosure() { - // Table E.1 - var SubbandsGainLog2 = { - 'LL': 0, - 'LH': 1, - 'HL': 1, - 'HH': 2 - }; - function JpxImage() { - this.failOnCorruptedImage = false; - } - JpxImage.prototype = { - parse: function JpxImage_parse(data) { - - var head = readUint16(data, 0); - // No box header, immediate start of codestream (SOC) - if (head === 0xFF4F) { - this.parseCodestream(data, 0, data.length); - return; - } - - var position = 0, length = data.length; - while (position < length) { - var headerSize = 8; - var lbox = readUint32(data, position); - var tbox = readUint32(data, position + 4); - position += headerSize; - if (lbox === 1) { - // XLBox: read UInt64 according to spec. - // JavaScript's int precision of 53 bit should be sufficient here. - lbox = readUint32(data, position) * 4294967296 + - readUint32(data, position + 4); - position += 8; - headerSize += 8; - } - if (lbox === 0) { - lbox = length - position + headerSize; - } - if (lbox < headerSize) { - throw new Error('JPX Error: Invalid box field size'); - } - var dataLength = lbox - headerSize; - var jumpDataLength = true; - switch (tbox) { - case 0x6A703268: // 'jp2h' - jumpDataLength = false; // parsing child boxes - break; - case 0x636F6C72: // 'colr' - // Colorspaces are not used, the CS from the PDF is used. - var method = data[position]; - if (method === 1) { - // enumerated colorspace - var colorspace = readUint32(data, position + 3); - switch (colorspace) { - case 16: // this indicates a sRGB colorspace - case 17: // this indicates a grayscale colorspace - case 18: // this indicates a YUV colorspace - break; - default: - warn('Unknown colorspace ' + colorspace); - break; - } - } else if (method === 2) { - info('ICC profile not supported'); - } - break; - case 0x6A703263: // 'jp2c' - this.parseCodestream(data, position, position + dataLength); - break; - case 0x6A502020: // 'jP\024\024' - if (0x0d0a870a !== readUint32(data, position)) { - warn('Invalid JP2 signature'); - } - break; - // The following header types are valid but currently not used: - case 0x6A501A1A: // 'jP\032\032' - case 0x66747970: // 'ftyp' - case 0x72726571: // 'rreq' - case 0x72657320: // 'res ' - case 0x69686472: // 'ihdr' - break; - default: - var headerType = String.fromCharCode((tbox >> 24) & 0xFF, - (tbox >> 16) & 0xFF, - (tbox >> 8) & 0xFF, - tbox & 0xFF); - warn('Unsupported header type ' + tbox + ' (' + headerType + ')'); - break; - } - if (jumpDataLength) { - position += dataLength; - } - } - }, - parseImageProperties: function JpxImage_parseImageProperties(stream) { - var newByte = stream.getByte(); - while (newByte >= 0) { - var oldByte = newByte; - newByte = stream.getByte(); - var code = (oldByte << 8) | newByte; - // Image and tile size (SIZ) - if (code === 0xFF51) { - stream.skip(4); - var Xsiz = stream.getInt32() >>> 0; // Byte 4 - var Ysiz = stream.getInt32() >>> 0; // Byte 8 - var XOsiz = stream.getInt32() >>> 0; // Byte 12 - var YOsiz = stream.getInt32() >>> 0; // Byte 16 - stream.skip(16); - var Csiz = stream.getUint16(); // Byte 36 - this.width = Xsiz - XOsiz; - this.height = Ysiz - YOsiz; - this.componentsCount = Csiz; - // Results are always returned as Uint8Arrays - this.bitsPerComponent = 8; - return; - } - } - throw new Error('JPX Error: No size marker found in JPX stream'); - }, - parseCodestream: function JpxImage_parseCodestream(data, start, end) { - var context = {}; - try { - var doNotRecover = false; - var position = start; - while (position + 1 < end) { - var code = readUint16(data, position); - position += 2; - - var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile; - switch (code) { - case 0xFF4F: // Start of codestream (SOC) - context.mainHeader = true; - break; - case 0xFFD9: // End of codestream (EOC) - break; - case 0xFF51: // Image and tile size (SIZ) - length = readUint16(data, position); - var siz = {}; - siz.Xsiz = readUint32(data, position + 4); - siz.Ysiz = readUint32(data, position + 8); - siz.XOsiz = readUint32(data, position + 12); - siz.YOsiz = readUint32(data, position + 16); - siz.XTsiz = readUint32(data, position + 20); - siz.YTsiz = readUint32(data, position + 24); - siz.XTOsiz = readUint32(data, position + 28); - siz.YTOsiz = readUint32(data, position + 32); - var componentsCount = readUint16(data, position + 36); - siz.Csiz = componentsCount; - var components = []; - j = position + 38; - for (var i = 0; i < componentsCount; i++) { - var component = { - precision: (data[j] & 0x7F) + 1, - isSigned: !!(data[j] & 0x80), - XRsiz: data[j + 1], - YRsiz: data[j + 1] - }; - calculateComponentDimensions(component, siz); - components.push(component); - } - context.SIZ = siz; - context.components = components; - calculateTileGrids(context, components); - context.QCC = []; - context.COC = []; - break; - case 0xFF5C: // Quantization default (QCD) - length = readUint16(data, position); - var qcd = {}; - j = position + 2; - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcd.noQuantization = (spqcdSize === 8); - qcd.scalarExpounded = scalarExpounded; - qcd.guardBits = sqcd >> 5; - spqcds = []; - while (j < length + position) { - var spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcd.SPqcds = spqcds; - if (context.mainHeader) { - context.QCD = qcd; - } else { - context.currentTile.QCD = qcd; - context.currentTile.QCC = []; - } - break; - case 0xFF5D: // Quantization component (QCC) - length = readUint16(data, position); - var qcc = {}; - j = position + 2; - var cqcc; - if (context.SIZ.Csiz < 257) { - cqcc = data[j++]; - } else { - cqcc = readUint16(data, j); - j += 2; - } - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcc.noQuantization = (spqcdSize === 8); - qcc.scalarExpounded = scalarExpounded; - qcc.guardBits = sqcd >> 5; - spqcds = []; - while (j < (length + position)) { - spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcc.SPqcds = spqcds; - if (context.mainHeader) { - context.QCC[cqcc] = qcc; - } else { - context.currentTile.QCC[cqcc] = qcc; - } - break; - case 0xFF52: // Coding style default (COD) - length = readUint16(data, position); - var cod = {}; - j = position + 2; - var scod = data[j++]; - cod.entropyCoderWithCustomPrecincts = !!(scod & 1); - cod.sopMarkerUsed = !!(scod & 2); - cod.ephMarkerUsed = !!(scod & 4); - cod.progressionOrder = data[j++]; - cod.layersCount = readUint16(data, j); - j += 2; - cod.multipleComponentTransform = data[j++]; - - cod.decompositionLevelsCount = data[j++]; - cod.xcb = (data[j++] & 0xF) + 2; - cod.ycb = (data[j++] & 0xF) + 2; - var blockStyle = data[j++]; - cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); - cod.resetContextProbabilities = !!(blockStyle & 2); - cod.terminationOnEachCodingPass = !!(blockStyle & 4); - cod.verticalyStripe = !!(blockStyle & 8); - cod.predictableTermination = !!(blockStyle & 16); - cod.segmentationSymbolUsed = !!(blockStyle & 32); - cod.reversibleTransformation = data[j++]; - if (cod.entropyCoderWithCustomPrecincts) { - var precinctsSizes = []; - while (j < length + position) { - var precinctsSize = data[j++]; - precinctsSizes.push({ - PPx: precinctsSize & 0xF, - PPy: precinctsSize >> 4 - }); - } - cod.precinctsSizes = precinctsSizes; - } - var unsupported = []; - if (cod.selectiveArithmeticCodingBypass) { - unsupported.push('selectiveArithmeticCodingBypass'); - } - if (cod.resetContextProbabilities) { - unsupported.push('resetContextProbabilities'); - } - if (cod.terminationOnEachCodingPass) { - unsupported.push('terminationOnEachCodingPass'); - } - if (cod.verticalyStripe) { - unsupported.push('verticalyStripe'); - } - if (cod.predictableTermination) { - unsupported.push('predictableTermination'); - } - if (unsupported.length > 0) { - doNotRecover = true; - throw new Error('JPX Error: Unsupported COD options (' + - unsupported.join(', ') + ')'); - } - if (context.mainHeader) { - context.COD = cod; - } else { - context.currentTile.COD = cod; - context.currentTile.COC = []; - } - break; - case 0xFF90: // Start of tile-part (SOT) - length = readUint16(data, position); - tile = {}; - tile.index = readUint16(data, position + 2); - tile.length = readUint32(data, position + 4); - tile.dataEnd = tile.length + position - 2; - tile.partIndex = data[position + 8]; - tile.partsCount = data[position + 9]; - - context.mainHeader = false; - if (tile.partIndex === 0) { - // reset component specific settings - tile.COD = context.COD; - tile.COC = context.COC.slice(0); // clone of the global COC - tile.QCD = context.QCD; - tile.QCC = context.QCC.slice(0); // clone of the global COC - } - context.currentTile = tile; - break; - case 0xFF93: // Start of data (SOD) - tile = context.currentTile; - if (tile.partIndex === 0) { - initializeTile(context, tile.index); - buildPackets(context); - } - - // moving to the end of the data - length = tile.dataEnd - position; - parseTilePackets(context, data, position, length); - break; - case 0xFF55: // Tile-part lengths, main header (TLM) - case 0xFF57: // Packet length, main header (PLM) - case 0xFF58: // Packet length, tile-part header (PLT) - case 0xFF64: // Comment (COM) - length = readUint16(data, position); - // skipping content - break; - case 0xFF53: // Coding style component (COC) - throw new Error('JPX Error: Codestream code 0xFF53 (COC) is ' + - 'not implemented'); - default: - throw new Error('JPX Error: Unknown codestream code: ' + - code.toString(16)); - } - position += length; - } - } catch (e) { - if (doNotRecover || this.failOnCorruptedImage) { - throw e; - } else { - warn('Trying to recover from ' + e.message); - } - } - this.tiles = transformComponents(context); - this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; - this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; - this.componentsCount = context.SIZ.Csiz; - } - }; - function calculateComponentDimensions(component, siz) { - // Section B.2 Component mapping - component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); - component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); - component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); - component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); - component.width = component.x1 - component.x0; - component.height = component.y1 - component.y0; - } - function calculateTileGrids(context, components) { - var siz = context.SIZ; - // Section B.3 Division into tile and tile-components - var tile, tiles = []; - var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); - var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); - for (var q = 0; q < numYtiles; q++) { - for (var p = 0; p < numXtiles; p++) { - tile = {}; - tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); - tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); - tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); - tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); - tile.width = tile.tx1 - tile.tx0; - tile.height = tile.ty1 - tile.ty0; - tile.components = []; - tiles.push(tile); - } - } - context.tiles = tiles; - - var componentsCount = siz.Csiz; - for (var i = 0, ii = componentsCount; i < ii; i++) { - var component = components[i]; - for (var j = 0, jj = tiles.length; j < jj; j++) { - var tileComponent = {}; - tile = tiles[j]; - tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); - tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); - tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); - tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); - tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; - tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; - tile.components[i] = tileComponent; - } - } - } - function getBlocksDimensions(context, component, r) { - var codOrCoc = component.codingStyleParameters; - var result = {}; - if (!codOrCoc.entropyCoderWithCustomPrecincts) { - result.PPx = 15; - result.PPy = 15; - } else { - result.PPx = codOrCoc.precinctsSizes[r].PPx; - result.PPy = codOrCoc.precinctsSizes[r].PPy; - } - // calculate codeblock size as described in section B.7 - result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : - Math.min(codOrCoc.xcb, result.PPx)); - result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : - Math.min(codOrCoc.ycb, result.PPy)); - return result; - } - function buildPrecincts(context, resolution, dimensions) { - // Section B.6 Division resolution to precincts - var precinctWidth = 1 << dimensions.PPx; - var precinctHeight = 1 << dimensions.PPy; - // Jasper introduces codeblock groups for mapping each subband codeblocks - // to precincts. Precinct partition divides a resolution according to width - // and height parameters. The subband that belongs to the resolution level - // has a different size than the level, unless it is the zero resolution. - - // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding: - // The precinct partitioning for a particular subband is derived from a - // partitioning of its parent LL band (i.e., the LL band at the next higher - // resolution level)... The LL band associated with each resolution level is - // divided into precincts... Each of the resulting precinct regions is then - // mapped into its child subbands (if any) at the next lower resolution - // level. This is accomplished by using the coordinate transformation - // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the - // coordinates of a point in the LL band and child subband, respectively. - var isZeroRes = resolution.resLevel === 0; - var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1)); - var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1)); - var numprecinctswide = (resolution.trx1 > resolution.trx0 ? - Math.ceil(resolution.trx1 / precinctWidth) - - Math.floor(resolution.trx0 / precinctWidth) : 0); - var numprecinctshigh = (resolution.try1 > resolution.try0 ? - Math.ceil(resolution.try1 / precinctHeight) - - Math.floor(resolution.try0 / precinctHeight) : 0); - var numprecincts = numprecinctswide * numprecinctshigh; - - resolution.precinctParameters = { - precinctWidth: precinctWidth, - precinctHeight: precinctHeight, - numprecinctswide: numprecinctswide, - numprecinctshigh: numprecinctshigh, - numprecincts: numprecincts, - precinctWidthInSubband: precinctWidthInSubband, - precinctHeightInSubband: precinctHeightInSubband - }; - } - function buildCodeblocks(context, subband, dimensions) { - // Section B.7 Division sub-band into code-blocks - var xcb_ = dimensions.xcb_; - var ycb_ = dimensions.ycb_; - var codeblockWidth = 1 << xcb_; - var codeblockHeight = 1 << ycb_; - var cbx0 = subband.tbx0 >> xcb_; - var cby0 = subband.tby0 >> ycb_; - var cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_; - var cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_; - var precinctParameters = subband.resolution.precinctParameters; - var codeblocks = []; - var precincts = []; - var i, j, codeblock, precinctNumber; - for (j = cby0; j < cby1; j++) { - for (i = cbx0; i < cbx1; i++) { - codeblock = { - cbx: i, - cby: j, - tbx0: codeblockWidth * i, - tby0: codeblockHeight * j, - tbx1: codeblockWidth * (i + 1), - tby1: codeblockHeight * (j + 1) - }; - - codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); - codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); - codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); - codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); - - // Calculate precinct number for this codeblock, codeblock position - // should be relative to its subband, use actual dimension and position - // See comment about codeblock group width and height - var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / - precinctParameters.precinctWidthInSubband); - var pj = Math.floor((codeblock.tby0_ - subband.tby0) / - precinctParameters.precinctHeightInSubband); - precinctNumber = pi + (pj * precinctParameters.numprecinctswide); - - codeblock.precinctNumber = precinctNumber; - codeblock.subbandType = subband.type; - codeblock.Lblock = 3; - - if (codeblock.tbx1_ <= codeblock.tbx0_ || - codeblock.tby1_ <= codeblock.tby0_) { - continue; - } - codeblocks.push(codeblock); - // building precinct for the sub-band - var precinct = precincts[precinctNumber]; - if (precinct !== undefined) { - if (i < precinct.cbxMin) { - precinct.cbxMin = i; - } else if (i > precinct.cbxMax) { - precinct.cbxMax = i; - } - if (j < precinct.cbyMin) { - precinct.cbxMin = j; - } else if (j > precinct.cbyMax) { - precinct.cbyMax = j; - } - } else { - precincts[precinctNumber] = precinct = { - cbxMin: i, - cbyMin: j, - cbxMax: i, - cbyMax: j - }; - } - codeblock.precinct = precinct; - } - } - subband.codeblockParameters = { - codeblockWidth: xcb_, - codeblockHeight: ycb_, - numcodeblockwide: cbx1 - cbx0 + 1, - numcodeblockhigh: cby1 - cby0 + 1 - }; - subband.codeblocks = codeblocks; - subband.precincts = precincts; - } - function createPacket(resolution, precinctNumber, layerNumber) { - var precinctCodeblocks = []; - // Section B.10.8 Order of info in packet - var subbands = resolution.subbands; - // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence - for (var i = 0, ii = subbands.length; i < ii; i++) { - var subband = subbands[i]; - var codeblocks = subband.codeblocks; - for (var j = 0, jj = codeblocks.length; j < jj; j++) { - var codeblock = codeblocks[j]; - if (codeblock.precinctNumber !== precinctNumber) { - continue; - } - precinctCodeblocks.push(codeblock); - } - } - return { - layerNumber: layerNumber, - codeblocks: precinctCodeblocks - }; - } - function LayerResolutionComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var l = 0, r = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.1 Layer-resolution-component-position - for (; l < layersCount; l++) { - for (; r <= maxDecompositionLevelsCount; r++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - r = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ResolutionLayerComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var r = 0, l = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.2 Resolution-layer-component-position - for (; r <= maxDecompositionLevelsCount; r++) { - for (; l < layersCount; l++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - l = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ResolutionPositionComponentLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var l, r, c, p; - var maxDecompositionLevelsCount = 0; - for (c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - component.codingStyleParameters.decompositionLevelsCount); - } - var maxNumPrecinctsInLevel = new Int32Array( - maxDecompositionLevelsCount + 1); - for (r = 0; r <= maxDecompositionLevelsCount; ++r) { - var maxNumPrecincts = 0; - for (c = 0; c < componentsCount; ++c) { - var resolutions = tile.components[c].resolutions; - if (r < resolutions.length) { - maxNumPrecincts = Math.max(maxNumPrecincts, - resolutions[r].precinctParameters.numprecincts); - } - } - maxNumPrecinctsInLevel[r] = maxNumPrecincts; - } - l = 0; - r = 0; - c = 0; - p = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.3 Resolution-position-component-layer - for (; r <= maxDecompositionLevelsCount; r++) { - for (; p < maxNumPrecinctsInLevel[r]; p++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - if (p >= numprecincts) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, p, l); - l++; - return packet; - } - l = 0; - } - c = 0; - } - p = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function PositionComponentResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var precinctsIterationSizes = precinctsSizes; - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.4 Position-component-resolution-layer - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = - precinctsSizes.components[c].resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - c = 0; - } - px = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ComponentPositionResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.5 Component-position-resolution-layer - for (; c < componentsCount; ++c) { - var component = tile.components[c]; - var precinctsIterationSizes = precinctsSizes.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = precinctsIterationSizes.resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - px = 0; - } - py = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function getPrecinctIndexIfExist( - pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { - var posX = pxIndex * precinctIterationSizes.minWidth; - var posY = pyIndex * precinctIterationSizes.minHeight; - if (posX % sizeInImageScale.width !== 0 || - posY % sizeInImageScale.height !== 0) { - return null; - } - var startPrecinctRowIndex = - (posY / sizeInImageScale.width) * - resolution.precinctParameters.numprecinctswide; - return (posX / sizeInImageScale.height) + startPrecinctRowIndex; - } - function getPrecinctSizesInImageScale(tile) { - var componentsCount = tile.components.length; - var minWidth = Number.MAX_VALUE; - var minHeight = Number.MAX_VALUE; - var maxNumWide = 0; - var maxNumHigh = 0; - var sizePerComponent = new Array(componentsCount); - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - var sizePerResolution = new Array(decompositionLevelsCount + 1); - var minWidthCurrentComponent = Number.MAX_VALUE; - var minHeightCurrentComponent = Number.MAX_VALUE; - var maxNumWideCurrentComponent = 0; - var maxNumHighCurrentComponent = 0; - var scale = 1; - for (var r = decompositionLevelsCount; r >= 0; --r) { - var resolution = component.resolutions[r]; - var widthCurrentResolution = - scale * resolution.precinctParameters.precinctWidth; - var heightCurrentResolution = - scale * resolution.precinctParameters.precinctHeight; - minWidthCurrentComponent = Math.min( - minWidthCurrentComponent, - widthCurrentResolution); - minHeightCurrentComponent = Math.min( - minHeightCurrentComponent, - heightCurrentResolution); - maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, - resolution.precinctParameters.numprecinctswide); - maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, - resolution.precinctParameters.numprecinctshigh); - sizePerResolution[r] = { - width: widthCurrentResolution, - height: heightCurrentResolution - }; - scale <<= 1; - } - minWidth = Math.min(minWidth, minWidthCurrentComponent); - minHeight = Math.min(minHeight, minHeightCurrentComponent); - maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); - maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); - sizePerComponent[c] = { - resolutions: sizePerResolution, - minWidth: minWidthCurrentComponent, - minHeight: minHeightCurrentComponent, - maxNumWide: maxNumWideCurrentComponent, - maxNumHigh: maxNumHighCurrentComponent - }; - } - return { - components: sizePerComponent, - minWidth: minWidth, - minHeight: minHeight, - maxNumWide: maxNumWide, - maxNumHigh: maxNumHigh - }; - } - function buildPackets(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var componentsCount = siz.Csiz; - // Creating resolutions and sub-bands for each component - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - // Section B.5 Resolution levels and sub-bands - var resolutions = []; - var subbands = []; - for (var r = 0; r <= decompositionLevelsCount; r++) { - var blocksDimensions = getBlocksDimensions(context, component, r); - var resolution = {}; - var scale = 1 << (decompositionLevelsCount - r); - resolution.trx0 = Math.ceil(component.tcx0 / scale); - resolution.try0 = Math.ceil(component.tcy0 / scale); - resolution.trx1 = Math.ceil(component.tcx1 / scale); - resolution.try1 = Math.ceil(component.tcy1 / scale); - resolution.resLevel = r; - buildPrecincts(context, resolution, blocksDimensions); - resolutions.push(resolution); - - var subband; - if (r === 0) { - // one sub-band (LL) with last decomposition - subband = {}; - subband.type = 'LL'; - subband.tbx0 = Math.ceil(component.tcx0 / scale); - subband.tby0 = Math.ceil(component.tcy0 / scale); - subband.tbx1 = Math.ceil(component.tcx1 / scale); - subband.tby1 = Math.ceil(component.tcy1 / scale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolution.subbands = [subband]; - } else { - var bscale = 1 << (decompositionLevelsCount - r + 1); - var resolutionSubbands = []; - // three sub-bands (HL, LH and HH) with rest of decompositions - subband = {}; - subband.type = 'HL'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'LH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'HH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - resolution.subbands = resolutionSubbands; - } - } - component.resolutions = resolutions; - component.subbands = subbands; - } - // Generate the packets sequence - var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; - switch (progressionOrder) { - case 0: - tile.packetsIterator = - new LayerResolutionComponentPositionIterator(context); - break; - case 1: - tile.packetsIterator = - new ResolutionLayerComponentPositionIterator(context); - break; - case 2: - tile.packetsIterator = - new ResolutionPositionComponentLayerIterator(context); - break; - case 3: - tile.packetsIterator = - new PositionComponentResolutionLayerIterator(context); - break; - case 4: - tile.packetsIterator = - new ComponentPositionResolutionLayerIterator(context); - break; - default: - throw new Error('JPX Error: Unsupported progression order ' + - progressionOrder); - } - } - function parseTilePackets(context, data, offset, dataLength) { - var position = 0; - var buffer, bufferSize = 0, skipNextBit = false; - function readBits(count) { - while (bufferSize < count) { - var b = data[offset + position]; - position++; - if (skipNextBit) { - buffer = (buffer << 7) | b; - bufferSize += 7; - skipNextBit = false; - } else { - buffer = (buffer << 8) | b; - bufferSize += 8; - } - if (b === 0xFF) { - skipNextBit = true; - } - } - bufferSize -= count; - return (buffer >>> bufferSize) & ((1 << count) - 1); - } - function skipMarkerIfEqual(value) { - if (data[offset + position - 1] === 0xFF && - data[offset + position] === value) { - skipBytes(1); - return true; - } else if (data[offset + position] === 0xFF && - data[offset + position + 1] === value) { - skipBytes(2); - return true; - } - return false; - } - function skipBytes(count) { - position += count; - } - function alignToByte() { - bufferSize = 0; - if (skipNextBit) { - position++; - skipNextBit = false; - } - } - function readCodingpasses() { - if (readBits(1) === 0) { - return 1; - } - if (readBits(1) === 0) { - return 2; - } - var value = readBits(2); - if (value < 3) { - return value + 3; - } - value = readBits(5); - if (value < 31) { - return value + 6; - } - value = readBits(7); - return value + 37; - } - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var sopMarkerUsed = context.COD.sopMarkerUsed; - var ephMarkerUsed = context.COD.ephMarkerUsed; - var packetsIterator = tile.packetsIterator; - while (position < dataLength) { - alignToByte(); - if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { - // Skip also marker segment length and packet sequence ID - skipBytes(4); - } - var packet = packetsIterator.nextPacket(); - if (!readBits(1)) { - continue; - } - var layerNumber = packet.layerNumber; - var queue = [], codeblock; - for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { - codeblock = packet.codeblocks[i]; - var precinct = codeblock.precinct; - var codeblockColumn = codeblock.cbx - precinct.cbxMin; - var codeblockRow = codeblock.cby - precinct.cbyMin; - var codeblockIncluded = false; - var firstTimeInclusion = false; - var valueReady; - if (codeblock['included'] !== undefined) { - codeblockIncluded = !!readBits(1); - } else { - // reading inclusion tree - precinct = codeblock.precinct; - var inclusionTree, zeroBitPlanesTree; - if (precinct['inclusionTree'] !== undefined) { - inclusionTree = precinct.inclusionTree; - } else { - // building inclusion and zero bit-planes trees - var width = precinct.cbxMax - precinct.cbxMin + 1; - var height = precinct.cbyMax - precinct.cbyMin + 1; - inclusionTree = new InclusionTree(width, height, layerNumber); - zeroBitPlanesTree = new TagTree(width, height); - precinct.inclusionTree = inclusionTree; - precinct.zeroBitPlanesTree = zeroBitPlanesTree; - } - - if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { - while (true) { - if (readBits(1)) { - valueReady = !inclusionTree.nextLevel(); - if (valueReady) { - codeblock.included = true; - codeblockIncluded = firstTimeInclusion = true; - break; - } - } else { - inclusionTree.incrementValue(layerNumber); - break; - } - } - } - } - if (!codeblockIncluded) { - continue; - } - if (firstTimeInclusion) { - zeroBitPlanesTree = precinct.zeroBitPlanesTree; - zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); - while (true) { - if (readBits(1)) { - valueReady = !zeroBitPlanesTree.nextLevel(); - if (valueReady) { - break; - } - } else { - zeroBitPlanesTree.incrementValue(); - } - } - codeblock.zeroBitPlanes = zeroBitPlanesTree.value; - } - var codingpasses = readCodingpasses(); - while (readBits(1)) { - codeblock.Lblock++; - } - var codingpassesLog2 = log2(codingpasses); - // rounding down log2 - var bits = ((codingpasses < (1 << codingpassesLog2)) ? - codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; - var codedDataLength = readBits(bits); - queue.push({ - codeblock: codeblock, - codingpasses: codingpasses, - dataLength: codedDataLength - }); - } - alignToByte(); - if (ephMarkerUsed) { - skipMarkerIfEqual(0x92); - } - while (queue.length > 0) { - var packetItem = queue.shift(); - codeblock = packetItem.codeblock; - if (codeblock['data'] === undefined) { - codeblock.data = []; - } - codeblock.data.push({ - data: data, - start: offset + position, - end: offset + position + packetItem.dataLength, - codingpasses: packetItem.codingpasses - }); - position += packetItem.dataLength; - } - } - return position; - } - function copyCoefficients(coefficients, levelWidth, levelHeight, subband, - delta, mb, reversible, segmentationSymbolUsed) { - var x0 = subband.tbx0; - var y0 = subband.tby0; - var width = subband.tbx1 - subband.tbx0; - var codeblocks = subband.codeblocks; - var right = subband.type.charAt(0) === 'H' ? 1 : 0; - var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; - - for (var i = 0, ii = codeblocks.length; i < ii; ++i) { - var codeblock = codeblocks[i]; - var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; - var blockHeight = codeblock.tby1_ - codeblock.tby0_; - if (blockWidth === 0 || blockHeight === 0) { - continue; - } - if (codeblock['data'] === undefined) { - continue; - } - - var bitModel, currentCodingpassType; - bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, - codeblock.zeroBitPlanes, mb); - currentCodingpassType = 2; // first bit plane starts from cleanup - - // collect data - var data = codeblock.data, totalLength = 0, codingpasses = 0; - var j, jj, dataItem; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - totalLength += dataItem.end - dataItem.start; - codingpasses += dataItem.codingpasses; - } - var encodedData = new Uint8Array(totalLength); - var position = 0; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); - encodedData.set(chunk, position); - position += chunk.length; - } - // decoding the item - var decoder = new ArithmeticDecoder(encodedData, 0, totalLength); - bitModel.setDecoder(decoder); - - for (j = 0; j < codingpasses; j++) { - switch (currentCodingpassType) { - case 0: - bitModel.runSignificancePropogationPass(); - break; - case 1: - bitModel.runMagnitudeRefinementPass(); - break; - case 2: - bitModel.runCleanupPass(); - if (segmentationSymbolUsed) { - bitModel.checkSegmentationSymbol(); - } - break; - } - currentCodingpassType = (currentCodingpassType + 1) % 3; - } - - var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width; - var sign = bitModel.coefficentsSign; - var magnitude = bitModel.coefficentsMagnitude; - var bitsDecoded = bitModel.bitsDecoded; - var magnitudeCorrection = reversible ? 0 : 0.5; - var k, n, nb; - position = 0; - // Do the interleaving of Section F.3.3 here, so we do not need - // to copy later. LL level is not interleaved, just copied. - var interleave = (subband.type !== 'LL'); - for (j = 0; j < blockHeight; j++) { - var row = (offset / width) | 0; // row in the non-interleaved subband - var levelOffset = 2 * row * (levelWidth - width) + right + bottom; - for (k = 0; k < blockWidth; k++) { - n = magnitude[position]; - if (n !== 0) { - n = (n + magnitudeCorrection) * delta; - if (sign[position] !== 0) { - n = -n; - } - nb = bitsDecoded[position]; - var pos = interleave ? (levelOffset + (offset << 1)) : offset; - if (reversible && (nb >= mb)) { - coefficients[pos] = n; - } else { - coefficients[pos] = n * (1 << (mb - nb)); - } - } - offset++; - position++; - } - offset += width - blockWidth; - } - } - } - function transformTile(context, tile, c) { - var component = tile.components[c]; - var codingStyleParameters = component.codingStyleParameters; - var quantizationParameters = component.quantizationParameters; - var decompositionLevelsCount = - codingStyleParameters.decompositionLevelsCount; - var spqcds = quantizationParameters.SPqcds; - var scalarExpounded = quantizationParameters.scalarExpounded; - var guardBits = quantizationParameters.guardBits; - var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; - var precision = context.components[c].precision; - - var reversible = codingStyleParameters.reversibleTransformation; - var transform = (reversible ? new ReversibleTransform() : - new IrreversibleTransform()); - - var subbandCoefficients = []; - var b = 0; - for (var i = 0; i <= decompositionLevelsCount; i++) { - var resolution = component.resolutions[i]; - - var width = resolution.trx1 - resolution.trx0; - var height = resolution.try1 - resolution.try0; - // Allocate space for the whole sublevel. - var coefficients = new Float32Array(width * height); - - for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { - var mu, epsilon; - if (!scalarExpounded) { - // formula E-5 - mu = spqcds[0].mu; - epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); - } else { - mu = spqcds[b].mu; - epsilon = spqcds[b].epsilon; - b++; - } - - var subband = resolution.subbands[j]; - var gainLog2 = SubbandsGainLog2[subband.type]; - - // calulate quantization coefficient (Section E.1.1.1) - var delta = (reversible ? 1 : - Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); - var mb = (guardBits + epsilon - 1); - - // In the first resolution level, copyCoefficients will fill the - // whole array with coefficients. In the succeding passes, - // copyCoefficients will consecutively fill in the values that belong - // to the interleaved positions of the HL, LH, and HH coefficients. - // The LL coefficients will then be interleaved in Transform.iterate(). - copyCoefficients(coefficients, width, height, subband, delta, mb, - reversible, segmentationSymbolUsed); - } - subbandCoefficients.push({ - width: width, - height: height, - items: coefficients - }); - } - - var result = transform.calculate(subbandCoefficients, - component.tcx0, component.tcy0); - return { - left: component.tcx0, - top: component.tcy0, - width: result.width, - height: result.height, - items: result.items - }; - } - function transformComponents(context) { - var siz = context.SIZ; - var components = context.components; - var componentsCount = siz.Csiz; - var resultImages = []; - for (var i = 0, ii = context.tiles.length; i < ii; i++) { - var tile = context.tiles[i]; - var transformedTiles = []; - var c; - for (c = 0; c < componentsCount; c++) { - transformedTiles[c] = transformTile(context, tile, c); - } - var tile0 = transformedTiles[0]; - var out = new Uint8Array(tile0.items.length * componentsCount); - var result = { - left: tile0.left, - top: tile0.top, - width: tile0.width, - height: tile0.height, - items: out - }; - - // Section G.2.2 Inverse multi component transform - var shift, offset, max, min, maxK; - var pos = 0, j, jj, y0, y1, y2, r, g, b, k, val; - if (tile.codingStyleDefaultParameters.multipleComponentTransform) { - var fourComponents = componentsCount === 4; - var y0items = transformedTiles[0].items; - var y1items = transformedTiles[1].items; - var y2items = transformedTiles[2].items; - var y3items = fourComponents ? transformedTiles[3].items : null; - - // HACK: The multiple component transform formulas below assume that - // all components have the same precision. With this in mind, we - // compute shift and offset only once. - shift = components[0].precision - 8; - offset = (128 << shift) + 0.5; - max = 255 * (1 << shift); - maxK = max * 0.5; - min = -maxK; - - var component0 = tile.components[0]; - var alpha01 = componentsCount - 3; - jj = y0items.length; - if (!component0.codingStyleParameters.reversibleTransformation) { - // inverse irreversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - r = y0 + 1.402 * y2; - g = y0 - 0.34413 * y1 - 0.71414 * y2; - b = y0 + 1.772 * y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } else { - // inverse reversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - g = y0 - ((y2 + y1) >> 2); - r = g + y2; - b = g + y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } - if (fourComponents) { - for (j = 0, pos = 3; j < jj; j++, pos += 4) { - k = y3items[j]; - out[pos] = k <= min ? 0 : k >= maxK ? 255 : (k + offset) >> shift; - } - } - } else { // no multi-component transform - for (c = 0; c < componentsCount; c++) { - var items = transformedTiles[c].items; - shift = components[c].precision - 8; - offset = (128 << shift) + 0.5; - max = (127.5 * (1 << shift)); - min = -max; - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - val = items[j]; - out[pos] = val <= min ? 0 : - val >= max ? 255 : (val + offset) >> shift; - pos += componentsCount; - } - } - } - resultImages.push(result); - } - return resultImages; - } - function initializeTile(context, tileIndex) { - var siz = context.SIZ; - var componentsCount = siz.Csiz; - var tile = context.tiles[tileIndex]; - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ? - context.currentTile.QCC[c] : context.currentTile.QCD); - component.quantizationParameters = qcdOrQcc; - var codOrCoc = (context.currentTile.COC[c] !== undefined ? - context.currentTile.COC[c] : context.currentTile.COD); - component.codingStyleParameters = codOrCoc; - } - tile.codingStyleDefaultParameters = context.currentTile.COD; - } - - // Section B.10.2 Tag trees - var TagTree = (function TagTreeClosure() { - function TagTree(width, height) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var level = { - width: width, - height: height, - items: [] - }; - this.levels.push(level); - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - TagTree.prototype = { - reset: function TagTree_reset(i, j) { - var currentLevel = 0, value = 0, level; - while (currentLevel < this.levels.length) { - level = this.levels[currentLevel]; - var index = i + j * level.width; - if (level.items[index] !== undefined) { - value = level.items[index]; - break; - } - level.index = index; - i >>= 1; - j >>= 1; - currentLevel++; - } - currentLevel--; - level = this.levels[currentLevel]; - level.items[level.index] = value; - this.currentLevel = currentLevel; - delete this.value; - }, - incrementValue: function TagTree_incrementValue() { - var level = this.levels[this.currentLevel]; - level.items[level.index]++; - }, - nextLevel: function TagTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - currentLevel--; - if (currentLevel < 0) { - this.value = value; - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return TagTree; - })(); - - var InclusionTree = (function InclusionTreeClosure() { - function InclusionTree(width, height, defaultValue) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var items = new Uint8Array(width * height); - for (var j = 0, jj = items.length; j < jj; j++) { - items[j] = defaultValue; - } - - var level = { - width: width, - height: height, - items: items - }; - this.levels.push(level); - - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - InclusionTree.prototype = { - reset: function InclusionTree_reset(i, j, stopValue) { - var currentLevel = 0; - while (currentLevel < this.levels.length) { - var level = this.levels[currentLevel]; - var index = i + j * level.width; - level.index = index; - var value = level.items[index]; - - if (value === 0xFF) { - break; - } - - if (value > stopValue) { - this.currentLevel = currentLevel; - // already know about this one, propagating the value to top levels - this.propagateValues(); - return false; - } - - i >>= 1; - j >>= 1; - currentLevel++; - } - this.currentLevel = currentLevel - 1; - return true; - }, - incrementValue: function InclusionTree_incrementValue(stopValue) { - var level = this.levels[this.currentLevel]; - level.items[level.index] = stopValue + 1; - this.propagateValues(); - }, - propagateValues: function InclusionTree_propagateValues() { - var levelIndex = this.currentLevel; - var level = this.levels[levelIndex]; - var currentValue = level.items[level.index]; - while (--levelIndex >= 0) { - level = this.levels[levelIndex]; - level.items[level.index] = currentValue; - } - }, - nextLevel: function InclusionTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - level.items[level.index] = 0xFF; - currentLevel--; - if (currentLevel < 0) { - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return InclusionTree; - })(); - - // Section D. Coefficient bit modeling - var BitModel = (function BitModelClosure() { - var UNIFORM_CONTEXT = 17; - var RUNLENGTH_CONTEXT = 18; - // Table D-1 - // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4), - // vv - sum of Vi (0..2), and hh - sum of Hi (0..2) - var LLAndLHContextsLabel = new Uint8Array([ - 0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, - 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, - 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8 - ]); - var HLContextLabel = new Uint8Array([ - 0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, - 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, - 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8 - ]); - var HHContextLabel = new Uint8Array([ - 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, - 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, - 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8 - ]); - - function BitModel(width, height, subband, zeroBitPlanes, mb) { - this.width = width; - this.height = height; - - this.contextLabelTable = (subband === 'HH' ? HHContextLabel : - (subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel)); - - var coefficientCount = width * height; - - // coefficients outside the encoding region treated as insignificant - // add border state cells for significanceState - this.neighborsSignificance = new Uint8Array(coefficientCount); - this.coefficentsSign = new Uint8Array(coefficientCount); - this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : - mb > 6 ? new Uint16Array(coefficientCount) : - new Uint8Array(coefficientCount); - this.processingFlags = new Uint8Array(coefficientCount); - - var bitsDecoded = new Uint8Array(coefficientCount); - if (zeroBitPlanes !== 0) { - for (var i = 0; i < coefficientCount; i++) { - bitsDecoded[i] = zeroBitPlanes; - } - } - this.bitsDecoded = bitsDecoded; - - this.reset(); - } - - BitModel.prototype = { - setDecoder: function BitModel_setDecoder(decoder) { - this.decoder = decoder; - }, - reset: function BitModel_reset() { - // We have 17 contexts that are accessed via context labels, - // plus the uniform and runlength context. - this.contexts = new Int8Array(19); - - // Contexts are packed into 1 byte: - // highest 7 bits carry the index, lowest bit carries mps - this.contexts[0] = (4 << 1) | 0; - this.contexts[UNIFORM_CONTEXT] = (46 << 1) | 0; - this.contexts[RUNLENGTH_CONTEXT] = (3 << 1) | 0; - }, - setNeighborsSignificance: - function BitModel_setNeighborsSignificance(row, column, index) { - var neighborsSignificance = this.neighborsSignificance; - var width = this.width, height = this.height; - var left = (column > 0); - var right = (column + 1 < width); - var i; - - if (row > 0) { - i = index - width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (row + 1 < height) { - i = index + width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (left) { - neighborsSignificance[index - 1] += 0x01; - } - if (right) { - neighborsSignificance[index + 1] += 0x01; - } - neighborsSignificance[index] |= 0x80; - }, - runSignificancePropogationPass: - function BitModel_runSignificancePropogationPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var neighborsSignificance = this.neighborsSignificance; - var processingFlags = this.processingFlags; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processedInverseMask = ~1; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - - for (var i0 = 0; i0 < height; i0 += 4) { - for (var j = 0; j < width; j++) { - var index = i0 * width + j; - for (var i1 = 0; i1 < 4; i1++, index += width) { - var i = i0 + i1; - if (i >= height) { - break; - } - // clear processed flag first - processingFlags[index] &= processedInverseMask; - - if (coefficentsMagnitude[index] || - !neighborsSignificance[index]) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision) { - var sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - decodeSignBit: function BitModel_decodeSignBit(row, column, index) { - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contribution, sign0, sign1, significance1; - var contextLabel, decoded; - - // calculate horizontal contribution - significance1 = (column > 0 && coefficentsMagnitude[index - 1] !== 0); - if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { - sign1 = coefficentsSign[index + 1]; - if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign1 - sign0; - } else { - contribution = 1 - sign1 - sign1; - } - } else if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign0 - sign0; - } else { - contribution = 0; - } - var horizontalContribution = 3 * contribution; - - // calculate vertical contribution and combine with the horizontal - significance1 = (row > 0 && coefficentsMagnitude[index - width] !== 0); - if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { - sign1 = coefficentsSign[index + width]; - if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign1 - sign0 + horizontalContribution; - } else { - contribution = 1 - sign1 - sign1 + horizontalContribution; - } - } else if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign0 - sign0 + horizontalContribution; - } else { - contribution = horizontalContribution; - } - - if (contribution >= 0) { - contextLabel = 9 + contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel); - } else { - contextLabel = 9 - contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; - } - return decoded; - }, - runMagnitudeRefinementPass: - function BitModel_runMagnitudeRefinementPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var neighborsSignificance = this.neighborsSignificance; - var contexts = this.contexts; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var length = width * height; - var width4 = width * 4; - - for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { - indexNext = Math.min(length, index0 + width4); - for (var j = 0; j < width; j++) { - for (var index = index0 + j; index < indexNext; index += width) { - - // significant but not those that have just become - if (!coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = 16; - if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { - processingFlags[index] ^= firstMagnitudeBitMask; - // first refinement - var significance = neighborsSignificance[index] & 127; - contextLabel = significance === 0 ? 15 : 14; - } - - var bit = decoder.readBit(contexts, contextLabel); - coefficentsMagnitude[index] = - (coefficentsMagnitude[index] << 1) | bit; - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - runCleanupPass: function BitModel_runCleanupPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var neighborsSignificance = this.neighborsSignificance; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var oneRowDown = width; - var twoRowsDown = width * 2; - var threeRowsDown = width * 3; - var iNext; - for (var i0 = 0; i0 < height; i0 = iNext) { - iNext = Math.min(i0 + 4, height); - var indexBase = i0 * width; - var checkAllEmpty = i0 + 3 < height; - for (var j = 0; j < width; j++) { - var index0 = indexBase + j; - // using the property: labels[neighborsSignificance[index]] === 0 - // when neighborsSignificance[index] === 0 - var allEmpty = (checkAllEmpty && - processingFlags[index0] === 0 && - processingFlags[index0 + oneRowDown] === 0 && - processingFlags[index0 + twoRowsDown] === 0 && - processingFlags[index0 + threeRowsDown] === 0 && - neighborsSignificance[index0] === 0 && - neighborsSignificance[index0 + oneRowDown] === 0 && - neighborsSignificance[index0 + twoRowsDown] === 0 && - neighborsSignificance[index0 + threeRowsDown] === 0); - var i1 = 0, index = index0; - var i = i0, sign; - if (allEmpty) { - var hasSignificantCoefficent = - decoder.readBit(contexts, RUNLENGTH_CONTEXT); - if (!hasSignificantCoefficent) { - bitsDecoded[index0]++; - bitsDecoded[index0 + oneRowDown]++; - bitsDecoded[index0 + twoRowsDown]++; - bitsDecoded[index0 + threeRowsDown]++; - continue; // next column - } - i1 = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (i1 !== 0) { - i = i0 + i1; - index += i1 * width; - } - - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - - index = index0; - for (var i2 = i0; i2 <= i; i2++, index += width) { - bitsDecoded[index]++; - } - - i1++; - } - for (i = i0 + i1; i < iNext; i++, index += width) { - if (coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision === 1) { - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - } - } - } - }, - checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { - var decoder = this.decoder; - var contexts = this.contexts; - var symbol = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 3) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 2) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (symbol !== 0xA) { - throw new Error('JPX Error: Invalid segmentation symbol'); - } - } - }; - - return BitModel; - })(); - - // Section F, Discrete wavelet transformation - var Transform = (function TransformClosure() { - function Transform() {} - - Transform.prototype.calculate = - function transformCalculate(subbands, u0, v0) { - var ll = subbands[0]; - for (var i = 1, ii = subbands.length; i < ii; i++) { - ll = this.iterate(ll, subbands[i], u0, v0); - } - return ll; - }; - Transform.prototype.extend = function extend(buffer, offset, size) { - // Section F.3.7 extending... using max extension of 4 - var i1 = offset - 1, j1 = offset + 1; - var i2 = offset + size - 2, j2 = offset + size; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1] = buffer[j1]; - buffer[j2] = buffer[i2]; - }; - Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, - u0, v0) { - var llWidth = ll.width, llHeight = ll.height, llItems = ll.items; - var width = hl_lh_hh.width; - var height = hl_lh_hh.height; - var items = hl_lh_hh.items; - var i, j, k, l, u, v; - - // Interleave LL according to Section F.3.3 - for (k = 0, i = 0; i < llHeight; i++) { - l = i * 2 * width; - for (j = 0; j < llWidth; j++, k++, l += 2) { - items[l] = llItems[k]; - } - } - // The LL band is not needed anymore. - llItems = ll.items = null; - - var bufferPadding = 4; - var rowBuffer = new Float32Array(width + 2 * bufferPadding); - - // Section F.3.4 HOR_SR - if (width === 1) { - // if width = 1, when u0 even keep items as is, when odd divide by 2 - if ((u0 & 1) !== 0) { - for (v = 0, k = 0; v < height; v++, k += width) { - items[k] *= 0.5; - } - } - } else { - for (v = 0, k = 0; v < height; v++, k += width) { - rowBuffer.set(items.subarray(k, k + width), bufferPadding); - - this.extend(rowBuffer, bufferPadding, width); - this.filter(rowBuffer, bufferPadding, width); - - items.set( - rowBuffer.subarray(bufferPadding, bufferPadding + width), - k); - } - } - - // Accesses to the items array can take long, because it may not fit into - // CPU cache and has to be fetched from main memory. Since subsequent - // accesses to the items array are not local when reading columns, we - // have a cache miss every time. To reduce cache misses, get up to - // 'numBuffers' items at a time and store them into the individual - // buffers. The colBuffers should be small enough to fit into CPU cache. - var numBuffers = 16; - var colBuffers = []; - for (i = 0; i < numBuffers; i++) { - colBuffers.push(new Float32Array(height + 2 * bufferPadding)); - } - var b, currentBuffer = 0; - ll = bufferPadding + height; - - // Section F.3.5 VER_SR - if (height === 1) { - // if height = 1, when v0 even keep items as is, when odd divide by 2 - if ((v0 & 1) !== 0) { - for (u = 0; u < width; u++) { - items[u] *= 0.5; - } - } - } else { - for (u = 0; u < width; u++) { - // if we ran out of buffers, copy several image columns at once - if (currentBuffer === 0) { - numBuffers = Math.min(width - u, numBuffers); - for (k = u, l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - colBuffers[b][l] = items[k + b]; - } - } - currentBuffer = numBuffers; - } - - currentBuffer--; - var buffer = colBuffers[currentBuffer]; - this.extend(buffer, bufferPadding, height); - this.filter(buffer, bufferPadding, height); - - // If this is last buffer in this group of buffers, flush all buffers. - if (currentBuffer === 0) { - k = u - numBuffers + 1; - for (l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - items[k + b] = colBuffers[b][l]; - } - } - } - } - } - - return { - width: width, - height: height, - items: items - }; - }; - return Transform; - })(); - - // Section 3.8.2 Irreversible 9-7 filter - var IrreversibleTransform = (function IrreversibleTransformClosure() { - function IrreversibleTransform() { - Transform.call(this); - } - - IrreversibleTransform.prototype = Object.create(Transform.prototype); - IrreversibleTransform.prototype.filter = - function irreversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n, current, next; - - var alpha = -1.586134342059924; - var beta = -0.052980118572961; - var gamma = 0.882911075530934; - var delta = 0.443506852043971; - var K = 1.230174104914001; - var K_ = 1 / K; - - // step 1 is combined with step 3 - - // step 2 - j = offset - 3; - for (n = len + 4; n--; j += 2) { - x[j] *= K_; - } - - // step 1 & 3 - j = offset - 2; - current = delta * x[j -1]; - for (n = len + 3; n--; j += 2) { - next = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - if (n--) { - j += 2; - current = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - } else { - break; - } - } - - // step 4 - j = offset - 1; - current = gamma * x[j - 1]; - for (n = len + 2; n--; j += 2) { - next = gamma * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = gamma * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 5 - j = offset; - current = beta * x[j - 1]; - for (n = len + 1; n--; j += 2) { - next = beta * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = beta * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 6 - if (len !== 0) { - j = offset + 1; - current = alpha * x[j - 1]; - for (n = len; n--; j += 2) { - next = alpha * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = alpha * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - } - }; - - return IrreversibleTransform; - })(); - - // Section 3.8.1 Reversible 5-3 filter - var ReversibleTransform = (function ReversibleTransformClosure() { - function ReversibleTransform() { - Transform.call(this); - } - - ReversibleTransform.prototype = Object.create(Transform.prototype); - ReversibleTransform.prototype.filter = - function reversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n; - - for (j = offset, n = len + 1; n--; j += 2) { - x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2; - } - - for (j = offset + 1, n = len; n--; j += 2) { - x[j] += (x[j - 1] + x[j + 1]) >> 1; - } - }; - - return ReversibleTransform; - })(); - - return JpxImage; -})(); - -exports.JpxImage = JpxImage; -})); - - - -(function (root, factory) { - { - factory((root.pdfjsCoreMurmurHash3 = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var Uint32ArrayView = sharedUtil.Uint32ArrayView; - -var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) { - // Workaround for missing math precison in JS. - var MASK_HIGH = 0xffff0000; - var MASK_LOW = 0xffff; - - function MurmurHash3_64 (seed) { - var SEED = 0xc3d2e1f0; - this.h1 = seed ? seed & 0xffffffff : SEED; - this.h2 = seed ? seed & 0xffffffff : SEED; - } - - var alwaysUseUint32ArrayView = false; - // old webkits have issues with non-aligned arrays - try { - new Uint32Array(new Uint8Array(5).buffer, 0, 1); - } catch (e) { - alwaysUseUint32ArrayView = true; - } - - MurmurHash3_64.prototype = { - update: function MurmurHash3_64_update(input) { - var useUint32ArrayView = alwaysUseUint32ArrayView; - var i; - if (typeof input === 'string') { - var data = new Uint8Array(input.length * 2); - var length = 0; - for (i = 0; i < input.length; i++) { - var code = input.charCodeAt(i); - if (code <= 0xff) { - data[length++] = code; - } - else { - data[length++] = code >>> 8; - data[length++] = code & 0xff; - } - } - } else if (input instanceof Uint8Array) { - data = input; - length = data.length; - } else if (typeof input === 'object' && ('length' in input)) { - // processing regular arrays as well, e.g. for IE9 - data = input; - length = data.length; - useUint32ArrayView = true; - } else { - throw new Error('Wrong data format in MurmurHash3_64_update. ' + - 'Input must be a string or array.'); - } - - var blockCounts = length >> 2; - var tailLength = length - blockCounts * 4; - // we don't care about endianness here - var dataUint32 = useUint32ArrayView ? - new Uint32ArrayView(data, blockCounts) : - new Uint32Array(data.buffer, 0, blockCounts); - var k1 = 0; - var k2 = 0; - var h1 = this.h1; - var h2 = this.h2; - var C1 = 0xcc9e2d51; - var C2 = 0x1b873593; - var C1_LOW = C1 & MASK_LOW; - var C2_LOW = C2 & MASK_LOW; - - for (i = 0; i < blockCounts; i++) { - if (i & 1) { - k1 = dataUint32[i]; - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 0xe6546b64; - } else { - k2 = dataUint32[i]; - k2 = (k2 * C1 & MASK_HIGH) | (k2 * C1_LOW & MASK_LOW); - k2 = k2 << 15 | k2 >>> 17; - k2 = (k2 * C2 & MASK_HIGH) | (k2 * C2_LOW & MASK_LOW); - h2 ^= k2; - h2 = h2 << 13 | h2 >>> 19; - h2 = h2 * 5 + 0xe6546b64; - } - } - - k1 = 0; - - switch (tailLength) { - case 3: - k1 ^= data[blockCounts * 4 + 2] << 16; - /* falls through */ - case 2: - k1 ^= data[blockCounts * 4 + 1] << 8; - /* falls through */ - case 1: - k1 ^= data[blockCounts * 4]; - /* falls through */ - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - if (blockCounts & 1) { - h1 ^= k1; - } else { - h2 ^= k1; - } - } - - this.h1 = h1; - this.h2 = h2; - return this; - }, - - hexdigest: function MurmurHash3_64_hexdigest () { - var h1 = this.h1; - var h2 = this.h2; - - h1 ^= h2 >>> 1; - h1 = (h1 * 0xed558ccd & MASK_HIGH) | (h1 * 0x8ccd & MASK_LOW); - h2 = (h2 * 0xff51afd7 & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - h1 = (h1 * 0x1a85ec53 & MASK_HIGH) | (h1 * 0xec53 & MASK_LOW); - h2 = (h2 * 0xc4ceb9fe & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - - for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { - var hex = (arr[i] >>> 0).toString(16); - while (hex.length < 8) { - hex = '0' + hex; - } - str += hex; - } - - return str; - } - }; - - return MurmurHash3_64; -})(); - -exports.MurmurHash3_64 = MurmurHash3_64; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePrimitives = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var isArray = sharedUtil.isArray; - -var Name = (function NameClosure() { - function Name(name) { - this.name = name; - } - - Name.prototype = {}; - - var nameCache = {}; - - Name.get = function Name_get(name) { - var nameValue = nameCache[name]; - return (nameValue ? nameValue : (nameCache[name] = new Name(name))); - }; - - return Name; -})(); - -var Cmd = (function CmdClosure() { - function Cmd(cmd) { - this.cmd = cmd; - } - - Cmd.prototype = {}; - - var cmdCache = {}; - - Cmd.get = function Cmd_get(cmd) { - var cmdValue = cmdCache[cmd]; - return (cmdValue ? cmdValue : (cmdCache[cmd] = new Cmd(cmd))); - }; - - return Cmd; -})(); - -var Dict = (function DictClosure() { - var nonSerializable = function nonSerializableClosure() { - return nonSerializable; // creating closure on some variable - }; - - var GETALL_DICTIONARY_TYPES_WHITELIST = { - 'Background': true, - 'ExtGState': true, - 'Halftone': true, - 'Layout': true, - 'Mask': true, - 'Pagination': true, - 'Printing': true - }; - - function isRecursionAllowedFor(dict) { - if (!isName(dict.Type)) { - return true; - } - var dictType = dict.Type.name; - return GETALL_DICTIONARY_TYPES_WHITELIST[dictType] === true; - } - - // xref is optional - function Dict(xref) { - // Map should only be used internally, use functions below to access. - this.map = Object.create(null); - this.xref = xref; - this.objId = null; - this.__nonSerializable__ = nonSerializable; // disable cloning of the Dict - } - - Dict.prototype = { - assignXref: function Dict_assignXref(newXref) { - this.xref = newXref; - }, - - // automatically dereferences Ref objects - get: function Dict_get(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - value = this.map[key3] || null; - return xref ? xref.fetchIfRef(value) : value; - }, - - // Same as get(), but returns a promise and uses fetchIfRefAsync(). - getAsync: function Dict_getAsync(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - value = this.map[key3] || null; - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - }, - - // Same as get(), but dereferences all elements if the result is an Array. - getArray: function Dict_getArray(key1, key2, key3) { - var value = this.get(key1, key2, key3); - var xref = this.xref; - if (!isArray(value) || !xref) { - return value; - } - value = value.slice(); // Ensure that we don't modify the Dict data. - for (var i = 0, ii = value.length; i < ii; i++) { - if (!isRef(value[i])) { - continue; - } - value[i] = xref.fetch(value[i]); - } - return value; - }, - - // no dereferencing - getRaw: function Dict_getRaw(key) { - return this.map[key]; - }, - - // creates new map and dereferences all Refs - getAll: function Dict_getAll() { - var all = Object.create(null); - var queue = null; - var key, obj; - for (key in this.map) { - obj = this.get(key); - if (obj instanceof Dict) { - if (isRecursionAllowedFor(obj)) { - (queue || (queue = [])).push({target: all, key: key, obj: obj}); - } else { - all[key] = this.getRaw(key); - } - } else { - all[key] = obj; - } - } - if (!queue) { - return all; - } - - // trying to take cyclic references into the account - var processed = Object.create(null); - while (queue.length > 0) { - var item = queue.shift(); - var itemObj = item.obj; - var objId = itemObj.objId; - if (objId && objId in processed) { - item.target[item.key] = processed[objId]; - continue; - } - var dereferenced = Object.create(null); - for (key in itemObj.map) { - obj = itemObj.get(key); - if (obj instanceof Dict) { - if (isRecursionAllowedFor(obj)) { - queue.push({target: dereferenced, key: key, obj: obj}); - } else { - dereferenced[key] = itemObj.getRaw(key); - } - } else { - dereferenced[key] = obj; - } - } - if (objId) { - processed[objId] = dereferenced; - } - item.target[item.key] = dereferenced; - } - return all; - }, - - getKeys: function Dict_getKeys() { - return Object.keys(this.map); - }, - - set: function Dict_set(key, value) { - this.map[key] = value; - }, - - has: function Dict_has(key) { - return key in this.map; - }, - - forEach: function Dict_forEach(callback) { - for (var key in this.map) { - callback(key, this.get(key)); - } - } - }; - - Dict.empty = new Dict(null); - - Dict.merge = function Dict_merge(xref, dictArray) { - var mergedDict = new Dict(xref); - - for (var i = 0, ii = dictArray.length; i < ii; i++) { - var dict = dictArray[i]; - if (!isDict(dict)) { - continue; - } - for (var keyName in dict.map) { - if (mergedDict.map[keyName]) { - continue; - } - mergedDict.map[keyName] = dict.map[keyName]; - } - } - return mergedDict; - }; - - return Dict; -})(); - -var Ref = (function RefClosure() { - function Ref(num, gen) { - this.num = num; - this.gen = gen; - } - - Ref.prototype = { - toString: function Ref_toString() { - // This function is hot, so we make the string as compact as possible. - // |this.gen| is almost always zero, so we treat that case specially. - var str = this.num + 'R'; - if (this.gen !== 0) { - str += this.gen; - } - return str; - } - }; - - return Ref; -})(); - -// The reference is identified by number and generation. -// This structure stores only one instance of the reference. -var RefSet = (function RefSetClosure() { - function RefSet() { - this.dict = {}; - } - - RefSet.prototype = { - has: function RefSet_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSet_put(ref) { - this.dict[ref.toString()] = true; - }, - - remove: function RefSet_remove(ref) { - delete this.dict[ref.toString()]; - } - }; - - return RefSet; -})(); - -var RefSetCache = (function RefSetCacheClosure() { - function RefSetCache() { - this.dict = Object.create(null); - } - - RefSetCache.prototype = { - get: function RefSetCache_get(ref) { - return this.dict[ref.toString()]; - }, - - has: function RefSetCache_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSetCache_put(ref, obj) { - this.dict[ref.toString()] = obj; - }, - - putAlias: function RefSetCache_putAlias(ref, aliasRef) { - this.dict[ref.toString()] = this.get(aliasRef); - }, - - forEach: function RefSetCache_forEach(fn, thisArg) { - for (var i in this.dict) { - fn.call(thisArg, this.dict[i]); - } - }, - - clear: function RefSetCache_clear() { - this.dict = Object.create(null); - } - }; - - return RefSetCache; -})(); - -function isName(v) { - return v instanceof Name; -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - if (!(v instanceof Dict)) { - return false; - } - if (!type) { - return true; - } - var dictType = v.get('Type'); - return isName(dictType) && dictType.name === type; -} - -function isRef(v) { - return v instanceof Ref; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -exports.Cmd = Cmd; -exports.Dict = Dict; -exports.Name = Name; -exports.Ref = Ref; -exports.RefSet = RefSet; -exports.RefSetCache = RefSetCache; -exports.isCmd = isCmd; -exports.isDict = isDict; -exports.isName = isName; -exports.isRef = isRef; -exports.isStream = isStream; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreStream = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreJbig2, root.pdfjsCoreJpg, - root.pdfjsCoreJpx); - } -}(this, function (exports, sharedUtil, corePrimitives, coreJbig2, coreJpg, - coreJpx) { - -var Util = sharedUtil.Util; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; -var Dict = corePrimitives.Dict; -var Jbig2Image = coreJbig2.Jbig2Image; -var JpegImage = coreJpg.JpegImage; -var JpxImage = coreJpx.JpxImage; - -var coreParser; // see _setCoreParser below -var EOF; // = coreParser.EOF; -var Lexer; // = coreParser.Lexer; - -var coreColorSpace; // see _setCoreColorSpace below -var ColorSpace; // = coreColorSpace.ColorSpace; - -var Stream = (function StreamClosure() { - function Stream(arrayBuffer, start, length, dict) { - this.bytes = (arrayBuffer instanceof Uint8Array ? - arrayBuffer : new Uint8Array(arrayBuffer)); - this.start = start || 0; - this.pos = this.start; - this.end = (start + length) || this.bytes.length; - this.dict = dict; - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - Stream.prototype = { - get length() { - return this.end - this.start; - }, - get isEmpty() { - return this.length === 0; - }, - getByte: function Stream_getByte() { - if (this.pos >= this.end) { - return -1; - } - return this.bytes[this.pos++]; - }, - getUint16: function Stream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function Stream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - // returns subarray of original buffer - // should only be read - getBytes: function Stream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - return bytes.subarray(pos, strEnd); - } - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.pos = end; - return bytes.subarray(pos, end); - }, - peekByte: function Stream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function Stream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - skip: function Stream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function Stream_reset() { - this.pos = this.start; - }, - moveStart: function Stream_moveStart() { - this.start = this.pos; - }, - makeSubStream: function Stream_makeSubStream(start, length, dict) { - return new Stream(this.bytes.buffer, start, length, dict); - }, - isStream: true - }; - - return Stream; -})(); - -var StringStream = (function StringStreamClosure() { - function StringStream(str) { - var length = str.length; - var bytes = new Uint8Array(length); - for (var n = 0; n < length; ++n) { - bytes[n] = str.charCodeAt(n); - } - Stream.call(this, bytes); - } - - StringStream.prototype = Stream.prototype; - - return StringStream; -})(); - -// super class for the decoding streams -var DecodeStream = (function DecodeStreamClosure() { - // Lots of DecodeStreams are created whose buffers are never used. For these - // we share a single empty buffer. This is (a) space-efficient and (b) avoids - // having special cases that would be required if we used |null| for an empty - // buffer. - var emptyBuffer = new Uint8Array(0); - - function DecodeStream(maybeMinBufferLength) { - this.pos = 0; - this.bufferLength = 0; - this.eof = false; - this.buffer = emptyBuffer; - this.minBufferLength = 512; - if (maybeMinBufferLength) { - // Compute the first power of two that is as big as maybeMinBufferLength. - while (this.minBufferLength < maybeMinBufferLength) { - this.minBufferLength *= 2; - } - } - } - - DecodeStream.prototype = { - get isEmpty() { - while (!this.eof && this.bufferLength === 0) { - this.readBlock(); - } - return this.bufferLength === 0; - }, - ensureBuffer: function DecodeStream_ensureBuffer(requested) { - var buffer = this.buffer; - if (requested <= buffer.byteLength) { - return buffer; - } - var size = this.minBufferLength; - while (size < requested) { - size *= 2; - } - var buffer2 = new Uint8Array(size); - buffer2.set(buffer); - return (this.buffer = buffer2); - }, - getByte: function DecodeStream_getByte() { - var pos = this.pos; - while (this.bufferLength <= pos) { - if (this.eof) { - return -1; - } - this.readBlock(); - } - return this.buffer[this.pos++]; - }, - getUint16: function DecodeStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function DecodeStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - getBytes: function DecodeStream_getBytes(length) { - var end, pos = this.pos; - - if (length) { - this.ensureBuffer(pos + length); - end = pos + length; - - while (!this.eof && this.bufferLength < end) { - this.readBlock(); - } - var bufEnd = this.bufferLength; - if (end > bufEnd) { - end = bufEnd; - } - } else { - while (!this.eof) { - this.readBlock(); - } - end = this.bufferLength; - } - - this.pos = end; - return this.buffer.subarray(pos, end); - }, - peekByte: function DecodeStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function DecodeStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { - var end = start + length; - while (this.bufferLength <= end && !this.eof) { - this.readBlock(); - } - return new Stream(this.buffer, start, length, dict); - }, - skip: function DecodeStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function DecodeStream_reset() { - this.pos = 0; - }, - getBaseStreams: function DecodeStream_getBaseStreams() { - if (this.str && this.str.getBaseStreams) { - return this.str.getBaseStreams(); - } - return []; - } - }; - - return DecodeStream; -})(); - -var StreamsSequenceStream = (function StreamsSequenceStreamClosure() { - function StreamsSequenceStream(streams) { - this.streams = streams; - DecodeStream.call(this, /* maybeLength = */ null); - } - - StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); - - StreamsSequenceStream.prototype.readBlock = - function streamSequenceStreamReadBlock() { - - var streams = this.streams; - if (streams.length === 0) { - this.eof = true; - return; - } - var stream = streams.shift(); - var chunk = stream.getBytes(); - var bufferLength = this.bufferLength; - var newLength = bufferLength + chunk.length; - var buffer = this.ensureBuffer(newLength); - buffer.set(chunk, bufferLength); - this.bufferLength = newLength; - }; - - StreamsSequenceStream.prototype.getBaseStreams = - function StreamsSequenceStream_getBaseStreams() { - - var baseStreams = []; - for (var i = 0, ii = this.streams.length; i < ii; i++) { - var stream = this.streams[i]; - if (stream.getBaseStreams) { - Util.appendToArray(baseStreams, stream.getBaseStreams()); - } - } - return baseStreams; - }; - - return StreamsSequenceStream; -})(); - -var FlateStream = (function FlateStreamClosure() { - var codeLenCodeMap = new Int32Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - ]); - - var lengthDecode = new Int32Array([ - 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, - 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, - 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, - 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102 - ]); - - var distDecode = new Int32Array([ - 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, - 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, - 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, - 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001 - ]); - - var fixedLitCodeTab = [new Int32Array([ - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, - 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, - 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, - 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, - 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, - 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, - 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, - 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, - 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, - 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, - 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, - 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, - 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, - 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, - 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, - 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, - 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, - 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, - 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, - 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, - 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, - 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, - 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, - 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, - 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, - 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, - 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, - 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, - 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, - 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, - 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, - 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, - 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, - 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, - 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, - 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, - 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, - 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, - 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, - 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, - 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, - 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, - 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, - 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, - 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, - 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, - 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, - 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, - 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff - ]), 9]; - - var fixedDistCodeTab = [new Int32Array([ - 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, - 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, - 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, - 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000 - ]), 5]; - - function FlateStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - var cmf = str.getByte(); - var flg = str.getByte(); - if (cmf === -1 || flg === -1) { - error('Invalid header in flate stream: ' + cmf + ', ' + flg); - } - if ((cmf & 0x0f) !== 0x08) { - error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); - } - if ((((cmf << 8) + flg) % 31) !== 0) { - error('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); - } - if (flg & 0x20) { - error('FDICT bit set in flate stream: ' + cmf + ', ' + flg); - } - - this.codeSize = 0; - this.codeBuf = 0; - - DecodeStream.call(this, maybeLength); - } - - FlateStream.prototype = Object.create(DecodeStream.prototype); - - FlateStream.prototype.getBits = function FlateStream_getBits(bits) { - var str = this.str; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < bits) { - if ((b = str.getByte()) === -1) { - error('Bad encoding in flate stream'); - } - codeBuf |= b << codeSize; - codeSize += 8; - } - b = codeBuf & ((1 << bits) - 1); - this.codeBuf = codeBuf >> bits; - this.codeSize = codeSize -= bits; - - return b; - }; - - FlateStream.prototype.getCode = function FlateStream_getCode(table) { - var str = this.str; - var codes = table[0]; - var maxLen = table[1]; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < maxLen) { - if ((b = str.getByte()) === -1) { - // premature end of stream. code might however still be valid. - // codeSize < codeLen check below guards against incomplete codeVal. - break; - } - codeBuf |= (b << codeSize); - codeSize += 8; - } - var code = codes[codeBuf & ((1 << maxLen) - 1)]; - var codeLen = code >> 16; - var codeVal = code & 0xffff; - if (codeLen < 1 || codeSize < codeLen) { - error('Bad encoding in flate stream'); - } - this.codeBuf = (codeBuf >> codeLen); - this.codeSize = (codeSize - codeLen); - return codeVal; - }; - - FlateStream.prototype.generateHuffmanTable = - function flateStreamGenerateHuffmanTable(lengths) { - var n = lengths.length; - - // find max code length - var maxLen = 0; - var i; - for (i = 0; i < n; ++i) { - if (lengths[i] > maxLen) { - maxLen = lengths[i]; - } - } - - // build the table - var size = 1 << maxLen; - var codes = new Int32Array(size); - for (var len = 1, code = 0, skip = 2; - len <= maxLen; - ++len, code <<= 1, skip <<= 1) { - for (var val = 0; val < n; ++val) { - if (lengths[val] === len) { - // bit-reverse the code - var code2 = 0; - var t = code; - for (i = 0; i < len; ++i) { - code2 = (code2 << 1) | (t & 1); - t >>= 1; - } - - // fill the table entries - for (i = code2; i < size; i += skip) { - codes[i] = (len << 16) | val; - } - ++code; - } - } - } - - return [codes, maxLen]; - }; - - FlateStream.prototype.readBlock = function FlateStream_readBlock() { - var buffer, len; - var str = this.str; - // read block header - var hdr = this.getBits(3); - if (hdr & 1) { - this.eof = true; - } - hdr >>= 1; - - if (hdr === 0) { // uncompressed block - var b; - - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var blockLen = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - blockLen |= (b << 8); - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var check = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - check |= (b << 8); - if (check !== (~blockLen & 0xffff) && - (blockLen !== 0 || check !== 0)) { - // Ignoring error for bad "empty" block (see issue 1277) - error('Bad uncompressed block length in flate stream'); - } - - this.codeBuf = 0; - this.codeSize = 0; - - var bufferLength = this.bufferLength; - buffer = this.ensureBuffer(bufferLength + blockLen); - var end = bufferLength + blockLen; - this.bufferLength = end; - if (blockLen === 0) { - if (str.peekByte() === -1) { - this.eof = true; - } - } else { - for (var n = bufferLength; n < end; ++n) { - if ((b = str.getByte()) === -1) { - this.eof = true; - break; - } - buffer[n] = b; - } - } - return; - } - - var litCodeTable; - var distCodeTable; - if (hdr === 1) { // compressed block, fixed codes - litCodeTable = fixedLitCodeTab; - distCodeTable = fixedDistCodeTab; - } else if (hdr === 2) { // compressed block, dynamic codes - var numLitCodes = this.getBits(5) + 257; - var numDistCodes = this.getBits(5) + 1; - var numCodeLenCodes = this.getBits(4) + 4; - - // build the code lengths code table - var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); - - var i; - for (i = 0; i < numCodeLenCodes; ++i) { - codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); - } - var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); - - // build the literal and distance code tables - len = 0; - i = 0; - var codes = numLitCodes + numDistCodes; - var codeLengths = new Uint8Array(codes); - var bitsLength, bitsOffset, what; - while (i < codes) { - var code = this.getCode(codeLenCodeTab); - if (code === 16) { - bitsLength = 2; bitsOffset = 3; what = len; - } else if (code === 17) { - bitsLength = 3; bitsOffset = 3; what = (len = 0); - } else if (code === 18) { - bitsLength = 7; bitsOffset = 11; what = (len = 0); - } else { - codeLengths[i++] = len = code; - continue; - } - - var repeatLength = this.getBits(bitsLength) + bitsOffset; - while (repeatLength-- > 0) { - codeLengths[i++] = what; - } - } - - litCodeTable = - this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); - distCodeTable = - this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); - } else { - error('Unknown block type in flate stream'); - } - - buffer = this.buffer; - var limit = buffer ? buffer.length : 0; - var pos = this.bufferLength; - while (true) { - var code1 = this.getCode(litCodeTable); - if (code1 < 256) { - if (pos + 1 >= limit) { - buffer = this.ensureBuffer(pos + 1); - limit = buffer.length; - } - buffer[pos++] = code1; - continue; - } - if (code1 === 256) { - this.bufferLength = pos; - return; - } - code1 -= 257; - code1 = lengthDecode[code1]; - var code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - len = (code1 & 0xffff) + code2; - code1 = this.getCode(distCodeTable); - code1 = distDecode[code1]; - code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - var dist = (code1 & 0xffff) + code2; - if (pos + len >= limit) { - buffer = this.ensureBuffer(pos + len); - limit = buffer.length; - } - for (var k = 0; k < len; ++k, ++pos) { - buffer[pos] = buffer[pos - dist]; - } - } - }; - - return FlateStream; -})(); - -var PredictorStream = (function PredictorStreamClosure() { - function PredictorStream(str, maybeLength, params) { - var predictor = this.predictor = params.get('Predictor') || 1; - - if (predictor <= 1) { - return str; // no prediction - } - if (predictor !== 2 && (predictor < 10 || predictor > 15)) { - error('Unsupported predictor: ' + predictor); - } - - if (predictor === 2) { - this.readBlock = this.readBlockTiff; - } else { - this.readBlock = this.readBlockPng; - } - - this.str = str; - this.dict = str.dict; - - var colors = this.colors = params.get('Colors') || 1; - var bits = this.bits = params.get('BitsPerComponent') || 8; - var columns = this.columns = params.get('Columns') || 1; - - this.pixBytes = (colors * bits + 7) >> 3; - this.rowBytes = (columns * colors * bits + 7) >> 3; - - DecodeStream.call(this, maybeLength); - return this; - } - - PredictorStream.prototype = Object.create(DecodeStream.prototype); - - PredictorStream.prototype.readBlockTiff = - function predictorStreamReadBlockTiff() { - var rowBytes = this.rowBytes; - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var bits = this.bits; - var colors = this.colors; - - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var inbuf = 0, outbuf = 0; - var inbits = 0, outbits = 0; - var pos = bufferLength; - var i; - - if (bits === 1) { - for (i = 0; i < rowBytes; ++i) { - var c = rawBytes[i]; - inbuf = (inbuf << 8) | c; - // bitwise addition is exclusive or - // first shift inbuf and then add - buffer[pos++] = (c ^ (inbuf >> colors)) & 0xFF; - // truncate inbuf (assumes colors < 16) - inbuf &= 0xFFFF; - } - } else if (bits === 8) { - for (i = 0; i < colors; ++i) { - buffer[pos++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[pos] = buffer[pos - colors] + rawBytes[i]; - pos++; - } - } else { - var compArray = new Uint8Array(colors + 1); - var bitMask = (1 << bits) - 1; - var j = 0, k = bufferLength; - var columns = this.columns; - for (i = 0; i < columns; ++i) { - for (var kk = 0; kk < colors; ++kk) { - if (inbits < bits) { - inbuf = (inbuf << 8) | (rawBytes[j++] & 0xFF); - inbits += 8; - } - compArray[kk] = (compArray[kk] + - (inbuf >> (inbits - bits))) & bitMask; - inbits -= bits; - outbuf = (outbuf << bits) | compArray[kk]; - outbits += bits; - if (outbits >= 8) { - buffer[k++] = (outbuf >> (outbits - 8)) & 0xFF; - outbits -= 8; - } - } - } - if (outbits > 0) { - buffer[k++] = (outbuf << (8 - outbits)) + - (inbuf & ((1 << (8 - outbits)) - 1)); - } - } - this.bufferLength += rowBytes; - }; - - PredictorStream.prototype.readBlockPng = - function predictorStreamReadBlockPng() { - - var rowBytes = this.rowBytes; - var pixBytes = this.pixBytes; - - var predictor = this.str.getByte(); - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); - if (prevRow.length === 0) { - prevRow = new Uint8Array(rowBytes); - } - - var i, j = bufferLength, up, c; - switch (predictor) { - case 0: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - break; - case 1: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (buffer[j - pixBytes] + rawBytes[i]) & 0xFF; - j++; - } - break; - case 2: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = (prevRow[i] + rawBytes[i]) & 0xFF; - } - break; - case 3: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (((prevRow[i] + buffer[j - pixBytes]) >> 1) + - rawBytes[i]) & 0xFF; - j++; - } - break; - case 4: - // we need to save the up left pixels values. the simplest way - // is to create a new buffer - for (i = 0; i < pixBytes; ++i) { - up = prevRow[i]; - c = rawBytes[i]; - buffer[j++] = up + c; - } - for (; i < rowBytes; ++i) { - up = prevRow[i]; - var upLeft = prevRow[i - pixBytes]; - var left = buffer[j - pixBytes]; - var p = left + up - upLeft; - - var pa = p - left; - if (pa < 0) { - pa = -pa; - } - var pb = p - up; - if (pb < 0) { - pb = -pb; - } - var pc = p - upLeft; - if (pc < 0) { - pc = -pc; - } - - c = rawBytes[i]; - if (pa <= pb && pa <= pc) { - buffer[j++] = left + c; - } else if (pb <= pc) { - buffer[j++] = up + c; - } else { - buffer[j++] = upLeft + c; - } - } - break; - default: - error('Unsupported predictor: ' + predictor); - } - this.bufferLength += rowBytes; - }; - - return PredictorStream; -})(); - -/** - * Depending on the type of JPEG a JpegStream is handled in different ways. For - * JPEG's that are supported natively such as DeviceGray and DeviceRGB the image - * data is stored and then loaded by the browser. For unsupported JPEG's we use - * a library to decode these images and the stream behaves like all the other - * DecodeStreams. - */ -var JpegStream = (function JpegStreamClosure() { - function JpegStream(stream, maybeLength, dict, xref) { - // Some images may contain 'junk' before the SOI (start-of-image) marker. - // Note: this seems to mainly affect inline images. - var ch; - while ((ch = stream.getByte()) !== -1) { - if (ch === 0xFF) { // Find the first byte of the SOI marker (0xFFD8). - stream.skip(-1); // Reset the stream position to the SOI. - break; - } - } - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpegStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpegStream.prototype, 'bytes', { - get: function JpegStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - try { - var jpegImage = new JpegImage(); - - // checking if values needs to be transformed before conversion - if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) { - var decodeArr = this.dict.get('Decode'); - var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; - var decodeArrLength = decodeArr.length; - var transform = new Int32Array(decodeArrLength); - var transformNeeded = false; - var maxValue = (1 << bitsPerComponent) - 1; - for (var i = 0; i < decodeArrLength; i += 2) { - transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0; - transform[i + 1] = (decodeArr[i] * maxValue) | 0; - if (transform[i] !== 256 || transform[i + 1] !== 0) { - transformNeeded = true; - } - } - if (transformNeeded) { - jpegImage.decodeTransform = transform; - } - } - - jpegImage.parse(this.bytes); - var data = jpegImage.getData(this.drawWidth, this.drawHeight, - this.forceRGB); - this.buffer = data; - this.bufferLength = data.length; - this.eof = true; - } catch (e) { - error('JPEG error: ' + e); - } - }; - - JpegStream.prototype.getBytes = function JpegStream_getBytes(length) { - this.ensureBuffer(); - return this.buffer; - }; - - JpegStream.prototype.getIR = function JpegStream_getIR() { - return PDFJS.createObjectURL(this.bytes, 'image/jpeg'); - }; - /** - * Checks if the image can be decoded and displayed by the browser without any - * further processing such as color space conversions. - */ - JpegStream.prototype.isNativelySupported = - function JpegStream_isNativelySupported(xref, res) { - var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); - return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && - cs.isDefaultDecode(this.dict.get('Decode', 'D')); - }; - /** - * Checks if the image can be decoded by the browser. - */ - JpegStream.prototype.isNativelyDecodable = - function JpegStream_isNativelyDecodable(xref, res) { - var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); - return (cs.numComps === 1 || cs.numComps === 3) && - cs.isDefaultDecode(this.dict.get('Decode', 'D')); - }; - - return JpegStream; -})(); - -/** - * For JPEG 2000's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var JpxStream = (function JpxStreamClosure() { - function JpxStream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpxStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpxStream.prototype, 'bytes', { - get: function JpxStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jpxImage = new JpxImage(); - jpxImage.parse(this.bytes); - - var width = jpxImage.width; - var height = jpxImage.height; - var componentsCount = jpxImage.componentsCount; - var tileCount = jpxImage.tiles.length; - if (tileCount === 1) { - this.buffer = jpxImage.tiles[0].items; - } else { - var data = new Uint8Array(width * height * componentsCount); - - for (var k = 0; k < tileCount; k++) { - var tileComponents = jpxImage.tiles[k]; - var tileWidth = tileComponents.width; - var tileHeight = tileComponents.height; - var tileLeft = tileComponents.left; - var tileTop = tileComponents.top; - - var src = tileComponents.items; - var srcPosition = 0; - var dataPosition = (width * tileTop + tileLeft) * componentsCount; - var imgRowSize = width * componentsCount; - var tileRowSize = tileWidth * componentsCount; - - for (var j = 0; j < tileHeight; j++) { - var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); - data.set(rowBytes, dataPosition); - srcPosition += tileRowSize; - dataPosition += imgRowSize; - } - } - this.buffer = data; - } - this.bufferLength = this.buffer.length; - this.eof = true; - }; - - return JpxStream; -})(); - -/** - * For JBIG2's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var Jbig2Stream = (function Jbig2StreamClosure() { - function Jbig2Stream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - Jbig2Stream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(Jbig2Stream.prototype, 'bytes', { - get: function Jbig2Stream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jbig2Image = new Jbig2Image(); - - var chunks = [], xref = this.dict.xref; - var decodeParams = xref.fetchIfRef(this.dict.get('DecodeParms')); - - // According to the PDF specification, DecodeParms can be either - // a dictionary, or an array whose elements are dictionaries. - if (isArray(decodeParams)) { - if (decodeParams.length > 1) { - warn('JBIG2 - \'DecodeParms\' array with multiple elements ' + - 'not supported.'); - } - decodeParams = xref.fetchIfRef(decodeParams[0]); - } - if (decodeParams && decodeParams.has('JBIG2Globals')) { - var globalsStream = decodeParams.get('JBIG2Globals'); - var globals = globalsStream.getBytes(); - chunks.push({data: globals, start: 0, end: globals.length}); - } - chunks.push({data: this.bytes, start: 0, end: this.bytes.length}); - var data = jbig2Image.parseChunks(chunks); - var dataLength = data.length; - - // JBIG2 had black as 1 and white as 0, inverting the colors - for (var i = 0; i < dataLength; i++) { - data[i] ^= 0xFF; - } - - this.buffer = data; - this.bufferLength = dataLength; - this.eof = true; - }; - - return Jbig2Stream; -})(); - -var DecryptStream = (function DecryptStreamClosure() { - function DecryptStream(str, maybeLength, decrypt) { - this.str = str; - this.dict = str.dict; - this.decrypt = decrypt; - this.nextChunk = null; - this.initialized = false; - - DecodeStream.call(this, maybeLength); - } - - var chunkSize = 512; - - DecryptStream.prototype = Object.create(DecodeStream.prototype); - - DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { - var chunk; - if (this.initialized) { - chunk = this.nextChunk; - } else { - chunk = this.str.getBytes(chunkSize); - this.initialized = true; - } - if (!chunk || chunk.length === 0) { - this.eof = true; - return; - } - this.nextChunk = this.str.getBytes(chunkSize); - var hasMoreData = this.nextChunk && this.nextChunk.length > 0; - - var decrypt = this.decrypt; - chunk = decrypt(chunk, !hasMoreData); - - var bufferLength = this.bufferLength; - var i, n = chunk.length; - var buffer = this.ensureBuffer(bufferLength + n); - for (i = 0; i < n; i++) { - buffer[bufferLength++] = chunk[i]; - } - this.bufferLength = bufferLength; - }; - - return DecryptStream; -})(); - -var Ascii85Stream = (function Ascii85StreamClosure() { - function Ascii85Stream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - this.input = new Uint8Array(5); - - // Most streams increase in size when decoded, but Ascii85 streams - // typically shrink by ~20%. - if (maybeLength) { - maybeLength = 0.8 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - Ascii85Stream.prototype = Object.create(DecodeStream.prototype); - - Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { - var TILDA_CHAR = 0x7E; // '~' - var Z_LOWER_CHAR = 0x7A; // 'z' - var EOF = -1; - - var str = this.str; - - var c = str.getByte(); - while (Lexer.isSpace(c)) { - c = str.getByte(); - } - - if (c === EOF || c === TILDA_CHAR) { - this.eof = true; - return; - } - - var bufferLength = this.bufferLength, buffer; - var i; - - // special code for z - if (c === Z_LOWER_CHAR) { - buffer = this.ensureBuffer(bufferLength + 4); - for (i = 0; i < 4; ++i) { - buffer[bufferLength + i] = 0; - } - this.bufferLength += 4; - } else { - var input = this.input; - input[0] = c; - for (i = 1; i < 5; ++i) { - c = str.getByte(); - while (Lexer.isSpace(c)) { - c = str.getByte(); - } - - input[i] = c; - - if (c === EOF || c === TILDA_CHAR) { - break; - } - } - buffer = this.ensureBuffer(bufferLength + i - 1); - this.bufferLength += i - 1; - - // partial ending; - if (i < 5) { - for (; i < 5; ++i) { - input[i] = 0x21 + 84; - } - this.eof = true; - } - var t = 0; - for (i = 0; i < 5; ++i) { - t = t * 85 + (input[i] - 0x21); - } - - for (i = 3; i >= 0; --i) { - buffer[bufferLength + i] = t & 0xFF; - t >>= 8; - } - } - }; - - return Ascii85Stream; -})(); - -var AsciiHexStream = (function AsciiHexStreamClosure() { - function AsciiHexStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - this.firstDigit = -1; - - // Most streams increase in size when decoded, but AsciiHex streams shrink - // by 50%. - if (maybeLength) { - maybeLength = 0.5 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - AsciiHexStream.prototype = Object.create(DecodeStream.prototype); - - AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { - var UPSTREAM_BLOCK_SIZE = 8000; - var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); - if (!bytes.length) { - this.eof = true; - return; - } - - var maxDecodeLength = (bytes.length + 1) >> 1; - var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); - var bufferLength = this.bufferLength; - - var firstDigit = this.firstDigit; - for (var i = 0, ii = bytes.length; i < ii; i++) { - var ch = bytes[i], digit; - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - digit = ch & 0x0F; - } else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'Z', 'a'-'z' - digit = (ch & 0x0F) + 9; - } else if (ch === 0x3E) { // '>' - this.eof = true; - break; - } else { // probably whitespace - continue; // ignoring - } - if (firstDigit < 0) { - firstDigit = digit; - } else { - buffer[bufferLength++] = (firstDigit << 4) | digit; - firstDigit = -1; - } - } - if (firstDigit >= 0 && this.eof) { - // incomplete byte - buffer[bufferLength++] = (firstDigit << 4); - firstDigit = -1; - } - this.firstDigit = firstDigit; - this.bufferLength = bufferLength; - }; - - return AsciiHexStream; -})(); - -var RunLengthStream = (function RunLengthStreamClosure() { - function RunLengthStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - DecodeStream.call(this, maybeLength); - } - - RunLengthStream.prototype = Object.create(DecodeStream.prototype); - - RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { - // The repeatHeader has following format. The first byte defines type of run - // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes - // (in addition to the second byte from the header), n = 129 through 255 - - // duplicate the second byte from the header (257 - n) times, n = 128 - end. - var repeatHeader = this.str.getBytes(2); - if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { - this.eof = true; - return; - } - - var buffer; - var bufferLength = this.bufferLength; - var n = repeatHeader[0]; - if (n < 128) { - // copy n bytes - buffer = this.ensureBuffer(bufferLength + n + 1); - buffer[bufferLength++] = repeatHeader[1]; - if (n > 0) { - var source = this.str.getBytes(n); - buffer.set(source, bufferLength); - bufferLength += n; - } - } else { - n = 257 - n; - var b = repeatHeader[1]; - buffer = this.ensureBuffer(bufferLength + n + 1); - for (var i = 0; i < n; i++) { - buffer[bufferLength++] = b; - } - } - this.bufferLength = bufferLength; - }; - - return RunLengthStream; -})(); - -var CCITTFaxStream = (function CCITTFaxStreamClosure() { - - var ccittEOL = -2; - var twoDimPass = 0; - var twoDimHoriz = 1; - var twoDimVert0 = 2; - var twoDimVertR1 = 3; - var twoDimVertL1 = 4; - var twoDimVertR2 = 5; - var twoDimVertL2 = 6; - var twoDimVertR3 = 7; - var twoDimVertL3 = 8; - - var twoDimTable = [ - [-1, -1], [-1, -1], // 000000x - [7, twoDimVertL3], // 0000010 - [7, twoDimVertR3], // 0000011 - [6, twoDimVertL2], [6, twoDimVertL2], // 000010x - [6, twoDimVertR2], [6, twoDimVertR2], // 000011x - [4, twoDimPass], [4, twoDimPass], // 0001xxx - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0] - ]; - - var whiteTable1 = [ - [-1, -1], // 00000 - [12, ccittEOL], // 00001 - [-1, -1], [-1, -1], // 0001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx - [11, 1792], [11, 1792], // 1000x - [12, 1984], // 10010 - [12, 2048], // 10011 - [12, 2112], // 10100 - [12, 2176], // 10101 - [12, 2240], // 10110 - [12, 2304], // 10111 - [11, 1856], [11, 1856], // 1100x - [11, 1920], [11, 1920], // 1101x - [12, 2368], // 11100 - [12, 2432], // 11101 - [12, 2496], // 11110 - [12, 2560] // 11111 - ]; - - var whiteTable2 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx - [8, 29], [8, 29], // 00000010x - [8, 30], [8, 30], // 00000011x - [8, 45], [8, 45], // 00000100x - [8, 46], [8, 46], // 00000101x - [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx - [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx - [8, 47], [8, 47], // 00001010x - [8, 48], [8, 48], // 00001011x - [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx - [6, 13], [6, 13], [6, 13], [6, 13], - [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx - [8, 33], [8, 33], // 00010010x - [8, 34], [8, 34], // 00010011x - [8, 35], [8, 35], // 00010100x - [8, 36], [8, 36], // 00010101x - [8, 37], [8, 37], // 00010110x - [8, 38], [8, 38], // 00010111x - [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx - [8, 31], [8, 31], // 00011010x - [8, 32], [8, 32], // 00011011x - [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx - [6, 1], [6, 1], [6, 1], [6, 1], - [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx - [6, 12], [6, 12], [6, 12], [6, 12], - [8, 53], [8, 53], // 00100100x - [8, 54], [8, 54], // 00100101x - [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx - [8, 39], [8, 39], // 00101000x - [8, 40], [8, 40], // 00101001x - [8, 41], [8, 41], // 00101010x - [8, 42], [8, 42], // 00101011x - [8, 43], [8, 43], // 00101100x - [8, 44], [8, 44], // 00101101x - [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx - [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx - [8, 61], [8, 61], // 00110010x - [8, 62], [8, 62], // 00110011x - [8, 63], [8, 63], // 00110100x - [8, 0], [8, 0], // 00110101x - [8, 320], [8, 320], // 00110110x - [8, 384], [8, 384], // 00110111x - [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx - [8, 59], [8, 59], // 01001010x - [8, 60], [8, 60], // 01001011x - [9, 1472], // 010011000 - [9, 1536], // 010011001 - [9, 1600], // 010011010 - [9, 1728], // 010011011 - [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx - [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx - [8, 49], [8, 49], // 01010010x - [8, 50], [8, 50], // 01010011x - [8, 51], [8, 51], // 01010100x - [8, 52], [8, 52], // 01010101x - [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx - [8, 55], [8, 55], // 01011000x - [8, 56], [8, 56], // 01011001x - [8, 57], [8, 57], // 01011010x - [8, 58], [8, 58], // 01011011x - [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx - [6, 192], [6, 192], [6, 192], [6, 192], - [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx - [6, 1664], [6, 1664], [6, 1664], [6, 1664], - [8, 448], [8, 448], // 01100100x - [8, 512], [8, 512], // 01100101x - [9, 704], // 011001100 - [9, 768], // 011001101 - [8, 640], [8, 640], // 01100111x - [8, 576], [8, 576], // 01101000x - [9, 832], // 011010010 - [9, 896], // 011010011 - [9, 960], // 011010100 - [9, 1024], // 011010101 - [9, 1088], // 011010110 - [9, 1152], // 011010111 - [9, 1216], // 011011000 - [9, 1280], // 011011001 - [9, 1344], // 011011010 - [9, 1408], // 011011011 - [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx - [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx - [6, 16], [6, 16], [6, 16], [6, 16], - [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx - [6, 17], [6, 17], [6, 17], [6, 17], - [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx - [6, 14], [6, 14], [6, 14], [6, 14], - [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx - [6, 15], [6, 15], [6, 15], [6, 15], - [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7] - ]; - - var blackTable1 = [ - [-1, -1], [-1, -1], // 000000000000x - [12, ccittEOL], [12, ccittEOL], // 000000000001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx - [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx - [12, 1984], [12, 1984], // 000000010010x - [12, 2048], [12, 2048], // 000000010011x - [12, 2112], [12, 2112], // 000000010100x - [12, 2176], [12, 2176], // 000000010101x - [12, 2240], [12, 2240], // 000000010110x - [12, 2304], [12, 2304], // 000000010111x - [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx - [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx - [12, 2368], [12, 2368], // 000000011100x - [12, 2432], [12, 2432], // 000000011101x - [12, 2496], [12, 2496], // 000000011110x - [12, 2560], [12, 2560], // 000000011111x - [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx - [10, 18], [10, 18], [10, 18], [10, 18], - [12, 52], [12, 52], // 000000100100x - [13, 640], // 0000001001010 - [13, 704], // 0000001001011 - [13, 768], // 0000001001100 - [13, 832], // 0000001001101 - [12, 55], [12, 55], // 000000100111x - [12, 56], [12, 56], // 000000101000x - [13, 1280], // 0000001010010 - [13, 1344], // 0000001010011 - [13, 1408], // 0000001010100 - [13, 1472], // 0000001010101 - [12, 59], [12, 59], // 000000101011x - [12, 60], [12, 60], // 000000101100x - [13, 1536], // 0000001011010 - [13, 1600], // 0000001011011 - [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx - [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx - [13, 1664], // 0000001100100 - [13, 1728], // 0000001100101 - [12, 320], [12, 320], // 000000110011x - [12, 384], [12, 384], // 000000110100x - [12, 448], [12, 448], // 000000110101x - [13, 512], // 0000001101100 - [13, 576], // 0000001101101 - [12, 53], [12, 53], // 000000110111x - [12, 54], [12, 54], // 000000111000x - [13, 896], // 0000001110010 - [13, 960], // 0000001110011 - [13, 1024], // 0000001110100 - [13, 1088], // 0000001110101 - [13, 1152], // 0000001110110 - [13, 1216], // 0000001110111 - [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx - [10, 64], [10, 64], [10, 64], [10, 64] - ]; - - var blackTable2 = [ - [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [11, 23], [11, 23], // 00000101000x - [12, 50], // 000001010010 - [12, 51], // 000001010011 - [12, 44], // 000001010100 - [12, 45], // 000001010101 - [12, 46], // 000001010110 - [12, 47], // 000001010111 - [12, 57], // 000001011000 - [12, 58], // 000001011001 - [12, 61], // 000001011010 - [12, 256], // 000001011011 - [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx - [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx - [12, 48], // 000001100100 - [12, 49], // 000001100101 - [12, 62], // 000001100110 - [12, 63], // 000001100111 - [12, 30], // 000001101000 - [12, 31], // 000001101001 - [12, 32], // 000001101010 - [12, 33], // 000001101011 - [12, 40], // 000001101100 - [12, 41], // 000001101101 - [11, 22], [11, 22], // 00000110111x - [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx - [9, 15], [9, 15], [9, 15], [9, 15], - [12, 128], // 000011001000 - [12, 192], // 000011001001 - [12, 26], // 000011001010 - [12, 27], // 000011001011 - [12, 28], // 000011001100 - [12, 29], // 000011001101 - [11, 19], [11, 19], // 00001100111x - [11, 20], [11, 20], // 00001101000x - [12, 34], // 000011010010 - [12, 35], // 000011010011 - [12, 36], // 000011010100 - [12, 37], // 000011010101 - [12, 38], // 000011010110 - [12, 39], // 000011010111 - [11, 21], [11, 21], // 00001101100x - [12, 42], // 000011011010 - [12, 43], // 000011011011 - [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx - [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12] - ]; - - var blackTable3 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx - [6, 9], // 000100 - [6, 8], // 000101 - [5, 7], [5, 7], // 00011x - [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx - [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx - [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx - [3, 1], [3, 1], [3, 1], [3, 1], - [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx - [3, 4], [3, 4], [3, 4], [3, 4], - [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2] - ]; - - function CCITTFaxStream(str, maybeLength, params) { - this.str = str; - this.dict = str.dict; - - params = params || Dict.empty; - - this.encoding = params.get('K') || 0; - this.eoline = params.get('EndOfLine') || false; - this.byteAlign = params.get('EncodedByteAlign') || false; - this.columns = params.get('Columns') || 1728; - this.rows = params.get('Rows') || 0; - var eoblock = params.get('EndOfBlock'); - if (eoblock === null || eoblock === undefined) { - eoblock = true; - } - this.eoblock = eoblock; - this.black = params.get('BlackIs1') || false; - - this.codingLine = new Uint32Array(this.columns + 1); - this.refLine = new Uint32Array(this.columns + 2); - - this.codingLine[0] = this.columns; - this.codingPos = 0; - - this.row = 0; - this.nextLine2D = this.encoding < 0; - this.inputBits = 0; - this.inputBuf = 0; - this.outputBits = 0; - - var code1; - while ((code1 = this.lookBits(12)) === 0) { - this.eatBits(1); - } - if (code1 === 1) { - this.eatBits(12); - } - if (this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - DecodeStream.call(this, maybeLength); - } - - CCITTFaxStream.prototype = Object.create(DecodeStream.prototype); - - CCITTFaxStream.prototype.readBlock = function CCITTFaxStream_readBlock() { - while (!this.eof) { - var c = this.lookChar(); - this.ensureBuffer(this.bufferLength + 1); - this.buffer[this.bufferLength++] = c; - } - }; - - CCITTFaxStream.prototype.addPixels = - function ccittFaxStreamAddPixels(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.addPixelsNeg = - function ccittFaxStreamAddPixelsNeg(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } else if (a1 < codingLine[codingPos]) { - if (a1 < 0) { - info('invalid code'); - this.err = true; - a1 = 0; - } - while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { - --codingPos; - } - codingLine[codingPos] = a1; - } - - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.lookChar = function CCITTFaxStream_lookChar() { - var refLine = this.refLine; - var codingLine = this.codingLine; - var columns = this.columns; - - var refPos, blackPixels, bits, i; - - if (this.outputBits === 0) { - if (this.eof) { - return null; - } - this.err = false; - - var code1, code2, code3; - if (this.nextLine2D) { - for (i = 0; codingLine[i] < columns; ++i) { - refLine[i] = codingLine[i]; - } - refLine[i++] = columns; - refLine[i] = columns; - codingLine[0] = 0; - this.codingPos = 0; - refPos = 0; - blackPixels = 0; - - while (codingLine[this.codingPos] < columns) { - code1 = this.getTwoDimCode(); - switch (code1) { - case twoDimPass: - this.addPixels(refLine[refPos + 1], blackPixels); - if (refLine[refPos + 1] < columns) { - refPos += 2; - } - break; - case twoDimHoriz: - code1 = code2 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + - code1, blackPixels); - if (codingLine[this.codingPos] < columns) { - this.addPixels(codingLine[this.codingPos] + code2, - blackPixels ^ 1); - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - break; - case twoDimVertR3: - this.addPixels(refLine[refPos] + 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR2: - this.addPixels(refLine[refPos] + 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR1: - this.addPixels(refLine[refPos] + 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVert0: - this.addPixels(refLine[refPos], blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL3: - this.addPixelsNeg(refLine[refPos] - 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL2: - this.addPixelsNeg(refLine[refPos] - 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL1: - this.addPixelsNeg(refLine[refPos] - 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case EOF: - this.addPixels(columns, 0); - this.eof = true; - break; - default: - info('bad 2d code'); - this.addPixels(columns, 0); - this.err = true; - } - } - } else { - codingLine[0] = 0; - this.codingPos = 0; - blackPixels = 0; - while (codingLine[this.codingPos] < columns) { - code1 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + code1, blackPixels); - blackPixels ^= 1; - } - } - - var gotEOL = false; - - if (this.byteAlign) { - this.inputBits &= ~7; - } - - if (!this.eoblock && this.row === this.rows - 1) { - this.eof = true; - } else { - code1 = this.lookBits(12); - if (this.eoline) { - while (code1 !== EOF && code1 !== 1) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } else { - while (code1 === 0) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } - if (code1 === 1) { - this.eatBits(12); - gotEOL = true; - } else if (code1 === EOF) { - this.eof = true; - } - } - - if (!this.eof && this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - if (this.eoblock && gotEOL && this.byteAlign) { - code1 = this.lookBits(12); - if (code1 === 1) { - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - if (this.encoding >= 0) { - for (i = 0; i < 4; ++i) { - code1 = this.lookBits(12); - if (code1 !== 1) { - info('bad rtc code: ' + code1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - } - } - this.eof = true; - } - } else if (this.err && this.eoline) { - while (true) { - code1 = this.lookBits(13); - if (code1 === EOF) { - this.eof = true; - return null; - } - if ((code1 >> 1) === 1) { - break; - } - this.eatBits(1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.eatBits(1); - this.nextLine2D = !(code1 & 1); - } - } - - if (codingLine[0] > 0) { - this.outputBits = codingLine[this.codingPos = 0]; - } else { - this.outputBits = codingLine[this.codingPos = 1]; - } - this.row++; - } - - var c; - if (this.outputBits >= 8) { - c = (this.codingPos & 1) ? 0 : 0xFF; - this.outputBits -= 8; - if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } - } else { - bits = 8; - c = 0; - do { - if (this.outputBits > bits) { - c <<= bits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - bits); - } - this.outputBits -= bits; - bits = 0; - } else { - c <<= this.outputBits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - this.outputBits); - } - bits -= this.outputBits; - this.outputBits = 0; - if (codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } else if (bits > 0) { - c <<= bits; - bits = 0; - } - } - } while (bits); - } - if (this.black) { - c ^= 0xFF; - } - return c; - }; - - // This functions returns the code found from the table. - // The start and end parameters set the boundaries for searching the table. - // The limit parameter is optional. Function returns an array with three - // values. The first array element indicates whether a valid code is being - // returned. The second array element is the actual code. The third array - // element indicates whether EOF was reached. - CCITTFaxStream.prototype.findTableCode = - function ccittFaxStreamFindTableCode(start, end, table, limit) { - - var limitValue = limit || 0; - for (var i = start; i <= end; ++i) { - var code = this.lookBits(i); - if (code === EOF) { - return [true, 1, false]; - } - if (i < end) { - code <<= end - i; - } - if (!limitValue || code >= limitValue) { - var p = table[code - limitValue]; - if (p[0] === i) { - this.eatBits(i); - return [true, p[1], true]; - } - } - } - return [false, 0, false]; - }; - - CCITTFaxStream.prototype.getTwoDimCode = - function ccittFaxStreamGetTwoDimCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(7); - p = twoDimTable[code]; - if (p && p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 7, twoDimTable); - if (result[0] && result[2]) { - return result[1]; - } - } - info('Bad two dim code'); - return EOF; - }; - - CCITTFaxStream.prototype.getWhiteCode = - function ccittFaxStreamGetWhiteCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(12); - if (code === EOF) { - return 1; - } - - if ((code >> 5) === 0) { - p = whiteTable1[code]; - } else { - p = whiteTable2[code >> 3]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 9, whiteTable2); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(11, 12, whiteTable1); - if (result[0]) { - return result[1]; - } - } - info('bad white code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.getBlackCode = - function ccittFaxStreamGetBlackCode() { - - var code, p; - if (this.eoblock) { - code = this.lookBits(13); - if (code === EOF) { - return 1; - } - if ((code >> 7) === 0) { - p = blackTable1[code]; - } else if ((code >> 9) === 0 && (code >> 7) !== 0) { - p = blackTable2[(code >> 1) - 64]; - } else { - p = blackTable3[code >> 7]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(2, 6, blackTable3); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(7, 12, blackTable2, 64); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(10, 13, blackTable1); - if (result[0]) { - return result[1]; - } - } - info('bad black code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.lookBits = function CCITTFaxStream_lookBits(n) { - var c; - while (this.inputBits < n) { - if ((c = this.str.getByte()) === -1) { - if (this.inputBits === 0) { - return EOF; - } - return ((this.inputBuf << (n - this.inputBits)) & - (0xFFFF >> (16 - n))); - } - this.inputBuf = (this.inputBuf << 8) + c; - this.inputBits += 8; - } - return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n)); - }; - - CCITTFaxStream.prototype.eatBits = function CCITTFaxStream_eatBits(n) { - if ((this.inputBits -= n) < 0) { - this.inputBits = 0; - } - }; - - return CCITTFaxStream; -})(); - -var LZWStream = (function LZWStreamClosure() { - function LZWStream(str, maybeLength, earlyChange) { - this.str = str; - this.dict = str.dict; - this.cachedData = 0; - this.bitsCached = 0; - - var maxLzwDictionarySize = 4096; - var lzwState = { - earlyChange: earlyChange, - codeLength: 9, - nextCode: 258, - dictionaryValues: new Uint8Array(maxLzwDictionarySize), - dictionaryLengths: new Uint16Array(maxLzwDictionarySize), - dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), - currentSequence: new Uint8Array(maxLzwDictionarySize), - currentSequenceLength: 0 - }; - for (var i = 0; i < 256; ++i) { - lzwState.dictionaryValues[i] = i; - lzwState.dictionaryLengths[i] = 1; - } - this.lzwState = lzwState; - - DecodeStream.call(this, maybeLength); - } - - LZWStream.prototype = Object.create(DecodeStream.prototype); - - LZWStream.prototype.readBits = function LZWStream_readBits(n) { - var bitsCached = this.bitsCached; - var cachedData = this.cachedData; - while (bitsCached < n) { - var c = this.str.getByte(); - if (c === -1) { - this.eof = true; - return null; - } - cachedData = (cachedData << 8) | c; - bitsCached += 8; - } - this.bitsCached = (bitsCached -= n); - this.cachedData = cachedData; - this.lastCode = null; - return (cachedData >>> bitsCached) & ((1 << n) - 1); - }; - - LZWStream.prototype.readBlock = function LZWStream_readBlock() { - var blockSize = 512; - var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize; - var i, j, q; - - var lzwState = this.lzwState; - if (!lzwState) { - return; // eof was found - } - - var earlyChange = lzwState.earlyChange; - var nextCode = lzwState.nextCode; - var dictionaryValues = lzwState.dictionaryValues; - var dictionaryLengths = lzwState.dictionaryLengths; - var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; - var codeLength = lzwState.codeLength; - var prevCode = lzwState.prevCode; - var currentSequence = lzwState.currentSequence; - var currentSequenceLength = lzwState.currentSequenceLength; - - var decodedLength = 0; - var currentBufferLength = this.bufferLength; - var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - - for (i = 0; i < blockSize; i++) { - var code = this.readBits(codeLength); - var hasPrev = currentSequenceLength > 0; - if (code < 256) { - currentSequence[0] = code; - currentSequenceLength = 1; - } else if (code >= 258) { - if (code < nextCode) { - currentSequenceLength = dictionaryLengths[code]; - for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { - currentSequence[j] = dictionaryValues[q]; - q = dictionaryPrevCodes[q]; - } - } else { - currentSequence[currentSequenceLength++] = currentSequence[0]; - } - } else if (code === 256) { - codeLength = 9; - nextCode = 258; - currentSequenceLength = 0; - continue; - } else { - this.eof = true; - delete this.lzwState; - break; - } - - if (hasPrev) { - dictionaryPrevCodes[nextCode] = prevCode; - dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; - dictionaryValues[nextCode] = currentSequence[0]; - nextCode++; - codeLength = (nextCode + earlyChange) & (nextCode + earlyChange - 1) ? - codeLength : Math.min(Math.log(nextCode + earlyChange) / - 0.6931471805599453 + 1, 12) | 0; - } - prevCode = code; - - decodedLength += currentSequenceLength; - if (estimatedDecodedSize < decodedLength) { - do { - estimatedDecodedSize += decodedSizeDelta; - } while (estimatedDecodedSize < decodedLength); - buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - } - for (j = 0; j < currentSequenceLength; j++) { - buffer[currentBufferLength++] = currentSequence[j]; - } - } - lzwState.nextCode = nextCode; - lzwState.codeLength = codeLength; - lzwState.prevCode = prevCode; - lzwState.currentSequenceLength = currentSequenceLength; - - this.bufferLength = currentBufferLength; - }; - - return LZWStream; -})(); - -var NullStream = (function NullStreamClosure() { - function NullStream() { - Stream.call(this, new Uint8Array(0)); - } - - NullStream.prototype = Stream.prototype; - - return NullStream; -})(); - -// TODO refactor to remove dependency on parser.js -function _setCoreParser(coreParser_) { - coreParser = coreParser_; - EOF = coreParser_.EOF; - Lexer = coreParser_.Lexer; -} -exports._setCoreParser = _setCoreParser; - -// TODO refactor to remove dependency on colorspace.js -function _setCoreColorSpace(coreColorSpace_) { - coreColorSpace = coreColorSpace_; - ColorSpace = coreColorSpace_.ColorSpace; -} -exports._setCoreColorSpace = _setCoreColorSpace; - -exports.Ascii85Stream = Ascii85Stream; -exports.AsciiHexStream = AsciiHexStream; -exports.CCITTFaxStream = CCITTFaxStream; -exports.DecryptStream = DecryptStream; -exports.DecodeStream = DecodeStream; -exports.FlateStream = FlateStream; -exports.Jbig2Stream = Jbig2Stream; -exports.JpegStream = JpegStream; -exports.JpxStream = JpxStream; -exports.NullStream = NullStream; -exports.PredictorStream = PredictorStream; -exports.RunLengthStream = RunLengthStream; -exports.Stream = Stream; -exports.StreamsSequenceStream = StreamsSequenceStream; -exports.StringStream = StringStream; -exports.LZWStream = LZWStream; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCrypto = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream) { - -var PasswordException = sharedUtil.PasswordException; -var PasswordResponses = sharedUtil.PasswordResponses; -var bytesToString = sharedUtil.bytesToString; -var error = sharedUtil.error; -var isInt = sharedUtil.isInt; -var stringToBytes = sharedUtil.stringToBytes; -var utf8StringToString = sharedUtil.utf8StringToString; -var warn = sharedUtil.warn; -var Name = corePrimitives.Name; -var isName = corePrimitives.isName; -var isDict = corePrimitives.isDict; -var DecryptStream = coreStream.DecryptStream; - -var ARCFourCipher = (function ARCFourCipherClosure() { - function ARCFourCipher(key) { - this.a = 0; - this.b = 0; - var s = new Uint8Array(256); - var i, j = 0, tmp, keyLength = key.length; - for (i = 0; i < 256; ++i) { - s[i] = i; - } - for (i = 0; i < 256; ++i) { - tmp = s[i]; - j = (j + tmp + key[i % keyLength]) & 0xFF; - s[i] = s[j]; - s[j] = tmp; - } - this.s = s; - } - - ARCFourCipher.prototype = { - encryptBlock: function ARCFourCipher_encryptBlock(data) { - var i, n = data.length, tmp, tmp2; - var a = this.a, b = this.b, s = this.s; - var output = new Uint8Array(n); - for (i = 0; i < n; ++i) { - a = (a + 1) & 0xFF; - tmp = s[a]; - b = (b + tmp) & 0xFF; - tmp2 = s[b]; - s[a] = tmp2; - s[b] = tmp; - output[i] = data[i] ^ s[(tmp + tmp2) & 0xFF]; - } - this.a = a; - this.b = b; - return output; - } - }; - ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; - - return ARCFourCipher; -})(); - -var calculateMD5 = (function calculateMD5Closure() { - var r = new Uint8Array([ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); - - var k = new Int32Array([ - -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, - -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, - 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, - 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, - 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, - 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, - -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, - -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, - -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, - -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, - -145523070, -1120210379, 718787259, -343485551]); - - function hash(data, offset, length) { - var h0 = 1732584193, h1 = -271733879, h2 = -1732584194, h3 = 271733878; - // pre-processing - var paddedLength = (length + 72) & ~63; // data + 9 extra bytes - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = (length << 3) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - var w = new Int32Array(16); - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j, i += 4) { - w[j] = (padded[i] | (padded[i + 1] << 8) | - (padded[i + 2] << 16) | (padded[i + 3] << 24)); - } - var a = h0, b = h1, c = h2, d = h3, f, g; - for (j = 0; j < 64; ++j) { - if (j < 16) { - f = (b & c) | ((~b) & d); - g = j; - } else if (j < 32) { - f = (d & b) | ((~d) & c); - g = (5 * j + 1) & 15; - } else if (j < 48) { - f = b ^ c ^ d; - g = (3 * j + 5) & 15; - } else { - f = c ^ (b | (~d)); - g = (7 * j) & 15; - } - var tmp = d, rotateArg = (a + f + k[j] + w[g]) | 0, rotate = r[j]; - d = c; - c = b; - b = (b + ((rotateArg << rotate) | (rotateArg >>> (32 - rotate)))) | 0; - a = tmp; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - } - return new Uint8Array([ - h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >>> 24) & 0xFF, - h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >>> 24) & 0xFF, - h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >>> 24) & 0xFF, - h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >>> 24) & 0xFF - ]); - } - - return hash; -})(); -var Word64 = (function Word64Closure() { - function Word64(highInteger, lowInteger) { - this.high = highInteger | 0; - this.low = lowInteger | 0; - } - Word64.prototype = { - and: function Word64_and(word) { - this.high &= word.high; - this.low &= word.low; - }, - xor: function Word64_xor(word) { - this.high ^= word.high; - this.low ^= word.low; - }, - - or: function Word64_or(word) { - this.high |= word.high; - this.low |= word.low; - }, - - shiftRight: function Word64_shiftRight(places) { - if (places >= 32) { - this.low = (this.high >>> (places - 32)) | 0; - this.high = 0; - } else { - this.low = (this.low >>> places) | (this.high << (32 - places)); - this.high = (this.high >>> places) | 0; - } - }, - - shiftLeft: function Word64_shiftLeft(places) { - if (places >= 32) { - this.high = this.low << (places - 32); - this.low = 0; - } else { - this.high = (this.high << places) | (this.low >>> (32 - places)); - this.low = this.low << places; - } - }, - - rotateRight: function Word64_rotateRight(places) { - var low, high; - if (places & 32) { - high = this.low; - low = this.high; - } else { - low = this.low; - high = this.high; - } - places &= 31; - this.low = (low >>> places) | (high << (32 - places)); - this.high = (high >>> places) | (low << (32 - places)); - }, - - not: function Word64_not() { - this.high = ~this.high; - this.low = ~this.low; - }, - - add: function Word64_add(word) { - var lowAdd = (this.low >>> 0) + (word.low >>> 0); - var highAdd = (this.high >>> 0) + (word.high >>> 0); - if (lowAdd > 0xFFFFFFFF) { - highAdd += 1; - } - this.low = lowAdd | 0; - this.high = highAdd | 0; - }, - - copyTo: function Word64_copyTo(bytes, offset) { - bytes[offset] = (this.high >>> 24) & 0xFF; - bytes[offset + 1] = (this.high >> 16) & 0xFF; - bytes[offset + 2] = (this.high >> 8) & 0xFF; - bytes[offset + 3] = this.high & 0xFF; - bytes[offset + 4] = (this.low >>> 24) & 0xFF; - bytes[offset + 5] = (this.low >> 16) & 0xFF; - bytes[offset + 6] = (this.low >> 8) & 0xFF; - bytes[offset + 7] = this.low & 0xFF; - }, - - assign: function Word64_assign(word) { - this.high = word.high; - this.low = word.low; - } - }; - return Word64; -})(); - -var calculateSHA256 = (function calculateSHA256Closure() { - function rotr(x, n) { - return (x >>> n) | (x << 32 - n); - } - - function ch(x, y, z) { - return (x & y) ^ (~x & z); - } - - function maj(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); - } - - function sigma(x) { - return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); - } - - function sigmaPrime(x) { - return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); - } - - function littleSigma(x) { - return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; - } - - function littleSigmaPrime(x) { - return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; - } - - var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - - function hash(data, offset, length) { - // initial hash values - var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, - h3 = 0xa54ff53a, h4 = 0x510e527f, h5 = 0x9b05688c, - h6 = 0x1f83d9ab, h7 = 0x5be0cd19; - // pre-processing - var paddedLength = Math.ceil((length + 9) / 64) * 64; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - var w = new Uint32Array(64); - // for each 512 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j] = (padded[i] << 24 | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3])); - i += 4; - } - - for (j = 16; j < 64; ++j) { - w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + - littleSigma(w[j - 15]) + w[j - 16] | 0; - } - var a = h0, b = h1, c = h2, d = h3, e = h4, - f = h5, g = h6, h = h7, t1, t2; - for (j = 0; j < 64; ++j) { - t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; - t2 = sigma(a) + maj(a, b, c); - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - h4 = (h4 + e) | 0; - h5 = (h5 + f) | 0; - h6 = (h6 + g) | 0; - h7 = (h7 + h) | 0; - } - return new Uint8Array([ - (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, (h0) & 0xFF, - (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, (h1) & 0xFF, - (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, (h2) & 0xFF, - (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, (h3) & 0xFF, - (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, (h4) & 0xFF, - (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, (h5) & 0xFF, - (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, (h6) & 0xFF, - (h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, (h7) & 0xFF - ]); - } - - return hash; -})(); - -var calculateSHA512 = (function calculateSHA512Closure() { - function ch(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.not(); - tmp.and(z); - result.xor(tmp); - } - - function maj(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.and(z); - result.xor(tmp); - tmp.assign(y); - tmp.and(z); - result.xor(tmp); - } - - function sigma(result, x, tmp) { - result.assign(x); - result.rotateRight(28); - tmp.assign(x); - tmp.rotateRight(34); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(39); - result.xor(tmp); - } - - function sigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(14); - tmp.assign(x); - tmp.rotateRight(18); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(41); - result.xor(tmp); - } - - function littleSigma(result, x, tmp) { - result.assign(x); - result.rotateRight(1); - tmp.assign(x); - tmp.rotateRight(8); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(7); - result.xor(tmp); - } - - function littleSigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(19); - tmp.assign(x); - tmp.rotateRight(61); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(6); - result.xor(tmp); - } - - var k = [ - new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), - new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), - new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), - new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), - new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), - new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), - new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), - new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), - new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), - new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), - new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), - new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), - new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), - new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), - new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), - new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), - new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), - new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), - new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), - new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), - new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), - new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), - new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), - new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), - new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), - new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), - new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), - new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), - new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), - new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), - new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), - new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), - new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), - new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), - new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), - new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), - new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), - new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), - new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), - new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; - - function hash(data, offset, length, mode384) { - mode384 = !!mode384; - // initial hash values - var h0, h1, h2, h3, h4, h5, h6, h7; - if (!mode384) { - h0 = new Word64(0x6a09e667, 0xf3bcc908); - h1 = new Word64(0xbb67ae85, 0x84caa73b); - h2 = new Word64(0x3c6ef372, 0xfe94f82b); - h3 = new Word64(0xa54ff53a, 0x5f1d36f1); - h4 = new Word64(0x510e527f, 0xade682d1); - h5 = new Word64(0x9b05688c, 0x2b3e6c1f); - h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); - h7 = new Word64(0x5be0cd19, 0x137e2179); - } - else { - // SHA384 is exactly the same - // except with different starting values and a trimmed result - h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); - h1 = new Word64(0x629a292a, 0x367cd507); - h2 = new Word64(0x9159015a, 0x3070dd17); - h3 = new Word64(0x152fecd8, 0xf70e5939); - h4 = new Word64(0x67332667, 0xffc00b31); - h5 = new Word64(0x8eb44a87, 0x68581511); - h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); - h7 = new Word64(0x47b5481d, 0xbefa4fa4); - } - - // pre-processing - var paddedLength = Math.ceil((length + 17) / 128) * 128; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 16; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - - var w = new Array(80); - for (i = 0; i < 80; i++) { - w[i] = new Word64(0, 0); - } - var a = new Word64(0, 0), b = new Word64(0, 0), c = new Word64(0, 0); - var d = new Word64(0, 0), e = new Word64(0, 0), f = new Word64(0, 0); - var g = new Word64(0, 0), h = new Word64(0, 0); - var t1 = new Word64(0, 0), t2 = new Word64(0, 0); - var tmp1 = new Word64(0, 0), tmp2 = new Word64(0, 0), tmp3; - - // for each 1024 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j].high = (padded[i] << 24) | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3]); - w[j].low = (padded[i + 4]) << 24 | (padded[i + 5]) << 16 | - (padded[i + 6]) << 8 | (padded[i + 7]); - i += 8; - } - for (j = 16; j < 80; ++j) { - tmp3 = w[j]; - littleSigmaPrime(tmp3, w[j - 2], tmp2); - tmp3.add(w[j - 7]); - littleSigma(tmp1, w[j - 15], tmp2); - tmp3.add(tmp1); - tmp3.add(w[j - 16]); - } - - a.assign(h0); b.assign(h1); c.assign(h2); d.assign(h3); - e.assign(h4); f.assign(h5); g.assign(h6); h.assign(h7); - for (j = 0; j < 80; ++j) { - t1.assign(h); - sigmaPrime(tmp1, e, tmp2); - t1.add(tmp1); - ch(tmp1, e, f, g, tmp2); - t1.add(tmp1); - t1.add(k[j]); - t1.add(w[j]); - - sigma(t2, a, tmp2); - maj(tmp1, a, b, c, tmp2); - t2.add(tmp1); - - tmp3 = h; - h = g; - g = f; - f = e; - d.add(t1); - e = d; - d = c; - c = b; - b = a; - tmp3.assign(t1); - tmp3.add(t2); - a = tmp3; - } - h0.add(a); - h1.add(b); - h2.add(c); - h3.add(d); - h4.add(e); - h5.add(f); - h6.add(g); - h7.add(h); - } - - var result; - if (!mode384) { - result = new Uint8Array(64); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - h6.copyTo(result,48); - h7.copyTo(result,56); - } - else { - result = new Uint8Array(48); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - } - return result; - } - - return hash; -})(); -var calculateSHA384 = (function calculateSHA384Closure() { - function hash(data, offset, length) { - return calculateSHA512(data, offset, length, true); - } - - return hash; -})(); -var NullCipher = (function NullCipherClosure() { - function NullCipher() { - } - - NullCipher.prototype = { - decryptBlock: function NullCipher_decryptBlock(data) { - return data; - } - }; - - return NullCipher; -})(); - -var AES128Cipher = (function AES128CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, - 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, - 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, - 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, - 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, - 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, - 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, - 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, - 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, - 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, - 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, - 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, - 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey128(cipherKey) { - var b = 176, result = new Uint8Array(b); - result.set(cipherKey); - for (var j = 16, i = 1; j < b; ++i) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ rcon[i]; - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 16]); - j++; - result[j] = (t2 ^= result[j - 16]); - j++; - result[j] = (t3 ^= result[j - 16]); - j++; - result[j] = (t4 ^= result[j - 16]); - j++; - } - } - return result; - } - - function decrypt128(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 9; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt128(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 10; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - return state; - } - - function AES128Cipher(key) { - this.key = expandKey128(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt128(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - - AES128Cipher.prototype = { - decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // waiting for IV values -- they are at the start of the stream - for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - // need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data.subarray(16), finalize); - }, - encrypt: function AES128Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt128(buffer, this.key); - iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES128Cipher; -})(); - -var AES256Cipher = (function AES256CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, - 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, - 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, - 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, - 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, - 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, - 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, - 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, - 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, - 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, - 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, - 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, - 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey256(cipherKey) { - var b = 240, result = new Uint8Array(b); - var r = 1; - - result.set(cipherKey); - for (var j = 32, i = 1; j < b; ++i) { - if (j % 32 === 16) { - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - } else if (j % 32 === 0) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ r; - if ((r <<= 1) >= 256) { - r = (r ^ 0x1b) & 0xFF; - } - } - - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 32]); - j++; - result[j] = (t2 ^= result[j - 32]); - j++; - result[j] = (t3 ^= result[j - 32]); - j++; - result[j] = (t4 ^= result[j - 32]); - j++; - } - } - return result; - } - - function decrypt256(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 13; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt256(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 14; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - - return state; - - } - - function AES256Cipher(key) { - this.key = expandKey256(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt256(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - - } - - AES256Cipher.prototype = { - decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // if not supplied an IV wait for IV values - // they are at the start of the stream - if (iv) { - this.iv = iv; - } else { - for (i = 0; bufferLength < 16 && - i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - //need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - data = data.subarray(16); - } - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data, finalize); - }, - encrypt: function AES256Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt256(buffer, this.key); - this.iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES256Cipher; -})(); - -var PDF17 = (function PDF17Closure() { - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - function PDF17() { - } - - PDF17.prototype = { - checkOwnerPassword: function PDF17_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF17_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF17_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF17; -})(); - -var PDF20 = (function PDF20Closure() { - - function concatArrays(array1, array2) { - var t = new Uint8Array(array1.length + array2.length); - t.set(array1, 0); - t.set(array2, array1.length); - return t; - } - - function calculatePDF20Hash(password, input, userBytes) { - //This refers to Algorithm 2.B as defined in ISO 32000-2 - var k = calculateSHA256(input, 0, input.length).subarray(0, 32); - var e = [0]; - var i = 0; - while (i < 64 || e[e.length - 1] > i - 32) { - var arrayLength = password.length + k.length + userBytes.length; - - var k1 = new Uint8Array(arrayLength * 64); - var array = concatArrays(password, k); - array = concatArrays(array, userBytes); - for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { - k1.set(array, pos); - } - //AES128 CBC NO PADDING with - //first 16 bytes of k as the key and the second 16 as the iv. - var cipher = new AES128Cipher(k.subarray(0, 16)); - e = cipher.encrypt(k1, k.subarray(16, 32)); - //Now we have to take the first 16 bytes of an unsigned - //big endian integer... and compute the remainder - //modulo 3.... That is a fairly large number and - //JavaScript isn't going to handle that well... - //So we're using a trick that allows us to perform - //modulo math byte by byte - var remainder = 0; - for (var z = 0; z < 16; z++) { - remainder *= (256 % 3); - remainder %= 3; - remainder += ((e[z] >>> 0) % 3); - remainder %= 3; - } - if (remainder === 0) { - k = calculateSHA256(e, 0, e.length); - } - else if (remainder === 1) { - k = calculateSHA384(e, 0, e.length); - } - else if (remainder === 2) { - k = calculateSHA512(e, 0, e.length); - } - i++; - } - return k.subarray(0, 32); - } - - function PDF20() { - } - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - PDF20.prototype = { - hash: function PDF20_hash(password, concatBytes, userBytes) { - return calculatePDF20Hash(password, concatBytes, userBytes); - }, - checkOwnerPassword: function PDF20_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculatePDF20Hash(password, hashData, userBytes); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF20_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculatePDF20Hash(password, hashData, []); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculatePDF20Hash(password, hashData, userBytes); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF20_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculatePDF20Hash(password, hashData, []); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF20; -})(); - -var CipherTransform = (function CipherTransformClosure() { - function CipherTransform(stringCipherConstructor, streamCipherConstructor) { - this.stringCipherConstructor = stringCipherConstructor; - this.streamCipherConstructor = streamCipherConstructor; - } - - CipherTransform.prototype = { - createStream: function CipherTransform_createStream(stream, length) { - var cipher = new this.streamCipherConstructor(); - return new DecryptStream(stream, length, - function cipherTransformDecryptStream(data, finalize) { - return cipher.decryptBlock(data, finalize); - } - ); - }, - decryptString: function CipherTransform_decryptString(s) { - var cipher = new this.stringCipherConstructor(); - var data = stringToBytes(s); - data = cipher.decryptBlock(data, true); - return bytesToString(data); - } - }; - return CipherTransform; -})(); - -var CipherTransformFactory = (function CipherTransformFactoryClosure() { - var defaultPasswordBytes = new Uint8Array([ - 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, - 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, - 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, - 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A]); - - function createEncryptionKey20(revision, password, ownerPassword, - ownerValidationSalt, ownerKeySalt, uBytes, - userPassword, userValidationSalt, userKeySalt, - ownerEncryption, userEncryption, perms) { - if (password) { - var passwordLength = Math.min(127, password.length); - password = password.subarray(0, passwordLength); - } else { - password = []; - } - var pdfAlgorithm; - if (revision === 6) { - pdfAlgorithm = new PDF20(); - } else { - pdfAlgorithm = new PDF17(); - } - - if (pdfAlgorithm) { - if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, - userPassword)) { - return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); - } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, - ownerValidationSalt, - uBytes, - ownerPassword)) { - return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, - ownerEncryption); - } - } - - return null; - } - - function prepareKeyData(fileId, password, ownerPassword, userPassword, - flags, revision, keyLength, encryptMetadata) { - var hashDataSize = 40 + ownerPassword.length + fileId.length; - var hashData = new Uint8Array(hashDataSize), i = 0, j, n; - if (password) { - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - // as now the padded password in the hashData[0..i] - for (j = 0, n = ownerPassword.length; j < n; ++j) { - hashData[i++] = ownerPassword[j]; - } - hashData[i++] = flags & 0xFF; - hashData[i++] = (flags >> 8) & 0xFF; - hashData[i++] = (flags >> 16) & 0xFF; - hashData[i++] = (flags >>> 24) & 0xFF; - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - if (revision >= 4 && !encryptMetadata) { - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, keyLengthInBytes); - } - } - var encryptionKey = hash.subarray(0, keyLengthInBytes); - var cipher, checkData; - - if (revision >= 3) { - for (i = 0; i < 32; ++i) { - hashData[i] = defaultPasswordBytes[i]; - } - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); - n = encryptionKey.length; - var derivedKey = new Uint8Array(n), k; - for (j = 1; j <= 19; ++j) { - for (k = 0; k < n; ++k) { - derivedKey[k] = encryptionKey[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - checkData = cipher.encryptBlock(checkData); - } - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } else { - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(defaultPasswordBytes); - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } - return encryptionKey; - } - - function decodeUserPassword(password, ownerPassword, revision, keyLength) { - var hashData = new Uint8Array(32), i = 0, j, n; - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, hash.length); - } - } - - var cipher, userPassword; - if (revision >= 3) { - userPassword = ownerPassword; - var derivedKey = new Uint8Array(keyLengthInBytes), k; - for (j = 19; j >= 0; j--) { - for (k = 0; k < keyLengthInBytes; ++k) { - derivedKey[k] = hash[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - userPassword = cipher.encryptBlock(userPassword); - } - } else { - cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); - userPassword = cipher.encryptBlock(ownerPassword); - } - return userPassword; - } - - var identityName = Name.get('Identity'); - - function CipherTransformFactory(dict, fileId, password) { - var filter = dict.get('Filter'); - if (!isName(filter) || filter.name !== 'Standard') { - error('unknown encryption method'); - } - this.dict = dict; - var algorithm = dict.get('V'); - if (!isInt(algorithm) || - (algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && - algorithm !== 5)) { - error('unsupported encryption algorithm'); - } - this.algorithm = algorithm; - var keyLength = dict.get('Length'); - if (!keyLength) { - // Spec asks to rely on encryption dictionary's Length entry, however - // some PDFs don't have it. Trying to recover. - if (algorithm <= 3) { - // For 1 and 2 it's fixed to 40-bit, for 3 40-bit is a minimal value. - keyLength = 40; - } else { - // Trying to find default handler -- it usually has Length. - var cfDict = dict.get('CF'); - var streamCryptoName = dict.get('StmF'); - if (isDict(cfDict) && isName(streamCryptoName)) { - var handlerDict = cfDict.get(streamCryptoName.name); - keyLength = (handlerDict && handlerDict.get('Length')) || 128; - if (keyLength < 40) { - // Sometimes it's incorrect value of bits, generators specify bytes. - keyLength <<= 3; - } - } - } - } - if (!isInt(keyLength) || - keyLength < 40 || (keyLength % 8) !== 0) { - error('invalid key length'); - } - - // prepare keys - var ownerPassword = stringToBytes(dict.get('O')).subarray(0, 32); - var userPassword = stringToBytes(dict.get('U')).subarray(0, 32); - var flags = dict.get('P'); - var revision = dict.get('R'); - // meaningful when V is 4 or 5 - var encryptMetadata = ((algorithm === 4 || algorithm === 5) && - dict.get('EncryptMetadata') !== false); - this.encryptMetadata = encryptMetadata; - - var fileIdBytes = stringToBytes(fileId); - var passwordBytes; - if (password) { - if (revision === 6) { - try { - password = utf8StringToString(password); - } catch (ex) { - warn('CipherTransformFactory: ' + - 'Unable to convert UTF8 encoded password.'); - } - } - passwordBytes = stringToBytes(password); - } - - var encryptionKey; - if (algorithm !== 5) { - encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - else { - var ownerValidationSalt = stringToBytes(dict.get('O')).subarray(32, 40); - var ownerKeySalt = stringToBytes(dict.get('O')).subarray(40, 48); - var uBytes = stringToBytes(dict.get('U')).subarray(0, 48); - var userValidationSalt = stringToBytes(dict.get('U')).subarray(32, 40); - var userKeySalt = stringToBytes(dict.get('U')).subarray(40, 48); - var ownerEncryption = stringToBytes(dict.get('OE')); - var userEncryption = stringToBytes(dict.get('UE')); - var perms = stringToBytes(dict.get('Perms')); - encryptionKey = - createEncryptionKey20(revision, passwordBytes, - ownerPassword, ownerValidationSalt, - ownerKeySalt, uBytes, - userPassword, userValidationSalt, - userKeySalt, ownerEncryption, - userEncryption, perms); - } - if (!encryptionKey && !password) { - throw new PasswordException('No password given', - PasswordResponses.NEED_PASSWORD); - } else if (!encryptionKey && password) { - // Attempting use the password as an owner password - var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, - revision, keyLength); - encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - - if (!encryptionKey) { - throw new PasswordException('Incorrect Password', - PasswordResponses.INCORRECT_PASSWORD); - } - - this.encryptionKey = encryptionKey; - - if (algorithm >= 4) { - this.cf = dict.get('CF'); - this.stmf = dict.get('StmF') || identityName; - this.strf = dict.get('StrF') || identityName; - this.eff = dict.get('EFF') || this.stmf; - } - } - - function buildObjectKey(num, gen, encryptionKey, isAes) { - var key = new Uint8Array(encryptionKey.length + 9), i, n; - for (i = 0, n = encryptionKey.length; i < n; ++i) { - key[i] = encryptionKey[i]; - } - key[i++] = num & 0xFF; - key[i++] = (num >> 8) & 0xFF; - key[i++] = (num >> 16) & 0xFF; - key[i++] = gen & 0xFF; - key[i++] = (gen >> 8) & 0xFF; - if (isAes) { - key[i++] = 0x73; - key[i++] = 0x41; - key[i++] = 0x6C; - key[i++] = 0x54; - } - var hash = calculateMD5(key, 0, i); - return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); - } - - function buildCipherConstructor(cf, name, num, gen, key) { - var cryptFilter = cf.get(name.name); - var cfm; - if (cryptFilter !== null && cryptFilter !== undefined) { - cfm = cryptFilter.get('CFM'); - } - if (!cfm || cfm.name === 'None') { - return function cipherTransformFactoryBuildCipherConstructorNone() { - return new NullCipher(); - }; - } - if ('V2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorV2() { - return new ARCFourCipher(buildObjectKey(num, gen, key, false)); - }; - } - if ('AESV2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV2() { - return new AES128Cipher(buildObjectKey(num, gen, key, true)); - }; - } - if ('AESV3' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV3() { - return new AES256Cipher(key); - }; - } - error('Unknown crypto method'); - } - - CipherTransformFactory.prototype = { - createCipherTransform: - function CipherTransformFactory_createCipherTransform(num, gen) { - if (this.algorithm === 4 || this.algorithm === 5) { - return new CipherTransform( - buildCipherConstructor(this.cf, this.stmf, - num, gen, this.encryptionKey), - buildCipherConstructor(this.cf, this.strf, - num, gen, this.encryptionKey)); - } - // algorithms 1 and 2 - var key = buildObjectKey(num, gen, this.encryptionKey, false); - var cipherConstructor = function buildCipherCipherConstructor() { - return new ARCFourCipher(key); - }; - return new CipherTransform(cipherConstructor, cipherConstructor); - } - }; - - return CipherTransformFactory; -})(); - -exports.AES128Cipher = AES128Cipher; -exports.AES256Cipher = AES256Cipher; -exports.ARCFourCipher = ARCFourCipher; -exports.CipherTransformFactory = CipherTransformFactory; -exports.PDF17 = PDF17; -exports.PDF20 = PDF20; -exports.calculateMD5 = calculateMD5; -exports.calculateSHA256 = calculateSHA256; -exports.calculateSHA384 = calculateSHA384; -exports.calculateSHA512 = calculateSHA512; -})); - -(function (root, factory) { - { - factory((root.pdfjsCoreFontRenderer = {}), root.pdfjsSharedUtil, - root.pdfjsCoreStream, root.pdfjsCoreGlyphList); - } -}(this, function (exports, sharedUtil, coreStream, coreGlyphList) { - -var Util = sharedUtil.Util; -var bytesToString = sharedUtil.bytesToString; -var error = sharedUtil.error; -var Stream = coreStream.Stream; -var GlyphsUnicode = coreGlyphList.GlyphsUnicode; - -var coreFonts; // see _setCoreFonts below -var CFFParser; // = coreFonts.CFFParser; -var Encodings; // = coreFonts.Encodings; - -var FontRendererFactory = (function FontRendererFactoryClosure() { - function getLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - } - - function getUshort(data, offset) { - return (data[offset] << 8) | data[offset + 1]; - } - - function parseCmap(data, start, end) { - var offset = (getUshort(data, start + 2) === 1 ? - getLong(data, start + 8) : getLong(data, start + 16)); - var format = getUshort(data, start + offset); - var length, ranges, p, i; - if (format === 4) { - length = getUshort(data, start + offset + 2); - var segCount = getUshort(data, start + offset + 6) >> 1; - p = start + offset + 14; - ranges = []; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i] = {end: getUshort(data, p)}; - } - p += 2; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].start = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].idDelta = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - var idOffset = getUshort(data, p); - if (idOffset === 0) { - continue; - } - ranges[i].ids = []; - for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { - ranges[i].ids[j] = getUshort(data, p + idOffset); - idOffset += 2; - } - } - return ranges; - } else if (format === 12) { - length = getLong(data, start + offset + 4); - var groups = getLong(data, start + offset + 12); - p = start + offset + 16; - ranges = []; - for (i = 0; i < groups; i++) { - ranges.push({ - start: getLong(data, p), - end: getLong(data, p + 4), - idDelta: getLong(data, p + 8) - getLong(data, p) - }); - p += 12; - } - return ranges; - } - error('not supported cmap: ' + format); - } - - function parseCff(data, start, end) { - var properties = {}; - var parser = new CFFParser(new Stream(data, start, end - start), - properties); - var cff = parser.parse(); - return { - glyphs: cff.charStrings.objects, - subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && - cff.topDict.privateDict.subrsIndex.objects), - gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects - }; - } - - function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { - var itemSize, itemDecode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - } - var glyphs = []; - var startOffset = itemDecode(loca, 0); - for (var j = itemSize; j < loca.length; j += itemSize) { - var endOffset = itemDecode(loca, j); - glyphs.push(glyf.subarray(startOffset, endOffset)); - startOffset = endOffset; - } - return glyphs; - } - - function lookupCmap(ranges, unicode) { - var code = unicode.charCodeAt(0); - var l = 0, r = ranges.length - 1; - while (l < r) { - var c = (l + r + 1) >> 1; - if (code < ranges[c].start) { - r = c - 1; - } else { - l = c; - } - } - if (ranges[l].start <= code && code <= ranges[l].end) { - return (ranges[l].idDelta + (ranges[l].ids ? - ranges[l].ids[code - ranges[l].start] : code)) & 0xFFFF; - } - return 0; - } - - function compileGlyf(code, cmds, font) { - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function quadraticCurveTo(xa, ya, x, y) { - cmds.push({cmd: 'quadraticCurveTo', args: [xa, ya, x, y]}); - } - - var i = 0; - var numberOfContours = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - var flags; - var x = 0, y = 0; - i += 10; - if (numberOfContours < 0) { - // composite glyph - do { - flags = (code[i] << 8) | code[i + 1]; - var glyphIndex = (code[i + 2] << 8) | code[i + 3]; - i += 4; - var arg1, arg2; - if ((flags & 0x01)) { - arg1 = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - arg2 = ((code[i + 2] << 24) | (code[i + 3] << 16)) >> 16; - i += 4; - } else { - arg1 = code[i++]; arg2 = code[i++]; - } - if ((flags & 0x02)) { - x = arg1; - y = arg2; - } else { - x = 0; y = 0; // TODO "they are points" ? - } - var scaleX = 1, scaleY = 1, scale01 = 0, scale10 = 0; - if ((flags & 0x08)) { - scaleX = - scaleY = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - i += 2; - } else if ((flags & 0x40)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scaleY = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - i += 4; - } else if ((flags & 0x80)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scale01 = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - scale10 = ((code[i + 4] << 24) | (code[i + 5] << 16)) / 1073741824; - scaleY = ((code[i + 6] << 24) | (code[i + 7] << 16)) / 1073741824; - i += 8; - } - var subglyph = font.glyphs[glyphIndex]; - if (subglyph) { - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', - args: [scaleX, scale01, scale10, scaleY, x, y]}); - compileGlyf(subglyph, cmds, font); - cmds.push({cmd: 'restore'}); - } - } while ((flags & 0x20)); - } else { - // simple glyph - var endPtsOfContours = []; - var j, jj; - for (j = 0; j < numberOfContours; j++) { - endPtsOfContours.push((code[i] << 8) | code[i + 1]); - i += 2; - } - var instructionLength = (code[i] << 8) | code[i + 1]; - i += 2 + instructionLength; // skipping the instructions - var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; - var points = []; - while (points.length < numberOfPoints) { - flags = code[i++]; - var repeat = 1; - if ((flags & 0x08)) { - repeat += code[i++]; - } - while (repeat-- > 0) { - points.push({flags: flags}); - } - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x12) { - case 0x00: - x += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x02: - x -= code[i++]; - break; - case 0x12: - x += code[i++]; - break; - } - points[j].x = x; - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x24) { - case 0x00: - y += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x04: - y -= code[i++]; - break; - case 0x24: - y += code[i++]; - break; - } - points[j].y = y; - } - - var startPoint = 0; - for (i = 0; i < numberOfContours; i++) { - var endPoint = endPtsOfContours[i]; - // contours might have implicit points, which is located in the middle - // between two neighboring off-curve points - var contour = points.slice(startPoint, endPoint + 1); - if ((contour[0].flags & 1)) { - contour.push(contour[0]); // using start point at the contour end - } else if ((contour[contour.length - 1].flags & 1)) { - // first is off-curve point, trying to use one from the end - contour.unshift(contour[contour.length - 1]); - } else { - // start and end are off-curve points, creating implicit one - var p = { - flags: 1, - x: (contour[0].x + contour[contour.length - 1].x) / 2, - y: (contour[0].y + contour[contour.length - 1].y) / 2 - }; - contour.unshift(p); - contour.push(p); - } - moveTo(contour[0].x, contour[0].y); - for (j = 1, jj = contour.length; j < jj; j++) { - if ((contour[j].flags & 1)) { - lineTo(contour[j].x, contour[j].y); - } else if ((contour[j + 1].flags & 1)){ - quadraticCurveTo(contour[j].x, contour[j].y, - contour[j + 1].x, contour[j + 1].y); - j++; - } else { - quadraticCurveTo(contour[j].x, contour[j].y, - (contour[j].x + contour[j + 1].x) / 2, - (contour[j].y + contour[j + 1].y) / 2); - } - } - startPoint = endPoint + 1; - } - } - } - - function compileCharString(code, cmds, font) { - var stack = []; - var x = 0, y = 0; - var stems = 0; - - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function bezierCurveTo(x1, y1, x2, y2, x, y) { - cmds.push({cmd: 'bezierCurveTo', args: [x1, y1, x2, y2, x, y]}); - } - - function parse(code) { - var i = 0; - while (i < code.length) { - var stackClean = false; - var v = code[i++]; - var xa, xb, ya, yb, y1, y2, y3, n, subrCode; - switch (v) { - case 1: // hstem - stems += stack.length >> 1; - stackClean = true; - break; - case 3: // vstem - stems += stack.length >> 1; - stackClean = true; - break; - case 4: // vmoveto - y += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 5: // rlineto - while (stack.length > 0) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - break; - case 6: // hlineto - while (stack.length > 0) { - x += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - y += stack.shift(); - lineTo(x, y); - } - break; - case 7: // vlineto - while (stack.length > 0) { - y += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - x += stack.shift(); - lineTo(x, y); - } - break; - case 8: // rrcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 10: // callsubr - n = stack.pop() + font.subrsBias; - subrCode = font.subrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 11: // return - return; - case 12: - v = code[i++]; - switch (v) { - case 34: // flex - xa = x + stack.shift(); - xb = xa + stack.shift(); y1 = y + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y, xb, y1, x, y1); - xa = x + stack.shift(); - xb = xa + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y, x, y); - break; - case 35: // flex - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - stack.pop(); // fd - break; - case 36: // hflex1 - xa = x + stack.shift(); y1 = y + stack.shift(); - xb = xa + stack.shift(); y2 = y1 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y2, x, y2); - xa = x + stack.shift(); - xb = xa + stack.shift(); y3 = y2 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y2, xb, y3, x, y); - break; - case 37: // flex1 - var x0 = x, y0 = y; - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb; - if (Math.abs(x - x0) > Math.abs(y - y0)) { - x += stack.shift(); - } else { - y += stack.shift(); - } - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - default: - error('unknown operator: 12 ' + v); - } - break; - case 14: // endchar - if (stack.length >= 4) { - var achar = stack.pop(); - var bchar = stack.pop(); - y = stack.pop(); - x = stack.pop(); - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'translate', args: [x, y]}); - var gid = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[Encodings.StandardEncoding[achar]])); - compileCharString(font.glyphs[gid], cmds, font); - cmds.push({cmd: 'restore'}); - - gid = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[Encodings.StandardEncoding[bchar]])); - compileCharString(font.glyphs[gid], cmds, font); - } - return; - case 18: // hstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 19: // hintmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 20: // cntrmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 21: // rmoveto - y += stack.pop(); - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 22: // hmoveto - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 23: // vstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 24: // rcurveline - while (stack.length > 2) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - break; - case 25: // rlinecurve - while (stack.length > 6) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - case 26: // vvcurveto - if (stack.length % 2) { - x += stack.shift(); - } - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 27: // hhcurveto - if (stack.length % 2) { - y += stack.shift(); - } - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb; - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 28: - stack.push(((code[i] << 24) | (code[i + 1] << 16)) >> 16); - i += 2; - break; - case 29: // callgsubr - n = stack.pop() + font.gsubrsBias; - subrCode = font.gsubrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 30: // vhcurveto - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 31: // hvcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - default: - if (v < 32) { - error('unknown operator: ' + v); - } - if (v < 247) { - stack.push(v - 139); - } else if (v < 251) { - stack.push((v - 247) * 256 + code[i++] + 108); - } else if (v < 255) { - stack.push(-(v - 251) * 256 - code[i++] - 108); - } else { - stack.push(((code[i] << 24) | (code[i + 1] << 16) | - (code[i + 2] << 8) | code[i + 3]) / 65536); - i += 4; - } - break; - } - if (stackClean) { - stack.length = 0; - } - } - } - parse(code); - } - - var noop = ''; - - function CompiledFont(fontMatrix) { - this.compiledGlyphs = {}; - this.fontMatrix = fontMatrix; - } - CompiledFont.prototype = { - getPathJs: function (unicode) { - var gid = lookupCmap(this.cmap, unicode); - var fn = this.compiledGlyphs[gid]; - if (!fn) { - this.compiledGlyphs[gid] = fn = this.compileGlyph(this.glyphs[gid]); - } - return fn; - }, - - compileGlyph: function (code) { - if (!code || code.length === 0 || code[0] === 14) { - return noop; - } - - var cmds = []; - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', args: this.fontMatrix.slice()}); - cmds.push({cmd: 'scale', args: ['size', '-size']}); - - this.compileGlyphImpl(code, cmds); - - cmds.push({cmd: 'restore'}); - - return cmds; - }, - - compileGlyphImpl: function () { - error('Children classes should implement this.'); - }, - - hasBuiltPath: function (unicode) { - var gid = lookupCmap(this.cmap, unicode); - return gid in this.compiledGlyphs; - } - }; - - function TrueTypeCompiled(glyphs, cmap, fontMatrix) { - fontMatrix = fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]; - CompiledFont.call(this, fontMatrix); - - this.glyphs = glyphs; - this.cmap = cmap; - - this.compiledGlyphs = []; - } - - Util.inherit(TrueTypeCompiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileGlyf(code, cmds, this); - } - }); - - function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { - fontMatrix = fontMatrix || [0.001, 0, 0, 0.001, 0, 0]; - CompiledFont.call(this, fontMatrix); - this.glyphs = cffInfo.glyphs; - this.gsubrs = cffInfo.gsubrs || []; - this.subrs = cffInfo.subrs || []; - this.cmap = cmap; - this.glyphNameMap = glyphNameMap || GlyphsUnicode; - - this.compiledGlyphs = []; - this.gsubrsBias = (this.gsubrs.length < 1240 ? - 107 : (this.gsubrs.length < 33900 ? 1131 : 32768)); - this.subrsBias = (this.subrs.length < 1240 ? - 107 : (this.subrs.length < 33900 ? 1131 : 32768)); - } - - Util.inherit(Type2Compiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileCharString(code, cmds, this); - } - }); - - - return { - create: function FontRendererFactory_create(font) { - var data = new Uint8Array(font.data); - var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; - var numTables = getUshort(data, 4); - for (var i = 0, p = 12; i < numTables; i++, p += 16) { - var tag = bytesToString(data.subarray(p, p + 4)); - var offset = getLong(data, p + 8); - var length = getLong(data, p + 12); - switch (tag) { - case 'cmap': - cmap = parseCmap(data, offset, offset + length); - break; - case 'glyf': - glyf = data.subarray(offset, offset + length); - break; - case 'loca': - loca = data.subarray(offset, offset + length); - break; - case 'head': - unitsPerEm = getUshort(data, offset + 18); - indexToLocFormat = getUshort(data, offset + 50); - break; - case 'CFF ': - cff = parseCff(data, offset, offset + length); - break; - } - } - - if (glyf) { - var fontMatrix = (!unitsPerEm ? font.fontMatrix : - [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]); - return new TrueTypeCompiled( - parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); - } else { - return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); - } - } - }; -})(); - - -// TODO refactor to remove cyclic dependency on fonts.js -function _setCoreFonts(coreFonts_) { - coreFonts = coreFonts_; - Encodings = coreFonts_.Encodings; - CFFParser = coreFonts_.CFFParser; -} -exports._setCoreFonts = _setCoreFonts; - -exports.FontRendererFactory = FontRendererFactory; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreParser = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream) { - -var MissingDataException = sharedUtil.MissingDataException; -var StreamType = sharedUtil.StreamType; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isNum = sharedUtil.isNum; -var isString = sharedUtil.isString; -var warn = sharedUtil.warn; -var Cmd = corePrimitives.Cmd; -var Dict = corePrimitives.Dict; -var Name = corePrimitives.Name; -var Ref = corePrimitives.Ref; -var isCmd = corePrimitives.isCmd; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var Ascii85Stream = coreStream.Ascii85Stream; -var AsciiHexStream = coreStream.AsciiHexStream; -var CCITTFaxStream = coreStream.CCITTFaxStream; -var FlateStream = coreStream.FlateStream; -var Jbig2Stream = coreStream.Jbig2Stream; -var JpegStream = coreStream.JpegStream; -var JpxStream = coreStream.JpxStream; -var LZWStream = coreStream.LZWStream; -var NullStream = coreStream.NullStream; -var PredictorStream = coreStream.PredictorStream; -var RunLengthStream = coreStream.RunLengthStream; - -var EOF = {}; - -function isEOF(v) { - return (v === EOF); -} - -var MAX_LENGTH_TO_CACHE = 1000; - -var Parser = (function ParserClosure() { - function Parser(lexer, allowStreams, xref) { - this.lexer = lexer; - this.allowStreams = allowStreams; - this.xref = xref; - this.imageCache = {}; - this.refill(); - } - - Parser.prototype = { - refill: function Parser_refill() { - this.buf1 = this.lexer.getObj(); - this.buf2 = this.lexer.getObj(); - }, - shift: function Parser_shift() { - if (isCmd(this.buf2, 'ID')) { - this.buf1 = this.buf2; - this.buf2 = null; - } else { - this.buf1 = this.buf2; - this.buf2 = this.lexer.getObj(); - } - }, - tryShift: function Parser_tryShift() { - try { - this.shift(); - return true; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - // Upon failure, the caller should reset this.lexer.pos to a known good - // state and call this.shift() twice to reset the buffers. - return false; - } - }, - getObj: function Parser_getObj(cipherTransform) { - var buf1 = this.buf1; - this.shift(); - - if (buf1 instanceof Cmd) { - switch (buf1.cmd) { - case 'BI': // inline image - return this.makeInlineImage(cipherTransform); - case '[': // array - var array = []; - while (!isCmd(this.buf1, ']') && !isEOF(this.buf1)) { - array.push(this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - error('End of file inside array'); - } - this.shift(); - return array; - case '<<': // dictionary or stream - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - info('Malformed dictionary: key must be a name object'); - this.shift(); - continue; - } - - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - error('End of file inside dictionary'); - } - - // Stream objects are not allowed inside content streams or - // object streams. - if (isCmd(this.buf2, 'stream')) { - return (this.allowStreams ? - this.makeStream(dict, cipherTransform) : dict); - } - this.shift(); - return dict; - default: // simple object - return buf1; - } - } - - if (isInt(buf1)) { // indirect reference or integer - var num = buf1; - if (isInt(this.buf1) && isCmd(this.buf2, 'R')) { - var ref = new Ref(num, this.buf1); - this.shift(); - this.shift(); - return ref; - } - return num; - } - - if (isString(buf1)) { // string - var str = buf1; - if (cipherTransform) { - str = cipherTransform.decryptString(str); - } - return str; - } - - // simple object - return buf1; - }, - /** - * Find the end of the stream by searching for the /EI\s/. - * @returns {number} The inline stream length. - */ - findDefaultInlineStreamEnd: - function Parser_findDefaultInlineStreamEnd(stream) { - var E = 0x45, I = 0x49, SPACE = 0x20, LF = 0xA, CR = 0xD; - var startPos = stream.pos, state = 0, ch, i, n, followingBytes; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else { - assert(state === 2); - if (ch === SPACE || ch === LF || ch === CR) { - // Let's check the next five bytes are ASCII... just be sure. - n = 5; - followingBytes = stream.peekBytes(n); - for (i = 0; i < n; i++) { - ch = followingBytes[i]; - if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { - // Not a LF, CR, SPACE or any visible ASCII character, i.e. - // it's binary stuff. Resetting the state. - state = 0; - break; - } - } - if (state === 2) { - break; // Finished! - } - } else { - state = 0; - } - } - } - return ((stream.pos - 4) - startPos); - }, - /** - * Find the EOI (end-of-image) marker 0xFFD9 of the stream. - * @returns {number} The inline stream length. - */ - findDCTDecodeInlineStreamEnd: - function Parser_findDCTDecodeInlineStreamEnd(stream) { - var startPos = stream.pos, foundEOI = false, b, markerLength, length; - while ((b = stream.getByte()) !== -1) { - if (b !== 0xFF) { // Not a valid marker. - continue; - } - switch (stream.getByte()) { - case 0x00: // Byte stuffing. - // 0xFF00 appears to be a very common byte sequence in JPEG images. - break; - - case 0xFF: // Fill byte. - // Avoid skipping a valid marker, resetting the stream position. - stream.skip(-1); - break; - - case 0xD9: // EOI - foundEOI = true; - break; - - case 0xC0: // SOF0 - case 0xC1: // SOF1 - case 0xC2: // SOF2 - case 0xC3: // SOF3 - - case 0xC5: // SOF5 - case 0xC6: // SOF6 - case 0xC7: // SOF7 - - case 0xC9: // SOF9 - case 0xCA: // SOF10 - case 0xCB: // SOF11 - - case 0xCD: // SOF13 - case 0xCE: // SOF14 - case 0xCF: // SOF15 - - case 0xC4: // DHT - case 0xCC: // DAC - - case 0xDA: // SOS - case 0xDB: // DQT - case 0xDC: // DNL - case 0xDD: // DRI - case 0xDE: // DHP - case 0xDF: // EXP - - case 0xE0: // APP0 - case 0xE1: // APP1 - case 0xE2: // APP2 - case 0xE3: // APP3 - case 0xE4: // APP4 - case 0xE5: // APP5 - case 0xE6: // APP6 - case 0xE7: // APP7 - case 0xE8: // APP8 - case 0xE9: // APP9 - case 0xEA: // APP10 - case 0xEB: // APP11 - case 0xEC: // APP12 - case 0xED: // APP13 - case 0xEE: // APP14 - case 0xEF: // APP15 - - case 0xFE: // COM - // The marker should be followed by the length of the segment. - markerLength = stream.getUint16(); - if (markerLength > 2) { - // |markerLength| contains the byte length of the marker segment, - // including its own length (2 bytes) and excluding the marker. - stream.skip(markerLength - 2); // Jump to the next marker. - } else { - // The marker length is invalid, resetting the stream position. - stream.skip(-2); - } - break; - } - if (foundEOI) { - break; - } - } - length = stream.pos - startPos; - if (b === -1) { - warn('Inline DCTDecode image stream: ' + - 'EOI marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCII85DecodeInlineStreamEnd: - function Parser_findASCII85DecodeInlineStreamEnd(stream) { - var TILDE = 0x7E, GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === TILDE && stream.peekByte() === GT) { - stream.skip(); - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCII85Decode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '>' (i.e. GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCIIHexDecodeInlineStreamEnd: - function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { - var GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === GT) { - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCIIHexDecode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Skip over the /EI/ for streams where we search for an EOD marker. - */ - inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { - var E = 0x45, I = 0x49; - var state = 0, ch; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else if (state === 2) { - break; - } - } - }, - makeInlineImage: function Parser_makeInlineImage(cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // Parse dictionary. - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, 'ID') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - error('Dictionary key must be a name object'); - } - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - - // Extract the name of the first (i.e. the current) image filter. - var filter = dict.get('Filter', 'F'), filterName; - if (isName(filter)) { - filterName = filter.name; - } else if (isArray(filter) && isName(filter[0])) { - filterName = filter[0].name; - } - - // Parse image stream. - var startPos = stream.pos, length, i, ii; - if (filterName === 'DCTDecode' || filterName === 'DCT') { - length = this.findDCTDecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCII85Decide' || filterName === 'A85') { - length = this.findASCII85DecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { - length = this.findASCIIHexDecodeInlineStreamEnd(stream); - } else { - length = this.findDefaultInlineStreamEnd(stream); - } - var imageStream = stream.makeSubStream(startPos, length, dict); - - // Cache all images below the MAX_LENGTH_TO_CACHE threshold by their - // adler32 checksum. - var adler32; - if (length < MAX_LENGTH_TO_CACHE) { - var imageBytes = imageStream.getBytes(); - imageStream.reset(); - - var a = 1; - var b = 0; - for (i = 0, ii = imageBytes.length; i < ii; ++i) { - // No modulo required in the loop if imageBytes.length < 5552. - a += imageBytes[i] & 0xff; - b += a; - } - adler32 = ((b % 65521) << 16) | (a % 65521); - - if (this.imageCache.adler32 === adler32) { - this.buf2 = Cmd.get('EI'); - this.shift(); - - this.imageCache[adler32].reset(); - return this.imageCache[adler32]; - } - } - - if (cipherTransform) { - imageStream = cipherTransform.createStream(imageStream, length); - } - - imageStream = this.filter(imageStream, dict, length); - imageStream.dict = dict; - if (adler32 !== undefined) { - imageStream.cacheKey = 'inline_' + length + '_' + adler32; - this.imageCache[adler32] = imageStream; - } - - this.buf2 = Cmd.get('EI'); - this.shift(); - - return imageStream; - }, - makeStream: function Parser_makeStream(dict, cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // get stream start position - lexer.skipToNextLine(); - var pos = stream.pos - 1; - - // get length - var length = dict.get('Length'); - if (!isInt(length)) { - info('Bad ' + length + ' attribute in stream'); - length = 0; - } - - // skip over the stream data - stream.pos = pos + length; - lexer.nextChar(); - - // Shift '>>' and check whether the new object marks the end of the stream - if (this.tryShift() && isCmd(this.buf2, 'endstream')) { - this.shift(); // 'stream' - } else { - // bad stream length, scanning for endstream - stream.pos = pos; - var SCAN_BLOCK_SIZE = 2048; - var ENDSTREAM_SIGNATURE_LENGTH = 9; - var ENDSTREAM_SIGNATURE = [0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6D]; - var skipped = 0, found = false, i, j; - while (stream.pos < stream.end) { - var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); - var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; - if (scanLength <= 0) { - break; - } - found = false; - i = 0; - while (i < scanLength) { - j = 0; - while (j < ENDSTREAM_SIGNATURE_LENGTH && - scanBytes[i + j] === ENDSTREAM_SIGNATURE[j]) { - j++; - } - if (j >= ENDSTREAM_SIGNATURE_LENGTH) { - found = true; - break; - } - i++; - } - if (found) { - skipped += i; - stream.pos += i; - break; - } - skipped += scanLength; - stream.pos += scanLength; - } - if (!found) { - error('Missing endstream'); - } - length = skipped; - - lexer.nextChar(); - this.shift(); - this.shift(); - } - this.shift(); // 'endstream' - - stream = stream.makeSubStream(pos, length, dict); - if (cipherTransform) { - stream = cipherTransform.createStream(stream, length); - } - stream = this.filter(stream, dict, length); - stream.dict = dict; - return stream; - }, - filter: function Parser_filter(stream, dict, length) { - var filter = dict.get('Filter', 'F'); - var params = dict.get('DecodeParms', 'DP'); - if (isName(filter)) { - return this.makeFilter(stream, filter.name, length, params); - } - - var maybeLength = length; - if (isArray(filter)) { - var filterArray = filter; - var paramsArray = params; - for (var i = 0, ii = filterArray.length; i < ii; ++i) { - filter = filterArray[i]; - if (!isName(filter)) { - error('Bad filter name: ' + filter); - } - - params = null; - if (isArray(paramsArray) && (i in paramsArray)) { - params = paramsArray[i]; - } - stream = this.makeFilter(stream, filter.name, maybeLength, params); - // after the first stream the length variable is invalid - maybeLength = null; - } - } - return stream; - }, - makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { - if (stream.dict.get('Length') === 0 && !maybeLength) { - warn('Empty "' + name + '" stream.'); - return new NullStream(stream); - } - try { - if (params && this.xref) { - params = this.xref.fetchIfRef(params); - } - var xrefStreamStats = this.xref.stats.streamTypes; - if (name === 'FlateDecode' || name === 'Fl') { - xrefStreamStats[StreamType.FLATE] = true; - if (params) { - return new PredictorStream(new FlateStream(stream, maybeLength), - maybeLength, params); - } - return new FlateStream(stream, maybeLength); - } - if (name === 'LZWDecode' || name === 'LZW') { - xrefStreamStats[StreamType.LZW] = true; - var earlyChange = 1; - if (params) { - if (params.has('EarlyChange')) { - earlyChange = params.get('EarlyChange'); - } - return new PredictorStream( - new LZWStream(stream, maybeLength, earlyChange), - maybeLength, params); - } - return new LZWStream(stream, maybeLength, earlyChange); - } - if (name === 'DCTDecode' || name === 'DCT') { - xrefStreamStats[StreamType.DCT] = true; - return new JpegStream(stream, maybeLength, stream.dict, this.xref); - } - if (name === 'JPXDecode' || name === 'JPX') { - xrefStreamStats[StreamType.JPX] = true; - return new JpxStream(stream, maybeLength, stream.dict); - } - if (name === 'ASCII85Decode' || name === 'A85') { - xrefStreamStats[StreamType.A85] = true; - return new Ascii85Stream(stream, maybeLength); - } - if (name === 'ASCIIHexDecode' || name === 'AHx') { - xrefStreamStats[StreamType.AHX] = true; - return new AsciiHexStream(stream, maybeLength); - } - if (name === 'CCITTFaxDecode' || name === 'CCF') { - xrefStreamStats[StreamType.CCF] = true; - return new CCITTFaxStream(stream, maybeLength, params); - } - if (name === 'RunLengthDecode' || name === 'RL') { - xrefStreamStats[StreamType.RL] = true; - return new RunLengthStream(stream, maybeLength); - } - if (name === 'JBIG2Decode') { - xrefStreamStats[StreamType.JBIG] = true; - return new Jbig2Stream(stream, maybeLength, stream.dict); - } - warn('filter "' + name + '" not supported yet'); - return stream; - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Invalid stream: \"' + ex + '\"'); - return new NullStream(stream); - } - } - }; - - return Parser; -})(); - -var Lexer = (function LexerClosure() { - function Lexer(stream, knownCommands) { - this.stream = stream; - this.nextChar(); - - // While lexing, we build up many strings one char at a time. Using += for - // this can result in lots of garbage strings. It's better to build an - // array of single-char strings and then join() them together at the end. - // And reusing a single array (i.e. |this.strBuf|) over and over for this - // purpose uses less memory than using a new array for each string. - this.strBuf = []; - - // The PDFs might have "glued" commands with other commands, operands or - // literals, e.g. "q1". The knownCommands is a dictionary of the valid - // commands and their prefixes. The prefixes are built the following way: - // if there a command that is a prefix of the other valid command or - // literal (e.g. 'f' and 'false') the following prefixes must be included, - // 'fa', 'fal', 'fals'. The prefixes are not needed, if the command has no - // other commands or literals as a prefix. The knowCommands is optional. - this.knownCommands = knownCommands; - } - - Lexer.isSpace = function Lexer_isSpace(ch) { - // Space is one of the following characters: SPACE, TAB, CR or LF. - return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A); - }; - - // A '1' in this array means the character is white space. A '1' or - // '2' means the character ends a name or command. - var specialChars = [ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x - 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx - ]; - - function toHexDigit(ch) { - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - return ch & 0x0F; - } - if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'F', 'a'-'f' - return (ch & 0x0F) + 9; - } - return -1; - } - - Lexer.prototype = { - nextChar: function Lexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - peekChar: function Lexer_peekChar() { - return this.stream.peekByte(); - }, - getNumber: function Lexer_getNumber() { - var ch = this.currentChar; - var eNotation = false; - var divideBy = 0; // different from 0 if it's a floating point value - var sign = 1; - - if (ch === 0x2D) { // '-' - sign = -1; - ch = this.nextChar(); - - if (ch === 0x2D) { // '-' - // Ignore double negative (this is consistent with Adobe Reader). - ch = this.nextChar(); - } - } else if (ch === 0x2B) { // '+' - ch = this.nextChar(); - } - if (ch === 0x2E) { // '.' - divideBy = 10; - ch = this.nextChar(); - } - if (ch < 0x30 || ch > 0x39) { // '0' - '9' - error('Invalid number: ' + String.fromCharCode(ch)); - return 0; - } - - var baseValue = ch - 0x30; // '0' - var powerValue = 0; - var powerValueSign = 1; - - while ((ch = this.nextChar()) >= 0) { - if (0x30 <= ch && ch <= 0x39) { // '0' - '9' - var currentDigit = ch - 0x30; // '0' - if (eNotation) { // We are after an 'e' or 'E' - powerValue = powerValue * 10 + currentDigit; - } else { - if (divideBy !== 0) { // We are after a point - divideBy *= 10; - } - baseValue = baseValue * 10 + currentDigit; - } - } else if (ch === 0x2E) { // '.' - if (divideBy === 0) { - divideBy = 1; - } else { - // A number can have only one '.' - break; - } - } else if (ch === 0x2D) { // '-' - // ignore minus signs in the middle of numbers to match - // Adobe's behavior - warn('Badly formated number'); - } else if (ch === 0x45 || ch === 0x65) { // 'E', 'e' - // 'E' can be either a scientific notation or the beginning of a new - // operator - ch = this.peekChar(); - if (ch === 0x2B || ch === 0x2D) { // '+', '-' - powerValueSign = (ch === 0x2D) ? -1 : 1; - this.nextChar(); // Consume the sign character - } else if (ch < 0x30 || ch > 0x39) { // '0' - '9' - // The 'E' must be the beginning of a new operator - break; - } - eNotation = true; - } else { - // the last character doesn't belong to us - break; - } - } - - if (divideBy !== 0) { - baseValue /= divideBy; - } - if (eNotation) { - baseValue *= Math.pow(10, powerValueSign * powerValue); - } - return sign * baseValue; - }, - getString: function Lexer_getString() { - var numParen = 1; - var done = false; - var strBuf = this.strBuf; - strBuf.length = 0; - - var ch = this.nextChar(); - while (true) { - var charBuffered = false; - switch (ch | 0) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x28: // '(' - ++numParen; - strBuf.push('('); - break; - case 0x29: // ')' - if (--numParen === 0) { - this.nextChar(); // consume strings ')' - done = true; - } else { - strBuf.push(')'); - } - break; - case 0x5C: // '\\' - ch = this.nextChar(); - switch (ch) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x6E: // 'n' - strBuf.push('\n'); - break; - case 0x72: // 'r' - strBuf.push('\r'); - break; - case 0x74: // 't' - strBuf.push('\t'); - break; - case 0x62: // 'b' - strBuf.push('\b'); - break; - case 0x66: // 'f' - strBuf.push('\f'); - break; - case 0x5C: // '\' - case 0x28: // '(' - case 0x29: // ')' - strBuf.push(String.fromCharCode(ch)); - break; - case 0x30: case 0x31: case 0x32: case 0x33: // '0'-'3' - case 0x34: case 0x35: case 0x36: case 0x37: // '4'-'7' - var x = ch & 0x0F; - ch = this.nextChar(); - charBuffered = true; - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - x = (x << 3) + (ch & 0x0F); - ch = this.nextChar(); - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - charBuffered = false; - x = (x << 3) + (ch & 0x0F); - } - } - strBuf.push(String.fromCharCode(x)); - break; - case 0x0D: // CR - if (this.peekChar() === 0x0A) { // LF - this.nextChar(); - } - break; - case 0x0A: // LF - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - if (done) { - break; - } - if (!charBuffered) { - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getName: function Lexer_getName() { - var ch, previousCh; - var strBuf = this.strBuf; - strBuf.length = 0; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - if (ch === 0x23) { // '#' - ch = this.nextChar(); - if (specialChars[ch]) { - warn('Lexer_getName: ' + - 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); - strBuf.push('#'); - break; - } - var x = toHexDigit(ch); - if (x !== -1) { - previousCh = ch; - ch = this.nextChar(); - var x2 = toHexDigit(ch); - if (x2 === -1) { - warn('Lexer_getName: Illegal digit (' + - String.fromCharCode(ch) +') in hexadecimal number.'); - strBuf.push('#', String.fromCharCode(previousCh)); - if (specialChars[ch]) { - break; - } - strBuf.push(String.fromCharCode(ch)); - continue; - } - strBuf.push(String.fromCharCode((x << 4) | x2)); - } else { - strBuf.push('#', String.fromCharCode(ch)); - } - } else { - strBuf.push(String.fromCharCode(ch)); - } - } - if (strBuf.length > 127) { - warn('name token is longer than allowed by the spec: ' + strBuf.length); - } - return Name.get(strBuf.join('')); - }, - getHexString: function Lexer_getHexString() { - var strBuf = this.strBuf; - strBuf.length = 0; - var ch = this.currentChar; - var isFirstHex = true; - var firstDigit; - var secondDigit; - while (true) { - if (ch < 0) { - warn('Unterminated hex string'); - break; - } else if (ch === 0x3E) { // '>' - this.nextChar(); - break; - } else if (specialChars[ch] === 1) { - ch = this.nextChar(); - continue; - } else { - if (isFirstHex) { - firstDigit = toHexDigit(ch); - if (firstDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - } else { - secondDigit = toHexDigit(ch); - if (secondDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - strBuf.push(String.fromCharCode((firstDigit << 4) | secondDigit)); - } - isFirstHex = !isFirstHex; - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getObj: function Lexer_getObj() { - // skip whitespace and comments - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch < 0) { - return EOF; - } - if (comment) { - if (ch === 0x0A || ch === 0x0D) { // LF, CR - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (specialChars[ch] !== 1) { - break; - } - ch = this.nextChar(); - } - - // start reading token - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return this.getNumber(); - case 0x28: // '(' - return this.getString(); - case 0x2F: // '/' - return this.getName(); - // array punctuation - case 0x5B: // '[' - this.nextChar(); - return Cmd.get('['); - case 0x5D: // ']' - this.nextChar(); - return Cmd.get(']'); - // hex string or dict punctuation - case 0x3C: // '<' - ch = this.nextChar(); - if (ch === 0x3C) { - // dict punctuation - this.nextChar(); - return Cmd.get('<<'); - } - return this.getHexString(); - // dict punctuation - case 0x3E: // '>' - ch = this.nextChar(); - if (ch === 0x3E) { - this.nextChar(); - return Cmd.get('>>'); - } - return Cmd.get('>'); - case 0x7B: // '{' - this.nextChar(); - return Cmd.get('{'); - case 0x7D: // '}' - this.nextChar(); - return Cmd.get('}'); - case 0x29: // ')' - error('Illegal character: ' + ch); - break; - } - - // command - var str = String.fromCharCode(ch); - var knownCommands = this.knownCommands; - var knownCommandFound = knownCommands && knownCommands[str] !== undefined; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - // stop if known command is found and next character does not make - // the str a command - var possibleCommand = str + String.fromCharCode(ch); - if (knownCommandFound && knownCommands[possibleCommand] === undefined) { - break; - } - if (str.length === 128) { - error('Command token too long: ' + str.length); - } - str = possibleCommand; - knownCommandFound = knownCommands && knownCommands[str] !== undefined; - } - if (str === 'true') { - return true; - } - if (str === 'false') { - return false; - } - if (str === 'null') { - return null; - } - return Cmd.get(str); - }, - skipToNextLine: function Lexer_skipToNextLine() { - var ch = this.currentChar; - while (ch >= 0) { - if (ch === 0x0D) { // CR - ch = this.nextChar(); - if (ch === 0x0A) { // LF - this.nextChar(); - } - break; - } else if (ch === 0x0A) { // LF - this.nextChar(); - break; - } - ch = this.nextChar(); - } - } - }; - - return Lexer; -})(); - -var Linearization = { - create: function LinearizationCreate(stream) { - function getInt(name, allowZeroValue) { - var obj = linDict.get(name); - if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { - return obj; - } - throw new Error('The "' + name + '" parameter in the linearization ' + - 'dictionary is invalid.'); - } - function getHints() { - var hints = linDict.get('H'), hintsLength, item; - if (isArray(hints) && - ((hintsLength = hints.length) === 2 || hintsLength === 4)) { - for (var index = 0; index < hintsLength; index++) { - if (!(isInt(item = hints[index]) && item > 0)) { - throw new Error('Hint (' + index + - ') in the linearization dictionary is invalid.'); - } - } - return hints; - } - throw new Error('Hint array in the linearization dictionary is invalid.'); - } - var parser = new Parser(new Lexer(stream), false, null); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - var linDict = parser.getObj(); - var obj, length; - if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) && - isNum(obj = linDict.get('Linearized')) && obj > 0)) { - return null; // No valid linearization dictionary found. - } else if ((length = getInt('L')) !== stream.length) { - throw new Error('The "L" parameter in the linearization dictionary ' + - 'does not equal the stream length.'); - } - return { - length: length, - hints: getHints(), - objectNumberFirst: getInt('O'), - endFirst: getInt('E'), - numPages: getInt('N'), - mainXRefEntriesOffset: getInt('T'), - pageFirst: (linDict.has('P') ? getInt('P', true) : 0) - }; - } -}; - -exports.EOF = EOF; -exports.Lexer = Lexer; -exports.Linearization = Linearization; -exports.Parser = Parser; -exports.isEOF = isEOF; - -// TODO refactor to remove dependency on stream.js -coreStream._setCoreParser(exports); -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCMap = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser) { - -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var isInt = sharedUtil.isInt; -var isString = sharedUtil.isString; -var warn = sharedUtil.warn; -var isName = corePrimitives.isName; -var isCmd = corePrimitives.isCmd; -var isStream = corePrimitives.isStream; -var StringStream = coreStream.StringStream; -var Lexer = coreParser.Lexer; -var isEOF = coreParser.isEOF; - -var BUILT_IN_CMAPS = [ -// << Start unicode maps. -'Adobe-GB1-UCS2', -'Adobe-CNS1-UCS2', -'Adobe-Japan1-UCS2', -'Adobe-Korea1-UCS2', -// >> End unicode maps. -'78-EUC-H', -'78-EUC-V', -'78-H', -'78-RKSJ-H', -'78-RKSJ-V', -'78-V', -'78ms-RKSJ-H', -'78ms-RKSJ-V', -'83pv-RKSJ-H', -'90ms-RKSJ-H', -'90ms-RKSJ-V', -'90msp-RKSJ-H', -'90msp-RKSJ-V', -'90pv-RKSJ-H', -'90pv-RKSJ-V', -'Add-H', -'Add-RKSJ-H', -'Add-RKSJ-V', -'Add-V', -'Adobe-CNS1-0', -'Adobe-CNS1-1', -'Adobe-CNS1-2', -'Adobe-CNS1-3', -'Adobe-CNS1-4', -'Adobe-CNS1-5', -'Adobe-CNS1-6', -'Adobe-GB1-0', -'Adobe-GB1-1', -'Adobe-GB1-2', -'Adobe-GB1-3', -'Adobe-GB1-4', -'Adobe-GB1-5', -'Adobe-Japan1-0', -'Adobe-Japan1-1', -'Adobe-Japan1-2', -'Adobe-Japan1-3', -'Adobe-Japan1-4', -'Adobe-Japan1-5', -'Adobe-Japan1-6', -'Adobe-Korea1-0', -'Adobe-Korea1-1', -'Adobe-Korea1-2', -'B5-H', -'B5-V', -'B5pc-H', -'B5pc-V', -'CNS-EUC-H', -'CNS-EUC-V', -'CNS1-H', -'CNS1-V', -'CNS2-H', -'CNS2-V', -'ETHK-B5-H', -'ETHK-B5-V', -'ETen-B5-H', -'ETen-B5-V', -'ETenms-B5-H', -'ETenms-B5-V', -'EUC-H', -'EUC-V', -'Ext-H', -'Ext-RKSJ-H', -'Ext-RKSJ-V', -'Ext-V', -'GB-EUC-H', -'GB-EUC-V', -'GB-H', -'GB-V', -'GBK-EUC-H', -'GBK-EUC-V', -'GBK2K-H', -'GBK2K-V', -'GBKp-EUC-H', -'GBKp-EUC-V', -'GBT-EUC-H', -'GBT-EUC-V', -'GBT-H', -'GBT-V', -'GBTpc-EUC-H', -'GBTpc-EUC-V', -'GBpc-EUC-H', -'GBpc-EUC-V', -'H', -'HKdla-B5-H', -'HKdla-B5-V', -'HKdlb-B5-H', -'HKdlb-B5-V', -'HKgccs-B5-H', -'HKgccs-B5-V', -'HKm314-B5-H', -'HKm314-B5-V', -'HKm471-B5-H', -'HKm471-B5-V', -'HKscs-B5-H', -'HKscs-B5-V', -'Hankaku', -'Hiragana', -'KSC-EUC-H', -'KSC-EUC-V', -'KSC-H', -'KSC-Johab-H', -'KSC-Johab-V', -'KSC-V', -'KSCms-UHC-H', -'KSCms-UHC-HW-H', -'KSCms-UHC-HW-V', -'KSCms-UHC-V', -'KSCpc-EUC-H', -'KSCpc-EUC-V', -'Katakana', -'NWP-H', -'NWP-V', -'RKSJ-H', -'RKSJ-V', -'Roman', -'UniCNS-UCS2-H', -'UniCNS-UCS2-V', -'UniCNS-UTF16-H', -'UniCNS-UTF16-V', -'UniCNS-UTF32-H', -'UniCNS-UTF32-V', -'UniCNS-UTF8-H', -'UniCNS-UTF8-V', -'UniGB-UCS2-H', -'UniGB-UCS2-V', -'UniGB-UTF16-H', -'UniGB-UTF16-V', -'UniGB-UTF32-H', -'UniGB-UTF32-V', -'UniGB-UTF8-H', -'UniGB-UTF8-V', -'UniJIS-UCS2-H', -'UniJIS-UCS2-HW-H', -'UniJIS-UCS2-HW-V', -'UniJIS-UCS2-V', -'UniJIS-UTF16-H', -'UniJIS-UTF16-V', -'UniJIS-UTF32-H', -'UniJIS-UTF32-V', -'UniJIS-UTF8-H', -'UniJIS-UTF8-V', -'UniJIS2004-UTF16-H', -'UniJIS2004-UTF16-V', -'UniJIS2004-UTF32-H', -'UniJIS2004-UTF32-V', -'UniJIS2004-UTF8-H', -'UniJIS2004-UTF8-V', -'UniJISPro-UCS2-HW-V', -'UniJISPro-UCS2-V', -'UniJISPro-UTF8-V', -'UniJISX0213-UTF32-H', -'UniJISX0213-UTF32-V', -'UniJISX02132004-UTF32-H', -'UniJISX02132004-UTF32-V', -'UniKS-UCS2-H', -'UniKS-UCS2-V', -'UniKS-UTF16-H', -'UniKS-UTF16-V', -'UniKS-UTF32-H', -'UniKS-UTF32-V', -'UniKS-UTF8-H', -'UniKS-UTF8-V', -'V', -'WP-Symbol']; - -// CMap, not to be confused with TrueType's cmap. -var CMap = (function CMapClosure() { - function CMap(builtInCMap) { - // Codespace ranges are stored as follows: - // [[1BytePairs], [2BytePairs], [3BytePairs], [4BytePairs]] - // where nBytePairs are ranges e.g. [low1, high1, low2, high2, ...] - this.codespaceRanges = [[], [], [], []]; - this.numCodespaceRanges = 0; - // Map entries have one of two forms. - // - cid chars are 16-bit unsigned integers, stored as integers. - // - bf chars are variable-length byte sequences, stored as strings, with - // one byte per character. - this._map = []; - this.name = ''; - this.vertical = false; - this.useCMap = null; - this.builtInCMap = builtInCMap; - } - CMap.prototype = { - addCodespaceRange: function(n, low, high) { - this.codespaceRanges[n - 1].push(low, high); - this.numCodespaceRanges++; - }, - - mapCidRange: function(low, high, dstLow) { - while (low <= high) { - this._map[low++] = dstLow++; - } - }, - - mapBfRange: function(low, high, dstLow) { - var lastByte = dstLow.length - 1; - while (low <= high) { - this._map[low++] = dstLow; - // Only the last byte has to be incremented. - dstLow = dstLow.substr(0, lastByte) + - String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); - } - }, - - mapBfRangeToArray: function(low, high, array) { - var i = 0, ii = array.length; - while (low <= high && i < ii) { - this._map[low] = array[i++]; - ++low; - } - }, - - // This is used for both bf and cid chars. - mapOne: function(src, dst) { - this._map[src] = dst; - }, - - lookup: function(code) { - return this._map[code]; - }, - - contains: function(code) { - return this._map[code] !== undefined; - }, - - forEach: function(callback) { - // Most maps have fewer than 65536 entries, and for those we use normal - // array iteration. But really sparse tables are possible -- e.g. with - // indices in the *billions*. For such tables we use for..in, which isn't - // ideal because it stringifies the indices for all present elements, but - // it does avoid iterating over every undefined entry. - var map = this._map; - var length = map.length; - var i; - if (length <= 0x10000) { - for (i = 0; i < length; i++) { - if (map[i] !== undefined) { - callback(i, map[i]); - } - } - } else { - for (i in this._map) { - callback(i, map[i]); - } - } - }, - - charCodeOf: function(value) { - return this._map.indexOf(value); - }, - - getMap: function() { - return this._map; - }, - - readCharCode: function(str, offset, out) { - var c = 0; - var codespaceRanges = this.codespaceRanges; - var codespaceRangesLen = this.codespaceRanges.length; - // 9.7.6.2 CMap Mapping - // The code length is at most 4. - for (var n = 0; n < codespaceRangesLen; n++) { - c = ((c << 8) | str.charCodeAt(offset + n)) >>> 0; - // Check each codespace range to see if it falls within. - var codespaceRange = codespaceRanges[n]; - for (var k = 0, kk = codespaceRange.length; k < kk;) { - var low = codespaceRange[k++]; - var high = codespaceRange[k++]; - if (c >= low && c <= high) { - out.charcode = c; - out.length = n + 1; - return; - } - } - } - out.charcode = 0; - out.length = 1; - }, - - get length() { - return this._map.length; - }, - - get isIdentityCMap() { - if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { - return false; - } - if (this._map.length !== 0x10000) { - return false; - } - for (var i = 0; i < 0x10000; i++) { - if (this._map[i] !== i) { - return false; - } - } - return true; - } - }; - return CMap; -})(); - -// A special case of CMap, where the _map array implicitly has a length of -// 65536 and each element is equal to its index. -var IdentityCMap = (function IdentityCMapClosure() { - function IdentityCMap(vertical, n) { - CMap.call(this); - this.vertical = vertical; - this.addCodespaceRange(n, 0, 0xffff); - } - Util.inherit(IdentityCMap, CMap, {}); - - IdentityCMap.prototype = { - addCodespaceRange: CMap.prototype.addCodespaceRange, - - mapCidRange: function(low, high, dstLow) { - error('should not call mapCidRange'); - }, - - mapBfRange: function(low, high, dstLow) { - error('should not call mapBfRange'); - }, - - mapBfRangeToArray: function(low, high, array) { - error('should not call mapBfRangeToArray'); - }, - - mapOne: function(src, dst) { - error('should not call mapCidOne'); - }, - - lookup: function(code) { - return (isInt(code) && code <= 0xffff) ? code : undefined; - }, - - contains: function(code) { - return isInt(code) && code <= 0xffff; - }, - - forEach: function(callback) { - for (var i = 0; i <= 0xffff; i++) { - callback(i, i); - } - }, - - charCodeOf: function(value) { - return (isInt(value) && value <= 0xffff) ? value : -1; - }, - - getMap: function() { - // Sometimes identity maps must be instantiated, but it's rare. - var map = new Array(0x10000); - for (var i = 0; i <= 0xffff; i++) { - map[i] = i; - } - return map; - }, - - readCharCode: CMap.prototype.readCharCode, - - get length() { - return 0x10000; - }, - - get isIdentityCMap() { - error('should not access .isIdentityCMap'); - } - }; - - return IdentityCMap; -})(); - -var BinaryCMapReader = (function BinaryCMapReaderClosure() { - function fetchBinaryData(url) { - var nonBinaryRequest = PDFJS.disableWorker; - var request = new XMLHttpRequest(); - request.open('GET', url, false); - if (!nonBinaryRequest) { - try { - request.responseType = 'arraybuffer'; - nonBinaryRequest = request.responseType !== 'arraybuffer'; - } catch (e) { - nonBinaryRequest = true; - } - } - if (nonBinaryRequest && request.overrideMimeType) { - request.overrideMimeType('text/plain; charset=x-user-defined'); - } - request.send(null); - if (nonBinaryRequest ? !request.responseText : !request.response) { - error('Unable to get binary cMap at: ' + url); - } - if (nonBinaryRequest) { - var data = Array.prototype.map.call(request.responseText, function (ch) { - return ch.charCodeAt(0) & 255; - }); - return new Uint8Array(data); - } - return new Uint8Array(request.response); - } - - function hexToInt(a, size) { - var n = 0; - for (var i = 0; i <= size; i++) { - n = (n << 8) | a[i]; - } - return n >>> 0; - } - - function hexToStr(a, size) { - // This code is hot. Special-case some common values to avoid creating an - // object with subarray(). - if (size === 1) { - return String.fromCharCode(a[0], a[1]); - } - if (size === 3) { - return String.fromCharCode(a[0], a[1], a[2], a[3]); - } - return String.fromCharCode.apply(null, a.subarray(0, size + 1)); - } - - function addHex(a, b, size) { - var c = 0; - for (var i = size; i >= 0; i--) { - c += a[i] + b[i]; - a[i] = c & 255; - c >>= 8; - } - } - - function incHex(a, size) { - var c = 1; - for (var i = size; i >= 0 && c > 0; i--) { - c += a[i]; - a[i] = c & 255; - c >>= 8; - } - } - - var MAX_NUM_SIZE = 16; - var MAX_ENCODED_NUM_SIZE = 19; // ceil(MAX_NUM_SIZE * 7 / 8) - - function BinaryCMapStream(data) { - this.buffer = data; - this.pos = 0; - this.end = data.length; - this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); - } - - BinaryCMapStream.prototype = { - readByte: function () { - if (this.pos >= this.end) { - return -1; - } - return this.buffer[this.pos++]; - }, - readNumber: function () { - var n = 0; - var last; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - n = (n << 7) | (b & 0x7F); - } while (!last); - return n; - }, - readSigned: function () { - var n = this.readNumber(); - return (n & 1) ? ~(n >>> 1) : n >>> 1; - }, - readHex: function (num, size) { - num.set(this.buffer.subarray(this.pos, - this.pos + size + 1)); - this.pos += size + 1; - }, - readHexNumber: function (num, size) { - var last; - var stack = this.tmpBuf, sp = 0; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - stack[sp++] = b & 0x7F; - } while (!last); - var i = size, buffer = 0, bufferSize = 0; - while (i >= 0) { - while (bufferSize < 8 && stack.length > 0) { - buffer = (stack[--sp] << bufferSize) | buffer; - bufferSize += 7; - } - num[i] = buffer & 255; - i--; - buffer >>= 8; - bufferSize -= 8; - } - }, - readHexSigned: function (num, size) { - this.readHexNumber(num, size); - var sign = num[size] & 1 ? 255 : 0; - var c = 0; - for (var i = 0; i <= size; i++) { - c = ((c & 1) << 8) | num[i]; - num[i] = (c >> 1) ^ sign; - } - }, - readString: function () { - var len = this.readNumber(); - var s = ''; - for (var i = 0; i < len; i++) { - s += String.fromCharCode(this.readNumber()); - } - return s; - } - }; - - function processBinaryCMap(url, cMap, extend) { - var data = fetchBinaryData(url); - var stream = new BinaryCMapStream(data); - - var header = stream.readByte(); - cMap.vertical = !!(header & 1); - - var useCMap = null; - var start = new Uint8Array(MAX_NUM_SIZE); - var end = new Uint8Array(MAX_NUM_SIZE); - var char = new Uint8Array(MAX_NUM_SIZE); - var charCode = new Uint8Array(MAX_NUM_SIZE); - var tmp = new Uint8Array(MAX_NUM_SIZE); - var code; - - var b; - while ((b = stream.readByte()) >= 0) { - var type = b >> 5; - if (type === 7) { // metadata, e.g. comment or usecmap - switch (b & 0x1F) { - case 0: - stream.readString(); // skipping comment - break; - case 1: - useCMap = stream.readString(); - break; - } - continue; - } - var sequence = !!(b & 0x10); - var dataSize = b & 15; - - assert(dataSize + 1 <= MAX_NUM_SIZE); - - var ucs2DataSize = 1; - var subitemsCount = stream.readNumber(); - var i; - switch (type) { - case 0: // codespacerange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - } - break; - case 1: // notdefrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // undefined range, skipping - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // nop - } - break; - case 2: // cidchar - stream.readHex(char, dataSize); - code = stream.readNumber(); - cMap.mapOne(hexToInt(char, dataSize), code); - for (i = 1; i < subitemsCount; i++) { - incHex(char, dataSize); - if (!sequence) { - stream.readHexNumber(tmp, dataSize); - addHex(char, tmp, dataSize); - } - code = stream.readSigned() + (code + 1); - cMap.mapOne(hexToInt(char, dataSize), code); - } - break; - case 3: // cidrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - if (!sequence) { - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - } - break; - case 4: // bfchar - stream.readHex(char, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(char, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(tmp, ucs2DataSize); - addHex(char, tmp, ucs2DataSize); - } - incHex(charCode, dataSize); - stream.readHexSigned(tmp, dataSize); - addHex(charCode, tmp, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - case 5: // bfrange - stream.readHex(start, ucs2DataSize); - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(start, ucs2DataSize); - addHex(start, end, ucs2DataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - default: - error('Unknown type: ' + type); - break; - } - } - - if (useCMap) { - extend(useCMap); - } - return cMap; - } - - function BinaryCMapReader() {} - - BinaryCMapReader.prototype = { - read: processBinaryCMap - }; - - return BinaryCMapReader; -})(); - -var CMapFactory = (function CMapFactoryClosure() { - function strToInt(str) { - var a = 0; - for (var i = 0; i < str.length; i++) { - a = (a << 8) | str.charCodeAt(i); - } - return a >>> 0; - } - - function expectString(obj) { - if (!isString(obj)) { - error('Malformed CMap: expected string.'); - } - } - - function expectInt(obj) { - if (!isInt(obj)) { - error('Malformed CMap: expected int.'); - } - } - - function parseBfChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - // TODO are /dstName used? - expectString(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseBfRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - if (isInt(obj) || isString(obj)) { - var dstLow = isInt(obj) ? String.fromCharCode(obj) : obj; - cMap.mapBfRange(low, high, dstLow); - } else if (isCmd(obj, '[')) { - obj = lexer.getObj(); - var array = []; - while (!isCmd(obj, ']') && !isEOF(obj)) { - array.push(obj); - obj = lexer.getObj(); - } - cMap.mapBfRangeToArray(low, high, array); - } else { - break; - } - } - error('Invalid bf range.'); - } - - function parseCidChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseCidRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dstLow = obj; - cMap.mapCidRange(low, high, dstLow); - } - } - - function parseCodespaceRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcodespacerange')) { - return; - } - if (!isString(obj)) { - break; - } - var low = strToInt(obj); - obj = lexer.getObj(); - if (!isString(obj)) { - break; - } - var high = strToInt(obj); - cMap.addCodespaceRange(obj.length, low, high); - } - error('Invalid codespace range.'); - } - - function parseWMode(cMap, lexer) { - var obj = lexer.getObj(); - if (isInt(obj)) { - cMap.vertical = !!obj; - } - } - - function parseCMapName(cMap, lexer) { - var obj = lexer.getObj(); - if (isName(obj) && isString(obj.name)) { - cMap.name = obj.name; - } - } - - function parseCMap(cMap, lexer, builtInCMapParams, useCMap) { - var previous; - var embededUseCMap; - objLoop: while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } else if (isName(obj)) { - if (obj.name === 'WMode') { - parseWMode(cMap, lexer); - } else if (obj.name === 'CMapName') { - parseCMapName(cMap, lexer); - } - previous = obj; - } else if (isCmd(obj)) { - switch (obj.cmd) { - case 'endcmap': - break objLoop; - case 'usecmap': - if (isName(previous)) { - embededUseCMap = previous.name; - } - break; - case 'begincodespacerange': - parseCodespaceRange(cMap, lexer); - break; - case 'beginbfchar': - parseBfChar(cMap, lexer); - break; - case 'begincidchar': - parseCidChar(cMap, lexer); - break; - case 'beginbfrange': - parseBfRange(cMap, lexer); - break; - case 'begincidrange': - parseCidRange(cMap, lexer); - break; - } - } - } - - if (!useCMap && embededUseCMap) { - // Load the usecmap definition from the file only if there wasn't one - // specified. - useCMap = embededUseCMap; - } - if (useCMap) { - extendCMap(cMap, builtInCMapParams, useCMap); - } - } - - function extendCMap(cMap, builtInCMapParams, useCMap) { - cMap.useCMap = createBuiltInCMap(useCMap, builtInCMapParams); - // If there aren't any code space ranges defined clone all the parent ones - // into this cMap. - if (cMap.numCodespaceRanges === 0) { - var useCodespaceRanges = cMap.useCMap.codespaceRanges; - for (var i = 0; i < useCodespaceRanges.length; i++) { - cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); - } - cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; - } - // Merge the map into the current one, making sure not to override - // any previously defined entries. - cMap.useCMap.forEach(function(key, value) { - if (!cMap.contains(key)) { - cMap.mapOne(key, cMap.useCMap.lookup(key)); - } - }); - } - - function parseBinaryCMap(name, builtInCMapParams) { - var url = builtInCMapParams.url + name + '.bcmap'; - var cMap = new CMap(true); - new BinaryCMapReader().read(url, cMap, function (useCMap) { - extendCMap(cMap, builtInCMapParams, useCMap); - }); - return cMap; - } - - function createBuiltInCMap(name, builtInCMapParams) { - if (name === 'Identity-H') { - return new IdentityCMap(false, 2); - } else if (name === 'Identity-V') { - return new IdentityCMap(true, 2); - } - if (BUILT_IN_CMAPS.indexOf(name) === -1) { - error('Unknown cMap name: ' + name); - } - assert(builtInCMapParams, 'built-in cMap parameters are not provided'); - - if (builtInCMapParams.packed) { - return parseBinaryCMap(name, builtInCMapParams); - } - - var request = new XMLHttpRequest(); - var url = builtInCMapParams.url + name; - request.open('GET', url, false); - request.send(null); - if (!request.responseText) { - error('Unable to get cMap at: ' + url); - } - var cMap = new CMap(true); - var lexer = new Lexer(new StringStream(request.responseText)); - parseCMap(cMap, lexer, builtInCMapParams, null); - return cMap; - } - - return { - create: function (encoding, builtInCMapParams, useCMap) { - if (isName(encoding)) { - return createBuiltInCMap(encoding.name, builtInCMapParams); - } else if (isStream(encoding)) { - var cMap = new CMap(); - var lexer = new Lexer(encoding); - try { - parseCMap(cMap, lexer, builtInCMapParams, useCMap); - } catch (e) { - warn('Invalid CMap data. ' + e); - } - if (cMap.isIdentityCMap) { - return createBuiltInCMap(cMap.name, builtInCMapParams); - } - return cMap; - } - error('Encoding required.'); - } - }; -})(); - -exports.CMap = CMap; -exports.CMapFactory = CMapFactory; -exports.IdentityCMap = IdentityCMap; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreObj = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreCrypto, root.pdfjsCoreParser, - root.pdfjsCoreChunkedStream); - } -}(this, function (exports, sharedUtil, corePrimitives, coreCrypto, coreParser, - coreChunkedStream) { - -var InvalidPDFException = sharedUtil.InvalidPDFException; -var MissingDataException = sharedUtil.MissingDataException; -var XRefParseException = sharedUtil.XRefParseException; -var assert = sharedUtil.assert; -var bytesToString = sharedUtil.bytesToString; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isString = sharedUtil.isString; -var shadow = sharedUtil.shadow; -var stringToPDFString = sharedUtil.stringToPDFString; -var stringToUTF8String = sharedUtil.stringToUTF8String; -var warn = sharedUtil.warn; -var isValidUrl = sharedUtil.isValidUrl; -var Util = sharedUtil.Util; -var Ref = corePrimitives.Ref; -var RefSet = corePrimitives.RefSet; -var RefSetCache = corePrimitives.RefSetCache; -var isName = corePrimitives.isName; -var isCmd = corePrimitives.isCmd; -var isDict = corePrimitives.isDict; -var isRef = corePrimitives.isRef; -var isStream = corePrimitives.isStream; -var CipherTransformFactory = coreCrypto.CipherTransformFactory; -var Lexer = coreParser.Lexer; -var Parser = coreParser.Parser; -var ChunkedStream = coreChunkedStream.ChunkedStream; - -var Catalog = (function CatalogClosure() { - function Catalog(pdfManager, xref, pageFactory) { - this.pdfManager = pdfManager; - this.xref = xref; - this.catDict = xref.getCatalogObj(); - this.fontCache = new RefSetCache(); - assert(isDict(this.catDict), - 'catalog object is not a dictionary'); - - // TODO refactor to move getPage() to the PDFDocument. - this.pageFactory = pageFactory; - this.pagePromises = []; - } - - Catalog.prototype = { - get metadata() { - var streamRef = this.catDict.getRaw('Metadata'); - if (!isRef(streamRef)) { - return shadow(this, 'metadata', null); - } - - var encryptMetadata = (!this.xref.encrypt ? false : - this.xref.encrypt.encryptMetadata); - - var stream = this.xref.fetch(streamRef, !encryptMetadata); - var metadata; - if (stream && isDict(stream.dict)) { - var type = stream.dict.get('Type'); - var subtype = stream.dict.get('Subtype'); - - if (isName(type) && isName(subtype) && - type.name === 'Metadata' && subtype.name === 'XML') { - // XXX: This should examine the charset the XML document defines, - // however since there are currently no real means to decode - // arbitrary charsets, let's just hope that the author of the PDF - // was reasonable enough to stick with the XML default charset, - // which is UTF-8. - try { - metadata = stringToUTF8String(bytesToString(stream.getBytes())); - } catch (e) { - info('Skipping invalid metadata.'); - } - } - } - - return shadow(this, 'metadata', metadata); - }, - get toplevelPagesDict() { - var pagesObj = this.catDict.get('Pages'); - assert(isDict(pagesObj), 'invalid top-level pages dictionary'); - // shadow the prototype getter - return shadow(this, 'toplevelPagesDict', pagesObj); - }, - get documentOutline() { - var obj = null; - try { - obj = this.readDocumentOutline(); - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Unable to read document outline'); - } - return shadow(this, 'documentOutline', obj); - }, - readDocumentOutline: function Catalog_readDocumentOutline() { - var xref = this.xref; - var obj = this.catDict.get('Outlines'); - var root = { items: [] }; - if (isDict(obj)) { - obj = obj.getRaw('First'); - var processed = new RefSet(); - if (isRef(obj)) { - var queue = [{obj: obj, parent: root}]; - // to avoid recursion keeping track of the items - // in the processed dictionary - processed.put(obj); - while (queue.length > 0) { - var i = queue.shift(); - var outlineDict = xref.fetchIfRef(i.obj); - if (outlineDict === null) { - continue; - } - if (!outlineDict.has('Title')) { - error('Invalid outline item'); - } - var actionDict = outlineDict.get('A'), dest = null, url = null; - if (actionDict) { - var destEntry = actionDict.get('D'); - if (destEntry) { - dest = destEntry; - } else { - var uriEntry = actionDict.get('URI'); - if (isString(uriEntry) && isValidUrl(uriEntry, false)) { - url = uriEntry; - } - } - } else if (outlineDict.has('Dest')) { - dest = outlineDict.getRaw('Dest'); - if (isName(dest)) { - dest = dest.name; - } - } - var title = outlineDict.get('Title'); - var outlineItem = { - dest: dest, - url: url, - title: stringToPDFString(title), - color: outlineDict.get('C') || [0, 0, 0], - count: outlineDict.get('Count'), - bold: !!(outlineDict.get('F') & 2), - italic: !!(outlineDict.get('F') & 1), - items: [] - }; - i.parent.items.push(outlineItem); - obj = outlineDict.getRaw('First'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: outlineItem}); - processed.put(obj); - } - obj = outlineDict.getRaw('Next'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: i.parent}); - processed.put(obj); - } - } - } - } - return (root.items.length > 0 ? root.items : null); - }, - get numPages() { - var obj = this.toplevelPagesDict.get('Count'); - assert( - isInt(obj), - 'page count in top level pages object is not an integer' - ); - // shadow the prototype getter - return shadow(this, 'num', obj); - }, - get destinations() { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dests = {}, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { - // reading simple destination dictionary - obj = nameDictionaryRef; - obj.forEach(function catalogForEach(key, value) { - if (!value) { - return; - } - dests[key] = fetchDestination(value); - }); - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - dests[name] = fetchDestination(names[name]); - } - } - return shadow(this, 'destinations', dests); - }, - getDestination: function Catalog_getDestination(destinationId) { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dest = null, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { // Simple destination dictionary. - var value = nameDictionaryRef.get(destinationId); - if (value) { - dest = fetchDestination(value); - } - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - dest = fetchDestination(nameTree.get(destinationId)); - } - return dest; - }, - - get pageLabels() { - var obj = null; - try { - obj = this.readPageLabels(); - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Unable to read page labels.'); - } - return shadow(this, 'pageLabels', obj); - }, - readPageLabels: function Catalog_readPageLabels() { - var obj = this.catDict.getRaw('PageLabels'); - if (!obj) { - return null; - } - var pageLabels = new Array(this.numPages); - var style = null; - var prefix = ''; - var start = 1; - - var numberTree = new NumberTree(obj, this.xref); - var nums = numberTree.getAll(); - var currentLabel = '', currentIndex = 1; - - for (var i = 0, ii = this.numPages; i < ii; i++) { - if (nums.hasOwnProperty(i)) { - var labelDict = nums[i]; - assert(isDict(labelDict), 'The PageLabel is not a dictionary.'); - - var type = labelDict.get('Type'); - assert(!type || (isName(type) && type.name === 'PageLabel'), - 'Invalid type in PageLabel dictionary.'); - - var s = labelDict.get('S'); - assert(!s || isName(s), 'Invalid style in PageLabel dictionary.'); - style = (s ? s.name : null); - - prefix = labelDict.get('P') || ''; - assert(isString(prefix), 'Invalid prefix in PageLabel dictionary.'); - - start = labelDict.get('St') || 1; - assert(isInt(start), 'Invalid start in PageLabel dictionary.'); - currentIndex = start; - } - - switch (style) { - case 'D': - currentLabel = currentIndex; - break; - case 'R': - case 'r': - currentLabel = Util.toRoman(currentIndex, style === 'r'); - break; - case 'A': - case 'a': - var LIMIT = 26; // Use only the characters A--Z, or a--z. - var A_UPPER_CASE = 0x41, A_LOWER_CASE = 0x61; - - var baseCharCode = (style === 'a' ? A_LOWER_CASE : A_UPPER_CASE); - var letterIndex = currentIndex - 1; - var character = String.fromCharCode(baseCharCode + - (letterIndex % LIMIT)); - var charBuf = []; - for (var j = 0, jj = (letterIndex / LIMIT) | 0; j <= jj; j++) { - charBuf.push(character); - } - currentLabel = charBuf.join(''); - break; - default: - assert(!style, - 'Invalid style "' + style + '" in PageLabel dictionary.'); - } - pageLabels[i] = prefix + currentLabel; - - currentLabel = ''; - currentIndex++; - } - return pageLabels; - }, - - get attachments() { - var xref = this.xref; - var attachments = null, nameTreeRef; - var obj = this.catDict.get('Names'); - if (obj) { - nameTreeRef = obj.getRaw('EmbeddedFiles'); - } - - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - var fs = new FileSpec(names[name], xref); - if (!attachments) { - attachments = {}; - } - attachments[stringToPDFString(name)] = fs.serializable; - } - } - return shadow(this, 'attachments', attachments); - }, - get javaScript() { - var xref = this.xref; - var obj = this.catDict.get('Names'); - - var javaScript = []; - function appendIfJavaScriptDict(jsDict) { - var type = jsDict.get('S'); - if (!isName(type) || type.name !== 'JavaScript') { - return; - } - var js = jsDict.get('JS'); - if (isStream(js)) { - js = bytesToString(js.getBytes()); - } else if (!isString(js)) { - return; - } - javaScript.push(stringToPDFString(js)); - } - if (obj && obj.has('JavaScript')) { - var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - // We don't really use the JavaScript right now. This code is - // defensive so we don't cause errors on document load. - var jsDict = names[name]; - if (isDict(jsDict)) { - appendIfJavaScriptDict(jsDict); - } - } - } - - // Append OpenAction actions to javaScript array - var openactionDict = this.catDict.get('OpenAction'); - if (isDict(openactionDict, 'Action')) { - var actionType = openactionDict.get('S'); - if (isName(actionType) && actionType.name === 'Named') { - // The named Print action is not a part of the PDF 1.7 specification, - // but is supported by many PDF readers/writers (including Adobe's). - var action = openactionDict.get('N'); - if (isName(action) && action.name === 'Print') { - javaScript.push('print({});'); - } - } else { - appendIfJavaScriptDict(openactionDict); - } - } - - return shadow(this, 'javaScript', javaScript); - }, - - cleanup: function Catalog_cleanup() { - var promises = []; - this.fontCache.forEach(function (promise) { - promises.push(promise); - }); - return Promise.all(promises).then(function (translatedFonts) { - for (var i = 0, ii = translatedFonts.length; i < ii; i++) { - var font = translatedFonts[i].dict; - delete font.translated; - } - this.fontCache.clear(); - }.bind(this)); - }, - - getPage: function Catalog_getPage(pageIndex) { - if (!(pageIndex in this.pagePromises)) { - this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then( - function (a) { - var dict = a[0]; - var ref = a[1]; - return this.pageFactory.createPage(pageIndex, dict, ref, - this.fontCache); - }.bind(this) - ); - } - return this.pagePromises[pageIndex]; - }, - - getPageDict: function Catalog_getPageDict(pageIndex) { - var capability = createPromiseCapability(); - var nodesToVisit = [this.catDict.getRaw('Pages')]; - var currentPageIndex = 0; - var xref = this.xref; - var checkAllKids = false; - - function next() { - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - if (isRef(currentNode)) { - xref.fetchAsync(currentNode).then(function (obj) { - if (isDict(obj, 'Page') || (isDict(obj) && !obj.has('Kids'))) { - if (pageIndex === currentPageIndex) { - capability.resolve([obj, currentNode]); - } else { - currentPageIndex++; - next(); - } - return; - } - nodesToVisit.push(obj); - next(); - }, capability.reject); - return; - } - - // Must be a child page dictionary. - assert( - isDict(currentNode), - 'page dictionary kid reference points to wrong type of object' - ); - var count = currentNode.get('Count'); - // If the current node doesn't have any children, avoid getting stuck - // in an empty node further down in the tree (see issue5644.pdf). - if (count === 0) { - checkAllKids = true; - } - // Skip nodes where the page can't be. - if (currentPageIndex + count <= pageIndex) { - currentPageIndex += count; - continue; - } - - var kids = currentNode.get('Kids'); - assert(isArray(kids), 'page dictionary kids object is not an array'); - if (!checkAllKids && count === kids.length) { - // Nodes that don't have the page have been skipped and this is the - // bottom of the tree which means the page requested must be a - // descendant of this pages node. Ideally we would just resolve the - // promise with the page ref here, but there is the case where more - // pages nodes could link to single a page (see issue 3666 pdf). To - // handle this push it back on the queue so if it is a pages node it - // will be descended into. - nodesToVisit = [kids[pageIndex - currentPageIndex]]; - currentPageIndex = pageIndex; - continue; - } else { - for (var last = kids.length - 1; last >= 0; last--) { - nodesToVisit.push(kids[last]); - } - } - } - capability.reject('Page index ' + pageIndex + ' not found.'); - } - next(); - return capability.promise; - }, - - getPageIndex: function Catalog_getPageIndex(ref) { - // The page tree nodes have the count of all the leaves below them. To get - // how many pages are before we just have to walk up the tree and keep - // adding the count of siblings to the left of the node. - var xref = this.xref; - function pagesBeforeRef(kidRef) { - var total = 0; - var parentRef; - return xref.fetchAsync(kidRef).then(function (node) { - if (!node) { - return null; - } - parentRef = node.getRaw('Parent'); - return node.getAsync('Parent'); - }).then(function (parent) { - if (!parent) { - return null; - } - return parent.getAsync('Kids'); - }).then(function (kids) { - if (!kids) { - return null; - } - var kidPromises = []; - var found = false; - for (var i = 0; i < kids.length; i++) { - var kid = kids[i]; - assert(isRef(kid), 'kids must be a ref'); - if (kid.num === kidRef.num) { - found = true; - break; - } - kidPromises.push(xref.fetchAsync(kid).then(function (kid) { - if (kid.has('Count')) { - var count = kid.get('Count'); - total += count; - } else { // page leaf node - total++; - } - })); - } - if (!found) { - error('kid ref not found in parents kids'); - } - return Promise.all(kidPromises).then(function () { - return [total, parentRef]; - }); - }); - } - - var total = 0; - function next(ref) { - return pagesBeforeRef(ref).then(function (args) { - if (!args) { - return total; - } - var count = args[0]; - var parentRef = args[1]; - total += count; - return next(parentRef); - }); - } - - return next(ref); - } - }; - - return Catalog; -})(); - -var XRef = (function XRefClosure() { - function XRef(stream, password) { - this.stream = stream; - this.entries = []; - this.xrefstms = {}; - // prepare the XRef cache - this.cache = []; - this.password = password; - this.stats = { - streamTypes: [], - fontTypes: [] - }; - } - - XRef.prototype = { - setStartXRef: function XRef_setStartXRef(startXRef) { - // Store the starting positions of xref tables as we process them - // so we can recover from missing data errors - this.startXRefQueue = [startXRef]; - }, - - parse: function XRef_parse(recoveryMode) { - var trailerDict; - if (!recoveryMode) { - trailerDict = this.readXRef(); - } else { - warn('Indexing all PDF objects'); - trailerDict = this.indexObjects(); - } - trailerDict.assignXref(this); - this.trailer = trailerDict; - var encrypt = trailerDict.get('Encrypt'); - if (encrypt) { - var ids = trailerDict.get('ID'); - var fileId = (ids && ids.length) ? ids[0] : ''; - this.encrypt = new CipherTransformFactory(encrypt, fileId, - this.password); - } - - // get the root dictionary (catalog) object - if (!(this.root = trailerDict.get('Root'))) { - error('Invalid root reference'); - } - }, - - processXRefTable: function XRef_processXRefTable(parser) { - if (!('tableState' in this)) { - // Stores state of the table as we process it so we can resume - // from middle of table in case of missing data error - this.tableState = { - entryNum: 0, - streamPos: parser.lexer.stream.pos, - parserBuf1: parser.buf1, - parserBuf2: parser.buf2 - }; - } - - var obj = this.readXRefTable(parser); - - // Sanity check - if (!isCmd(obj, 'trailer')) { - error('Invalid XRef table: could not find trailer dictionary'); - } - // Read trailer dictionary, e.g. - // trailer - // << /Size 22 - // /Root 20R - // /Info 10R - // /ID [ <81b14aafa313db63dbd6f981e49f94f4> ] - // >> - // The parser goes through the entire stream << ... >> and provides - // a getter interface for the key-value table - var dict = parser.getObj(); - - // The pdflib PDF generator can generate a nested trailer dictionary - if (!isDict(dict) && dict.dict) { - dict = dict.dict; - } - if (!isDict(dict)) { - error('Invalid XRef table: could not parse trailer dictionary'); - } - delete this.tableState; - - return dict; - }, - - readXRefTable: function XRef_readXRefTable(parser) { - // Example of cross-reference table: - // xref - // 0 1 <-- subsection header (first obj #, obj count) - // 0000000000 65535 f <-- actual object (offset, generation #, f/n) - // 23 2 <-- subsection header ... and so on ... - // 0000025518 00002 n - // 0000025635 00000 n - // trailer - // ... - - var stream = parser.lexer.stream; - var tableState = this.tableState; - stream.pos = tableState.streamPos; - parser.buf1 = tableState.parserBuf1; - parser.buf2 = tableState.parserBuf2; - - // Outer loop is over subsection headers - var obj; - - while (true) { - if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { - if (isCmd(obj = parser.getObj(), 'trailer')) { - break; - } - tableState.firstEntryNum = obj; - tableState.entryCount = parser.getObj(); - } - - var first = tableState.firstEntryNum; - var count = tableState.entryCount; - if (!isInt(first) || !isInt(count)) { - error('Invalid XRef table: wrong types in subsection header'); - } - // Inner loop is over objects themselves - for (var i = tableState.entryNum; i < count; i++) { - tableState.streamPos = stream.pos; - tableState.entryNum = i; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - - var entry = {}; - entry.offset = parser.getObj(); - entry.gen = parser.getObj(); - var type = parser.getObj(); - - if (isCmd(type, 'f')) { - entry.free = true; - } else if (isCmd(type, 'n')) { - entry.uncompressed = true; - } - - // Validate entry obj - if (!isInt(entry.offset) || !isInt(entry.gen) || - !(entry.free || entry.uncompressed)) { - error('Invalid entry in XRef subsection: ' + first + ', ' + count); - } - - if (!this.entries[i + first]) { - this.entries[i + first] = entry; - } - } - - tableState.entryNum = 0; - tableState.streamPos = stream.pos; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - delete tableState.firstEntryNum; - delete tableState.entryCount; - } - - // Per issue 3248: hp scanners generate bad XRef - if (first === 1 && this.entries[1] && this.entries[1].free) { - // shifting the entries - this.entries.shift(); - } - - // Sanity check: as per spec, first object must be free - if (this.entries[0] && !this.entries[0].free) { - error('Invalid XRef table: unexpected first object'); - } - return obj; - }, - - processXRefStream: function XRef_processXRefStream(stream) { - if (!('streamState' in this)) { - // Stores state of the stream as we process it so we can resume - // from middle of stream in case of missing data error - var streamParameters = stream.dict; - var byteWidths = streamParameters.get('W'); - var range = streamParameters.get('Index'); - if (!range) { - range = [0, streamParameters.get('Size')]; - } - - this.streamState = { - entryRanges: range, - byteWidths: byteWidths, - entryNum: 0, - streamPos: stream.pos - }; - } - this.readXRefStream(stream); - delete this.streamState; - - return stream.dict; - }, - - readXRefStream: function XRef_readXRefStream(stream) { - var i, j; - var streamState = this.streamState; - stream.pos = streamState.streamPos; - - var byteWidths = streamState.byteWidths; - var typeFieldWidth = byteWidths[0]; - var offsetFieldWidth = byteWidths[1]; - var generationFieldWidth = byteWidths[2]; - - var entryRanges = streamState.entryRanges; - while (entryRanges.length > 0) { - var first = entryRanges[0]; - var n = entryRanges[1]; - - if (!isInt(first) || !isInt(n)) { - error('Invalid XRef range fields: ' + first + ', ' + n); - } - if (!isInt(typeFieldWidth) || !isInt(offsetFieldWidth) || - !isInt(generationFieldWidth)) { - error('Invalid XRef entry fields length: ' + first + ', ' + n); - } - for (i = streamState.entryNum; i < n; ++i) { - streamState.entryNum = i; - streamState.streamPos = stream.pos; - - var type = 0, offset = 0, generation = 0; - for (j = 0; j < typeFieldWidth; ++j) { - type = (type << 8) | stream.getByte(); - } - // if type field is absent, its default value is 1 - if (typeFieldWidth === 0) { - type = 1; - } - for (j = 0; j < offsetFieldWidth; ++j) { - offset = (offset << 8) | stream.getByte(); - } - for (j = 0; j < generationFieldWidth; ++j) { - generation = (generation << 8) | stream.getByte(); - } - var entry = {}; - entry.offset = offset; - entry.gen = generation; - switch (type) { - case 0: - entry.free = true; - break; - case 1: - entry.uncompressed = true; - break; - case 2: - break; - default: - error('Invalid XRef entry type: ' + type); - } - if (!this.entries[first + i]) { - this.entries[first + i] = entry; - } - } - - streamState.entryNum = 0; - streamState.streamPos = stream.pos; - entryRanges.splice(0, 2); - } - }, - - indexObjects: function XRef_indexObjects() { - // Simple scan through the PDF content to find objects, - // trailers and XRef streams. - var TAB = 0x9, LF = 0xA, CR = 0xD, SPACE = 0x20; - var PERCENT = 0x25, LT = 0x3C; - - function readToken(data, offset) { - var token = '', ch = data[offset]; - while (ch !== LF && ch !== CR && ch !== LT) { - if (++offset >= data.length) { - break; - } - token += String.fromCharCode(ch); - ch = data[offset]; - } - return token; - } - function skipUntil(data, offset, what) { - var length = what.length, dataLength = data.length; - var skipped = 0; - // finding byte sequence - while (offset < dataLength) { - var i = 0; - while (i < length && data[offset + i] === what[i]) { - ++i; - } - if (i >= length) { - break; // sequence found - } - offset++; - skipped++; - } - return skipped; - } - var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; - var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); - var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, - 101, 102]); - var endobjBytes = new Uint8Array([101, 110, 100, 111, 98, 106]); - var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); - - // Clear out any existing entries, since they may be bogus. - this.entries.length = 0; - - var stream = this.stream; - stream.pos = 0; - var buffer = stream.getBytes(); - var position = stream.start, length = buffer.length; - var trailers = [], xrefStms = []; - while (position < length) { - var ch = buffer[position]; - if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { - ++position; - continue; - } - if (ch === PERCENT) { // %-comment - do { - ++position; - if (position >= length) { - break; - } - ch = buffer[position]; - } while (ch !== LF && ch !== CR); - continue; - } - var token = readToken(buffer, position); - var m; - if (token.indexOf('xref') === 0 && - (token.length === 4 || /\s/.test(token[4]))) { - position += skipUntil(buffer, position, trailerBytes); - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else if ((m = objRegExp.exec(token))) { - if (typeof this.entries[m[1]] === 'undefined') { - this.entries[m[1]] = { - offset: position - stream.start, - gen: m[2] | 0, - uncompressed: true - }; - } - var contentLength = skipUntil(buffer, position, endobjBytes) + 7; - var content = buffer.subarray(position, position + contentLength); - - // checking XRef stream suspect - // (it shall have '/XRef' and next char is not a letter) - var xrefTagOffset = skipUntil(content, 0, xrefBytes); - if (xrefTagOffset < contentLength && - content[xrefTagOffset + 5] < 64) { - xrefStms.push(position - stream.start); - this.xrefstms[position - stream.start] = 1; // Avoid recursion - } - - position += contentLength; - } else if (token.indexOf('trailer') === 0 && - (token.length === 7 || /\s/.test(token[7]))) { - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else { - position += token.length + 1; - } - } - // reading XRef streams - var i, ii; - for (i = 0, ii = xrefStms.length; i < ii; ++i) { - this.startXRefQueue.push(xrefStms[i]); - this.readXRef(/* recoveryMode */ true); - } - // finding main trailer - var dict; - for (i = 0, ii = trailers.length; i < ii; ++i) { - stream.pos = trailers[i]; - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - if (!isCmd(obj, 'trailer')) { - continue; - } - // read the trailer dictionary - if (!isDict(dict = parser.getObj())) { - continue; - } - // taking the first one with 'ID' - if (dict.has('ID')) { - return dict; - } - } - // no tailer with 'ID', taking last one (if exists) - if (dict) { - return dict; - } - // nothing helps - // calling error() would reject worker with an UnknownErrorException. - throw new InvalidPDFException('Invalid PDF structure'); - }, - - readXRef: function XRef_readXRef(recoveryMode) { - var stream = this.stream; - - try { - while (this.startXRefQueue.length) { - var startXRef = this.startXRefQueue[0]; - - stream.pos = startXRef + stream.start; - - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - var dict; - - // Get dictionary - if (isCmd(obj, 'xref')) { - // Parse end-of-file XRef - dict = this.processXRefTable(parser); - if (!this.topDict) { - this.topDict = dict; - } - - // Recursively get other XRefs 'XRefStm', if any - obj = dict.get('XRefStm'); - if (isInt(obj)) { - var pos = obj; - // ignore previously loaded xref streams - // (possible infinite recursion) - if (!(pos in this.xrefstms)) { - this.xrefstms[pos] = 1; - this.startXRefQueue.push(pos); - } - } - } else if (isInt(obj)) { - // Parse in-stream XRef - if (!isInt(parser.getObj()) || - !isCmd(parser.getObj(), 'obj') || - !isStream(obj = parser.getObj())) { - error('Invalid XRef stream'); - } - dict = this.processXRefStream(obj); - if (!this.topDict) { - this.topDict = dict; - } - if (!dict) { - error('Failed to read XRef stream'); - } - } else { - error('Invalid XRef stream header'); - } - - // Recursively get previous dictionary, if any - obj = dict.get('Prev'); - if (isInt(obj)) { - this.startXRefQueue.push(obj); - } else if (isRef(obj)) { - // The spec says Prev must not be a reference, i.e. "/Prev NNN" - // This is a fallback for non-compliant PDFs, i.e. "/Prev NNN 0 R" - this.startXRefQueue.push(obj.num); - } - - this.startXRefQueue.shift(); - } - - return this.topDict; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - info('(while reading XRef): ' + e); - } - - if (recoveryMode) { - return; - } - throw new XRefParseException(); - }, - - getEntry: function XRef_getEntry(i) { - var xrefEntry = this.entries[i]; - if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { - return xrefEntry; - } - return null; - }, - - fetchIfRef: function XRef_fetchIfRef(obj) { - if (!isRef(obj)) { - return obj; - } - return this.fetch(obj); - }, - - fetch: function XRef_fetch(ref, suppressEncryption) { - assert(isRef(ref), 'ref object is not a reference'); - var num = ref.num; - if (num in this.cache) { - var cacheEntry = this.cache[num]; - return cacheEntry; - } - - var xrefEntry = this.getEntry(num); - - // the referenced entry can be free - if (xrefEntry === null) { - return (this.cache[num] = null); - } - - if (xrefEntry.uncompressed) { - xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); - } else { - xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); - } - if (isDict(xrefEntry)){ - xrefEntry.objId = ref.toString(); - } else if (isStream(xrefEntry)) { - xrefEntry.dict.objId = ref.toString(); - } - return xrefEntry; - }, - - fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, - suppressEncryption) { - var gen = ref.gen; - var num = ref.num; - if (xrefEntry.gen !== gen) { - error('inconsistent generation in XRef'); - } - var stream = this.stream.makeSubStream(xrefEntry.offset + - this.stream.start); - var parser = new Parser(new Lexer(stream), true, this); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - if (!isInt(obj1) || parseInt(obj1, 10) !== num || - !isInt(obj2) || parseInt(obj2, 10) !== gen || - !isCmd(obj3)) { - error('bad XRef entry'); - } - if (!isCmd(obj3, 'obj')) { - // some bad PDFs use "obj1234" and really mean 1234 - if (obj3.cmd.indexOf('obj') === 0) { - num = parseInt(obj3.cmd.substring(3), 10); - if (!isNaN(num)) { - return num; - } - } - error('bad XRef entry'); - } - if (this.encrypt && !suppressEncryption) { - xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); - } else { - xrefEntry = parser.getObj(); - } - if (!isStream(xrefEntry)) { - this.cache[num] = xrefEntry; - } - return xrefEntry; - }, - - fetchCompressed: function XRef_fetchCompressed(xrefEntry, - suppressEncryption) { - var tableOffset = xrefEntry.offset; - var stream = this.fetch(new Ref(tableOffset, 0)); - if (!isStream(stream)) { - error('bad ObjStm stream'); - } - var first = stream.dict.get('First'); - var n = stream.dict.get('N'); - if (!isInt(first) || !isInt(n)) { - error('invalid first and n parameters for ObjStm stream'); - } - var parser = new Parser(new Lexer(stream), false, this); - parser.allowStreams = true; - var i, entries = [], num, nums = []; - // read the object numbers to populate cache - for (i = 0; i < n; ++i) { - num = parser.getObj(); - if (!isInt(num)) { - error('invalid object number in the ObjStm stream: ' + num); - } - nums.push(num); - var offset = parser.getObj(); - if (!isInt(offset)) { - error('invalid object offset in the ObjStm stream: ' + offset); - } - } - // read stream objects for cache - for (i = 0; i < n; ++i) { - entries.push(parser.getObj()); - num = nums[i]; - var entry = this.entries[num]; - if (entry && entry.offset === tableOffset && entry.gen === i) { - this.cache[num] = entries[i]; - } - } - xrefEntry = entries[xrefEntry.gen]; - if (xrefEntry === undefined) { - error('bad XRef entry for compressed object'); - } - return xrefEntry; - }, - - fetchIfRefAsync: function XRef_fetchIfRefAsync(obj) { - if (!isRef(obj)) { - return Promise.resolve(obj); - } - return this.fetchAsync(obj); - }, - - fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { - var streamManager = this.stream.manager; - var xref = this; - return new Promise(function tryFetch(resolve, reject) { - try { - resolve(xref.fetch(ref, suppressEncryption)); - } catch (e) { - if (e instanceof MissingDataException) { - streamManager.requestRange(e.begin, e.end).then(function () { - tryFetch(resolve, reject); - }, reject); - return; - } - reject(e); - } - }); - }, - - getCatalogObj: function XRef_getCatalogObj() { - return this.root; - } - }; - - return XRef; -})(); - -/** - * A NameTree/NumberTree is like a Dict but has some advantageous properties, - * see the specification (7.9.6 and 7.9.7) for additional details. - * TODO: implement all the Dict functions and make this more efficient. - */ -var NameOrNumberTree = (function NameOrNumberTreeClosure() { - function NameOrNumberTree(root, xref) { - throw new Error('Cannot initialize NameOrNumberTree.'); - } - - NameOrNumberTree.prototype = { - getAll: function NameOrNumberTree_getAll() { - var dict = {}; - if (!this.root) { - return dict; - } - var xref = this.xref; - // Reading Name/Number tree. - var processed = new RefSet(); - processed.put(this.root); - var queue = [this.root]; - while (queue.length > 0) { - var i, n; - var obj = xref.fetchIfRef(queue.shift()); - if (!isDict(obj)) { - continue; - } - if (obj.has('Kids')) { - var kids = obj.get('Kids'); - for (i = 0, n = kids.length; i < n; i++) { - var kid = kids[i]; - assert(!processed.has(kid), - 'Duplicate entry in "' + this._type + '" tree.'); - queue.push(kid); - processed.put(kid); - } - continue; - } - var entries = obj.get(this._type); - if (isArray(entries)) { - for (i = 0, n = entries.length; i < n; i += 2) { - dict[xref.fetchIfRef(entries[i])] = xref.fetchIfRef(entries[i + 1]); - } - } - } - return dict; - }, - - get: function NameOrNumberTree_get(key) { - if (!this.root) { - return null; - } - - var xref = this.xref; - var kidsOrEntries = xref.fetchIfRef(this.root); - var loopCount = 0; - var MAX_LEVELS = 10; - var l, r, m; - - // Perform a binary search to quickly find the entry that - // contains the key we are looking for. - while (kidsOrEntries.has('Kids')) { - if (++loopCount > MAX_LEVELS) { - warn('Search depth limit reached for "' + this._type + '" tree.'); - return null; - } - - var kids = kidsOrEntries.get('Kids'); - if (!isArray(kids)) { - return null; - } - - l = 0; - r = kids.length - 1; - while (l <= r) { - m = (l + r) >> 1; - var kid = xref.fetchIfRef(kids[m]); - var limits = kid.get('Limits'); - - if (key < xref.fetchIfRef(limits[0])) { - r = m - 1; - } else if (key > xref.fetchIfRef(limits[1])) { - l = m + 1; - } else { - kidsOrEntries = xref.fetchIfRef(kids[m]); - break; - } - } - if (l > r) { - return null; - } - } - - // If we get here, then we have found the right entry. Now go through the - // entries in the dictionary until we find the key we're looking for. - var entries = kidsOrEntries.get(this._type); - if (isArray(entries)) { - // Perform a binary search to reduce the lookup time. - l = 0; - r = entries.length - 2; - while (l <= r) { - // Check only even indices (0, 2, 4, ...) because the - // odd indices contain the actual data. - m = (l + r) & ~1; - var currentKey = xref.fetchIfRef(entries[m]); - if (key < currentKey) { - r = m - 2; - } else if (key > currentKey) { - l = m + 2; - } else { - return xref.fetchIfRef(entries[m + 1]); - } - } - } - return null; - } - }; - return NameOrNumberTree; -})(); - -var NameTree = (function NameTreeClosure() { - function NameTree(root, xref) { - this.root = root; - this.xref = xref; - this._type = 'Names'; - } - - Util.inherit(NameTree, NameOrNumberTree, {}); - - return NameTree; -})(); - -var NumberTree = (function NumberTreeClosure() { - function NumberTree(root, xref) { - this.root = root; - this.xref = xref; - this._type = 'Nums'; - } - - Util.inherit(NumberTree, NameOrNumberTree, {}); - - return NumberTree; -})(); - -/** - * "A PDF file can refer to the contents of another file by using a File - * Specification (PDF 1.1)", see the spec (7.11) for more details. - * NOTE: Only embedded files are supported (as part of the attachments support) - * TODO: support the 'URL' file system (with caching if !/V), portable - * collections attributes and related files (/RF) - */ -var FileSpec = (function FileSpecClosure() { - function FileSpec(root, xref) { - if (!root || !isDict(root)) { - return; - } - this.xref = xref; - this.root = root; - if (root.has('FS')) { - this.fs = root.get('FS'); - } - this.description = root.has('Desc') ? - stringToPDFString(root.get('Desc')) : - ''; - if (root.has('RF')) { - warn('Related file specifications are not supported'); - } - this.contentAvailable = true; - if (!root.has('EF')) { - this.contentAvailable = false; - warn('Non-embedded file specifications are not supported'); - } - } - - function pickPlatformItem(dict) { - // Look for the filename in this order: - // UF, F, Unix, Mac, DOS - if (dict.has('UF')) { - return dict.get('UF'); - } else if (dict.has('F')) { - return dict.get('F'); - } else if (dict.has('Unix')) { - return dict.get('Unix'); - } else if (dict.has('Mac')) { - return dict.get('Mac'); - } else if (dict.has('DOS')) { - return dict.get('DOS'); - } else { - return null; - } - } - - FileSpec.prototype = { - get filename() { - if (!this._filename && this.root) { - var filename = pickPlatformItem(this.root) || 'unnamed'; - this._filename = stringToPDFString(filename). - replace(/\\\\/g, '\\'). - replace(/\\\//g, '/'). - replace(/\\/g, '/'); - } - return this._filename; - }, - get content() { - if (!this.contentAvailable) { - return null; - } - if (!this.contentRef && this.root) { - this.contentRef = pickPlatformItem(this.root.get('EF')); - } - var content = null; - if (this.contentRef) { - var xref = this.xref; - var fileObj = xref.fetchIfRef(this.contentRef); - if (fileObj && isStream(fileObj)) { - content = fileObj.getBytes(); - } else { - warn('Embedded file specification points to non-existing/invalid ' + - 'content'); - } - } else { - warn('Embedded file specification does not have a content'); - } - return content; - }, - get serializable() { - return { - filename: this.filename, - content: this.content - }; - } - }; - return FileSpec; -})(); - -/** - * A helper for loading missing data in object graphs. It traverses the graph - * depth first and queues up any objects that have missing data. Once it has - * has traversed as many objects that are available it attempts to bundle the - * missing data requests and then resume from the nodes that weren't ready. - * - * NOTE: It provides protection from circular references by keeping track of - * of loaded references. However, you must be careful not to load any graphs - * that have references to the catalog or other pages since that will cause the - * entire PDF document object graph to be traversed. - */ -var ObjectLoader = (function() { - function mayHaveChildren(value) { - return isRef(value) || isDict(value) || isArray(value) || isStream(value); - } - - function addChildren(node, nodesToVisit) { - var value; - if (isDict(node) || isStream(node)) { - var map; - if (isDict(node)) { - map = node.map; - } else { - map = node.dict.map; - } - for (var key in map) { - value = map[key]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } else if (isArray(node)) { - for (var i = 0, ii = node.length; i < ii; i++) { - value = node[i]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } - } - - function ObjectLoader(obj, keys, xref) { - this.obj = obj; - this.keys = keys; - this.xref = xref; - this.refSet = null; - this.capability = null; - } - - ObjectLoader.prototype = { - load: function ObjectLoader_load() { - var keys = this.keys; - this.capability = createPromiseCapability(); - // Don't walk the graph if all the data is already loaded. - if (!(this.xref.stream instanceof ChunkedStream) || - this.xref.stream.getMissingChunks().length === 0) { - this.capability.resolve(); - return this.capability.promise; - } - - this.refSet = new RefSet(); - // Setup the initial nodes to visit. - var nodesToVisit = []; - for (var i = 0; i < keys.length; i++) { - nodesToVisit.push(this.obj[keys[i]]); - } - - this._walk(nodesToVisit); - return this.capability.promise; - }, - - _walk: function ObjectLoader_walk(nodesToVisit) { - var nodesToRevisit = []; - var pendingRequests = []; - // DFS walk of the object graph. - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - // Only references or chunked streams can cause missing data exceptions. - if (isRef(currentNode)) { - // Skip nodes that have already been visited. - if (this.refSet.has(currentNode)) { - continue; - } - try { - var ref = currentNode; - this.refSet.put(ref); - currentNode = this.xref.fetch(currentNode); - } catch (e) { - if (!(e instanceof MissingDataException)) { - throw e; - } - nodesToRevisit.push(currentNode); - pendingRequests.push({ begin: e.begin, end: e.end }); - } - } - if (currentNode && currentNode.getBaseStreams) { - var baseStreams = currentNode.getBaseStreams(); - var foundMissingData = false; - for (var i = 0; i < baseStreams.length; i++) { - var stream = baseStreams[i]; - if (stream.getMissingChunks && stream.getMissingChunks().length) { - foundMissingData = true; - pendingRequests.push({ - begin: stream.start, - end: stream.end - }); - } - } - if (foundMissingData) { - nodesToRevisit.push(currentNode); - } - } - - addChildren(currentNode, nodesToVisit); - } - - if (pendingRequests.length) { - this.xref.stream.manager.requestRanges(pendingRequests).then( - function pendingRequestCallback() { - nodesToVisit = nodesToRevisit; - for (var i = 0; i < nodesToRevisit.length; i++) { - var node = nodesToRevisit[i]; - // Remove any reference nodes from the currrent refset so they - // aren't skipped when we revist them. - if (isRef(node)) { - this.refSet.remove(node); - } - } - this._walk(nodesToVisit); - }.bind(this), this.capability.reject); - return; - } - // Everything is loaded. - this.refSet = null; - this.capability.resolve(); - } - }; - - return ObjectLoader; -})(); - -exports.Catalog = Catalog; -exports.ObjectLoader = ObjectLoader; -exports.XRef = XRef; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePsParser = {}), root.pdfjsSharedUtil, - root.pdfjsCoreParser); - } -}(this, function (exports, sharedUtil, coreParser) { - -var error = sharedUtil.error; -var EOF = coreParser.EOF; -var Lexer = coreParser.Lexer; - -var PostScriptParser = (function PostScriptParserClosure() { - function PostScriptParser(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - PostScriptParser.prototype = { - nextToken: function PostScriptParser_nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - }, - accept: function PostScriptParser_accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - return false; - }, - expect: function PostScriptParser_expect(type) { - if (this.accept(type)) { - return true; - } - error('Unexpected symbol: found ' + this.token.type + ' expected ' + - type + '.'); - }, - parse: function PostScriptParser_parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - }, - parseBlock: function PostScriptParser_parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - }, - parseCondition: function PostScriptParser_parseCondition() { - // Add two place holders that will be updated later - var conditionLocation = this.operators.length; - this.operators.push(null, null); - - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - if (this.accept(PostScriptTokenTypes.IF)) { - // The true block is right after the 'if' so it just falls through on - // true else it jumps and skips the true block. - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = 'jz'; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - var jumpLocation = this.operators.length; - this.operators.push(null, null); - var endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - // The jump is added at the end of the true block to skip the false - // block. - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = 'j'; - - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = 'jz'; - } else { - error('PS Function: error parsing conditional.'); - } - } - }; - return PostScriptParser; -})(); - -var PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; - -var PostScriptToken = (function PostScriptTokenClosure() { - function PostScriptToken(type, value) { - this.type = type; - this.value = value; - } - - var opCache = {}; - - PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { - var opValue = opCache[op]; - if (opValue) { - return opValue; - } - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - }; - - PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, - '{'); - PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, - '}'); - PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); - PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, - 'IFELSE'); - return PostScriptToken; -})(); - -var PostScriptLexer = (function PostScriptLexerClosure() { - function PostScriptLexer(stream) { - this.stream = stream; - this.nextChar(); - - this.strBuf = []; - } - PostScriptLexer.prototype = { - nextChar: function PostScriptLexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - getToken: function PostScriptLexer_getToken() { - var comment = false; - var ch = this.currentChar; - - // skip comments - while (true) { - if (ch < 0) { - return EOF; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!Lexer.isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return new PostScriptToken(PostScriptTokenTypes.NUMBER, - this.getNumber()); - case 0x7B: // '{' - this.nextChar(); - return PostScriptToken.LBRACE; - case 0x7D: // '}' - this.nextChar(); - return PostScriptToken.RBRACE; - } - // operator - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0 && // and 'A'-'Z', 'a'-'z' - ((ch >= 0x41 && ch <= 0x5A) || (ch >= 0x61 && ch <= 0x7A))) { - strBuf.push(String.fromCharCode(ch)); - } - var str = strBuf.join(''); - switch (str.toLowerCase()) { - case 'if': - return PostScriptToken.IF; - case 'ifelse': - return PostScriptToken.IFELSE; - default: - return PostScriptToken.getOperator(str); - } - }, - getNumber: function PostScriptLexer_getNumber() { - var ch = this.currentChar; - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0) { - if ((ch >= 0x30 && ch <= 0x39) || // '0'-'9' - ch === 0x2D || ch === 0x2E) { // '-', '.' - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - var value = parseFloat(strBuf.join('')); - if (isNaN(value)) { - error('Invalid floating point number: ' + value); - } - return value; - } - }; - return PostScriptLexer; -})(); - -exports.PostScriptLexer = PostScriptLexer; -exports.PostScriptParser = PostScriptParser; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreFonts = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser, - root.pdfjsCoreCMap, root.pdfjsCoreGlyphList, root.pdfjsCoreCharsets, - root.pdfjsCoreFontRenderer); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser, - coreCMap, coreGlyphList, coreCharsets, coreFontRenderer) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var FontType = sharedUtil.FontType; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var bytesToString = sharedUtil.bytesToString; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isNum = sharedUtil.isNum; -var readUint32 = sharedUtil.readUint32; -var shadow = sharedUtil.shadow; -var stringToBytes = sharedUtil.stringToBytes; -var string32 = sharedUtil.string32; -var warn = sharedUtil.warn; -var Name = corePrimitives.Name; -var Stream = coreStream.Stream; -var Lexer = coreParser.Lexer; -var CMapFactory = coreCMap.CMapFactory; -var IdentityCMap = coreCMap.IdentityCMap; -var GlyphsUnicode = coreGlyphList.GlyphsUnicode; -var DingbatsGlyphsUnicode = coreGlyphList.DingbatsGlyphsUnicode; -var ISOAdobeCharset = coreCharsets.ISOAdobeCharset; -var ExpertCharset = coreCharsets.ExpertCharset; -var ExpertSubsetCharset = coreCharsets.ExpertSubsetCharset; -var FontRendererFactory = coreFontRenderer.FontRendererFactory; - -// Unicode Private Use Area -var PRIVATE_USE_OFFSET_START = 0xE000; -var PRIVATE_USE_OFFSET_END = 0xF8FF; -var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; - -// PDF Glyph Space Units are one Thousandth of a TextSpace Unit -// except for Type 3 fonts -var PDF_GLYPH_SPACE_UNITS = 1000; - -// Hinting is currently disabled due to unknown problems on windows -// in tracemonkey and various other pdfs with type1 fonts. -var HINTING_ENABLED = false; - -// Accented charactars are not displayed properly on windows, using this flag -// to control analysis of seac charstrings. -var SEAC_ANALYSIS_ENABLED = false; - -// Maximum subroutine call depth of type 2 chartrings. Matches OTS. -var MAX_SUBR_NESTING = 10; - -var FontFlags = { - FixedPitch: 1, - Serif: 2, - Symbolic: 4, - Script: 8, - Nonsymbolic: 32, - Italic: 64, - AllCap: 65536, - SmallCap: 131072, - ForceBold: 262144 -}; - -var Encodings = { - ExpertEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', - 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', - 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', - 'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', - 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', - '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', - 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', - 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', - 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', - 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', - 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', - 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', - 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', - 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', - 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', - 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall'], - MacExpertEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', - 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', - 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', - 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', - 'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '', - 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff', - 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', - 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '', - 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall', - 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall', - 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall', - 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '', - 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior', - 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior', - 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior', - 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '', - 'dollarinferior', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior', - 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall', - 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '', - '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '', - 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior', - 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior', - 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior', - '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall', - 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior', - 'periodsuperior', 'Dotaccentsmall', 'Ringsmall'], - MacRomanEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', - 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', - 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', - 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', - 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', - 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', - 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', - 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', - 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', - 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', - 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', - 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', - 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', - 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', - 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', - 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', - 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', - 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', - 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', - 'ogonek', 'caron'], - StandardEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', - 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', - 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', - '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', - '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', - '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'], - WinAnsiEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', - 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', - 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', - 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', - 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', - 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', - 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', - 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', - 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', - 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', - 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', - 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', - 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', - 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', - 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', - 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', - 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', - 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', - 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', - 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash', - 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', - 'ydieresis'], - SymbolSetEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', - 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', - 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', - 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', - 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', - 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', - 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', - 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', - 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', - 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', - 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', - 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', - 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', - 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', - 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', - 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', - 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', - 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', - 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', - 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', - 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', - 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', - 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', - 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', - 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', - 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', - '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', - 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', - 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', - 'bracerightbt'], - ZapfDingbatsEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', - 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', - 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', - 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', - 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', - 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', - 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', - 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', - 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', - 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', - 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', - 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', - 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', - 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', - 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', - 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', - 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', - 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', - 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', - 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', - 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191'] -}; - -/** - * Hold a map of decoded fonts and of the standard fourteen Type1 - * fonts and their acronyms. - */ -var stdFontMap = { - 'ArialNarrow': 'Helvetica', - 'ArialNarrow-Bold': 'Helvetica-Bold', - 'ArialNarrow-BoldItalic': 'Helvetica-BoldOblique', - 'ArialNarrow-Italic': 'Helvetica-Oblique', - 'ArialBlack': 'Helvetica', - 'ArialBlack-Bold': 'Helvetica-Bold', - 'ArialBlack-BoldItalic': 'Helvetica-BoldOblique', - 'ArialBlack-Italic': 'Helvetica-Oblique', - 'Arial': 'Helvetica', - 'Arial-Bold': 'Helvetica-Bold', - 'Arial-BoldItalic': 'Helvetica-BoldOblique', - 'Arial-Italic': 'Helvetica-Oblique', - 'Arial-BoldItalicMT': 'Helvetica-BoldOblique', - 'Arial-BoldMT': 'Helvetica-Bold', - 'Arial-ItalicMT': 'Helvetica-Oblique', - 'ArialMT': 'Helvetica', - 'Courier-Bold': 'Courier-Bold', - 'Courier-BoldItalic': 'Courier-BoldOblique', - 'Courier-Italic': 'Courier-Oblique', - 'CourierNew': 'Courier', - 'CourierNew-Bold': 'Courier-Bold', - 'CourierNew-BoldItalic': 'Courier-BoldOblique', - 'CourierNew-Italic': 'Courier-Oblique', - 'CourierNewPS-BoldItalicMT': 'Courier-BoldOblique', - 'CourierNewPS-BoldMT': 'Courier-Bold', - 'CourierNewPS-ItalicMT': 'Courier-Oblique', - 'CourierNewPSMT': 'Courier', - 'Helvetica': 'Helvetica', - 'Helvetica-Bold': 'Helvetica-Bold', - 'Helvetica-BoldItalic': 'Helvetica-BoldOblique', - 'Helvetica-BoldOblique': 'Helvetica-BoldOblique', - 'Helvetica-Italic': 'Helvetica-Oblique', - 'Helvetica-Oblique':'Helvetica-Oblique', - 'Symbol-Bold': 'Symbol', - 'Symbol-BoldItalic': 'Symbol', - 'Symbol-Italic': 'Symbol', - 'TimesNewRoman': 'Times-Roman', - 'TimesNewRoman-Bold': 'Times-Bold', - 'TimesNewRoman-BoldItalic': 'Times-BoldItalic', - 'TimesNewRoman-Italic': 'Times-Italic', - 'TimesNewRomanPS': 'Times-Roman', - 'TimesNewRomanPS-Bold': 'Times-Bold', - 'TimesNewRomanPS-BoldItalic': 'Times-BoldItalic', - 'TimesNewRomanPS-BoldItalicMT': 'Times-BoldItalic', - 'TimesNewRomanPS-BoldMT': 'Times-Bold', - 'TimesNewRomanPS-Italic': 'Times-Italic', - 'TimesNewRomanPS-ItalicMT': 'Times-Italic', - 'TimesNewRomanPSMT': 'Times-Roman', - 'TimesNewRomanPSMT-Bold': 'Times-Bold', - 'TimesNewRomanPSMT-BoldItalic': 'Times-BoldItalic', - 'TimesNewRomanPSMT-Italic': 'Times-Italic' -}; - -/** - * Holds the map of the non-standard fonts that might be included as a standard - * fonts without glyph data. - */ -var nonStdFontMap = { - 'CenturyGothic': 'Helvetica', - 'CenturyGothic-Bold': 'Helvetica-Bold', - 'CenturyGothic-BoldItalic': 'Helvetica-BoldOblique', - 'CenturyGothic-Italic': 'Helvetica-Oblique', - 'ComicSansMS': 'Comic Sans MS', - 'ComicSansMS-Bold': 'Comic Sans MS-Bold', - 'ComicSansMS-BoldItalic': 'Comic Sans MS-BoldItalic', - 'ComicSansMS-Italic': 'Comic Sans MS-Italic', - 'LucidaConsole': 'Courier', - 'LucidaConsole-Bold': 'Courier-Bold', - 'LucidaConsole-BoldItalic': 'Courier-BoldOblique', - 'LucidaConsole-Italic': 'Courier-Oblique', - 'MS-Gothic': 'MS Gothic', - 'MS-Gothic-Bold': 'MS Gothic-Bold', - 'MS-Gothic-BoldItalic': 'MS Gothic-BoldItalic', - 'MS-Gothic-Italic': 'MS Gothic-Italic', - 'MS-Mincho': 'MS Mincho', - 'MS-Mincho-Bold': 'MS Mincho-Bold', - 'MS-Mincho-BoldItalic': 'MS Mincho-BoldItalic', - 'MS-Mincho-Italic': 'MS Mincho-Italic', - 'MS-PGothic': 'MS PGothic', - 'MS-PGothic-Bold': 'MS PGothic-Bold', - 'MS-PGothic-BoldItalic': 'MS PGothic-BoldItalic', - 'MS-PGothic-Italic': 'MS PGothic-Italic', - 'MS-PMincho': 'MS PMincho', - 'MS-PMincho-Bold': 'MS PMincho-Bold', - 'MS-PMincho-BoldItalic': 'MS PMincho-BoldItalic', - 'MS-PMincho-Italic': 'MS PMincho-Italic', - 'Wingdings': 'ZapfDingbats' -}; - -var serifFonts = { - 'Adobe Jenson': true, 'Adobe Text': true, 'Albertus': true, - 'Aldus': true, 'Alexandria': true, 'Algerian': true, - 'American Typewriter': true, 'Antiqua': true, 'Apex': true, - 'Arno': true, 'Aster': true, 'Aurora': true, - 'Baskerville': true, 'Bell': true, 'Bembo': true, - 'Bembo Schoolbook': true, 'Benguiat': true, 'Berkeley Old Style': true, - 'Bernhard Modern': true, 'Berthold City': true, 'Bodoni': true, - 'Bauer Bodoni': true, 'Book Antiqua': true, 'Bookman': true, - 'Bordeaux Roman': true, 'Californian FB': true, 'Calisto': true, - 'Calvert': true, 'Capitals': true, 'Cambria': true, - 'Cartier': true, 'Caslon': true, 'Catull': true, - 'Centaur': true, 'Century Old Style': true, 'Century Schoolbook': true, - 'Chaparral': true, 'Charis SIL': true, 'Cheltenham': true, - 'Cholla Slab': true, 'Clarendon': true, 'Clearface': true, - 'Cochin': true, 'Colonna': true, 'Computer Modern': true, - 'Concrete Roman': true, 'Constantia': true, 'Cooper Black': true, - 'Corona': true, 'Ecotype': true, 'Egyptienne': true, - 'Elephant': true, 'Excelsior': true, 'Fairfield': true, - 'FF Scala': true, 'Folkard': true, 'Footlight': true, - 'FreeSerif': true, 'Friz Quadrata': true, 'Garamond': true, - 'Gentium': true, 'Georgia': true, 'Gloucester': true, - 'Goudy Old Style': true, 'Goudy Schoolbook': true, 'Goudy Pro Font': true, - 'Granjon': true, 'Guardian Egyptian': true, 'Heather': true, - 'Hercules': true, 'High Tower Text': true, 'Hiroshige': true, - 'Hoefler Text': true, 'Humana Serif': true, 'Imprint': true, - 'Ionic No. 5': true, 'Janson': true, 'Joanna': true, - 'Korinna': true, 'Lexicon': true, 'Liberation Serif': true, - 'Linux Libertine': true, 'Literaturnaya': true, 'Lucida': true, - 'Lucida Bright': true, 'Melior': true, 'Memphis': true, - 'Miller': true, 'Minion': true, 'Modern': true, - 'Mona Lisa': true, 'Mrs Eaves': true, 'MS Serif': true, - 'Museo Slab': true, 'New York': true, 'Nimbus Roman': true, - 'NPS Rawlinson Roadway': true, 'Palatino': true, 'Perpetua': true, - 'Plantin': true, 'Plantin Schoolbook': true, 'Playbill': true, - 'Poor Richard': true, 'Rawlinson Roadway': true, 'Renault': true, - 'Requiem': true, 'Rockwell': true, 'Roman': true, - 'Rotis Serif': true, 'Sabon': true, 'Scala': true, - 'Seagull': true, 'Sistina': true, 'Souvenir': true, - 'STIX': true, 'Stone Informal': true, 'Stone Serif': true, - 'Sylfaen': true, 'Times': true, 'Trajan': true, - 'Trinité': true, 'Trump Mediaeval': true, 'Utopia': true, - 'Vale Type': true, 'Bitstream Vera': true, 'Vera Serif': true, - 'Versailles': true, 'Wanted': true, 'Weiss': true, - 'Wide Latin': true, 'Windsor': true, 'XITS': true -}; - -var symbolsFonts = { - 'Dingbats': true, 'Symbol': true, 'ZapfDingbats': true -}; - -// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID fonts -// but does not embed the CID to GID mapping. The mapping is incomplete for all -// glyphs, but common for some set of the standard fonts. -var GlyphMapForStandardFonts = { - '2': 10, '3': 32, '4': 33, '5': 34, '6': 35, '7': 36, '8': 37, '9': 38, - '10': 39, '11': 40, '12': 41, '13': 42, '14': 43, '15': 44, '16': 45, - '17': 46, '18': 47, '19': 48, '20': 49, '21': 50, '22': 51, '23': 52, - '24': 53, '25': 54, '26': 55, '27': 56, '28': 57, '29': 58, '30': 894, - '31': 60, '32': 61, '33': 62, '34': 63, '35': 64, '36': 65, '37': 66, - '38': 67, '39': 68, '40': 69, '41': 70, '42': 71, '43': 72, '44': 73, - '45': 74, '46': 75, '47': 76, '48': 77, '49': 78, '50': 79, '51': 80, - '52': 81, '53': 82, '54': 83, '55': 84, '56': 85, '57': 86, '58': 87, - '59': 88, '60': 89, '61': 90, '62': 91, '63': 92, '64': 93, '65': 94, - '66': 95, '67': 96, '68': 97, '69': 98, '70': 99, '71': 100, '72': 101, - '73': 102, '74': 103, '75': 104, '76': 105, '77': 106, '78': 107, '79': 108, - '80': 109, '81': 110, '82': 111, '83': 112, '84': 113, '85': 114, '86': 115, - '87': 116, '88': 117, '89': 118, '90': 119, '91': 120, '92': 121, '93': 122, - '94': 123, '95': 124, '96': 125, '97': 126, '98': 196, '99': 197, '100': 199, - '101': 201, '102': 209, '103': 214, '104': 220, '105': 225, '106': 224, - '107': 226, '108': 228, '109': 227, '110': 229, '111': 231, '112': 233, - '113': 232, '114': 234, '115': 235, '116': 237, '117': 236, '118': 238, - '119': 239, '120': 241, '121': 243, '122': 242, '123': 244, '124': 246, - '125': 245, '126': 250, '127': 249, '128': 251, '129': 252, '130': 8224, - '131': 176, '132': 162, '133': 163, '134': 167, '135': 8226, '136': 182, - '137': 223, '138': 174, '139': 169, '140': 8482, '141': 180, '142': 168, - '143': 8800, '144': 198, '145': 216, '146': 8734, '147': 177, '148': 8804, - '149': 8805, '150': 165, '151': 181, '152': 8706, '153': 8721, '154': 8719, - '156': 8747, '157': 170, '158': 186, '159': 8486, '160': 230, '161': 248, - '162': 191, '163': 161, '164': 172, '165': 8730, '166': 402, '167': 8776, - '168': 8710, '169': 171, '170': 187, '171': 8230, '210': 218, '223': 711, - '224': 321, '225': 322, '227': 353, '229': 382, '234': 253, '252': 263, - '253': 268, '254': 269, '258': 258, '260': 260, '261': 261, '265': 280, - '266': 281, '268': 283, '269': 313, '275': 323, '276': 324, '278': 328, - '284': 345, '285': 346, '286': 347, '292': 367, '295': 377, '296': 378, - '298': 380, '305': 963, - '306': 964, '307': 966, '308': 8215, '309': 8252, '310': 8319, '311': 8359, - '312': 8592, '313': 8593, '337': 9552, '493': 1039, '494': 1040, '705': 1524, - '706': 8362, '710': 64288, '711': 64298, '759': 1617, '761': 1776, - '763': 1778, '775': 1652, '777': 1764, '778': 1780, '779': 1781, '780': 1782, - '782': 771, '783': 64726, '786': 8363, '788': 8532, '790': 768, '791': 769, - '792': 768, '795': 803, '797': 64336, '798': 64337, '799': 64342, - '800': 64343, '801': 64344, '802': 64345, '803': 64362, '804': 64363, - '805': 64364, '2424': 7821, '2425': 7822, '2426': 7823, '2427': 7824, - '2428': 7825, '2429': 7826, '2430': 7827, '2433': 7682, '2678': 8045, - '2679': 8046, '2830': 1552, '2838': 686, '2840': 751, '2842': 753, - '2843': 754, '2844': 755, '2846': 757, '2856': 767, '2857': 848, '2858': 849, - '2862': 853, '2863': 854, '2864': 855, '2865': 861, '2866': 862, '2906': 7460, - '2908': 7462, '2909': 7463, '2910': 7464, '2912': 7466, '2913': 7467, - '2914': 7468, '2916': 7470, '2917': 7471, '2918': 7472, '2920': 7474, - '2921': 7475, '2922': 7476, '2924': 7478, '2925': 7479, '2926': 7480, - '2928': 7482, '2929': 7483, '2930': 7484, '2932': 7486, '2933': 7487, - '2934': 7488, '2936': 7490, '2937': 7491, '2938': 7492, '2940': 7494, - '2941': 7495, '2942': 7496, '2944': 7498, '2946': 7500, '2948': 7502, - '2950': 7504, '2951': 7505, '2952': 7506, '2954': 7508, '2955': 7509, - '2956': 7510, '2958': 7512, '2959': 7513, '2960': 7514, '2962': 7516, - '2963': 7517, '2964': 7518, '2966': 7520, '2967': 7521, '2968': 7522, - '2970': 7524, '2971': 7525, '2972': 7526, '2974': 7528, '2975': 7529, - '2976': 7530, '2978': 1537, '2979': 1538, '2980': 1539, '2982': 1549, - '2983': 1551, '2984': 1552, '2986': 1554, '2987': 1555, '2988': 1556, - '2990': 1623, '2991': 1624, '2995': 1775, '2999': 1791, '3002': 64290, - '3003': 64291, '3004': 64292, '3006': 64294, '3007': 64295, '3008': 64296, - '3011': 1900, '3014': 8223, '3015': 8244, '3017': 7532, '3018': 7533, - '3019': 7534, '3075': 7590, '3076': 7591, '3079': 7594, '3080': 7595, - '3083': 7598, '3084': 7599, '3087': 7602, '3088': 7603, '3091': 7606, - '3092': 7607, '3095': 7610, '3096': 7611, '3099': 7614, '3100': 7615, - '3103': 7618, '3104': 7619, '3107': 8337, '3108': 8338, '3116': 1884, - '3119': 1885, '3120': 1885, '3123': 1886, '3124': 1886, '3127': 1887, - '3128': 1887, '3131': 1888, '3132': 1888, '3135': 1889, '3136': 1889, - '3139': 1890, '3140': 1890, '3143': 1891, '3144': 1891, '3147': 1892, - '3148': 1892, '3153': 580, '3154': 581, '3157': 584, '3158': 585, '3161': 588, - '3162': 589, '3165': 891, '3166': 892, '3169': 1274, '3170': 1275, - '3173': 1278, '3174': 1279, '3181': 7622, '3182': 7623, '3282': 11799, - '3316': 578, '3379': 42785, '3393': 1159, '3416': 8377 -}; - -// The glyph map for ArialBlack differs slightly from the glyph map used for -// other well-known standard fonts. Hence we use this (incomplete) CID to GID -// mapping to adjust the glyph map for non-embedded ArialBlack fonts. -var SupplementalGlyphMapForArialBlack = { - '227': 322, '264': 261, '291': 346, -}; - -// Some characters, e.g. copyrightserif, are mapped to the private use area and -// might not be displayed using standard fonts. Mapping/hacking well-known chars -// to the similar equivalents in the normal characters range. -var SpecialPUASymbols = { - '63721': 0x00A9, // copyrightsans (0xF8E9) => copyright - '63193': 0x00A9, // copyrightserif (0xF6D9) => copyright - '63720': 0x00AE, // registersans (0xF8E8) => registered - '63194': 0x00AE, // registerserif (0xF6DA) => registered - '63722': 0x2122, // trademarksans (0xF8EA) => trademark - '63195': 0x2122, // trademarkserif (0xF6DB) => trademark - '63729': 0x23A7, // bracelefttp (0xF8F1) - '63730': 0x23A8, // braceleftmid (0xF8F2) - '63731': 0x23A9, // braceleftbt (0xF8F3) - '63740': 0x23AB, // bracerighttp (0xF8FC) - '63741': 0x23AC, // bracerightmid (0xF8FD) - '63742': 0x23AD, // bracerightbt (0xF8FE) - '63726': 0x23A1, // bracketlefttp (0xF8EE) - '63727': 0x23A2, // bracketleftex (0xF8EF) - '63728': 0x23A3, // bracketleftbt (0xF8F0) - '63737': 0x23A4, // bracketrighttp (0xF8F9) - '63738': 0x23A5, // bracketrightex (0xF8FA) - '63739': 0x23A6, // bracketrightbt (0xF8FB) - '63723': 0x239B, // parenlefttp (0xF8EB) - '63724': 0x239C, // parenleftex (0xF8EC) - '63725': 0x239D, // parenleftbt (0xF8ED) - '63734': 0x239E, // parenrighttp (0xF8F6) - '63735': 0x239F, // parenrightex (0xF8F7) - '63736': 0x23A0, // parenrightbt (0xF8F8) -}; -function mapSpecialUnicodeValues(code) { - if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials unicode block. - return 0; - } else if (code >= 0xF600 && code <= 0xF8FF) { - return (SpecialPUASymbols[code] || code); - } - return code; -} - -var UnicodeRanges = [ - { 'begin': 0x0000, 'end': 0x007F }, // Basic Latin - { 'begin': 0x0080, 'end': 0x00FF }, // Latin-1 Supplement - { 'begin': 0x0100, 'end': 0x017F }, // Latin Extended-A - { 'begin': 0x0180, 'end': 0x024F }, // Latin Extended-B - { 'begin': 0x0250, 'end': 0x02AF }, // IPA Extensions - { 'begin': 0x02B0, 'end': 0x02FF }, // Spacing Modifier Letters - { 'begin': 0x0300, 'end': 0x036F }, // Combining Diacritical Marks - { 'begin': 0x0370, 'end': 0x03FF }, // Greek and Coptic - { 'begin': 0x2C80, 'end': 0x2CFF }, // Coptic - { 'begin': 0x0400, 'end': 0x04FF }, // Cyrillic - { 'begin': 0x0530, 'end': 0x058F }, // Armenian - { 'begin': 0x0590, 'end': 0x05FF }, // Hebrew - { 'begin': 0xA500, 'end': 0xA63F }, // Vai - { 'begin': 0x0600, 'end': 0x06FF }, // Arabic - { 'begin': 0x07C0, 'end': 0x07FF }, // NKo - { 'begin': 0x0900, 'end': 0x097F }, // Devanagari - { 'begin': 0x0980, 'end': 0x09FF }, // Bengali - { 'begin': 0x0A00, 'end': 0x0A7F }, // Gurmukhi - { 'begin': 0x0A80, 'end': 0x0AFF }, // Gujarati - { 'begin': 0x0B00, 'end': 0x0B7F }, // Oriya - { 'begin': 0x0B80, 'end': 0x0BFF }, // Tamil - { 'begin': 0x0C00, 'end': 0x0C7F }, // Telugu - { 'begin': 0x0C80, 'end': 0x0CFF }, // Kannada - { 'begin': 0x0D00, 'end': 0x0D7F }, // Malayalam - { 'begin': 0x0E00, 'end': 0x0E7F }, // Thai - { 'begin': 0x0E80, 'end': 0x0EFF }, // Lao - { 'begin': 0x10A0, 'end': 0x10FF }, // Georgian - { 'begin': 0x1B00, 'end': 0x1B7F }, // Balinese - { 'begin': 0x1100, 'end': 0x11FF }, // Hangul Jamo - { 'begin': 0x1E00, 'end': 0x1EFF }, // Latin Extended Additional - { 'begin': 0x1F00, 'end': 0x1FFF }, // Greek Extended - { 'begin': 0x2000, 'end': 0x206F }, // General Punctuation - { 'begin': 0x2070, 'end': 0x209F }, // Superscripts And Subscripts - { 'begin': 0x20A0, 'end': 0x20CF }, // Currency Symbol - { 'begin': 0x20D0, 'end': 0x20FF }, // Combining Diacritical Marks For Symbols - { 'begin': 0x2100, 'end': 0x214F }, // Letterlike Symbols - { 'begin': 0x2150, 'end': 0x218F }, // Number Forms - { 'begin': 0x2190, 'end': 0x21FF }, // Arrows - { 'begin': 0x2200, 'end': 0x22FF }, // Mathematical Operators - { 'begin': 0x2300, 'end': 0x23FF }, // Miscellaneous Technical - { 'begin': 0x2400, 'end': 0x243F }, // Control Pictures - { 'begin': 0x2440, 'end': 0x245F }, // Optical Character Recognition - { 'begin': 0x2460, 'end': 0x24FF }, // Enclosed Alphanumerics - { 'begin': 0x2500, 'end': 0x257F }, // Box Drawing - { 'begin': 0x2580, 'end': 0x259F }, // Block Elements - { 'begin': 0x25A0, 'end': 0x25FF }, // Geometric Shapes - { 'begin': 0x2600, 'end': 0x26FF }, // Miscellaneous Symbols - { 'begin': 0x2700, 'end': 0x27BF }, // Dingbats - { 'begin': 0x3000, 'end': 0x303F }, // CJK Symbols And Punctuation - { 'begin': 0x3040, 'end': 0x309F }, // Hiragana - { 'begin': 0x30A0, 'end': 0x30FF }, // Katakana - { 'begin': 0x3100, 'end': 0x312F }, // Bopomofo - { 'begin': 0x3130, 'end': 0x318F }, // Hangul Compatibility Jamo - { 'begin': 0xA840, 'end': 0xA87F }, // Phags-pa - { 'begin': 0x3200, 'end': 0x32FF }, // Enclosed CJK Letters And Months - { 'begin': 0x3300, 'end': 0x33FF }, // CJK Compatibility - { 'begin': 0xAC00, 'end': 0xD7AF }, // Hangul Syllables - { 'begin': 0xD800, 'end': 0xDFFF }, // Non-Plane 0 * - { 'begin': 0x10900, 'end': 0x1091F }, // Phoenicia - { 'begin': 0x4E00, 'end': 0x9FFF }, // CJK Unified Ideographs - { 'begin': 0xE000, 'end': 0xF8FF }, // Private Use Area (plane 0) - { 'begin': 0x31C0, 'end': 0x31EF }, // CJK Strokes - { 'begin': 0xFB00, 'end': 0xFB4F }, // Alphabetic Presentation Forms - { 'begin': 0xFB50, 'end': 0xFDFF }, // Arabic Presentation Forms-A - { 'begin': 0xFE20, 'end': 0xFE2F }, // Combining Half Marks - { 'begin': 0xFE10, 'end': 0xFE1F }, // Vertical Forms - { 'begin': 0xFE50, 'end': 0xFE6F }, // Small Form Variants - { 'begin': 0xFE70, 'end': 0xFEFF }, // Arabic Presentation Forms-B - { 'begin': 0xFF00, 'end': 0xFFEF }, // Halfwidth And Fullwidth Forms - { 'begin': 0xFFF0, 'end': 0xFFFF }, // Specials - { 'begin': 0x0F00, 'end': 0x0FFF }, // Tibetan - { 'begin': 0x0700, 'end': 0x074F }, // Syriac - { 'begin': 0x0780, 'end': 0x07BF }, // Thaana - { 'begin': 0x0D80, 'end': 0x0DFF }, // Sinhala - { 'begin': 0x1000, 'end': 0x109F }, // Myanmar - { 'begin': 0x1200, 'end': 0x137F }, // Ethiopic - { 'begin': 0x13A0, 'end': 0x13FF }, // Cherokee - { 'begin': 0x1400, 'end': 0x167F }, // Unified Canadian Aboriginal Syllabics - { 'begin': 0x1680, 'end': 0x169F }, // Ogham - { 'begin': 0x16A0, 'end': 0x16FF }, // Runic - { 'begin': 0x1780, 'end': 0x17FF }, // Khmer - { 'begin': 0x1800, 'end': 0x18AF }, // Mongolian - { 'begin': 0x2800, 'end': 0x28FF }, // Braille Patterns - { 'begin': 0xA000, 'end': 0xA48F }, // Yi Syllables - { 'begin': 0x1700, 'end': 0x171F }, // Tagalog - { 'begin': 0x10300, 'end': 0x1032F }, // Old Italic - { 'begin': 0x10330, 'end': 0x1034F }, // Gothic - { 'begin': 0x10400, 'end': 0x1044F }, // Deseret - { 'begin': 0x1D000, 'end': 0x1D0FF }, // Byzantine Musical Symbols - { 'begin': 0x1D400, 'end': 0x1D7FF }, // Mathematical Alphanumeric Symbols - { 'begin': 0xFF000, 'end': 0xFFFFD }, // Private Use (plane 15) - { 'begin': 0xFE00, 'end': 0xFE0F }, // Variation Selectors - { 'begin': 0xE0000, 'end': 0xE007F }, // Tags - { 'begin': 0x1900, 'end': 0x194F }, // Limbu - { 'begin': 0x1950, 'end': 0x197F }, // Tai Le - { 'begin': 0x1980, 'end': 0x19DF }, // New Tai Lue - { 'begin': 0x1A00, 'end': 0x1A1F }, // Buginese - { 'begin': 0x2C00, 'end': 0x2C5F }, // Glagolitic - { 'begin': 0x2D30, 'end': 0x2D7F }, // Tifinagh - { 'begin': 0x4DC0, 'end': 0x4DFF }, // Yijing Hexagram Symbols - { 'begin': 0xA800, 'end': 0xA82F }, // Syloti Nagri - { 'begin': 0x10000, 'end': 0x1007F }, // Linear B Syllabary - { 'begin': 0x10140, 'end': 0x1018F }, // Ancient Greek Numbers - { 'begin': 0x10380, 'end': 0x1039F }, // Ugaritic - { 'begin': 0x103A0, 'end': 0x103DF }, // Old Persian - { 'begin': 0x10450, 'end': 0x1047F }, // Shavian - { 'begin': 0x10480, 'end': 0x104AF }, // Osmanya - { 'begin': 0x10800, 'end': 0x1083F }, // Cypriot Syllabary - { 'begin': 0x10A00, 'end': 0x10A5F }, // Kharoshthi - { 'begin': 0x1D300, 'end': 0x1D35F }, // Tai Xuan Jing Symbols - { 'begin': 0x12000, 'end': 0x123FF }, // Cuneiform - { 'begin': 0x1D360, 'end': 0x1D37F }, // Counting Rod Numerals - { 'begin': 0x1B80, 'end': 0x1BBF }, // Sundanese - { 'begin': 0x1C00, 'end': 0x1C4F }, // Lepcha - { 'begin': 0x1C50, 'end': 0x1C7F }, // Ol Chiki - { 'begin': 0xA880, 'end': 0xA8DF }, // Saurashtra - { 'begin': 0xA900, 'end': 0xA92F }, // Kayah Li - { 'begin': 0xA930, 'end': 0xA95F }, // Rejang - { 'begin': 0xAA00, 'end': 0xAA5F }, // Cham - { 'begin': 0x10190, 'end': 0x101CF }, // Ancient Symbols - { 'begin': 0x101D0, 'end': 0x101FF }, // Phaistos Disc - { 'begin': 0x102A0, 'end': 0x102DF }, // Carian - { 'begin': 0x1F030, 'end': 0x1F09F } // Domino Tiles -]; - -var MacStandardGlyphOrdering = [ - '.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', - 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', - 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', - 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', - 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', - 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', - 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', - 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', - 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', - 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', - 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', - 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', - 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', - 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', - 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', - 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', - 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', - 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', - 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', - 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', - 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', - 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', - 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', - 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', - 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', - 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', - 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', - 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', - 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', - 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', - 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', - 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat']; - -function getUnicodeRangeFor(value) { - for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { - var range = UnicodeRanges[i]; - if (value >= range.begin && value < range.end) { - return i; - } - } - return -1; -} - -function isRTLRangeFor(value) { - var range = UnicodeRanges[13]; - if (value >= range.begin && value < range.end) { - return true; - } - range = UnicodeRanges[11]; - if (value >= range.begin && value < range.end) { - return true; - } - return false; -} - -// The normalization table is obtained by filtering the Unicode characters -// database with entries. -var NormalizedUnicodes = { - '\u00A8': '\u0020\u0308', - '\u00AF': '\u0020\u0304', - '\u00B4': '\u0020\u0301', - '\u00B5': '\u03BC', - '\u00B8': '\u0020\u0327', - '\u0132': '\u0049\u004A', - '\u0133': '\u0069\u006A', - '\u013F': '\u004C\u00B7', - '\u0140': '\u006C\u00B7', - '\u0149': '\u02BC\u006E', - '\u017F': '\u0073', - '\u01C4': '\u0044\u017D', - '\u01C5': '\u0044\u017E', - '\u01C6': '\u0064\u017E', - '\u01C7': '\u004C\u004A', - '\u01C8': '\u004C\u006A', - '\u01C9': '\u006C\u006A', - '\u01CA': '\u004E\u004A', - '\u01CB': '\u004E\u006A', - '\u01CC': '\u006E\u006A', - '\u01F1': '\u0044\u005A', - '\u01F2': '\u0044\u007A', - '\u01F3': '\u0064\u007A', - '\u02D8': '\u0020\u0306', - '\u02D9': '\u0020\u0307', - '\u02DA': '\u0020\u030A', - '\u02DB': '\u0020\u0328', - '\u02DC': '\u0020\u0303', - '\u02DD': '\u0020\u030B', - '\u037A': '\u0020\u0345', - '\u0384': '\u0020\u0301', - '\u03D0': '\u03B2', - '\u03D1': '\u03B8', - '\u03D2': '\u03A5', - '\u03D5': '\u03C6', - '\u03D6': '\u03C0', - '\u03F0': '\u03BA', - '\u03F1': '\u03C1', - '\u03F2': '\u03C2', - '\u03F4': '\u0398', - '\u03F5': '\u03B5', - '\u03F9': '\u03A3', - '\u0587': '\u0565\u0582', - '\u0675': '\u0627\u0674', - '\u0676': '\u0648\u0674', - '\u0677': '\u06C7\u0674', - '\u0678': '\u064A\u0674', - '\u0E33': '\u0E4D\u0E32', - '\u0EB3': '\u0ECD\u0EB2', - '\u0EDC': '\u0EAB\u0E99', - '\u0EDD': '\u0EAB\u0EA1', - '\u0F77': '\u0FB2\u0F81', - '\u0F79': '\u0FB3\u0F81', - '\u1E9A': '\u0061\u02BE', - '\u1FBD': '\u0020\u0313', - '\u1FBF': '\u0020\u0313', - '\u1FC0': '\u0020\u0342', - '\u1FFE': '\u0020\u0314', - '\u2002': '\u0020', - '\u2003': '\u0020', - '\u2004': '\u0020', - '\u2005': '\u0020', - '\u2006': '\u0020', - '\u2008': '\u0020', - '\u2009': '\u0020', - '\u200A': '\u0020', - '\u2017': '\u0020\u0333', - '\u2024': '\u002E', - '\u2025': '\u002E\u002E', - '\u2026': '\u002E\u002E\u002E', - '\u2033': '\u2032\u2032', - '\u2034': '\u2032\u2032\u2032', - '\u2036': '\u2035\u2035', - '\u2037': '\u2035\u2035\u2035', - '\u203C': '\u0021\u0021', - '\u203E': '\u0020\u0305', - '\u2047': '\u003F\u003F', - '\u2048': '\u003F\u0021', - '\u2049': '\u0021\u003F', - '\u2057': '\u2032\u2032\u2032\u2032', - '\u205F': '\u0020', - '\u20A8': '\u0052\u0073', - '\u2100': '\u0061\u002F\u0063', - '\u2101': '\u0061\u002F\u0073', - '\u2103': '\u00B0\u0043', - '\u2105': '\u0063\u002F\u006F', - '\u2106': '\u0063\u002F\u0075', - '\u2107': '\u0190', - '\u2109': '\u00B0\u0046', - '\u2116': '\u004E\u006F', - '\u2121': '\u0054\u0045\u004C', - '\u2135': '\u05D0', - '\u2136': '\u05D1', - '\u2137': '\u05D2', - '\u2138': '\u05D3', - '\u213B': '\u0046\u0041\u0058', - '\u2160': '\u0049', - '\u2161': '\u0049\u0049', - '\u2162': '\u0049\u0049\u0049', - '\u2163': '\u0049\u0056', - '\u2164': '\u0056', - '\u2165': '\u0056\u0049', - '\u2166': '\u0056\u0049\u0049', - '\u2167': '\u0056\u0049\u0049\u0049', - '\u2168': '\u0049\u0058', - '\u2169': '\u0058', - '\u216A': '\u0058\u0049', - '\u216B': '\u0058\u0049\u0049', - '\u216C': '\u004C', - '\u216D': '\u0043', - '\u216E': '\u0044', - '\u216F': '\u004D', - '\u2170': '\u0069', - '\u2171': '\u0069\u0069', - '\u2172': '\u0069\u0069\u0069', - '\u2173': '\u0069\u0076', - '\u2174': '\u0076', - '\u2175': '\u0076\u0069', - '\u2176': '\u0076\u0069\u0069', - '\u2177': '\u0076\u0069\u0069\u0069', - '\u2178': '\u0069\u0078', - '\u2179': '\u0078', - '\u217A': '\u0078\u0069', - '\u217B': '\u0078\u0069\u0069', - '\u217C': '\u006C', - '\u217D': '\u0063', - '\u217E': '\u0064', - '\u217F': '\u006D', - '\u222C': '\u222B\u222B', - '\u222D': '\u222B\u222B\u222B', - '\u222F': '\u222E\u222E', - '\u2230': '\u222E\u222E\u222E', - '\u2474': '\u0028\u0031\u0029', - '\u2475': '\u0028\u0032\u0029', - '\u2476': '\u0028\u0033\u0029', - '\u2477': '\u0028\u0034\u0029', - '\u2478': '\u0028\u0035\u0029', - '\u2479': '\u0028\u0036\u0029', - '\u247A': '\u0028\u0037\u0029', - '\u247B': '\u0028\u0038\u0029', - '\u247C': '\u0028\u0039\u0029', - '\u247D': '\u0028\u0031\u0030\u0029', - '\u247E': '\u0028\u0031\u0031\u0029', - '\u247F': '\u0028\u0031\u0032\u0029', - '\u2480': '\u0028\u0031\u0033\u0029', - '\u2481': '\u0028\u0031\u0034\u0029', - '\u2482': '\u0028\u0031\u0035\u0029', - '\u2483': '\u0028\u0031\u0036\u0029', - '\u2484': '\u0028\u0031\u0037\u0029', - '\u2485': '\u0028\u0031\u0038\u0029', - '\u2486': '\u0028\u0031\u0039\u0029', - '\u2487': '\u0028\u0032\u0030\u0029', - '\u2488': '\u0031\u002E', - '\u2489': '\u0032\u002E', - '\u248A': '\u0033\u002E', - '\u248B': '\u0034\u002E', - '\u248C': '\u0035\u002E', - '\u248D': '\u0036\u002E', - '\u248E': '\u0037\u002E', - '\u248F': '\u0038\u002E', - '\u2490': '\u0039\u002E', - '\u2491': '\u0031\u0030\u002E', - '\u2492': '\u0031\u0031\u002E', - '\u2493': '\u0031\u0032\u002E', - '\u2494': '\u0031\u0033\u002E', - '\u2495': '\u0031\u0034\u002E', - '\u2496': '\u0031\u0035\u002E', - '\u2497': '\u0031\u0036\u002E', - '\u2498': '\u0031\u0037\u002E', - '\u2499': '\u0031\u0038\u002E', - '\u249A': '\u0031\u0039\u002E', - '\u249B': '\u0032\u0030\u002E', - '\u249C': '\u0028\u0061\u0029', - '\u249D': '\u0028\u0062\u0029', - '\u249E': '\u0028\u0063\u0029', - '\u249F': '\u0028\u0064\u0029', - '\u24A0': '\u0028\u0065\u0029', - '\u24A1': '\u0028\u0066\u0029', - '\u24A2': '\u0028\u0067\u0029', - '\u24A3': '\u0028\u0068\u0029', - '\u24A4': '\u0028\u0069\u0029', - '\u24A5': '\u0028\u006A\u0029', - '\u24A6': '\u0028\u006B\u0029', - '\u24A7': '\u0028\u006C\u0029', - '\u24A8': '\u0028\u006D\u0029', - '\u24A9': '\u0028\u006E\u0029', - '\u24AA': '\u0028\u006F\u0029', - '\u24AB': '\u0028\u0070\u0029', - '\u24AC': '\u0028\u0071\u0029', - '\u24AD': '\u0028\u0072\u0029', - '\u24AE': '\u0028\u0073\u0029', - '\u24AF': '\u0028\u0074\u0029', - '\u24B0': '\u0028\u0075\u0029', - '\u24B1': '\u0028\u0076\u0029', - '\u24B2': '\u0028\u0077\u0029', - '\u24B3': '\u0028\u0078\u0029', - '\u24B4': '\u0028\u0079\u0029', - '\u24B5': '\u0028\u007A\u0029', - '\u2A0C': '\u222B\u222B\u222B\u222B', - '\u2A74': '\u003A\u003A\u003D', - '\u2A75': '\u003D\u003D', - '\u2A76': '\u003D\u003D\u003D', - '\u2E9F': '\u6BCD', - '\u2EF3': '\u9F9F', - '\u2F00': '\u4E00', - '\u2F01': '\u4E28', - '\u2F02': '\u4E36', - '\u2F03': '\u4E3F', - '\u2F04': '\u4E59', - '\u2F05': '\u4E85', - '\u2F06': '\u4E8C', - '\u2F07': '\u4EA0', - '\u2F08': '\u4EBA', - '\u2F09': '\u513F', - '\u2F0A': '\u5165', - '\u2F0B': '\u516B', - '\u2F0C': '\u5182', - '\u2F0D': '\u5196', - '\u2F0E': '\u51AB', - '\u2F0F': '\u51E0', - '\u2F10': '\u51F5', - '\u2F11': '\u5200', - '\u2F12': '\u529B', - '\u2F13': '\u52F9', - '\u2F14': '\u5315', - '\u2F15': '\u531A', - '\u2F16': '\u5338', - '\u2F17': '\u5341', - '\u2F18': '\u535C', - '\u2F19': '\u5369', - '\u2F1A': '\u5382', - '\u2F1B': '\u53B6', - '\u2F1C': '\u53C8', - '\u2F1D': '\u53E3', - '\u2F1E': '\u56D7', - '\u2F1F': '\u571F', - '\u2F20': '\u58EB', - '\u2F21': '\u5902', - '\u2F22': '\u590A', - '\u2F23': '\u5915', - '\u2F24': '\u5927', - '\u2F25': '\u5973', - '\u2F26': '\u5B50', - '\u2F27': '\u5B80', - '\u2F28': '\u5BF8', - '\u2F29': '\u5C0F', - '\u2F2A': '\u5C22', - '\u2F2B': '\u5C38', - '\u2F2C': '\u5C6E', - '\u2F2D': '\u5C71', - '\u2F2E': '\u5DDB', - '\u2F2F': '\u5DE5', - '\u2F30': '\u5DF1', - '\u2F31': '\u5DFE', - '\u2F32': '\u5E72', - '\u2F33': '\u5E7A', - '\u2F34': '\u5E7F', - '\u2F35': '\u5EF4', - '\u2F36': '\u5EFE', - '\u2F37': '\u5F0B', - '\u2F38': '\u5F13', - '\u2F39': '\u5F50', - '\u2F3A': '\u5F61', - '\u2F3B': '\u5F73', - '\u2F3C': '\u5FC3', - '\u2F3D': '\u6208', - '\u2F3E': '\u6236', - '\u2F3F': '\u624B', - '\u2F40': '\u652F', - '\u2F41': '\u6534', - '\u2F42': '\u6587', - '\u2F43': '\u6597', - '\u2F44': '\u65A4', - '\u2F45': '\u65B9', - '\u2F46': '\u65E0', - '\u2F47': '\u65E5', - '\u2F48': '\u66F0', - '\u2F49': '\u6708', - '\u2F4A': '\u6728', - '\u2F4B': '\u6B20', - '\u2F4C': '\u6B62', - '\u2F4D': '\u6B79', - '\u2F4E': '\u6BB3', - '\u2F4F': '\u6BCB', - '\u2F50': '\u6BD4', - '\u2F51': '\u6BDB', - '\u2F52': '\u6C0F', - '\u2F53': '\u6C14', - '\u2F54': '\u6C34', - '\u2F55': '\u706B', - '\u2F56': '\u722A', - '\u2F57': '\u7236', - '\u2F58': '\u723B', - '\u2F59': '\u723F', - '\u2F5A': '\u7247', - '\u2F5B': '\u7259', - '\u2F5C': '\u725B', - '\u2F5D': '\u72AC', - '\u2F5E': '\u7384', - '\u2F5F': '\u7389', - '\u2F60': '\u74DC', - '\u2F61': '\u74E6', - '\u2F62': '\u7518', - '\u2F63': '\u751F', - '\u2F64': '\u7528', - '\u2F65': '\u7530', - '\u2F66': '\u758B', - '\u2F67': '\u7592', - '\u2F68': '\u7676', - '\u2F69': '\u767D', - '\u2F6A': '\u76AE', - '\u2F6B': '\u76BF', - '\u2F6C': '\u76EE', - '\u2F6D': '\u77DB', - '\u2F6E': '\u77E2', - '\u2F6F': '\u77F3', - '\u2F70': '\u793A', - '\u2F71': '\u79B8', - '\u2F72': '\u79BE', - '\u2F73': '\u7A74', - '\u2F74': '\u7ACB', - '\u2F75': '\u7AF9', - '\u2F76': '\u7C73', - '\u2F77': '\u7CF8', - '\u2F78': '\u7F36', - '\u2F79': '\u7F51', - '\u2F7A': '\u7F8A', - '\u2F7B': '\u7FBD', - '\u2F7C': '\u8001', - '\u2F7D': '\u800C', - '\u2F7E': '\u8012', - '\u2F7F': '\u8033', - '\u2F80': '\u807F', - '\u2F81': '\u8089', - '\u2F82': '\u81E3', - '\u2F83': '\u81EA', - '\u2F84': '\u81F3', - '\u2F85': '\u81FC', - '\u2F86': '\u820C', - '\u2F87': '\u821B', - '\u2F88': '\u821F', - '\u2F89': '\u826E', - '\u2F8A': '\u8272', - '\u2F8B': '\u8278', - '\u2F8C': '\u864D', - '\u2F8D': '\u866B', - '\u2F8E': '\u8840', - '\u2F8F': '\u884C', - '\u2F90': '\u8863', - '\u2F91': '\u897E', - '\u2F92': '\u898B', - '\u2F93': '\u89D2', - '\u2F94': '\u8A00', - '\u2F95': '\u8C37', - '\u2F96': '\u8C46', - '\u2F97': '\u8C55', - '\u2F98': '\u8C78', - '\u2F99': '\u8C9D', - '\u2F9A': '\u8D64', - '\u2F9B': '\u8D70', - '\u2F9C': '\u8DB3', - '\u2F9D': '\u8EAB', - '\u2F9E': '\u8ECA', - '\u2F9F': '\u8F9B', - '\u2FA0': '\u8FB0', - '\u2FA1': '\u8FB5', - '\u2FA2': '\u9091', - '\u2FA3': '\u9149', - '\u2FA4': '\u91C6', - '\u2FA5': '\u91CC', - '\u2FA6': '\u91D1', - '\u2FA7': '\u9577', - '\u2FA8': '\u9580', - '\u2FA9': '\u961C', - '\u2FAA': '\u96B6', - '\u2FAB': '\u96B9', - '\u2FAC': '\u96E8', - '\u2FAD': '\u9751', - '\u2FAE': '\u975E', - '\u2FAF': '\u9762', - '\u2FB0': '\u9769', - '\u2FB1': '\u97CB', - '\u2FB2': '\u97ED', - '\u2FB3': '\u97F3', - '\u2FB4': '\u9801', - '\u2FB5': '\u98A8', - '\u2FB6': '\u98DB', - '\u2FB7': '\u98DF', - '\u2FB8': '\u9996', - '\u2FB9': '\u9999', - '\u2FBA': '\u99AC', - '\u2FBB': '\u9AA8', - '\u2FBC': '\u9AD8', - '\u2FBD': '\u9ADF', - '\u2FBE': '\u9B25', - '\u2FBF': '\u9B2F', - '\u2FC0': '\u9B32', - '\u2FC1': '\u9B3C', - '\u2FC2': '\u9B5A', - '\u2FC3': '\u9CE5', - '\u2FC4': '\u9E75', - '\u2FC5': '\u9E7F', - '\u2FC6': '\u9EA5', - '\u2FC7': '\u9EBB', - '\u2FC8': '\u9EC3', - '\u2FC9': '\u9ECD', - '\u2FCA': '\u9ED1', - '\u2FCB': '\u9EF9', - '\u2FCC': '\u9EFD', - '\u2FCD': '\u9F0E', - '\u2FCE': '\u9F13', - '\u2FCF': '\u9F20', - '\u2FD0': '\u9F3B', - '\u2FD1': '\u9F4A', - '\u2FD2': '\u9F52', - '\u2FD3': '\u9F8D', - '\u2FD4': '\u9F9C', - '\u2FD5': '\u9FA0', - '\u3036': '\u3012', - '\u3038': '\u5341', - '\u3039': '\u5344', - '\u303A': '\u5345', - '\u309B': '\u0020\u3099', - '\u309C': '\u0020\u309A', - '\u3131': '\u1100', - '\u3132': '\u1101', - '\u3133': '\u11AA', - '\u3134': '\u1102', - '\u3135': '\u11AC', - '\u3136': '\u11AD', - '\u3137': '\u1103', - '\u3138': '\u1104', - '\u3139': '\u1105', - '\u313A': '\u11B0', - '\u313B': '\u11B1', - '\u313C': '\u11B2', - '\u313D': '\u11B3', - '\u313E': '\u11B4', - '\u313F': '\u11B5', - '\u3140': '\u111A', - '\u3141': '\u1106', - '\u3142': '\u1107', - '\u3143': '\u1108', - '\u3144': '\u1121', - '\u3145': '\u1109', - '\u3146': '\u110A', - '\u3147': '\u110B', - '\u3148': '\u110C', - '\u3149': '\u110D', - '\u314A': '\u110E', - '\u314B': '\u110F', - '\u314C': '\u1110', - '\u314D': '\u1111', - '\u314E': '\u1112', - '\u314F': '\u1161', - '\u3150': '\u1162', - '\u3151': '\u1163', - '\u3152': '\u1164', - '\u3153': '\u1165', - '\u3154': '\u1166', - '\u3155': '\u1167', - '\u3156': '\u1168', - '\u3157': '\u1169', - '\u3158': '\u116A', - '\u3159': '\u116B', - '\u315A': '\u116C', - '\u315B': '\u116D', - '\u315C': '\u116E', - '\u315D': '\u116F', - '\u315E': '\u1170', - '\u315F': '\u1171', - '\u3160': '\u1172', - '\u3161': '\u1173', - '\u3162': '\u1174', - '\u3163': '\u1175', - '\u3164': '\u1160', - '\u3165': '\u1114', - '\u3166': '\u1115', - '\u3167': '\u11C7', - '\u3168': '\u11C8', - '\u3169': '\u11CC', - '\u316A': '\u11CE', - '\u316B': '\u11D3', - '\u316C': '\u11D7', - '\u316D': '\u11D9', - '\u316E': '\u111C', - '\u316F': '\u11DD', - '\u3170': '\u11DF', - '\u3171': '\u111D', - '\u3172': '\u111E', - '\u3173': '\u1120', - '\u3174': '\u1122', - '\u3175': '\u1123', - '\u3176': '\u1127', - '\u3177': '\u1129', - '\u3178': '\u112B', - '\u3179': '\u112C', - '\u317A': '\u112D', - '\u317B': '\u112E', - '\u317C': '\u112F', - '\u317D': '\u1132', - '\u317E': '\u1136', - '\u317F': '\u1140', - '\u3180': '\u1147', - '\u3181': '\u114C', - '\u3182': '\u11F1', - '\u3183': '\u11F2', - '\u3184': '\u1157', - '\u3185': '\u1158', - '\u3186': '\u1159', - '\u3187': '\u1184', - '\u3188': '\u1185', - '\u3189': '\u1188', - '\u318A': '\u1191', - '\u318B': '\u1192', - '\u318C': '\u1194', - '\u318D': '\u119E', - '\u318E': '\u11A1', - '\u3200': '\u0028\u1100\u0029', - '\u3201': '\u0028\u1102\u0029', - '\u3202': '\u0028\u1103\u0029', - '\u3203': '\u0028\u1105\u0029', - '\u3204': '\u0028\u1106\u0029', - '\u3205': '\u0028\u1107\u0029', - '\u3206': '\u0028\u1109\u0029', - '\u3207': '\u0028\u110B\u0029', - '\u3208': '\u0028\u110C\u0029', - '\u3209': '\u0028\u110E\u0029', - '\u320A': '\u0028\u110F\u0029', - '\u320B': '\u0028\u1110\u0029', - '\u320C': '\u0028\u1111\u0029', - '\u320D': '\u0028\u1112\u0029', - '\u320E': '\u0028\u1100\u1161\u0029', - '\u320F': '\u0028\u1102\u1161\u0029', - '\u3210': '\u0028\u1103\u1161\u0029', - '\u3211': '\u0028\u1105\u1161\u0029', - '\u3212': '\u0028\u1106\u1161\u0029', - '\u3213': '\u0028\u1107\u1161\u0029', - '\u3214': '\u0028\u1109\u1161\u0029', - '\u3215': '\u0028\u110B\u1161\u0029', - '\u3216': '\u0028\u110C\u1161\u0029', - '\u3217': '\u0028\u110E\u1161\u0029', - '\u3218': '\u0028\u110F\u1161\u0029', - '\u3219': '\u0028\u1110\u1161\u0029', - '\u321A': '\u0028\u1111\u1161\u0029', - '\u321B': '\u0028\u1112\u1161\u0029', - '\u321C': '\u0028\u110C\u116E\u0029', - '\u321D': '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029', - '\u321E': '\u0028\u110B\u1169\u1112\u116E\u0029', - '\u3220': '\u0028\u4E00\u0029', - '\u3221': '\u0028\u4E8C\u0029', - '\u3222': '\u0028\u4E09\u0029', - '\u3223': '\u0028\u56DB\u0029', - '\u3224': '\u0028\u4E94\u0029', - '\u3225': '\u0028\u516D\u0029', - '\u3226': '\u0028\u4E03\u0029', - '\u3227': '\u0028\u516B\u0029', - '\u3228': '\u0028\u4E5D\u0029', - '\u3229': '\u0028\u5341\u0029', - '\u322A': '\u0028\u6708\u0029', - '\u322B': '\u0028\u706B\u0029', - '\u322C': '\u0028\u6C34\u0029', - '\u322D': '\u0028\u6728\u0029', - '\u322E': '\u0028\u91D1\u0029', - '\u322F': '\u0028\u571F\u0029', - '\u3230': '\u0028\u65E5\u0029', - '\u3231': '\u0028\u682A\u0029', - '\u3232': '\u0028\u6709\u0029', - '\u3233': '\u0028\u793E\u0029', - '\u3234': '\u0028\u540D\u0029', - '\u3235': '\u0028\u7279\u0029', - '\u3236': '\u0028\u8CA1\u0029', - '\u3237': '\u0028\u795D\u0029', - '\u3238': '\u0028\u52B4\u0029', - '\u3239': '\u0028\u4EE3\u0029', - '\u323A': '\u0028\u547C\u0029', - '\u323B': '\u0028\u5B66\u0029', - '\u323C': '\u0028\u76E3\u0029', - '\u323D': '\u0028\u4F01\u0029', - '\u323E': '\u0028\u8CC7\u0029', - '\u323F': '\u0028\u5354\u0029', - '\u3240': '\u0028\u796D\u0029', - '\u3241': '\u0028\u4F11\u0029', - '\u3242': '\u0028\u81EA\u0029', - '\u3243': '\u0028\u81F3\u0029', - '\u32C0': '\u0031\u6708', - '\u32C1': '\u0032\u6708', - '\u32C2': '\u0033\u6708', - '\u32C3': '\u0034\u6708', - '\u32C4': '\u0035\u6708', - '\u32C5': '\u0036\u6708', - '\u32C6': '\u0037\u6708', - '\u32C7': '\u0038\u6708', - '\u32C8': '\u0039\u6708', - '\u32C9': '\u0031\u0030\u6708', - '\u32CA': '\u0031\u0031\u6708', - '\u32CB': '\u0031\u0032\u6708', - '\u3358': '\u0030\u70B9', - '\u3359': '\u0031\u70B9', - '\u335A': '\u0032\u70B9', - '\u335B': '\u0033\u70B9', - '\u335C': '\u0034\u70B9', - '\u335D': '\u0035\u70B9', - '\u335E': '\u0036\u70B9', - '\u335F': '\u0037\u70B9', - '\u3360': '\u0038\u70B9', - '\u3361': '\u0039\u70B9', - '\u3362': '\u0031\u0030\u70B9', - '\u3363': '\u0031\u0031\u70B9', - '\u3364': '\u0031\u0032\u70B9', - '\u3365': '\u0031\u0033\u70B9', - '\u3366': '\u0031\u0034\u70B9', - '\u3367': '\u0031\u0035\u70B9', - '\u3368': '\u0031\u0036\u70B9', - '\u3369': '\u0031\u0037\u70B9', - '\u336A': '\u0031\u0038\u70B9', - '\u336B': '\u0031\u0039\u70B9', - '\u336C': '\u0032\u0030\u70B9', - '\u336D': '\u0032\u0031\u70B9', - '\u336E': '\u0032\u0032\u70B9', - '\u336F': '\u0032\u0033\u70B9', - '\u3370': '\u0032\u0034\u70B9', - '\u33E0': '\u0031\u65E5', - '\u33E1': '\u0032\u65E5', - '\u33E2': '\u0033\u65E5', - '\u33E3': '\u0034\u65E5', - '\u33E4': '\u0035\u65E5', - '\u33E5': '\u0036\u65E5', - '\u33E6': '\u0037\u65E5', - '\u33E7': '\u0038\u65E5', - '\u33E8': '\u0039\u65E5', - '\u33E9': '\u0031\u0030\u65E5', - '\u33EA': '\u0031\u0031\u65E5', - '\u33EB': '\u0031\u0032\u65E5', - '\u33EC': '\u0031\u0033\u65E5', - '\u33ED': '\u0031\u0034\u65E5', - '\u33EE': '\u0031\u0035\u65E5', - '\u33EF': '\u0031\u0036\u65E5', - '\u33F0': '\u0031\u0037\u65E5', - '\u33F1': '\u0031\u0038\u65E5', - '\u33F2': '\u0031\u0039\u65E5', - '\u33F3': '\u0032\u0030\u65E5', - '\u33F4': '\u0032\u0031\u65E5', - '\u33F5': '\u0032\u0032\u65E5', - '\u33F6': '\u0032\u0033\u65E5', - '\u33F7': '\u0032\u0034\u65E5', - '\u33F8': '\u0032\u0035\u65E5', - '\u33F9': '\u0032\u0036\u65E5', - '\u33FA': '\u0032\u0037\u65E5', - '\u33FB': '\u0032\u0038\u65E5', - '\u33FC': '\u0032\u0039\u65E5', - '\u33FD': '\u0033\u0030\u65E5', - '\u33FE': '\u0033\u0031\u65E5', - '\uFB00': '\u0066\u0066', - '\uFB01': '\u0066\u0069', - '\uFB02': '\u0066\u006C', - '\uFB03': '\u0066\u0066\u0069', - '\uFB04': '\u0066\u0066\u006C', - '\uFB05': '\u017F\u0074', - '\uFB06': '\u0073\u0074', - '\uFB13': '\u0574\u0576', - '\uFB14': '\u0574\u0565', - '\uFB15': '\u0574\u056B', - '\uFB16': '\u057E\u0576', - '\uFB17': '\u0574\u056D', - '\uFB4F': '\u05D0\u05DC', - '\uFB50': '\u0671', - '\uFB51': '\u0671', - '\uFB52': '\u067B', - '\uFB53': '\u067B', - '\uFB54': '\u067B', - '\uFB55': '\u067B', - '\uFB56': '\u067E', - '\uFB57': '\u067E', - '\uFB58': '\u067E', - '\uFB59': '\u067E', - '\uFB5A': '\u0680', - '\uFB5B': '\u0680', - '\uFB5C': '\u0680', - '\uFB5D': '\u0680', - '\uFB5E': '\u067A', - '\uFB5F': '\u067A', - '\uFB60': '\u067A', - '\uFB61': '\u067A', - '\uFB62': '\u067F', - '\uFB63': '\u067F', - '\uFB64': '\u067F', - '\uFB65': '\u067F', - '\uFB66': '\u0679', - '\uFB67': '\u0679', - '\uFB68': '\u0679', - '\uFB69': '\u0679', - '\uFB6A': '\u06A4', - '\uFB6B': '\u06A4', - '\uFB6C': '\u06A4', - '\uFB6D': '\u06A4', - '\uFB6E': '\u06A6', - '\uFB6F': '\u06A6', - '\uFB70': '\u06A6', - '\uFB71': '\u06A6', - '\uFB72': '\u0684', - '\uFB73': '\u0684', - '\uFB74': '\u0684', - '\uFB75': '\u0684', - '\uFB76': '\u0683', - '\uFB77': '\u0683', - '\uFB78': '\u0683', - '\uFB79': '\u0683', - '\uFB7A': '\u0686', - '\uFB7B': '\u0686', - '\uFB7C': '\u0686', - '\uFB7D': '\u0686', - '\uFB7E': '\u0687', - '\uFB7F': '\u0687', - '\uFB80': '\u0687', - '\uFB81': '\u0687', - '\uFB82': '\u068D', - '\uFB83': '\u068D', - '\uFB84': '\u068C', - '\uFB85': '\u068C', - '\uFB86': '\u068E', - '\uFB87': '\u068E', - '\uFB88': '\u0688', - '\uFB89': '\u0688', - '\uFB8A': '\u0698', - '\uFB8B': '\u0698', - '\uFB8C': '\u0691', - '\uFB8D': '\u0691', - '\uFB8E': '\u06A9', - '\uFB8F': '\u06A9', - '\uFB90': '\u06A9', - '\uFB91': '\u06A9', - '\uFB92': '\u06AF', - '\uFB93': '\u06AF', - '\uFB94': '\u06AF', - '\uFB95': '\u06AF', - '\uFB96': '\u06B3', - '\uFB97': '\u06B3', - '\uFB98': '\u06B3', - '\uFB99': '\u06B3', - '\uFB9A': '\u06B1', - '\uFB9B': '\u06B1', - '\uFB9C': '\u06B1', - '\uFB9D': '\u06B1', - '\uFB9E': '\u06BA', - '\uFB9F': '\u06BA', - '\uFBA0': '\u06BB', - '\uFBA1': '\u06BB', - '\uFBA2': '\u06BB', - '\uFBA3': '\u06BB', - '\uFBA4': '\u06C0', - '\uFBA5': '\u06C0', - '\uFBA6': '\u06C1', - '\uFBA7': '\u06C1', - '\uFBA8': '\u06C1', - '\uFBA9': '\u06C1', - '\uFBAA': '\u06BE', - '\uFBAB': '\u06BE', - '\uFBAC': '\u06BE', - '\uFBAD': '\u06BE', - '\uFBAE': '\u06D2', - '\uFBAF': '\u06D2', - '\uFBB0': '\u06D3', - '\uFBB1': '\u06D3', - '\uFBD3': '\u06AD', - '\uFBD4': '\u06AD', - '\uFBD5': '\u06AD', - '\uFBD6': '\u06AD', - '\uFBD7': '\u06C7', - '\uFBD8': '\u06C7', - '\uFBD9': '\u06C6', - '\uFBDA': '\u06C6', - '\uFBDB': '\u06C8', - '\uFBDC': '\u06C8', - '\uFBDD': '\u0677', - '\uFBDE': '\u06CB', - '\uFBDF': '\u06CB', - '\uFBE0': '\u06C5', - '\uFBE1': '\u06C5', - '\uFBE2': '\u06C9', - '\uFBE3': '\u06C9', - '\uFBE4': '\u06D0', - '\uFBE5': '\u06D0', - '\uFBE6': '\u06D0', - '\uFBE7': '\u06D0', - '\uFBE8': '\u0649', - '\uFBE9': '\u0649', - '\uFBEA': '\u0626\u0627', - '\uFBEB': '\u0626\u0627', - '\uFBEC': '\u0626\u06D5', - '\uFBED': '\u0626\u06D5', - '\uFBEE': '\u0626\u0648', - '\uFBEF': '\u0626\u0648', - '\uFBF0': '\u0626\u06C7', - '\uFBF1': '\u0626\u06C7', - '\uFBF2': '\u0626\u06C6', - '\uFBF3': '\u0626\u06C6', - '\uFBF4': '\u0626\u06C8', - '\uFBF5': '\u0626\u06C8', - '\uFBF6': '\u0626\u06D0', - '\uFBF7': '\u0626\u06D0', - '\uFBF8': '\u0626\u06D0', - '\uFBF9': '\u0626\u0649', - '\uFBFA': '\u0626\u0649', - '\uFBFB': '\u0626\u0649', - '\uFBFC': '\u06CC', - '\uFBFD': '\u06CC', - '\uFBFE': '\u06CC', - '\uFBFF': '\u06CC', - '\uFC00': '\u0626\u062C', - '\uFC01': '\u0626\u062D', - '\uFC02': '\u0626\u0645', - '\uFC03': '\u0626\u0649', - '\uFC04': '\u0626\u064A', - '\uFC05': '\u0628\u062C', - '\uFC06': '\u0628\u062D', - '\uFC07': '\u0628\u062E', - '\uFC08': '\u0628\u0645', - '\uFC09': '\u0628\u0649', - '\uFC0A': '\u0628\u064A', - '\uFC0B': '\u062A\u062C', - '\uFC0C': '\u062A\u062D', - '\uFC0D': '\u062A\u062E', - '\uFC0E': '\u062A\u0645', - '\uFC0F': '\u062A\u0649', - '\uFC10': '\u062A\u064A', - '\uFC11': '\u062B\u062C', - '\uFC12': '\u062B\u0645', - '\uFC13': '\u062B\u0649', - '\uFC14': '\u062B\u064A', - '\uFC15': '\u062C\u062D', - '\uFC16': '\u062C\u0645', - '\uFC17': '\u062D\u062C', - '\uFC18': '\u062D\u0645', - '\uFC19': '\u062E\u062C', - '\uFC1A': '\u062E\u062D', - '\uFC1B': '\u062E\u0645', - '\uFC1C': '\u0633\u062C', - '\uFC1D': '\u0633\u062D', - '\uFC1E': '\u0633\u062E', - '\uFC1F': '\u0633\u0645', - '\uFC20': '\u0635\u062D', - '\uFC21': '\u0635\u0645', - '\uFC22': '\u0636\u062C', - '\uFC23': '\u0636\u062D', - '\uFC24': '\u0636\u062E', - '\uFC25': '\u0636\u0645', - '\uFC26': '\u0637\u062D', - '\uFC27': '\u0637\u0645', - '\uFC28': '\u0638\u0645', - '\uFC29': '\u0639\u062C', - '\uFC2A': '\u0639\u0645', - '\uFC2B': '\u063A\u062C', - '\uFC2C': '\u063A\u0645', - '\uFC2D': '\u0641\u062C', - '\uFC2E': '\u0641\u062D', - '\uFC2F': '\u0641\u062E', - '\uFC30': '\u0641\u0645', - '\uFC31': '\u0641\u0649', - '\uFC32': '\u0641\u064A', - '\uFC33': '\u0642\u062D', - '\uFC34': '\u0642\u0645', - '\uFC35': '\u0642\u0649', - '\uFC36': '\u0642\u064A', - '\uFC37': '\u0643\u0627', - '\uFC38': '\u0643\u062C', - '\uFC39': '\u0643\u062D', - '\uFC3A': '\u0643\u062E', - '\uFC3B': '\u0643\u0644', - '\uFC3C': '\u0643\u0645', - '\uFC3D': '\u0643\u0649', - '\uFC3E': '\u0643\u064A', - '\uFC3F': '\u0644\u062C', - '\uFC40': '\u0644\u062D', - '\uFC41': '\u0644\u062E', - '\uFC42': '\u0644\u0645', - '\uFC43': '\u0644\u0649', - '\uFC44': '\u0644\u064A', - '\uFC45': '\u0645\u062C', - '\uFC46': '\u0645\u062D', - '\uFC47': '\u0645\u062E', - '\uFC48': '\u0645\u0645', - '\uFC49': '\u0645\u0649', - '\uFC4A': '\u0645\u064A', - '\uFC4B': '\u0646\u062C', - '\uFC4C': '\u0646\u062D', - '\uFC4D': '\u0646\u062E', - '\uFC4E': '\u0646\u0645', - '\uFC4F': '\u0646\u0649', - '\uFC50': '\u0646\u064A', - '\uFC51': '\u0647\u062C', - '\uFC52': '\u0647\u0645', - '\uFC53': '\u0647\u0649', - '\uFC54': '\u0647\u064A', - '\uFC55': '\u064A\u062C', - '\uFC56': '\u064A\u062D', - '\uFC57': '\u064A\u062E', - '\uFC58': '\u064A\u0645', - '\uFC59': '\u064A\u0649', - '\uFC5A': '\u064A\u064A', - '\uFC5B': '\u0630\u0670', - '\uFC5C': '\u0631\u0670', - '\uFC5D': '\u0649\u0670', - '\uFC5E': '\u0020\u064C\u0651', - '\uFC5F': '\u0020\u064D\u0651', - '\uFC60': '\u0020\u064E\u0651', - '\uFC61': '\u0020\u064F\u0651', - '\uFC62': '\u0020\u0650\u0651', - '\uFC63': '\u0020\u0651\u0670', - '\uFC64': '\u0626\u0631', - '\uFC65': '\u0626\u0632', - '\uFC66': '\u0626\u0645', - '\uFC67': '\u0626\u0646', - '\uFC68': '\u0626\u0649', - '\uFC69': '\u0626\u064A', - '\uFC6A': '\u0628\u0631', - '\uFC6B': '\u0628\u0632', - '\uFC6C': '\u0628\u0645', - '\uFC6D': '\u0628\u0646', - '\uFC6E': '\u0628\u0649', - '\uFC6F': '\u0628\u064A', - '\uFC70': '\u062A\u0631', - '\uFC71': '\u062A\u0632', - '\uFC72': '\u062A\u0645', - '\uFC73': '\u062A\u0646', - '\uFC74': '\u062A\u0649', - '\uFC75': '\u062A\u064A', - '\uFC76': '\u062B\u0631', - '\uFC77': '\u062B\u0632', - '\uFC78': '\u062B\u0645', - '\uFC79': '\u062B\u0646', - '\uFC7A': '\u062B\u0649', - '\uFC7B': '\u062B\u064A', - '\uFC7C': '\u0641\u0649', - '\uFC7D': '\u0641\u064A', - '\uFC7E': '\u0642\u0649', - '\uFC7F': '\u0642\u064A', - '\uFC80': '\u0643\u0627', - '\uFC81': '\u0643\u0644', - '\uFC82': '\u0643\u0645', - '\uFC83': '\u0643\u0649', - '\uFC84': '\u0643\u064A', - '\uFC85': '\u0644\u0645', - '\uFC86': '\u0644\u0649', - '\uFC87': '\u0644\u064A', - '\uFC88': '\u0645\u0627', - '\uFC89': '\u0645\u0645', - '\uFC8A': '\u0646\u0631', - '\uFC8B': '\u0646\u0632', - '\uFC8C': '\u0646\u0645', - '\uFC8D': '\u0646\u0646', - '\uFC8E': '\u0646\u0649', - '\uFC8F': '\u0646\u064A', - '\uFC90': '\u0649\u0670', - '\uFC91': '\u064A\u0631', - '\uFC92': '\u064A\u0632', - '\uFC93': '\u064A\u0645', - '\uFC94': '\u064A\u0646', - '\uFC95': '\u064A\u0649', - '\uFC96': '\u064A\u064A', - '\uFC97': '\u0626\u062C', - '\uFC98': '\u0626\u062D', - '\uFC99': '\u0626\u062E', - '\uFC9A': '\u0626\u0645', - '\uFC9B': '\u0626\u0647', - '\uFC9C': '\u0628\u062C', - '\uFC9D': '\u0628\u062D', - '\uFC9E': '\u0628\u062E', - '\uFC9F': '\u0628\u0645', - '\uFCA0': '\u0628\u0647', - '\uFCA1': '\u062A\u062C', - '\uFCA2': '\u062A\u062D', - '\uFCA3': '\u062A\u062E', - '\uFCA4': '\u062A\u0645', - '\uFCA5': '\u062A\u0647', - '\uFCA6': '\u062B\u0645', - '\uFCA7': '\u062C\u062D', - '\uFCA8': '\u062C\u0645', - '\uFCA9': '\u062D\u062C', - '\uFCAA': '\u062D\u0645', - '\uFCAB': '\u062E\u062C', - '\uFCAC': '\u062E\u0645', - '\uFCAD': '\u0633\u062C', - '\uFCAE': '\u0633\u062D', - '\uFCAF': '\u0633\u062E', - '\uFCB0': '\u0633\u0645', - '\uFCB1': '\u0635\u062D', - '\uFCB2': '\u0635\u062E', - '\uFCB3': '\u0635\u0645', - '\uFCB4': '\u0636\u062C', - '\uFCB5': '\u0636\u062D', - '\uFCB6': '\u0636\u062E', - '\uFCB7': '\u0636\u0645', - '\uFCB8': '\u0637\u062D', - '\uFCB9': '\u0638\u0645', - '\uFCBA': '\u0639\u062C', - '\uFCBB': '\u0639\u0645', - '\uFCBC': '\u063A\u062C', - '\uFCBD': '\u063A\u0645', - '\uFCBE': '\u0641\u062C', - '\uFCBF': '\u0641\u062D', - '\uFCC0': '\u0641\u062E', - '\uFCC1': '\u0641\u0645', - '\uFCC2': '\u0642\u062D', - '\uFCC3': '\u0642\u0645', - '\uFCC4': '\u0643\u062C', - '\uFCC5': '\u0643\u062D', - '\uFCC6': '\u0643\u062E', - '\uFCC7': '\u0643\u0644', - '\uFCC8': '\u0643\u0645', - '\uFCC9': '\u0644\u062C', - '\uFCCA': '\u0644\u062D', - '\uFCCB': '\u0644\u062E', - '\uFCCC': '\u0644\u0645', - '\uFCCD': '\u0644\u0647', - '\uFCCE': '\u0645\u062C', - '\uFCCF': '\u0645\u062D', - '\uFCD0': '\u0645\u062E', - '\uFCD1': '\u0645\u0645', - '\uFCD2': '\u0646\u062C', - '\uFCD3': '\u0646\u062D', - '\uFCD4': '\u0646\u062E', - '\uFCD5': '\u0646\u0645', - '\uFCD6': '\u0646\u0647', - '\uFCD7': '\u0647\u062C', - '\uFCD8': '\u0647\u0645', - '\uFCD9': '\u0647\u0670', - '\uFCDA': '\u064A\u062C', - '\uFCDB': '\u064A\u062D', - '\uFCDC': '\u064A\u062E', - '\uFCDD': '\u064A\u0645', - '\uFCDE': '\u064A\u0647', - '\uFCDF': '\u0626\u0645', - '\uFCE0': '\u0626\u0647', - '\uFCE1': '\u0628\u0645', - '\uFCE2': '\u0628\u0647', - '\uFCE3': '\u062A\u0645', - '\uFCE4': '\u062A\u0647', - '\uFCE5': '\u062B\u0645', - '\uFCE6': '\u062B\u0647', - '\uFCE7': '\u0633\u0645', - '\uFCE8': '\u0633\u0647', - '\uFCE9': '\u0634\u0645', - '\uFCEA': '\u0634\u0647', - '\uFCEB': '\u0643\u0644', - '\uFCEC': '\u0643\u0645', - '\uFCED': '\u0644\u0645', - '\uFCEE': '\u0646\u0645', - '\uFCEF': '\u0646\u0647', - '\uFCF0': '\u064A\u0645', - '\uFCF1': '\u064A\u0647', - '\uFCF2': '\u0640\u064E\u0651', - '\uFCF3': '\u0640\u064F\u0651', - '\uFCF4': '\u0640\u0650\u0651', - '\uFCF5': '\u0637\u0649', - '\uFCF6': '\u0637\u064A', - '\uFCF7': '\u0639\u0649', - '\uFCF8': '\u0639\u064A', - '\uFCF9': '\u063A\u0649', - '\uFCFA': '\u063A\u064A', - '\uFCFB': '\u0633\u0649', - '\uFCFC': '\u0633\u064A', - '\uFCFD': '\u0634\u0649', - '\uFCFE': '\u0634\u064A', - '\uFCFF': '\u062D\u0649', - '\uFD00': '\u062D\u064A', - '\uFD01': '\u062C\u0649', - '\uFD02': '\u062C\u064A', - '\uFD03': '\u062E\u0649', - '\uFD04': '\u062E\u064A', - '\uFD05': '\u0635\u0649', - '\uFD06': '\u0635\u064A', - '\uFD07': '\u0636\u0649', - '\uFD08': '\u0636\u064A', - '\uFD09': '\u0634\u062C', - '\uFD0A': '\u0634\u062D', - '\uFD0B': '\u0634\u062E', - '\uFD0C': '\u0634\u0645', - '\uFD0D': '\u0634\u0631', - '\uFD0E': '\u0633\u0631', - '\uFD0F': '\u0635\u0631', - '\uFD10': '\u0636\u0631', - '\uFD11': '\u0637\u0649', - '\uFD12': '\u0637\u064A', - '\uFD13': '\u0639\u0649', - '\uFD14': '\u0639\u064A', - '\uFD15': '\u063A\u0649', - '\uFD16': '\u063A\u064A', - '\uFD17': '\u0633\u0649', - '\uFD18': '\u0633\u064A', - '\uFD19': '\u0634\u0649', - '\uFD1A': '\u0634\u064A', - '\uFD1B': '\u062D\u0649', - '\uFD1C': '\u062D\u064A', - '\uFD1D': '\u062C\u0649', - '\uFD1E': '\u062C\u064A', - '\uFD1F': '\u062E\u0649', - '\uFD20': '\u062E\u064A', - '\uFD21': '\u0635\u0649', - '\uFD22': '\u0635\u064A', - '\uFD23': '\u0636\u0649', - '\uFD24': '\u0636\u064A', - '\uFD25': '\u0634\u062C', - '\uFD26': '\u0634\u062D', - '\uFD27': '\u0634\u062E', - '\uFD28': '\u0634\u0645', - '\uFD29': '\u0634\u0631', - '\uFD2A': '\u0633\u0631', - '\uFD2B': '\u0635\u0631', - '\uFD2C': '\u0636\u0631', - '\uFD2D': '\u0634\u062C', - '\uFD2E': '\u0634\u062D', - '\uFD2F': '\u0634\u062E', - '\uFD30': '\u0634\u0645', - '\uFD31': '\u0633\u0647', - '\uFD32': '\u0634\u0647', - '\uFD33': '\u0637\u0645', - '\uFD34': '\u0633\u062C', - '\uFD35': '\u0633\u062D', - '\uFD36': '\u0633\u062E', - '\uFD37': '\u0634\u062C', - '\uFD38': '\u0634\u062D', - '\uFD39': '\u0634\u062E', - '\uFD3A': '\u0637\u0645', - '\uFD3B': '\u0638\u0645', - '\uFD3C': '\u0627\u064B', - '\uFD3D': '\u0627\u064B', - '\uFD50': '\u062A\u062C\u0645', - '\uFD51': '\u062A\u062D\u062C', - '\uFD52': '\u062A\u062D\u062C', - '\uFD53': '\u062A\u062D\u0645', - '\uFD54': '\u062A\u062E\u0645', - '\uFD55': '\u062A\u0645\u062C', - '\uFD56': '\u062A\u0645\u062D', - '\uFD57': '\u062A\u0645\u062E', - '\uFD58': '\u062C\u0645\u062D', - '\uFD59': '\u062C\u0645\u062D', - '\uFD5A': '\u062D\u0645\u064A', - '\uFD5B': '\u062D\u0645\u0649', - '\uFD5C': '\u0633\u062D\u062C', - '\uFD5D': '\u0633\u062C\u062D', - '\uFD5E': '\u0633\u062C\u0649', - '\uFD5F': '\u0633\u0645\u062D', - '\uFD60': '\u0633\u0645\u062D', - '\uFD61': '\u0633\u0645\u062C', - '\uFD62': '\u0633\u0645\u0645', - '\uFD63': '\u0633\u0645\u0645', - '\uFD64': '\u0635\u062D\u062D', - '\uFD65': '\u0635\u062D\u062D', - '\uFD66': '\u0635\u0645\u0645', - '\uFD67': '\u0634\u062D\u0645', - '\uFD68': '\u0634\u062D\u0645', - '\uFD69': '\u0634\u062C\u064A', - '\uFD6A': '\u0634\u0645\u062E', - '\uFD6B': '\u0634\u0645\u062E', - '\uFD6C': '\u0634\u0645\u0645', - '\uFD6D': '\u0634\u0645\u0645', - '\uFD6E': '\u0636\u062D\u0649', - '\uFD6F': '\u0636\u062E\u0645', - '\uFD70': '\u0636\u062E\u0645', - '\uFD71': '\u0637\u0645\u062D', - '\uFD72': '\u0637\u0645\u062D', - '\uFD73': '\u0637\u0645\u0645', - '\uFD74': '\u0637\u0645\u064A', - '\uFD75': '\u0639\u062C\u0645', - '\uFD76': '\u0639\u0645\u0645', - '\uFD77': '\u0639\u0645\u0645', - '\uFD78': '\u0639\u0645\u0649', - '\uFD79': '\u063A\u0645\u0645', - '\uFD7A': '\u063A\u0645\u064A', - '\uFD7B': '\u063A\u0645\u0649', - '\uFD7C': '\u0641\u062E\u0645', - '\uFD7D': '\u0641\u062E\u0645', - '\uFD7E': '\u0642\u0645\u062D', - '\uFD7F': '\u0642\u0645\u0645', - '\uFD80': '\u0644\u062D\u0645', - '\uFD81': '\u0644\u062D\u064A', - '\uFD82': '\u0644\u062D\u0649', - '\uFD83': '\u0644\u062C\u062C', - '\uFD84': '\u0644\u062C\u062C', - '\uFD85': '\u0644\u062E\u0645', - '\uFD86': '\u0644\u062E\u0645', - '\uFD87': '\u0644\u0645\u062D', - '\uFD88': '\u0644\u0645\u062D', - '\uFD89': '\u0645\u062D\u062C', - '\uFD8A': '\u0645\u062D\u0645', - '\uFD8B': '\u0645\u062D\u064A', - '\uFD8C': '\u0645\u062C\u062D', - '\uFD8D': '\u0645\u062C\u0645', - '\uFD8E': '\u0645\u062E\u062C', - '\uFD8F': '\u0645\u062E\u0645', - '\uFD92': '\u0645\u062C\u062E', - '\uFD93': '\u0647\u0645\u062C', - '\uFD94': '\u0647\u0645\u0645', - '\uFD95': '\u0646\u062D\u0645', - '\uFD96': '\u0646\u062D\u0649', - '\uFD97': '\u0646\u062C\u0645', - '\uFD98': '\u0646\u062C\u0645', - '\uFD99': '\u0646\u062C\u0649', - '\uFD9A': '\u0646\u0645\u064A', - '\uFD9B': '\u0646\u0645\u0649', - '\uFD9C': '\u064A\u0645\u0645', - '\uFD9D': '\u064A\u0645\u0645', - '\uFD9E': '\u0628\u062E\u064A', - '\uFD9F': '\u062A\u062C\u064A', - '\uFDA0': '\u062A\u062C\u0649', - '\uFDA1': '\u062A\u062E\u064A', - '\uFDA2': '\u062A\u062E\u0649', - '\uFDA3': '\u062A\u0645\u064A', - '\uFDA4': '\u062A\u0645\u0649', - '\uFDA5': '\u062C\u0645\u064A', - '\uFDA6': '\u062C\u062D\u0649', - '\uFDA7': '\u062C\u0645\u0649', - '\uFDA8': '\u0633\u062E\u0649', - '\uFDA9': '\u0635\u062D\u064A', - '\uFDAA': '\u0634\u062D\u064A', - '\uFDAB': '\u0636\u062D\u064A', - '\uFDAC': '\u0644\u062C\u064A', - '\uFDAD': '\u0644\u0645\u064A', - '\uFDAE': '\u064A\u062D\u064A', - '\uFDAF': '\u064A\u062C\u064A', - '\uFDB0': '\u064A\u0645\u064A', - '\uFDB1': '\u0645\u0645\u064A', - '\uFDB2': '\u0642\u0645\u064A', - '\uFDB3': '\u0646\u062D\u064A', - '\uFDB4': '\u0642\u0645\u062D', - '\uFDB5': '\u0644\u062D\u0645', - '\uFDB6': '\u0639\u0645\u064A', - '\uFDB7': '\u0643\u0645\u064A', - '\uFDB8': '\u0646\u062C\u062D', - '\uFDB9': '\u0645\u062E\u064A', - '\uFDBA': '\u0644\u062C\u0645', - '\uFDBB': '\u0643\u0645\u0645', - '\uFDBC': '\u0644\u062C\u0645', - '\uFDBD': '\u0646\u062C\u062D', - '\uFDBE': '\u062C\u062D\u064A', - '\uFDBF': '\u062D\u062C\u064A', - '\uFDC0': '\u0645\u062C\u064A', - '\uFDC1': '\u0641\u0645\u064A', - '\uFDC2': '\u0628\u062D\u064A', - '\uFDC3': '\u0643\u0645\u0645', - '\uFDC4': '\u0639\u062C\u0645', - '\uFDC5': '\u0635\u0645\u0645', - '\uFDC6': '\u0633\u062E\u064A', - '\uFDC7': '\u0646\u062C\u064A', - '\uFE49': '\u203E', - '\uFE4A': '\u203E', - '\uFE4B': '\u203E', - '\uFE4C': '\u203E', - '\uFE4D': '\u005F', - '\uFE4E': '\u005F', - '\uFE4F': '\u005F', - '\uFE80': '\u0621', - '\uFE81': '\u0622', - '\uFE82': '\u0622', - '\uFE83': '\u0623', - '\uFE84': '\u0623', - '\uFE85': '\u0624', - '\uFE86': '\u0624', - '\uFE87': '\u0625', - '\uFE88': '\u0625', - '\uFE89': '\u0626', - '\uFE8A': '\u0626', - '\uFE8B': '\u0626', - '\uFE8C': '\u0626', - '\uFE8D': '\u0627', - '\uFE8E': '\u0627', - '\uFE8F': '\u0628', - '\uFE90': '\u0628', - '\uFE91': '\u0628', - '\uFE92': '\u0628', - '\uFE93': '\u0629', - '\uFE94': '\u0629', - '\uFE95': '\u062A', - '\uFE96': '\u062A', - '\uFE97': '\u062A', - '\uFE98': '\u062A', - '\uFE99': '\u062B', - '\uFE9A': '\u062B', - '\uFE9B': '\u062B', - '\uFE9C': '\u062B', - '\uFE9D': '\u062C', - '\uFE9E': '\u062C', - '\uFE9F': '\u062C', - '\uFEA0': '\u062C', - '\uFEA1': '\u062D', - '\uFEA2': '\u062D', - '\uFEA3': '\u062D', - '\uFEA4': '\u062D', - '\uFEA5': '\u062E', - '\uFEA6': '\u062E', - '\uFEA7': '\u062E', - '\uFEA8': '\u062E', - '\uFEA9': '\u062F', - '\uFEAA': '\u062F', - '\uFEAB': '\u0630', - '\uFEAC': '\u0630', - '\uFEAD': '\u0631', - '\uFEAE': '\u0631', - '\uFEAF': '\u0632', - '\uFEB0': '\u0632', - '\uFEB1': '\u0633', - '\uFEB2': '\u0633', - '\uFEB3': '\u0633', - '\uFEB4': '\u0633', - '\uFEB5': '\u0634', - '\uFEB6': '\u0634', - '\uFEB7': '\u0634', - '\uFEB8': '\u0634', - '\uFEB9': '\u0635', - '\uFEBA': '\u0635', - '\uFEBB': '\u0635', - '\uFEBC': '\u0635', - '\uFEBD': '\u0636', - '\uFEBE': '\u0636', - '\uFEBF': '\u0636', - '\uFEC0': '\u0636', - '\uFEC1': '\u0637', - '\uFEC2': '\u0637', - '\uFEC3': '\u0637', - '\uFEC4': '\u0637', - '\uFEC5': '\u0638', - '\uFEC6': '\u0638', - '\uFEC7': '\u0638', - '\uFEC8': '\u0638', - '\uFEC9': '\u0639', - '\uFECA': '\u0639', - '\uFECB': '\u0639', - '\uFECC': '\u0639', - '\uFECD': '\u063A', - '\uFECE': '\u063A', - '\uFECF': '\u063A', - '\uFED0': '\u063A', - '\uFED1': '\u0641', - '\uFED2': '\u0641', - '\uFED3': '\u0641', - '\uFED4': '\u0641', - '\uFED5': '\u0642', - '\uFED6': '\u0642', - '\uFED7': '\u0642', - '\uFED8': '\u0642', - '\uFED9': '\u0643', - '\uFEDA': '\u0643', - '\uFEDB': '\u0643', - '\uFEDC': '\u0643', - '\uFEDD': '\u0644', - '\uFEDE': '\u0644', - '\uFEDF': '\u0644', - '\uFEE0': '\u0644', - '\uFEE1': '\u0645', - '\uFEE2': '\u0645', - '\uFEE3': '\u0645', - '\uFEE4': '\u0645', - '\uFEE5': '\u0646', - '\uFEE6': '\u0646', - '\uFEE7': '\u0646', - '\uFEE8': '\u0646', - '\uFEE9': '\u0647', - '\uFEEA': '\u0647', - '\uFEEB': '\u0647', - '\uFEEC': '\u0647', - '\uFEED': '\u0648', - '\uFEEE': '\u0648', - '\uFEEF': '\u0649', - '\uFEF0': '\u0649', - '\uFEF1': '\u064A', - '\uFEF2': '\u064A', - '\uFEF3': '\u064A', - '\uFEF4': '\u064A', - '\uFEF5': '\u0644\u0622', - '\uFEF6': '\u0644\u0622', - '\uFEF7': '\u0644\u0623', - '\uFEF8': '\u0644\u0623', - '\uFEF9': '\u0644\u0625', - '\uFEFA': '\u0644\u0625', - '\uFEFB': '\u0644\u0627', - '\uFEFC': '\u0644\u0627' -}; - -function reverseIfRtl(chars) { - var charsLength = chars.length; - //reverse an arabic ligature - if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { - return chars; - } - var s = ''; - for (var ii = charsLength - 1; ii >= 0; ii--) { - s += chars[ii]; - } - return s; -} - -function adjustWidths(properties) { - if (!properties.fontMatrix) { - return; - } - if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { - return; - } - // adjusting width to fontMatrix scale - var scale = 0.001 / properties.fontMatrix[0]; - var glyphsWidths = properties.widths; - for (var glyph in glyphsWidths) { - glyphsWidths[glyph] *= scale; - } - properties.defaultWidth *= scale; -} - -function getFontType(type, subtype) { - switch (type) { - case 'Type1': - return subtype === 'Type1C' ? FontType.TYPE1C : FontType.TYPE1; - case 'CIDFontType0': - return subtype === 'CIDFontType0C' ? FontType.CIDFONTTYPE0C : - FontType.CIDFONTTYPE0; - case 'OpenType': - return FontType.OPENTYPE; - case 'TrueType': - return FontType.TRUETYPE; - case 'CIDFontType2': - return FontType.CIDFONTTYPE2; - case 'MMType1': - return FontType.MMTYPE1; - case 'Type0': - return FontType.TYPE0; - default: - return FontType.UNKNOWN; - } -} - -var Glyph = (function GlyphClosure() { - function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, - isSpace) { - this.fontChar = fontChar; - this.unicode = unicode; - this.accent = accent; - this.width = width; - this.vmetric = vmetric; - this.operatorListId = operatorListId; - this.isSpace = isSpace; - } - - Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, - vmetric, operatorListId, isSpace) { - return this.fontChar === fontChar && - this.unicode === unicode && - this.accent === accent && - this.width === width && - this.vmetric === vmetric && - this.operatorListId === operatorListId && - this.isSpace === isSpace; - }; - - return Glyph; -})(); - -var ToUnicodeMap = (function ToUnicodeMapClosure() { - function ToUnicodeMap(cmap) { - // The elements of this._map can be integers or strings, depending on how - // |cmap| was created. - this._map = cmap; - } - - ToUnicodeMap.prototype = { - get length() { - return this._map.length; - }, - - forEach: function(callback) { - for (var charCode in this._map) { - callback(charCode, this._map[charCode].charCodeAt(0)); - } - }, - - has: function(i) { - return this._map[i] !== undefined; - }, - - get: function(i) { - return this._map[i]; - }, - - charCodeOf: function(v) { - return this._map.indexOf(v); - } - }; - - return ToUnicodeMap; -})(); - -var IdentityToUnicodeMap = (function IdentityToUnicodeMapClosure() { - function IdentityToUnicodeMap(firstChar, lastChar) { - this.firstChar = firstChar; - this.lastChar = lastChar; - } - - IdentityToUnicodeMap.prototype = { - get length() { - return (this.lastChar + 1) - this.firstChar; - }, - - forEach: function (callback) { - for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { - callback(i, i); - } - }, - - has: function (i) { - return this.firstChar <= i && i <= this.lastChar; - }, - - get: function (i) { - if (this.firstChar <= i && i <= this.lastChar) { - return String.fromCharCode(i); - } - return undefined; - }, - - charCodeOf: function (v) { - return (isInt(v) && v >= this.firstChar && v <= this.lastChar) ? v : -1; - } - }; - - return IdentityToUnicodeMap; -})(); - -var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() { - function writeInt16(dest, offset, num) { - dest[offset] = (num >> 8) & 0xFF; - dest[offset + 1] = num & 0xFF; - } - - function writeInt32(dest, offset, num) { - dest[offset] = (num >> 24) & 0xFF; - dest[offset + 1] = (num >> 16) & 0xFF; - dest[offset + 2] = (num >> 8) & 0xFF; - dest[offset + 3] = num & 0xFF; - } - - function writeData(dest, offset, data) { - var i, ii; - if (data instanceof Uint8Array) { - dest.set(data, offset); - } else if (typeof data === 'string') { - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data.charCodeAt(i) & 0xFF; - } - } else { - // treating everything else as array - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data[i] & 0xFF; - } - } - } - - function OpenTypeFileBuilder(sfnt) { - this.sfnt = sfnt; - this.tables = Object.create(null); - } - - OpenTypeFileBuilder.getSearchParams = - function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { - var maxPower2 = 1, log2 = 0; - while ((maxPower2 ^ entriesCount) > maxPower2) { - maxPower2 <<= 1; - log2++; - } - var searchRange = maxPower2 * entrySize; - return { - range: searchRange, - entry: log2, - rangeShift: entrySize * entriesCount - searchRange - }; - }; - - var OTF_HEADER_SIZE = 12; - var OTF_TABLE_ENTRY_SIZE = 16; - - OpenTypeFileBuilder.prototype = { - toArray: function OpenTypeFileBuilder_toArray() { - var sfnt = this.sfnt; - - // Tables needs to be written by ascendant alphabetic order - var tables = this.tables; - var tablesNames = Object.keys(tables); - tablesNames.sort(); - var numTables = tablesNames.length; - - var i, j, jj, table, tableName; - // layout the tables data - var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; - var tableOffsets = [offset]; - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - var paddedLength = ((table.length + 3) & ~3) >>> 0; - offset += paddedLength; - tableOffsets.push(offset); - } - - var file = new Uint8Array(offset); - // write the table data first (mostly for checksum) - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - writeData(file, tableOffsets[i], table); - } - - // sfnt version (4 bytes) - if (sfnt === 'true') { - // Windows hates the Mac TrueType sfnt version number - sfnt = string32(0x00010000); - } - file[0] = sfnt.charCodeAt(0) & 0xFF; - file[1] = sfnt.charCodeAt(1) & 0xFF; - file[2] = sfnt.charCodeAt(2) & 0xFF; - file[3] = sfnt.charCodeAt(3) & 0xFF; - - // numTables (2 bytes) - writeInt16(file, 4, numTables); - - var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); - - // searchRange (2 bytes) - writeInt16(file, 6, searchParams.range); - // entrySelector (2 bytes) - writeInt16(file, 8, searchParams.entry); - // rangeShift (2 bytes) - writeInt16(file, 10, searchParams.rangeShift); - - offset = OTF_HEADER_SIZE; - // writing table entries - for (i = 0; i < numTables; i++) { - tableName = tablesNames[i]; - file[offset] = tableName.charCodeAt(0) & 0xFF; - file[offset + 1] = tableName.charCodeAt(1) & 0xFF; - file[offset + 2] = tableName.charCodeAt(2) & 0xFF; - file[offset + 3] = tableName.charCodeAt(3) & 0xFF; - - // checksum - var checksum = 0; - for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { - var quad = (file[j] << 24) + (file[j + 1] << 16) + - (file[j + 2] << 8) + file[j + 3]; - checksum = (checksum + quad) | 0; - } - writeInt32(file, offset + 4, checksum); - - // offset - writeInt32(file, offset + 8, tableOffsets[i]); - // length - writeInt32(file, offset + 12, tables[tableName].length); - - offset += OTF_TABLE_ENTRY_SIZE; - } - return file; - }, - - addTable: function OpenTypeFileBuilder_addTable(tag, data) { - if (tag in this.tables) { - throw new Error('Table ' + tag + ' already exists'); - } - this.tables[tag] = data; - } - }; - - return OpenTypeFileBuilder; -})(); - -// Problematic Unicode characters in the fonts that needs to be moved to avoid -// issues when they are painted on the canvas, e.g. complex-script shaping or -// control/whitespace characters. The ranges are listed in pairs: the first item -// is a code of the first problematic code, the second one is the next -// non-problematic code. The ranges must be in sorted order. -var ProblematicCharRanges = new Int32Array([ - // Control characters. - 0x0000, 0x0020, - 0x007F, 0x00A1, - 0x00AD, 0x00AE, - // Chars that is used in complex-script shaping. - 0x0600, 0x0780, - 0x08A0, 0x10A0, - 0x1780, 0x1800, - // General punctuation chars. - 0x2000, 0x2010, - 0x2011, 0x2012, - 0x2028, 0x2030, - 0x205F, 0x2070, - 0x25CC, 0x25CD, - // Chars that is used in complex-script shaping. - 0xAA60, 0xAA80, - // Specials Unicode block. - 0xFFF0, 0x10000 -]); - -/** - * 'Font' is the class the outside world should use, it encapsulate all the font - * decoding logics whatever type it is (assuming the font type is supported). - * - * For example to read a Type1 font and to attach it to the document: - * var type1Font = new Font("MyFontName", binaryFile, propertiesObject); - * type1Font.bind(); - */ -var Font = (function FontClosure() { - function Font(name, file, properties) { - var charCode, glyphName, fontChar; - - this.name = name; - this.loadedName = properties.loadedName; - this.isType3Font = properties.isType3Font; - this.sizes = []; - - this.glyphCache = {}; - - var names = name.split('+'); - names = names.length > 1 ? names[1] : names[0]; - names = names.split(/[-,_]/g)[0]; - this.isSerifFont = !!(properties.flags & FontFlags.Serif); - this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); - this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); - - var type = properties.type; - var subtype = properties.subtype; - this.type = type; - - this.fallbackName = (this.isMonospace ? 'monospace' : - (this.isSerifFont ? 'serif' : 'sans-serif')); - - this.differences = properties.differences; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.composite = properties.composite; - this.wideChars = properties.wideChars; - this.cMap = properties.cMap; - this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; - this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; - this.fontMatrix = properties.fontMatrix; - this.bbox = properties.bbox; - - this.toUnicode = properties.toUnicode = this.buildToUnicode(properties); - - this.toFontChar = []; - - if (properties.type === 'Type3') { - for (charCode = 0; charCode < 256; charCode++) { - this.toFontChar[charCode] = (this.differences[charCode] || - properties.defaultEncoding[charCode]); - } - this.fontType = FontType.TYPE3; - return; - } - - this.cidEncoding = properties.cidEncoding; - this.vertical = properties.vertical; - if (this.vertical) { - this.vmetrics = properties.vmetrics; - this.defaultVMetrics = properties.defaultVMetrics; - } - - if (!file || file.isEmpty) { - if (file) { - // Some bad PDF generators will include empty font files, - // attempting to recover by assuming that no file exists. - warn('Font file is empty in "' + name + '" (' + this.loadedName + ')'); - } - - this.missingFile = true; - // The file data is not specified. Trying to fix the font name - // to be used with the canvas.font. - var fontName = name.replace(/[,_]/g, '-'); - var isStandardFont = !!stdFontMap[fontName] || - !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); - fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; - - this.bold = (fontName.search(/bold/gi) !== -1); - this.italic = ((fontName.search(/oblique/gi) !== -1) || - (fontName.search(/italic/gi) !== -1)); - - // Use 'name' instead of 'fontName' here because the original - // name ArialBlack for example will be replaced by Helvetica. - this.black = (name.search(/Black/g) !== -1); - - // if at least one width is present, remeasure all chars when exists - this.remeasure = Object.keys(this.widths).length > 0; - if (isStandardFont && type === 'CIDFontType2' && - properties.cidEncoding.indexOf('Identity-') === 0) { - // Standard fonts might be embedded as CID font without glyph mapping. - // Building one based on GlyphMapForStandardFonts. - var map = []; - for (charCode in GlyphMapForStandardFonts) { - map[+charCode] = GlyphMapForStandardFonts[charCode]; - } - if (/ArialBlack/i.test(name)) { - for (charCode in SupplementalGlyphMapForArialBlack) { - map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; - } - } - var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; - if (!isIdentityUnicode) { - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - map[+charCode] = unicodeCharCode; - }); - } - this.toFontChar = map; - this.toUnicode = new ToUnicodeMap(map); - } else if (/Symbol/i.test(fontName)) { - var symbols = Encodings.SymbolSetEncoding; - for (charCode in symbols) { - fontChar = GlyphsUnicode[symbols[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = GlyphsUnicode[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - } else if (/Dingbats/i.test(fontName)) { - if (/Wingdings/i.test(name)) { - warn('Wingdings font without embedded font file, ' + - 'falling back to the ZapfDingbats encoding.'); - } - var dingbats = Encodings.ZapfDingbatsEncoding; - for (charCode in dingbats) { - fontChar = DingbatsGlyphsUnicode[dingbats[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = DingbatsGlyphsUnicode[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - } else if (isStandardFont) { - this.toFontChar = []; - for (charCode in properties.defaultEncoding) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - this.toFontChar[charCode] = GlyphsUnicode[glyphName]; - } - } else { - var unicodeCharCode, notCidFont = (type.indexOf('CIDFontType') === -1); - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - if (notCidFont) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - unicodeCharCode = (GlyphsUnicode[glyphName] || unicodeCharCode); - } - this.toFontChar[charCode] = unicodeCharCode; - }.bind(this)); - } - this.loadedName = fontName.split('-')[0]; - this.loading = false; - this.fontType = getFontType(type, subtype); - return; - } - - // Some fonts might use wrong font types for Type1C or CIDFontType0C - if (subtype === 'Type1C' && (type !== 'Type1' && type !== 'MMType1')) { - // Some TrueType fonts by mistake claim Type1C - if (isTrueTypeFile(file)) { - subtype = 'TrueType'; - } else { - type = 'Type1'; - } - } - if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { - type = 'CIDFontType0'; - } - if (subtype === 'OpenType') { - type = 'OpenType'; - } - // Some CIDFontType0C fonts by mistake claim CIDFontType0. - if (type === 'CIDFontType0') { - if (isType1File(file)) { - subtype = 'CIDFontType0'; - } else if (isOpenTypeFile(file)) { - // Sometimes the type/subtype can be a complete lie (see issue6782.pdf). - type = subtype = 'OpenType'; - } else { - subtype = 'CIDFontType0C'; - } - } - - var data; - switch (type) { - case 'MMType1': - info('MMType1 font (' + name + '), falling back to Type1.'); - /* falls through */ - case 'Type1': - case 'CIDFontType0': - this.mimetype = 'font/opentype'; - - var cff = (subtype === 'Type1C' || subtype === 'CIDFontType0C') ? - new CFFFont(file, properties) : new Type1Font(name, file, properties); - - adjustWidths(properties); - - // Wrap the CFF data inside an OTF font file - data = this.convert(name, cff, properties); - break; - - case 'OpenType': - case 'TrueType': - case 'CIDFontType2': - this.mimetype = 'font/opentype'; - - // Repair the TrueType file. It is can be damaged in the point of - // view of the sanitizer - data = this.checkAndRepair(name, file, properties); - if (this.isOpenType) { - adjustWidths(properties); - - type = 'OpenType'; - } - break; - - default: - error('Font ' + type + ' is not supported'); - break; - } - - this.data = data; - this.fontType = getFontType(type, subtype); - - // Transfer some properties again that could change during font conversion - this.fontMatrix = properties.fontMatrix; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.encoding = properties.baseEncoding; - this.seacMap = properties.seacMap; - - this.loading = true; - } - - Font.getFontID = (function () { - var ID = 1; - return function Font_getFontID() { - return String(ID++); - }; - })(); - - function int16(b0, b1) { - return (b0 << 8) + b1; - } - - function int32(b0, b1, b2, b3) { - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - } - - function string16(value) { - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function safeString16(value) { - // clamp value to the 16-bit int range - value = (value > 0x7FFF ? 0x7FFF : (value < -0x8000 ? -0x8000 : value)); - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function isTrueTypeFile(file) { - var header = file.peekBytes(4); - return readUint32(header, 0) === 0x00010000; - } - - function isOpenTypeFile(file) { - var header = file.peekBytes(4); - return bytesToString(header) === 'OTTO'; - } - - function isType1File(file) { - var header = file.peekBytes(2); - // All Type1 font programs must begin with the comment '%!' (0x25 + 0x21). - if (header[0] === 0x25 && header[1] === 0x21) { - return true; - } - // ... obviously some fonts violate that part of the specification, - // please refer to the comment in |Type1Font| below. - if (header[0] === 0x80 && header[1] === 0x01) { // pfb file header. - return true; - } - return false; - } - - /** - * Helper function for |adjustMapping|. - * @return {boolean} - */ - function isProblematicUnicodeLocation(code) { - // Using binary search to find a range start. - var i = 0, j = ProblematicCharRanges.length - 1; - while (i < j) { - var c = (i + j + 1) >> 1; - if (code < ProblematicCharRanges[c]) { - j = c - 1; - } else { - i = c; - } - } - // Even index means code in problematic range. - return !(i & 1); - } - - /** - * Rebuilds the char code to glyph ID map by trying to replace the char codes - * with their unicode value. It also moves char codes that are in known - * problematic locations. - * @return {Object} Two properties: - * 'toFontChar' - maps original char codes(the value that will be read - * from commands such as show text) to the char codes that will be used in the - * font that we build - * 'charCodeToGlyphId' - maps the new font char codes to glyph ids - */ - function adjustMapping(charCodeToGlyphId, properties) { - var toUnicode = properties.toUnicode; - var isSymbolic = !!(properties.flags & FontFlags.Symbolic); - var isIdentityUnicode = - properties.toUnicode instanceof IdentityToUnicodeMap; - var newMap = Object.create(null); - var toFontChar = []; - var usedFontCharCodes = []; - var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; - for (var originalCharCode in charCodeToGlyphId) { - originalCharCode |= 0; - var glyphId = charCodeToGlyphId[originalCharCode]; - var fontCharCode = originalCharCode; - // First try to map the value to a unicode position if a non identity map - // was created. - if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { - var unicode = toUnicode.get(fontCharCode); - // TODO: Try to map ligatures to the correct spot. - if (unicode.length === 1) { - fontCharCode = unicode.charCodeAt(0); - } - } - // Try to move control characters, special characters and already mapped - // characters to the private use area since they will not be drawn by - // canvas if left in their current position. Also, move characters if the - // font was symbolic and there is only an identity unicode map since the - // characters probably aren't in the correct position (fixes an issue - // with firefox and thuluthfont). - if ((usedFontCharCodes[fontCharCode] !== undefined || - isProblematicUnicodeLocation(fontCharCode) || - (isSymbolic && isIdentityUnicode)) && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left. - // Loop to try and find a free spot in the private use area. - do { - fontCharCode = nextAvailableFontCharCode++; - - if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { - fontCharCode = 0xF020; - nextAvailableFontCharCode = fontCharCode + 1; - } - - } while (usedFontCharCodes[fontCharCode] !== undefined && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END); - } - - newMap[fontCharCode] = glyphId; - toFontChar[originalCharCode] = fontCharCode; - usedFontCharCodes[fontCharCode] = true; - } - return { - toFontChar: toFontChar, - charCodeToGlyphId: newMap, - nextAvailableFontCharCode: nextAvailableFontCharCode - }; - } - - function getRanges(glyphs, numGlyphs) { - // Array.sort() sorts by characters, not numerically, so convert to an - // array of characters. - var codes = []; - for (var charCode in glyphs) { - // Remove an invalid glyph ID mappings to make OTS happy. - if (glyphs[charCode] >= numGlyphs) { - continue; - } - codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); - } - codes.sort(function fontGetRangesSort(a, b) { - return a.fontCharCode - b.fontCharCode; - }); - - // Split the sorted codes into ranges. - var ranges = []; - var length = codes.length; - for (var n = 0; n < length; ) { - var start = codes[n].fontCharCode; - var codeIndices = [codes[n].glyphId]; - ++n; - var end = start; - while (n < length && end + 1 === codes[n].fontCharCode) { - codeIndices.push(codes[n].glyphId); - ++end; - ++n; - if (end === 0xFFFF) { - break; - } - } - ranges.push([start, end, codeIndices]); - } - - return ranges; - } - - function createCmapTable(glyphs, numGlyphs) { - var ranges = getRanges(glyphs, numGlyphs); - var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; - var cmap = '\x00\x00' + // version - string16(numTables) + // numTables - '\x00\x03' + // platformID - '\x00\x01' + // encodingID - string32(4 + numTables * 8); // start of the table record - - var i, ii, j, jj; - for (i = ranges.length - 1; i >= 0; --i) { - if (ranges[i][0] <= 0xFFFF) { break; } - } - var bmpLength = i + 1; - - if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { - ranges[i][1] = 0xFFFE; - } - var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; - var segCount = bmpLength + trailingRangesCount; - var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); - - // Fill up the 4 parallel arrays describing the segments. - var startCount = ''; - var endCount = ''; - var idDeltas = ''; - var idRangeOffsets = ''; - var glyphsIds = ''; - var bias = 0; - - var range, start, end, codes; - for (i = 0, ii = bmpLength; i < ii; i++) { - range = ranges[i]; - start = range[0]; - end = range[1]; - startCount += string16(start); - endCount += string16(end); - codes = range[2]; - var contiguous = true; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - contiguous = false; - break; - } - } - if (!contiguous) { - var offset = (segCount - i) * 2 + bias * 2; - bias += (end - start + 1); - - idDeltas += string16(0); - idRangeOffsets += string16(offset); - - for (j = 0, jj = codes.length; j < jj; ++j) { - glyphsIds += string16(codes[j]); - } - } else { - var startCode = codes[0]; - - idDeltas += string16((startCode - start) & 0xFFFF); - idRangeOffsets += string16(0); - } - } - - if (trailingRangesCount > 0) { - endCount += '\xFF\xFF'; - startCount += '\xFF\xFF'; - idDeltas += '\x00\x01'; - idRangeOffsets += '\x00\x00'; - } - - var format314 = '\x00\x00' + // language - string16(2 * segCount) + - string16(searchParams.range) + - string16(searchParams.entry) + - string16(searchParams.rangeShift) + - endCount + '\x00\x00' + startCount + - idDeltas + idRangeOffsets + glyphsIds; - - var format31012 = ''; - var header31012 = ''; - if (numTables > 1) { - cmap += '\x00\x03' + // platformID - '\x00\x0A' + // encodingID - string32(4 + numTables * 8 + - 4 + format314.length); // start of the table record - format31012 = ''; - for (i = 0, ii = ranges.length; i < ii; i++) { - range = ranges[i]; - start = range[0]; - codes = range[2]; - var code = codes[0]; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - end = range[0] + j - 1; - format31012 += string32(start) + // startCharCode - string32(end) + // endCharCode - string32(code); // startGlyphID - start = end + 1; - code = codes[j]; - } - } - format31012 += string32(start) + // startCharCode - string32(range[1]) + // endCharCode - string32(code); // startGlyphID - } - header31012 = '\x00\x0C' + // format - '\x00\x00' + // reserved - string32(format31012.length + 16) + // length - '\x00\x00\x00\x00' + // language - string32(format31012.length / 12); // nGroups - } - - return cmap + '\x00\x04' + // format - string16(format314.length + 4) + // length - format314 + header31012 + format31012; - } - - function validateOS2Table(os2) { - var stream = new Stream(os2.data); - var version = stream.getUint16(); - // TODO verify all OS/2 tables fields, but currently we validate only those - // that give us issues - stream.getBytes(60); // skipping type, misc sizes, panose, unicode ranges - var selection = stream.getUint16(); - if (version < 4 && (selection & 0x0300)) { - return false; - } - var firstChar = stream.getUint16(); - var lastChar = stream.getUint16(); - if (firstChar > lastChar) { - return false; - } - stream.getBytes(6); // skipping sTypoAscender/Descender/LineGap - var usWinAscent = stream.getUint16(); - if (usWinAscent === 0) { // makes font unreadable by windows - return false; - } - - // OS/2 appears to be valid, resetting some fields - os2.data[8] = os2.data[9] = 0; // IE rejects fonts if fsType != 0 - return true; - } - - function createOS2Table(properties, charstrings, override) { - override = override || { - unitsPerEm: 0, - yMax: 0, - yMin: 0, - ascent: 0, - descent: 0 - }; - - var ulUnicodeRange1 = 0; - var ulUnicodeRange2 = 0; - var ulUnicodeRange3 = 0; - var ulUnicodeRange4 = 0; - - var firstCharIndex = null; - var lastCharIndex = 0; - - if (charstrings) { - for (var code in charstrings) { - code |= 0; - if (firstCharIndex > code || !firstCharIndex) { - firstCharIndex = code; - } - if (lastCharIndex < code) { - lastCharIndex = code; - } - - var position = getUnicodeRangeFor(code); - if (position < 32) { - ulUnicodeRange1 |= 1 << position; - } else if (position < 64) { - ulUnicodeRange2 |= 1 << position - 32; - } else if (position < 96) { - ulUnicodeRange3 |= 1 << position - 64; - } else if (position < 123) { - ulUnicodeRange4 |= 1 << position - 96; - } else { - error('Unicode ranges Bits > 123 are reserved for internal usage'); - } - } - } else { - // TODO - firstCharIndex = 0; - lastCharIndex = 255; - } - - var bbox = properties.bbox || [0, 0, 0, 0]; - var unitsPerEm = (override.unitsPerEm || - 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]); - - // if the font units differ to the PDF glyph space units - // then scale up the values - var scale = (properties.ascentScaled ? 1.0 : - unitsPerEm / PDF_GLYPH_SPACE_UNITS); - - var typoAscent = (override.ascent || - Math.round(scale * (properties.ascent || bbox[3]))); - var typoDescent = (override.descent || - Math.round(scale * (properties.descent || bbox[1]))); - if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { - typoDescent = -typoDescent; // fixing incorrect descent - } - var winAscent = override.yMax || typoAscent; - var winDescent = -override.yMin || -typoDescent; - - return '\x00\x03' + // version - '\x02\x24' + // xAvgCharWidth - '\x01\xF4' + // usWeightClass - '\x00\x05' + // usWidthClass - '\x00\x00' + // fstype (0 to let the font loads via font-face on IE) - '\x02\x8A' + // ySubscriptXSize - '\x02\xBB' + // ySubscriptYSize - '\x00\x00' + // ySubscriptXOffset - '\x00\x8C' + // ySubscriptYOffset - '\x02\x8A' + // ySuperScriptXSize - '\x02\xBB' + // ySuperScriptYSize - '\x00\x00' + // ySuperScriptXOffset - '\x01\xDF' + // ySuperScriptYOffset - '\x00\x31' + // yStrikeOutSize - '\x01\x02' + // yStrikeOutPosition - '\x00\x00' + // sFamilyClass - '\x00\x00\x06' + - String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + - '\x00\x00\x00\x00\x00\x00' + // Panose - string32(ulUnicodeRange1) + // ulUnicodeRange1 (Bits 0-31) - string32(ulUnicodeRange2) + // ulUnicodeRange2 (Bits 32-63) - string32(ulUnicodeRange3) + // ulUnicodeRange3 (Bits 64-95) - string32(ulUnicodeRange4) + // ulUnicodeRange4 (Bits 96-127) - '\x2A\x32\x31\x2A' + // achVendID - string16(properties.italicAngle ? 1 : 0) + // fsSelection - string16(firstCharIndex || - properties.firstChar) + // usFirstCharIndex - string16(lastCharIndex || properties.lastChar) + // usLastCharIndex - string16(typoAscent) + // sTypoAscender - string16(typoDescent) + // sTypoDescender - '\x00\x64' + // sTypoLineGap (7%-10% of the unitsPerEM value) - string16(winAscent) + // usWinAscent - string16(winDescent) + // usWinDescent - '\x00\x00\x00\x00' + // ulCodePageRange1 (Bits 0-31) - '\x00\x00\x00\x00' + // ulCodePageRange2 (Bits 32-63) - string16(properties.xHeight) + // sxHeight - string16(properties.capHeight) + // sCapHeight - string16(0) + // usDefaultChar - string16(firstCharIndex || properties.firstChar) + // usBreakChar - '\x00\x03'; // usMaxContext - } - - function createPostTable(properties) { - var angle = Math.floor(properties.italicAngle * (Math.pow(2, 16))); - return ('\x00\x03\x00\x00' + // Version number - string32(angle) + // italicAngle - '\x00\x00' + // underlinePosition - '\x00\x00' + // underlineThickness - string32(properties.fixedPitch) + // isFixedPitch - '\x00\x00\x00\x00' + // minMemType42 - '\x00\x00\x00\x00' + // maxMemType42 - '\x00\x00\x00\x00' + // minMemType1 - '\x00\x00\x00\x00'); // maxMemType1 - } - - function createNameTable(name, proto) { - if (!proto) { - proto = [[], []]; // no strings and unicode strings - } - - var strings = [ - proto[0][0] || 'Original licence', // 0.Copyright - proto[0][1] || name, // 1.Font family - proto[0][2] || 'Unknown', // 2.Font subfamily (font weight) - proto[0][3] || 'uniqueID', // 3.Unique ID - proto[0][4] || name, // 4.Full font name - proto[0][5] || 'Version 0.11', // 5.Version - proto[0][6] || '', // 6.Postscript name - proto[0][7] || 'Unknown', // 7.Trademark - proto[0][8] || 'Unknown', // 8.Manufacturer - proto[0][9] || 'Unknown' // 9.Designer - ]; - - // Mac want 1-byte per character strings while Windows want - // 2-bytes per character, so duplicate the names table - var stringsUnicode = []; - var i, ii, j, jj, str; - for (i = 0, ii = strings.length; i < ii; i++) { - str = proto[1][i] || strings[i]; - - var strBufUnicode = []; - for (j = 0, jj = str.length; j < jj; j++) { - strBufUnicode.push(string16(str.charCodeAt(j))); - } - stringsUnicode.push(strBufUnicode.join('')); - } - - var names = [strings, stringsUnicode]; - var platforms = ['\x00\x01', '\x00\x03']; - var encodings = ['\x00\x00', '\x00\x01']; - var languages = ['\x00\x00', '\x04\x09']; - - var namesRecordCount = strings.length * platforms.length; - var nameTable = - '\x00\x00' + // format - string16(namesRecordCount) + // Number of names Record - string16(namesRecordCount * 12 + 6); // Storage - - // Build the name records field - var strOffset = 0; - for (i = 0, ii = platforms.length; i < ii; i++) { - var strs = names[i]; - for (j = 0, jj = strs.length; j < jj; j++) { - str = strs[j]; - var nameRecord = - platforms[i] + // platform ID - encodings[i] + // encoding ID - languages[i] + // language ID - string16(j) + // name ID - string16(str.length) + - string16(strOffset); - nameTable += nameRecord; - strOffset += str.length; - } - } - - nameTable += strings.join('') + stringsUnicode.join(''); - return nameTable; - } - - Font.prototype = { - name: null, - font: null, - mimetype: null, - encoding: null, - get renderer() { - var renderer = FontRendererFactory.create(this); - return shadow(this, 'renderer', renderer); - }, - - exportData: function Font_exportData() { - var data = {}; - for (var i in this) { - if (this.hasOwnProperty(i)) { - data[i] = this[i]; - } - } - return data; - }, - - checkAndRepair: function Font_checkAndRepair(name, font, properties) { - function readTableEntry(file) { - var tag = bytesToString(file.getBytes(4)); - - var checksum = file.getInt32(); - var offset = file.getInt32() >>> 0; - var length = file.getInt32() >>> 0; - - // Read the table associated data - var previousPosition = file.pos; - file.pos = file.start ? file.start : 0; - file.skip(offset); - var data = file.getBytes(length); - file.pos = previousPosition; - - if (tag === 'head') { - // clearing checksum adjustment - data[8] = data[9] = data[10] = data[11] = 0; - data[17] |= 0x20; //Set font optimized for cleartype flag - } - - return { - tag: tag, - checksum: checksum, - length: length, - offset: offset, - data: data - }; - } - - function readOpenTypeHeader(ttf) { - return { - version: bytesToString(ttf.getBytes(4)), - numTables: ttf.getUint16(), - searchRange: ttf.getUint16(), - entrySelector: ttf.getUint16(), - rangeShift: ttf.getUint16() - }; - } - - /** - * Read the appropriate subtable from the cmap according to 9.6.6.4 from - * PDF spec - */ - function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { - if (!cmap) { - warn('No cmap table available.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - var segment; - var start = (font.start ? font.start : 0) + cmap.offset; - font.pos = start; - - var version = font.getUint16(); - var numTables = font.getUint16(); - - var potentialTable; - var canBreak = false; - // There's an order of preference in terms of which cmap subtable to - // use: - // - non-symbolic fonts the preference is a 3,1 table then a 1,0 table - // - symbolic fonts the preference is a 3,0 table then a 1,0 table - // The following takes advantage of the fact that the tables are sorted - // to work. - for (var i = 0; i < numTables; i++) { - var platformId = font.getUint16(); - var encodingId = font.getUint16(); - var offset = font.getInt32() >>> 0; - var useTable = false; - - if (platformId === 0 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 1 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 3 && encodingId === 1 && - ((!isSymbolicFont && hasEncoding) || !potentialTable)) { - useTable = true; - if (!isSymbolicFont) { - canBreak = true; - } - } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { - useTable = true; - canBreak = true; - } - - if (useTable) { - potentialTable = { - platformId: platformId, - encodingId: encodingId, - offset: offset - }; - } - if (canBreak) { - break; - } - } - - if (potentialTable) { - font.pos = start + potentialTable.offset; - } - if (!potentialTable || font.peekByte() === -1) { - warn('Could not find a preferred cmap table.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - var format = font.getUint16(); - var length = font.getUint16(); - var language = font.getUint16(); - - var hasShortCmap = false; - var mappings = []; - var j, glyphId; - - // TODO(mack): refactor this cmap subtable reading logic out - if (format === 0) { - for (j = 0; j < 256; j++) { - var index = font.getByte(); - if (!index) { - continue; - } - mappings.push({ - charCode: j, - glyphId: index - }); - } - hasShortCmap = true; - } else if (format === 4) { - // re-creating the table in format 4 since the encoding - // might be changed - var segCount = (font.getUint16() >> 1); - font.getBytes(6); // skipping range fields - var segIndex, segments = []; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments.push({ end: font.getUint16() }); - } - font.getUint16(); - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].start = font.getUint16(); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].delta = font.getUint16(); - } - - var offsetsCount = 0; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - var rangeOffset = font.getUint16(); - if (!rangeOffset) { - segment.offsetIndex = -1; - continue; - } - - var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); - segment.offsetIndex = offsetIndex; - offsetsCount = Math.max(offsetsCount, offsetIndex + - segment.end - segment.start + 1); - } - - var offsets = []; - for (j = 0; j < offsetsCount; j++) { - offsets.push(font.getUint16()); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - start = segment.start; - var end = segment.end; - var delta = segment.delta; - offsetIndex = segment.offsetIndex; - - for (j = start; j <= end; j++) { - if (j === 0xFFFF) { - continue; - } - - glyphId = (offsetIndex < 0 ? - j : offsets[offsetIndex + j - start]); - glyphId = (glyphId + delta) & 0xFFFF; - if (glyphId === 0) { - continue; - } - mappings.push({ - charCode: j, - glyphId: glyphId - }); - } - } - } else if (format === 6) { - // Format 6 is a 2-bytes dense mapping, which means the font data - // lives glue together even if they are pretty far in the unicode - // table. (This looks weird, so I can have missed something), this - // works on Linux but seems to fails on Mac so let's rewrite the - // cmap table to a 3-1-4 style - var firstCode = font.getUint16(); - var entryCount = font.getUint16(); - - for (j = 0; j < entryCount; j++) { - glyphId = font.getUint16(); - var charCode = firstCode + j; - - mappings.push({ - charCode: charCode, - glyphId: glyphId - }); - } - } else { - warn('cmap table has unsupported format: ' + format); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - // removing duplicate entries - mappings.sort(function (a, b) { - return a.charCode - b.charCode; - }); - for (i = 1; i < mappings.length; i++) { - if (mappings[i - 1].charCode === mappings[i].charCode) { - mappings.splice(i, 1); - i--; - } - } - - return { - platformId: potentialTable.platformId, - encodingId: potentialTable.encodingId, - mappings: mappings, - hasShortCmap: hasShortCmap - }; - } - - function sanitizeMetrics(font, header, metrics, numGlyphs) { - if (!header) { - if (metrics) { - metrics.data = null; - } - return; - } - - font.pos = (font.start ? font.start : 0) + header.offset; - font.pos += header.length - 2; - var numOfMetrics = font.getUint16(); - - if (numOfMetrics > numGlyphs) { - info('The numOfMetrics (' + numOfMetrics + ') should not be ' + - 'greater than the numGlyphs (' + numGlyphs + ')'); - // Reduce numOfMetrics if it is greater than numGlyphs - numOfMetrics = numGlyphs; - header.data[34] = (numOfMetrics & 0xff00) >> 8; - header.data[35] = numOfMetrics & 0x00ff; - } - - var numOfSidebearings = numGlyphs - numOfMetrics; - var numMissing = numOfSidebearings - - ((metrics.length - numOfMetrics * 4) >> 1); - - if (numMissing > 0) { - // For each missing glyph, we set both the width and lsb to 0 (zero). - // Since we need to add two properties for each glyph, this explains - // the use of |numMissing * 2| when initializing the typed array. - var entries = new Uint8Array(metrics.length + numMissing * 2); - entries.set(metrics.data); - metrics.data = entries; - } - } - - function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, - hintsValid) { - if (sourceEnd - sourceStart <= 12) { - // glyph with data less than 12 is invalid one - return 0; - } - var glyf = source.subarray(sourceStart, sourceEnd); - var contoursCount = (glyf[0] << 8) | glyf[1]; - if (contoursCount & 0x8000) { - // complex glyph, writing as is - dest.set(glyf, destStart); - return glyf.length; - } - - var i, j = 10, flagsCount = 0; - for (i = 0; i < contoursCount; i++) { - var endPoint = (glyf[j] << 8) | glyf[j + 1]; - flagsCount = endPoint + 1; - j += 2; - } - // skipping instructions - var instructionsStart = j; - var instructionsLength = (glyf[j] << 8) | glyf[j + 1]; - j += 2 + instructionsLength; - var instructionsEnd = j; - // validating flags - var coordinatesLength = 0; - for (i = 0; i < flagsCount; i++) { - var flag = glyf[j++]; - if (flag & 0xC0) { - // reserved flags must be zero, cleaning up - glyf[j - 1] = flag & 0x3F; - } - var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) + - ((flag & 4) ? 1 : (flag & 32) ? 0 : 2); - coordinatesLength += xyLength; - if (flag & 8) { - var repeat = glyf[j++]; - i += repeat; - coordinatesLength += repeat * xyLength; - } - } - // glyph without coordinates will be rejected - if (coordinatesLength === 0) { - return 0; - } - var glyphDataLength = j + coordinatesLength; - if (glyphDataLength > glyf.length) { - // not enough data for coordinates - return 0; - } - if (!hintsValid && instructionsLength > 0) { - dest.set(glyf.subarray(0, instructionsStart), destStart); - dest.set([0, 0], destStart + instructionsStart); - dest.set(glyf.subarray(instructionsEnd, glyphDataLength), - destStart + instructionsStart + 2); - glyphDataLength -= instructionsLength; - if (glyf.length - glyphDataLength > 3) { - glyphDataLength = (glyphDataLength + 3) & ~3; - } - return glyphDataLength; - } - if (glyf.length - glyphDataLength > 3) { - // truncating and aligning to 4 bytes the long glyph data - glyphDataLength = (glyphDataLength + 3) & ~3; - dest.set(glyf.subarray(0, glyphDataLength), destStart); - return glyphDataLength; - } - // glyph data is fine - dest.set(glyf, destStart); - return glyf.length; - } - - function sanitizeHead(head, numGlyphs, locaLength) { - var data = head.data; - - // Validate version: - // Should always be 0x00010000 - var version = int32(data[0], data[1], data[2], data[3]); - if (version >> 16 !== 1) { - info('Attempting to fix invalid version in head table: ' + version); - data[0] = 0; - data[1] = 1; - data[2] = 0; - data[3] = 0; - } - - var indexToLocFormat = int16(data[50], data[51]); - if (indexToLocFormat < 0 || indexToLocFormat > 1) { - info('Attempting to fix invalid indexToLocFormat in head table: ' + - indexToLocFormat); - - // The value of indexToLocFormat should be 0 if the loca table - // consists of short offsets, and should be 1 if the loca table - // consists of long offsets. - // - // The number of entries in the loca table should be numGlyphs + 1. - // - // Using this information, we can work backwards to deduce if the - // size of each offset in the loca table, and thus figure out the - // appropriate value for indexToLocFormat. - - var numGlyphsPlusOne = numGlyphs + 1; - if (locaLength === numGlyphsPlusOne << 1) { - // 0x0000 indicates the loca table consists of short offsets - data[50] = 0; - data[51] = 0; - } else if (locaLength === numGlyphsPlusOne << 2) { - // 0x0001 indicates the loca table consists of long offsets - data[50] = 0; - data[51] = 1; - } else { - warn('Could not fix indexToLocFormat: ' + indexToLocFormat); - } - } - } - - function sanitizeGlyphLocations(loca, glyf, numGlyphs, - isGlyphLocationsLong, hintsValid, - dupFirstEntry) { - var itemSize, itemDecode, itemEncode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - itemEncode = function fontItemEncodeLong(data, offset, value) { - data[offset] = (value >>> 24) & 0xFF; - data[offset + 1] = (value >> 16) & 0xFF; - data[offset + 2] = (value >> 8) & 0xFF; - data[offset + 3] = value & 0xFF; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - itemEncode = function fontItemEncode(data, offset, value) { - data[offset] = (value >> 9) & 0xFF; - data[offset + 1] = (value >> 1) & 0xFF; - }; - } - var locaData = loca.data; - var locaDataSize = itemSize * (1 + numGlyphs); - // is loca.data too short or long? - if (locaData.length !== locaDataSize) { - locaData = new Uint8Array(locaDataSize); - locaData.set(loca.data.subarray(0, locaDataSize)); - loca.data = locaData; - } - // removing the invalid glyphs - var oldGlyfData = glyf.data; - var oldGlyfDataLength = oldGlyfData.length; - var newGlyfData = new Uint8Array(oldGlyfDataLength); - var startOffset = itemDecode(locaData, 0); - var writeOffset = 0; - var missingGlyphData = {}; - itemEncode(locaData, 0, writeOffset); - var i, j; - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - var endOffset = itemDecode(locaData, j); - if (endOffset > oldGlyfDataLength && - ((oldGlyfDataLength + 3) & ~3) === endOffset) { - // Aspose breaks fonts by aligning the glyphs to the qword, but not - // the glyf table size, which makes last glyph out of range. - endOffset = oldGlyfDataLength; - } - if (endOffset > oldGlyfDataLength) { - // glyph end offset points outside glyf data, rejecting the glyph - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - continue; - } - - if (startOffset === endOffset) { - missingGlyphData[i] = true; - } - - var newLength = sanitizeGlyph(oldGlyfData, startOffset, endOffset, - newGlyfData, writeOffset, hintsValid); - writeOffset += newLength; - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - } - - if (writeOffset === 0) { - // glyf table cannot be empty -- redoing the glyf and loca tables - // to have single glyph with one point - var simpleGlyph = new Uint8Array( - [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - itemEncode(locaData, j, simpleGlyph.length); - } - glyf.data = simpleGlyph; - return missingGlyphData; - } - - if (dupFirstEntry) { - var firstEntryLength = itemDecode(locaData, itemSize); - if (newGlyfData.length > firstEntryLength + writeOffset) { - glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); - } else { - glyf.data = new Uint8Array(firstEntryLength + writeOffset); - glyf.data.set(newGlyfData.subarray(0, writeOffset)); - } - glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); - itemEncode(loca.data, locaData.length - itemSize, - writeOffset + firstEntryLength); - } else { - glyf.data = newGlyfData.subarray(0, writeOffset); - } - return missingGlyphData; - } - - function readPostScriptTable(post, properties, maxpNumGlyphs) { - var start = (font.start ? font.start : 0) + post.offset; - font.pos = start; - - var length = post.length, end = start + length; - var version = font.getInt32(); - // skip rest to the tables - font.getBytes(28); - - var glyphNames; - var valid = true; - var i; - - switch (version) { - case 0x00010000: - glyphNames = MacStandardGlyphOrdering; - break; - case 0x00020000: - var numGlyphs = font.getUint16(); - if (numGlyphs !== maxpNumGlyphs) { - valid = false; - break; - } - var glyphNameIndexes = []; - for (i = 0; i < numGlyphs; ++i) { - var index = font.getUint16(); - if (index >= 32768) { - valid = false; - break; - } - glyphNameIndexes.push(index); - } - if (!valid) { - break; - } - var customNames = []; - var strBuf = []; - while (font.pos < end) { - var stringLength = font.getByte(); - strBuf.length = stringLength; - for (i = 0; i < stringLength; ++i) { - strBuf[i] = String.fromCharCode(font.getByte()); - } - customNames.push(strBuf.join('')); - } - glyphNames = []; - for (i = 0; i < numGlyphs; ++i) { - var j = glyphNameIndexes[i]; - if (j < 258) { - glyphNames.push(MacStandardGlyphOrdering[j]); - continue; - } - glyphNames.push(customNames[j - 258]); - } - break; - case 0x00030000: - break; - default: - warn('Unknown/unsupported post table version ' + version); - valid = false; - if (properties.defaultEncoding) { - glyphNames = properties.defaultEncoding; - } - break; - } - properties.glyphNames = glyphNames; - return valid; - } - - function readNameTable(nameTable) { - var start = (font.start ? font.start : 0) + nameTable.offset; - font.pos = start; - - var names = [[], []]; - var length = nameTable.length, end = start + length; - var format = font.getUint16(); - var FORMAT_0_HEADER_LENGTH = 6; - if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { - // unsupported name table format or table "too" small - return names; - } - var numRecords = font.getUint16(); - var stringsStart = font.getUint16(); - var records = []; - var NAME_RECORD_LENGTH = 12; - var i, ii; - - for (i = 0; i < numRecords && - font.pos + NAME_RECORD_LENGTH <= end; i++) { - var r = { - platform: font.getUint16(), - encoding: font.getUint16(), - language: font.getUint16(), - name: font.getUint16(), - length: font.getUint16(), - offset: font.getUint16() - }; - // using only Macintosh and Windows platform/encoding names - if ((r.platform === 1 && r.encoding === 0 && r.language === 0) || - (r.platform === 3 && r.encoding === 1 && r.language === 0x409)) { - records.push(r); - } - } - for (i = 0, ii = records.length; i < ii; i++) { - var record = records[i]; - var pos = start + stringsStart + record.offset; - if (pos + record.length > end) { - continue; // outside of name table, ignoring - } - font.pos = pos; - var nameIndex = record.name; - if (record.encoding) { - // unicode - var str = ''; - for (var j = 0, jj = record.length; j < jj; j += 2) { - str += String.fromCharCode(font.getUint16()); - } - names[1][nameIndex] = str; - } else { - names[0][nameIndex] = bytesToString(font.getBytes(record.length)); - } - } - return names; - } - - var TTOpsStackDeltas = [ - 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, - 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, - 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, - 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, - -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, - -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, - -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; - // 0xC0-DF == -1 and 0xE0-FF == -2 - - function sanitizeTTProgram(table, ttContext) { - var data = table.data; - var i = 0, j, n, b, funcId, pc, lastEndf = 0, lastDeff = 0; - var stack = []; - var callstack = []; - var functionsCalled = []; - var tooComplexToFollowFunctions = - ttContext.tooComplexToFollowFunctions; - var inFDEF = false, ifLevel = 0, inELSE = 0; - for (var ii = data.length; i < ii;) { - var op = data[i++]; - // The TrueType instruction set docs can be found at - // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html - if (op === 0x40) { // NPUSHB - pushes n bytes - n = data[i++]; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if (op === 0x41) { // NPUSHW - pushes n words - n = data[i++]; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes - n = op - 0xB0 + 1; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words - n = op - 0xB8 + 1; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL - if (!inFDEF && !inELSE) { - // collecting inforamtion about which functions are used - funcId = stack[stack.length - 1]; - ttContext.functionsUsed[funcId] = true; - if (funcId in ttContext.functionsStackDeltas) { - stack.length += ttContext.functionsStackDeltas[funcId]; - } else if (funcId in ttContext.functionsDefined && - functionsCalled.indexOf(funcId) < 0) { - callstack.push({data: data, i: i, stackTop: stack.length - 1}); - functionsCalled.push(funcId); - pc = ttContext.functionsDefined[funcId]; - if (!pc) { - warn('TT: CALL non-existent function'); - ttContext.hintsValid = false; - return; - } - data = pc.data; - i = pc.i; - } - } - } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF - if (inFDEF || inELSE) { - warn('TT: nested FDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // collecting inforamtion about which functions are defined - lastDeff = i; - funcId = stack.pop(); - ttContext.functionsDefined[funcId] = {data: data, i: i}; - } else if (op === 0x2D) { // ENDF - end of function - if (inFDEF) { - inFDEF = false; - lastEndf = i; - } else { - pc = callstack.pop(); - if (!pc) { - warn('TT: ENDF bad stack'); - ttContext.hintsValid = false; - return; - } - funcId = functionsCalled.pop(); - data = pc.data; - i = pc.i; - ttContext.functionsStackDeltas[funcId] = - stack.length - pc.stackTop; - } - } else if (op === 0x89) { // IDEF - instruction definition - if (inFDEF || inELSE) { - warn('TT: nested IDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // recording it as a function to track ENDF - lastDeff = i; - } else if (op === 0x58) { // IF - ++ifLevel; - } else if (op === 0x1B) { // ELSE - inELSE = ifLevel; - } else if (op === 0x59) { // EIF - if (inELSE === ifLevel) { - inELSE = 0; - } - --ifLevel; - } else if (op === 0x1C) { // JMPR - if (!inFDEF && !inELSE) { - var offset = stack[stack.length - 1]; - // only jumping forward to prevent infinite loop - if (offset > 0) { - i += offset - 1; - } - } - } - // Adjusting stack not extactly, but just enough to get function id - if (!inFDEF && !inELSE) { - var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : - op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; - if (op >= 0x71 && op <= 0x75) { - n = stack.pop(); - if (n === n) { - stackDelta = -n * 2; - } - } - while (stackDelta < 0 && stack.length > 0) { - stack.pop(); - stackDelta++; - } - while (stackDelta > 0) { - stack.push(NaN); // pushing any number into stack - stackDelta--; - } - } - } - ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; - var content = [data]; - if (i > data.length) { - content.push(new Uint8Array(i - data.length)); - } - if (lastDeff > lastEndf) { - warn('TT: complementing a missing function tail'); - // new function definition started, but not finished - // complete function by [CLEAR, ENDF] - content.push(new Uint8Array([0x22, 0x2D])); - } - foldTTTable(table, content); - } - - function checkInvalidFunctions(ttContext, maxFunctionDefs) { - if (ttContext.tooComplexToFollowFunctions) { - return; - } - if (ttContext.functionsDefined.length > maxFunctionDefs) { - warn('TT: more functions defined than expected'); - ttContext.hintsValid = false; - return; - } - for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { - if (j > maxFunctionDefs) { - warn('TT: invalid function id: ' + j); - ttContext.hintsValid = false; - return; - } - if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { - warn('TT: undefined function: ' + j); - ttContext.hintsValid = false; - return; - } - } - } - - function foldTTTable(table, content) { - if (content.length > 1) { - // concatenating the content items - var newLength = 0; - var j, jj; - for (j = 0, jj = content.length; j < jj; j++) { - newLength += content[j].length; - } - newLength = (newLength + 3) & ~3; - var result = new Uint8Array(newLength); - var pos = 0; - for (j = 0, jj = content.length; j < jj; j++) { - result.set(content[j], pos); - pos += content[j].length; - } - table.data = result; - table.length = newLength; - } - } - - function sanitizeTTPrograms(fpgm, prep, cvt) { - var ttContext = { - functionsDefined: [], - functionsUsed: [], - functionsStackDeltas: [], - tooComplexToFollowFunctions: false, - hintsValid: true - }; - if (fpgm) { - sanitizeTTProgram(fpgm, ttContext); - } - if (prep) { - sanitizeTTProgram(prep, ttContext); - } - if (fpgm) { - checkInvalidFunctions(ttContext, maxFunctionDefs); - } - if (cvt && (cvt.length & 1)) { - var cvtData = new Uint8Array(cvt.length + 1); - cvtData.set(cvt.data); - cvt.data = cvtData; - } - return ttContext.hintsValid; - } - - // The following steps modify the original font data, making copy - font = new Stream(new Uint8Array(font.getBytes())); - - var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', - 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; - - var header = readOpenTypeHeader(font); - var numTables = header.numTables; - var cff, cffFile; - - var tables = { 'OS/2': null, cmap: null, head: null, hhea: null, - hmtx: null, maxp: null, name: null, post: null }; - var table; - for (var i = 0; i < numTables; i++) { - table = readTableEntry(font); - if (VALID_TABLES.indexOf(table.tag) < 0) { - continue; // skipping table if it's not a required or optional table - } - if (table.length === 0) { - continue; // skipping empty tables - } - tables[table.tag] = table; - } - - var isTrueType = !tables['CFF ']; - if (!isTrueType) { - // OpenType font - if ((header.version === 'OTTO' && properties.type !== 'CIDFontType2') || - !tables.head || !tables.hhea || !tables.maxp || !tables.post) { - // no major tables: throwing everything at CFFFont - cffFile = new Stream(tables['CFF '].data); - cff = new CFFFont(cffFile, properties); - - adjustWidths(properties); - - return this.convert(name, cff, properties); - } - - delete tables.glyf; - delete tables.loca; - delete tables.fpgm; - delete tables.prep; - delete tables['cvt ']; - this.isOpenType = true; - } else { - if (!tables.loca) { - error('Required "loca" table is not found'); - } - if (!tables.glyf) { - warn('Required "glyf" table is not found -- trying to recover.'); - // Note: We use `sanitizeGlyphLocations` to add dummy glyf data below. - tables.glyf = { - tag: 'glyf', - data: new Uint8Array(0), - }; - } - this.isOpenType = false; - } - - if (!tables.maxp) { - error('Required "maxp" table is not found'); - } - - font.pos = (font.start || 0) + tables.maxp.offset; - var version = font.getInt32(); - var numGlyphs = font.getUint16(); - var maxFunctionDefs = 0; - if (version >= 0x00010000 && tables.maxp.length >= 22) { - // maxZones can be invalid - font.pos += 8; - var maxZones = font.getUint16(); - if (maxZones > 2) { // reset to 2 if font has invalid maxZones - tables.maxp.data[14] = 0; - tables.maxp.data[15] = 2; - } - font.pos += 4; - maxFunctionDefs = font.getUint16(); - } - - var dupFirstEntry = false; - if (properties.type === 'CIDFontType2' && properties.toUnicode && - properties.toUnicode.get(0) > '\u0000') { - // oracle's defect (see 3427), duplicating first entry - dupFirstEntry = true; - numGlyphs++; - tables.maxp.data[4] = numGlyphs >> 8; - tables.maxp.data[5] = numGlyphs & 255; - } - - var hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, - tables['cvt '], maxFunctionDefs); - if (!hintsValid) { - delete tables.fpgm; - delete tables.prep; - delete tables['cvt ']; - } - - // Ensure the hmtx table contains the advance width and - // sidebearings information for numGlyphs in the maxp table - sanitizeMetrics(font, tables.hhea, tables.hmtx, numGlyphs); - - if (!tables.head) { - error('Required "head" table is not found'); - } - - sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); - - var missingGlyphs = {}; - if (isTrueType) { - var isGlyphLocationsLong = int16(tables.head.data[50], - tables.head.data[51]); - missingGlyphs = sanitizeGlyphLocations(tables.loca, tables.glyf, - numGlyphs, isGlyphLocationsLong, - hintsValid, dupFirstEntry); - } - - if (!tables.hhea) { - error('Required "hhea" table is not found'); - } - - // Sanitizer reduces the glyph advanceWidth to the maxAdvanceWidth - // Sometimes it's 0. That needs to be fixed - if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { - tables.hhea.data[10] = 0xFF; - tables.hhea.data[11] = 0xFF; - } - - // Extract some more font properties from the OpenType head and - // hhea tables; yMin and descent value are always negative. - var metricsOverride = { - unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), - yMax: int16(tables.head.data[42], tables.head.data[43]), - yMin: int16(tables.head.data[38], tables.head.data[39]) - 0x10000, - ascent: int16(tables.hhea.data[4], tables.hhea.data[5]), - descent: int16(tables.hhea.data[6], tables.hhea.data[7]) - 0x10000 - }; - - // PDF FontDescriptor metrics lie -- using data from actual font. - this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; - this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; - - // The 'post' table has glyphs names. - if (tables.post) { - var valid = readPostScriptTable(tables.post, properties, numGlyphs); - if (!valid) { - tables.post = null; - } - } - - var charCodeToGlyphId = [], charCode; - var toUnicode = properties.toUnicode, widths = properties.widths; - var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap || - toUnicode.length === 0x10000); - - // Helper function to try to skip mapping of empty glyphs. - // Note: In some cases, just relying on the glyph data doesn't work, - // hence we also use a few heuristics to fix various PDF files. - function hasGlyph(glyphId, charCode, widthCode) { - if (!missingGlyphs[glyphId]) { - return true; - } - if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) { - return true; - } - if (widths && widthCode >= 0 && isNum(widths[widthCode])) { - return true; - } - return false; - } - - if (properties.type === 'CIDFontType2') { - var cidToGidMap = properties.cidToGidMap || []; - var isCidToGidMapEmpty = cidToGidMap.length === 0; - - properties.cMap.forEach(function(charCode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - var glyphId = -1; - if (isCidToGidMapEmpty) { - glyphId = charCode; - } else if (cidToGidMap[cid] !== undefined) { - glyphId = cidToGidMap[cid]; - } - - if (glyphId >= 0 && glyphId < numGlyphs && - hasGlyph(glyphId, charCode, cid)) { - charCodeToGlyphId[charCode] = glyphId; - } - }); - if (dupFirstEntry) { - charCodeToGlyphId[0] = numGlyphs - 1; - } - } else { - // Most of the following logic in this code branch is based on the - // 9.6.6.4 of the PDF spec. - var hasEncoding = - properties.differences.length > 0 || !!properties.baseEncodingName; - var cmapTable = - readCmapTable(tables.cmap, font, this.isSymbolicFont, hasEncoding); - var cmapPlatformId = cmapTable.platformId; - var cmapEncodingId = cmapTable.encodingId; - var cmapMappings = cmapTable.mappings; - var cmapMappingsLength = cmapMappings.length; - - // The spec seems to imply that if the font is symbolic the encoding - // should be ignored, this doesn't appear to work for 'preistabelle.pdf' - // where the the font is symbolic and it has an encoding. - if (hasEncoding && - (cmapPlatformId === 3 && cmapEncodingId === 1 || - cmapPlatformId === 1 && cmapEncodingId === 0) || - (cmapPlatformId === -1 && cmapEncodingId === -1 && // Temporary hack - !!Encodings[properties.baseEncodingName])) { // Temporary hack - // When no preferred cmap table was found and |baseEncodingName| is - // one of the predefined encodings, we seem to obtain a better - // |charCodeToGlyphId| map from the code below (fixes bug 1057544). - // TODO: Note that this is a hack which should be removed as soon as - // we have proper support for more exotic cmap tables. - - var baseEncoding = []; - if (properties.baseEncodingName === 'MacRomanEncoding' || - properties.baseEncodingName === 'WinAnsiEncoding') { - baseEncoding = Encodings[properties.baseEncodingName]; - } - for (charCode = 0; charCode < 256; charCode++) { - var glyphName; - if (this.differences && charCode in this.differences) { - glyphName = this.differences[charCode]; - } else if (charCode in baseEncoding && - baseEncoding[charCode] !== '') { - glyphName = baseEncoding[charCode]; - } else { - glyphName = Encodings.StandardEncoding[charCode]; - } - if (!glyphName) { - continue; - } - var unicodeOrCharCode, isUnicode = false; - if (cmapPlatformId === 3 && cmapEncodingId === 1) { - unicodeOrCharCode = GlyphsUnicode[glyphName]; - isUnicode = true; - } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { - // TODO: the encoding needs to be updated with mac os table. - unicodeOrCharCode = Encodings.MacRomanEncoding.indexOf(glyphName); - } - - var found = false; - for (i = 0; i < cmapMappingsLength; ++i) { - if (cmapMappings[i].charCode !== unicodeOrCharCode) { - continue; - } - var code = isUnicode ? charCode : unicodeOrCharCode; - if (hasGlyph(cmapMappings[i].glyphId, code, -1)) { - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - found = true; - break; - } - } - if (!found && properties.glyphNames) { - // Try to map using the post table. - var glyphId = properties.glyphNames.indexOf(glyphName); - if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) { - charCodeToGlyphId[charCode] = glyphId; - found = true; - } - } - if (!found) { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { - // Default Unicode semantics, use the charcodes as is. - for (i = 0; i < cmapMappingsLength; ++i) { - charCodeToGlyphId[cmapMappings[i].charCode] = - cmapMappings[i].glyphId; - } - } else { - // For (3, 0) cmap tables: - // The charcode key being stored in charCodeToGlyphId is the lower - // byte of the two-byte charcodes of the cmap table since according to - // the spec: 'each byte from the string shall be prepended with the - // high byte of the range [of charcodes in the cmap table], to form - // a two-byte character, which shall be used to select the - // associated glyph description from the subtable'. - // - // For (1, 0) cmap tables: - // 'single bytes from the string shall be used to look up the - // associated glyph descriptions from the subtable'. This means - // charcodes in the cmap will be single bytes, so no-op since - // glyph.charCode & 0xFF === glyph.charCode - for (i = 0; i < cmapMappingsLength; ++i) { - charCode = cmapMappings[i].charCode & 0xFF; - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - } - } - } - - if (charCodeToGlyphId.length === 0) { - // defines at least one glyph - charCodeToGlyphId[0] = 0; - } - - // Converting glyphs and ids into font's cmap table - var newMapping = adjustMapping(charCodeToGlyphId, properties); - this.toFontChar = newMapping.toFontChar; - tables.cmap = { - tag: 'cmap', - data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) - }; - - if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { - tables['OS/2'] = { - tag: 'OS/2', - data: createOS2Table(properties, newMapping.charCodeToGlyphId, - metricsOverride) - }; - } - - // Rewrite the 'post' table if needed - if (!tables.post) { - tables.post = { - tag: 'post', - data: createPostTable(properties) - }; - } - - if (!isTrueType) { - try { - // Trying to repair CFF file - cffFile = new Stream(tables['CFF '].data); - var parser = new CFFParser(cffFile, properties); - cff = parser.parse(); - var compiler = new CFFCompiler(cff); - tables['CFF '].data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - } - } - - // Re-creating 'name' table - if (!tables.name) { - tables.name = { - tag: 'name', - data: createNameTable(this.name) - }; - } else { - // ... using existing 'name' table as prototype - var namePrototype = readNameTable(tables.name); - tables.name.data = createNameTable(name, namePrototype); - } - - var builder = new OpenTypeFileBuilder(header.version); - for (var tableTag in tables) { - builder.addTable(tableTag, tables[tableTag].data); - } - return builder.toArray(); - }, - - convert: function Font_convert(fontName, font, properties) { - // TODO: Check the charstring widths to determine this. - properties.fixedPitch = false; - - var mapping = font.getGlyphMapping(properties); - var newMapping = adjustMapping(mapping, properties); - this.toFontChar = newMapping.toFontChar; - var numGlyphs = font.numGlyphs; - - function getCharCodes(charCodeToGlyphId, glyphId) { - var charCodes = null; - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - if (!charCodes) { - charCodes = []; - } - charCodes.push(charCode | 0); - } - } - return charCodes; - } - - function createCharCode(charCodeToGlyphId, glyphId) { - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - return charCode | 0; - } - } - newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = - glyphId; - return newMapping.nextAvailableFontCharCode++; - } - - var seacs = font.seacs; - if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { - var matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; - var charset = font.getCharset(); - var seacMap = Object.create(null); - for (var glyphId in seacs) { - glyphId |= 0; - var seac = seacs[glyphId]; - var baseGlyphName = Encodings.StandardEncoding[seac[2]]; - var accentGlyphName = Encodings.StandardEncoding[seac[3]]; - var baseGlyphId = charset.indexOf(baseGlyphName); - var accentGlyphId = charset.indexOf(accentGlyphName); - if (baseGlyphId < 0 || accentGlyphId < 0) { - continue; - } - var accentOffset = { - x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], - y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] - }; - - var charCodes = getCharCodes(mapping, glyphId); - if (!charCodes) { - // There's no point in mapping it if the char code was never mapped - // to begin with. - continue; - } - for (var i = 0, ii = charCodes.length; i < ii; i++) { - var charCode = charCodes[i]; - // Find a fontCharCode that maps to the base and accent glyphs. - // If one doesn't exists, create it. - var charCodeToGlyphId = newMapping.charCodeToGlyphId; - var baseFontCharCode = createCharCode(charCodeToGlyphId, - baseGlyphId); - var accentFontCharCode = createCharCode(charCodeToGlyphId, - accentGlyphId); - seacMap[charCode] = { - baseFontCharCode: baseFontCharCode, - accentFontCharCode: accentFontCharCode, - accentOffset: accentOffset - }; - } - } - properties.seacMap = seacMap; - } - - var unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; - - var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); - // PostScript Font Program - builder.addTable('CFF ', font.data); - // OS/2 and Windows Specific metrics - builder.addTable('OS/2', createOS2Table(properties, - newMapping.charCodeToGlyphId)); - // Character to glyphs mapping - builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, - numGlyphs)); - // Font header - builder.addTable('head', - '\x00\x01\x00\x00' + // Version number - '\x00\x00\x10\x00' + // fontRevision - '\x00\x00\x00\x00' + // checksumAdjustement - '\x5F\x0F\x3C\xF5' + // magicNumber - '\x00\x00' + // Flags - safeString16(unitsPerEm) + // unitsPerEM - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // creation date - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // modifification date - '\x00\x00' + // xMin - safeString16(properties.descent) + // yMin - '\x0F\xFF' + // xMax - safeString16(properties.ascent) + // yMax - string16(properties.italicAngle ? 2 : 0) + // macStyle - '\x00\x11' + // lowestRecPPEM - '\x00\x00' + // fontDirectionHint - '\x00\x00' + // indexToLocFormat - '\x00\x00'); // glyphDataFormat - - // Horizontal header - builder.addTable('hhea', - '\x00\x01\x00\x00' + // Version number - safeString16(properties.ascent) + // Typographic Ascent - safeString16(properties.descent) + // Typographic Descent - '\x00\x00' + // Line Gap - '\xFF\xFF' + // advanceWidthMax - '\x00\x00' + // minLeftSidebearing - '\x00\x00' + // minRightSidebearing - '\x00\x00' + // xMaxExtent - safeString16(properties.capHeight) + // caretSlopeRise - safeString16(Math.tan(properties.italicAngle) * - properties.xHeight) + // caretSlopeRun - '\x00\x00' + // caretOffset - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // metricDataFormat - string16(numGlyphs)); // Number of HMetrics - - // Horizontal metrics - builder.addTable('hmtx', (function fontFieldsHmtx() { - var charstrings = font.charstrings; - var cffWidths = font.cff ? font.cff.widths : null; - var hmtx = '\x00\x00\x00\x00'; // Fake .notdef - for (var i = 1, ii = numGlyphs; i < ii; i++) { - var width = 0; - if (charstrings) { - var charstring = charstrings[i - 1]; - width = 'width' in charstring ? charstring.width : 0; - } else if (cffWidths) { - width = Math.ceil(cffWidths[i] || 0); - } - hmtx += string16(width) + string16(0); - } - return hmtx; - })()); - - // Maximum profile - builder.addTable('maxp', - '\x00\x00\x50\x00' + // Version number - string16(numGlyphs)); // Num of glyphs - - // Naming tables - builder.addTable('name', createNameTable(fontName)); - - // PostScript informations - builder.addTable('post', createPostTable(properties)); - - return builder.toArray(); - }, - - /** - * Builds a char code to unicode map based on section 9.10 of the spec. - * @param {Object} properties Font properties object. - * @return {Object} A ToUnicodeMap object. - */ - buildToUnicode: function Font_buildToUnicode(properties) { - // Section 9.10.2 Mapping Character Codes to Unicode Values - if (properties.toUnicode && properties.toUnicode.length !== 0) { - return properties.toUnicode; - } - // According to the spec if the font is a simple font we should only map - // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or - // the differences array only contains adobe standard or symbol set names, - // in pratice it seems better to always try to create a toUnicode - // map based of the default encoding. - var toUnicode, charcode; - if (!properties.composite /* is simple font */) { - toUnicode = []; - var encoding = properties.defaultEncoding.slice(); - var baseEncodingName = properties.baseEncodingName; - // Merge in the differences array. - var differences = properties.differences; - for (charcode in differences) { - encoding[charcode] = differences[charcode]; - } - for (charcode in encoding) { - // a) Map the character code to a character name. - var glyphName = encoding[charcode]; - // b) Look up the character name in the Adobe Glyph List (see the - // Bibliography) to obtain the corresponding Unicode value. - if (glyphName === '') { - continue; - } else if (GlyphsUnicode[glyphName] === undefined) { - // (undocumented) c) Few heuristics to recognize unknown glyphs - // NOTE: Adobe Reader does not do this step, but OSX Preview does - var code = 0; - switch (glyphName[0]) { - case 'G': // Gxx glyph - if (glyphName.length === 3) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'g': // g00xx glyph - if (glyphName.length === 5) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'C': // Cddd glyph - case 'c': // cddd glyph - if (glyphName.length >= 3) { - code = +glyphName.substr(1); - } - break; - } - if (code) { - // If |baseEncodingName| is one the predefined encodings, - // and |code| equals |charcode|, using the glyph defined in the - // baseEncoding seems to yield a better |toUnicode| mapping - // (fixes issue 5070). - if (baseEncodingName && code === +charcode) { - var baseEncoding = Encodings[baseEncodingName]; - if (baseEncoding && (glyphName = baseEncoding[charcode])) { - toUnicode[charcode] = - String.fromCharCode(GlyphsUnicode[glyphName]); - continue; - } - } - toUnicode[charcode] = String.fromCharCode(code); - } - continue; - } - toUnicode[charcode] = String.fromCharCode(GlyphsUnicode[glyphName]); - } - return new ToUnicodeMap(toUnicode); - } - // If the font is a composite font that uses one of the predefined CMaps - // listed in Table 118 (except Identity–H and Identity–V) or whose - // descendant CIDFont uses the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, or - // Adobe-Korea1 character collection: - if (properties.composite && ( - (properties.cMap.builtInCMap && - !(properties.cMap instanceof IdentityCMap)) || - (properties.cidSystemInfo.registry === 'Adobe' && - (properties.cidSystemInfo.ordering === 'GB1' || - properties.cidSystemInfo.ordering === 'CNS1' || - properties.cidSystemInfo.ordering === 'Japan1' || - properties.cidSystemInfo.ordering === 'Korea1')))) { - // Then: - // a) Map the character code to a character identifier (CID) according - // to the font’s CMap. - // b) Obtain the registry and ordering of the character collection used - // by the font’s CMap (for example, Adobe and Japan1) from its - // CIDSystemInfo dictionary. - var registry = properties.cidSystemInfo.registry; - var ordering = properties.cidSystemInfo.ordering; - // c) Construct a second CMap name by concatenating the registry and - // ordering obtained in step (b) in the format registry–ordering–UCS2 - // (for example, Adobe–Japan1–UCS2). - var ucs2CMapName = new Name(registry + '-' + ordering + '-UCS2'); - // d) Obtain the CMap with the name constructed in step (c) (available - // from the ASN Web site; see the Bibliography). - var ucs2CMap = CMapFactory.create(ucs2CMapName, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - var cMap = properties.cMap; - toUnicode = []; - cMap.forEach(function(charcode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - // e) Map the CID obtained in step (a) according to the CMap obtained - // in step (d), producing a Unicode value. - var ucs2 = ucs2CMap.lookup(cid); - if (ucs2) { - toUnicode[charcode] = - String.fromCharCode((ucs2.charCodeAt(0) << 8) + - ucs2.charCodeAt(1)); - } - }); - return new ToUnicodeMap(toUnicode); - } - - // The viewer's choice, just use an identity map. - return new IdentityToUnicodeMap(properties.firstChar, - properties.lastChar); - }, - - get spaceWidth() { - if ('_shadowWidth' in this) { - return this._shadowWidth; - } - - // trying to estimate space character width - var possibleSpaceReplacements = ['space', 'minus', 'one', 'i']; - var width; - for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { - var glyphName = possibleSpaceReplacements[i]; - // if possible, getting width by glyph name - if (glyphName in this.widths) { - width = this.widths[glyphName]; - break; - } - var glyphUnicode = GlyphsUnicode[glyphName]; - // finding the charcode via unicodeToCID map - var charcode = 0; - if (this.composite) { - if (this.cMap.contains(glyphUnicode)) { - charcode = this.cMap.lookup(glyphUnicode); - } - } - // ... via toUnicode map - if (!charcode && this.toUnicode) { - charcode = this.toUnicode.charCodeOf(glyphUnicode); - } - // setting it to unicode if negative or undefined - if (charcode <= 0) { - charcode = glyphUnicode; - } - // trying to get width via charcode - width = this.widths[charcode]; - if (width) { - break; // the non-zero width found - } - } - width = width || this.defaultWidth; - // Do not shadow the property here. See discussion: - // https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280 - this._shadowWidth = width; - return width; - }, - - charToGlyph: function Font_charToGlyph(charcode, isSpace) { - var fontCharCode, width, operatorListId; - - var widthCode = charcode; - if (this.cMap && this.cMap.contains(charcode)) { - widthCode = this.cMap.lookup(charcode); - } - width = this.widths[widthCode]; - width = isNum(width) ? width : this.defaultWidth; - var vmetric = this.vmetrics && this.vmetrics[widthCode]; - - var unicode = this.toUnicode.get(charcode) || charcode; - if (typeof unicode === 'number') { - unicode = String.fromCharCode(unicode); - } - - // First try the toFontChar map, if it's not there then try falling - // back to the char code. - fontCharCode = this.toFontChar[charcode] || charcode; - if (this.missingFile) { - fontCharCode = mapSpecialUnicodeValues(fontCharCode); - } - - if (this.isType3Font) { - // Font char code in this case is actually a glyph name. - operatorListId = fontCharCode; - } - - var accent = null; - if (this.seacMap && this.seacMap[charcode]) { - var seac = this.seacMap[charcode]; - fontCharCode = seac.baseFontCharCode; - accent = { - fontChar: String.fromCharCode(seac.accentFontCharCode), - offset: seac.accentOffset - }; - } - - var fontChar = String.fromCharCode(fontCharCode); - - var glyph = this.glyphCache[charcode]; - if (!glyph || - !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace)) { - glyph = new Glyph(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace); - this.glyphCache[charcode] = glyph; - } - return glyph; - }, - - charsToGlyphs: function Font_charsToGlyphs(chars) { - var charsCache = this.charsCache; - var glyphs, glyph, charcode; - - // if we translated this string before, just grab it from the cache - if (charsCache) { - glyphs = charsCache[chars]; - if (glyphs) { - return glyphs; - } - } - - // lazily create the translation cache - if (!charsCache) { - charsCache = this.charsCache = Object.create(null); - } - - glyphs = []; - var charsCacheKey = chars; - var i = 0, ii; - - if (this.cMap) { - // composite fonts have multi-byte strings convert the string from - // single-byte to multi-byte - var c = {}; - while (i < chars.length) { - this.cMap.readCharCode(chars, i, c); - charcode = c.charcode; - var length = c.length; - i += length; - // Space is char with code 0x20 and length 1 in multiple-byte codes. - var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; - glyph = this.charToGlyph(charcode, isSpace); - glyphs.push(glyph); - } - } else { - for (i = 0, ii = chars.length; i < ii; ++i) { - charcode = chars.charCodeAt(i); - glyph = this.charToGlyph(charcode, charcode === 0x20); - glyphs.push(glyph); - } - } - - // Enter the translated string into the cache - return (charsCache[charsCacheKey] = glyphs); - } - }; - - return Font; -})(); - -var ErrorFont = (function ErrorFontClosure() { - function ErrorFont(error) { - this.error = error; - this.loadedName = 'g_font_error'; - this.loading = false; - } - - ErrorFont.prototype = { - charsToGlyphs: function ErrorFont_charsToGlyphs() { - return []; - }, - exportData: function ErrorFont_exportData() { - return {error: this.error}; - } - }; - - return ErrorFont; -})(); - -/** - * Shared logic for building a char code to glyph id mapping for Type1 and - * simple CFF fonts. See section 9.6.6.2 of the spec. - * @param {Object} properties Font properties object. - * @param {Object} builtInEncoding The encoding contained within the actual font - * data. - * @param {Array} Array of glyph names where the index is the glyph ID. - * @returns {Object} A char code to glyph ID map. - */ -function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { - var charCodeToGlyphId = Object.create(null); - var glyphId, charCode, baseEncoding; - - if (properties.baseEncodingName) { - // If a valid base encoding name was used, the mapping is initialized with - // that. - baseEncoding = Encodings[properties.baseEncodingName]; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } else if (!!(properties.flags & FontFlags.Symbolic)) { - // For a symbolic font the encoding should be the fonts built-in - // encoding. - for (charCode in builtInEncoding) { - charCodeToGlyphId[charCode] = builtInEncoding[charCode]; - } - } else { - // For non-symbolic fonts that don't have a base encoding the standard - // encoding should be used. - baseEncoding = Encodings.StandardEncoding; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - - // Lastly, merge in the differences. - var differences = properties.differences; - if (differences) { - for (charCode in differences) { - var glyphName = differences[charCode]; - glyphId = glyphNames.indexOf(glyphName); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - return charCodeToGlyphId; -} - -/* - * CharStrings are encoded following the the CharString Encoding sequence - * describe in Chapter 6 of the "Adobe Type1 Font Format" specification. - * The value in a byte indicates a command, a number, or subsequent bytes - * that are to be interpreted in a special way. - * - * CharString Number Encoding: - * A CharString byte containing the values from 32 through 255 inclusive - * indicate an integer. These values are decoded in four ranges. - * - * 1. A CharString byte containing a value, v, between 32 and 246 inclusive, - * indicate the integer v - 139. Thus, the integer values from -107 through - * 107 inclusive may be encoded in single byte. - * - * 2. A CharString byte containing a value, v, between 247 and 250 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * [(v - 247) x 256] + w + 108 - * - * 3. A CharString byte containing a value, v, between 251 and 254 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * -[(v - 251) * 256] - w - 108 - * - * 4. A CharString containing the value 255 indicates that the next 4 bytes - * are a two complement signed integer. The first of these bytes contains the - * highest order bits, the second byte contains the next higher order bits - * and the fourth byte contain the lowest order bits. - * - * - * CharString Command Encoding: - * CharStrings commands are encoded in 1 or 2 bytes. - * - * Single byte commands are encoded in 1 byte that contains a value between - * 0 and 31 inclusive. - * If a command byte contains the value 12, then the value in the next byte - * indicates a command. This "escape" mechanism allows many extra commands - * to be encoded and this encoding technique helps to minimize the length of - * the charStrings. - */ -var Type1CharString = (function Type1CharStringClosure() { - var COMMAND_MAP = { - 'hstem': [1], - 'vstem': [3], - 'vmoveto': [4], - 'rlineto': [5], - 'hlineto': [6], - 'vlineto': [7], - 'rrcurveto': [8], - 'callsubr': [10], - 'flex': [12, 35], - 'drop' : [12, 18], - 'endchar': [14], - 'rmoveto': [21], - 'hmoveto': [22], - 'vhcurveto': [30], - 'hvcurveto': [31] - }; - - function Type1CharString() { - this.width = 0; - this.lsb = 0; - this.flexing = false; - this.output = []; - this.stack = []; - } - - Type1CharString.prototype = { - convert: function Type1CharString_convert(encoded, subrs) { - var count = encoded.length; - var error = false; - var wx, sbx, subrNumber; - for (var i = 0; i < count; i++) { - var value = encoded[i]; - if (value < 32) { - if (value === 12) { - value = (value << 8) + encoded[++i]; - } - switch (value) { - case 1: // hstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case 3: // vstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case 4: // vmoveto - if (this.flexing) { - if (this.stack.length < 1) { - error = true; - break; - } - // Add the dx for flex and but also swap the values so they are - // the right order. - var dy = this.stack.pop(); - this.stack.push(0, dy); - break; - } - error = this.executeCommand(1, COMMAND_MAP.vmoveto); - break; - case 5: // rlineto - error = this.executeCommand(2, COMMAND_MAP.rlineto); - break; - case 6: // hlineto - error = this.executeCommand(1, COMMAND_MAP.hlineto); - break; - case 7: // vlineto - error = this.executeCommand(1, COMMAND_MAP.vlineto); - break; - case 8: // rrcurveto - error = this.executeCommand(6, COMMAND_MAP.rrcurveto); - break; - case 9: // closepath - // closepath is a Type1 command that does not take argument and is - // useless in Type2 and it can simply be ignored. - this.stack = []; - break; - case 10: // callsubr - if (this.stack.length < 1) { - error = true; - break; - } - subrNumber = this.stack.pop(); - error = this.convert(subrs[subrNumber], subrs); - break; - case 11: // return - return error; - case 13: // hsbw - if (this.stack.length < 2) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use hmoveto with lsb. - wx = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx); - error = this.executeCommand(2, COMMAND_MAP.hmoveto); - break; - case 14: // endchar - this.output.push(COMMAND_MAP.endchar[0]); - break; - case 21: // rmoveto - if (this.flexing) { - break; - } - error = this.executeCommand(2, COMMAND_MAP.rmoveto); - break; - case 22: // hmoveto - if (this.flexing) { - // Add the dy for flex. - this.stack.push(0); - break; - } - error = this.executeCommand(1, COMMAND_MAP.hmoveto); - break; - case 30: // vhcurveto - error = this.executeCommand(4, COMMAND_MAP.vhcurveto); - break; - case 31: // hvcurveto - error = this.executeCommand(4, COMMAND_MAP.hvcurveto); - break; - case (12 << 8) + 0: // dotsection - // dotsection is a Type1 command to specify some hinting feature - // for dots that do not take a parameter and it can safely be - // ignored for Type2. - this.stack = []; - break; - case (12 << 8) + 1: // vstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // [vh]stem3 are Type1 only and Type2 supports [vh]stem with - // multiple parameters, so instead of returning [vh]stem3 take a - // shortcut and return [vhstem] instead. - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case (12 << 8) + 2: // hstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // See vstem3. - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case (12 << 8) + 6: // seac - // seac is like type 2's special endchar but it doesn't use the - // first argument asb, so remove it. - if (SEAC_ANALYSIS_ENABLED) { - this.seac = this.stack.splice(-4, 4); - error = this.executeCommand(0, COMMAND_MAP.endchar); - } else { - error = this.executeCommand(4, COMMAND_MAP.endchar); - } - break; - case (12 << 8) + 7: // sbw - if (this.stack.length < 4) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use rmoveto with - // (dx, dy). The height argument will not be used for vmtx and - // vhea tables reconstruction -- ignoring it. - var wy = this.stack.pop(); - wx = this.stack.pop(); - var sby = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx, sby); - error = this.executeCommand(3, COMMAND_MAP.rmoveto); - break; - case (12 << 8) + 12: // div - if (this.stack.length < 2) { - error = true; - break; - } - var num2 = this.stack.pop(); - var num1 = this.stack.pop(); - this.stack.push(num1 / num2); - break; - case (12 << 8) + 16: // callothersubr - if (this.stack.length < 2) { - error = true; - break; - } - subrNumber = this.stack.pop(); - var numArgs = this.stack.pop(); - if (subrNumber === 0 && numArgs === 3) { - var flexArgs = this.stack.splice(this.stack.length - 17, 17); - this.stack.push( - flexArgs[2] + flexArgs[0], // bcp1x + rpx - flexArgs[3] + flexArgs[1], // bcp1y + rpy - flexArgs[4], // bcp2x - flexArgs[5], // bcp2y - flexArgs[6], // p2x - flexArgs[7], // p2y - flexArgs[8], // bcp3x - flexArgs[9], // bcp3y - flexArgs[10], // bcp4x - flexArgs[11], // bcp4y - flexArgs[12], // p3x - flexArgs[13], // p3y - flexArgs[14] // flexDepth - // 15 = finalx unused by flex - // 16 = finaly unused by flex - ); - error = this.executeCommand(13, COMMAND_MAP.flex, true); - this.flexing = false; - this.stack.push(flexArgs[15], flexArgs[16]); - } else if (subrNumber === 1 && numArgs === 0) { - this.flexing = true; - } - break; - case (12 << 8) + 17: // pop - // Ignore this since it is only used with othersubr. - break; - case (12 << 8) + 33: // setcurrentpoint - // Ignore for now. - this.stack = []; - break; - default: - warn('Unknown type 1 charstring command of "' + value + '"'); - break; - } - if (error) { - break; - } - continue; - } else if (value <= 246) { - value = value - 139; - } else if (value <= 250) { - value = ((value - 247) * 256) + encoded[++i] + 108; - } else if (value <= 254) { - value = -((value - 251) * 256) - encoded[++i] - 108; - } else { - value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | - (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; - } - this.stack.push(value); - } - return error; - }, - - executeCommand: function(howManyArgs, command, keepStack) { - var stackLength = this.stack.length; - if (howManyArgs > stackLength) { - return true; - } - var start = stackLength - howManyArgs; - for (var i = start; i < stackLength; i++) { - var value = this.stack[i]; - if (value === (value | 0)) { // int - this.output.push(28, (value >> 8) & 0xff, value & 0xff); - } else { // fixed point - value = (65536 * value) | 0; - this.output.push(255, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF); - } - } - this.output.push.apply(this.output, command); - if (keepStack) { - this.stack.splice(start, howManyArgs); - } else { - this.stack.length = 0; - } - return false; - } - }; - - return Type1CharString; -})(); - -/* - * Type1Parser encapsulate the needed code for parsing a Type1 font - * program. Some of its logic depends on the Type2 charstrings - * structure. - * Note: this doesn't really parse the font since that would require evaluation - * of PostScript, but it is possible in most cases to extract what we need - * without a full parse. - */ -var Type1Parser = (function Type1ParserClosure() { - /* - * Decrypt a Sequence of Ciphertext Bytes to Produce the Original Sequence - * of Plaintext Bytes. The function took a key as a parameter which can be - * for decrypting the eexec block of for decoding charStrings. - */ - var EEXEC_ENCRYPT_KEY = 55665; - var CHAR_STRS_ENCRYPT_KEY = 4330; - - function isHexDigit(code) { - return code >= 48 && code <= 57 || // '0'-'9' - code >= 65 && code <= 70 || // 'A'-'F' - code >= 97 && code <= 102; // 'a'-'f' - } - - function decrypt(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length; - var decrypted = new Uint8Array(count); - for (var i = 0; i < count; i++) { - var value = data[i]; - decrypted[i] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - return Array.prototype.slice.call(decrypted, discardNumber); - } - - function decryptAscii(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length, maybeLength = count >>> 1; - var decrypted = new Uint8Array(maybeLength); - var i, j; - for (i = 0, j = 0; i < count; i++) { - var digit1 = data[i]; - if (!isHexDigit(digit1)) { - continue; - } - i++; - var digit2; - while (i < count && !isHexDigit(digit2 = data[i])) { - i++; - } - if (i < count) { - var value = parseInt(String.fromCharCode(digit1, digit2), 16); - decrypted[j++] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - } - return Array.prototype.slice.call(decrypted, discardNumber, j); - } - - function isSpecial(c) { - return c === 0x2F || // '/' - c === 0x5B || c === 0x5D || // '[', ']' - c === 0x7B || c === 0x7D || // '{', '}' - c === 0x28 || c === 0x29; // '(', ')' - } - - function Type1Parser(stream, encrypted) { - if (encrypted) { - var data = stream.getBytes(); - var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && - isHexDigit(data[2]) && isHexDigit(data[3])); - stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : - decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); - } - this.stream = stream; - this.nextChar(); - } - - Type1Parser.prototype = { - readNumberArray: function Type1Parser_readNumberArray() { - this.getToken(); // read '[' or '{' (arrays can start with either) - var array = []; - while (true) { - var token = this.getToken(); - if (token === null || token === ']' || token === '}') { - break; - } - array.push(parseFloat(token || 0)); - } - return array; - }, - - readNumber: function Type1Parser_readNumber() { - var token = this.getToken(); - return parseFloat(token || 0); - }, - - readInt: function Type1Parser_readInt() { - // Use '| 0' to prevent setting a double into length such as the double - // does not flow into the loop variable. - var token = this.getToken(); - return parseInt(token || 0, 10) | 0; - }, - - readBoolean: function Type1Parser_readBoolean() { - var token = this.getToken(); - - // Use 1 and 0 since that's what type2 charstrings use. - return token === 'true' ? 1 : 0; - }, - - nextChar : function Type1_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - - getToken: function Type1Parser_getToken() { - // Eat whitespace and comments. - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch === -1) { - return null; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!Lexer.isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - if (isSpecial(ch)) { - this.nextChar(); - return String.fromCharCode(ch); - } - var token = ''; - do { - token += String.fromCharCode(ch); - ch = this.nextChar(); - } while (ch >= 0 && !Lexer.isSpace(ch) && !isSpecial(ch)); - return token; - }, - - /* - * Returns an object containing a Subrs array and a CharStrings - * array extracted from and eexec encrypted block of data - */ - extractFontProgram: function Type1Parser_extractFontProgram() { - var stream = this.stream; - - var subrs = [], charstrings = []; - var program = { - subrs: [], - charstrings: [], - properties: { - 'privateData': { - 'lenIV': 4 - } - } - }; - var token, length, data, lenIV, encoded; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'CharStrings': - // The number immediately following CharStrings must be greater or - // equal to the number of CharStrings. - this.getToken(); - this.getToken(); // read in 'dict' - this.getToken(); // read in 'dup' - this.getToken(); // read in 'begin' - while(true) { - token = this.getToken(); - if (token === null || token === 'end') { - break; - } - - if (token !== '/') { - continue; - } - var glyph = this.getToken(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'ND' or '|-' - if (token === 'noaccess') { - this.getToken(); // read in 'def' - } - charstrings.push({ - glyph: glyph, - encoded: encoded - }); - } - break; - case 'Subrs': - var num = this.readInt(); - this.getToken(); // read in 'array' - while ((token = this.getToken()) === 'dup') { - var index = this.readInt(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'NP' or '|' - if (token === 'noaccess') { - this.getToken(); // read in 'put' - } - subrs[index] = encoded; - } - break; - case 'BlueValues': - case 'OtherBlues': - case 'FamilyBlues': - case 'FamilyOtherBlues': - var blueArray = this.readNumberArray(); - // *Blue* values may contain invalid data: disables reading of - // those values when hinting is disabled. - if (blueArray.length > 0 && (blueArray.length % 2) === 0 && - HINTING_ENABLED) { - program.properties.privateData[token] = blueArray; - } - break; - case 'StemSnapH': - case 'StemSnapV': - program.properties.privateData[token] = this.readNumberArray(); - break; - case 'StdHW': - case 'StdVW': - program.properties.privateData[token] = - this.readNumberArray()[0]; - break; - case 'BlueShift': - case 'lenIV': - case 'BlueFuzz': - case 'BlueScale': - case 'LanguageGroup': - case 'ExpansionFactor': - program.properties.privateData[token] = this.readNumber(); - break; - case 'ForceBold': - program.properties.privateData[token] = this.readBoolean(); - break; - } - } - - for (var i = 0; i < charstrings.length; i++) { - glyph = charstrings[i].glyph; - encoded = charstrings[i].encoded; - var charString = new Type1CharString(); - var error = charString.convert(encoded, subrs); - var output = charString.output; - if (error) { - // It seems when FreeType encounters an error while evaluating a glyph - // that it completely ignores the glyph so we'll mimic that behaviour - // here and put an endchar to make the validator happy. - output = [14]; - } - program.charstrings.push({ - glyphName: glyph, - charstring: output, - width: charString.width, - lsb: charString.lsb, - seac: charString.seac - }); - } - - return program; - }, - - extractFontHeader: function Type1Parser_extractFontHeader(properties) { - var token; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'FontMatrix': - var matrix = this.readNumberArray(); - properties.fontMatrix = matrix; - break; - case 'Encoding': - var encodingArg = this.getToken(); - var encoding; - if (!/^\d+$/.test(encodingArg)) { - // encoding name is specified - encoding = Encodings[encodingArg]; - } else { - encoding = []; - var size = parseInt(encodingArg, 10) | 0; - this.getToken(); // read in 'array' - - for (var j = 0; j < size; j++) { - token = this.getToken(); - // skipping till first dup or def (e.g. ignoring for statement) - while (token !== 'dup' && token !== 'def') { - token = this.getToken(); - if (token === null) { - return; // invalid header - } - } - if (token === 'def') { - break; // read all array data - } - var index = this.readInt(); - this.getToken(); // read in '/' - var glyph = this.getToken(); - encoding[index] = glyph; - this.getToken(); // read the in 'put' - } - } - properties.builtInEncoding = encoding; - break; - case 'FontBBox': - var fontBBox = this.readNumberArray(); - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - break; - } - } - } - }; - - return Type1Parser; -})(); - -/** - * The CFF class takes a Type1 file and wrap it into a - * 'Compact Font Format' which itself embed Type2 charstrings. - */ -var CFFStandardStrings = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', - 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', - 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', - 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', - 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', - 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', - 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', - 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', - 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', - 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', - 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', - 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', - 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', - 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', - 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', - 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', - 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', - 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', - 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', - 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', - 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', - 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron', 'exclamsmall', - 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', - 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', - 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', - 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', - 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', - 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', - 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', - 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', - 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'questiondownsmall', 'oneeighth', - 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', - 'zerosuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', - 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', - 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', - 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', - 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', - 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', - 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', - 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', - 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', - 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', - 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', - 'Thornsmall', 'Ydieresissmall', '001.000', '001.001', '001.002', '001.003', - 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold' -]; - -// Type1Font is also a CIDFontType0. -var Type1Font = function Type1Font(name, file, properties) { - // Some bad generators embed pfb file as is, we have to strip 6-byte headers. - // Also, length1 and length2 might be off by 6 bytes as well. - // http://www.math.ubc.ca/~cass/piscript/type1.pdf - var PFB_HEADER_SIZE = 6; - var headerBlockLength = properties.length1; - var eexecBlockLength = properties.length2; - var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); - var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; - if (pfbHeaderPresent) { - file.skip(PFB_HEADER_SIZE); - headerBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Get the data block containing glyphs and subrs informations - var headerBlock = new Stream(file.getBytes(headerBlockLength)); - var headerBlockParser = new Type1Parser(headerBlock); - headerBlockParser.extractFontHeader(properties); - - if (pfbHeaderPresent) { - pfbHeader = file.getBytes(PFB_HEADER_SIZE); - eexecBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Decrypt the data blocks and retrieve it's content - var eexecBlock = new Stream(file.getBytes(eexecBlockLength)); - var eexecBlockParser = new Type1Parser(eexecBlock, true); - var data = eexecBlockParser.extractFontProgram(); - for (var info in data.properties) { - properties[info] = data.properties[info]; - } - - var charstrings = data.charstrings; - var type2Charstrings = this.getType2Charstrings(charstrings); - var subrs = this.getType2Subrs(data.subrs); - - this.charstrings = charstrings; - this.data = this.wrap(name, type2Charstrings, this.charstrings, - subrs, properties); - this.seacs = this.getSeacs(data.charstrings); -}; - -Type1Font.prototype = { - get numGlyphs() { - return this.charstrings.length + 1; - }, - - getCharset: function Type1Font_getCharset() { - var charset = ['.notdef']; - var charstrings = this.charstrings; - for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { - charset.push(charstrings[glyphId].glyphName); - } - return charset; - }, - - getGlyphMapping: function Type1Font_getGlyphMapping(properties) { - var charstrings = this.charstrings; - var glyphNames = ['.notdef'], glyphId; - for (glyphId = 0; glyphId < charstrings.length; glyphId++) { - glyphNames.push(charstrings[glyphId].glyphName); - } - var encoding = properties.builtInEncoding; - if (encoding) { - var builtInEncoding = {}; - for (var charCode in encoding) { - glyphId = glyphNames.indexOf(encoding[charCode]); - if (glyphId >= 0) { - builtInEncoding[charCode] = glyphId; - } - } - } - - return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); - }, - - getSeacs: function Type1Font_getSeacs(charstrings) { - var i, ii; - var seacMap = []; - for (i = 0, ii = charstrings.length; i < ii; i++) { - var charstring = charstrings[i]; - if (charstring.seac) { - // Offset by 1 for .notdef - seacMap[i + 1] = charstring.seac; - } - } - return seacMap; - }, - - getType2Charstrings: function Type1Font_getType2Charstrings( - type1Charstrings) { - var type2Charstrings = []; - for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { - type2Charstrings.push(type1Charstrings[i].charstring); - } - return type2Charstrings; - }, - - getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { - var bias = 0; - var count = type1Subrs.length; - if (count < 1133) { - bias = 107; - } else if (count < 33769) { - bias = 1131; - } else { - bias = 32768; - } - - // Add a bunch of empty subrs to deal with the Type2 bias - var type2Subrs = []; - var i; - for (i = 0; i < bias; i++) { - type2Subrs.push([0x0B]); - } - - for (i = 0; i < count; i++) { - type2Subrs.push(type1Subrs[i]); - } - - return type2Subrs; - }, - - wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { - var cff = new CFF(); - cff.header = new CFFHeader(1, 0, 4, 4); - - cff.names = [name]; - - var topDict = new CFFTopDict(); - // CFF strings IDs 0...390 are predefined names, so refering - // to entries in our own String INDEX starts at SID 391. - topDict.setByName('version', 391); - topDict.setByName('Notice', 392); - topDict.setByName('FullName', 393); - topDict.setByName('FamilyName', 394); - topDict.setByName('Weight', 395); - topDict.setByName('Encoding', null); // placeholder - topDict.setByName('FontMatrix', properties.fontMatrix); - topDict.setByName('FontBBox', properties.bbox); - topDict.setByName('charset', null); // placeholder - topDict.setByName('CharStrings', null); // placeholder - topDict.setByName('Private', null); // placeholder - cff.topDict = topDict; - - var strings = new CFFStrings(); - strings.add('Version 0.11'); // Version - strings.add('See original notice'); // Notice - strings.add(name); // FullName - strings.add(name); // FamilyName - strings.add('Medium'); // Weight - cff.strings = strings; - - cff.globalSubrIndex = new CFFIndex(); - - var count = glyphs.length; - var charsetArray = [0]; - var i, ii; - for (i = 0; i < count; i++) { - var index = CFFStandardStrings.indexOf(charstrings[i].glyphName); - // TODO: Insert the string and correctly map it. Previously it was - // thought mapping names that aren't in the standard strings to .notdef - // was fine, however in issue818 when mapping them all to .notdef the - // adieresis glyph no longer worked. - if (index === -1) { - index = 0; - } - charsetArray.push((index >> 8) & 0xff, index & 0xff); - } - cff.charset = new CFFCharset(false, 0, [], charsetArray); - - var charStringsIndex = new CFFIndex(); - charStringsIndex.add([0x8B, 0x0E]); // .notdef - for (i = 0; i < count; i++) { - charStringsIndex.add(glyphs[i]); - } - cff.charStrings = charStringsIndex; - - var privateDict = new CFFPrivateDict(); - privateDict.setByName('Subrs', null); // placeholder - var fields = [ - 'BlueValues', - 'OtherBlues', - 'FamilyBlues', - 'FamilyOtherBlues', - 'StemSnapH', - 'StemSnapV', - 'BlueShift', - 'BlueFuzz', - 'BlueScale', - 'LanguageGroup', - 'ExpansionFactor', - 'ForceBold', - 'StdHW', - 'StdVW' - ]; - for (i = 0, ii = fields.length; i < ii; i++) { - var field = fields[i]; - if (!properties.privateData.hasOwnProperty(field)) { - continue; - } - var value = properties.privateData[field]; - if (isArray(value)) { - // All of the private dictionary array data in CFF must be stored as - // "delta-encoded" numbers. - for (var j = value.length - 1; j > 0; j--) { - value[j] -= value[j - 1]; // ... difference from previous value - } - } - privateDict.setByName(field, value); - } - cff.topDict.privateDict = privateDict; - - var subrIndex = new CFFIndex(); - for (i = 0, ii = subrs.length; i < ii; i++) { - subrIndex.add(subrs[i]); - } - privateDict.subrsIndex = subrIndex; - - var compiler = new CFFCompiler(cff); - return compiler.compile(); - } -}; - -var CFFFont = (function CFFFontClosure() { - function CFFFont(file, properties) { - this.properties = properties; - - var parser = new CFFParser(file, properties); - this.cff = parser.parse(); - var compiler = new CFFCompiler(this.cff); - this.seacs = this.cff.seacs; - try { - this.data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - // There may have just been an issue with the compiler, set the data - // anyway and hope the font loaded. - this.data = file; - } - } - - CFFFont.prototype = { - get numGlyphs() { - return this.cff.charStrings.count; - }, - getCharset: function CFFFont_getCharset() { - return this.cff.charset.charset; - }, - getGlyphMapping: function CFFFont_getGlyphMapping() { - var cff = this.cff; - var properties = this.properties; - var charsets = cff.charset.charset; - var charCodeToGlyphId; - var glyphId; - - if (properties.composite) { - charCodeToGlyphId = Object.create(null); - if (cff.isCIDFont) { - // If the font is actually a CID font then we should use the charset - // to map CIDs to GIDs. - for (glyphId = 0; glyphId < charsets.length; glyphId++) { - var cid = charsets[glyphId]; - var charCode = properties.cMap.charCodeOf(cid); - charCodeToGlyphId[charCode] = glyphId; - } - } else { - // If it is NOT actually a CID font then CIDs should be mapped - // directly to GIDs. - for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { - charCodeToGlyphId[glyphId] = glyphId; - } - } - return charCodeToGlyphId; - } - - var encoding = cff.encoding ? cff.encoding.encoding : null; - charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); - return charCodeToGlyphId; - } - }; - - return CFFFont; -})(); - -var CFFParser = (function CFFParserClosure() { - var CharstringValidationData = [ - null, - { id: 'hstem', min: 2, stackClearing: true, stem: true }, - null, - { id: 'vstem', min: 2, stackClearing: true, stem: true }, - { id: 'vmoveto', min: 1, stackClearing: true }, - { id: 'rlineto', min: 2, resetStack: true }, - { id: 'hlineto', min: 1, resetStack: true }, - { id: 'vlineto', min: 1, resetStack: true }, - { id: 'rrcurveto', min: 6, resetStack: true }, - null, - { id: 'callsubr', min: 1, undefStack: true }, - { id: 'return', min: 0, undefStack: true }, - null, // 12 - null, - { id: 'endchar', min: 0, stackClearing: true }, - null, - null, - null, - { id: 'hstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'hintmask', min: 0, stackClearing: true }, - { id: 'cntrmask', min: 0, stackClearing: true }, - { id: 'rmoveto', min: 2, stackClearing: true }, - { id: 'hmoveto', min: 1, stackClearing: true }, - { id: 'vstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'rcurveline', min: 8, resetStack: true }, - { id: 'rlinecurve', min: 8, resetStack: true }, - { id: 'vvcurveto', min: 4, resetStack: true }, - { id: 'hhcurveto', min: 4, resetStack: true }, - null, // shortint - { id: 'callgsubr', min: 1, undefStack: true }, - { id: 'vhcurveto', min: 4, resetStack: true }, - { id: 'hvcurveto', min: 4, resetStack: true } - ]; - var CharstringValidationData12 = [ - null, - null, - null, - { id: 'and', min: 2, stackDelta: -1 }, - { id: 'or', min: 2, stackDelta: -1 }, - { id: 'not', min: 1, stackDelta: 0 }, - null, - null, - null, - { id: 'abs', min: 1, stackDelta: 0 }, - { id: 'add', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] + stack[index - 1]; - } - }, - { id: 'sub', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] - stack[index - 1]; - } - }, - { id: 'div', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] / stack[index - 1]; - } - }, - null, - { id: 'neg', min: 1, stackDelta: 0, - stackFn: function stack_div(stack, index) { - stack[index - 1] = -stack[index - 1]; - } - }, - { id: 'eq', min: 2, stackDelta: -1 }, - null, - null, - { id: 'drop', min: 1, stackDelta: -1 }, - null, - { id: 'put', min: 2, stackDelta: -2 }, - { id: 'get', min: 1, stackDelta: 0 }, - { id: 'ifelse', min: 4, stackDelta: -3 }, - { id: 'random', min: 0, stackDelta: 1 }, - { id: 'mul', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] * stack[index - 1]; - } - }, - null, - { id: 'sqrt', min: 1, stackDelta: 0 }, - { id: 'dup', min: 1, stackDelta: 1 }, - { id: 'exch', min: 2, stackDelta: 0 }, - { id: 'index', min: 2, stackDelta: 0 }, - { id: 'roll', min: 3, stackDelta: -2 }, - null, - null, - null, - { id: 'hflex', min: 7, resetStack: true }, - { id: 'flex', min: 13, resetStack: true }, - { id: 'hflex1', min: 9, resetStack: true }, - { id: 'flex1', min: 11, resetStack: true } - ]; - - function CFFParser(file, properties) { - this.bytes = file.getBytes(); - this.properties = properties; - } - CFFParser.prototype = { - parse: function CFFParser_parse() { - var properties = this.properties; - var cff = new CFF(); - this.cff = cff; - - // The first five sections must be in order, all the others are reached - // via offsets contained in one of the below. - var header = this.parseHeader(); - var nameIndex = this.parseIndex(header.endPos); - var topDictIndex = this.parseIndex(nameIndex.endPos); - var stringIndex = this.parseIndex(topDictIndex.endPos); - var globalSubrIndex = this.parseIndex(stringIndex.endPos); - - var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); - var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); - - cff.header = header.obj; - cff.names = this.parseNameIndex(nameIndex.obj); - cff.strings = this.parseStringIndex(stringIndex.obj); - cff.topDict = topDict; - cff.globalSubrIndex = globalSubrIndex.obj; - - this.parsePrivateDict(cff.topDict); - - cff.isCIDFont = topDict.hasName('ROS'); - - var charStringOffset = topDict.getByName('CharStrings'); - var charStringIndex = this.parseIndex(charStringOffset).obj; - - var fontMatrix = topDict.getByName('FontMatrix'); - if (fontMatrix) { - properties.fontMatrix = fontMatrix; - } - - var fontBBox = topDict.getByName('FontBBox'); - if (fontBBox) { - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - } - - var charset, encoding; - if (cff.isCIDFont) { - var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; - for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { - var dictRaw = fdArrayIndex.get(i); - var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), - cff.strings); - this.parsePrivateDict(fontDict); - cff.fdArray.push(fontDict); - } - // cid fonts don't have an encoding - encoding = null; - charset = this.parseCharsets(topDict.getByName('charset'), - charStringIndex.count, cff.strings, true); - cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), - charStringIndex.count); - } else { - charset = this.parseCharsets(topDict.getByName('charset'), - charStringIndex.count, cff.strings, false); - encoding = this.parseEncoding(topDict.getByName('Encoding'), - properties, - cff.strings, charset.charset); - } - - cff.charset = charset; - cff.encoding = encoding; - - var charStringsAndSeacs = this.parseCharStrings( - charStringIndex, - topDict.privateDict.subrsIndex, - globalSubrIndex.obj, - cff.fdSelect, - cff.fdArray); - cff.charStrings = charStringsAndSeacs.charStrings; - cff.seacs = charStringsAndSeacs.seacs; - cff.widths = charStringsAndSeacs.widths; - - return cff; - }, - parseHeader: function CFFParser_parseHeader() { - var bytes = this.bytes; - var bytesLength = bytes.length; - var offset = 0; - - // Prevent an infinite loop, by checking that the offset is within the - // bounds of the bytes array. Necessary in empty, or invalid, font files. - while (offset < bytesLength && bytes[offset] !== 1) { - ++offset; - } - if (offset >= bytesLength) { - error('Invalid CFF header'); - } else if (offset !== 0) { - info('cff data is shifted'); - bytes = bytes.subarray(offset); - this.bytes = bytes; - } - var major = bytes[0]; - var minor = bytes[1]; - var hdrSize = bytes[2]; - var offSize = bytes[3]; - var header = new CFFHeader(major, minor, hdrSize, offSize); - return { obj: header, endPos: hdrSize }; - }, - parseDict: function CFFParser_parseDict(dict) { - var pos = 0; - - function parseOperand() { - var value = dict[pos++]; - if (value === 30) { - return parseFloatOperand(pos); - } else if (value === 28) { - value = dict[pos++]; - value = ((value << 24) | (dict[pos++] << 16)) >> 16; - return value; - } else if (value === 29) { - value = dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - return value; - } else if (value >= 32 && value <= 246) { - return value - 139; - } else if (value >= 247 && value <= 250) { - return ((value - 247) * 256) + dict[pos++] + 108; - } else if (value >= 251 && value <= 254) { - return -((value - 251) * 256) - dict[pos++] - 108; - } else { - error('255 is not a valid DICT command'); - } - return -1; - } - - function parseFloatOperand() { - var str = ''; - var eof = 15; - var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', '.', 'E', 'E-', null, '-']; - var length = dict.length; - while (pos < length) { - var b = dict[pos++]; - var b1 = b >> 4; - var b2 = b & 15; - - if (b1 === eof) { - break; - } - str += lookup[b1]; - - if (b2 === eof) { - break; - } - str += lookup[b2]; - } - return parseFloat(str); - } - - var operands = []; - var entries = []; - - pos = 0; - var end = dict.length; - while (pos < end) { - var b = dict[pos]; - if (b <= 21) { - if (b === 12) { - b = (b << 8) | dict[++pos]; - } - entries.push([b, operands]); - operands = []; - ++pos; - } else { - operands.push(parseOperand()); - } - } - return entries; - }, - parseIndex: function CFFParser_parseIndex(pos) { - var cffIndex = new CFFIndex(); - var bytes = this.bytes; - var count = (bytes[pos++] << 8) | bytes[pos++]; - var offsets = []; - var end = pos; - var i, ii; - - if (count !== 0) { - var offsetSize = bytes[pos++]; - // add 1 for offset to determine size of last object - var startPos = pos + ((count + 1) * offsetSize) - 1; - - for (i = 0, ii = count + 1; i < ii; ++i) { - var offset = 0; - for (var j = 0; j < offsetSize; ++j) { - offset <<= 8; - offset += bytes[pos++]; - } - offsets.push(startPos + offset); - } - end = offsets[count]; - } - for (i = 0, ii = offsets.length - 1; i < ii; ++i) { - var offsetStart = offsets[i]; - var offsetEnd = offsets[i + 1]; - cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); - } - return {obj: cffIndex, endPos: end}; - }, - parseNameIndex: function CFFParser_parseNameIndex(index) { - var names = []; - for (var i = 0, ii = index.count; i < ii; ++i) { - var name = index.get(i); - // OTS doesn't allow names to be over 127 characters. - var length = Math.min(name.length, 127); - var data = []; - // OTS also only permits certain characters in the name. - for (var j = 0; j < length; ++j) { - var c = name[j]; - if (j === 0 && c === 0) { - data[j] = c; - continue; - } - if ((c < 33 || c > 126) || c === 91 /* [ */ || c === 93 /* ] */ || - c === 40 /* ( */ || c === 41 /* ) */ || c === 123 /* { */ || - c === 125 /* } */ || c === 60 /* < */ || c === 62 /* > */ || - c === 47 /* / */ || c === 37 /* % */ || c === 35 /* # */) { - data[j] = 95; - continue; - } - data[j] = c; - } - names.push(bytesToString(data)); - } - return names; - }, - parseStringIndex: function CFFParser_parseStringIndex(index) { - var strings = new CFFStrings(); - for (var i = 0, ii = index.count; i < ii; ++i) { - var data = index.get(i); - strings.add(bytesToString(data)); - } - return strings; - }, - createDict: function CFFParser_createDict(Type, dict, strings) { - var cffDict = new Type(strings); - for (var i = 0, ii = dict.length; i < ii; ++i) { - var pair = dict[i]; - var key = pair[0]; - var value = pair[1]; - cffDict.setByKey(key, value); - } - return cffDict; - }, - parseCharString: function CFFParser_parseCharString(state, data, - localSubrIndex, - globalSubrIndex) { - if (state.callDepth > MAX_SUBR_NESTING) { - return false; - } - var stackSize = state.stackSize; - var stack = state.stack; - - var length = data.length; - - for (var j = 0; j < length;) { - var value = data[j++]; - var validationCommand = null; - if (value === 12) { - var q = data[j++]; - if (q === 0) { - // The CFF specification state that the 'dotsection' command - // (12, 0) is deprecated and treated as a no-op, but all Type2 - // charstrings processors should support them. Unfortunately - // the font sanitizer don't. As a workaround the sequence (12, 0) - // is replaced by a useless (0, hmoveto). - data[j - 2] = 139; - data[j - 1] = 22; - stackSize = 0; - } else { - validationCommand = CharstringValidationData12[q]; - } - } else if (value === 28) { // number (16 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16; - j += 2; - stackSize++; - } else if (value === 14) { - if (stackSize >= 4) { - stackSize -= 4; - if (SEAC_ANALYSIS_ENABLED) { - state.seac = stack.slice(stackSize, stackSize + 4); - return false; - } - } - validationCommand = CharstringValidationData[value]; - } else if (value >= 32 && value <= 246) { // number - stack[stackSize] = value - 139; - stackSize++; - } else if (value >= 247 && value <= 254) { // number (+1 bytes) - stack[stackSize] = (value < 251 ? - ((value - 247) << 8) + data[j] + 108 : - -((value - 251) << 8) - data[j] - 108); - j++; - stackSize++; - } else if (value === 255) { // number (32 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16) | - (data[j + 2] << 8) | data[j + 3]) / 65536; - j += 4; - stackSize++; - } else if (value === 19 || value === 20) { - state.hints += stackSize >> 1; - // skipping right amount of hints flag data - j += (state.hints + 7) >> 3; - stackSize %= 2; - validationCommand = CharstringValidationData[value]; - } else if (value === 10 || value === 29) { - var subrsIndex; - if (value === 10) { - subrsIndex = localSubrIndex; - } else { - subrsIndex = globalSubrIndex; - } - if (!subrsIndex) { - validationCommand = CharstringValidationData[value]; - warn('Missing subrsIndex for ' + validationCommand.id); - return false; - } - var bias = 32768; - if (subrsIndex.count < 1240) { - bias = 107; - } else if (subrsIndex.count < 33900) { - bias = 1131; - } - var subrNumber = stack[--stackSize] + bias; - if (subrNumber < 0 || subrNumber >= subrsIndex.count) { - validationCommand = CharstringValidationData[value]; - warn('Out of bounds subrIndex for ' + validationCommand.id); - return false; - } - state.stackSize = stackSize; - state.callDepth++; - var valid = this.parseCharString(state, subrsIndex.get(subrNumber), - localSubrIndex, globalSubrIndex); - if (!valid) { - return false; - } - state.callDepth--; - stackSize = state.stackSize; - continue; - } else if (value === 11) { - state.stackSize = stackSize; - return true; - } else { - validationCommand = CharstringValidationData[value]; - } - if (validationCommand) { - if (validationCommand.stem) { - state.hints += stackSize >> 1; - } - if ('min' in validationCommand) { - if (!state.undefStack && stackSize < validationCommand.min) { - warn('Not enough parameters for ' + validationCommand.id + - '; actual: ' + stackSize + - ', expected: ' + validationCommand.min); - return false; - } - } - if (state.firstStackClearing && validationCommand.stackClearing) { - state.firstStackClearing = false; - // the optional character width can be found before the first - // stack-clearing command arguments - stackSize -= validationCommand.min; - if (stackSize >= 2 && validationCommand.stem) { - // there are even amount of arguments for stem commands - stackSize %= 2; - } else if (stackSize > 1) { - warn('Found too many parameters for stack-clearing command'); - } - if (stackSize > 0 && stack[stackSize - 1] >= 0) { - state.width = stack[stackSize - 1]; - } - } - if ('stackDelta' in validationCommand) { - if ('stackFn' in validationCommand) { - validationCommand.stackFn(stack, stackSize); - } - stackSize += validationCommand.stackDelta; - } else if (validationCommand.stackClearing) { - stackSize = 0; - } else if (validationCommand.resetStack) { - stackSize = 0; - state.undefStack = false; - } else if (validationCommand.undefStack) { - stackSize = 0; - state.undefStack = true; - state.firstStackClearing = false; - } - } - } - state.stackSize = stackSize; - return true; - }, - parseCharStrings: function CFFParser_parseCharStrings(charStrings, - localSubrIndex, - globalSubrIndex, - fdSelect, - fdArray) { - var seacs = []; - var widths = []; - var count = charStrings.count; - for (var i = 0; i < count; i++) { - var charstring = charStrings.get(i); - var state = { - callDepth: 0, - stackSize: 0, - stack: [], - undefStack: true, - hints: 0, - firstStackClearing: true, - seac: null, - width: null - }; - var valid = true; - var localSubrToUse = null; - if (fdSelect && fdArray.length) { - var fdIndex = fdSelect.getFDIndex(i); - if (fdIndex === -1) { - warn('Glyph index is not in fd select.'); - valid = false; - } - if (fdIndex >= fdArray.length) { - warn('Invalid fd index for glyph index.'); - valid = false; - } - if (valid) { - localSubrToUse = fdArray[fdIndex].privateDict.subrsIndex; - } - } else if (localSubrIndex) { - localSubrToUse = localSubrIndex; - } - if (valid) { - valid = this.parseCharString(state, charstring, localSubrToUse, - globalSubrIndex); - } - if (state.width !== null) { - widths[i] = state.width; - } - if (state.seac !== null) { - seacs[i] = state.seac; - } - if (!valid) { - // resetting invalid charstring to single 'endchar' - charStrings.set(i, new Uint8Array([14])); - } - } - return { charStrings: charStrings, seacs: seacs, widths: widths }; - }, - emptyPrivateDictionary: - function CFFParser_emptyPrivateDictionary(parentDict) { - var privateDict = this.createDict(CFFPrivateDict, [], - parentDict.strings); - parentDict.setByKey(18, [0, 0]); - parentDict.privateDict = privateDict; - }, - parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { - // no private dict, do nothing - if (!parentDict.hasName('Private')) { - this.emptyPrivateDictionary(parentDict); - return; - } - var privateOffset = parentDict.getByName('Private'); - // make sure the params are formatted correctly - if (!isArray(privateOffset) || privateOffset.length !== 2) { - parentDict.removeByName('Private'); - return; - } - var size = privateOffset[0]; - var offset = privateOffset[1]; - // remove empty dicts or ones that refer to invalid location - if (size === 0 || offset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - - var privateDictEnd = offset + size; - var dictData = this.bytes.subarray(offset, privateDictEnd); - var dict = this.parseDict(dictData); - var privateDict = this.createDict(CFFPrivateDict, dict, - parentDict.strings); - parentDict.privateDict = privateDict; - - // Parse the Subrs index also since it's relative to the private dict. - if (!privateDict.getByName('Subrs')) { - return; - } - var subrsOffset = privateDict.getByName('Subrs'); - var relativeOffset = offset + subrsOffset; - // Validate the offset. - if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - var subrsIndex = this.parseIndex(relativeOffset); - privateDict.subrsIndex = subrsIndex.obj; - }, - parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { - if (pos === 0) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, - ISOAdobeCharset); - } else if (pos === 1) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, - ExpertCharset); - } else if (pos === 2) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, - ExpertSubsetCharset); - } - - var bytes = this.bytes; - var start = pos; - var format = bytes[pos++]; - var charset = ['.notdef']; - var id, count, i; - - // subtract 1 for the .notdef glyph - length -= 1; - - switch (format) { - case 0: - for (i = 0; i < length; i++) { - id = (bytes[pos++] << 8) | bytes[pos++]; - charset.push(cid ? id : strings.get(id)); - } - break; - case 1: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - case 2: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - default: - error('Unknown charset format'); - } - // Raw won't be needed if we actually compile the charset. - var end = pos; - var raw = bytes.subarray(start, end); - - return new CFFCharset(false, format, charset, raw); - }, - parseEncoding: function CFFParser_parseEncoding(pos, - properties, - strings, - charset) { - var encoding = {}; - var bytes = this.bytes; - var predefined = false; - var hasSupplement = false; - var format, i, ii; - var raw = null; - - function readSupplement() { - var supplementsCount = bytes[pos++]; - for (i = 0; i < supplementsCount; i++) { - var code = bytes[pos++]; - var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); - encoding[code] = charset.indexOf(strings.get(sid)); - } - } - - if (pos === 0 || pos === 1) { - predefined = true; - format = pos; - var baseEncoding = pos ? Encodings.ExpertEncoding : - Encodings.StandardEncoding; - for (i = 0, ii = charset.length; i < ii; i++) { - var index = baseEncoding.indexOf(charset[i]); - if (index !== -1) { - encoding[index] = i; - } - } - } else { - var dataStart = pos; - format = bytes[pos++]; - switch (format & 0x7f) { - case 0: - var glyphsCount = bytes[pos++]; - for (i = 1; i <= glyphsCount; i++) { - encoding[bytes[pos++]] = i; - } - break; - - case 1: - var rangesCount = bytes[pos++]; - var gid = 1; - for (i = 0; i < rangesCount; i++) { - var start = bytes[pos++]; - var left = bytes[pos++]; - for (var j = start; j <= start + left; j++) { - encoding[j] = gid++; - } - } - break; - - default: - error('Unknow encoding format: ' + format + ' in CFF'); - break; - } - var dataEnd = pos; - if (format & 0x80) { - // The font sanitizer does not support CFF encoding with a - // supplement, since the encoding is not really used to map - // between gid to glyph, let's overwrite what is declared in - // the top dictionary to let the sanitizer think the font use - // StandardEncoding, that's a lie but that's ok. - bytes[dataStart] &= 0x7f; - readSupplement(); - hasSupplement = true; - } - raw = bytes.subarray(dataStart, dataEnd); - } - format = format & 0x7f; - return new CFFEncoding(predefined, format, encoding, raw); - }, - parseFDSelect: function CFFParser_parseFDSelect(pos, length) { - var start = pos; - var bytes = this.bytes; - var format = bytes[pos++]; - var fdSelect = []; - var i; - - switch (format) { - case 0: - for (i = 0; i < length; ++i) { - var id = bytes[pos++]; - fdSelect.push(id); - } - break; - case 3: - var rangesCount = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i < rangesCount; ++i) { - var first = (bytes[pos++] << 8) | bytes[pos++]; - var fdIndex = bytes[pos++]; - var next = (bytes[pos] << 8) | bytes[pos + 1]; - for (var j = first; j < next; ++j) { - fdSelect.push(fdIndex); - } - } - // Advance past the sentinel(next). - pos += 2; - break; - default: - error('Unknown fdselect format ' + format); - break; - } - var end = pos; - return new CFFFDSelect(fdSelect, bytes.subarray(start, end)); - } - }; - return CFFParser; -})(); - -// Compact Font Format -var CFF = (function CFFClosure() { - function CFF() { - this.header = null; - this.names = []; - this.topDict = null; - this.strings = new CFFStrings(); - this.globalSubrIndex = null; - - // The following could really be per font, but since we only have one font - // store them here. - this.encoding = null; - this.charset = null; - this.charStrings = null; - this.fdArray = []; - this.fdSelect = null; - - this.isCIDFont = false; - } - return CFF; -})(); - -var CFFHeader = (function CFFHeaderClosure() { - function CFFHeader(major, minor, hdrSize, offSize) { - this.major = major; - this.minor = minor; - this.hdrSize = hdrSize; - this.offSize = offSize; - } - return CFFHeader; -})(); - -var CFFStrings = (function CFFStringsClosure() { - function CFFStrings() { - this.strings = []; - } - CFFStrings.prototype = { - get: function CFFStrings_get(index) { - if (index >= 0 && index <= 390) { - return CFFStandardStrings[index]; - } - if (index - 391 <= this.strings.length) { - return this.strings[index - 391]; - } - return CFFStandardStrings[0]; - }, - add: function CFFStrings_add(value) { - this.strings.push(value); - }, - get count() { - return this.strings.length; - } - }; - return CFFStrings; -})(); - -var CFFIndex = (function CFFIndexClosure() { - function CFFIndex() { - this.objects = []; - this.length = 0; - } - CFFIndex.prototype = { - add: function CFFIndex_add(data) { - this.length += data.length; - this.objects.push(data); - }, - set: function CFFIndex_set(index, data) { - this.length += data.length - this.objects[index].length; - this.objects[index] = data; - }, - get: function CFFIndex_get(index) { - return this.objects[index]; - }, - get count() { - return this.objects.length; - } - }; - return CFFIndex; -})(); - -var CFFDict = (function CFFDictClosure() { - function CFFDict(tables, strings) { - this.keyToNameMap = tables.keyToNameMap; - this.nameToKeyMap = tables.nameToKeyMap; - this.defaults = tables.defaults; - this.types = tables.types; - this.opcodes = tables.opcodes; - this.order = tables.order; - this.strings = strings; - this.values = {}; - } - CFFDict.prototype = { - // value should always be an array - setByKey: function CFFDict_setByKey(key, value) { - if (!(key in this.keyToNameMap)) { - return false; - } - // ignore empty values - if (value.length === 0) { - return true; - } - var type = this.types[key]; - // remove the array wrapping these types of values - if (type === 'num' || type === 'sid' || type === 'offset') { - value = value[0]; - } - this.values[key] = value; - return true; - }, - setByName: function CFFDict_setByName(name, value) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - this.values[this.nameToKeyMap[name]] = value; - }, - hasName: function CFFDict_hasName(name) { - return this.nameToKeyMap[name] in this.values; - }, - getByName: function CFFDict_getByName(name) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - var key = this.nameToKeyMap[name]; - if (!(key in this.values)) { - return this.defaults[key]; - } - return this.values[key]; - }, - removeByName: function CFFDict_removeByName(name) { - delete this.values[this.nameToKeyMap[name]]; - } - }; - CFFDict.createTables = function CFFDict_createTables(layout) { - var tables = { - keyToNameMap: {}, - nameToKeyMap: {}, - defaults: {}, - types: {}, - opcodes: {}, - order: [] - }; - for (var i = 0, ii = layout.length; i < ii; ++i) { - var entry = layout[i]; - var key = isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; - tables.keyToNameMap[key] = entry[1]; - tables.nameToKeyMap[entry[1]] = key; - tables.types[key] = entry[2]; - tables.defaults[key] = entry[3]; - tables.opcodes[key] = isArray(entry[0]) ? entry[0] : [entry[0]]; - tables.order.push(key); - } - return tables; - }; - return CFFDict; -})(); - -var CFFTopDict = (function CFFTopDictClosure() { - var layout = [ - [[12, 30], 'ROS', ['sid', 'sid', 'num'], null], - [[12, 20], 'SyntheticBase', 'num', null], - [0, 'version', 'sid', null], - [1, 'Notice', 'sid', null], - [[12, 0], 'Copyright', 'sid', null], - [2, 'FullName', 'sid', null], - [3, 'FamilyName', 'sid', null], - [4, 'Weight', 'sid', null], - [[12, 1], 'isFixedPitch', 'num', 0], - [[12, 2], 'ItalicAngle', 'num', 0], - [[12, 3], 'UnderlinePosition', 'num', -100], - [[12, 4], 'UnderlineThickness', 'num', 50], - [[12, 5], 'PaintType', 'num', 0], - [[12, 6], 'CharstringType', 'num', 2], - [[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'], - [0.001, 0, 0, 0.001, 0, 0]], - [13, 'UniqueID', 'num', null], - [5, 'FontBBox', ['num', 'num', 'num', 'num'], [0, 0, 0, 0]], - [[12, 8], 'StrokeWidth', 'num', 0], - [14, 'XUID', 'array', null], - [15, 'charset', 'offset', 0], - [16, 'Encoding', 'offset', 0], - [17, 'CharStrings', 'offset', 0], - [18, 'Private', ['offset', 'offset'], null], - [[12, 21], 'PostScript', 'sid', null], - [[12, 22], 'BaseFontName', 'sid', null], - [[12, 23], 'BaseFontBlend', 'delta', null], - [[12, 31], 'CIDFontVersion', 'num', 0], - [[12, 32], 'CIDFontRevision', 'num', 0], - [[12, 33], 'CIDFontType', 'num', 0], - [[12, 34], 'CIDCount', 'num', 8720], - [[12, 35], 'UIDBase', 'num', null], - // XXX: CID Fonts on DirectWrite 6.1 only seem to work if FDSelect comes - // before FDArray. - [[12, 37], 'FDSelect', 'offset', null], - [[12, 36], 'FDArray', 'offset', null], - [[12, 38], 'FontName', 'sid', null] - ]; - var tables = null; - function CFFTopDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.privateDict = null; - } - CFFTopDict.prototype = Object.create(CFFDict.prototype); - return CFFTopDict; -})(); - -var CFFPrivateDict = (function CFFPrivateDictClosure() { - var layout = [ - [6, 'BlueValues', 'delta', null], - [7, 'OtherBlues', 'delta', null], - [8, 'FamilyBlues', 'delta', null], - [9, 'FamilyOtherBlues', 'delta', null], - [[12, 9], 'BlueScale', 'num', 0.039625], - [[12, 10], 'BlueShift', 'num', 7], - [[12, 11], 'BlueFuzz', 'num', 1], - [10, 'StdHW', 'num', null], - [11, 'StdVW', 'num', null], - [[12, 12], 'StemSnapH', 'delta', null], - [[12, 13], 'StemSnapV', 'delta', null], - [[12, 14], 'ForceBold', 'num', 0], - [[12, 17], 'LanguageGroup', 'num', 0], - [[12, 18], 'ExpansionFactor', 'num', 0.06], - [[12, 19], 'initialRandomSeed', 'num', 0], - [20, 'defaultWidthX', 'num', 0], - [21, 'nominalWidthX', 'num', 0], - [19, 'Subrs', 'offset', null] - ]; - var tables = null; - function CFFPrivateDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.subrsIndex = null; - } - CFFPrivateDict.prototype = Object.create(CFFDict.prototype); - return CFFPrivateDict; -})(); - -var CFFCharsetPredefinedTypes = { - ISO_ADOBE: 0, - EXPERT: 1, - EXPERT_SUBSET: 2 -}; -var CFFCharset = (function CFFCharsetClosure() { - function CFFCharset(predefined, format, charset, raw) { - this.predefined = predefined; - this.format = format; - this.charset = charset; - this.raw = raw; - } - return CFFCharset; -})(); - -var CFFEncoding = (function CFFEncodingClosure() { - function CFFEncoding(predefined, format, encoding, raw) { - this.predefined = predefined; - this.format = format; - this.encoding = encoding; - this.raw = raw; - } - return CFFEncoding; -})(); - -var CFFFDSelect = (function CFFFDSelectClosure() { - function CFFFDSelect(fdSelect, raw) { - this.fdSelect = fdSelect; - this.raw = raw; - } - CFFFDSelect.prototype = { - getFDIndex: function CFFFDSelect_get(glyphIndex) { - if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { - return -1; - } - return this.fdSelect[glyphIndex]; - } - }; - return CFFFDSelect; -})(); - -// Helper class to keep track of where an offset is within the data and helps -// filling in that offset once it's known. -var CFFOffsetTracker = (function CFFOffsetTrackerClosure() { - function CFFOffsetTracker() { - this.offsets = {}; - } - CFFOffsetTracker.prototype = { - isTracking: function CFFOffsetTracker_isTracking(key) { - return key in this.offsets; - }, - track: function CFFOffsetTracker_track(key, location) { - if (key in this.offsets) { - error('Already tracking location of ' + key); - } - this.offsets[key] = location; - }, - offset: function CFFOffsetTracker_offset(value) { - for (var key in this.offsets) { - this.offsets[key] += value; - } - }, - setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, - values, - output) { - if (!(key in this.offsets)) { - error('Not tracking location of ' + key); - } - var data = output.data; - var dataOffset = this.offsets[key]; - var size = 5; - for (var i = 0, ii = values.length; i < ii; ++i) { - var offset0 = i * size + dataOffset; - var offset1 = offset0 + 1; - var offset2 = offset0 + 2; - var offset3 = offset0 + 3; - var offset4 = offset0 + 4; - // It's easy to screw up offsets so perform this sanity check. - if (data[offset0] !== 0x1d || data[offset1] !== 0 || - data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { - error('writing to an offset that is not empty'); - } - var value = values[i]; - data[offset0] = 0x1d; - data[offset1] = (value >> 24) & 0xFF; - data[offset2] = (value >> 16) & 0xFF; - data[offset3] = (value >> 8) & 0xFF; - data[offset4] = value & 0xFF; - } - } - }; - return CFFOffsetTracker; -})(); - -// Takes a CFF and converts it to the binary representation. -var CFFCompiler = (function CFFCompilerClosure() { - function CFFCompiler(cff) { - this.cff = cff; - } - CFFCompiler.prototype = { - compile: function CFFCompiler_compile() { - var cff = this.cff; - var output = { - data: [], - length: 0, - add: function CFFCompiler_add(data) { - this.data = this.data.concat(data); - this.length = this.data.length; - } - }; - - // Compile the five entries that must be in order. - var header = this.compileHeader(cff.header); - output.add(header); - - var nameIndex = this.compileNameIndex(cff.names); - output.add(nameIndex); - - if (cff.isCIDFont) { - // The spec is unclear on how font matrices should relate to each other - // when there is one in the main top dict and the sub top dicts. - // Windows handles this differently than linux and osx so we have to - // normalize to work on all. - // Rules based off of some mailing list discussions: - // - If main font has a matrix and subfont doesn't, use the main matrix. - // - If no main font matrix and there is a subfont matrix, use the - // subfont matrix. - // - If both have matrices, concat together. - // - If neither have matrices, use default. - // To make this work on all platforms we move the top matrix into each - // sub top dict and concat if necessary. - if (cff.topDict.hasName('FontMatrix')) { - var base = cff.topDict.getByName('FontMatrix'); - cff.topDict.removeByName('FontMatrix'); - for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { - var subDict = cff.fdArray[i]; - var matrix = base.slice(0); - if (subDict.hasName('FontMatrix')) { - matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); - } - subDict.setByName('FontMatrix', matrix); - } - } - } - - var compiled = this.compileTopDicts([cff.topDict], - output.length, - cff.isCIDFont); - output.add(compiled.output); - var topDictTracker = compiled.trackers[0]; - - var stringIndex = this.compileStringIndex(cff.strings.strings); - output.add(stringIndex); - - var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); - output.add(globalSubrIndex); - - // Now start on the other entries that have no specfic order. - if (cff.encoding && cff.topDict.hasName('Encoding')) { - if (cff.encoding.predefined) { - topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], - output); - } else { - var encoding = this.compileEncoding(cff.encoding); - topDictTracker.setEntryLocation('Encoding', [output.length], output); - output.add(encoding); - } - } - - if (cff.charset && cff.topDict.hasName('charset')) { - if (cff.charset.predefined) { - topDictTracker.setEntryLocation('charset', [cff.charset.format], - output); - } else { - var charset = this.compileCharset(cff.charset); - topDictTracker.setEntryLocation('charset', [output.length], output); - output.add(charset); - } - } - - var charStrings = this.compileCharStrings(cff.charStrings); - topDictTracker.setEntryLocation('CharStrings', [output.length], output); - output.add(charStrings); - - if (cff.isCIDFont) { - // For some reason FDSelect must be in front of FDArray on windows. OSX - // and linux don't seem to care. - topDictTracker.setEntryLocation('FDSelect', [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect.raw); - output.add(fdSelect); - // It is unclear if the sub font dictionary can have CID related - // dictionary keys, but the sanitizer doesn't like them so remove them. - compiled = this.compileTopDicts(cff.fdArray, output.length, true); - topDictTracker.setEntryLocation('FDArray', [output.length], output); - output.add(compiled.output); - var fontDictTrackers = compiled.trackers; - - this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - } - - this.compilePrivateDicts([cff.topDict], [topDictTracker], output); - - // If the font data ends with INDEX whose object data is zero-length, - // the sanitizer will bail out. Add a dummy byte to avoid that. - output.add([0]); - - return output.data; - }, - encodeNumber: function CFFCompiler_encodeNumber(value) { - if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { // isInt - return this.encodeInteger(value); - } else { - return this.encodeFloat(value); - } - }, - encodeFloat: function CFFCompiler_encodeFloat(num) { - var value = num.toString(); - - // rounding inaccurate doubles - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); - if (m) { - var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); - value = (Math.round(num * epsilon) / epsilon).toString(); - } - - var nibbles = ''; - var i, ii; - for (i = 0, ii = value.length; i < ii; ++i) { - var a = value[i]; - if (a === 'e') { - nibbles += value[++i] === '-' ? 'c' : 'b'; - } else if (a === '.') { - nibbles += 'a'; - } else if (a === '-') { - nibbles += 'e'; - } else { - nibbles += a; - } - } - nibbles += (nibbles.length & 1) ? 'f' : 'ff'; - var out = [30]; - for (i = 0, ii = nibbles.length; i < ii; i += 2) { - out.push(parseInt(nibbles.substr(i, 2), 16)); - } - return out; - }, - encodeInteger: function CFFCompiler_encodeInteger(value) { - var code; - if (value >= -107 && value <= 107) { - code = [value + 139]; - } else if (value >= 108 && value <= 1131) { - value = [value - 108]; - code = [(value >> 8) + 247, value & 0xFF]; - } else if (value >= -1131 && value <= -108) { - value = -value - 108; - code = [(value >> 8) + 251, value & 0xFF]; - } else if (value >= -32768 && value <= 32767) { - code = [0x1c, (value >> 8) & 0xFF, value & 0xFF]; - } else { - code = [0x1d, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF]; - } - return code; - }, - compileHeader: function CFFCompiler_compileHeader(header) { - return [ - header.major, - header.minor, - header.hdrSize, - header.offSize - ]; - }, - compileNameIndex: function CFFCompiler_compileNameIndex(names) { - var nameIndex = new CFFIndex(); - for (var i = 0, ii = names.length; i < ii; ++i) { - nameIndex.add(stringToBytes(names[i])); - } - return this.compileIndex(nameIndex); - }, - compileTopDicts: function CFFCompiler_compileTopDicts(dicts, - length, - removeCidKeys) { - var fontDictTrackers = []; - var fdArrayIndex = new CFFIndex(); - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - if (removeCidKeys) { - fontDict.removeByName('CIDFontVersion'); - fontDict.removeByName('CIDFontRevision'); - fontDict.removeByName('CIDFontType'); - fontDict.removeByName('CIDCount'); - fontDict.removeByName('UIDBase'); - } - var fontDictTracker = new CFFOffsetTracker(); - var fontDictData = this.compileDict(fontDict, fontDictTracker); - fontDictTrackers.push(fontDictTracker); - fdArrayIndex.add(fontDictData); - fontDictTracker.offset(length); - } - fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); - return { - trackers: fontDictTrackers, - output: fdArrayIndex - }; - }, - compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, - trackers, - output) { - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - assert(fontDict.privateDict && fontDict.hasName('Private'), - 'There must be an private dictionary.'); - var privateDict = fontDict.privateDict; - var privateDictTracker = new CFFOffsetTracker(); - var privateDictData = this.compileDict(privateDict, privateDictTracker); - - var outputLength = output.length; - privateDictTracker.offset(outputLength); - if (!privateDictData.length) { - // The private dictionary was empty, set the output length to zero to - // ensure the offset length isn't out of bounds in the eyes of the - // sanitizer. - outputLength = 0; - } - - trackers[i].setEntryLocation('Private', - [privateDictData.length, outputLength], - output); - output.add(privateDictData); - - if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { - var subrs = this.compileIndex(privateDict.subrsIndex); - privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], - output); - output.add(subrs); - } - } - }, - compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { - var out = []; - // The dictionary keys must be in a certain order. - var order = dict.order; - for (var i = 0; i < order.length; ++i) { - var key = order[i]; - if (!(key in dict.values)) { - continue; - } - var values = dict.values[key]; - var types = dict.types[key]; - if (!isArray(types)) { - types = [types]; - } - if (!isArray(values)) { - values = [values]; - } - - // Remove any empty dict values. - if (values.length === 0) { - continue; - } - - for (var j = 0, jj = types.length; j < jj; ++j) { - var type = types[j]; - var value = values[j]; - switch (type) { - case 'num': - case 'sid': - out = out.concat(this.encodeNumber(value)); - break; - case 'offset': - // For offsets we just insert a 32bit integer so we don't have to - // deal with figuring out the length of the offset when it gets - // replaced later on by the compiler. - var name = dict.keyToNameMap[key]; - // Some offsets have the offset and the length, so just record the - // position of the first one. - if (!offsetTracker.isTracking(name)) { - offsetTracker.track(name, out.length); - } - out = out.concat([0x1d, 0, 0, 0, 0]); - break; - case 'array': - case 'delta': - out = out.concat(this.encodeNumber(value)); - for (var k = 1, kk = values.length; k < kk; ++k) { - out = out.concat(this.encodeNumber(values[k])); - } - break; - default: - error('Unknown data type of ' + type); - break; - } - } - out = out.concat(dict.opcodes[key]); - } - return out; - }, - compileStringIndex: function CFFCompiler_compileStringIndex(strings) { - var stringIndex = new CFFIndex(); - for (var i = 0, ii = strings.length; i < ii; ++i) { - stringIndex.add(stringToBytes(strings[i])); - } - return this.compileIndex(stringIndex); - }, - compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { - var globalSubrIndex = this.cff.globalSubrIndex; - this.out.writeByteArray(this.compileIndex(globalSubrIndex)); - }, - compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { - return this.compileIndex(charStrings); - }, - compileCharset: function CFFCompiler_compileCharset(charset) { - return this.compileTypedArray(charset.raw); - }, - compileEncoding: function CFFCompiler_compileEncoding(encoding) { - return this.compileTypedArray(encoding.raw); - }, - compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { - return this.compileTypedArray(fdSelect); - }, - compileTypedArray: function CFFCompiler_compileTypedArray(data) { - var out = []; - for (var i = 0, ii = data.length; i < ii; ++i) { - out[i] = data[i]; - } - return out; - }, - compileIndex: function CFFCompiler_compileIndex(index, trackers) { - trackers = trackers || []; - var objects = index.objects; - // First 2 bytes contains the number of objects contained into this index - var count = objects.length; - - // If there is no object, just create an index. This technically - // should just be [0, 0] but OTS has an issue with that. - if (count === 0) { - return [0, 0, 0]; - } - - var data = [(count >> 8) & 0xFF, count & 0xff]; - - var lastOffset = 1, i; - for (i = 0; i < count; ++i) { - lastOffset += objects[i].length; - } - - var offsetSize; - if (lastOffset < 0x100) { - offsetSize = 1; - } else if (lastOffset < 0x10000) { - offsetSize = 2; - } else if (lastOffset < 0x1000000) { - offsetSize = 3; - } else { - offsetSize = 4; - } - - // Next byte contains the offset size use to reference object in the file - data.push(offsetSize); - - // Add another offset after this one because we need a new offset - var relativeOffset = 1; - for (i = 0; i < count + 1; i++) { - if (offsetSize === 1) { - data.push(relativeOffset & 0xFF); - } else if (offsetSize === 2) { - data.push((relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else if (offsetSize === 3) { - data.push((relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else { - data.push((relativeOffset >>> 24) & 0xFF, - (relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } - - if (objects[i]) { - relativeOffset += objects[i].length; - } - } - - for (i = 0; i < count; i++) { - // Notify the tracker where the object will be offset in the data. - if (trackers[i]) { - trackers[i].offset(data.length); - } - for (var j = 0, jj = objects[i].length; j < jj; j++) { - data.push(objects[i][j]); - } - } - return data; - } - }; - return CFFCompiler; -})(); - -function _enableSeacAnalysis(enabled) { - exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED = enabled; -} - -// Workaround for seac on Windows. -(function checkSeacSupport() { - if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) { - SEAC_ANALYSIS_ENABLED = true; - } -})(); - -// Workaround for Private Use Area characters in Chrome on Windows -// http://code.google.com/p/chromium/issues/detail?id=122465 -// https://github.com/mozilla/pdf.js/issues/1689 -(function checkChromeWindows() { - if (typeof navigator !== 'undefined' && - /Windows.*Chrome/.test(navigator.userAgent)) { - SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; - } -})(); - -exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; -exports.CFFCompiler = CFFCompiler; -exports.CFFIndex = CFFIndex; -exports.CFFParser = CFFParser; -exports.CFFStrings = CFFStrings; -exports.Encodings = Encodings; -exports.ErrorFont = ErrorFont; -exports.FontFlags = FontFlags; -exports.Font = Font; -exports.IdentityToUnicodeMap = IdentityToUnicodeMap; -exports.NormalizedUnicodes = NormalizedUnicodes; -exports.ToUnicodeMap = ToUnicodeMap; -exports.Type1Parser = Type1Parser; -exports.getFontType = getFontType; -exports.reverseIfRtl = reverseIfRtl; -exports.serifFonts = serifFonts; -exports.symbolsFonts = symbolsFonts; -exports.stdFontMap = stdFontMap; -exports._enableSeacAnalysis = _enableSeacAnalysis; - -// TODO refactor to remove cyclic dependency on font_renderer.js -coreFontRenderer._setCoreFonts(exports); -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreFunction = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCorePsParser); - } -}(this, function (exports, sharedUtil, corePrimitives, corePsParser) { - -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isBool = sharedUtil.isBool; -var isDict = corePrimitives.isDict; -var isStream = corePrimitives.isStream; -var PostScriptLexer = corePsParser.PostScriptLexer; -var PostScriptParser = corePsParser.PostScriptParser; - -var PDFFunction = (function PDFFunctionClosure() { - var CONSTRUCT_SAMPLED = 0; - var CONSTRUCT_INTERPOLATED = 2; - var CONSTRUCT_STICHED = 3; - var CONSTRUCT_POSTSCRIPT = 4; - - return { - getSampleArray: function PDFFunction_getSampleArray(size, outputSize, bps, - str) { - var i, ii; - var length = 1; - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - length *= outputSize; - - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - // 32 is a valid bps so shifting won't work - var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); - - var strBytes = str.getBytes((length * bps + 7) / 8); - var strIdx = 0; - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - return array; - }, - - getIR: function PDFFunction_getIR(xref, fn) { - var dict = fn.dict; - if (!dict) { - dict = fn; - } - - var types = [this.constructSampled, - null, - this.constructInterpolated, - this.constructStiched, - this.constructPostScript]; - - var typeNum = dict.get('FunctionType'); - var typeFn = types[typeNum]; - if (!typeFn) { - error('Unknown type of function'); - } - - return typeFn.call(this, fn, dict, xref); - }, - - fromIR: function PDFFunction_fromIR(IR) { - var type = IR[0]; - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR(IR); - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR(IR); - case CONSTRUCT_STICHED: - return this.constructStichedFromIR(IR); - //case CONSTRUCT_POSTSCRIPT: - default: - return this.constructPostScriptFromIR(IR); - } - }, - - parse: function PDFFunction_parse(xref, fn) { - var IR = this.getIR(xref, fn); - return this.fromIR(IR); - }, - - parseArray: function PDFFunction_parseArray(xref, fnObj) { - if (!isArray(fnObj)) { - // not an array -- parsing as regular function - return this.parse(xref, fnObj); - } - - var fnArray = []; - for (var j = 0, jj = fnObj.length; j < jj; j++) { - var obj = xref.fetchIfRef(fnObj[j]); - fnArray.push(PDFFunction.parse(xref, obj)); - } - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - - constructSampled: function PDFFunction_constructSampled(str, dict) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - return out; - } - var domain = dict.get('Domain'); - var range = dict.get('Range'); - - if (!domain || !range) { - error('No domain or range'); - } - - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - - domain = toMultiArray(domain); - range = toMultiArray(range); - - var size = dict.get('Size'); - var bps = dict.get('BitsPerSample'); - var order = dict.get('Order') || 1; - if (order !== 1) { - // No description how cubic spline interpolation works in PDF32000:2008 - // As in poppler, ignoring order, linear interpolation may work as good - info('No support for cubic spline interpolation: ' + order); - } - - var encode = dict.get('Encode'); - if (!encode) { - encode = []; - for (var i = 0; i < inputSize; ++i) { - encode.push(0); - encode.push(size[i] - 1); - } - } - encode = toMultiArray(encode); - - var decode = dict.get('Decode'); - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - - var samples = this.getSampleArray(size, outputSize, bps, str); - - return [ - CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, - outputSize, Math.pow(2, bps) - 1, range - ]; - }, - - constructSampledFromIR: function PDFFunction_constructSampledFromIR(IR) { - // See chapter 3, page 109 of the PDF reference - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + ((x - xmin) * ((ymax - ymin) / (xmax - xmin))); - } - - return function constructSampledFromIRResult(src, srcOffset, - dest, destOffset) { - // See chapter 3, page 110 of the PDF reference. - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - //var mask = IR[8]; - var range = IR[9]; - - // Building the cube vertices: its part and sample index - // http://rjwagner49.com/Mathematics/Interpolation.pdf - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - - var k = n, pos = 1; - // Map x_i to y_j for 0 <= i < m using the sampled function. - for (i = 0; i < m; ++i) { - // x_i' = min(max(x_i, Domain_2i), Domain_2i+1) - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset +i], domain_2i), - domain_2i_1); - - // e_i = Interpolate(x_i', Domain_2i, Domain_2i+1, - // Encode_2i, Encode_2i+1) - var e = interpolate(xi, domain_2i, domain_2i_1, - encode[i][0], encode[i][1]); - - // e_i' = min(max(e_i, 0), Size_i - 1) - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - - // Adjusting the cube: N and vertex sample index - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; // e1 = e0 + 1; - var n0 = e0 + 1 - e; // (e1 - e) / (e1 - e0); - var n1 = e - e0; // (e - e0) / (e1 - e0); - var offset0 = e0 * k; - var offset1 = offset0 + k; // e1 * k - for (j = 0; j < cubeVertices; j++) { - if (j & pos) { - cubeN[j] *= n1; - cubeVertex[j] += offset1; - } else { - cubeN[j] *= n0; - cubeVertex[j] += offset0; - } - } - - k *= size_i; - pos <<= 1; - } - - for (j = 0; j < n; ++j) { - // Sum all cube vertices' samples portions - var rj = 0; - for (i = 0; i < cubeVertices; i++) { - rj += samples[cubeVertex[i] + j] * cubeN[i]; - } - - // r_j' = Interpolate(r_j, 0, 2^BitsPerSample - 1, - // Decode_2j, Decode_2j+1) - rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); - - // y_j = min(max(r_j, range_2j), range_2j+1) - dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), - range[j][1]); - } - }; - }, - - constructInterpolated: function PDFFunction_constructInterpolated(str, - dict) { - var c0 = dict.get('C0') || [0]; - var c1 = dict.get('C1') || [1]; - var n = dict.get('N'); - - if (!isArray(c0) || !isArray(c1)) { - error('Illegal dictionary for interpolated function'); - } - - var length = c0.length; - var diff = []; - for (var i = 0; i < length; ++i) { - diff.push(c1[i] - c0[i]); - } - - return [CONSTRUCT_INTERPOLATED, c0, diff, n]; - }, - - constructInterpolatedFromIR: - function PDFFunction_constructInterpolatedFromIR(IR) { - var c0 = IR[1]; - var diff = IR[2]; - var n = IR[3]; - - var length = diff.length; - - return function constructInterpolatedFromIRResult(src, srcOffset, - dest, destOffset) { - var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); - - for (var j = 0; j < length; ++j) { - dest[destOffset + j] = c0[j] + (x * diff[j]); - } - }; - }, - - constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { - var domain = dict.get('Domain'); - - if (!domain) { - error('No domain'); - } - - var inputSize = domain.length / 2; - if (inputSize !== 1) { - error('Bad domain for stiched function'); - } - - var fnRefs = dict.get('Functions'); - var fns = []; - for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); - } - - var bounds = dict.get('Bounds'); - var encode = dict.get('Encode'); - - return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; - }, - - constructStichedFromIR: function PDFFunction_constructStichedFromIR(IR) { - var domain = IR[1]; - var bounds = IR[2]; - var encode = IR[3]; - var fnsIR = IR[4]; - var fns = []; - var tmpBuf = new Float32Array(1); - - for (var i = 0, ii = fnsIR.length; i < ii; i++) { - fns.push(PDFFunction.fromIR(fnsIR[i])); - } - - return function constructStichedFromIRResult(src, srcOffset, - dest, destOffset) { - var clip = function constructStichedFromIRClip(v, min, max) { - if (v > max) { - v = max; - } else if (v < min) { - v = min; - } - return v; - }; - - // clip to domain - var v = clip(src[srcOffset], domain[0], domain[1]); - // calulate which bound the value is in - for (var i = 0, ii = bounds.length; i < ii; ++i) { - if (v < bounds[i]) { - break; - } - } - - // encode value into domain of function - var dmin = domain[0]; - if (i > 0) { - dmin = bounds[i - 1]; - } - var dmax = domain[1]; - if (i < bounds.length) { - dmax = bounds[i]; - } - - var rmin = encode[2 * i]; - var rmax = encode[2 * i + 1]; - - // Prevent the value from becoming NaN as a result - // of division by zero (fixes issue6113.pdf). - tmpBuf[0] = dmin === dmax ? rmin : - rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); - - // call the appropriate function - fns[i](tmpBuf, 0, dest, destOffset); - }; - }, - - constructPostScript: function PDFFunction_constructPostScript(fn, dict, - xref) { - var domain = dict.get('Domain'); - var range = dict.get('Range'); - - if (!domain) { - error('No domain.'); - } - - if (!range) { - error('No range.'); - } - - var lexer = new PostScriptLexer(fn); - var parser = new PostScriptParser(lexer); - var code = parser.parse(); - - return [CONSTRUCT_POSTSCRIPT, domain, range, code]; - }, - - constructPostScriptFromIR: function PDFFunction_constructPostScriptFromIR( - IR) { - var domain = IR[1]; - var range = IR[2]; - var code = IR[3]; - - var compiled = (new PostScriptCompiler()).compile(code, domain, range); - if (compiled) { - // Compiled function consists of simple expressions such as addition, - // subtraction, Math.max, and also contains 'var' and 'return' - // statements. See the generation in the PostScriptCompiler below. - /*jshint -W054 */ - return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); - } - - info('Unable to compile PS function'); - - var numOutputs = range.length >> 1; - var numInputs = domain.length >> 1; - var evaluator = new PostScriptEvaluator(code); - // Cache the values for a big speed up, the cache size is limited though - // since the number of possible values can be huge from a PS function. - var cache = {}; - // The MAX_CACHE_SIZE is set to ~4x the maximum number of distinct values - // seen in our tests. - var MAX_CACHE_SIZE = 2048 * 4; - var cache_available = MAX_CACHE_SIZE; - var tmpBuf = new Float32Array(numInputs); - - return function constructPostScriptFromIRResult(src, srcOffset, - dest, destOffset) { - var i, value; - var key = ''; - var input = tmpBuf; - for (i = 0; i < numInputs; i++) { - value = src[srcOffset + i]; - input[i] = value; - key += value + '_'; - } - - var cachedValue = cache[key]; - if (cachedValue !== undefined) { - dest.set(cachedValue, destOffset); - return; - } - - var output = new Float32Array(numOutputs); - var stack = evaluator.execute(input); - var stackIndex = stack.length - numOutputs; - for (i = 0; i < numOutputs; i++) { - value = stack[stackIndex + i]; - var bound = range[i * 2]; - if (value < bound) { - value = bound; - } else { - bound = range[i * 2 +1]; - if (value > bound) { - value = bound; - } - } - output[i] = value; - } - if (cache_available > 0) { - cache_available--; - cache[key] = output; - } - dest.set(output, destOffset); - }; - } - }; -})(); - -function isPDFFunction(v) { - var fnDict; - if (typeof v !== 'object') { - return false; - } else if (isDict(v)) { - fnDict = v; - } else if (isStream(v)) { - fnDict = v.dict; - } else { - return false; - } - return fnDict.has('FunctionType'); -} - -var PostScriptStack = (function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : - Array.prototype.slice.call(initialStack, 0); - } - - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - error('PostScript function stack underflow.'); - } - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - var stack = this.stack; - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); - } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - // rotate the last n stack elements p times - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, c = l + (p - Math.floor(p / n) * n), i, j, t; - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - } - }; - return PostScriptStack; -})(); -var PostScriptEvaluator = (function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; - } - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; - while (counter < length) { - operator = operators[counter++]; - if (typeof operator === 'number') { - // Operator is really an operand and should be pushed to the stack. - stack.push(operator); - continue; - } - switch (operator) { - // non standard ps operators - case 'jz': // jump if false - b = stack.pop(); - a = stack.pop(); - if (!a) { - counter = b; - } - break; - case 'j': // jump - a = stack.pop(); - counter = a; - break; - - // all ps operators in alphabetical order (excluding if/ifelse) - case 'abs': - a = stack.pop(); - stack.push(Math.abs(a)); - break; - case 'add': - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; - case 'and': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a && b); - } else { - stack.push(a & b); - } - break; - case 'atan': - a = stack.pop(); - stack.push(Math.atan(a)); - break; - case 'bitshift': - b = stack.pop(); - a = stack.pop(); - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); - } - break; - case 'ceiling': - a = stack.pop(); - stack.push(Math.ceil(a)); - break; - case 'copy': - a = stack.pop(); - stack.copy(a); - break; - case 'cos': - a = stack.pop(); - stack.push(Math.cos(a)); - break; - case 'cvi': - a = stack.pop() | 0; - stack.push(a); - break; - case 'cvr': - // noop - break; - case 'div': - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); - break; - case 'dup': - stack.copy(1); - break; - case 'eq': - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; - case 'exch': - stack.roll(2, 1); - break; - case 'exp': - b = stack.pop(); - a = stack.pop(); - stack.push(Math.pow(a, b)); - break; - case 'false': - stack.push(false); - break; - case 'floor': - a = stack.pop(); - stack.push(Math.floor(a)); - break; - case 'ge': - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; - case 'gt': - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; - case 'idiv': - b = stack.pop(); - a = stack.pop(); - stack.push((a / b) | 0); - break; - case 'index': - a = stack.pop(); - stack.index(a); - break; - case 'le': - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; - case 'ln': - a = stack.pop(); - stack.push(Math.log(a)); - break; - case 'log': - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); - break; - case 'lt': - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; - case 'mod': - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; - case 'mul': - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; - case 'ne': - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; - case 'neg': - a = stack.pop(); - stack.push(-a); - break; - case 'not': - a = stack.pop(); - if (isBool(a)) { - stack.push(!a); - } else { - stack.push(~a); - } - break; - case 'or': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } - break; - case 'pop': - stack.pop(); - break; - case 'roll': - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; - case 'round': - a = stack.pop(); - stack.push(Math.round(a)); - break; - case 'sin': - a = stack.pop(); - stack.push(Math.sin(a)); - break; - case 'sqrt': - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; - case 'sub': - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; - case 'true': - stack.push(true); - break; - case 'truncate': - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; - case 'xor': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } - break; - default: - error('Unknown operator ' + operator); - break; - } - } - return stack.stack; - } - }; - return PostScriptEvaluator; -})(); - -// Most of the PDFs functions consist of simple operations such as: -// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add. -// -// We can compile most of such programs, and at the same moment, we can -// optimize some expressions using basic math properties. Keeping track of -// min/max values will allow us to avoid extra Math.min/Math.max calls. -var PostScriptCompiler = (function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } - AstNode.prototype.visit = function (visitor) { - throw new Error('abstract method'); - }; - - function AstArgument(index, min, max) { - AstNode.call(this, 'args'); - this.index = index; - this.min = min; - this.max = max; - } - AstArgument.prototype = Object.create(AstNode.prototype); - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; - - function AstLiteral(number) { - AstNode.call(this, 'literal'); - this.number = number; - this.min = number; - this.max = number; - } - AstLiteral.prototype = Object.create(AstNode.prototype); - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; - - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, 'binary'); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; - } - AstBinaryOperation.prototype = Object.create(AstNode.prototype); - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; - - function AstMin(arg, max) { - AstNode.call(this, 'max'); - this.arg = arg; - this.min = arg.min; - this.max = max; - } - AstMin.prototype = Object.create(AstNode.prototype); - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; - - function AstVariable(index, min, max) { - AstNode.call(this, 'var'); - this.index = index; - this.min = min; - this.max = max; - } - AstVariable.prototype = Object.create(AstNode.prototype); - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - - function AstVariableDefinition(variable, arg) { - AstNode.call(this, 'definition'); - this.variable = variable; - this.arg = arg; - } - AstVariableDefinition.prototype = Object.create(AstNode.prototype); - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; - - function ExpressionBuilderVisitor() { - this.parts = []; - } - ExpressionBuilderVisitor.prototype = { - visitArgument: function (arg) { - this.parts.push('Math.max(', arg.min, ', Math.min(', - arg.max, ', src[srcOffset + ', arg.index, ']))'); - }, - visitVariable: function (variable) { - this.parts.push('v', variable.index); - }, - visitLiteral: function (literal) { - this.parts.push(literal.number); - }, - visitBinaryOperation: function (operation) { - this.parts.push('('); - operation.arg1.visit(this); - this.parts.push(' ', operation.op, ' '); - operation.arg2.visit(this); - this.parts.push(')'); - }, - visitVariableDefinition: function (definition) { - this.parts.push('var '); - definition.variable.visit(this); - this.parts.push(' = '); - definition.arg.visit(this); - this.parts.push(';'); - }, - visitMin: function (max) { - this.parts.push('Math.min('); - max.arg.visit(this); - this.parts.push(', ', max.max, ')'); - }, - toString: function () { - return this.parts.join(''); - } - }; - - function buildAddOperation(num1, num2) { - if (num2.type === 'literal' && num2.number === 0) { - // optimization: second operand is 0 - return num1; - } - if (num1.type === 'literal' && num1.number === 0) { - // optimization: first operand is 0 - return num2; - } - if (num2.type === 'literal' && num1.type === 'literal') { - // optimization: operands operand are literals - return new AstLiteral(num1.number + num2.number); - } - return new AstBinaryOperation('+', num1, num2, - num1.min + num2.min, num1.max + num2.max); - } - - function buildMulOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num2.number === 1) { - return num1; // and it's 1 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number * num2.number); - } - } - if (num1.type === 'literal') { - // optimization: first operands is a literal... - if (num1.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num1.number === 1) { - return num2; // and it's 1 - } - } - var min = Math.min(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation('*', num1, num2, min, max); - } - - function buildSubOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return num1; // ... and it's 0 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number - num2.number); - } - } - if (num2.type === 'binary' && num2.op === '-' && - num1.type === 'literal' && num1.number === 1 && - num2.arg1.type === 'literal' && num2.arg1.number === 1) { - // optimization for case: 1 - (1 - x) - return num2.arg2; - } - return new AstBinaryOperation('-', num1, num2, - num1.min - num2.max, num1.max - num2.min); - } - - function buildMinOperation(num1, max) { - if (num1.min >= max) { - // optimization: num1 min value is not less than required max - return new AstLiteral(max); // just returning max - } else if (num1.max <= max) { - // optimization: num1 max value is not greater than required max - return num1; // just returning an argument - } - return new AstMin(num1, max); - } - - function PostScriptCompiler() {} - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var i, ii; - var instructions = []; - var inputSize = domain.length >> 1, outputSize = range.length >> 1; - var lastRegister = 0; - var n, j; - var num1, num2, ast1, ast2, tmpVar, item; - for (i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } - - for (i = 0, ii = code.length; i < ii; i++) { - item = code[i]; - if (typeof item === 'number') { - stack.push(new AstLiteral(item)); - continue; - } - - switch (item) { - case 'add': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; - case 'cvr': - if (stack.length < 1) { - return null; - } - break; - case 'mul': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; - case 'sub': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; - case 'exch': - if (stack.length < 2) { - return null; - } - ast1 = stack.pop(); ast2 = stack.pop(); - stack.push(ast1, ast2); - break; - case 'pop': - if (stack.length < 1) { - return null; - } - stack.pop(); - break; - case 'index': - if (stack.length < 1) { - return null; - } - num1 = stack.pop(); - if (num1.type !== 'literal') { - return null; - } - n = num1.number; - if (n < 0 || (n|0) !== n || stack.length < n) { - return null; - } - ast1 = stack[stack.length - n - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'dup': - if (stack.length < 1) { - return null; - } - if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && - code[i + 3] === i + 7 && code[i + 4] === 'jz' && - code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { - // special case of the commands sequence for the min operation - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } - ast1 = stack[stack.length - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - // we don't have to save into intermediate variable a literal or - // variable. - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'roll': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - if (num2.type !== 'literal' || num1.type !== 'literal') { - // both roll operands must be numbers - return null; - } - j = num2.number; - n = num1.number; - if (n <= 0 || (n|0) !== n || (j|0) !== j || stack.length < n) { - // ... and integers - return null; - } - j = ((j % n) + n) % n; - if (j === 0) { - break; // just skipping -- there are nothing to rotate - } - Array.prototype.push.apply(stack, - stack.splice(stack.length - n, n - j)); - break; - default: - return null; // unsupported operator - } - } - - if (stack.length !== outputSize) { - return null; - } - - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - if (min > expr.min) { - out.unshift('Math.max(', min, ', '); - out.push(')'); - } - if (max < expr.max) { - out.unshift('Math.min(', max, ', '); - out.push(')'); - } - out.unshift('dest[destOffset + ', i, '] = '); - out.push(';'); - result.push(out.join('')); - }); - return result.join('\n'); - } - }; - - return PostScriptCompiler; -})(); - -exports.isPDFFunction = isPDFFunction; -exports.PDFFunction = PDFFunction; -exports.PostScriptEvaluator = PostScriptEvaluator; -exports.PostScriptCompiler = PostScriptCompiler; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreColorSpace = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreFunction, root.pdfjsCoreStream); - } -}(this, function (exports, sharedUtil, corePrimitives, coreFunction, - coreStream) { - -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isString = sharedUtil.isString; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isStream = corePrimitives.isStream; -var PDFFunction = coreFunction.PDFFunction; - -var coreImage; // see _setCoreImage below -var PDFImage; // = coreImage.PDFImage; - -var ColorSpace = (function ColorSpaceClosure() { - // Constructor should define this.numComps, this.defaultColor, this.name - function ColorSpace() { - error('should not call ColorSpace constructor'); - } - - ColorSpace.prototype = { - /** - * Converts the color value to the RGB color. The color components are - * located in the src array starting from the srcOffset. Returns the array - * of the rgb components, each value ranging from [0,255]. - */ - getRgb: function ColorSpace_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - /** - * Converts the color value to the RGB color, similar to the getRgb method. - * The result placed into the dest array starting from the destOffset. - */ - getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, - dest, destOffset) { - error('Should not call ColorSpace.getRgbItem'); - }, - /** - * Converts the specified number of the color values to the RGB colors. - * The colors are located in the src array starting from the srcOffset. - * The result is placed into the dest array starting from the destOffset. - * The src array items shall be in [0,2^bits) range, the dest array items - * will be in [0,255] range. alpha01 indicates how many alpha components - * there are in the dest array; it will be either 0 (RGB array) or 1 (RGBA - * array). - */ - getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - error('Should not call ColorSpace.getRgbBuffer'); - }, - /** - * Determines the number of bytes required to store the result of the - * conversion done by the getRgbBuffer method. As in getRgbBuffer, - * |alpha01| is either 0 (RGB output) or 1 (RGBA output). - */ - getOutputLength: function ColorSpace_getOutputLength(inputLength, - alpha01) { - error('Should not call ColorSpace.getOutputLength'); - }, - /** - * Returns true if source data will be equal the result/output data. - */ - isPassthrough: function ColorSpace_isPassthrough(bits) { - return false; - }, - /** - * Fills in the RGB colors in the destination buffer. alpha01 indicates - * how many alpha components there are in the dest array; it will be either - * 0 (RGB array) or 1 (RGBA array). - */ - fillRgb: function ColorSpace_fillRgb(dest, originalWidth, - originalHeight, width, height, - actualHeight, bpc, comps, alpha01) { - var count = originalWidth * originalHeight; - var rgbBuf = null; - var numComponentColors = 1 << bpc; - var needsResizing = originalHeight !== height || originalWidth !== width; - var i, ii; - - if (this.isPassthrough(bpc)) { - rgbBuf = comps; - } else if (this.numComps === 1 && count > numComponentColors && - this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { - // Optimization: create a color map when there is just one component and - // we are converting more colors than the size of the color map. We - // don't build the map if the colorspace is gray or rgb since those - // methods are faster than building a map. This mainly offers big speed - // ups for indexed and alternate colorspaces. - // - // TODO it may be worth while to cache the color map. While running - // testing I never hit a cache so I will leave that out for now (perhaps - // we are reparsing colorspaces too much?). - var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : - new Uint16Array(numComponentColors); - var key; - for (i = 0; i < numComponentColors; i++) { - allColors[i] = i; - } - var colorMap = new Uint8Array(numComponentColors * 3); - this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, - /* alpha01 = */ 0); - - var destPos, rgbPos; - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - destPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - dest[destPos++] = colorMap[key]; - dest[destPos++] = colorMap[key + 1]; - dest[destPos++] = colorMap[key + 2]; - destPos += alpha01; - } - } else { - rgbBuf = new Uint8Array(count * 3); - rgbPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - rgbBuf[rgbPos++] = colorMap[key]; - rgbBuf[rgbPos++] = colorMap[key + 1]; - rgbBuf[rgbPos++] = colorMap[key + 2]; - } - } - } else { - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, - alpha01); - } else { - rgbBuf = new Uint8Array(count * 3); - this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, - /* alpha01 = */ 0); - } - } - - if (rgbBuf) { - if (needsResizing) { - PDFImage.resize(rgbBuf, bpc, 3, originalWidth, originalHeight, width, - height, dest, alpha01); - } else { - rgbPos = 0; - destPos = 0; - for (i = 0, ii = width * actualHeight; i < ii; i++) { - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - destPos += alpha01; - } - } - } - }, - /** - * True if the colorspace has components in the default range of [0, 1]. - * This should be true for all colorspaces except for lab color spaces - * which are [0,100], [-128, 127], [-128, 127]. - */ - usesZeroToOneRange: true - }; - - ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { - var IR = ColorSpace.parseToIR(cs, xref, res); - if (IR instanceof AlternateCS) { - return IR; - } - return ColorSpace.fromIR(IR); - }; - - ColorSpace.fromIR = function ColorSpace_fromIR(IR) { - var name = isArray(IR) ? IR[0] : IR; - var whitePoint, blackPoint, gamma; - - switch (name) { - case 'DeviceGrayCS': - return this.singletons.gray; - case 'DeviceRgbCS': - return this.singletons.rgb; - case 'DeviceCmykCS': - return this.singletons.cmyk; - case 'CalGrayCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - gamma = IR[1].Gamma; - return new CalGrayCS(whitePoint, blackPoint, gamma); - case 'CalRGBCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - gamma = IR[1].Gamma; - var matrix = IR[1].Matrix; - return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); - case 'PatternCS': - var basePatternCS = IR[1]; - if (basePatternCS) { - basePatternCS = ColorSpace.fromIR(basePatternCS); - } - return new PatternCS(basePatternCS); - case 'IndexedCS': - var baseIndexedCS = IR[1]; - var hiVal = IR[2]; - var lookup = IR[3]; - return new IndexedCS(ColorSpace.fromIR(baseIndexedCS), hiVal, lookup); - case 'AlternateCS': - var numComps = IR[1]; - var alt = IR[2]; - var tintFnIR = IR[3]; - - return new AlternateCS(numComps, ColorSpace.fromIR(alt), - PDFFunction.fromIR(tintFnIR)); - case 'LabCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - var range = IR[1].Range; - return new LabCS(whitePoint, blackPoint, range); - default: - error('Unknown name ' + name); - } - return null; - }; - - ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) { - if (isName(cs)) { - var colorSpaces = res.get('ColorSpace'); - if (isDict(colorSpaces)) { - var refcs = colorSpaces.get(cs.name); - if (refcs) { - cs = refcs; - } - } - } - - cs = xref.fetchIfRef(cs); - var mode; - - if (isName(cs)) { - mode = cs.name; - this.mode = mode; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'Pattern': - return ['PatternCS', null]; - default: - error('unrecognized colorspace ' + mode); - } - } else if (isArray(cs)) { - mode = xref.fetchIfRef(cs[0]).name; - this.mode = mode; - var numComps, params, alt; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'CalGray': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['CalGrayCS', params]; - case 'CalRGB': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['CalRGBCS', params]; - case 'ICCBased': - var stream = xref.fetchIfRef(cs[1]); - var dict = stream.dict; - numComps = dict.get('N'); - alt = dict.get('Alternate'); - if (alt) { - var altIR = ColorSpace.parseToIR(alt, xref, res); - // Parse the /Alternate CS to ensure that the number of components - // are correct, and also (indirectly) that it is not a PatternCS. - var altCS = ColorSpace.fromIR(altIR); - if (altCS.numComps === numComps) { - return altIR; - } - warn('ICCBased color space: Ignoring incorrect /Alternate entry.'); - } - if (numComps === 1) { - return 'DeviceGrayCS'; - } else if (numComps === 3) { - return 'DeviceRgbCS'; - } else if (numComps === 4) { - return 'DeviceCmykCS'; - } - break; - case 'Pattern': - var basePatternCS = cs[1] || null; - if (basePatternCS) { - basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); - } - return ['PatternCS', basePatternCS]; - case 'Indexed': - case 'I': - var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res); - var hiVal = xref.fetchIfRef(cs[2]) + 1; - var lookup = xref.fetchIfRef(cs[3]); - if (isStream(lookup)) { - lookup = lookup.getBytes(); - } - return ['IndexedCS', baseIndexedCS, hiVal, lookup]; - case 'Separation': - case 'DeviceN': - var name = xref.fetchIfRef(cs[1]); - numComps = 1; - if (isName(name)) { - numComps = 1; - } else if (isArray(name)) { - numComps = name.length; - } - alt = ColorSpace.parseToIR(cs[2], xref, res); - var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); - return ['AlternateCS', numComps, alt, tintFnIR]; - case 'Lab': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['LabCS', params]; - default: - error('unimplemented color space object "' + mode + '"'); - } - } else { - error('unrecognized color space object: "' + cs + '"'); - } - return null; - }; - /** - * Checks if a decode map matches the default decode map for a color space. - * This handles the general decode maps where there are two values per - * component. e.g. [0, 1, 0, 1, 0, 1] for a RGB color. - * This does not handle Lab, Indexed, or Pattern decode maps since they are - * slightly different. - * @param {Array} decode Decode map (usually from an image). - * @param {Number} n Number of components the color space has. - */ - ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { - if (!isArray(decode)) { - return true; - } - - if (n * 2 !== decode.length) { - warn('The decode map is not the correct length'); - return true; - } - for (var i = 0, ii = decode.length; i < ii; i += 2) { - if (decode[i] !== 0 || decode[i + 1] !== 1) { - return false; - } - } - return true; - }; - - ColorSpace.singletons = { - get gray() { - return shadow(this, 'gray', new DeviceGrayCS()); - }, - get rgb() { - return shadow(this, 'rgb', new DeviceRgbCS()); - }, - get cmyk() { - return shadow(this, 'cmyk', new DeviceCmykCS()); - } - }; - - return ColorSpace; -})(); - -/** - * Alternate color space handles both Separation and DeviceN color spaces. A - * Separation color space is actually just a DeviceN with one color component. - * Both color spaces use a tinting function to convert colors to a base color - * space. - */ -var AlternateCS = (function AlternateCSClosure() { - function AlternateCS(numComps, base, tintFn) { - this.name = 'Alternate'; - this.numComps = numComps; - this.defaultColor = new Float32Array(numComps); - for (var i = 0; i < numComps; ++i) { - this.defaultColor[i] = 1; - } - this.base = base; - this.tintFn = tintFn; - this.tmpBuf = new Float32Array(base.numComps); - } - - AlternateCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var tmpBuf = this.tmpBuf; - this.tintFn(src, srcOffset, tmpBuf, 0); - this.base.getRgbItem(tmpBuf, 0, dest, destOffset); - }, - getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var tintFn = this.tintFn; - var base = this.base; - var scale = 1 / ((1 << bits) - 1); - var baseNumComps = base.numComps; - var usesZeroToOneRange = base.usesZeroToOneRange; - var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && - alpha01 === 0; - var pos = isPassthrough ? destOffset : 0; - var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); - var numComps = this.numComps; - - var scaled = new Float32Array(numComps); - var tinted = new Float32Array(baseNumComps); - var i, j; - if (usesZeroToOneRange) { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - for (j = 0; j < baseNumComps; j++) { - baseBuf[pos++] = tinted[j] * 255; - } - } - } else { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - base.getRgbItem(tinted, 0, baseBuf, pos); - pos += baseNumComps; - } - } - if (!isPassthrough) { - base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); - } - }, - getOutputLength: function AlternateCS_getOutputLength(inputLength, - alpha01) { - return this.base.getOutputLength(inputLength * - this.base.numComps / this.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return AlternateCS; -})(); - -var PatternCS = (function PatternCSClosure() { - function PatternCS(baseCS) { - this.name = 'Pattern'; - this.base = baseCS; - } - PatternCS.prototype = {}; - - return PatternCS; -})(); - -var IndexedCS = (function IndexedCSClosure() { - function IndexedCS(base, highVal, lookup) { - this.name = 'Indexed'; - this.numComps = 1; - this.defaultColor = new Uint8Array([0]); - this.base = base; - this.highVal = highVal; - - var baseNumComps = base.numComps; - var length = baseNumComps * highVal; - var lookupArray; - - if (isStream(lookup)) { - lookupArray = new Uint8Array(length); - var bytes = lookup.getBytes(length); - lookupArray.set(bytes); - } else if (isString(lookup)) { - lookupArray = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - lookupArray[i] = lookup.charCodeAt(i); - } - } else if (lookup instanceof Uint8Array || lookup instanceof Array) { - lookupArray = lookup; - } else { - error('Unrecognized lookup table: ' + lookup); - } - this.lookup = lookupArray; - } - - IndexedCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var numComps = this.base.numComps; - var start = src[srcOffset] * numComps; - this.base.getRgbItem(this.lookup, start, dest, destOffset); - }, - getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var base = this.base; - var numComps = base.numComps; - var outputDelta = base.getOutputLength(numComps, alpha01); - var lookup = this.lookup; - - for (var i = 0; i < count; ++i) { - var lookupPos = src[srcOffset++] * numComps; - base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); - destOffset += outputDelta; - } - }, - getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { - return this.base.getOutputLength(inputLength * this.base.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { - // indexed color maps shouldn't be changed - return true; - }, - usesZeroToOneRange: true - }; - return IndexedCS; -})(); - -var DeviceGrayCS = (function DeviceGrayCSClosure() { - function DeviceGrayCS() { - this.name = 'DeviceGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - } - - DeviceGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var c = (src[srcOffset] * 255) | 0; - c = c < 0 ? 0 : c > 255 ? 255 : c; - dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; - }, - getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - var c = (scale * src[j++]) | 0; - dest[q++] = c; - dest[q++] = c; - dest[q++] = c; - q += alpha01; - } - }, - getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, - alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceGrayCS; -})(); - -var DeviceRgbCS = (function DeviceRgbCSClosure() { - function DeviceRgbCS() { - this.name = 'DeviceRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - } - DeviceRgbCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var r = (src[srcOffset] * 255) | 0; - var g = (src[srcOffset + 1] * 255) | 0; - var b = (src[srcOffset + 2] * 255) | 0; - dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; - dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; - dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; - }, - getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - if (bits === 8 && alpha01 === 0) { - dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); - return; - } - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - q += alpha01; - } - }, - getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, - alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: function DeviceRgbCS_isPassthrough(bits) { - return bits === 8; - }, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceRgbCS; -})(); - -var DeviceCmykCS = (function DeviceCmykCSClosure() { - // The coefficients below was found using numerical analysis: the method of - // steepest descent for the sum((f_i - color_value_i)^2) for r/g/b colors, - // where color_value is the tabular value from the table of sampled RGB colors - // from CMYK US Web Coated (SWOP) colorspace, and f_i is the corresponding - // CMYK color conversion using the estimation below: - // f(A, B,.. N) = Acc+Bcm+Ccy+Dck+c+Fmm+Gmy+Hmk+Im+Jyy+Kyk+Ly+Mkk+Nk+255 - function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { - var c = src[srcOffset + 0] * srcScale; - var m = src[srcOffset + 1] * srcScale; - var y = src[srcOffset + 2] * srcScale; - var k = src[srcOffset + 3] * srcScale; - - var r = - (c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k + - -285.2331026137004) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y + - -17.873870861415444 * k - 5.497006427196366) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 17.5119270841813) + - k * (-21.86122147463605 * k - 189.48180835922747) + 255) | 0; - var g = - (c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k + - -79.2970844816548) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 190.9453302588951) + - y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + - k * (-20.737325471181034 * k - 187.80453709719578) + 255) | 0; - var b = - (c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k + - -14.183576799673286) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 112.23884253719248) + - y * (0.03296041114873217 * y + 115.60384449646641 * k + - -193.58209356861505) + - k * (-22.33816807309886 * k - 180.12613974708367) + 255) | 0; - - dest[destOffset] = r > 255 ? 255 : r < 0 ? 0 : r; - dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; - dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; - } - - function DeviceCmykCS() { - this.name = 'DeviceCMYK'; - this.numComps = 4; - this.defaultColor = new Float32Array([0, 0, 0, 1]); - } - DeviceCmykCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(src, srcOffset, 1, dest, destOffset); - }, - getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - for (var i = 0; i < count; i++) { - convertToRgb(src, srcOffset, scale, dest, destOffset); - srcOffset += 4; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, - alpha01) { - return (inputLength / 4 * (3 + alpha01)) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return DeviceCmykCS; -})(); - -// -// CalGrayCS: Based on "PDF Reference, Sixth Ed", p.245 -// -var CalGrayCS = (function CalGrayCSClosure() { - function CalGrayCS(whitePoint, blackPoint, gamma) { - this.name = 'CalGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalGray'); - } - blackPoint = blackPoint || [0, 0, 0]; - gamma = gamma || 1; - - // Translate arguments to spec variables. - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - this.G = gamma; - - // Validate variables as per spec. - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ', falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { - warn(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + - ', ZB: ' + this.ZB + ', only default values are supported.'); - } - - if (this.G < 1) { - info('Invalid Gamma: ' + this.G + ' for ' + this.name + - ', falling back to default'); - this.G = 1; - } - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A represents a gray component of a calibrated gray space. - // A <---> AG in the spec - var A = src[srcOffset] * scale; - var AG = Math.pow(A, cs.G); - - // Computes L as per spec. ( = cs.YW * AG ) - // Except if other than default BlackPoint values are used. - var L = cs.YW * AG; - // http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html, Ch 4. - // Convert values to rgb range [0, 255]. - var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; - dest[destOffset] = val; - dest[destOffset + 1] = val; - dest[destOffset + 2] = val; - } - - CalGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 1; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalGrayCS; -})(); - -// -// CalRGBCS: Based on "PDF Reference, Sixth Ed", p.247 -// -var CalRGBCS = (function CalRGBCSClosure() { - - // See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for these - // matrices. - var BRADFORD_SCALE_MATRIX = new Float32Array([ - 0.8951, 0.2664, -0.1614, - -0.7502, 1.7135, 0.0367, - 0.0389, -0.0685, 1.0296]); - - var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([ - 0.9869929, -0.1470543, 0.1599627, - 0.4323053, 0.5183603, 0.0492912, - -0.0085287, 0.0400428, 0.9684867]); - - // See http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html. - var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([ - 3.2404542, -1.5371385, -0.4985314, - -0.9692660, 1.8760108, 0.0415560, - 0.0556434, -0.2040259, 1.0572252]); - - var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); - - var tempNormalizeMatrix = new Float32Array(3); - var tempConvertMatrix1 = new Float32Array(3); - var tempConvertMatrix2 = new Float32Array(3); - - var DECODE_L_CONSTANT = Math.pow(((8 + 16) / 116), 3) / 8.0; - - function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { - this.name = 'CalRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array(3); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalRGB'); - } - blackPoint = blackPoint || new Float32Array(3); - gamma = gamma || new Float32Array([1, 1, 1]); - matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); - - // Translate arguments to spec variables. - var XW = whitePoint[0]; - var YW = whitePoint[1]; - var ZW = whitePoint[2]; - this.whitePoint = whitePoint; - - var XB = blackPoint[0]; - var YB = blackPoint[1]; - var ZB = blackPoint[2]; - this.blackPoint = blackPoint; - - this.GR = gamma[0]; - this.GG = gamma[1]; - this.GB = gamma[2]; - - this.MXA = matrix[0]; - this.MYA = matrix[1]; - this.MZA = matrix[2]; - this.MXB = matrix[3]; - this.MYB = matrix[4]; - this.MZB = matrix[5]; - this.MXC = matrix[6]; - this.MYC = matrix[7]; - this.MZC = matrix[8]; - - // Validate variables as per spec. - if (XW < 0 || ZW < 0 || YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (XB < 0 || YB < 0 || ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + - ', ' + ZB + '], falling back to default'); - this.blackPoint = new Float32Array(3); - } - - if (this.GR < 0 || this.GG < 0 || this.GB < 0) { - info('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + - '] for ' + this.name + ', falling back to default'); - this.GR = this.GG = this.GB = 1; - } - - if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || - this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || - this.MXC < 0 || this.MYC < 0 || this.MZC < 0) { - info('Invalid Matrix for ' + this.name + ' [' + - this.MXA + ', ' + this.MYA + ', ' + this.MZA + - this.MXB + ', ' + this.MYB + ', ' + this.MZB + - this.MXC + ', ' + this.MYC + ', ' + this.MZC + - '], falling back to default'); - this.MXA = this.MYB = this.MZC = 1; - this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; - } - } - - function matrixProduct(a, b, result) { - result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; - result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; - result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; - } - - function convertToFlat(sourceWhitePoint, LMS, result) { - result[0] = LMS[0] * 1 / sourceWhitePoint[0]; - result[1] = LMS[1] * 1 / sourceWhitePoint[1]; - result[2] = LMS[2] * 1 / sourceWhitePoint[2]; - } - - function convertToD65(sourceWhitePoint, LMS, result) { - var D65X = 0.95047; - var D65Y = 1; - var D65Z = 1.08883; - - result[0] = LMS[0] * D65X / sourceWhitePoint[0]; - result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; - result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; - } - - function sRGBTransferFunction(color) { - // See http://en.wikipedia.org/wiki/SRGB. - if (color <= 0.0031308){ - return adjustToRange(0, 1, 12.92 * color); - } - - return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); - } - - function adjustToRange(min, max, value) { - return Math.max(min, Math.min(max, value)); - } - - function decodeL(L) { - if (L < 0) { - return -decodeL(-L); - } - - if (L > 8.0) { - return Math.pow(((L + 16) / 116), 3); - } - - return L * DECODE_L_CONSTANT; - } - - function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { - - // In case the blackPoint is already the default blackPoint then there is - // no need to do compensation. - if (sourceBlackPoint[0] === 0 && - sourceBlackPoint[1] === 0 && - sourceBlackPoint[2] === 0) { - result[0] = XYZ_Flat[0]; - result[1] = XYZ_Flat[1]; - result[2] = XYZ_Flat[2]; - return; - } - - // For the blackPoint calculation details, please see - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - // The destination blackPoint is the default blackPoint [0, 0, 0]. - var zeroDecodeL = decodeL(0); - - var X_DST = zeroDecodeL; - var X_SRC = decodeL(sourceBlackPoint[0]); - - var Y_DST = zeroDecodeL; - var Y_SRC = decodeL(sourceBlackPoint[1]); - - var Z_DST = zeroDecodeL; - var Z_SRC = decodeL(sourceBlackPoint[2]); - - var X_Scale = (1 - X_DST) / (1 - X_SRC); - var X_Offset = 1 - X_Scale; - - var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); - var Y_Offset = 1 - Y_Scale; - - var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); - var Z_Offset = 1 - Z_Scale; - - result[0] = XYZ_Flat[0] * X_Scale + X_Offset; - result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; - result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; - } - - function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { - - // In case the whitePoint is already flat then there is no need to do - // normalization. - if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { - result[0] = XYZ_In[0]; - result[1] = XYZ_In[1]; - result[2] = XYZ_In[2]; - return; - } - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_Flat = tempNormalizeMatrix; - convertToFlat(sourceWhitePoint, LMS, LMS_Flat); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); - } - - function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_D65 = tempNormalizeMatrix; - convertToD65(sourceWhitePoint, LMS, LMS_D65); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A, B and C represent a red, green and blue components of a calibrated - // rgb space. - var A = adjustToRange(0, 1, src[srcOffset] * scale); - var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); - var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); - - // A <---> AGR in the spec - // B <---> BGG in the spec - // C <---> CGB in the spec - var AGR = Math.pow(A, cs.GR); - var BGG = Math.pow(B, cs.GG); - var CGB = Math.pow(C, cs.GB); - - // Computes intermediate variables L, M, N as per spec. - // To decode X, Y, Z values map L, M, N directly to them. - var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; - var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; - var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; - - // The following calculations are based on this document: - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - var XYZ = tempConvertMatrix1; - XYZ[0] = X; - XYZ[1] = Y; - XYZ[2] = Z; - var XYZ_Flat = tempConvertMatrix2; - - normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); - - var XYZ_Black = tempConvertMatrix1; - compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); - - var XYZ_D65 = tempConvertMatrix2; - normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); - - var SRGB = tempConvertMatrix1; - matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); - - var sR = sRGBTransferFunction(SRGB[0]); - var sG = sRGBTransferFunction(SRGB[1]); - var sB = sRGBTransferFunction(SRGB[2]); - - // Convert the values to rgb range [0, 255]. - dest[destOffset] = Math.round(sR * 255); - dest[destOffset + 1] = Math.round(sG * 255); - dest[destOffset + 2] = Math.round(sB * 255); - } - - CalRGBCS.prototype = { - getRgb: function CalRGBCS_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalRGBCS; -})(); - -// -// LabCS: Based on "PDF Reference, Sixth Ed", p.250 -// -var LabCS = (function LabCSClosure() { - function LabCS(whitePoint, blackPoint, range) { - this.name = 'Lab'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space Lab'); - } - blackPoint = blackPoint || [0, 0, 0]; - range = range || [-100, 100, -100, 100]; - - // Translate args to spec variables - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - this.amin = range[0]; - this.amax = range[1]; - this.bmin = range[2]; - this.bmax = range[3]; - - // These are here just for completeness - the spec doesn't offer any - // formulas that use BlackPoint in Lab - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - // Validate vars as per spec - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components, no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint, falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.amin > this.amax || this.bmin > this.bmax) { - info('Invalid Range, falling back to defaults'); - this.amin = -100; - this.amax = 100; - this.bmin = -100; - this.bmax = 100; - } - } - - // Function g(x) from spec - function fn_g(x) { - if (x >= 6 / 29) { - return x * x * x; - } else { - return (108 / 841) * (x - 4 / 29); - } - } - - function decode(value, high1, low2, high2) { - return low2 + (value) * (high2 - low2) / (high1); - } - - // If decoding is needed maxVal should be 2^bits per component - 1. - function convertToRgb(cs, src, srcOffset, maxVal, dest, destOffset) { - // XXX: Lab input is in the range of [0, 100], [amin, amax], [bmin, bmax] - // not the usual [0, 1]. If a command like setFillColor is used the src - // values will already be within the correct range. However, if we are - // converting an image we have to map the values to the correct range given - // above. - // Ls,as,bs <---> L*,a*,b* in the spec - var Ls = src[srcOffset]; - var as = src[srcOffset + 1]; - var bs = src[srcOffset + 2]; - if (maxVal !== false) { - Ls = decode(Ls, maxVal, 0, 100); - as = decode(as, maxVal, cs.amin, cs.amax); - bs = decode(bs, maxVal, cs.bmin, cs.bmax); - } - - // Adjust limits of 'as' and 'bs' - as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; - bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; - - // Computes intermediate variables X,Y,Z as per spec - var M = (Ls + 16) / 116; - var L = M + (as / 500); - var N = M - (bs / 200); - - var X = cs.XW * fn_g(L); - var Y = cs.YW * fn_g(M); - var Z = cs.ZW * fn_g(N); - - var r, g, b; - // Using different conversions for D50 and D65 white points, - // per http://www.color.org/srgb.pdf - if (cs.ZW < 1) { - // Assuming D50 (X=0.9642, Y=1.00, Z=0.8249) - r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; - g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; - b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; - } else { - // Assuming D65 (X=0.9505, Y=1.00, Z=1.0888) - r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; - g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; - b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; - } - // clamp color values to [0,1] range then convert to [0,255] range. - dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; - dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; - dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; - } - - LabCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { - convertToRgb(this, src, srcOffset, false, dest, destOffset); - }, - getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var maxVal = (1 << bits) - 1; - for (var i = 0; i < count; i++) { - convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { - // XXX: Decoding is handled with the lab conversion because of the strange - // ranges that are used. - return true; - }, - usesZeroToOneRange: false - }; - return LabCS; -})(); - -// TODO refactor to remove dependency on image.js -function _setCoreImage(coreImage_) { - coreImage = coreImage_; - PDFImage = coreImage_.PDFImage; -} -exports._setCoreImage = _setCoreImage; - -exports.ColorSpace = ColorSpace; - -// TODO refactor to remove dependency on colorspace.js -coreStream._setCoreColorSpace(exports); -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreImage = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreColorSpace, root.pdfjsCoreStream, - root.pdfjsCoreJpx); - } -}(this, function (exports, sharedUtil, corePrimitives, coreColorSpace, - coreStream, coreJpx) { - -var ImageKind = sharedUtil.ImageKind; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var warn = sharedUtil.warn; -var Name = corePrimitives.Name; -var isStream = corePrimitives.isStream; -var ColorSpace = coreColorSpace.ColorSpace; -var DecodeStream = coreStream.DecodeStream; -var Stream = coreStream.Stream; -var JpegStream = coreStream.JpegStream; -var JpxImage = coreJpx.JpxImage; - -var PDFImage = (function PDFImageClosure() { - /** - * Decode the image in the main thread if it supported. Resovles the promise - * when the image data is ready. - */ - function handleImageData(handler, xref, res, image) { - if (image instanceof JpegStream && image.isNativelyDecodable(xref, res)) { - // For natively supported jpegs send them to the main thread for decoding. - var dict = image.dict; - var colorSpace = dict.get('ColorSpace', 'CS'); - colorSpace = ColorSpace.parse(colorSpace, xref, res); - var numComps = colorSpace.numComps; - var decodePromise = handler.sendWithPromise('JpegDecode', - [image.getIR(), numComps]); - return decodePromise.then(function (message) { - var data = message.data; - return new Stream(data, 0, data.length, image.dict); - }); - } else { - return Promise.resolve(image); - } - } - - /** - * Decode and clamp a value. The formula is different from the spec because we - * don't decode to float range [0,1], we decode it in the [0,max] range. - */ - function decodeAndClamp(value, addend, coefficient, max) { - value = addend + value * coefficient; - // Clamp the value to the range - return (value < 0 ? 0 : (value > max ? max : value)); - } - - function PDFImage(xref, res, image, inline, smask, mask, isMask) { - this.image = image; - var dict = image.dict; - if (dict.has('Filter')) { - var filter = dict.get('Filter').name; - if (filter === 'JPXDecode') { - var jpxImage = new JpxImage(); - jpxImage.parseImageProperties(image.stream); - image.stream.reset(); - image.bitsPerComponent = jpxImage.bitsPerComponent; - image.numComps = jpxImage.componentsCount; - } else if (filter === 'JBIG2Decode') { - image.bitsPerComponent = 1; - image.numComps = 1; - } - } - // TODO cache rendered images? - - this.width = dict.get('Width', 'W'); - this.height = dict.get('Height', 'H'); - - if (this.width < 1 || this.height < 1) { - error('Invalid image width: ' + this.width + ' or height: ' + - this.height); - } - - this.interpolate = dict.get('Interpolate', 'I') || false; - this.imageMask = dict.get('ImageMask', 'IM') || false; - this.matte = dict.get('Matte') || false; - - var bitsPerComponent = image.bitsPerComponent; - if (!bitsPerComponent) { - bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); - if (!bitsPerComponent) { - if (this.imageMask) { - bitsPerComponent = 1; - } else { - error('Bits per component missing in image: ' + this.imageMask); - } - } - } - this.bpc = bitsPerComponent; - - if (!this.imageMask) { - var colorSpace = dict.get('ColorSpace', 'CS'); - if (!colorSpace) { - info('JPX images (which do not require color spaces)'); - switch (image.numComps) { - case 1: - colorSpace = Name.get('DeviceGray'); - break; - case 3: - colorSpace = Name.get('DeviceRGB'); - break; - case 4: - colorSpace = Name.get('DeviceCMYK'); - break; - default: - error('JPX images with ' + this.numComps + - ' color components not supported.'); - } - } - this.colorSpace = ColorSpace.parse(colorSpace, xref, res); - this.numComps = this.colorSpace.numComps; - } - - this.decode = dict.get('Decode', 'D'); - this.needsDecode = false; - if (this.decode && - ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) || - (isMask && !ColorSpace.isDefaultDecode(this.decode, 1)))) { - this.needsDecode = true; - // Do some preprocessing to avoid more math. - var max = (1 << bitsPerComponent) - 1; - this.decodeCoefficients = []; - this.decodeAddends = []; - for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { - var dmin = this.decode[i]; - var dmax = this.decode[i + 1]; - this.decodeCoefficients[j] = dmax - dmin; - this.decodeAddends[j] = max * dmin; - } - } - - if (smask) { - this.smask = new PDFImage(xref, res, smask, false); - } else if (mask) { - if (isStream(mask)) { - var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM'); - if (!imageMask) { - warn('Ignoring /Mask in image without /ImageMask.'); - } else { - this.mask = new PDFImage(xref, res, mask, false, null, null, true); - } - } else { - // Color key mask (just an array). - this.mask = mask; - } - } - } - /** - * Handles processing of image data and returns the Promise that is resolved - * with a PDFImage when the image is ready to be used. - */ - PDFImage.buildImage = function PDFImage_buildImage(handler, xref, - res, image, inline) { - var imagePromise = handleImageData(handler, xref, res, image); - var smaskPromise; - var maskPromise; - - var smask = image.dict.get('SMask'); - var mask = image.dict.get('Mask'); - - if (smask) { - smaskPromise = handleImageData(handler, xref, res, smask); - maskPromise = Promise.resolve(null); - } else { - smaskPromise = Promise.resolve(null); - if (mask) { - if (isStream(mask)) { - maskPromise = handleImageData(handler, xref, res, mask); - } else if (isArray(mask)) { - maskPromise = Promise.resolve(mask); - } else { - warn('Unsupported mask format.'); - maskPromise = Promise.resolve(null); - } - } else { - maskPromise = Promise.resolve(null); - } - } - return Promise.all([imagePromise, smaskPromise, maskPromise]).then( - function(results) { - var imageData = results[0]; - var smaskData = results[1]; - var maskData = results[2]; - return new PDFImage(xref, res, imageData, inline, smaskData, maskData); - }); - }; - - /** - * Resize an image using the nearest neighbor algorithm. Currently only - * supports one and three component images. - * @param {TypedArray} pixels The original image with one component. - * @param {Number} bpc Number of bits per component. - * @param {Number} components Number of color components, 1 or 3 is supported. - * @param {Number} w1 Original width. - * @param {Number} h1 Original height. - * @param {Number} w2 New width. - * @param {Number} h2 New height. - * @param {TypedArray} dest (Optional) The destination buffer. - * @param {Number} alpha01 (Optional) Size reserved for the alpha channel. - * @return {TypedArray} Resized image data. - */ - PDFImage.resize = function PDFImage_resize(pixels, bpc, components, - w1, h1, w2, h2, dest, alpha01) { - - if (components !== 1 && components !== 3) { - error('Unsupported component count for resizing.'); - } - - var length = w2 * h2 * components; - var temp = dest ? dest : (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, j, py, newIndex = 0, oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1 * components; - if (alpha01 !== 1) { - alpha01 = 0; - } - - for (j = 0; j < w2; j++) { - xScaled[j] = Math.floor(j * xRatio) * components; - } - - if (components === 1) { - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - temp[newIndex++] = pixels[oldIndex]; - } - } - } else if (components === 3) { - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - temp[newIndex++] = pixels[oldIndex++]; - temp[newIndex++] = pixels[oldIndex++]; - temp[newIndex++] = pixels[oldIndex++]; - newIndex += alpha01; - } - } - } - return temp; - }; - - PDFImage.createMask = - function PDFImage_createMask(imgArray, width, height, - imageIsFromDecodeStream, inverseDecode) { - - // |imgArray| might not contain full data for every pixel of the mask, so - // we need to distinguish between |computedLength| and |actualLength|. - // In particular, if inverseDecode is true, then the array we return must - // have a length of |computedLength|. - - var computedLength = ((width + 7) >> 3) * height; - var actualLength = imgArray.byteLength; - var haveFullData = computedLength === actualLength; - var data, i; - - if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { - // imgArray came from a DecodeStream and its data is in an appropriate - // form, so we can just transfer it. - data = imgArray; - } else if (!inverseDecode) { - data = new Uint8Array(actualLength); - data.set(imgArray); - } else { - data = new Uint8Array(computedLength); - data.set(imgArray); - for (i = actualLength; i < computedLength; i++) { - data[i] = 0xff; - } - } - - // If necessary, invert the original mask data (but not any extra we might - // have added above). It's safe to modify the array -- whether it's the - // original or a copy, we're about to transfer it anyway, so nothing else - // in this thread can be relying on its contents. - if (inverseDecode) { - for (i = 0; i < actualLength; i++) { - data[i] = ~data[i]; - } - } - - return {data: data, width: width, height: height}; - }; - - PDFImage.prototype = { - get drawWidth() { - return Math.max(this.width, - this.smask && this.smask.width || 0, - this.mask && this.mask.width || 0); - }, - - get drawHeight() { - return Math.max(this.height, - this.smask && this.smask.height || 0, - this.mask && this.mask.height || 0); - }, - - decodeBuffer: function PDFImage_decodeBuffer(buffer) { - var bpc = this.bpc; - var numComps = this.numComps; - - var decodeAddends = this.decodeAddends; - var decodeCoefficients = this.decodeCoefficients; - var max = (1 << bpc) - 1; - var i, ii; - - if (bpc === 1) { - // If the buffer needed decode that means it just needs to be inverted. - for (i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = +!(buffer[i]); - } - return; - } - var index = 0; - for (i = 0, ii = this.width * this.height; i < ii; i++) { - for (var j = 0; j < numComps; j++) { - buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], - decodeCoefficients[j], max); - index++; - } - } - }, - - getComponents: function PDFImage_getComponents(buffer) { - var bpc = this.bpc; - - // This image doesn't require any extra work. - if (bpc === 8) { - return buffer; - } - - var width = this.width; - var height = this.height; - var numComps = this.numComps; - - var length = width * height * numComps; - var bufferPos = 0; - var output = (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var rowComps = width * numComps; - - var max = (1 << bpc) - 1; - var i = 0, ii, buf; - - if (bpc === 1) { - // Optimization for reading 1 bpc images. - var mask, loop1End, loop2End; - for (var j = 0; j < height; j++) { - loop1End = i + (rowComps & ~7); - loop2End = i + rowComps; - - // unroll loop for all full bytes - while (i < loop1End) { - buf = buffer[bufferPos++]; - output[i] = (buf >> 7) & 1; - output[i + 1] = (buf >> 6) & 1; - output[i + 2] = (buf >> 5) & 1; - output[i + 3] = (buf >> 4) & 1; - output[i + 4] = (buf >> 3) & 1; - output[i + 5] = (buf >> 2) & 1; - output[i + 6] = (buf >> 1) & 1; - output[i + 7] = buf & 1; - i += 8; - } - - // handle remaing bits - if (i < loop2End) { - buf = buffer[bufferPos++]; - mask = 128; - while (i < loop2End) { - output[i++] = +!!(buf & mask); - mask >>= 1; - } - } - } - } else { - // The general case that handles all other bpc values. - var bits = 0; - buf = 0; - for (i = 0, ii = length; i < ii; ++i) { - if (i % rowComps === 0) { - buf = 0; - bits = 0; - } - - while (bits < bpc) { - buf = (buf << 8) | buffer[bufferPos++]; - bits += 8; - } - - var remainingBits = bits - bpc; - var value = buf >> remainingBits; - output[i] = (value < 0 ? 0 : (value > max ? max : value)); - buf = buf & ((1 << remainingBits) - 1); - bits = remainingBits; - } - } - return output; - }, - - fillOpacity: function PDFImage_fillOpacity(rgbaBuf, width, height, - actualHeight, image) { - var smask = this.smask; - var mask = this.mask; - var alphaBuf, sw, sh, i, ii, j; - - if (smask) { - sw = smask.width; - sh = smask.height; - alphaBuf = new Uint8Array(sw * sh); - smask.fillGrayBuffer(alphaBuf); - if (sw !== width || sh !== height) { - alphaBuf = PDFImage.resize(alphaBuf, smask.bpc, 1, sw, sh, width, - height); - } - } else if (mask) { - if (mask instanceof PDFImage) { - sw = mask.width; - sh = mask.height; - alphaBuf = new Uint8Array(sw * sh); - mask.numComps = 1; - mask.fillGrayBuffer(alphaBuf); - - // Need to invert values in rgbaBuf - for (i = 0, ii = sw * sh; i < ii; ++i) { - alphaBuf[i] = 255 - alphaBuf[i]; - } - - if (sw !== width || sh !== height) { - alphaBuf = PDFImage.resize(alphaBuf, mask.bpc, 1, sw, sh, width, - height); - } - } else if (isArray(mask)) { - // Color key mask: if any of the compontents are outside the range - // then they should be painted. - alphaBuf = new Uint8Array(width * height); - var numComps = this.numComps; - for (i = 0, ii = width * height; i < ii; ++i) { - var opacity = 0; - var imageOffset = i * numComps; - for (j = 0; j < numComps; ++j) { - var color = image[imageOffset + j]; - var maskOffset = j * 2; - if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { - opacity = 255; - break; - } - } - alphaBuf[i] = opacity; - } - } else { - error('Unknown mask format.'); - } - } - - if (alphaBuf) { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = alphaBuf[i]; - } - } else { - // No mask. - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = 255; - } - } - }, - - undoPreblend: function PDFImage_undoPreblend(buffer, width, height) { - var matte = this.smask && this.smask.matte; - if (!matte) { - return; - } - var matteRgb = this.colorSpace.getRgb(matte, 0); - var matteR = matteRgb[0]; - var matteG = matteRgb[1]; - var matteB = matteRgb[2]; - var length = width * height * 4; - var r, g, b; - for (var i = 0; i < length; i += 4) { - var alpha = buffer[i + 3]; - if (alpha === 0) { - // according formula we have to get Infinity in all components - // making it white (typical paper color) should be okay - buffer[i] = 255; - buffer[i + 1] = 255; - buffer[i + 2] = 255; - continue; - } - var k = 255 / alpha; - r = (buffer[i] - matteR) * k + matteR; - g = (buffer[i + 1] - matteG) * k + matteG; - b = (buffer[i + 2] - matteB) * k + matteB; - buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; - buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; - buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; - } - }, - - createImageData: function PDFImage_createImageData(forceRGBA) { - var drawWidth = this.drawWidth; - var drawHeight = this.drawHeight; - var imgData = { // other fields are filled in below - width: drawWidth, - height: drawHeight - }; - - var numComps = this.numComps; - var originalWidth = this.width; - var originalHeight = this.height; - var bpc = this.bpc; - - // Rows start at byte boundary. - var rowBytes = (originalWidth * numComps * bpc + 7) >> 3; - var imgArray; - - if (!forceRGBA) { - // If it is a 1-bit-per-pixel grayscale (i.e. black-and-white) image - // without any complications, we pass a same-sized copy to the main - // thread rather than expanding by 32x to RGBA form. This saves *lots* - // of memory for many scanned documents. It's also much faster. - // - // Similarly, if it is a 24-bit-per pixel RGB image without any - // complications, we avoid expanding by 1.333x to RGBA form. - var kind; - if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { - kind = ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && - !this.needsDecode) { - kind = ImageKind.RGB_24BPP; - } - if (kind && !this.smask && !this.mask && - drawWidth === originalWidth && drawHeight === originalHeight) { - imgData.kind = kind; - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // If imgArray came from a DecodeStream, we're safe to transfer it - // (and thus neuter it) because it will constitute the entire - // DecodeStream's data. But if it came from a Stream, we need to - // copy it because it'll only be a portion of the Stream's data, and - // the rest will be read later on. - if (this.image instanceof DecodeStream) { - imgData.data = imgArray; - } else { - var newArray = new Uint8Array(imgArray.length); - newArray.set(imgArray); - imgData.data = newArray; - } - if (this.needsDecode) { - // Invert the buffer (which must be grayscale if we reached here). - assert(kind === ImageKind.GRAYSCALE_1BPP); - var buffer = imgData.data; - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] ^= 0xff; - } - } - return imgData; - } - if (this.image instanceof JpegStream && !this.smask && !this.mask && - (this.colorSpace.name === 'DeviceGray' || - this.colorSpace.name === 'DeviceRGB' || - this.colorSpace.name === 'DeviceCMYK')) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = this.getImageBytes(originalHeight * rowBytes, - drawWidth, drawHeight, true); - return imgData; - } - } - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // imgArray can be incomplete (e.g. after CCITT fax encoding). - var actualHeight = 0 | (imgArray.length / rowBytes * - drawHeight / originalHeight); - - var comps = this.getComponents(imgArray); - - // If opacity data is present, use RGBA_32BPP form. Otherwise, use the - // more compact RGB_24BPP form if allowable. - var alpha01, maybeUndoPreblend; - if (!forceRGBA && !this.smask && !this.mask) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 3); - alpha01 = 0; - maybeUndoPreblend = false; - } else { - imgData.kind = ImageKind.RGBA_32BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 4); - alpha01 = 1; - maybeUndoPreblend = true; - - // Color key masking (opacity) must be performed before decoding. - this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, - comps); - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, - drawWidth, drawHeight, actualHeight, bpc, comps, - alpha01); - if (maybeUndoPreblend) { - this.undoPreblend(imgData.data, drawWidth, actualHeight); - } - - return imgData; - }, - - fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) { - var numComps = this.numComps; - if (numComps !== 1) { - error('Reading gray scale from a color image: ' + numComps); - } - - var width = this.width; - var height = this.height; - var bpc = this.bpc; - - // rows start at byte boundary - var rowBytes = (width * numComps * bpc + 7) >> 3; - var imgArray = this.getImageBytes(height * rowBytes); - - var comps = this.getComponents(imgArray); - var i, length; - - if (bpc === 1) { - // inline decoding (= inversion) for 1 bpc images - length = width * height; - if (this.needsDecode) { - // invert and scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (comps[i] - 1) & 255; - } - } else { - // scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (-comps[i]) & 255; - } - } - return; - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - length = width * height; - // we aren't using a colorspace so we need to scale the value - var scale = 255 / ((1 << bpc) - 1); - for (i = 0; i < length; ++i) { - buffer[i] = (scale * comps[i]) | 0; - } - }, - - getImageBytes: function PDFImage_getImageBytes(length, - drawWidth, drawHeight, - forceRGB) { - this.image.reset(); - this.image.drawWidth = drawWidth || this.width; - this.image.drawHeight = drawHeight || this.height; - this.image.forceRGB = !!forceRGB; - return this.image.getBytes(length); - } - }; - return PDFImage; -})(); - -exports.PDFImage = PDFImage; - -// TODO refactor to remove dependency on colorspace.js -coreColorSpace._setCoreImage(exports); -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePattern = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreFunction, - root.pdfjsCoreColorSpace); - } -}(this, function (exports, sharedUtil, corePrimitives, coreFunction, - coreColorSpace) { - -var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; -var MissingDataException = sharedUtil.MissingDataException; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var warn = sharedUtil.warn; -var isStream = corePrimitives.isStream; -var PDFFunction = coreFunction.PDFFunction; -var ColorSpace = coreColorSpace.ColorSpace; - -var ShadingType = { - FUNCTION_BASED: 1, - AXIAL: 2, - RADIAL: 3, - FREE_FORM_MESH: 4, - LATTICE_FORM_MESH: 5, - COONS_PATCH_MESH: 6, - TENSOR_PATCH_MESH: 7 -}; - -var Pattern = (function PatternClosure() { - // Constructor should define this.getPattern - function Pattern() { - error('should not call Pattern constructor'); - } - - Pattern.prototype = { - // Input: current Canvas context - // Output: the appropriate fillStyle or strokeStyle - getPattern: function Pattern_getPattern(ctx) { - error('Should not call Pattern.getStyle: ' + ctx); - } - }; - - Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref, - res, handler) { - - var dict = isStream(shading) ? shading.dict : shading; - var type = dict.get('ShadingType'); - - try { - switch (type) { - case ShadingType.AXIAL: - case ShadingType.RADIAL: - // Both radial and axial shadings are handled by RadialAxial shading. - return new Shadings.RadialAxial(dict, matrix, xref, res); - case ShadingType.FREE_FORM_MESH: - case ShadingType.LATTICE_FORM_MESH: - case ShadingType.COONS_PATCH_MESH: - case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res); - default: - throw new Error('Unsupported ShadingType: ' + type); - } - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.shadingPattern}); - warn(ex); - return new Shadings.Dummy(); - } - }; - return Pattern; -})(); - -var Shadings = {}; - -// A small number to offset the first/last color stops so we can insert ones to -// support extend. Number.MIN_VALUE is too small and breaks the extend. -Shadings.SMALL_NUMBER = 1e-6; - -// Radial and axial shading have very similar implementations -// If needed, the implementations can be broken into two classes -Shadings.RadialAxial = (function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res) { - this.matrix = matrix; - this.coordsArr = dict.get('Coords'); - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - - var t0 = 0.0, t1 = 1.0; - if (dict.has('Domain')) { - var domainArr = dict.get('Domain'); - t0 = domainArr[0]; - t1 = domainArr[1]; - } - - var extendStart = false, extendEnd = false; - if (dict.has('Extend')) { - var extendArr = dict.get('Extend'); - extendStart = extendArr[0]; - extendEnd = extendArr[1]; - } - - if (this.shadingType === ShadingType.RADIAL && - (!extendStart || !extendEnd)) { - // Radial gradient only currently works if either circle is fully within - // the other circle. - var x1 = this.coordsArr[0]; - var y1 = this.coordsArr[1]; - var r1 = this.coordsArr[2]; - var x2 = this.coordsArr[3]; - var y2 = this.coordsArr[4]; - var r2 = this.coordsArr[5]; - var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); - if (r1 <= r2 + distance && - r2 <= r1 + distance) { - warn('Unsupported radial gradient.'); - } - } - - this.extendStart = extendStart; - this.extendEnd = extendEnd; - - var fnObj = dict.get('Function'); - var fn = PDFFunction.parseArray(xref, fnObj); - - // 10 samples seems good enough for now, but probably won't work - // if there are sharp color changes. Ideally, we would implement - // the spec faithfully and add lossless optimizations. - var diff = t1 - t0; - var step = diff / 10; - - var colorStops = this.colorStops = []; - - // Protect against bad domains so we don't end up in an infinte loop below. - if (t0 >= t1 || step <= 0) { - // Acrobat doesn't seem to handle these cases so we'll ignore for - // now. - info('Bad shading domain.'); - return; - } - - var color = new Float32Array(cs.numComps), ratio = new Float32Array(1); - var rgbColor; - for (var i = t0; i <= t1; i += step) { - ratio[0] = i; - fn(ratio, 0, color, 0); - rgbColor = cs.getRgb(color, 0); - var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - colorStops.push([(i - t0) / diff, cssColor]); - } - - var background = 'transparent'; - if (dict.has('Background')) { - rgbColor = cs.getRgb(dict.get('Background'), 0); - background = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - } - - if (!extendStart) { - // Insert a color stop at the front and offset the first real color stop - // so it doesn't conflict with the one we insert. - colorStops.unshift([0, background]); - colorStops[1][0] += Shadings.SMALL_NUMBER; - } - if (!extendEnd) { - // Same idea as above in extendStart but for the end. - colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; - colorStops.push([1, background]); - } - - this.colorStops = colorStops; - } - - RadialAxial.prototype = { - getIR: function RadialAxial_getIR() { - var coordsArr = this.coordsArr; - var shadingType = this.shadingType; - var type, p0, p1, r0, r1; - if (shadingType === ShadingType.AXIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[2], coordsArr[3]]; - r0 = null; - r1 = null; - type = 'axial'; - } else if (shadingType === ShadingType.RADIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[3], coordsArr[4]]; - r0 = coordsArr[2]; - r1 = coordsArr[5]; - type = 'radial'; - } else { - error('getPattern type unknown: ' + shadingType); - } - - var matrix = this.matrix; - if (matrix) { - p0 = Util.applyTransform(p0, matrix); - p1 = Util.applyTransform(p1, matrix); - if (shadingType === ShadingType.RADIAL) { - var scale = Util.singularValueDecompose2dScale(matrix); - r0 *= scale[0]; - r1 *= scale[1]; - } - } - - return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; - } - }; - - return RadialAxial; -})(); - -// All mesh shading. For now, they will be presented as set of the triangles -// to be drawn on the canvas and rgb color for each vertex. -Shadings.Mesh = (function MeshClosure() { - function MeshStreamReader(stream, context) { - this.stream = stream; - this.context = context; - this.buffer = 0; - this.bufferLength = 0; - - var numComps = context.numComps; - this.tmpCompsBuf = new Float32Array(numComps); - var csNumComps = context.colorSpace.numComps; - this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : - this.tmpCompsBuf; - } - MeshStreamReader.prototype = { - get hasData() { - if (this.stream.end) { - return this.stream.pos < this.stream.end; - } - if (this.bufferLength > 0) { - return true; - } - var nextByte = this.stream.getByte(); - if (nextByte < 0) { - return false; - } - this.buffer = nextByte; - this.bufferLength = 8; - return true; - }, - readBits: function MeshStreamReader_readBits(n) { - var buffer = this.buffer; - var bufferLength = this.bufferLength; - if (n === 32) { - if (bufferLength === 0) { - return ((this.stream.getByte() << 24) | - (this.stream.getByte() << 16) | (this.stream.getByte() << 8) | - this.stream.getByte()) >>> 0; - } - buffer = (buffer << 24) | (this.stream.getByte() << 16) | - (this.stream.getByte() << 8) | this.stream.getByte(); - var nextByte = this.stream.getByte(); - this.buffer = nextByte & ((1 << bufferLength) - 1); - return ((buffer << (8 - bufferLength)) | - ((nextByte & 0xFF) >> bufferLength)) >>> 0; - } - if (n === 8 && bufferLength === 0) { - return this.stream.getByte(); - } - while (bufferLength < n) { - buffer = (buffer << 8) | this.stream.getByte(); - bufferLength += 8; - } - bufferLength -= n; - this.bufferLength = bufferLength; - this.buffer = buffer & ((1 << bufferLength) - 1); - return buffer >> bufferLength; - }, - align: function MeshStreamReader_align() { - this.buffer = 0; - this.bufferLength = 0; - }, - readFlag: function MeshStreamReader_readFlag() { - return this.readBits(this.context.bitsPerFlag); - }, - readCoordinate: function MeshStreamReader_readCoordinate() { - var bitsPerCoordinate = this.context.bitsPerCoordinate; - var xi = this.readBits(bitsPerCoordinate); - var yi = this.readBits(bitsPerCoordinate); - var decode = this.context.decode; - var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - return [ - xi * scale * (decode[1] - decode[0]) + decode[0], - yi * scale * (decode[3] - decode[2]) + decode[2] - ]; - }, - readComponents: function MeshStreamReader_readComponents() { - var numComps = this.context.numComps; - var bitsPerComponent = this.context.bitsPerComponent; - var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - var decode = this.context.decode; - var components = this.tmpCompsBuf; - for (var i = 0, j = 4; i < numComps; i++, j += 2) { - var ci = this.readBits(bitsPerComponent); - components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; - } - var color = this.tmpCsCompsBuf; - if (this.context.colorFn) { - this.context.colorFn(components, 0, color, 0); - } - return this.context.colorSpace.getRgb(color, 0); - } - }; - - function decodeType4Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var operators = []; - var ps = []; // not maintaining cs since that will match ps - var verticesLeft = 0; // assuming we have all data to start a new triangle - while (reader.hasData) { - var f = reader.readFlag(); - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - if (verticesLeft === 0) { // ignoring flags if we started a triangle - assert(0 <= f && f <= 2, 'Unknown type4 flag'); - switch (f) { - case 0: - verticesLeft = 3; - break; - case 1: - ps.push(ps[ps.length - 2], ps[ps.length - 1]); - verticesLeft = 1; - break; - case 2: - ps.push(ps[ps.length - 3], ps[ps.length - 1]); - verticesLeft = 1; - break; - } - operators.push(f); - } - ps.push(coords.length); - coords.push(coord); - colors.push(color); - verticesLeft--; - - reader.align(); - } - mesh.figures.push({ - type: 'triangles', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - }); - } - - function decodeType5Shading(mesh, reader, verticesPerRow) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = []; // not maintaining cs since that will match ps - while (reader.hasData) { - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - ps.push(coords.length); - coords.push(coord); - colors.push(color); - } - mesh.figures.push({ - type: 'lattice', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - verticesPerRow: verticesPerRow - }); - } - - var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; - var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; - - var TRIANGLE_DENSITY = 20; // count of triangles per entire mesh bounds - - var getB = (function getBClosure() { - function buildB(count) { - var lut = []; - for (var i = 0; i <= count; i++) { - var t = i / count, t_ = 1 - t; - lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, - 3 * t * t * t_, t * t * t])); - } - return lut; - } - var cache = []; - return function getB(count) { - if (!cache[count]) { - cache[count] = buildB(count); - } - return cache[count]; - }; - })(); - - function buildFigureFromPatch(mesh, index) { - var figure = mesh.figures[index]; - assert(figure.type === 'patch', 'Unexpected patch mesh figure'); - - var coords = mesh.coords, colors = mesh.colors; - var pi = figure.coords; - var ci = figure.colors; - - var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / - (mesh.bounds[2] - mesh.bounds[0])); - splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); - var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / - (mesh.bounds[3] - mesh.bounds[1])); - splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); - - var verticesPerRow = splitXBy + 1; - var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); - var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); - var k = 0; - var cl = new Uint8Array(3), cr = new Uint8Array(3); - var c0 = colors[ci[0]], c1 = colors[ci[1]], - c2 = colors[ci[2]], c3 = colors[ci[3]]; - var bRow = getB(splitYBy), bCol = getB(splitXBy); - for (var row = 0; row <= splitYBy; row++) { - cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0; - cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0; - cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0; - - cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0; - cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0; - cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0; - - for (var col = 0; col <= splitXBy; col++, k++) { - if ((row === 0 || row === splitYBy) && - (col === 0 || col === splitXBy)) { - continue; - } - var x = 0, y = 0; - var q = 0; - for (var i = 0; i <= 3; i++) { - for (var j = 0; j <= 3; j++, q++) { - var m = bRow[row][i] * bCol[col][j]; - x += coords[pi[q]][0] * m; - y += coords[pi[q]][1] * m; - } - } - figureCoords[k] = coords.length; - coords.push([x, y]); - figureColors[k] = colors.length; - var newColor = new Uint8Array(3); - newColor[0] = ((cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy) | 0; - newColor[1] = ((cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy) | 0; - newColor[2] = ((cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy) | 0; - colors.push(newColor); - } - } - figureCoords[0] = pi[0]; - figureColors[0] = ci[0]; - figureCoords[splitXBy] = pi[3]; - figureColors[splitXBy] = ci[1]; - figureCoords[verticesPerRow * splitYBy] = pi[12]; - figureColors[verticesPerRow * splitYBy] = ci[2]; - figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; - figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; - - mesh.figures[index] = { - type: 'lattice', - coords: figureCoords, - colors: figureColors, - verticesPerRow: verticesPerRow - }; - } - - function decodeType6Shading(mesh, reader) { - // A special case of Type 7. The p11, p12, p21, p22 automatically filled - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type6 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 8 : 12); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 7; - ps[ 4] = pi + 1; /* calculated below */ ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = ps[2]; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - // set p11, p12, p21, p22 - ps[5] = coords.length; - coords.push([ - (-4 * coords[ps[0]][0] - coords[ps[15]][0] + - 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, - (-4 * coords[ps[0]][1] - coords[ps[15]][1] + - 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9 - ]); - ps[6] = coords.length; - coords.push([ - (-4 * coords[ps[3]][0] - coords[ps[12]][0] + - 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, - (-4 * coords[ps[3]][1] - coords[ps[12]][1] + - 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9 - ]); - ps[9] = coords.length; - coords.push([ - (-4 * coords[ps[12]][0] - coords[ps[3]][0] + - 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, - (-4 * coords[ps[12]][1] - coords[ps[3]][1] + - 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9 - ]); - ps[10] = coords.length; - coords.push([ - (-4 * coords[ps[15]][0] - coords[ps[0]][0] + - 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, - (-4 * coords[ps[15]][1] - coords[ps[0]][1] + - 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9 - ]); - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function decodeType7Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type7 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 12 : 16); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; ps[ 9] = pi + 13; ps[10] = pi + 14; ps[11] = pi + 7; - ps[ 4] = pi + 1; ps[ 5] = pi + 12; ps[ 6] = pi + 15; ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = ps[2]; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function updateBounds(mesh) { - var minX = mesh.coords[0][0], minY = mesh.coords[0][1], - maxX = minX, maxY = minY; - for (var i = 1, ii = mesh.coords.length; i < ii; i++) { - var x = mesh.coords[i][0], y = mesh.coords[i][1]; - minX = minX > x ? x : minX; - minY = minY > y ? y : minY; - maxX = maxX < x ? x : maxX; - maxY = maxY < y ? y : maxY; - } - mesh.bounds = [minX, minY, maxX, maxY]; - } - - function packData(mesh) { - var i, ii, j, jj; - - var coords = mesh.coords; - var coordsPacked = new Float32Array(coords.length * 2); - for (i = 0, j = 0, ii = coords.length; i < ii; i++) { - var xy = coords[i]; - coordsPacked[j++] = xy[0]; - coordsPacked[j++] = xy[1]; - } - mesh.coords = coordsPacked; - - var colors = mesh.colors; - var colorsPacked = new Uint8Array(colors.length * 3); - for (i = 0, j = 0, ii = colors.length; i < ii; i++) { - var c = colors[i]; - colorsPacked[j++] = c[0]; - colorsPacked[j++] = c[1]; - colorsPacked[j++] = c[2]; - } - mesh.colors = colorsPacked; - - var figures = mesh.figures; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - for (j = 0, jj = ps.length; j < jj; j++) { - ps[j] *= 2; - cs[j] *= 3; - } - } - } - - function Mesh(stream, matrix, xref, res) { - assert(isStream(stream), 'Mesh data is not a stream'); - var dict = stream.dict; - this.matrix = matrix; - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - this.bbox = dict.get('BBox'); - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - this.background = dict.has('Background') ? - cs.getRgb(dict.get('Background'), 0) : null; - - var fnObj = dict.get('Function'); - var fn = fnObj ? PDFFunction.parseArray(xref, fnObj) : null; - - this.coords = []; - this.colors = []; - this.figures = []; - - var decodeContext = { - bitsPerCoordinate: dict.get('BitsPerCoordinate'), - bitsPerComponent: dict.get('BitsPerComponent'), - bitsPerFlag: dict.get('BitsPerFlag'), - decode: dict.get('Decode'), - colorFn: fn, - colorSpace: cs, - numComps: fn ? 1 : cs.numComps - }; - var reader = new MeshStreamReader(stream, decodeContext); - - var patchMesh = false; - switch (this.shadingType) { - case ShadingType.FREE_FORM_MESH: - decodeType4Shading(this, reader); - break; - case ShadingType.LATTICE_FORM_MESH: - var verticesPerRow = dict.get('VerticesPerRow') | 0; - assert(verticesPerRow >= 2, 'Invalid VerticesPerRow'); - decodeType5Shading(this, reader, verticesPerRow); - break; - case ShadingType.COONS_PATCH_MESH: - decodeType6Shading(this, reader); - patchMesh = true; - break; - case ShadingType.TENSOR_PATCH_MESH: - decodeType7Shading(this, reader); - patchMesh = true; - break; - default: - error('Unsupported mesh type.'); - break; - } - - if (patchMesh) { - // dirty bounds calculation for determining, how dense shall be triangles - updateBounds(this); - for (var i = 0, ii = this.figures.length; i < ii; i++) { - buildFigureFromPatch(this, i); - } - } - // calculate bounds - updateBounds(this); - - packData(this); - } - - Mesh.prototype = { - getIR: function Mesh_getIR() { - return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, - this.bounds, this.matrix, this.bbox, this.background]; - } - }; - - return Mesh; -})(); - -Shadings.Dummy = (function DummyClosure() { - function Dummy() { - this.type = 'Pattern'; - } - - Dummy.prototype = { - getIR: function Dummy_getIR() { - return ['Dummy']; - } - }; - return Dummy; -})(); - -function getTilingPatternIR(operatorList, dict, args) { - var matrix = dict.get('Matrix'); - var bbox = dict.get('BBox'); - var xstep = dict.get('XStep'); - var ystep = dict.get('YStep'); - var paintType = dict.get('PaintType'); - var tilingType = dict.get('TilingType'); - - return [ - 'TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, - paintType, tilingType - ]; -} - -exports.Pattern = Pattern; -exports.getTilingPatternIR = getTilingPatternIR; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreEvaluator = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser, - root.pdfjsCoreImage, root.pdfjsCoreColorSpace, root.pdfjsCoreMurmurHash3, - root.pdfjsCoreFonts, root.pdfjsCoreFunction, root.pdfjsCorePattern, - root.pdfjsCoreCMap, root.pdfjsCoreMetrics, root.pdfjsCoreBidi); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser, - coreImage, coreColorSpace, coreMurmurHash3, coreFonts, - coreFunction, corePattern, coreCMap, coreMetrics, coreBidi) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; -var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; -var ImageKind = sharedUtil.ImageKind; -var OPS = sharedUtil.OPS; -var TextRenderingMode = sharedUtil.TextRenderingMode; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isNum = sharedUtil.isNum; -var isString = sharedUtil.isString; -var warn = sharedUtil.warn; -var Dict = corePrimitives.Dict; -var Name = corePrimitives.Name; -var isCmd = corePrimitives.isCmd; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isRef = corePrimitives.isRef; -var isStream = corePrimitives.isStream; -var DecodeStream = coreStream.DecodeStream; -var JpegStream = coreStream.JpegStream; -var Lexer = coreParser.Lexer; -var Parser = coreParser.Parser; -var isEOF = coreParser.isEOF; -var PDFImage = coreImage.PDFImage; -var ColorSpace = coreColorSpace.ColorSpace; -var MurmurHash3_64 = coreMurmurHash3.MurmurHash3_64; -var Encodings = coreFonts.Encodings; -var ErrorFont = coreFonts.ErrorFont; -var FontFlags = coreFonts.FontFlags; -var Font = coreFonts.Font; -var IdentityToUnicodeMap = coreFonts.IdentityToUnicodeMap; -var NormalizedUnicodes = coreFonts.NormalizedUnicodes; -var ToUnicodeMap = coreFonts.ToUnicodeMap; -var getFontType = coreFonts.getFontType; -var reverseIfRtl = coreFonts.reverseIfRtl; -var serifFonts = coreFonts.serifFonts; -var symbolsFonts = coreFonts.symbolsFonts; -var stdFontMap = coreFonts.stdFontMap; -var isPDFFunction = coreFunction.isPDFFunction; -var PDFFunction = coreFunction.PDFFunction; -var Pattern = corePattern.Pattern; -var getTilingPatternIR = corePattern.getTilingPatternIR; -var CMapFactory = coreCMap.CMapFactory; -var IdentityCMap = coreCMap.IdentityCMap; -var Metrics = coreMetrics.Metrics; -var bidi = coreBidi.bidi; - -var PartialEvaluator = (function PartialEvaluatorClosure() { - function PartialEvaluator(pdfManager, xref, handler, pageIndex, - uniquePrefix, idCounters, fontCache) { - this.pdfManager = pdfManager; - this.xref = xref; - this.handler = handler; - this.pageIndex = pageIndex; - this.uniquePrefix = uniquePrefix; - this.idCounters = idCounters; - this.fontCache = fontCache; - } - - // Trying to minimize Date.now() usage and check every 100 time - var TIME_SLOT_DURATION_MS = 20; - var CHECK_TIME_EVERY = 100; - function TimeSlotManager() { - this.reset(); - } - TimeSlotManager.prototype = { - check: function TimeSlotManager_check() { - if (++this.checked < CHECK_TIME_EVERY) { - return false; - } - this.checked = 0; - return this.endTime <= Date.now(); - }, - reset: function TimeSlotManager_reset() { - this.endTime = Date.now() + TIME_SLOT_DURATION_MS; - this.checked = 0; - } - }; - - var deferred = Promise.resolve(); - - var TILING_PATTERN = 1, SHADING_PATTERN = 2; - - PartialEvaluator.prototype = { - hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!isDict(resources)) { - return false; - } - - var processed = Object.create(null); - if (resources.objId) { - processed[resources.objId] = true; - } - - var nodes = [resources]; - while (nodes.length) { - var key; - var node = nodes.shift(); - // First check the current resources for blend modes. - var graphicStates = node.get('ExtGState'); - if (isDict(graphicStates)) { - graphicStates = graphicStates.getAll(); - for (key in graphicStates) { - var graphicState = graphicStates[key]; - var bm = graphicState['BM']; - if (isName(bm) && bm.name !== 'Normal') { - return true; - } - } - } - // Descend into the XObjects to look for more resources and blend modes. - var xObjects = node.get('XObject'); - if (!isDict(xObjects)) { - continue; - } - xObjects = xObjects.getAll(); - for (key in xObjects) { - var xObject = xObjects[key]; - if (!isStream(xObject)) { - continue; - } - if (xObject.dict.objId) { - if (processed[xObject.dict.objId]) { - // stream has objId and is processed already - continue; - } - processed[xObject.dict.objId] = true; - } - var xResources = xObject.dict.get('Resources'); - // Checking objId to detect an infinite loop. - if (isDict(xResources) && - (!xResources.objId || !processed[xResources.objId])) { - nodes.push(xResources); - if (xResources.objId) { - processed[xResources.objId] = true; - } - } - } - } - return false; - }, - - buildFormXObject: function PartialEvaluator_buildFormXObject(resources, - xobj, smask, - operatorList, - task, - initialState) { - var matrix = xobj.dict.getArray('Matrix'); - var bbox = xobj.dict.getArray('BBox'); - var group = xobj.dict.get('Group'); - if (group) { - var groupOptions = { - matrix: matrix, - bbox: bbox, - smask: smask, - isolated: false, - knockout: false - }; - - var groupSubtype = group.get('S'); - var colorSpace; - if (isName(groupSubtype) && groupSubtype.name === 'Transparency') { - groupOptions.isolated = (group.get('I') || false); - groupOptions.knockout = (group.get('K') || false); - colorSpace = (group.has('CS') ? - ColorSpace.parse(group.get('CS'), this.xref, resources) : null); - } - - if (smask && smask.backdrop) { - colorSpace = colorSpace || ColorSpace.singletons.rgb; - smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); - } - - operatorList.addOp(OPS.beginGroup, [groupOptions]); - } - - operatorList.addOp(OPS.paintFormXObjectBegin, [matrix, bbox]); - - return this.getOperatorList(xobj, task, - (xobj.dict.get('Resources') || resources), operatorList, initialState). - then(function () { - operatorList.addOp(OPS.paintFormXObjectEnd, []); - - if (group) { - operatorList.addOp(OPS.endGroup, [groupOptions]); - } - }); - }, - - buildPaintImageXObject: - function PartialEvaluator_buildPaintImageXObject(resources, image, - inline, operatorList, - cacheKey, imageCache) { - var self = this; - var dict = image.dict; - var w = dict.get('Width', 'W'); - var h = dict.get('Height', 'H'); - - if (!(w && isNum(w)) || !(h && isNum(h))) { - warn('Image dimensions are missing, or not numbers.'); - return; - } - if (PDFJS.maxImageSize !== -1 && w * h > PDFJS.maxImageSize) { - warn('Image exceeded maximum allowed size and was removed.'); - return; - } - - var imageMask = (dict.get('ImageMask', 'IM') || false); - var imgData, args; - if (imageMask) { - // This depends on a tmpCanvas being filled with the - // current fillStyle, such that processing the pixel - // data can't be done here. Instead of creating a - // complete PDFImage, only read the information needed - // for later. - - var width = dict.get('Width', 'W'); - var height = dict.get('Height', 'H'); - var bitStrideLength = (width + 7) >> 3; - var imgArray = image.getBytes(bitStrideLength * height); - var decode = dict.get('Decode', 'D'); - var inverseDecode = (!!decode && decode[0] > 0); - - imgData = PDFImage.createMask(imgArray, width, height, - image instanceof DecodeStream, - inverseDecode); - imgData.cached = true; - args = [imgData]; - operatorList.addOp(OPS.paintImageMaskXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageMaskXObject, - args: args - }; - } - return; - } - - var softMask = (dict.get('SMask', 'SM') || false); - var mask = (dict.get('Mask') || false); - - var SMALL_IMAGE_DIMENSIONS = 200; - // Inlining small images into the queue as RGB data - if (inline && !softMask && !mask && !(image instanceof JpegStream) && - (w + h) < SMALL_IMAGE_DIMENSIONS) { - var imageObj = new PDFImage(this.xref, resources, image, - inline, null, null); - // We force the use of RGBA_32BPP images here, because we can't handle - // any other kind. - imgData = imageObj.createImageData(/* forceRGBA = */ true); - operatorList.addOp(OPS.paintInlineImageXObject, [imgData]); - return; - } - - // If there is no imageMask, create the PDFImage and a lot - // of image processing can be done here. - var uniquePrefix = (this.uniquePrefix || ''); - var objId = 'img_' + uniquePrefix + (++this.idCounters.obj); - operatorList.addDependency(objId); - args = [objId, w, h]; - - if (!softMask && !mask && image instanceof JpegStream && - image.isNativelySupported(this.xref, resources)) { - // These JPEGs don't need any more processing so we can just send it. - operatorList.addOp(OPS.paintJpegXObject, args); - this.handler.send('obj', - [objId, this.pageIndex, 'JpegStream', image.getIR()]); - return; - } - - PDFImage.buildImage(self.handler, self.xref, resources, image, inline). - then(function(imageObj) { - var imgData = imageObj.createImageData(/* forceRGBA = */ false); - self.handler.send('obj', [objId, self.pageIndex, 'Image', imgData], - [imgData.data.buffer]); - }).then(undefined, function (reason) { - warn('Unable to decode image: ' + reason); - self.handler.send('obj', [objId, self.pageIndex, 'Image', null]); - }); - - operatorList.addOp(OPS.paintImageXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageXObject, - args: args - }; - } - }, - - handleSMask: function PartialEvaluator_handleSmask(smask, resources, - operatorList, task, - stateManager) { - var smaskContent = smask.get('G'); - var smaskOptions = { - subtype: smask.get('S').name, - backdrop: smask.get('BC') - }; - - // The SMask might have a alpha/luminosity value transfer function -- - // we will build a map of integer values in range 0..255 to be fast. - var transferObj = smask.get('TR'); - if (isPDFFunction(transferObj)) { - var transferFn = PDFFunction.parse(this.xref, transferObj); - var transferMap = new Uint8Array(256); - var tmp = new Float32Array(1); - for (var i = 0; i < 255; i++) { - tmp[0] = i / 255; - transferFn(tmp, 0, tmp, 0); - transferMap[i] = (tmp[0] * 255) | 0; - } - smaskOptions.transferMap = transferMap; - } - - return this.buildFormXObject(resources, smaskContent, smaskOptions, - operatorList, task, stateManager.state.clone()); - }, - - handleTilingType: - function PartialEvaluator_handleTilingType(fn, args, resources, - pattern, patternDict, - operatorList, task) { - // Create an IR of the pattern code. - var tilingOpList = new OperatorList(); - // Merge the available resources, to prevent issues when the patternDict - // is missing some /Resources entries (fixes issue6541.pdf). - var resourcesArray = [patternDict.get('Resources'), resources]; - var patternResources = Dict.merge(this.xref, resourcesArray); - - return this.getOperatorList(pattern, task, patternResources, - tilingOpList).then(function () { - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - operatorList.addDependencies(tilingOpList.dependencies); - operatorList.addOp(fn, getTilingPatternIR({ - fnArray: tilingOpList.fnArray, - argsArray: tilingOpList.argsArray - }, patternDict, args)); - }); - }, - - handleSetFont: - function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, - operatorList, task, state) { - // TODO(mack): Not needed? - var fontName; - if (fontArgs) { - fontArgs = fontArgs.slice(); - fontName = fontArgs[0].name; - } - - var self = this; - return this.loadFont(fontName, fontRef, this.xref, resources).then( - function (translated) { - if (!translated.font.isType3Font) { - return translated; - } - return translated.loadType3Data(self, resources, operatorList, task). - then(function () { - return translated; - }, function (reason) { - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - return new TranslatedFont('g_font_error', - new ErrorFont('Type3 font load error: ' + reason), translated.font); - }); - }).then(function (translated) { - state.font = translated.font; - translated.send(self.handler); - return translated.loadedName; - }); - }, - - handleText: function PartialEvaluator_handleText(chars, state) { - var font = state.font; - var glyphs = font.charsToGlyphs(chars); - var isAddToPathSet = !!(state.textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - if (font.data && (isAddToPathSet || PDFJS.disableFontFace)) { - var buildPath = function (fontChar) { - if (!font.renderer.hasBuiltPath(fontChar)) { - var path = font.renderer.getPathJs(fontChar); - this.handler.send('commonobj', [ - font.loadedName + '_path_' + fontChar, - 'FontPath', - path - ]); - } - }.bind(this); - - for (var i = 0, ii = glyphs.length; i < ii; i++) { - var glyph = glyphs[i]; - buildPath(glyph.fontChar); - - // If the glyph has an accent we need to build a path for its - // fontChar too, otherwise CanvasGraphics_paintChar will fail. - var accent = glyph.accent; - if (accent && accent.fontChar) { - buildPath(accent.fontChar); - } - } - } - - return glyphs; - }, - - setGState: function PartialEvaluator_setGState(resources, gState, - operatorList, task, - xref, stateManager) { - // This array holds the converted/processed state data. - var gStateObj = []; - var gStateMap = gState.map; - var self = this; - var promise = Promise.resolve(); - for (var key in gStateMap) { - var value = gStateMap[key]; - switch (key) { - case 'Type': - break; - case 'LW': - case 'LC': - case 'LJ': - case 'ML': - case 'D': - case 'RI': - case 'FL': - case 'CA': - case 'ca': - gStateObj.push([key, value]); - break; - case 'Font': - promise = promise.then(function () { - return self.handleSetFont(resources, null, value[0], operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - gStateObj.push([key, [loadedName, value[1]]]); - }); - }); - break; - case 'BM': - gStateObj.push([key, value]); - break; - case 'SMask': - if (isName(value) && value.name === 'None') { - gStateObj.push([key, false]); - break; - } - var dict = xref.fetchIfRef(value); - if (isDict(dict)) { - promise = promise.then(function () { - return self.handleSMask(dict, resources, operatorList, - task, stateManager); - }); - gStateObj.push([key, true]); - } else { - warn('Unsupported SMask type'); - } - - break; - // Only generate info log messages for the following since - // they are unlikely to have a big impact on the rendering. - case 'OP': - case 'op': - case 'OPM': - case 'BG': - case 'BG2': - case 'UCR': - case 'UCR2': - case 'TR': - case 'TR2': - case 'HT': - case 'SM': - case 'SA': - case 'AIS': - case 'TK': - // TODO implement these operators. - info('graphic state operator ' + key); - break; - default: - info('Unknown graphic state operator ' + key); - break; - } - } - return promise.then(function () { - if (gStateObj.length >= 0) { - operatorList.addOp(OPS.setGState, [gStateObj]); - } - }); - }, - - loadFont: function PartialEvaluator_loadFont(fontName, font, xref, - resources) { - - function errorFont() { - return Promise.resolve(new TranslatedFont('g_font_error', - new ErrorFont('Font ' + fontName + ' is not available'), font)); - } - var fontRef; - if (font) { // Loading by ref. - assert(isRef(font)); - fontRef = font; - } else { // Loading by name. - var fontRes = resources.get('Font'); - if (fontRes) { - fontRef = fontRes.getRaw(fontName); - } else { - warn('fontRes not available'); - return errorFont(); - } - } - if (!fontRef) { - warn('fontRef not available'); - return errorFont(); - } - - if (this.fontCache.has(fontRef)) { - return this.fontCache.get(fontRef); - } - - font = xref.fetchIfRef(fontRef); - if (!isDict(font)) { - return errorFont(); - } - - // We are holding font.translated references just for fontRef that are not - // dictionaries (Dict). See explanation below. - if (font.translated) { - return font.translated; - } - - var fontCapability = createPromiseCapability(); - - var preEvaluatedFont = this.preEvaluateFont(font, xref); - var descriptor = preEvaluatedFont.descriptor; - var fontID = fontRef.num + '_' + fontRef.gen; - if (isDict(descriptor)) { - if (!descriptor.fontAliases) { - descriptor.fontAliases = Object.create(null); - } - - var fontAliases = descriptor.fontAliases; - var hash = preEvaluatedFont.hash; - if (fontAliases[hash]) { - var aliasFontRef = fontAliases[hash].aliasRef; - if (aliasFontRef && this.fontCache.has(aliasFontRef)) { - this.fontCache.putAlias(fontRef, aliasFontRef); - return this.fontCache.get(fontRef); - } - } - - if (!fontAliases[hash]) { - fontAliases[hash] = { - fontID: Font.getFontID() - }; - } - - fontAliases[hash].aliasRef = fontRef; - fontID = fontAliases[hash].fontID; - } - - // Workaround for bad PDF generators that don't reference fonts - // properly, i.e. by not using an object identifier. - // Check if the fontRef is a Dict (as opposed to a standard object), - // in which case we don't cache the font and instead reference it by - // fontName in font.loadedName below. - var fontRefIsDict = isDict(fontRef); - if (!fontRefIsDict) { - this.fontCache.put(fontRef, fontCapability.promise); - } - - // Keep track of each font we translated so the caller can - // load them asynchronously before calling display on a page. - font.loadedName = 'g_' + this.pdfManager.docId + '_f' + (fontRefIsDict ? - fontName.replace(/\W/g, '') : fontID); - - font.translated = fontCapability.promise; - - // TODO move promises into translate font - var translatedPromise; - try { - translatedPromise = Promise.resolve( - this.translateFont(preEvaluatedFont, xref)); - } catch (e) { - translatedPromise = Promise.reject(e); - } - - var self = this; - translatedPromise.then(function (translatedFont) { - if (translatedFont.fontType !== undefined) { - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[translatedFont.fontType] = true; - } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - translatedFont, font)); - }, function (reason) { - // TODO fontCapability.reject? - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - - try { - // error, but it's still nice to have font type reported - var descriptor = preEvaluatedFont.descriptor; - var fontFile3 = descriptor && descriptor.get('FontFile3'); - var subtype = fontFile3 && fontFile3.get('Subtype'); - var fontType = getFontType(preEvaluatedFont.type, - subtype && subtype.name); - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[fontType] = true; - } catch (ex) { } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - new ErrorFont(reason instanceof Error ? reason.message : reason), - font)); - }); - return fontCapability.promise; - }, - - buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { - var lastIndex = operatorList.length - 1; - if (!args) { - args = []; - } - if (lastIndex < 0 || - operatorList.fnArray[lastIndex] !== OPS.constructPath) { - operatorList.addOp(OPS.constructPath, [[fn], args]); - } else { - var opArgs = operatorList.argsArray[lastIndex]; - opArgs[0].push(fn); - Array.prototype.push.apply(opArgs[1], args); - } - }, - - handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, - cs, patterns, resources, task, xref) { - // compile tiling patterns - var patternName = args[args.length - 1]; - // SCN/scn applies patterns along with normal colors - var pattern; - if (isName(patternName) && - (pattern = patterns.get(patternName.name))) { - var dict = (isStream(pattern) ? pattern.dict : pattern); - var typeNum = dict.get('PatternType'); - - if (typeNum === TILING_PATTERN) { - var color = cs.base ? cs.base.getRgb(args, 0) : null; - return this.handleTilingType(fn, color, resources, pattern, - dict, operatorList, task); - } else if (typeNum === SHADING_PATTERN) { - var shading = dict.get('Shading'); - var matrix = dict.get('Matrix'); - pattern = Pattern.parseShading(shading, matrix, xref, resources, - this.handler); - operatorList.addOp(fn, pattern.getIR()); - return Promise.resolve(); - } else { - return Promise.reject('Unknown PatternType: ' + typeNum); - } - } - // TODO shall we fail here? - operatorList.addOp(fn, args); - return Promise.resolve(); - }, - - getOperatorList: function PartialEvaluator_getOperatorList(stream, - task, - resources, - operatorList, - initialState) { - - var self = this; - var xref = this.xref; - var imageCache = {}; - - assert(operatorList); - - resources = (resources || Dict.empty); - var xobjs = (resources.get('XObject') || Dict.empty); - var patterns = (resources.get('Pattern') || Dict.empty); - var stateManager = new StateManager(initialState || new EvalState()); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function next(resolve, reject) { - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, i, ii, cs; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are used beyond this loop, so we - // cannot reuse the same array on each iteration. Therefore we pass - // in |null| as the initial value (see the comment on - // EvaluatorPreprocessor_read() for why). - operation.args = null; - if (!(preprocessor.read(operation))) { - break; - } - var args = operation.args; - var fn = operation.fn; - - switch (fn | 0) { - case OPS.paintXObject: - if (args[0].code) { - break; - } - // eagerly compile XForm objects - var name = args[0].name; - if (!name) { - warn('XObject must be referred to by name.'); - continue; - } - if (imageCache[name] !== undefined) { - operatorList.addOp(imageCache[name].fn, imageCache[name].args); - args = null; - continue; - } - - var xobj = xobjs.get(name); - if (xobj) { - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), - 'XObject should have a Name subtype'); - - if (type.name === 'Form') { - stateManager.save(); - return self.buildFormXObject(resources, xobj, null, - operatorList, task, - stateManager.state.clone()). - then(function () { - stateManager.restore(); - next(resolve, reject); - }, reject); - } else if (type.name === 'Image') { - self.buildPaintImageXObject(resources, xobj, false, - operatorList, name, imageCache); - args = null; - continue; - } else if (type.name === 'PS') { - // PostScript XObjects are unused when viewing documents. - // See section 4.7.1 of Adobe's PDF reference. - info('Ignored XObject subtype PS'); - continue; - } else { - error('Unhandled XObject subtype ' + type.name); - } - } - break; - case OPS.setFont: - var fontSize = args[1]; - // eagerly collect all fonts - return self.handleSetFont(resources, args, null, operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - operatorList.addOp(OPS.setFont, [loadedName, fontSize]); - next(resolve, reject); - }, reject); - case OPS.endInlineImage: - var cacheKey = args[0].cacheKey; - if (cacheKey) { - var cacheEntry = imageCache[cacheKey]; - if (cacheEntry !== undefined) { - operatorList.addOp(cacheEntry.fn, cacheEntry.args); - args = null; - continue; - } - } - self.buildPaintImageXObject(resources, args[0], true, - operatorList, cacheKey, imageCache); - args = null; - continue; - case OPS.showText: - args[0] = self.handleText(args[0], stateManager.state); - break; - case OPS.showSpacedText: - var arr = args[0]; - var combinedGlyphs = []; - var arrLength = arr.length; - var state = stateManager.state; - for (i = 0; i < arrLength; ++i) { - var arrItem = arr[i]; - if (isString(arrItem)) { - Array.prototype.push.apply(combinedGlyphs, - self.handleText(arrItem, state)); - } else if (isNum(arrItem)) { - combinedGlyphs.push(arrItem); - } - } - args[0] = combinedGlyphs; - fn = OPS.showText; - break; - case OPS.nextLineShowText: - operatorList.addOp(OPS.nextLine); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.nextLineSetSpacingShowText: - operatorList.addOp(OPS.nextLine); - operatorList.addOp(OPS.setWordSpacing, [args.shift()]); - operatorList.addOp(OPS.setCharSpacing, [args.shift()]); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.setTextRenderingMode: - stateManager.state.textRenderingMode = args[0]; - break; - - case OPS.setFillColorSpace: - stateManager.state.fillColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setStrokeColorSpace: - stateManager.state.strokeColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setFillColor: - cs = stateManager.state.fillColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColor: - cs = stateManager.state.strokeColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillGray: - stateManager.state.fillColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeGray: - stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillCMYKColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeCMYKColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillRGBColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setStrokeRGBColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setFillColorN: - cs = stateManager.state.fillColorSpace; - if (cs.name === 'Pattern') { - return self.handleColorN(operatorList, OPS.setFillColorN, - args, cs, patterns, resources, task, xref).then(function() { - next(resolve, reject); - }, reject); - } - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColorN: - cs = stateManager.state.strokeColorSpace; - if (cs.name === 'Pattern') { - return self.handleColorN(operatorList, OPS.setStrokeColorN, - args, cs, patterns, resources, task, xref).then(function() { - next(resolve, reject); - }, reject); - } - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - - case OPS.shadingFill: - var shadingRes = resources.get('Shading'); - if (!shadingRes) { - error('No shading resource found'); - } - - var shading = shadingRes.get(args[0].name); - if (!shading) { - error('No shading object found'); - } - - var shadingFill = Pattern.parseShading(shading, null, xref, - resources, self.handler); - var patternIR = shadingFill.getIR(); - args = [patternIR]; - fn = OPS.shadingFill; - break; - case OPS.setGState: - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gState = extGState.get(dictName.name); - return self.setGState(resources, gState, operatorList, task, - xref, stateManager).then(function() { - next(resolve, reject); - }, reject); - case OPS.moveTo: - case OPS.lineTo: - case OPS.curveTo: - case OPS.curveTo2: - case OPS.curveTo3: - case OPS.closePath: - self.buildPath(operatorList, fn, args); - continue; - case OPS.rectangle: - self.buildPath(operatorList, fn, args); - continue; - case OPS.markPoint: - case OPS.markPointProps: - case OPS.beginMarkedContent: - case OPS.beginMarkedContentProps: - case OPS.endMarkedContent: - case OPS.beginCompat: - case OPS.endCompat: - // Ignore operators where the corresponding handlers are known to - // be no-op in CanvasGraphics (display/canvas.js). This prevents - // serialization errors and is also a bit more efficient. - // We could also try to serialize all objects in a general way, - // e.g. as done in https://github.com/mozilla/pdf.js/pull/6266, - // but doing so is meaningless without knowing the semantics. - continue; - default: - // Note: Let's hope that the ignored operator does not have any - // non-serializable arguments, otherwise postMessage will throw - // "An object could not be cloned.". - } - operatorList.addOp(fn, args); - } - if (stop) { - deferred.then(function () { - next(resolve, reject); - }, reject); - return; - } - // Some PDFs don't close all restores inside object/form. - // Closing those for them. - for (i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { - operatorList.addOp(OPS.restore, []); - } - resolve(); - }); - }, - - getTextContent: - function PartialEvaluator_getTextContent(stream, task, resources, - stateManager, - normalizeWhitespace) { - - stateManager = (stateManager || new StateManager(new TextState())); - - var WhitespaceRegexp = /\s/g; - - var textContent = { - items: [], - styles: Object.create(null) - }; - var textContentItem = { - initialized: false, - str: [], - width: 0, - height: 0, - vertical: false, - lastAdvanceWidth: 0, - lastAdvanceHeight: 0, - textAdvanceScale: 0, - spaceWidth: 0, - fakeSpaceMin: Infinity, - fakeMultiSpaceMin: Infinity, - fakeMultiSpaceMax: -0, - textRunBreakAllowed: false, - transform: null, - fontName: null - }; - var SPACE_FACTOR = 0.3; - var MULTI_SPACE_FACTOR = 1.5; - var MULTI_SPACE_FACTOR_MAX = 4; - - var self = this; - var xref = this.xref; - - resources = (xref.fetchIfRef(resources) || Dict.empty); - - // The xobj is parsed iff it's needed, e.g. if there is a `DO` cmd. - var xobjs = null; - var xobjsCache = {}; - - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - - var textState; - - function ensureTextContentItem() { - if (textContentItem.initialized) { - return textContentItem; - } - var font = textState.font; - if (!(font.loadedName in textContent.styles)) { - textContent.styles[font.loadedName] = { - fontFamily: font.fallbackName, - ascent: font.ascent, - descent: font.descent, - vertical: font.vertical - }; - } - textContentItem.fontName = font.loadedName; - - // 9.4.4 Text Space Details - var tsm = [textState.fontSize * textState.textHScale, 0, - 0, textState.fontSize, - 0, textState.textRise]; - - if (font.isType3Font && - textState.fontMatrix !== FONT_IDENTITY_MATRIX && - textState.fontSize === 1) { - var glyphHeight = font.bbox[3] - font.bbox[1]; - if (glyphHeight > 0) { - glyphHeight = glyphHeight * textState.fontMatrix[3]; - tsm[3] *= glyphHeight; - } - } - - var trm = Util.transform(textState.ctm, - Util.transform(textState.textMatrix, tsm)); - textContentItem.transform = trm; - if (!font.vertical) { - textContentItem.width = 0; - textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); - textContentItem.vertical = false; - } else { - textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); - textContentItem.height = 0; - textContentItem.vertical = true; - } - - var a = textState.textLineMatrix[0]; - var b = textState.textLineMatrix[1]; - var scaleLineX = Math.sqrt(a * a + b * b); - a = textState.ctm[0]; - b = textState.ctm[1]; - var scaleCtmX = Math.sqrt(a * a + b * b); - textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; - textContentItem.lastAdvanceWidth = 0; - textContentItem.lastAdvanceHeight = 0; - - var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; - if (spaceWidth) { - textContentItem.spaceWidth = spaceWidth; - textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; - textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; - textContentItem.fakeMultiSpaceMax = - spaceWidth * MULTI_SPACE_FACTOR_MAX; - // It's okay for monospace fonts to fake as much space as needed. - textContentItem.textRunBreakAllowed = !font.isMonospace; - } else { - textContentItem.spaceWidth = 0; - textContentItem.fakeSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMax = 0; - textContentItem.textRunBreakAllowed = false; - } - - - textContentItem.initialized = true; - return textContentItem; - } - - function replaceWhitespace(str) { - // Replaces all whitespaces with standard spaces (0x20), to avoid - // alignment issues between the textLayer and the canvas if the text - // contains e.g. tabs (fixes issue6612.pdf). - var i = 0, ii = str.length, code; - while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { - i++; - } - return (i < ii ? str.replace(WhitespaceRegexp, ' ') : str); - } - - function runBidiTransform(textChunk) { - var str = textChunk.str.join(''); - var bidiResult = PDFJS.bidi(str, -1, textChunk.vertical); - return { - str: (normalizeWhitespace ? replaceWhitespace(bidiResult.str) : - bidiResult.str), - dir: bidiResult.dir, - width: textChunk.width, - height: textChunk.height, - transform: textChunk.transform, - fontName: textChunk.fontName - }; - } - - function handleSetFont(fontName, fontRef) { - return self.loadFont(fontName, fontRef, xref, resources). - then(function (translated) { - textState.font = translated.font; - textState.fontMatrix = translated.font.fontMatrix || - FONT_IDENTITY_MATRIX; - }); - } - - function buildTextContentItem(chars) { - var font = textState.font; - var textChunk = ensureTextContentItem(); - var width = 0; - var height = 0; - var glyphs = font.charsToGlyphs(chars); - var defaultVMetrics = font.defaultVMetrics; - for (var i = 0; i < glyphs.length; i++) { - var glyph = glyphs[i]; - var vMetricX = null; - var vMetricY = null; - var glyphWidth = null; - if (font.vertical) { - if (glyph.vmetric) { - glyphWidth = glyph.vmetric[0]; - vMetricX = glyph.vmetric[1]; - vMetricY = glyph.vmetric[2]; - } else { - glyphWidth = glyph.width; - vMetricX = glyph.width * 0.5; - vMetricY = defaultVMetrics[2]; - } - } else { - glyphWidth = glyph.width; - } - - var glyphUnicode = glyph.unicode; - if (NormalizedUnicodes[glyphUnicode] !== undefined) { - glyphUnicode = NormalizedUnicodes[glyphUnicode]; - } - glyphUnicode = reverseIfRtl(glyphUnicode); - - // The following will calculate the x and y of the individual glyphs. - // if (font.vertical) { - // tsm[4] -= vMetricX * Math.abs(textState.fontSize) * - // textState.fontMatrix[0]; - // tsm[5] -= vMetricY * textState.fontSize * - // textState.fontMatrix[0]; - // } - // var trm = Util.transform(textState.textMatrix, tsm); - // var pt = Util.applyTransform([trm[4], trm[5]], textState.ctm); - // var x = pt[0]; - // var y = pt[1]; - - var charSpacing = textState.charSpacing; - if (glyph.isSpace) { - var wordSpacing = textState.wordSpacing; - charSpacing += wordSpacing; - if (wordSpacing > 0) { - addFakeSpaces(wordSpacing, textChunk.str); - } - } - - var tx = 0; - var ty = 0; - if (!font.vertical) { - var w0 = glyphWidth * textState.fontMatrix[0]; - tx = (w0 * textState.fontSize + charSpacing) * - textState.textHScale; - width += tx; - } else { - var w1 = glyphWidth * textState.fontMatrix[0]; - ty = w1 * textState.fontSize + charSpacing; - height += ty; - } - textState.translateTextMatrix(tx, ty); - - textChunk.str.push(glyphUnicode); - } - - if (!font.vertical) { - textChunk.lastAdvanceWidth = width; - textChunk.width += width * textChunk.textAdvanceScale; - } else { - textChunk.lastAdvanceHeight = height; - textChunk.height += Math.abs(height * textChunk.textAdvanceScale); - } - - return textChunk; - } - - function addFakeSpaces(width, strBuf) { - if (width < textContentItem.fakeSpaceMin) { - return; - } - if (width < textContentItem.fakeMultiSpaceMin) { - strBuf.push(' '); - return; - } - var fakeSpaces = Math.round(width / textContentItem.spaceWidth); - while (fakeSpaces-- > 0) { - strBuf.push(' '); - } - } - - function flushTextContentItem() { - if (!textContentItem.initialized) { - return; - } - textContent.items.push(runBidiTransform(textContentItem)); - - textContentItem.initialized = false; - textContentItem.str.length = 0; - } - - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function next(resolve, reject) { - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, args = []; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are not used beyond this loop, so - // we can reuse the same array on every iteration, thus avoiding - // unnecessary allocations. - args.length = 0; - operation.args = args; - if (!(preprocessor.read(operation))) { - break; - } - textState = stateManager.state; - var fn = operation.fn; - args = operation.args; - var advance; - - switch (fn | 0) { - case OPS.setFont: - flushTextContentItem(); - textState.fontSize = args[1]; - return handleSetFont(args[0].name).then(function() { - next(resolve, reject); - }, reject); - case OPS.setTextRise: - flushTextContentItem(); - textState.textRise = args[0]; - break; - case OPS.setHScale: - flushTextContentItem(); - textState.textHScale = args[0] / 100; - break; - case OPS.setLeading: - flushTextContentItem(); - textState.leading = args[0]; - break; - case OPS.moveText: - // Optimization to treat same line movement as advance - var isSameTextLine = !textState.font ? false : - ((textState.font.vertical ? args[0] : args[1]) === 0); - advance = args[0] - args[1]; - if (isSameTextLine && textContentItem.initialized && - advance > 0 && - advance <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(args[0], args[1]); - textContentItem.width += - (args[0] - textContentItem.lastAdvanceWidth); - textContentItem.height += - (args[1] - textContentItem.lastAdvanceHeight); - var diff = (args[0] - textContentItem.lastAdvanceWidth) - - (args[1] - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } - - flushTextContentItem(); - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.setLeadingMoveText: - flushTextContentItem(); - textState.leading = -args[1]; - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.nextLine: - flushTextContentItem(); - textState.carriageReturn(); - break; - case OPS.setTextMatrix: - flushTextContentItem(); - textState.setTextMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - textState.setTextLineMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.setCharSpacing: - textState.charSpacing = args[0]; - break; - case OPS.setWordSpacing: - textState.wordSpacing = args[0]; - break; - case OPS.beginText: - flushTextContentItem(); - textState.textMatrix = IDENTITY_MATRIX.slice(); - textState.textLineMatrix = IDENTITY_MATRIX.slice(); - break; - case OPS.showSpacedText: - var items = args[0]; - var offset; - for (var j = 0, jj = items.length; j < jj; j++) { - if (typeof items[j] === 'string') { - buildTextContentItem(items[j]); - } else { - ensureTextContentItem(); - - // PDF Specification 5.3.2 states: - // The number is expressed in thousandths of a unit of text - // space. - // This amount is subtracted from the current horizontal or - // vertical coordinate, depending on the writing mode. - // In the default coordinate system, a positive adjustment - // has the effect of moving the next glyph painted either to - // the left or down by the given amount. - advance = items[j] * textState.fontSize / 1000; - var breakTextRun = false; - if (textState.font.vertical) { - offset = advance * - (textState.textHScale * textState.textMatrix[2] + - textState.textMatrix[3]); - textState.translateTextMatrix(0, advance); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be added to height to paint down. - textContentItem.height += offset; - } - } else { - advance = -advance; - offset = advance * ( - textState.textHScale * textState.textMatrix[0] + - textState.textMatrix[1]); - textState.translateTextMatrix(advance, 0); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be subtracted from width to paint left. - textContentItem.width += offset; - } - } - if (breakTextRun) { - flushTextContentItem(); - } else if (advance > 0) { - addFakeSpaces(advance, textContentItem.str); - } - } - } - break; - case OPS.showText: - buildTextContentItem(args[0]); - break; - case OPS.nextLineShowText: - flushTextContentItem(); - textState.carriageReturn(); - buildTextContentItem(args[0]); - break; - case OPS.nextLineSetSpacingShowText: - flushTextContentItem(); - textState.wordSpacing = args[0]; - textState.charSpacing = args[1]; - textState.carriageReturn(); - buildTextContentItem(args[2]); - break; - case OPS.paintXObject: - flushTextContentItem(); - if (args[0].code) { - break; - } - - if (!xobjs) { - xobjs = (resources.get('XObject') || Dict.empty); - } - - var name = args[0].name; - if (xobjsCache.key === name) { - if (xobjsCache.texts) { - Util.appendToArray(textContent.items, xobjsCache.texts.items); - Util.extendObj(textContent.styles, xobjsCache.texts.styles); - } - break; - } - - var xobj = xobjs.get(name); - if (!xobj) { - break; - } - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), - 'XObject should have a Name subtype'); - - if ('Form' !== type.name) { - xobjsCache.key = name; - xobjsCache.texts = null; - break; - } - - stateManager.save(); - var matrix = xobj.dict.get('Matrix'); - if (isArray(matrix) && matrix.length === 6) { - stateManager.transform(matrix); - } - - return self.getTextContent(xobj, task, - xobj.dict.get('Resources') || resources, stateManager, - normalizeWhitespace).then(function (formTextContent) { - Util.appendToArray(textContent.items, formTextContent.items); - Util.extendObj(textContent.styles, formTextContent.styles); - stateManager.restore(); - - xobjsCache.key = name; - xobjsCache.texts = formTextContent; - - next(resolve, reject); - }, reject); - case OPS.setGState: - flushTextContentItem(); - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gsStateMap = extGState.get(dictName.name); - var gsStateFont = null; - for (var key in gsStateMap) { - if (key === 'Font') { - assert(!gsStateFont); - gsStateFont = gsStateMap[key]; - } - } - if (gsStateFont) { - textState.fontSize = gsStateFont[1]; - return handleSetFont(gsStateFont[0]).then(function() { - next(resolve, reject); - }, reject); - } - break; - } // switch - } // while - if (stop) { - deferred.then(function () { - next(resolve, reject); - }, reject); - return; - } - flushTextContentItem(); - resolve(textContent); - }); - }, - - extractDataStructures: function - partialEvaluatorExtractDataStructures(dict, baseDict, - xref, properties) { - // 9.10.2 - var toUnicode = (dict.get('ToUnicode') || baseDict.get('ToUnicode')); - if (toUnicode) { - properties.toUnicode = this.readToUnicode(toUnicode); - } - if (properties.composite) { - // CIDSystemInfo helps to match CID to glyphs - var cidSystemInfo = dict.get('CIDSystemInfo'); - if (isDict(cidSystemInfo)) { - properties.cidSystemInfo = { - registry: cidSystemInfo.get('Registry'), - ordering: cidSystemInfo.get('Ordering'), - supplement: cidSystemInfo.get('Supplement') - }; - } - - var cidToGidMap = dict.get('CIDToGIDMap'); - if (isStream(cidToGidMap)) { - properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); - } - } - - // Based on 9.6.6 of the spec the encoding can come from multiple places - // and depends on the font type. The base encoding and differences are - // read here, but the encoding that is actually used is chosen during - // glyph mapping in the font. - // TODO: Loading the built in encoding in the font would allow the - // differences to be merged in here not require us to hold on to it. - var differences = []; - var baseEncodingName = null; - var encoding; - if (dict.has('Encoding')) { - encoding = dict.get('Encoding'); - if (isDict(encoding)) { - baseEncodingName = encoding.get('BaseEncoding'); - baseEncodingName = (isName(baseEncodingName) ? - baseEncodingName.name : null); - // Load the differences between the base and original - if (encoding.has('Differences')) { - var diffEncoding = encoding.get('Differences'); - var index = 0; - for (var j = 0, jj = diffEncoding.length; j < jj; j++) { - var data = diffEncoding[j]; - if (isNum(data)) { - index = data; - } else if (isName(data)) { - differences[index++] = data.name; - } else if (isRef(data)) { - diffEncoding[j--] = xref.fetch(data); - continue; - } else { - error('Invalid entry in \'Differences\' array: ' + data); - } - } - } - } else if (isName(encoding)) { - baseEncodingName = encoding.name; - } else { - error('Encoding is not a Name nor a Dict'); - } - // According to table 114 if the encoding is a named encoding it must be - // one of these predefined encodings. - if ((baseEncodingName !== 'MacRomanEncoding' && - baseEncodingName !== 'MacExpertEncoding' && - baseEncodingName !== 'WinAnsiEncoding')) { - baseEncodingName = null; - } - } - - if (baseEncodingName) { - properties.defaultEncoding = Encodings[baseEncodingName].slice(); - } else { - encoding = (properties.type === 'TrueType' ? - Encodings.WinAnsiEncoding : Encodings.StandardEncoding); - // The Symbolic attribute can be misused for regular fonts - // Heuristic: we have to check if the font is a standard one also - if (!!(properties.flags & FontFlags.Symbolic)) { - encoding = Encodings.MacRomanEncoding; - if (!properties.file) { - if (/Symbol/i.test(properties.name)) { - encoding = Encodings.SymbolSetEncoding; - } else if (/Dingbats/i.test(properties.name)) { - encoding = Encodings.ZapfDingbatsEncoding; - } - } - } - properties.defaultEncoding = encoding; - } - - properties.differences = differences; - properties.baseEncodingName = baseEncodingName; - properties.dict = dict; - }, - - readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { - var cmap, cmapObj = toUnicode; - if (isName(cmapObj)) { - cmap = CMapFactory.create(cmapObj, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - return new ToUnicodeMap(cmap.getMap()); - } else if (isStream(cmapObj)) { - cmap = CMapFactory.create(cmapObj, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - var map = new Array(cmap.length); - // Convert UTF-16BE - // NOTE: cmap can be a sparse array, so use forEach instead of for(;;) - // to iterate over all keys. - cmap.forEach(function(charCode, token) { - var str = []; - for (var k = 0; k < token.length; k += 2) { - var w1 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - if ((w1 & 0xF800) !== 0xD800) { // w1 < 0xD800 || w1 > 0xDFFF - str.push(w1); - continue; - } - k += 2; - var w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); - } - map[charCode] = String.fromCharCode.apply(String, str); - }); - return new ToUnicodeMap(map); - } - return null; - }, - - readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { - // Extract the encoding from the CIDToGIDMap - var glyphsData = cidToGidStream.getBytes(); - - // Set encoding 0 to later verify the font has an encoding - var result = []; - for (var j = 0, jj = glyphsData.length; j < jj; j++) { - var glyphID = (glyphsData[j++] << 8) | glyphsData[j]; - if (glyphID === 0) { - continue; - } - var code = j >> 1; - result[code] = glyphID; - } - return result; - }, - - extractWidths: function PartialEvaluator_extractWidths(dict, xref, - descriptor, - properties) { - var glyphsWidths = []; - var defaultWidth = 0; - var glyphsVMetrics = []; - var defaultVMetrics; - var i, ii, j, jj, start, code, widths; - if (properties.composite) { - defaultWidth = dict.get('DW') || 1000; - - widths = dict.get('W'); - if (widths) { - for (i = 0, ii = widths.length; i < ii; i++) { - start = widths[i++]; - code = xref.fetchIfRef(widths[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsWidths[start++] = code[j]; - } - } else { - var width = widths[++i]; - for (j = start; j <= code; j++) { - glyphsWidths[j] = width; - } - } - } - } - - if (properties.vertical) { - var vmetrics = (dict.get('DW2') || [880, -1000]); - defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; - vmetrics = dict.get('W2'); - if (vmetrics) { - for (i = 0, ii = vmetrics.length; i < ii; i++) { - start = vmetrics[i++]; - code = xref.fetchIfRef(vmetrics[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsVMetrics[start++] = [code[j++], code[j++], code[j]]; - } - } else { - var vmetric = [vmetrics[++i], vmetrics[++i], vmetrics[++i]]; - for (j = start; j <= code; j++) { - glyphsVMetrics[j] = vmetric; - } - } - } - } - } - } else { - var firstChar = properties.firstChar; - widths = dict.get('Widths'); - if (widths) { - j = firstChar; - for (i = 0, ii = widths.length; i < ii; i++) { - glyphsWidths[j++] = widths[i]; - } - defaultWidth = (parseFloat(descriptor.get('MissingWidth')) || 0); - } else { - // Trying get the BaseFont metrics (see comment above). - var baseFontName = dict.get('BaseFont'); - if (isName(baseFontName)) { - var metrics = this.getBaseFontMetrics(baseFontName.name); - - glyphsWidths = this.buildCharCodeToWidth(metrics.widths, - properties); - defaultWidth = metrics.defaultWidth; - } - } - } - - // Heuristic: detection of monospace font by checking all non-zero widths - var isMonospace = true; - var firstWidth = defaultWidth; - for (var glyph in glyphsWidths) { - var glyphWidth = glyphsWidths[glyph]; - if (!glyphWidth) { - continue; - } - if (!firstWidth) { - firstWidth = glyphWidth; - continue; - } - if (firstWidth !== glyphWidth) { - isMonospace = false; - break; - } - } - if (isMonospace) { - properties.flags |= FontFlags.FixedPitch; - } - - properties.defaultWidth = defaultWidth; - properties.widths = glyphsWidths; - properties.defaultVMetrics = defaultVMetrics; - properties.vmetrics = glyphsVMetrics; - }, - - isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - return (fontNameWoStyle in serifFonts) || - (fontNameWoStyle.search(/serif/gi) !== -1); - }, - - getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { - var defaultWidth = 0; - var widths = []; - var monospace = false; - var lookupName = (stdFontMap[name] || name); - - if (!(lookupName in Metrics)) { - // Use default fonts for looking up font metrics if the passed - // font is not a base font - if (this.isSerifFont(name)) { - lookupName = 'Times-Roman'; - } else { - lookupName = 'Helvetica'; - } - } - var glyphWidths = Metrics[lookupName]; - - if (isNum(glyphWidths)) { - defaultWidth = glyphWidths; - monospace = true; - } else { - widths = glyphWidths; - } - - return { - defaultWidth: defaultWidth, - monospace: monospace, - widths: widths - }; - }, - - buildCharCodeToWidth: - function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, - properties) { - var widths = Object.create(null); - var differences = properties.differences; - var encoding = properties.defaultEncoding; - for (var charCode = 0; charCode < 256; charCode++) { - if (charCode in differences && - widthsByGlyphName[differences[charCode]]) { - widths[charCode] = widthsByGlyphName[differences[charCode]]; - continue; - } - if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { - widths[charCode] = widthsByGlyphName[encoding[charCode]]; - continue; - } - } - return widths; - }, - - preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) { - var baseDict = dict; - var type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - - var composite = false; - var uint8array; - if (type.name === 'Type0') { - // If font is a composite - // - get the descendant font - // - set the type according to the descendant font - // - get the FontDescriptor from the descendant font - var df = dict.get('DescendantFonts'); - if (!df) { - error('Descendant fonts are not specified'); - } - dict = (isArray(df) ? xref.fetchIfRef(df[0]) : df); - - type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - composite = true; - } - - var descriptor = dict.get('FontDescriptor'); - if (descriptor) { - var hash = new MurmurHash3_64(); - var encoding = baseDict.getRaw('Encoding'); - if (isName(encoding)) { - hash.update(encoding.name); - } else if (isRef(encoding)) { - hash.update(encoding.num + '_' + encoding.gen); - } else if (isDict(encoding)) { - var keys = encoding.getKeys(); - for (var i = 0, ii = keys.length; i < ii; i++) { - var entry = encoding.getRaw(keys[i]); - if (isName(entry)) { - hash.update(entry.name); - } else if (isRef(entry)) { - hash.update(entry.num + '_' + entry.gen); - } else if (isArray(entry)) { // 'Differences' entry. - // Ideally we should check the contents of the array, but to avoid - // parsing it here and then again in |extractDataStructures|, - // we only use the array length for now (fixes bug1157493.pdf). - hash.update(entry.length.toString()); - } - } - } - - var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); - if (isStream(toUnicode)) { - var stream = toUnicode.str || toUnicode; - uint8array = stream.buffer ? - new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : - new Uint8Array(stream.bytes.buffer, - stream.start, stream.end - stream.start); - hash.update(uint8array); - - } else if (isName(toUnicode)) { - hash.update(toUnicode.name); - } - - var widths = dict.get('Widths') || baseDict.get('Widths'); - if (widths) { - uint8array = new Uint8Array(new Uint32Array(widths).buffer); - hash.update(uint8array); - } - } - - return { - descriptor: descriptor, - dict: dict, - baseDict: baseDict, - composite: composite, - type: type.name, - hash: hash ? hash.hexdigest() : '' - }; - }, - - translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, - xref) { - var baseDict = preEvaluatedFont.baseDict; - var dict = preEvaluatedFont.dict; - var composite = preEvaluatedFont.composite; - var descriptor = preEvaluatedFont.descriptor; - var type = preEvaluatedFont.type; - var maxCharIndex = (composite ? 0xFFFF : 0xFF); - var properties; - - if (!descriptor) { - if (type === 'Type3') { - // FontDescriptor is only required for Type3 fonts when the document - // is a tagged pdf. Create a barbebones one to get by. - descriptor = new Dict(null); - descriptor.set('FontName', Name.get(type)); - descriptor.set('FontBBox', dict.get('FontBBox')); - } else { - // Before PDF 1.5 if the font was one of the base 14 fonts, having a - // FontDescriptor was not required. - // This case is here for compatibility. - var baseFontName = dict.get('BaseFont'); - if (!isName(baseFontName)) { - error('Base font is not specified'); - } - - // Using base font name as a font name. - baseFontName = baseFontName.name.replace(/[,_]/g, '-'); - var metrics = this.getBaseFontMetrics(baseFontName); - - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - var flags = - (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | - (metrics.monospace ? FontFlags.FixedPitch : 0) | - (symbolsFonts[fontNameWoStyle] ? FontFlags.Symbolic : - FontFlags.Nonsymbolic); - - properties = { - type: type, - name: baseFontName, - widths: metrics.widths, - defaultWidth: metrics.defaultWidth, - flags: flags, - firstChar: 0, - lastChar: maxCharIndex - }; - this.extractDataStructures(dict, dict, xref, properties); - properties.widths = this.buildCharCodeToWidth(metrics.widths, - properties); - return new Font(baseFontName, null, properties); - } - } - - // According to the spec if 'FontDescriptor' is declared, 'FirstChar', - // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem - // to ignore this rule when a variant of a standart font is used. - // TODO Fill the width array depending on which of the base font this is - // a variant. - var firstChar = (dict.get('FirstChar') || 0); - var lastChar = (dict.get('LastChar') || maxCharIndex); - - var fontName = descriptor.get('FontName'); - var baseFont = dict.get('BaseFont'); - // Some bad PDFs have a string as the font name. - if (isString(fontName)) { - fontName = Name.get(fontName); - } - if (isString(baseFont)) { - baseFont = Name.get(baseFont); - } - - if (type !== 'Type3') { - var fontNameStr = fontName && fontName.name; - var baseFontStr = baseFont && baseFont.name; - if (fontNameStr !== baseFontStr) { - info('The FontDescriptor\'s FontName is "' + fontNameStr + - '" but should be the same as the Font\'s BaseFont "' + - baseFontStr + '"'); - // Workaround for cases where e.g. fontNameStr = 'Arial' and - // baseFontStr = 'Arial,Bold' (needed when no font file is embedded). - if (fontNameStr && baseFontStr && - baseFontStr.indexOf(fontNameStr) === 0) { - fontName = baseFont; - } - } - } - fontName = (fontName || baseFont); - - assert(isName(fontName), 'invalid font name'); - - var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); - if (fontFile) { - if (fontFile.dict) { - var subtype = fontFile.dict.get('Subtype'); - if (subtype) { - subtype = subtype.name; - } - var length1 = fontFile.dict.get('Length1'); - var length2 = fontFile.dict.get('Length2'); - } - } - - properties = { - type: type, - name: fontName.name, - subtype: subtype, - file: fontFile, - length1: length1, - length2: length2, - loadedName: baseDict.loadedName, - composite: composite, - wideChars: composite, - fixedPitch: false, - fontMatrix: (dict.get('FontMatrix') || FONT_IDENTITY_MATRIX), - firstChar: firstChar || 0, - lastChar: (lastChar || maxCharIndex), - bbox: descriptor.get('FontBBox'), - ascent: descriptor.get('Ascent'), - descent: descriptor.get('Descent'), - xHeight: descriptor.get('XHeight'), - capHeight: descriptor.get('CapHeight'), - flags: descriptor.get('Flags'), - italicAngle: descriptor.get('ItalicAngle'), - coded: false - }; - - if (composite) { - var cidEncoding = baseDict.get('Encoding'); - if (isName(cidEncoding)) { - properties.cidEncoding = cidEncoding.name; - } - properties.cMap = CMapFactory.create(cidEncoding, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - properties.vertical = properties.cMap.vertical; - } - this.extractDataStructures(dict, baseDict, xref, properties); - this.extractWidths(dict, xref, descriptor, properties); - - if (type === 'Type3') { - properties.isType3Font = true; - } - - return new Font(fontName.name, fontFile, properties); - } - }; - - return PartialEvaluator; -})(); - -var TranslatedFont = (function TranslatedFontClosure() { - function TranslatedFont(loadedName, font, dict) { - this.loadedName = loadedName; - this.font = font; - this.dict = dict; - this.type3Loaded = null; - this.sent = false; - } - TranslatedFont.prototype = { - send: function (handler) { - if (this.sent) { - return; - } - var fontData = this.font.exportData(); - handler.send('commonobj', [ - this.loadedName, - 'Font', - fontData - ]); - this.sent = true; - }, - loadType3Data: function (evaluator, resources, parentOperatorList, task) { - assert(this.font.isType3Font); - - if (this.type3Loaded) { - return this.type3Loaded; - } - - var translatedFont = this.font; - var loadCharProcsPromise = Promise.resolve(); - var charProcs = this.dict.get('CharProcs').getAll(); - var fontResources = this.dict.get('Resources') || resources; - var charProcKeys = Object.keys(charProcs); - var charProcOperatorList = {}; - for (var i = 0, n = charProcKeys.length; i < n; ++i) { - loadCharProcsPromise = loadCharProcsPromise.then(function (key) { - var glyphStream = charProcs[key]; - var operatorList = new OperatorList(); - return evaluator.getOperatorList(glyphStream, task, fontResources, - operatorList).then(function () { - charProcOperatorList[key] = operatorList.getIR(); - - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - parentOperatorList.addDependencies(operatorList.dependencies); - }, function (reason) { - warn('Type3 font resource \"' + key + '\" is not available'); - var operatorList = new OperatorList(); - charProcOperatorList[key] = operatorList.getIR(); - }); - }.bind(this, charProcKeys[i])); - } - this.type3Loaded = loadCharProcsPromise.then(function () { - translatedFont.charProcOperatorList = charProcOperatorList; - }); - return this.type3Loaded; - } - }; - return TranslatedFont; -})(); - -var OperatorList = (function OperatorListClosure() { - var CHUNK_SIZE = 1000; - var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; // close to chunk size - - function getTransfers(queue) { - var transfers = []; - var fnArray = queue.fnArray, argsArray = queue.argsArray; - for (var i = 0, ii = queue.length; i < ii; i++) { - switch (fnArray[i]) { - case OPS.paintInlineImageXObject: - case OPS.paintInlineImageXObjectGroup: - case OPS.paintImageMaskXObject: - var arg = argsArray[i][0]; // first param in imgData - if (!arg.cached) { - transfers.push(arg.data.buffer); - } - break; - } - } - return transfers; - } - - function OperatorList(intent, messageHandler, pageIndex) { - this.messageHandler = messageHandler; - this.fnArray = []; - this.argsArray = []; - this.dependencies = {}; - this._totalLength = 0; - this.pageIndex = pageIndex; - this.intent = intent; - } - - OperatorList.prototype = { - get length() { - return this.argsArray.length; - }, - - /** - * @returns {number} The total length of the entire operator list, - * since `this.length === 0` after flushing. - */ - get totalLength() { - return (this._totalLength + this.length); - }, - - addOp: function(fn, args) { - this.fnArray.push(fn); - this.argsArray.push(args); - if (this.messageHandler) { - if (this.fnArray.length >= CHUNK_SIZE) { - this.flush(); - } else if (this.fnArray.length >= CHUNK_SIZE_ABOUT && - (fn === OPS.restore || fn === OPS.endText)) { - // heuristic to flush on boundary of restore or endText - this.flush(); - } - } - }, - - addDependency: function(dependency) { - if (dependency in this.dependencies) { - return; - } - this.dependencies[dependency] = true; - this.addOp(OPS.dependency, [dependency]); - }, - - addDependencies: function(dependencies) { - for (var key in dependencies) { - this.addDependency(key); - } - }, - - addOpList: function(opList) { - Util.extendObj(this.dependencies, opList.dependencies); - for (var i = 0, ii = opList.length; i < ii; i++) { - this.addOp(opList.fnArray[i], opList.argsArray[i]); - } - }, - - getIR: function() { - return { - fnArray: this.fnArray, - argsArray: this.argsArray, - length: this.length - }; - }, - - flush: function(lastChunk) { - if (this.intent !== 'oplist') { - new QueueOptimizer().optimize(this); - } - var transfers = getTransfers(this); - var length = this.length; - this._totalLength += length; - - this.messageHandler.send('RenderPageChunk', { - operatorList: { - fnArray: this.fnArray, - argsArray: this.argsArray, - lastChunk: lastChunk, - length: length - }, - pageIndex: this.pageIndex, - intent: this.intent - }, transfers); - this.dependencies = {}; - this.fnArray.length = 0; - this.argsArray.length = 0; - } - }; - - return OperatorList; -})(); - -var StateManager = (function StateManagerClosure() { - function StateManager(initialState) { - this.state = initialState; - this.stateStack = []; - } - StateManager.prototype = { - save: function () { - var old = this.state; - this.stateStack.push(this.state); - this.state = old.clone(); - }, - restore: function () { - var prev = this.stateStack.pop(); - if (prev) { - this.state = prev; - } - }, - transform: function (args) { - this.state.ctm = Util.transform(this.state.ctm, args); - } - }; - return StateManager; -})(); - -var TextState = (function TextStateClosure() { - function TextState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.fontSize = 0; - this.font = null; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.textMatrix = IDENTITY_MATRIX.slice(); - this.textLineMatrix = IDENTITY_MATRIX.slice(); - this.charSpacing = 0; - this.wordSpacing = 0; - this.leading = 0; - this.textHScale = 1; - this.textRise = 0; - } - - TextState.prototype = { - setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textLineMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - translateTextMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textLineMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { - // 9.4.4 Text Space Details - var tsm = [this.fontSize * this.textHScale, 0, - 0, this.fontSize, - 0, this.textRise]; - return Util.transform(ctm, Util.transform(this.textMatrix, tsm)); - }, - carriageReturn: function TextState_carriageReturn() { - this.translateTextLineMatrix(0, -this.leading); - this.textMatrix = this.textLineMatrix.slice(); - }, - clone: function TextState_clone() { - var clone = Object.create(this); - clone.textMatrix = this.textMatrix.slice(); - clone.textLineMatrix = this.textLineMatrix.slice(); - clone.fontMatrix = this.fontMatrix.slice(); - return clone; - } - }; - return TextState; -})(); - -var EvalState = (function EvalStateClosure() { - function EvalState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.font = null; - this.textRenderingMode = TextRenderingMode.FILL; - this.fillColorSpace = ColorSpace.singletons.gray; - this.strokeColorSpace = ColorSpace.singletons.gray; - } - EvalState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - }; - return EvalState; -})(); - -var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() { - // Specifies properties for each command - // - // If variableArgs === true: [0, `numArgs`] expected - // If variableArgs === false: exactly `numArgs` expected - var OP_MAP = { - // Graphic state - w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false }, - J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false }, - j: { id: OPS.setLineJoin, numArgs: 1, variableArgs: false }, - M: { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false }, - d: { id: OPS.setDash, numArgs: 2, variableArgs: false }, - ri: { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false }, - i: { id: OPS.setFlatness, numArgs: 1, variableArgs: false }, - gs: { id: OPS.setGState, numArgs: 1, variableArgs: false }, - q: { id: OPS.save, numArgs: 0, variableArgs: false }, - Q: { id: OPS.restore, numArgs: 0, variableArgs: false }, - cm: { id: OPS.transform, numArgs: 6, variableArgs: false }, - - // Path - m: { id: OPS.moveTo, numArgs: 2, variableArgs: false }, - l: { id: OPS.lineTo, numArgs: 2, variableArgs: false }, - c: { id: OPS.curveTo, numArgs: 6, variableArgs: false }, - v: { id: OPS.curveTo2, numArgs: 4, variableArgs: false }, - y: { id: OPS.curveTo3, numArgs: 4, variableArgs: false }, - h: { id: OPS.closePath, numArgs: 0, variableArgs: false }, - re: { id: OPS.rectangle, numArgs: 4, variableArgs: false }, - S: { id: OPS.stroke, numArgs: 0, variableArgs: false }, - s: { id: OPS.closeStroke, numArgs: 0, variableArgs: false }, - f: { id: OPS.fill, numArgs: 0, variableArgs: false }, - F: { id: OPS.fill, numArgs: 0, variableArgs: false }, - 'f*': { id: OPS.eoFill, numArgs: 0, variableArgs: false }, - B: { id: OPS.fillStroke, numArgs: 0, variableArgs: false }, - 'B*': { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false }, - b: { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false }, - 'b*': { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false }, - n: { id: OPS.endPath, numArgs: 0, variableArgs: false }, - - // Clipping - W: { id: OPS.clip, numArgs: 0, variableArgs: false }, - 'W*': { id: OPS.eoClip, numArgs: 0, variableArgs: false }, - - // Text - BT: { id: OPS.beginText, numArgs: 0, variableArgs: false }, - ET: { id: OPS.endText, numArgs: 0, variableArgs: false }, - Tc: { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false }, - Tw: { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false }, - Tz: { id: OPS.setHScale, numArgs: 1, variableArgs: false }, - TL: { id: OPS.setLeading, numArgs: 1, variableArgs: false }, - Tf: { id: OPS.setFont, numArgs: 2, variableArgs: false }, - Tr: { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false }, - Ts: { id: OPS.setTextRise, numArgs: 1, variableArgs: false }, - Td: { id: OPS.moveText, numArgs: 2, variableArgs: false }, - TD: { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false }, - Tm: { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false }, - 'T*': { id: OPS.nextLine, numArgs: 0, variableArgs: false }, - Tj: { id: OPS.showText, numArgs: 1, variableArgs: false }, - TJ: { id: OPS.showSpacedText, numArgs: 1, variableArgs: false }, - '\'': { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false }, - '"': { id: OPS.nextLineSetSpacingShowText, numArgs: 3, - variableArgs: false }, - - // Type3 fonts - d0: { id: OPS.setCharWidth, numArgs: 2, variableArgs: false }, - d1: { id: OPS.setCharWidthAndBounds, numArgs: 6, variableArgs: false }, - - // Color - CS: { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false }, - cs: { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false }, - SC: { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true }, - SCN: { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true }, - sc: { id: OPS.setFillColor, numArgs: 4, variableArgs: true }, - scn: { id: OPS.setFillColorN, numArgs: 33, variableArgs: true }, - G: { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false }, - g: { id: OPS.setFillGray, numArgs: 1, variableArgs: false }, - RG: { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false }, - rg: { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false }, - K: { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false }, - k: { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false }, - - // Shading - sh: { id: OPS.shadingFill, numArgs: 1, variableArgs: false }, - - // Images - BI: { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false }, - ID: { id: OPS.beginImageData, numArgs: 0, variableArgs: false }, - EI: { id: OPS.endInlineImage, numArgs: 1, variableArgs: false }, - - // XObjects - Do: { id: OPS.paintXObject, numArgs: 1, variableArgs: false }, - MP: { id: OPS.markPoint, numArgs: 1, variableArgs: false }, - DP: { id: OPS.markPointProps, numArgs: 2, variableArgs: false }, - BMC: { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false }, - BDC: { id: OPS.beginMarkedContentProps, numArgs: 2, - variableArgs: false }, - EMC: { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false }, - - // Compatibility - BX: { id: OPS.beginCompat, numArgs: 0, variableArgs: false }, - EX: { id: OPS.endCompat, numArgs: 0, variableArgs: false }, - - // (reserved partial commands for the lexer) - BM: null, - BD: null, - 'true': null, - fa: null, - fal: null, - fals: null, - 'false': null, - nu: null, - nul: null, - 'null': null - }; - - function EvaluatorPreprocessor(stream, xref, stateManager) { - // TODO(mduan): pass array of knownCommands rather than OP_MAP - // dictionary - this.parser = new Parser(new Lexer(stream, OP_MAP), false, xref); - this.stateManager = stateManager; - this.nonProcessedArgs = []; - } - - EvaluatorPreprocessor.prototype = { - get savedStatesDepth() { - return this.stateManager.stateStack.length; - }, - - // |operation| is an object with two fields: - // - // - |fn| is an out param. - // - // - |args| is an inout param. On entry, it should have one of two values. - // - // - An empty array. This indicates that the caller is providing the - // array in which the args will be stored in. The caller should use - // this value if it can reuse a single array for each call to read(). - // - // - |null|. This indicates that the caller needs this function to create - // the array in which any args are stored in. If there are zero args, - // this function will leave |operation.args| as |null| (thus avoiding - // allocations that would occur if we used an empty array to represent - // zero arguments). Otherwise, it will replace |null| with a new array - // containing the arguments. The caller should use this value if it - // cannot reuse an array for each call to read(). - // - // These two modes are present because this function is very hot and so - // avoiding allocations where possible is worthwhile. - // - read: function EvaluatorPreprocessor_read(operation) { - var args = operation.args; - while (true) { - var obj = this.parser.getObj(); - if (isCmd(obj)) { - var cmd = obj.cmd; - // Check that the command is valid - var opSpec = OP_MAP[cmd]; - if (!opSpec) { - warn('Unknown command "' + cmd + '"'); - continue; - } - - var fn = opSpec.id; - var numArgs = opSpec.numArgs; - var argsLength = args !== null ? args.length : 0; - - if (!opSpec.variableArgs) { - // Postscript commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf - if (argsLength !== numArgs) { - var nonProcessedArgs = this.nonProcessedArgs; - while (argsLength > numArgs) { - nonProcessedArgs.push(args.shift()); - argsLength--; - } - while (argsLength < numArgs && nonProcessedArgs.length !== 0) { - if (!args) { - args = []; - } - args.unshift(nonProcessedArgs.pop()); - argsLength++; - } - } - - if (argsLength < numArgs) { - // If we receive too few args, it's not possible to possible - // to execute the command, so skip the command - info('Command ' + fn + ': because expected ' + - numArgs + ' args, but received ' + argsLength + - ' args; skipping'); - args = null; - continue; - } - } else if (argsLength > numArgs) { - info('Command ' + fn + ': expected [0,' + numArgs + - '] args, but received ' + argsLength + ' args'); - } - - // TODO figure out how to type-check vararg functions - this.preprocessCommand(fn, args); - - operation.fn = fn; - operation.args = args; - return true; - } else { - if (isEOF(obj)) { - return false; // no more commands - } - // argument - if (obj !== null) { - if (!args) { - args = []; - } - args.push((obj instanceof Dict ? obj.getAll() : obj)); - assert(args.length <= 33, 'Too many arguments'); - } - } - } - }, - - preprocessCommand: - function EvaluatorPreprocessor_preprocessCommand(fn, args) { - switch (fn | 0) { - case OPS.save: - this.stateManager.save(); - break; - case OPS.restore: - this.stateManager.restore(); - break; - case OPS.transform: - this.stateManager.transform(args); - break; - } - } - }; - return EvaluatorPreprocessor; -})(); - -var QueueOptimizer = (function QueueOptimizerClosure() { - function addState(parentState, pattern, fn) { - var state = parentState; - for (var i = 0, ii = pattern.length - 1; i < ii; i++) { - var item = pattern[i]; - state = (state[item] || (state[item] = [])); - } - state[pattern[pattern.length - 1]] = fn; - } - - function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray) { - // Handles special case of mainly LaTeX documents which use image masks to - // draw lines with the current fill style. - // 'count' groups of (save, transform, paintImageMaskXObject, restore)+ - // have been found at iFirstSave. - var iFirstPIMXO = iFirstSave + 2; - for (var i = 0; i < count; i++) { - var arg = argsArray[iFirstPIMXO + 4 * i]; - var imageMask = arg.length === 1 && arg[0]; - if (imageMask && imageMask.width === 1 && imageMask.height === 1 && - (!imageMask.data.length || - (imageMask.data.length === 1 && imageMask.data[0] === 0))) { - fnArray[iFirstPIMXO + 4 * i] = OPS.paintSolidColorImageMask; - continue; - } - break; - } - return count - i; - } - - var InitialState = []; - - // This replaces (save, transform, paintInlineImageXObject, restore)+ - // sequences with one |paintInlineImageXObjectGroup| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], - function foundInlineImageGroup(context) { - var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; - var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; - var MAX_WIDTH = 1000; - var IMAGE_PADDING = 1; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIIXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintInlineImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, - MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); - if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { - return i; - } - - // assuming that heights of those image is too small (~1 pixel) - // packing as much as possible by lines - var maxX = 0; - var map = [], maxLineHeight = 0; - var currentX = IMAGE_PADDING, currentY = IMAGE_PADDING; - var q; - for (q = 0; q < count; q++) { - var transform = argsArray[iFirstTransform + (q << 2)]; - var img = argsArray[iFirstPIIXO + (q << 2)][0]; - if (currentX + img.width > MAX_WIDTH) { - // starting new line - maxX = Math.max(maxX, currentX); - currentY += maxLineHeight + 2 * IMAGE_PADDING; - currentX = 0; - maxLineHeight = 0; - } - map.push({ - transform: transform, - x: currentX, y: currentY, - w: img.width, h: img.height - }); - currentX += img.width + 2 * IMAGE_PADDING; - maxLineHeight = Math.max(maxLineHeight, img.height); - } - var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; - var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; - var imgData = new Uint8Array(imgWidth * imgHeight * 4); - var imgRowSize = imgWidth << 2; - for (q = 0; q < count; q++) { - var data = argsArray[iFirstPIIXO + (q << 2)][0].data; - // Copy image by lines and extends pixels into padding. - var rowSize = map[q].w << 2; - var dataOffset = 0; - var offset = (map[q].x + map[q].y * imgWidth) << 2; - imgData.set(data.subarray(0, rowSize), offset - imgRowSize); - for (var k = 0, kk = map[q].h; k < kk; k++) { - imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); - dataOffset += rowSize; - offset += imgRowSize; - } - imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); - while (offset >= 0) { - data[offset - 4] = data[offset]; - data[offset - 3] = data[offset + 1]; - data[offset - 2] = data[offset + 2]; - data[offset - 1] = data[offset + 3]; - data[offset + rowSize] = data[offset + rowSize - 4]; - data[offset + rowSize + 1] = data[offset + rowSize - 3]; - data[offset + rowSize + 2] = data[offset + rowSize - 2]; - data[offset + rowSize + 3] = data[offset + rowSize - 1]; - offset -= imgRowSize; - } - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); - argsArray.splice(iFirstSave, count * 4, - [{ width: imgWidth, height: imgHeight, kind: ImageKind.RGBA_32BPP, - data: imgData }, map]); - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageMaskXObject, restore)+ - // sequences with one |paintImageMaskXObjectGroup| or one - // |paintImageMaskXObjectRepeat| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], - function foundImageMaskGroup(context) { - var MIN_IMAGES_IN_MASKS_BLOCK = 10; - var MAX_IMAGES_IN_MASKS_BLOCK = 100; - var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIMXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageMaskXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = (i - iFirstSave) / 4; - count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray); - if (count < MIN_IMAGES_IN_MASKS_BLOCK) { - return i; - } - - var q; - var isSameImage = false; - var iTransform, transformArgs; - var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; - if (argsArray[iFirstTransform][1] === 0 && - argsArray[iFirstTransform][2] === 0) { - isSameImage = true; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - iTransform = iFirstTransform + 4; - var iPIMXO = iFirstPIMXO + 4; - for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { - transformArgs = argsArray[iTransform]; - if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || - transformArgs[0] !== firstTransformArg0 || - transformArgs[1] !== 0 || - transformArgs[2] !== 0 || - transformArgs[3] !== firstTransformArg3) { - if (q < MIN_IMAGES_IN_MASKS_BLOCK) { - isSameImage = false; - } else { - count = q; - } - break; // different image or transform - } - } - } - - if (isSameImage) { - count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); - var positions = new Float32Array(count * 2); - iTransform = iFirstTransform; - for (q = 0; q < count; q++, iTransform += 4) { - transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, - [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); - } else { - count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); - var images = []; - for (q = 0; q < count; q++) { - transformArgs = argsArray[iFirstTransform + (q << 2)]; - var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; - images.push({ data: maskParams.data, width: maskParams.width, - height: maskParams.height, - transform: transformArgs }); - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); - argsArray.splice(iFirstSave, count * 4, [images]); - } - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageXObject, restore)+ sequences - // with one paintImageXObjectRepeat operation, if the |transform| and - // |paintImageXObjectRepeat| ops are appropriate. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], - function (context) { - var MIN_IMAGES_IN_BLOCK = 3; - var MAX_IMAGES_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIXO = curr - 1; - var iFirstRestore = curr; - - if (argsArray[iFirstTransform][1] !== 0 || - argsArray[iFirstTransform][2] !== 0) { - return iFirstRestore + 1; // transform has the wrong form - } - - // Look for the quartets. - var firstPIXOArg0 = argsArray[iFirstPIXO][0]; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstTransformArg0 || - argsArray[i + 1][1] !== 0 || - argsArray[i + 1][2] !== 0 || - argsArray[i + 1][3] !== firstTransformArg3) { - break; // transforms don't match - } - if (argsArray[i + 2][0] !== firstPIXOArg0) { - break; // images don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_BLOCK); - if (count < MIN_IMAGES_IN_BLOCK) { - return i; - } - - // Extract the (x,y) positions from all of the matching transforms. - var positions = new Float32Array(count * 2); - var iTransform = iFirstTransform; - for (var q = 0; q < count; q++, iTransform += 4) { - var transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, - positions]; - fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, args); - - return iFirstSave + 1; - }); - - // This replaces (beginText, setFont, setTextMatrix, showText, endText)+ - // sequences with (beginText, setFont, (setTextMatrix, showText)+, endText)+ - // sequences, if the font for each one is the same. - addState(InitialState, - [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], - function (context) { - var MIN_CHARS_IN_BLOCK = 3; - var MAX_CHARS_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstBeginText = curr - 4; - var iFirstSetFont = curr - 3; - var iFirstSetTextMatrix = curr - 2; - var iFirstShowText = curr - 1; - var iFirstEndText = curr; - - // Look for the quintets. - var firstSetFontArg0 = argsArray[iFirstSetFont][0]; - var firstSetFontArg1 = argsArray[iFirstSetFont][1]; - var i = iFirstBeginText + 5; - var ii = fnArray.length; - while (i + 4 < ii) { - if (fnArray[i] !== OPS.beginText || - fnArray[i + 1] !== OPS.setFont || - fnArray[i + 2] !== OPS.setTextMatrix || - fnArray[i + 3] !== OPS.showText || - fnArray[i + 4] !== OPS.endText) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstSetFontArg0 || - argsArray[i + 1][1] !== firstSetFontArg1) { - break; // fonts don't match - } - i += 5; - } - - // At this point, i is the index of the first op past the last valid - // quintet. - var count = Math.min(((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); - if (count < MIN_CHARS_IN_BLOCK) { - return i; - } - - // If the preceding quintet is (, setFont, setTextMatrix, - // showText, endText), include that as well. (E.g. might be - // |dependency|.) - var iFirst = iFirstBeginText; - if (iFirstBeginText >= 4 && - fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && - fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && - fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && - fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && - argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && - argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { - count++; - iFirst -= 5; - } - - // Remove (endText, beginText, setFont) trios. - var iEndText = iFirst + 4; - for (var q = 1; q < count; q++) { - fnArray.splice(iEndText, 3); - argsArray.splice(iEndText, 3); - iEndText += 2; - } - - return iEndText + 1; - }); - - function QueueOptimizer() {} - - QueueOptimizer.prototype = { - optimize: function QueueOptimizer_optimize(queue) { - var fnArray = queue.fnArray, argsArray = queue.argsArray; - var context = { - iCurr: 0, - fnArray: fnArray, - argsArray: argsArray - }; - var state; - var i = 0, ii = fnArray.length; - while (i < ii) { - state = (state || InitialState)[fnArray[i]]; - if (typeof state === 'function') { // we found some handler - context.iCurr = i; - // state() returns the index of the first non-matching op (if we - // didn't match) or the first op past the modified ops (if we did - // match and replace). - i = state(context); - state = undefined; // reset the state machine - ii = context.fnArray.length; - } else { - i++; - } - } - } - }; - return QueueOptimizer; -})(); - -exports.OperatorList = OperatorList; -exports.PartialEvaluator = PartialEvaluator; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreAnnotation = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreColorSpace, - root.pdfjsCoreObj, root.pdfjsCoreEvaluator); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, - coreColorSpace, coreObj, coreEvaluator) { - -var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; -var AnnotationFlag = sharedUtil.AnnotationFlag; -var AnnotationType = sharedUtil.AnnotationType; -var OPS = sharedUtil.OPS; -var Util = sharedUtil.Util; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isValidUrl = sharedUtil.isValidUrl; -var stringToBytes = sharedUtil.stringToBytes; -var stringToPDFString = sharedUtil.stringToPDFString; -var stringToUTF8String = sharedUtil.stringToUTF8String; -var warn = sharedUtil.warn; -var Dict = corePrimitives.Dict; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var Stream = coreStream.Stream; -var ColorSpace = coreColorSpace.ColorSpace; -var ObjectLoader = coreObj.ObjectLoader; -var OperatorList = coreEvaluator.OperatorList; - -/** - * @class - * @alias AnnotationFactory - */ -function AnnotationFactory() {} -AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ { - /** - * @param {XRef} xref - * @param {Object} ref - * @returns {Annotation} - */ - create: function AnnotationFactory_create(xref, ref) { - var dict = xref.fetchIfRef(ref); - if (!isDict(dict)) { - return; - } - - // Determine the annotation's subtype. - var subtype = dict.get('Subtype'); - subtype = isName(subtype) ? subtype.name : ''; - - // Return the right annotation object based on the subtype and field type. - var parameters = { - dict: dict, - ref: ref - }; - - switch (subtype) { - case 'Link': - return new LinkAnnotation(parameters); - - case 'Text': - return new TextAnnotation(parameters); - - case 'Widget': - var fieldType = Util.getInheritableProperty(dict, 'FT'); - if (isName(fieldType) && fieldType.name === 'Tx') { - return new TextWidgetAnnotation(parameters); - } - return new WidgetAnnotation(parameters); - - case 'Popup': - return new PopupAnnotation(parameters); - - case 'Highlight': - return new HighlightAnnotation(parameters); - - case 'Underline': - return new UnderlineAnnotation(parameters); - - case 'Squiggly': - return new SquigglyAnnotation(parameters); - - case 'StrikeOut': - return new StrikeOutAnnotation(parameters); - - default: - warn('Unimplemented annotation type "' + subtype + '", ' + - 'falling back to base annotation'); - return new Annotation(parameters); - } - } -}; - -var Annotation = (function AnnotationClosure() { - // 12.5.5: Algorithm: Appearance streams - function getTransformMatrix(rect, bbox, matrix) { - var bounds = Util.getAxialAlignedBoundingBox(bbox, matrix); - var minX = bounds[0]; - var minY = bounds[1]; - var maxX = bounds[2]; - var maxY = bounds[3]; - - if (minX === maxX || minY === maxY) { - // From real-life file, bbox was [0, 0, 0, 0]. In this case, - // just apply the transform for rect - return [1, 0, 0, 1, rect[0], rect[1]]; - } - - var xRatio = (rect[2] - rect[0]) / (maxX - minX); - var yRatio = (rect[3] - rect[1]) / (maxY - minY); - return [ - xRatio, - 0, - 0, - yRatio, - rect[0] - minX * xRatio, - rect[1] - minY * yRatio - ]; - } - - function getDefaultAppearance(dict) { - var appearanceState = dict.get('AP'); - if (!isDict(appearanceState)) { - return; - } - - var appearance; - var appearances = appearanceState.get('N'); - if (isDict(appearances)) { - var as = dict.get('AS'); - if (as && appearances.has(as.name)) { - appearance = appearances.get(as.name); - } - } else { - appearance = appearances; - } - return appearance; - } - - function Annotation(params) { - var dict = params.dict; - - this.setFlags(dict.get('F')); - this.setRectangle(dict.get('Rect')); - this.setColor(dict.get('C')); - this.setBorderStyle(dict); - this.appearance = getDefaultAppearance(dict); - - // Expose public properties using a data object. - this.data = {}; - this.data.id = params.ref.toString(); - this.data.subtype = dict.get('Subtype').name; - this.data.annotationFlags = this.flags; - this.data.rect = this.rectangle; - this.data.color = this.color; - this.data.borderStyle = this.borderStyle; - this.data.hasAppearance = !!this.appearance; - } - - Annotation.prototype = { - /** - * @return {boolean} - */ - get viewable() { - if (this.flags) { - return !this.hasFlag(AnnotationFlag.INVISIBLE) && - !this.hasFlag(AnnotationFlag.HIDDEN) && - !this.hasFlag(AnnotationFlag.NOVIEW); - } - return true; - }, - - /** - * @return {boolean} - */ - get printable() { - if (this.flags) { - return this.hasFlag(AnnotationFlag.PRINT) && - !this.hasFlag(AnnotationFlag.INVISIBLE) && - !this.hasFlag(AnnotationFlag.HIDDEN); - } - return false; - }, - - /** - * Set the flags. - * - * @public - * @memberof Annotation - * @param {number} flags - Unsigned 32-bit integer specifying annotation - * characteristics - * @see {@link shared/util.js} - */ - setFlags: function Annotation_setFlags(flags) { - if (isInt(flags)) { - this.flags = flags; - } else { - this.flags = 0; - } - }, - - /** - * Check if a provided flag is set. - * - * @public - * @memberof Annotation - * @param {number} flag - Hexadecimal representation for an annotation - * characteristic - * @return {boolean} - * @see {@link shared/util.js} - */ - hasFlag: function Annotation_hasFlag(flag) { - if (this.flags) { - return (this.flags & flag) > 0; - } - return false; - }, - - /** - * Set the rectangle. - * - * @public - * @memberof Annotation - * @param {Array} rectangle - The rectangle array with exactly four entries - */ - setRectangle: function Annotation_setRectangle(rectangle) { - if (isArray(rectangle) && rectangle.length === 4) { - this.rectangle = Util.normalizeRect(rectangle); - } else { - this.rectangle = [0, 0, 0, 0]; - } - }, - - /** - * Set the color and take care of color space conversion. - * - * @public - * @memberof Annotation - * @param {Array} color - The color array containing either 0 - * (transparent), 1 (grayscale), 3 (RGB) or - * 4 (CMYK) elements - */ - setColor: function Annotation_setColor(color) { - var rgbColor = new Uint8Array(3); // Black in RGB color space (default) - if (!isArray(color)) { - this.color = rgbColor; - return; - } - - switch (color.length) { - case 0: // Transparent, which we indicate with a null value - this.color = null; - break; - - case 1: // Convert grayscale to RGB - ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 3: // Convert RGB percentages to RGB - ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 4: // Convert CMYK to RGB - ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - default: - this.color = rgbColor; - break; - } - }, - - /** - * Set the border style (as AnnotationBorderStyle object). - * - * @public - * @memberof Annotation - * @param {Dict} borderStyle - The border style dictionary - */ - setBorderStyle: function Annotation_setBorderStyle(borderStyle) { - this.borderStyle = new AnnotationBorderStyle(); - if (!isDict(borderStyle)) { - return; - } - if (borderStyle.has('BS')) { - var dict = borderStyle.get('BS'); - var dictType; - - if (!dict.has('Type') || (isName(dictType = dict.get('Type')) && - dictType.name === 'Border')) { - this.borderStyle.setWidth(dict.get('W')); - this.borderStyle.setStyle(dict.get('S')); - this.borderStyle.setDashArray(dict.get('D')); - } - } else if (borderStyle.has('Border')) { - var array = borderStyle.get('Border'); - if (isArray(array) && array.length >= 3) { - this.borderStyle.setHorizontalCornerRadius(array[0]); - this.borderStyle.setVerticalCornerRadius(array[1]); - this.borderStyle.setWidth(array[2]); - - if (array.length === 4) { // Dash array available - this.borderStyle.setDashArray(array[3]); - } - } - } else { - // There are no border entries in the dictionary. According to the - // specification, we should draw a solid border of width 1 in that - // case, but Adobe Reader did not implement that part of the - // specification and instead draws no border at all, so we do the same. - // See also https://github.com/mozilla/pdf.js/issues/6179. - this.borderStyle.setWidth(0); - } - }, - - loadResources: function Annotation_loadResources(keys) { - return new Promise(function (resolve, reject) { - this.appearance.dict.getAsync('Resources').then(function (resources) { - if (!resources) { - resolve(); - return; - } - var objectLoader = new ObjectLoader(resources.map, - keys, - resources.xref); - objectLoader.load().then(function() { - resolve(resources); - }, reject); - }, reject); - }.bind(this)); - }, - - getOperatorList: function Annotation_getOperatorList(evaluator, task) { - if (!this.appearance) { - return Promise.resolve(new OperatorList()); - } - - var data = this.data; - var appearanceDict = this.appearance.dict; - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - var bbox = appearanceDict.get('BBox') || [0, 0, 1, 1]; - var matrix = appearanceDict.get('Matrix') || [1, 0, 0, 1, 0 ,0]; - var transform = getTransformMatrix(data.rect, bbox, matrix); - var self = this; - - return resourcesPromise.then(function(resources) { - var opList = new OperatorList(); - opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); - return evaluator.getOperatorList(self.appearance, task, - resources, opList). - then(function () { - opList.addOp(OPS.endAnnotation, []); - self.appearance.reset(); - return opList; - }); - }); - } - }; - - Annotation.appendToOperatorList = function Annotation_appendToOperatorList( - annotations, opList, partialEvaluator, task, intent) { - var annotationPromises = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if ((intent === 'display' && annotations[i].viewable) || - (intent === 'print' && annotations[i].printable)) { - annotationPromises.push( - annotations[i].getOperatorList(partialEvaluator, task)); - } - } - return Promise.all(annotationPromises).then(function(operatorLists) { - opList.addOp(OPS.beginAnnotations, []); - for (var i = 0, n = operatorLists.length; i < n; ++i) { - opList.addOpList(operatorLists[i]); - } - opList.addOp(OPS.endAnnotations, []); - }); - }; - - return Annotation; -})(); - -/** - * Contains all data regarding an annotation's border style. - * - * @class - */ -var AnnotationBorderStyle = (function AnnotationBorderStyleClosure() { - /** - * @constructor - * @private - */ - function AnnotationBorderStyle() { - this.width = 1; - this.style = AnnotationBorderStyleType.SOLID; - this.dashArray = [3]; - this.horizontalCornerRadius = 0; - this.verticalCornerRadius = 0; - } - - AnnotationBorderStyle.prototype = { - /** - * Set the width. - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} width - The width - */ - setWidth: function AnnotationBorderStyle_setWidth(width) { - if (width === (width | 0)) { - this.width = width; - } - }, - - /** - * Set the style. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Object} style - The style object - * @see {@link shared/util.js} - */ - setStyle: function AnnotationBorderStyle_setStyle(style) { - if (!style) { - return; - } - switch (style.name) { - case 'S': - this.style = AnnotationBorderStyleType.SOLID; - break; - - case 'D': - this.style = AnnotationBorderStyleType.DASHED; - break; - - case 'B': - this.style = AnnotationBorderStyleType.BEVELED; - break; - - case 'I': - this.style = AnnotationBorderStyleType.INSET; - break; - - case 'U': - this.style = AnnotationBorderStyleType.UNDERLINE; - break; - - default: - break; - } - }, - - /** - * Set the dash array. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Array} dashArray - The dash array with at least one element - */ - setDashArray: function AnnotationBorderStyle_setDashArray(dashArray) { - // We validate the dash array, but we do not use it because CSS does not - // allow us to change spacing of dashes. For more information, visit - // http://www.w3.org/TR/css3-background/#the-border-style. - if (isArray(dashArray) && dashArray.length > 0) { - // According to the PDF specification: the elements in a dashArray - // shall be numbers that are nonnegative and not all equal to zero. - var isValid = true; - var allZeros = true; - for (var i = 0, len = dashArray.length; i < len; i++) { - var element = dashArray[i]; - var validNumber = (+element >= 0); - if (!validNumber) { - isValid = false; - break; - } else if (element > 0) { - allZeros = false; - } - } - if (isValid && !allZeros) { - this.dashArray = dashArray; - } else { - this.width = 0; // Adobe behavior when the array is invalid. - } - } else if (dashArray) { - this.width = 0; // Adobe behavior when the array is invalid. - } - }, - - /** - * Set the horizontal corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The horizontal corner radius - */ - setHorizontalCornerRadius: - function AnnotationBorderStyle_setHorizontalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.horizontalCornerRadius = radius; - } - }, - - /** - * Set the vertical corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The vertical corner radius - */ - setVerticalCornerRadius: - function AnnotationBorderStyle_setVerticalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.verticalCornerRadius = radius; - } - } - }; - - return AnnotationBorderStyle; -})(); - -var WidgetAnnotation = (function WidgetAnnotationClosure() { - function WidgetAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - - data.annotationType = AnnotationType.WIDGET; - data.fieldValue = stringToPDFString( - Util.getInheritableProperty(dict, 'V') || ''); - data.alternativeText = stringToPDFString(dict.get('TU') || ''); - data.defaultAppearance = Util.getInheritableProperty(dict, 'DA') || ''; - var fieldType = Util.getInheritableProperty(dict, 'FT'); - data.fieldType = isName(fieldType) ? fieldType.name : ''; - data.fieldFlags = Util.getInheritableProperty(dict, 'Ff') || 0; - this.fieldResources = Util.getInheritableProperty(dict, 'DR') || Dict.empty; - - // Hide unsupported Widget signatures. - if (data.fieldType === 'Sig') { - warn('unimplemented annotation type: Widget signature'); - this.setFlags(AnnotationFlag.HIDDEN); - } - - // Building the full field name by collecting the field and - // its ancestors 'T' data and joining them using '.'. - var fieldName = []; - var namedItem = dict; - var ref = params.ref; - while (namedItem) { - var parent = namedItem.get('Parent'); - var parentRef = namedItem.getRaw('Parent'); - var name = namedItem.get('T'); - if (name) { - fieldName.unshift(stringToPDFString(name)); - } else if (parent && ref) { - // The field name is absent, that means more than one field - // with the same name may exist. Replacing the empty name - // with the '`' plus index in the parent's 'Kids' array. - // This is not in the PDF spec but necessary to id the - // the input controls. - var kids = parent.get('Kids'); - var j, jj; - for (j = 0, jj = kids.length; j < jj; j++) { - var kidRef = kids[j]; - if (kidRef.num === ref.num && kidRef.gen === ref.gen) { - break; - } - } - fieldName.unshift('`' + j); - } - namedItem = parent; - ref = parentRef; - } - data.fullName = fieldName.join('.'); - } - - Util.inherit(WidgetAnnotation, Annotation, {}); - - return WidgetAnnotation; -})(); - -var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { - function TextWidgetAnnotation(params) { - WidgetAnnotation.call(this, params); - - this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q'); - this.data.hasHtml = !this.data.hasAppearance && !!this.data.fieldValue; - } - - Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { - getOperatorList: function TextWidgetAnnotation_getOperatorList(evaluator, - task) { - if (this.appearance) { - return Annotation.prototype.getOperatorList.call(this, evaluator, task); - } - - var opList = new OperatorList(); - var data = this.data; - - // Even if there is an appearance stream, ignore it. This is the - // behaviour used by Adobe Reader. - if (!data.defaultAppearance) { - return Promise.resolve(opList); - } - - var stream = new Stream(stringToBytes(data.defaultAppearance)); - return evaluator.getOperatorList(stream, task, - this.fieldResources, opList). - then(function () { - return opList; - }); - } - }); - - return TextWidgetAnnotation; -})(); - -var TextAnnotation = (function TextAnnotationClosure() { - var DEFAULT_ICON_SIZE = 22; // px - - function TextAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.TEXT; - this.data.hasHtml = true; - - var dict = parameters.dict; - if (this.data.hasAppearance) { - this.data.name = 'NoIcon'; - } else { - this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; - this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; - this.data.name = dict.has('Name') ? dict.get('Name').name : 'Note'; - } - - if (!dict.has('C')) { - // Fall back to the default background color. - this.data.color = null; - } - - this.data.hasPopup = dict.has('Popup'); - if (!this.data.hasPopup) { - // There is no associated Popup annotation, so the Text annotation - // must create its own popup. - this.data.title = stringToPDFString(dict.get('T') || ''); - this.data.contents = stringToPDFString(dict.get('Contents') || ''); - this.data.hasHtml = (this.data.title || this.data.contents); - } - } - - Util.inherit(TextAnnotation, Annotation, {}); - - return TextAnnotation; -})(); - -var LinkAnnotation = (function LinkAnnotationClosure() { - function LinkAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - data.annotationType = AnnotationType.LINK; - data.hasHtml = true; - - var action = dict.get('A'); - if (action && isDict(action)) { - var linkType = action.get('S').name; - if (linkType === 'URI') { - var url = action.get('URI'); - if (isName(url)) { - // Some bad PDFs do not put parentheses around relative URLs. - url = '/' + url.name; - } else if (url) { - url = addDefaultProtocolToUrl(url); - } - // TODO: pdf spec mentions urls can be relative to a Base - // entry in the dictionary. - if (!isValidUrl(url, false)) { - url = ''; - } - // According to ISO 32000-1:2008, section 12.6.4.7, - // URI should to be encoded in 7-bit ASCII. - // Some bad PDFs may have URIs in UTF-8 encoding, see Bugzilla 1122280. - try { - data.url = stringToUTF8String(url); - } catch (e) { - // Fall back to a simple copy. - data.url = url; - } - } else if (linkType === 'GoTo') { - data.dest = action.get('D'); - } else if (linkType === 'GoToR') { - var urlDict = action.get('F'); - if (isDict(urlDict)) { - // We assume that the 'url' is a Filspec dictionary - // and fetch the url without checking any further - url = urlDict.get('F') || ''; - } - - // TODO: pdf reference says that GoToR - // can also have 'NewWindow' attribute - if (!isValidUrl(url, false)) { - url = ''; - } - data.url = url; - data.dest = action.get('D'); - } else if (linkType === 'Named') { - data.action = action.get('N').name; - } else { - warn('unrecognized link type: ' + linkType); - } - } else if (dict.has('Dest')) { - // simple destination link - var dest = dict.get('Dest'); - data.dest = isName(dest) ? dest.name : dest; - } - } - - // Lets URLs beginning with 'www.' default to using the 'http://' protocol. - function addDefaultProtocolToUrl(url) { - if (url && url.indexOf('www.') === 0) { - return ('http://' + url); - } - return url; - } - - Util.inherit(LinkAnnotation, Annotation, {}); - - return LinkAnnotation; -})(); - -var PopupAnnotation = (function PopupAnnotationClosure() { - function PopupAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.POPUP; - - var dict = parameters.dict; - var parentItem = dict.get('Parent'); - if (!parentItem) { - warn('Popup annotation has a missing or invalid parent annotation.'); - return; - } - - this.data.parentId = dict.getRaw('Parent').toString(); - this.data.title = stringToPDFString(parentItem.get('T') || ''); - this.data.contents = stringToPDFString(parentItem.get('Contents') || ''); - - if (!parentItem.has('C')) { - // Fall back to the default background color. - this.data.color = null; - } else { - this.setColor(parentItem.get('C')); - this.data.color = this.color; - } - - this.data.hasHtml = (this.data.title || this.data.contents); - } - - Util.inherit(PopupAnnotation, Annotation, {}); - - return PopupAnnotation; -})(); - -var HighlightAnnotation = (function HighlightAnnotationClosure() { - function HighlightAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.HIGHLIGHT; - this.data.hasHtml = true; - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(HighlightAnnotation, Annotation, {}); - - return HighlightAnnotation; -})(); - -var UnderlineAnnotation = (function UnderlineAnnotationClosure() { - function UnderlineAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.UNDERLINE; - this.data.hasHtml = true; - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(UnderlineAnnotation, Annotation, {}); - - return UnderlineAnnotation; -})(); - -var SquigglyAnnotation = (function SquigglyAnnotationClosure() { - function SquigglyAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.SQUIGGLY; - this.data.hasHtml = true; - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(SquigglyAnnotation, Annotation, {}); - - return SquigglyAnnotation; -})(); - -var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() { - function StrikeOutAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.STRIKEOUT; - this.data.hasHtml = true; - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(StrikeOutAnnotation, Annotation, {}); - - return StrikeOutAnnotation; -})(); - -exports.Annotation = Annotation; -exports.AnnotationBorderStyle = AnnotationBorderStyle; -exports.AnnotationFactory = AnnotationFactory; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreDocument = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, - root.pdfjsCoreObj, root.pdfjsCoreParser, root.pdfjsCoreCrypto, - root.pdfjsCoreEvaluator, root.pdfjsCoreAnnotation); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreObj, - coreParser, coreCrypto, coreEvaluator, coreAnnotation) { - -var MissingDataException = sharedUtil.MissingDataException; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isArrayBuffer = sharedUtil.isArrayBuffer; -var isString = sharedUtil.isString; -var shadow = sharedUtil.shadow; -var stringToBytes = sharedUtil.stringToBytes; -var stringToPDFString = sharedUtil.stringToPDFString; -var warn = sharedUtil.warn; -var Dict = corePrimitives.Dict; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isStream = corePrimitives.isStream; -var NullStream = coreStream.NullStream; -var Stream = coreStream.Stream; -var StreamsSequenceStream = coreStream.StreamsSequenceStream; -var Catalog = coreObj.Catalog; -var ObjectLoader = coreObj.ObjectLoader; -var XRef = coreObj.XRef; -var Lexer = coreParser.Lexer; -var Linearization = coreParser.Linearization; -var calculateMD5 = coreCrypto.calculateMD5; -var OperatorList = coreEvaluator.OperatorList; -var PartialEvaluator = coreEvaluator.PartialEvaluator; -var Annotation = coreAnnotation.Annotation; -var AnnotationFactory = coreAnnotation.AnnotationFactory; - -var Page = (function PageClosure() { - - var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; - - function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache) { - this.pdfManager = pdfManager; - this.pageIndex = pageIndex; - this.pageDict = pageDict; - this.xref = xref; - this.ref = ref; - this.fontCache = fontCache; - this.idCounters = { - obj: 0 - }; - this.resourcesPromise = null; - } - - Page.prototype = { - getPageProp: function Page_getPageProp(key) { - return this.pageDict.get(key); - }, - - getInheritedPageProp: function Page_getInheritedPageProp(key) { - var dict = this.pageDict, valueArray = null, loopCount = 0; - var MAX_LOOP_COUNT = 100; - // Always walk up the entire parent chain, to be able to find - // e.g. \Resources placed on multiple levels of the tree. - while (dict) { - var value = dict.get(key); - if (value) { - if (!valueArray) { - valueArray = []; - } - valueArray.push(value); - } - if (++loopCount > MAX_LOOP_COUNT) { - warn('Page_getInheritedPageProp: maximum loop count exceeded.'); - break; - } - dict = dict.get('Parent'); - } - if (!valueArray) { - return Dict.empty; - } - if (valueArray.length === 1 || !isDict(valueArray[0]) || - loopCount > MAX_LOOP_COUNT) { - return valueArray[0]; - } - return Dict.merge(this.xref, valueArray); - }, - - get content() { - return this.getPageProp('Contents'); - }, - - get resources() { - // For robustness: The spec states that a \Resources entry has to be - // present, but can be empty. Some document omit it still, in this case - // we return an empty dictionary. - return shadow(this, 'resources', this.getInheritedPageProp('Resources')); - }, - - get mediaBox() { - var obj = this.getInheritedPageProp('MediaBox'); - // Reset invalid media box to letter size. - if (!isArray(obj) || obj.length !== 4) { - obj = LETTER_SIZE_MEDIABOX; - } - return shadow(this, 'mediaBox', obj); - }, - - get view() { - var mediaBox = this.mediaBox; - var cropBox = this.getInheritedPageProp('CropBox'); - if (!isArray(cropBox) || cropBox.length !== 4) { - return shadow(this, 'view', mediaBox); - } - - // From the spec, 6th ed., p.963: - // "The crop, bleed, trim, and art boxes should not ordinarily - // extend beyond the boundaries of the media box. If they do, they are - // effectively reduced to their intersection with the media box." - cropBox = Util.intersect(cropBox, mediaBox); - if (!cropBox) { - return shadow(this, 'view', mediaBox); - } - return shadow(this, 'view', cropBox); - }, - - get rotate() { - var rotate = this.getInheritedPageProp('Rotate') || 0; - // Normalize rotation so it's a multiple of 90 and between 0 and 270 - if (rotate % 90 !== 0) { - rotate = 0; - } else if (rotate >= 360) { - rotate = rotate % 360; - } else if (rotate < 0) { - // The spec doesn't cover negatives, assume its counterclockwise - // rotation. The following is the other implementation of modulo. - rotate = ((rotate % 360) + 360) % 360; - } - return shadow(this, 'rotate', rotate); - }, - - getContentStream: function Page_getContentStream() { - var content = this.content; - var stream; - if (isArray(content)) { - // fetching items - var xref = this.xref; - var i, n = content.length; - var streams = []; - for (i = 0; i < n; ++i) { - streams.push(xref.fetchIfRef(content[i])); - } - stream = new StreamsSequenceStream(streams); - } else if (isStream(content)) { - stream = content; - } else { - // replacing non-existent page content with empty one - stream = new NullStream(); - } - return stream; - }, - - loadResources: function Page_loadResources(keys) { - if (!this.resourcesPromise) { - // TODO: add async getInheritedPageProp and remove this. - this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); - } - return this.resourcesPromise.then(function resourceSuccess() { - var objectLoader = new ObjectLoader(this.resources.map, - keys, - this.xref); - return objectLoader.load(); - }.bind(this)); - }, - - getOperatorList: function Page_getOperatorList(handler, task, intent) { - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - - var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, - handler, this.pageIndex, - 'p' + this.pageIndex + '_', - this.idCounters, - this.fontCache); - - var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); - var pageListPromise = dataPromises.then(function(data) { - var contentStream = data[0]; - var opList = new OperatorList(intent, handler, self.pageIndex); - - handler.send('StartRenderPage', { - transparency: partialEvaluator.hasBlendModes(self.resources), - pageIndex: self.pageIndex, - intent: intent - }); - return partialEvaluator.getOperatorList(contentStream, task, - self.resources, opList).then(function () { - return opList; - }); - }); - - var annotationsPromise = pdfManager.ensure(this, 'annotations'); - return Promise.all([pageListPromise, annotationsPromise]).then( - function(datas) { - var pageOpList = datas[0]; - var annotations = datas[1]; - - if (annotations.length === 0) { - pageOpList.flush(true); - return pageOpList; - } - - var annotationsReadyPromise = Annotation.appendToOperatorList( - annotations, pageOpList, partialEvaluator, task, intent); - return annotationsReadyPromise.then(function () { - pageOpList.flush(true); - return pageOpList; - }); - }); - }, - - extractTextContent: function Page_extractTextContent(task, - normalizeWhitespace) { - var handler = { - on: function nullHandlerOn() {}, - send: function nullHandlerSend() {} - }; - - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'XObject', - 'Font' - ]); - - var dataPromises = Promise.all([contentStreamPromise, - resourcesPromise]); - return dataPromises.then(function(data) { - var contentStream = data[0]; - var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, - handler, self.pageIndex, - 'p' + self.pageIndex + '_', - self.idCounters, - self.fontCache); - - return partialEvaluator.getTextContent(contentStream, - task, - self.resources, - /* stateManager = */ null, - normalizeWhitespace); - }); - }, - - getAnnotationsData: function Page_getAnnotationsData(intent) { - var annotations = this.annotations; - var annotationsData = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if (intent) { - if (!(intent === 'display' && annotations[i].viewable) && - !(intent === 'print' && annotations[i].printable)) { - continue; - } - } - annotationsData.push(annotations[i].data); - } - return annotationsData; - }, - - get annotations() { - var annotations = []; - var annotationRefs = this.getInheritedPageProp('Annots') || []; - var annotationFactory = new AnnotationFactory(); - for (var i = 0, n = annotationRefs.length; i < n; ++i) { - var annotationRef = annotationRefs[i]; - var annotation = annotationFactory.create(this.xref, annotationRef); - if (annotation) { - annotations.push(annotation); - } - } - return shadow(this, 'annotations', annotations); - } - }; - - return Page; -})(); - -/** - * The `PDFDocument` holds all the data of the PDF file. Compared to the - * `PDFDoc`, this one doesn't have any job management code. - * Right now there exists one PDFDocument on the main thread + one object - * for each worker. If there is no worker support enabled, there are two - * `PDFDocument` objects on the main thread created. - */ -var PDFDocument = (function PDFDocumentClosure() { - var FINGERPRINT_FIRST_BYTES = 1024; - var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + - '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; - - function PDFDocument(pdfManager, arg, password) { - if (isStream(arg)) { - init.call(this, pdfManager, arg, password); - } else if (isArrayBuffer(arg)) { - init.call(this, pdfManager, new Stream(arg), password); - } else { - error('PDFDocument: Unknown argument type'); - } - } - - function init(pdfManager, stream, password) { - assert(stream.length > 0, 'stream must have data'); - this.pdfManager = pdfManager; - this.stream = stream; - var xref = new XRef(this.stream, password, pdfManager); - this.xref = xref; - } - - function find(stream, needle, limit, backwards) { - var pos = stream.pos; - var end = stream.end; - var strBuf = []; - if (pos + limit > end) { - limit = end - pos; - } - for (var n = 0; n < limit; ++n) { - strBuf.push(String.fromCharCode(stream.getByte())); - } - var str = strBuf.join(''); - stream.pos = pos; - var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); - if (index === -1) { - return false; /* not found */ - } - stream.pos += index; - return true; /* found */ - } - - var DocumentInfoValidators = { - get entries() { - // Lazily build this since all the validation functions below are not - // defined until after this file loads. - return shadow(this, 'entries', { - Title: isString, - Author: isString, - Subject: isString, - Keywords: isString, - Creator: isString, - Producer: isString, - CreationDate: isString, - ModDate: isString, - Trapped: isName - }); - } - }; - - PDFDocument.prototype = { - parse: function PDFDocument_parse(recoveryMode) { - this.setup(recoveryMode); - var version = this.catalog.catDict.get('Version'); - if (isName(version)) { - this.pdfFormatVersion = version.name; - } - try { - // checking if AcroForm is present - this.acroForm = this.catalog.catDict.get('AcroForm'); - if (this.acroForm) { - this.xfa = this.acroForm.get('XFA'); - var fields = this.acroForm.get('Fields'); - if ((!fields || !isArray(fields) || fields.length === 0) && - !this.xfa) { - // no fields and no XFA -- not a form (?) - this.acroForm = null; - } - } - } catch (ex) { - info('Something wrong with AcroForm entry'); - this.acroForm = null; - } - }, - - get linearization() { - var linearization = null; - if (this.stream.length) { - try { - linearization = Linearization.create(this.stream); - } catch (err) { - if (err instanceof MissingDataException) { - throw err; - } - info(err); - } - } - // shadow the prototype getter with a data property - return shadow(this, 'linearization', linearization); - }, - get startXRef() { - var stream = this.stream; - var startXRef = 0; - var linearization = this.linearization; - if (linearization) { - // Find end of first obj. - stream.reset(); - if (find(stream, 'endobj', 1024)) { - startXRef = stream.pos + 6; - } - } else { - // Find startxref by jumping backward from the end of the file. - var step = 1024; - var found = false, pos = stream.end; - while (!found && pos > 0) { - pos -= step - 'startxref'.length; - if (pos < 0) { - pos = 0; - } - stream.pos = pos; - found = find(stream, 'startxref', step, true); - } - if (found) { - stream.skip(9); - var ch; - do { - ch = stream.getByte(); - } while (Lexer.isSpace(ch)); - var str = ''; - while (ch >= 0x20 && ch <= 0x39) { // < '9' - str += String.fromCharCode(ch); - ch = stream.getByte(); - } - startXRef = parseInt(str, 10); - if (isNaN(startXRef)) { - startXRef = 0; - } - } - } - // shadow the prototype getter with a data property - return shadow(this, 'startXRef', startXRef); - }, - get mainXRefEntriesOffset() { - var mainXRefEntriesOffset = 0; - var linearization = this.linearization; - if (linearization) { - mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; - } - // shadow the prototype getter with a data property - return shadow(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); - }, - // Find the header, remove leading garbage and setup the stream - // starting from the header. - checkHeader: function PDFDocument_checkHeader() { - var stream = this.stream; - stream.reset(); - if (find(stream, '%PDF-', 1024)) { - // Found the header, trim off any garbage before it. - stream.moveStart(); - // Reading file format version - var MAX_VERSION_LENGTH = 12; - var version = '', ch; - while ((ch = stream.getByte()) > 0x20) { // SPACE - if (version.length >= MAX_VERSION_LENGTH) { - break; - } - version += String.fromCharCode(ch); - } - if (!this.pdfFormatVersion) { - // removing "%PDF-"-prefix - this.pdfFormatVersion = version.substring(5); - } - return; - } - // May not be a PDF file, continue anyway. - }, - parseStartXRef: function PDFDocument_parseStartXRef() { - var startXRef = this.startXRef; - this.xref.setStartXRef(startXRef); - }, - setup: function PDFDocument_setup(recoveryMode) { - this.xref.parse(recoveryMode); - var self = this; - var pageFactory = { - createPage: function (pageIndex, dict, ref, fontCache) { - return new Page(self.pdfManager, self.xref, pageIndex, dict, ref, - fontCache); - } - }; - this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); - }, - get numPages() { - var linearization = this.linearization; - var num = linearization ? linearization.numPages : this.catalog.numPages; - // shadow the prototype getter - return shadow(this, 'numPages', num); - }, - get documentInfo() { - var docInfo = { - PDFFormatVersion: this.pdfFormatVersion, - IsAcroFormPresent: !!this.acroForm, - IsXFAPresent: !!this.xfa - }; - var infoDict; - try { - infoDict = this.xref.trailer.get('Info'); - } catch (err) { - info('The document information dictionary is invalid.'); - } - if (infoDict) { - var validEntries = DocumentInfoValidators.entries; - // Only fill the document info with valid entries from the spec. - for (var key in validEntries) { - if (infoDict.has(key)) { - var value = infoDict.get(key); - // Make sure the value conforms to the spec. - if (validEntries[key](value)) { - docInfo[key] = (typeof value !== 'string' ? - value : stringToPDFString(value)); - } else { - info('Bad value in document info for "' + key + '"'); - } - } - } - } - return shadow(this, 'documentInfo', docInfo); - }, - get fingerprint() { - var xref = this.xref, hash, fileID = ''; - var idArray = xref.trailer.get('ID'); - - if (idArray && isArray(idArray) && idArray[0] && isString(idArray[0]) && - idArray[0] !== EMPTY_FINGERPRINT) { - hash = stringToBytes(idArray[0]); - } else { - if (this.stream.ensureRange) { - this.stream.ensureRange(0, - Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); - } - hash = calculateMD5(this.stream.bytes.subarray(0, - FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); - } - - for (var i = 0, n = hash.length; i < n; i++) { - var hex = hash[i].toString(16); - fileID += hex.length === 1 ? '0' + hex : hex; - } - - return shadow(this, 'fingerprint', fileID); - }, - - getPage: function PDFDocument_getPage(pageIndex) { - return this.catalog.getPage(pageIndex); - }, - - cleanup: function PDFDocument_cleanup() { - return this.catalog.cleanup(); - } - }; - - return PDFDocument; -})(); - -exports.Page = Page; -exports.PDFDocument = PDFDocument; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePdfManager = {}), root.pdfjsSharedUtil, - root.pdfjsCoreStream, root.pdfjsCoreChunkedStream, - root.pdfjsCoreDocument); - } -}(this, function (exports, sharedUtil, coreStream, coreChunkedStream, - coreDocument) { - -var NotImplementedException = sharedUtil.NotImplementedException; -var MissingDataException = sharedUtil.MissingDataException; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var Util = sharedUtil.Util; -var Stream = coreStream.Stream; -var ChunkedStreamManager = coreChunkedStream.ChunkedStreamManager; -var PDFDocument = coreDocument.PDFDocument; - -var BasePdfManager = (function BasePdfManagerClosure() { - function BasePdfManager() { - throw new Error('Cannot initialize BaseManagerManager'); - } - - BasePdfManager.prototype = { - get docId() { - return this._docId; - }, - - onLoadedStream: function BasePdfManager_onLoadedStream() { - throw new NotImplementedException(); - }, - - ensureDoc: function BasePdfManager_ensureDoc(prop, args) { - return this.ensure(this.pdfDocument, prop, args); - }, - - ensureXRef: function BasePdfManager_ensureXRef(prop, args) { - return this.ensure(this.pdfDocument.xref, prop, args); - }, - - ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { - return this.ensure(this.pdfDocument.catalog, prop, args); - }, - - getPage: function BasePdfManager_getPage(pageIndex) { - return this.pdfDocument.getPage(pageIndex); - }, - - cleanup: function BasePdfManager_cleanup() { - return this.pdfDocument.cleanup(); - }, - - ensure: function BasePdfManager_ensure(obj, prop, args) { - return new NotImplementedException(); - }, - - requestRange: function BasePdfManager_requestRange(begin, end) { - return new NotImplementedException(); - }, - - requestLoadedStream: function BasePdfManager_requestLoadedStream() { - return new NotImplementedException(); - }, - - sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { - return new NotImplementedException(); - }, - - updatePassword: function BasePdfManager_updatePassword(password) { - this.pdfDocument.xref.password = this.password = password; - if (this._passwordChangedCapability) { - this._passwordChangedCapability.resolve(); - } - }, - - passwordChanged: function BasePdfManager_passwordChanged() { - this._passwordChangedCapability = createPromiseCapability(); - return this._passwordChangedCapability.promise; - }, - - terminate: function BasePdfManager_terminate() { - return new NotImplementedException(); - } - }; - - return BasePdfManager; -})(); - -var LocalPdfManager = (function LocalPdfManagerClosure() { - function LocalPdfManager(docId, data, password) { - this._docId = docId; - var stream = new Stream(data); - this.pdfDocument = new PDFDocument(this, stream, password); - this._loadedStreamCapability = createPromiseCapability(); - this._loadedStreamCapability.resolve(stream); - } - - Util.inherit(LocalPdfManager, BasePdfManager, { - ensure: function LocalPdfManager_ensure(obj, prop, args) { - return new Promise(function (resolve, reject) { - try { - var value = obj[prop]; - var result; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch (e) { - reject(e); - } - }); - }, - - requestRange: function LocalPdfManager_requestRange(begin, end) { - return Promise.resolve(); - }, - - requestLoadedStream: function LocalPdfManager_requestLoadedStream() { - return; - }, - - onLoadedStream: function LocalPdfManager_onLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - terminate: function LocalPdfManager_terminate() { - return; - } - }); - - return LocalPdfManager; -})(); - -var NetworkPdfManager = (function NetworkPdfManagerClosure() { - function NetworkPdfManager(docId, args, msgHandler) { - this._docId = docId; - this.msgHandler = msgHandler; - - var params = { - msgHandler: msgHandler, - httpHeaders: args.httpHeaders, - withCredentials: args.withCredentials, - chunkedViewerLoading: args.chunkedViewerLoading, - disableAutoFetch: args.disableAutoFetch, - initialData: args.initialData - }; - this.streamManager = new ChunkedStreamManager(args.length, - args.rangeChunkSize, - args.url, params); - this.pdfDocument = new PDFDocument(this, this.streamManager.getStream(), - args.password); - } - - Util.inherit(NetworkPdfManager, BasePdfManager, { - ensure: function NetworkPdfManager_ensure(obj, prop, args) { - var pdfManager = this; - - return new Promise(function (resolve, reject) { - function ensureHelper() { - try { - var result; - var value = obj[prop]; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch(e) { - if (!(e instanceof MissingDataException)) { - reject(e); - return; - } - pdfManager.streamManager.requestRange(e.begin, e.end). - then(ensureHelper, reject); - } - } - - ensureHelper(); - }); - }, - - requestRange: function NetworkPdfManager_requestRange(begin, end) { - return this.streamManager.requestRange(begin, end); - }, - - requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { - this.streamManager.requestAllChunks(); - }, - - sendProgressiveData: - function NetworkPdfManager_sendProgressiveData(chunk) { - this.streamManager.onReceiveData({ chunk: chunk }); - }, - - onLoadedStream: function NetworkPdfManager_onLoadedStream() { - return this.streamManager.onLoadedStream(); - }, - - terminate: function NetworkPdfManager_terminate() { - this.streamManager.abort(); - } - }); - - return NetworkPdfManager; -})(); - -exports.LocalPdfManager = LocalPdfManager; -exports.NetworkPdfManager = NetworkPdfManager; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreWorker = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCorePdfManager, - root.pdfjsSharedGlobal); - } -}(this, function (exports, sharedUtil, corePrimitives, corePdfManager, - sharedGlobal) { - -var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; -var InvalidPDFException = sharedUtil.InvalidPDFException; -var MessageHandler = sharedUtil.MessageHandler; -var MissingPDFException = sharedUtil.MissingPDFException; -var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; -var PasswordException = sharedUtil.PasswordException; -var PasswordResponses = sharedUtil.PasswordResponses; -var UnknownErrorException = sharedUtil.UnknownErrorException; -var XRefParseException = sharedUtil.XRefParseException; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isInt = sharedUtil.isInt; -var warn = sharedUtil.warn; -var Ref = corePrimitives.Ref; -var LocalPdfManager = corePdfManager.LocalPdfManager; -var NetworkPdfManager = corePdfManager.NetworkPdfManager; -var globalScope = sharedGlobal.globalScope; -var PDFJS = sharedGlobal.PDFJS; - -var WorkerTask = (function WorkerTaskClosure() { - function WorkerTask(name) { - this.name = name; - this.terminated = false; - this._capability = createPromiseCapability(); - } - - WorkerTask.prototype = { - get finished() { - return this._capability.promise; - }, - - finish: function () { - this._capability.resolve(); - }, - - terminate: function () { - this.terminated = true; - }, - - ensureNotTerminated: function () { - if (this.terminated) { - throw new Error('Worker task was terminated'); - } - } - }; - - return WorkerTask; -})(); - -var WorkerMessageHandler = PDFJS.WorkerMessageHandler = { - setup: function wphSetup(handler, port) { - var testMessageProcessed = false; - handler.on('test', function wphSetupTest(data) { - if (testMessageProcessed) { - return; // we already processed 'test' message once - } - testMessageProcessed = true; - - // check if Uint8Array can be sent to worker - if (!(data instanceof Uint8Array)) { - handler.send('test', 'main', false); - return; - } - // making sure postMessage transfers are working - var supportTransfers = data[0] === 255; - handler.postMessageTransfers = supportTransfers; - // check if the response property is supported by xhr - var xhr = new XMLHttpRequest(); - var responseExists = 'response' in xhr; - // check if the property is actually implemented - try { - var dummy = xhr.responseType; - } catch (e) { - responseExists = false; - } - if (!responseExists) { - handler.send('test', false); - return; - } - handler.send('test', { - supportTypedArray: true, - supportTransfers: supportTransfers - }); - }); - - handler.on('GetDocRequest', function wphSetupDoc(data) { - return WorkerMessageHandler.createDocumentHandler(data, port); - }); - }, - createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { - // This context is actually holds references on pdfManager and handler, - // until the latter is destroyed. - var pdfManager; - var terminated = false; - var cancelXHRs = null; - var WorkerTasks = []; - - var docId = docParams.docId; - var workerHandlerName = docParams.docId + '_worker'; - var handler = new MessageHandler(workerHandlerName, docId, port); - - function ensureNotTerminated() { - if (terminated) { - throw new Error('Worker was terminated'); - } - } - - function startWorkerTask(task) { - WorkerTasks.push(task); - } - - function finishWorkerTask(task) { - task.finish(); - var i = WorkerTasks.indexOf(task); - WorkerTasks.splice(i, 1); - } - - function loadDocument(recoveryMode) { - var loadDocumentCapability = createPromiseCapability(); - - var parseSuccess = function parseSuccess() { - var numPagesPromise = pdfManager.ensureDoc('numPages'); - var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); - var encryptedPromise = pdfManager.ensureXRef('encrypt'); - Promise.all([numPagesPromise, fingerprintPromise, - encryptedPromise]).then(function onDocReady(results) { - var doc = { - numPages: results[0], - fingerprint: results[1], - encrypted: !!results[2], - }; - loadDocumentCapability.resolve(doc); - }, - parseFailure); - }; - - var parseFailure = function parseFailure(e) { - loadDocumentCapability.reject(e); - }; - - pdfManager.ensureDoc('checkHeader', []).then(function() { - pdfManager.ensureDoc('parseStartXRef', []).then(function() { - pdfManager.ensureDoc('parse', [recoveryMode]).then( - parseSuccess, parseFailure); - }, parseFailure); - }, parseFailure); - - return loadDocumentCapability.promise; - } - - function getPdfManager(data) { - var pdfManagerCapability = createPromiseCapability(); - var pdfManager; - - var source = data.source; - var disableRange = data.disableRange; - if (source.data) { - try { - pdfManager = new LocalPdfManager(docId, source.data, source.password); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } else if (source.chunkedViewerLoading) { - try { - pdfManager = new NetworkPdfManager(docId, source, handler); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } - - var networkManager = new NetworkManager(source.url, { - httpHeaders: source.httpHeaders, - withCredentials: source.withCredentials - }); - var cachedChunks = []; - var fullRequestXhrId = networkManager.requestFull({ - onHeadersReceived: function onHeadersReceived() { - if (disableRange) { - return; - } - - var fullRequestXhr = networkManager.getRequestXhr(fullRequestXhrId); - if (fullRequestXhr.getResponseHeader('Accept-Ranges') !== 'bytes') { - return; - } - - var contentEncoding = - fullRequestXhr.getResponseHeader('Content-Encoding') || 'identity'; - if (contentEncoding !== 'identity') { - return; - } - - var length = fullRequestXhr.getResponseHeader('Content-Length'); - length = parseInt(length, 10); - if (!isInt(length)) { - return; - } - source.length = length; - if (length <= 2 * source.rangeChunkSize) { - // The file size is smaller than the size of two chunks, so it does - // not make any sense to abort the request and retry with a range - // request. - return; - } - - if (networkManager.isStreamingRequest(fullRequestXhrId)) { - // We can continue fetching when progressive loading is enabled, - // and we don't need the autoFetch feature. - source.disableAutoFetch = true; - } else { - // NOTE: by cancelling the full request, and then issuing range - // requests, there will be an issue for sites where you can only - // request the pdf once. However, if this is the case, then the - // server should not be returning that it can support range - // requests. - networkManager.abortRequest(fullRequestXhrId); - } - - try { - pdfManager = new NetworkPdfManager(docId, source, handler); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cancelXHRs = null; - }, - - onProgressiveData: source.disableStream ? null : - function onProgressiveData(chunk) { - if (!pdfManager) { - cachedChunks.push(chunk); - return; - } - pdfManager.sendProgressiveData(chunk); - }, - - onDone: function onDone(args) { - if (pdfManager) { - return; // already processed - } - - var pdfFile; - if (args === null) { - // TODO add some streaming manager, e.g. for unknown length files. - // The data was returned in the onProgressiveData, combining... - var pdfFileLength = 0, pos = 0; - cachedChunks.forEach(function (chunk) { - pdfFileLength += chunk.byteLength; - }); - if (source.length && pdfFileLength !== source.length) { - warn('reported HTTP length is different from actual'); - } - var pdfFileArray = new Uint8Array(pdfFileLength); - cachedChunks.forEach(function (chunk) { - pdfFileArray.set(new Uint8Array(chunk), pos); - pos += chunk.byteLength; - }); - pdfFile = pdfFileArray.buffer; - } else { - pdfFile = args.chunk; - } - - // the data is array, instantiating directly from it - try { - pdfManager = new LocalPdfManager(docId, pdfFile, source.password); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cancelXHRs = null; - }, - - onError: function onError(status) { - var exception; - if (status === 404 || status === 0 && /^file:/.test(source.url)) { - exception = new MissingPDFException('Missing PDF "' + - source.url + '".'); - handler.send('MissingPDF', exception); - } else { - exception = new UnexpectedResponseException( - 'Unexpected server response (' + status + - ') while retrieving PDF "' + source.url + '".', status); - handler.send('UnexpectedResponse', exception); - } - cancelXHRs = null; - }, - - onProgress: function onProgress(evt) { - handler.send('DocProgress', { - loaded: evt.loaded, - total: evt.lengthComputable ? evt.total : source.length - }); - } - }); - - cancelXHRs = function () { - networkManager.abortRequest(fullRequestXhrId); - }; - - return pdfManagerCapability.promise; - } - - var setupDoc = function(data) { - var onSuccess = function(doc) { - ensureNotTerminated(); - handler.send('GetDoc', { pdfInfo: doc }); - }; - - var onFailure = function(e) { - if (e instanceof PasswordException) { - if (e.code === PasswordResponses.NEED_PASSWORD) { - handler.send('NeedPassword', e); - } else if (e.code === PasswordResponses.INCORRECT_PASSWORD) { - handler.send('IncorrectPassword', e); - } - } else if (e instanceof InvalidPDFException) { - handler.send('InvalidPDF', e); - } else if (e instanceof MissingPDFException) { - handler.send('MissingPDF', e); - } else if (e instanceof UnexpectedResponseException) { - handler.send('UnexpectedResponse', e); - } else { - handler.send('UnknownError', - new UnknownErrorException(e.message, e.toString())); - } - }; - - ensureNotTerminated(); - - PDFJS.maxImageSize = data.maxImageSize === undefined ? - -1 : data.maxImageSize; - PDFJS.disableFontFace = data.disableFontFace; - PDFJS.disableCreateObjectURL = data.disableCreateObjectURL; - PDFJS.verbosity = data.verbosity; - PDFJS.cMapUrl = data.cMapUrl === undefined ? - null : data.cMapUrl; - PDFJS.cMapPacked = data.cMapPacked === true; - - getPdfManager(data).then(function (newPdfManager) { - if (terminated) { - // We were in a process of setting up the manager, but it got - // terminated in the middle. - newPdfManager.terminate(); - throw new Error('Worker was terminated'); - } - - pdfManager = newPdfManager; - handler.send('PDFManagerReady', null); - pdfManager.onLoadedStream().then(function(stream) { - handler.send('DataLoaded', { length: stream.bytes.byteLength }); - }); - }).then(function pdfManagerReady() { - ensureNotTerminated(); - - loadDocument(false).then(onSuccess, function loadFailure(ex) { - ensureNotTerminated(); - - // Try again with recoveryMode == true - if (!(ex instanceof XRefParseException)) { - if (ex instanceof PasswordException) { - // after password exception prepare to receive a new password - // to repeat loading - pdfManager.passwordChanged().then(pdfManagerReady); - } - - onFailure(ex); - return; - } - - pdfManager.requestLoadedStream(); - pdfManager.onLoadedStream().then(function() { - ensureNotTerminated(); - - loadDocument(true).then(onSuccess, onFailure); - }); - }, onFailure); - }, onFailure); - }; - - handler.on('GetPage', function wphSetupGetPage(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - var rotatePromise = pdfManager.ensure(page, 'rotate'); - var refPromise = pdfManager.ensure(page, 'ref'); - var viewPromise = pdfManager.ensure(page, 'view'); - - return Promise.all([rotatePromise, refPromise, viewPromise]).then( - function(results) { - return { - rotate: results[0], - ref: results[1], - view: results[2] - }; - }); - }); - }); - - handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { - var ref = new Ref(data.ref.num, data.ref.gen); - var catalog = pdfManager.pdfDocument.catalog; - return catalog.getPageIndex(ref); - }); - - handler.on('GetDestinations', - function wphSetupGetDestinations(data) { - return pdfManager.ensureCatalog('destinations'); - } - ); - - handler.on('GetDestination', - function wphSetupGetDestination(data) { - return pdfManager.ensureCatalog('getDestination', [data.id]); - } - ); - - handler.on('GetPageLabels', - function wphSetupGetPageLabels(data) { - return pdfManager.ensureCatalog('pageLabels'); - } - ); - - handler.on('GetAttachments', - function wphSetupGetAttachments(data) { - return pdfManager.ensureCatalog('attachments'); - } - ); - - handler.on('GetJavaScript', - function wphSetupGetJavaScript(data) { - return pdfManager.ensureCatalog('javaScript'); - } - ); - - handler.on('GetOutline', - function wphSetupGetOutline(data) { - return pdfManager.ensureCatalog('documentOutline'); - } - ); - - handler.on('GetMetadata', - function wphSetupGetMetadata(data) { - return Promise.all([pdfManager.ensureDoc('documentInfo'), - pdfManager.ensureCatalog('metadata')]); - } - ); - - handler.on('GetData', function wphSetupGetData(data) { - pdfManager.requestLoadedStream(); - return pdfManager.onLoadedStream().then(function(stream) { - return stream.bytes; - }); - }); - - handler.on('GetStats', - function wphSetupGetStats(data) { - return pdfManager.pdfDocument.xref.stats; - } - ); - - handler.on('UpdatePassword', function wphSetupUpdatePassword(data) { - pdfManager.updatePassword(data); - }); - - handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); - }); - }); - - handler.on('RenderPageRequest', function wphSetupRenderPage(data) { - var pageIndex = data.pageIndex; - pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); - startWorkerTask(task); - - var pageNum = pageIndex + 1; - var start = Date.now(); - // Pre compile the pdf page and fetch the fonts/images. - page.getOperatorList(handler, task, data.intent).then( - function(operatorList) { - finishWorkerTask(task); - - info('page=' + pageNum + ' - getOperatorList: time=' + - (Date.now() - start) + 'ms, len=' + operatorList.totalLength); - }, function(e) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - - // For compatibility with older behavior, generating unknown - // unsupported feature notification on errors. - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.unknown}); - - var minimumStackMessage = - 'worker.js: while trying to getPage() and getOperatorList()'; - - var wrappedException; - - // Turn the error into an obj that can be serialized - if (typeof e === 'string') { - wrappedException = { - message: e, - stack: minimumStackMessage - }; - } else if (typeof e === 'object') { - wrappedException = { - message: e.message || e.toString(), - stack: e.stack || minimumStackMessage - }; - } else { - wrappedException = { - message: 'Unknown exception type: ' + (typeof e), - stack: minimumStackMessage - }; - } - - handler.send('PageError', { - pageNum: pageNum, - error: wrappedException, - intent: data.intent - }); - }); - }); - }, this); - - handler.on('GetTextContent', function wphExtractText(data) { - var pageIndex = data.pageIndex; - var normalizeWhitespace = data.normalizeWhitespace; - return pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('GetTextContent: page ' + pageIndex); - startWorkerTask(task); - var pageNum = pageIndex + 1; - var start = Date.now(); - return page.extractTextContent(task, normalizeWhitespace).then( - function(textContent) { - finishWorkerTask(task); - info('text indexing: page=' + pageNum + ' - time=' + - (Date.now() - start) + 'ms'); - return textContent; - }, function (reason) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - throw reason; - }); - }); - }); - - handler.on('Cleanup', function wphCleanup(data) { - return pdfManager.cleanup(); - }); - - handler.on('Terminate', function wphTerminate(data) { - terminated = true; - if (pdfManager) { - pdfManager.terminate(); - pdfManager = null; - } - if (cancelXHRs) { - cancelXHRs(); - } - - var waitOn = []; - WorkerTasks.forEach(function (task) { - waitOn.push(task.finished); - task.terminate(); - }); - - return Promise.all(waitOn).then(function () { - // Notice that even if we destroying handler, resolved response promise - // must be sent back. - handler.destroy(); - handler = null; - }); - }); - - handler.on('Ready', function wphReady(data) { - setupDoc(docParams); - docParams = null; // we don't need docParams anymore -- saving memory. - }); - return workerHandlerName; - } -}; - -function initializeWorker() { - if (!('console' in globalScope)) { - var consoleTimer = {}; - - var workerConsole = { - log: function log() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_log', - data: args - }); - }, - - error: function error() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_error', - data: args - }); - throw 'pdf.js execution error'; - }, - - time: function time(name) { - consoleTimer[name] = Date.now(); - }, - - timeEnd: function timeEnd(name) { - var time = consoleTimer[name]; - if (!time) { - error('Unknown timer name ' + name); - } - this.log('Timer:', name, Date.now() - time); - } - }; - - globalScope.console = workerConsole; - } - - var handler = new MessageHandler('worker', 'main', self); - WorkerMessageHandler.setup(handler, self); - handler.send('ready', null); -} - -// Worker thread (and not node.js)? -if (typeof window === 'undefined' && - !(typeof module !== 'undefined' && module.require)) { - initializeWorker(); -} - -exports.WorkerTask = WorkerTask; -exports.WorkerMessageHandler = WorkerMessageHandler; -})); - - - }).call(pdfjsLibs); - - exports.PDFJS = pdfjsLibs.pdfjsSharedGlobal.PDFJS; - -})); - - diff --git a/public/plugins/pdfjs-1.4.20/web/compatibility.js b/public/plugins/pdfjs-1.4.20/web/compatibility.js deleted file mode 100644 index 1119a2742..000000000 --- a/public/plugins/pdfjs-1.4.20/web/compatibility.js +++ /dev/null @@ -1,593 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals VBArray, PDFJS */ - -'use strict'; - -// Initializing PDFJS global object here, it case if we need to change/disable -// some PDF.js features, e.g. range requests -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -// Checking if the typed arrays are supported -// Support: iOS<6.0 (subarray), IE<10, Android<4.0 -(function checkTypedArrayCompatibility() { - if (typeof Uint8Array !== 'undefined') { - // Support: iOS<6.0 - if (typeof Uint8Array.prototype.subarray === 'undefined') { - Uint8Array.prototype.subarray = function subarray(start, end) { - return new Uint8Array(this.slice(start, end)); - }; - Float32Array.prototype.subarray = function subarray(start, end) { - return new Float32Array(this.slice(start, end)); - }; - } - - // Support: Android<4.1 - if (typeof Float64Array === 'undefined') { - window.Float64Array = Float32Array; - } - return; - } - - function subarray(start, end) { - return new TypedArray(this.slice(start, end)); - } - - function setArrayOffset(array, offset) { - if (arguments.length < 2) { - offset = 0; - } - for (var i = 0, n = array.length; i < n; ++i, ++offset) { - this[offset] = array[i] & 0xFF; - } - } - - function TypedArray(arg1) { - var result, i, n; - if (typeof arg1 === 'number') { - result = []; - for (i = 0; i < arg1; ++i) { - result[i] = 0; - } - } else if ('slice' in arg1) { - result = arg1.slice(0); - } else { - result = []; - for (i = 0, n = arg1.length; i < n; ++i) { - result[i] = arg1[i]; - } - } - - result.subarray = subarray; - result.buffer = result; - result.byteLength = result.length; - result.set = setArrayOffset; - - if (typeof arg1 === 'object' && arg1.buffer) { - result.buffer = arg1.buffer; - } - return result; - } - - window.Uint8Array = TypedArray; - window.Int8Array = TypedArray; - - // we don't need support for set, byteLength for 32-bit array - // so we can use the TypedArray as well - window.Uint32Array = TypedArray; - window.Int32Array = TypedArray; - window.Uint16Array = TypedArray; - window.Float32Array = TypedArray; - window.Float64Array = TypedArray; -})(); - -// URL = URL || webkitURL -// Support: Safari<7, Android 4.2+ -(function normalizeURLObject() { - if (!window.URL) { - window.URL = window.webkitURL; - } -})(); - -// Object.defineProperty()? -// Support: Android<4.0, Safari<5.1 -(function checkObjectDefinePropertyCompatibility() { - if (typeof Object.defineProperty !== 'undefined') { - var definePropertyPossible = true; - try { - // some browsers (e.g. safari) cannot use defineProperty() on DOM objects - // and thus the native version is not sufficient - Object.defineProperty(new Image(), 'id', { value: 'test' }); - // ... another test for android gb browser for non-DOM objects - var Test = function Test() {}; - Test.prototype = { get id() { } }; - Object.defineProperty(new Test(), 'id', - { value: '', configurable: true, enumerable: true, writable: false }); - } catch (e) { - definePropertyPossible = false; - } - if (definePropertyPossible) { - return; - } - } - - Object.defineProperty = function objectDefineProperty(obj, name, def) { - delete obj[name]; - if ('get' in def) { - obj.__defineGetter__(name, def['get']); - } - if ('set' in def) { - obj.__defineSetter__(name, def['set']); - } - if ('value' in def) { - obj.__defineSetter__(name, function objectDefinePropertySetter(value) { - this.__defineGetter__(name, function objectDefinePropertyGetter() { - return value; - }); - return value; - }); - obj[name] = def.value; - } - }; -})(); - - -// No XMLHttpRequest#response? -// Support: IE<11, Android <4.0 -(function checkXMLHttpRequestResponseCompatibility() { - var xhrPrototype = XMLHttpRequest.prototype; - var xhr = new XMLHttpRequest(); - if (!('overrideMimeType' in xhr)) { - // IE10 might have response, but not overrideMimeType - // Support: IE10 - Object.defineProperty(xhrPrototype, 'overrideMimeType', { - value: function xmlHttpRequestOverrideMimeType(mimeType) {} - }); - } - if ('responseType' in xhr) { - return; - } - - // The worker will be using XHR, so we can save time and disable worker. - PDFJS.disableWorker = true; - - Object.defineProperty(xhrPrototype, 'responseType', { - get: function xmlHttpRequestGetResponseType() { - return this._responseType || 'text'; - }, - set: function xmlHttpRequestSetResponseType(value) { - if (value === 'text' || value === 'arraybuffer') { - this._responseType = value; - if (value === 'arraybuffer' && - typeof this.overrideMimeType === 'function') { - this.overrideMimeType('text/plain; charset=x-user-defined'); - } - } - } - }); - - // Support: IE9 - if (typeof VBArray !== 'undefined') { - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType === 'arraybuffer') { - return new Uint8Array(new VBArray(this.responseBody).toArray()); - } else { - return this.responseText; - } - } - }); - return; - } - - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType !== 'arraybuffer') { - return this.responseText; - } - var text = this.responseText; - var i, n = text.length; - var result = new Uint8Array(n); - for (i = 0; i < n; ++i) { - result[i] = text.charCodeAt(i) & 0xFF; - } - return result.buffer; - } - }); -})(); - -// window.btoa (base64 encode function) ? -// Support: IE<10 -(function checkWindowBtoaCompatibility() { - if ('btoa' in window) { - return; - } - - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - window.btoa = function windowBtoa(chars) { - var buffer = ''; - var i, n; - for (i = 0, n = chars.length; i < n; i += 3) { - var b1 = chars.charCodeAt(i) & 0xFF; - var b2 = chars.charCodeAt(i + 1) & 0xFF; - var b3 = chars.charCodeAt(i + 2) & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < n ? (b3 & 0x3F) : 64; - buffer += (digits.charAt(d1) + digits.charAt(d2) + - digits.charAt(d3) + digits.charAt(d4)); - } - return buffer; - }; -})(); - -// window.atob (base64 encode function)? -// Support: IE<10 -(function checkWindowAtobCompatibility() { - if ('atob' in window) { - return; - } - - // https://github.com/davidchambers/Base64.js - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - window.atob = function (input) { - input = input.replace(/=+$/, ''); - if (input.length % 4 === 1) { - throw new Error('bad atob input'); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? - // initialize bit storage and add its ascii value - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = digits.indexOf(buffer); - } - return output; - }; -})(); - -// Function.prototype.bind? -// Support: Android<4.0, iOS<6.0 -(function checkFunctionPrototypeBindCompatibility() { - if (typeof Function.prototype.bind !== 'undefined') { - return; - } - - Function.prototype.bind = function functionPrototypeBind(obj) { - var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); - var bound = function functionPrototypeBindBound() { - var args = headArgs.concat(Array.prototype.slice.call(arguments)); - return fn.apply(obj, args); - }; - return bound; - }; -})(); - -// HTMLElement dataset property -// Support: IE<11, Safari<5.1, Android<4.0 -(function checkDatasetProperty() { - var div = document.createElement('div'); - if ('dataset' in div) { - return; // dataset property exists - } - - Object.defineProperty(HTMLElement.prototype, 'dataset', { - get: function() { - if (this._dataset) { - return this._dataset; - } - - var dataset = {}; - for (var j = 0, jj = this.attributes.length; j < jj; j++) { - var attribute = this.attributes[j]; - if (attribute.name.substring(0, 5) !== 'data-') { - continue; - } - var key = attribute.name.substring(5).replace(/\-([a-z])/g, - function(all, ch) { - return ch.toUpperCase(); - }); - dataset[key] = attribute.value; - } - - Object.defineProperty(this, '_dataset', { - value: dataset, - writable: false, - enumerable: false - }); - return dataset; - }, - enumerable: true - }); -})(); - -// HTMLElement classList property -// Support: IE<10, Android<4.0, iOS<5.0 -(function checkClassListProperty() { - var div = document.createElement('div'); - if ('classList' in div) { - return; // classList property exists - } - - function changeList(element, itemName, add, remove) { - var s = element.className || ''; - var list = s.split(/\s+/g); - if (list[0] === '') { - list.shift(); - } - var index = list.indexOf(itemName); - if (index < 0 && add) { - list.push(itemName); - } - if (index >= 0 && remove) { - list.splice(index, 1); - } - element.className = list.join(' '); - return (index >= 0); - } - - var classListPrototype = { - add: function(name) { - changeList(this.element, name, true, false); - }, - contains: function(name) { - return changeList(this.element, name, false, false); - }, - remove: function(name) { - changeList(this.element, name, false, true); - }, - toggle: function(name) { - changeList(this.element, name, true, true); - } - }; - - Object.defineProperty(HTMLElement.prototype, 'classList', { - get: function() { - if (this._classList) { - return this._classList; - } - - var classList = Object.create(classListPrototype, { - element: { - value: this, - writable: false, - enumerable: true - } - }); - Object.defineProperty(this, '_classList', { - value: classList, - writable: false, - enumerable: false - }); - return classList; - }, - enumerable: true - }); -})(); - -// Check console compatibility -// In older IE versions the console object is not available -// unless console is open. -// Support: IE<10 -(function checkConsoleCompatibility() { - if (!('console' in window)) { - window.console = { - log: function() {}, - error: function() {}, - warn: function() {} - }; - } else if (!('bind' in console.log)) { - // native functions in IE9 might not have bind - console.log = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.log); - console.error = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.error); - console.warn = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.warn); - } -})(); - -// Check onclick compatibility in Opera -// Support: Opera<15 -(function checkOnClickCompatibility() { - // workaround for reported Opera bug DSK-354448: - // onclick fires on disabled buttons with opaque content - function ignoreIfTargetDisabled(event) { - if (isDisabled(event.target)) { - event.stopPropagation(); - } - } - function isDisabled(node) { - return node.disabled || (node.parentNode && isDisabled(node.parentNode)); - } - if (navigator.userAgent.indexOf('Opera') !== -1) { - // use browser detection since we cannot feature-check this bug - document.addEventListener('click', ignoreIfTargetDisabled, true); - } -})(); - -// Checks if possible to use URL.createObjectURL() -// Support: IE -(function checkOnBlobSupport() { - // sometimes IE loosing the data created with createObjectURL(), see #3977 - if (navigator.userAgent.indexOf('Trident') >= 0) { - PDFJS.disableCreateObjectURL = true; - } -})(); - -// Checks if navigator.language is supported -(function checkNavigatorLanguage() { - if ('language' in navigator) { - return; - } - PDFJS.locale = navigator.userLanguage || 'en-US'; -})(); - -(function checkRangeRequests() { - // Safari has issues with cached range requests see: - // https://github.com/mozilla/pdf.js/issues/3260 - // Last tested with version 6.0.4. - // Support: Safari 6.0+ - var isSafari = Object.prototype.toString.call( - window.HTMLElement).indexOf('Constructor') > 0; - - // Older versions of Android (pre 3.0) has issues with range requests, see: - // https://github.com/mozilla/pdf.js/issues/3381. - // Make sure that we only match webkit-based Android browsers, - // since Firefox/Fennec works as expected. - // Support: Android<3.0 - var regex = /Android\s[0-2][^\d]/; - var isOldAndroid = regex.test(navigator.userAgent); - - // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318 - var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(navigator.userAgent); - - if (isSafari || isOldAndroid || isChromeWithRangeBug) { - PDFJS.disableRange = true; - PDFJS.disableStream = true; - } -})(); - -// Check if the browser supports manipulation of the history. -// Support: IE<10, Android<4.2 -(function checkHistoryManipulation() { - // Android 2.x has so buggy pushState support that it was removed in - // Android 3.0 and restored as late as in Android 4.2. - // Support: Android 2.x - if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) { - PDFJS.disableHistory = true; - } -})(); - -// Support: IE<11, Chrome<21, Android<4.4, Safari<6 -(function checkSetPresenceInImageData() { - // IE < 11 will use window.CanvasPixelArray which lacks set function. - if (window.CanvasPixelArray) { - if (typeof window.CanvasPixelArray.prototype.set !== 'function') { - window.CanvasPixelArray.prototype.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - } - } else { - // Old Chrome and Android use an inaccessible CanvasPixelArray prototype. - // Because we cannot feature detect it, we rely on user agent parsing. - var polyfill = false, versionMatch; - if (navigator.userAgent.indexOf('Chrom') >= 0) { - versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); - // Chrome < 21 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[2]) < 21; - } else if (navigator.userAgent.indexOf('Android') >= 0) { - // Android < 4.4 lacks the set function. - // Android >= 4.4 will contain Chrome in the user agent, - // thus pass the Chrome check above and not reach this block. - polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent); - } else if (navigator.userAgent.indexOf('Safari') >= 0) { - versionMatch = navigator.userAgent. - match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); - // Safari < 6 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[1]) < 6; - } - - if (polyfill) { - var contextPrototype = window.CanvasRenderingContext2D.prototype; - var createImageData = contextPrototype.createImageData; - contextPrototype.createImageData = function(w, h) { - var imageData = createImageData.call(this, w, h); - imageData.data.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - return imageData; - }; - // this closure will be kept referenced, so clear its vars - contextPrototype = null; - } - } -})(); - -// Support: IE<10, Android<4.0, iOS -(function checkRequestAnimationFrame() { - function fakeRequestAnimationFrame(callback) { - window.setTimeout(callback, 20); - } - - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - if (isIOS) { - // requestAnimationFrame on iOS is broken, replacing with fake one. - window.requestAnimationFrame = fakeRequestAnimationFrame; - return; - } - if ('requestAnimationFrame' in window) { - return; - } - window.requestAnimationFrame = - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - fakeRequestAnimationFrame; -})(); - -(function checkCanvasSizeLimitation() { - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - var isAndroid = /Android/g.test(navigator.userAgent); - if (isIOS || isAndroid) { - // 5MP - PDFJS.maxCanvasPixels = 5242880; - } -})(); - -// Disable fullscreen support for certain problematic configurations. -// Support: IE11+ (when embedded). -(function checkFullscreenSupport() { - var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 && - window.parent !== window); - if (isEmbeddedIE) { - PDFJS.disableFullscreen = true; - } -})(); - -// Provides document.currentScript support -// Support: IE, Chrome<29. -(function checkCurrentScript() { - if ('currentScript' in document) { - return; - } - Object.defineProperty(document, 'currentScript', { - get: function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - }, - enumerable: true, - configurable: true - }); -})(); diff --git a/public/plugins/pdfjs-1.4.20/web/debugger.js b/public/plugins/pdfjs-1.4.20/web/debugger.js deleted file mode 100644 index 9c35b63d7..000000000 --- a/public/plugins/pdfjs-1.4.20/web/debugger.js +++ /dev/null @@ -1,618 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals PDFJS */ - -'use strict'; - -var FontInspector = (function FontInspectorClosure() { - var fonts; - var active = false; - var fontAttribute = 'data-font-name'; - function removeSelection() { - var divs = document.querySelectorAll('div[' + fontAttribute + ']'); - for (var i = 0, ii = divs.length; i < ii; ++i) { - var div = divs[i]; - div.className = ''; - } - } - function resetSelection() { - var divs = document.querySelectorAll('div[' + fontAttribute + ']'); - for (var i = 0, ii = divs.length; i < ii; ++i) { - var div = divs[i]; - div.className = 'debuggerHideText'; - } - } - function selectFont(fontName, show) { - var divs = document.querySelectorAll('div[' + fontAttribute + '=' + - fontName + ']'); - for (var i = 0, ii = divs.length; i < ii; ++i) { - var div = divs[i]; - div.className = show ? 'debuggerShowText' : 'debuggerHideText'; - } - } - function textLayerClick(e) { - if (!e.target.dataset.fontName || - e.target.tagName.toUpperCase() !== 'DIV') { - return; - } - var fontName = e.target.dataset.fontName; - var selects = document.getElementsByTagName('input'); - for (var i = 0; i < selects.length; ++i) { - var select = selects[i]; - if (select.dataset.fontName !== fontName) { - continue; - } - select.checked = !select.checked; - selectFont(fontName, select.checked); - select.scrollIntoView(); - } - } - return { - // Properties/functions needed by PDFBug. - id: 'FontInspector', - name: 'Font Inspector', - panel: null, - manager: null, - init: function init() { - var panel = this.panel; - panel.setAttribute('style', 'padding: 5px;'); - var tmp = document.createElement('button'); - tmp.addEventListener('click', resetSelection); - tmp.textContent = 'Refresh'; - panel.appendChild(tmp); - - fonts = document.createElement('div'); - panel.appendChild(fonts); - }, - cleanup: function cleanup() { - fonts.textContent = ''; - }, - enabled: false, - get active() { - return active; - }, - set active(value) { - active = value; - if (active) { - document.body.addEventListener('click', textLayerClick, true); - resetSelection(); - } else { - document.body.removeEventListener('click', textLayerClick, true); - removeSelection(); - } - }, - // FontInspector specific functions. - fontAdded: function fontAdded(fontObj, url) { - function properties(obj, list) { - var moreInfo = document.createElement('table'); - for (var i = 0; i < list.length; i++) { - var tr = document.createElement('tr'); - var td1 = document.createElement('td'); - td1.textContent = list[i]; - tr.appendChild(td1); - var td2 = document.createElement('td'); - td2.textContent = obj[list[i]].toString(); - tr.appendChild(td2); - moreInfo.appendChild(tr); - } - return moreInfo; - } - var moreInfo = properties(fontObj, ['name', 'type']); - var fontName = fontObj.loadedName; - var font = document.createElement('div'); - var name = document.createElement('span'); - name.textContent = fontName; - var download = document.createElement('a'); - if (url) { - url = /url\(['"]?([^\)"']+)/.exec(url); - download.href = url[1]; - } else if (fontObj.data) { - url = URL.createObjectURL(new Blob([fontObj.data], { - type: fontObj.mimeType - })); - download.href = url; - } - download.textContent = 'Download'; - var logIt = document.createElement('a'); - logIt.href = ''; - logIt.textContent = 'Log'; - logIt.addEventListener('click', function(event) { - event.preventDefault(); - console.log(fontObj); - }); - var select = document.createElement('input'); - select.setAttribute('type', 'checkbox'); - select.dataset.fontName = fontName; - select.addEventListener('click', (function(select, fontName) { - return (function() { - selectFont(fontName, select.checked); - }); - })(select, fontName)); - font.appendChild(select); - font.appendChild(name); - font.appendChild(document.createTextNode(' ')); - font.appendChild(download); - font.appendChild(document.createTextNode(' ')); - font.appendChild(logIt); - font.appendChild(moreInfo); - fonts.appendChild(font); - // Somewhat of a hack, should probably add a hook for when the text layer - // is done rendering. - setTimeout(function() { - if (this.active) { - resetSelection(); - } - }.bind(this), 2000); - } - }; -})(); - -// Manages all the page steppers. -var StepperManager = (function StepperManagerClosure() { - var steppers = []; - var stepperDiv = null; - var stepperControls = null; - var stepperChooser = null; - var breakPoints = {}; - return { - // Properties/functions needed by PDFBug. - id: 'Stepper', - name: 'Stepper', - panel: null, - manager: null, - init: function init() { - var self = this; - this.panel.setAttribute('style', 'padding: 5px;'); - stepperControls = document.createElement('div'); - stepperChooser = document.createElement('select'); - stepperChooser.addEventListener('change', function(event) { - self.selectStepper(this.value); - }); - stepperControls.appendChild(stepperChooser); - stepperDiv = document.createElement('div'); - this.panel.appendChild(stepperControls); - this.panel.appendChild(stepperDiv); - if (sessionStorage.getItem('pdfjsBreakPoints')) { - breakPoints = JSON.parse(sessionStorage.getItem('pdfjsBreakPoints')); - } - }, - cleanup: function cleanup() { - stepperChooser.textContent = ''; - stepperDiv.textContent = ''; - steppers = []; - }, - enabled: false, - active: false, - // Stepper specific functions. - create: function create(pageIndex) { - var debug = document.createElement('div'); - debug.id = 'stepper' + pageIndex; - debug.setAttribute('hidden', true); - debug.className = 'stepper'; - stepperDiv.appendChild(debug); - var b = document.createElement('option'); - b.textContent = 'Page ' + (pageIndex + 1); - b.value = pageIndex; - stepperChooser.appendChild(b); - var initBreakPoints = breakPoints[pageIndex] || []; - var stepper = new Stepper(debug, pageIndex, initBreakPoints); - steppers.push(stepper); - if (steppers.length === 1) { - this.selectStepper(pageIndex, false); - } - return stepper; - }, - selectStepper: function selectStepper(pageIndex, selectPanel) { - var i; - pageIndex = pageIndex | 0; - if (selectPanel) { - this.manager.selectPanel(this); - } - for (i = 0; i < steppers.length; ++i) { - var stepper = steppers[i]; - if (stepper.pageIndex === pageIndex) { - stepper.panel.removeAttribute('hidden'); - } else { - stepper.panel.setAttribute('hidden', true); - } - } - var options = stepperChooser.options; - for (i = 0; i < options.length; ++i) { - var option = options[i]; - option.selected = (option.value | 0) === pageIndex; - } - }, - saveBreakPoints: function saveBreakPoints(pageIndex, bps) { - breakPoints[pageIndex] = bps; - sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints)); - } - }; -})(); - -// The stepper for each page's IRQueue. -var Stepper = (function StepperClosure() { - // Shorter way to create element and optionally set textContent. - function c(tag, textContent) { - var d = document.createElement(tag); - if (textContent) { - d.textContent = textContent; - } - return d; - } - - var opMap = null; - - function simplifyArgs(args) { - if (typeof args === 'string') { - var MAX_STRING_LENGTH = 75; - return args.length <= MAX_STRING_LENGTH ? args : - args.substr(0, MAX_STRING_LENGTH) + '...'; - } - if (typeof args !== 'object' || args === null) { - return args; - } - if ('length' in args) { // array - var simpleArgs = [], i, ii; - var MAX_ITEMS = 10; - for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) { - simpleArgs.push(simplifyArgs(args[i])); - } - if (i < args.length) { - simpleArgs.push('...'); - } - return simpleArgs; - } - var simpleObj = {}; - for (var key in args) { - simpleObj[key] = simplifyArgs(args[key]); - } - return simpleObj; - } - - function Stepper(panel, pageIndex, initialBreakPoints) { - this.panel = panel; - this.breakPoint = 0; - this.nextBreakPoint = null; - this.pageIndex = pageIndex; - this.breakPoints = initialBreakPoints; - this.currentIdx = -1; - this.operatorListIdx = 0; - } - Stepper.prototype = { - init: function init() { - var panel = this.panel; - var content = c('div', 'c=continue, s=step'); - var table = c('table'); - content.appendChild(table); - table.cellSpacing = 0; - var headerRow = c('tr'); - table.appendChild(headerRow); - headerRow.appendChild(c('th', 'Break')); - headerRow.appendChild(c('th', 'Idx')); - headerRow.appendChild(c('th', 'fn')); - headerRow.appendChild(c('th', 'args')); - panel.appendChild(content); - this.table = table; - if (!opMap) { - opMap = Object.create(null); - for (var key in PDFJS.OPS) { - opMap[PDFJS.OPS[key]] = key; - } - } - }, - updateOperatorList: function updateOperatorList(operatorList) { - var self = this; - - function cboxOnClick() { - var x = +this.dataset.idx; - if (this.checked) { - self.breakPoints.push(x); - } else { - self.breakPoints.splice(self.breakPoints.indexOf(x), 1); - } - StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints); - } - - var MAX_OPERATORS_COUNT = 15000; - if (this.operatorListIdx > MAX_OPERATORS_COUNT) { - return; - } - - var chunk = document.createDocumentFragment(); - var operatorsToDisplay = Math.min(MAX_OPERATORS_COUNT, - operatorList.fnArray.length); - for (var i = this.operatorListIdx; i < operatorsToDisplay; i++) { - var line = c('tr'); - line.className = 'line'; - line.dataset.idx = i; - chunk.appendChild(line); - var checked = this.breakPoints.indexOf(i) !== -1; - var args = operatorList.argsArray[i] || []; - - var breakCell = c('td'); - var cbox = c('input'); - cbox.type = 'checkbox'; - cbox.className = 'points'; - cbox.checked = checked; - cbox.dataset.idx = i; - cbox.onclick = cboxOnClick; - - breakCell.appendChild(cbox); - line.appendChild(breakCell); - line.appendChild(c('td', i.toString())); - var fn = opMap[operatorList.fnArray[i]]; - var decArgs = args; - if (fn === 'showText') { - var glyphs = args[0]; - var newArgs = []; - var str = []; - for (var j = 0; j < glyphs.length; j++) { - var glyph = glyphs[j]; - if (typeof glyph === 'object' && glyph !== null) { - str.push(glyph.fontChar); - } else { - if (str.length > 0) { - newArgs.push(str.join('')); - str = []; - } - newArgs.push(glyph); // null or number - } - } - if (str.length > 0) { - newArgs.push(str.join('')); - } - decArgs = [newArgs]; - } - line.appendChild(c('td', fn)); - line.appendChild(c('td', JSON.stringify(simplifyArgs(decArgs)))); - } - if (operatorsToDisplay < operatorList.fnArray.length) { - line = c('tr'); - var lastCell = c('td', '...'); - lastCell.colspan = 4; - chunk.appendChild(lastCell); - } - this.operatorListIdx = operatorList.fnArray.length; - this.table.appendChild(chunk); - }, - getNextBreakPoint: function getNextBreakPoint() { - this.breakPoints.sort(function(a, b) { return a - b; }); - for (var i = 0; i < this.breakPoints.length; i++) { - if (this.breakPoints[i] > this.currentIdx) { - return this.breakPoints[i]; - } - } - return null; - }, - breakIt: function breakIt(idx, callback) { - StepperManager.selectStepper(this.pageIndex, true); - var self = this; - var dom = document; - self.currentIdx = idx; - var listener = function(e) { - switch (e.keyCode) { - case 83: // step - dom.removeEventListener('keydown', listener, false); - self.nextBreakPoint = self.currentIdx + 1; - self.goTo(-1); - callback(); - break; - case 67: // continue - dom.removeEventListener('keydown', listener, false); - var breakPoint = self.getNextBreakPoint(); - self.nextBreakPoint = breakPoint; - self.goTo(-1); - callback(); - break; - } - }; - dom.addEventListener('keydown', listener, false); - self.goTo(idx); - }, - goTo: function goTo(idx) { - var allRows = this.panel.getElementsByClassName('line'); - for (var x = 0, xx = allRows.length; x < xx; ++x) { - var row = allRows[x]; - if ((row.dataset.idx | 0) === idx) { - row.style.backgroundColor = 'rgb(251,250,207)'; - row.scrollIntoView(); - } else { - row.style.backgroundColor = null; - } - } - } - }; - return Stepper; -})(); - -var Stats = (function Stats() { - var stats = []; - function clear(node) { - while (node.hasChildNodes()) { - node.removeChild(node.lastChild); - } - } - function getStatIndex(pageNumber) { - for (var i = 0, ii = stats.length; i < ii; ++i) { - if (stats[i].pageNumber === pageNumber) { - return i; - } - } - return false; - } - return { - // Properties/functions needed by PDFBug. - id: 'Stats', - name: 'Stats', - panel: null, - manager: null, - init: function init() { - this.panel.setAttribute('style', 'padding: 5px;'); - PDFJS.enableStats = true; - }, - enabled: false, - active: false, - // Stats specific functions. - add: function(pageNumber, stat) { - if (!stat) { - return; - } - var statsIndex = getStatIndex(pageNumber); - if (statsIndex !== false) { - var b = stats[statsIndex]; - this.panel.removeChild(b.div); - stats.splice(statsIndex, 1); - } - var wrapper = document.createElement('div'); - wrapper.className = 'stats'; - var title = document.createElement('div'); - title.className = 'title'; - title.textContent = 'Page: ' + pageNumber; - var statsDiv = document.createElement('div'); - statsDiv.textContent = stat.toString(); - wrapper.appendChild(title); - wrapper.appendChild(statsDiv); - stats.push({ pageNumber: pageNumber, div: wrapper }); - stats.sort(function(a, b) { return a.pageNumber - b.pageNumber; }); - clear(this.panel); - for (var i = 0, ii = stats.length; i < ii; ++i) { - this.panel.appendChild(stats[i].div); - } - }, - cleanup: function () { - stats = []; - clear(this.panel); - } - }; -})(); - -// Manages all the debugging tools. -var PDFBug = (function PDFBugClosure() { - var panelWidth = 300; - var buttons = []; - var activePanel = null; - - return { - tools: [ - FontInspector, - StepperManager, - Stats - ], - enable: function(ids) { - var all = false, tools = this.tools; - if (ids.length === 1 && ids[0] === 'all') { - all = true; - } - for (var i = 0; i < tools.length; ++i) { - var tool = tools[i]; - if (all || ids.indexOf(tool.id) !== -1) { - tool.enabled = true; - } - } - if (!all) { - // Sort the tools by the order they are enabled. - tools.sort(function(a, b) { - var indexA = ids.indexOf(a.id); - indexA = indexA < 0 ? tools.length : indexA; - var indexB = ids.indexOf(b.id); - indexB = indexB < 0 ? tools.length : indexB; - return indexA - indexB; - }); - } - }, - init: function init() { - /* - * Basic Layout: - * PDFBug - * Controls - * Panels - * Panel - * Panel - * ... - */ - var ui = document.createElement('div'); - ui.id = 'PDFBug'; - - var controls = document.createElement('div'); - controls.setAttribute('class', 'controls'); - ui.appendChild(controls); - - var panels = document.createElement('div'); - panels.setAttribute('class', 'panels'); - ui.appendChild(panels); - - var container = document.getElementById('viewerContainer'); - container.appendChild(ui); - container.style.right = panelWidth + 'px'; - - // Initialize all the debugging tools. - var tools = this.tools; - var self = this; - for (var i = 0; i < tools.length; ++i) { - var tool = tools[i]; - var panel = document.createElement('div'); - var panelButton = document.createElement('button'); - panelButton.textContent = tool.name; - panelButton.addEventListener('click', (function(selected) { - return function(event) { - event.preventDefault(); - self.selectPanel(selected); - }; - })(i)); - controls.appendChild(panelButton); - panels.appendChild(panel); - tool.panel = panel; - tool.manager = this; - if (tool.enabled) { - tool.init(); - } else { - panel.textContent = tool.name + ' is disabled. To enable add ' + - ' "' + tool.id + '" to the pdfBug parameter ' + - 'and refresh (seperate multiple by commas).'; - } - buttons.push(panelButton); - } - this.selectPanel(0); - }, - cleanup: function cleanup() { - for (var i = 0, ii = this.tools.length; i < ii; i++) { - if (this.tools[i].enabled) { - this.tools[i].cleanup(); - } - } - }, - selectPanel: function selectPanel(index) { - if (typeof index !== 'number') { - index = this.tools.indexOf(index); - } - if (index === activePanel) { - return; - } - activePanel = index; - var tools = this.tools; - for (var j = 0; j < tools.length; ++j) { - if (j === index) { - buttons[j].setAttribute('class', 'active'); - tools[j].active = true; - tools[j].panel.removeAttribute('hidden'); - } else { - buttons[j].setAttribute('class', ''); - tools[j].active = false; - tools[j].panel.setAttribute('hidden', 'true'); - } - } - } - }; -})(); diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-check.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-check.svg deleted file mode 100644 index 71cd16df5..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-check.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-comment.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-comment.svg deleted file mode 100644 index 86f1f1724..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-comment.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-help.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-help.svg deleted file mode 100644 index 00938fefe..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-help.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-insert.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-insert.svg deleted file mode 100644 index 519ef6826..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-insert.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-key.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-key.svg deleted file mode 100644 index 8d09d5378..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-key.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-newparagraph.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-newparagraph.svg deleted file mode 100644 index 38d2497da..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-newparagraph.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-noicon.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-noicon.svg deleted file mode 100644 index c07d10808..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-noicon.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-note.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-note.svg deleted file mode 100644 index 70173651c..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-note.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/annotation-paragraph.svg b/public/plugins/pdfjs-1.4.20/web/images/annotation-paragraph.svg deleted file mode 100644 index 6ae5212b7..000000000 --- a/public/plugins/pdfjs-1.4.20/web/images/annotation-paragraph.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next-rtl.png deleted file mode 100644 index bef02743f..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next-rtl@2x.png deleted file mode 100644 index 1da6dc949..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next.png deleted file mode 100644 index de1d0fc90..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next@2x.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next@2x.png deleted file mode 100644 index 0250307c0..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-next@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous-rtl.png deleted file mode 100644 index de1d0fc90..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous-rtl@2x.png deleted file mode 100644 index 0250307c0..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous.png deleted file mode 100644 index bef02743f..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous@2x.png b/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous@2x.png deleted file mode 100644 index 1da6dc949..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/findbarButton-previous@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/grab.cur b/public/plugins/pdfjs-1.4.20/web/images/grab.cur deleted file mode 100644 index db7ad5aed..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/grab.cur and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/grabbing.cur b/public/plugins/pdfjs-1.4.20/web/images/grabbing.cur deleted file mode 100644 index e0dfd04e4..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/grabbing.cur and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/loading-icon.gif b/public/plugins/pdfjs-1.4.20/web/images/loading-icon.gif deleted file mode 100644 index 1c72ebb55..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/loading-icon.gif and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/loading-small.png b/public/plugins/pdfjs-1.4.20/web/images/loading-small.png deleted file mode 100644 index 8831a8058..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/loading-small.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/loading-small@2x.png b/public/plugins/pdfjs-1.4.20/web/images/loading-small@2x.png deleted file mode 100644 index b25b4452a..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/loading-small@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-documentProperties.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-documentProperties.png deleted file mode 100644 index 40925e25a..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-documentProperties.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-documentProperties@2x.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-documentProperties@2x.png deleted file mode 100644 index adb240eaa..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-documentProperties@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-firstPage.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-firstPage.png deleted file mode 100644 index e68846aa5..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-firstPage.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-firstPage@2x.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-firstPage@2x.png deleted file mode 100644 index 3ad8af517..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-firstPage@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-handTool.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-handTool.png deleted file mode 100644 index cb85a841b..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-handTool.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-handTool@2x.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-handTool@2x.png deleted file mode 100644 index 5c13f77ff..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-handTool@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-lastPage.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-lastPage.png deleted file mode 100644 index be763e0c4..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-lastPage.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-lastPage@2x.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-lastPage@2x.png deleted file mode 100644 index 8570984f2..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-lastPage@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCcw.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCcw.png deleted file mode 100644 index 675d6da2c..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCcw.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCcw@2x.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCcw@2x.png deleted file mode 100644 index b9e743122..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCcw@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCw.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCw.png deleted file mode 100644 index e1c759888..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCw.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCw@2x.png b/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCw@2x.png deleted file mode 100644 index cb257b41c..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/secondaryToolbarButton-rotateCw@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/shadow.png b/public/plugins/pdfjs-1.4.20/web/images/shadow.png deleted file mode 100644 index 31d3bdb14..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/shadow.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/texture.png b/public/plugins/pdfjs-1.4.20/web/images/texture.png deleted file mode 100644 index eb5ccb5ec..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/texture.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-bookmark.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-bookmark.png deleted file mode 100644 index a187be6c9..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-bookmark.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-bookmark@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-bookmark@2x.png deleted file mode 100644 index 4efbaa675..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-bookmark@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-download.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-download.png deleted file mode 100644 index eaab35f09..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-download.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-download@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-download@2x.png deleted file mode 100644 index 896face45..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-download@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-menuArrows.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-menuArrows.png deleted file mode 100644 index 306eb43b8..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-menuArrows.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-menuArrows@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-menuArrows@2x.png deleted file mode 100644 index f7570bc0d..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-menuArrows@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-openFile.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-openFile.png deleted file mode 100644 index b5cf1bd06..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-openFile.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-openFile@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-openFile@2x.png deleted file mode 100644 index 91ab76593..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-openFile@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown-rtl.png deleted file mode 100644 index 1957f79ab..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown-rtl@2x.png deleted file mode 100644 index 16ebcb8ef..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown.png deleted file mode 100644 index 8219ecf83..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown@2x.png deleted file mode 100644 index 758c01d83..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageDown@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp-rtl.png deleted file mode 100644 index 98e7ce481..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp-rtl@2x.png deleted file mode 100644 index a01b02380..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp.png deleted file mode 100644 index fb9daa337..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp@2x.png deleted file mode 100644 index a5cfd755b..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-pageUp@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-presentationMode.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-presentationMode.png deleted file mode 100644 index 3ac21244d..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-presentationMode.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-presentationMode@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-presentationMode@2x.png deleted file mode 100644 index cada9e791..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-presentationMode@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-print.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-print.png deleted file mode 100644 index 51275e54b..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-print.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-print@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-print@2x.png deleted file mode 100644 index 53d18daf7..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-print@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-search.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-search.png deleted file mode 100644 index f9b75579b..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-search.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-search@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-search@2x.png deleted file mode 100644 index 456b13324..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-search@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle-rtl.png deleted file mode 100644 index 843709527..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png deleted file mode 100644 index 9d9bfa4f6..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle.png deleted file mode 100644 index 1f90f83da..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle@2x.png deleted file mode 100644 index b066fe5cb..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-secondaryToolbarToggle@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle-rtl.png deleted file mode 100644 index 6f85ec061..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle-rtl@2x.png deleted file mode 100644 index 291e00679..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle.png deleted file mode 100644 index 025dc9040..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle@2x.png deleted file mode 100644 index 7f834df94..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-sidebarToggle@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewAttachments.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewAttachments.png deleted file mode 100644 index fcd0b268a..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewAttachments.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewAttachments@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewAttachments@2x.png deleted file mode 100644 index b979e523e..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewAttachments@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline-rtl.png deleted file mode 100644 index aaa943021..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline-rtl@2x.png deleted file mode 100644 index 3410f70df..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline.png deleted file mode 100644 index 976365a50..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline@2x.png deleted file mode 100644 index b6a197fdf..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewOutline@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewThumbnail.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewThumbnail.png deleted file mode 100644 index 584ba5588..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewThumbnail.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewThumbnail@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewThumbnail@2x.png deleted file mode 100644 index fb7db9383..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-viewThumbnail@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomIn.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomIn.png deleted file mode 100644 index 513d081bc..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomIn.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomIn@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomIn@2x.png deleted file mode 100644 index d5d49d5ff..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomIn@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomOut.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomOut.png deleted file mode 100644 index 156c26b94..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomOut.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomOut@2x.png b/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomOut@2x.png deleted file mode 100644 index 959e1919d..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/toolbarButton-zoomOut@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed-rtl.png b/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed-rtl.png deleted file mode 100644 index 1c8b9f701..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed-rtl.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed-rtl@2x.png b/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed-rtl@2x.png deleted file mode 100644 index 84279368d..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed-rtl@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed.png b/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed.png deleted file mode 100644 index 06d4d3769..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed@2x.png b/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed@2x.png deleted file mode 100644 index eec1e58c1..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/treeitem-collapsed@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/treeitem-expanded.png b/public/plugins/pdfjs-1.4.20/web/images/treeitem-expanded.png deleted file mode 100644 index c8d557351..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/treeitem-expanded.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/images/treeitem-expanded@2x.png b/public/plugins/pdfjs-1.4.20/web/images/treeitem-expanded@2x.png deleted file mode 100644 index 3b3b6103b..000000000 Binary files a/public/plugins/pdfjs-1.4.20/web/images/treeitem-expanded@2x.png and /dev/null differ diff --git a/public/plugins/pdfjs-1.4.20/web/viewer.css b/public/plugins/pdfjs-1.4.20/web/viewer.css deleted file mode 100644 index da2cf6533..000000000 --- a/public/plugins/pdfjs-1.4.20/web/viewer.css +++ /dev/null @@ -1,2122 +0,0 @@ -/* Copyright 2014 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.textLayer { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - overflow: hidden; - opacity: 0.2; - line-height: 1.0; -} - -.textLayer > div { - color: transparent; - position: absolute; - white-space: pre; - cursor: text; - -webkit-transform-origin: 0% 0%; - -moz-transform-origin: 0% 0%; - -o-transform-origin: 0% 0%; - -ms-transform-origin: 0% 0%; - transform-origin: 0% 0%; -} - -.textLayer .highlight { - margin: -1px; - padding: 1px; - - background-color: rgb(180, 0, 170); - border-radius: 4px; -} - -.textLayer .highlight.begin { - border-radius: 4px 0px 0px 4px; -} - -.textLayer .highlight.end { - border-radius: 0px 4px 4px 0px; -} - -.textLayer .highlight.middle { - border-radius: 0px; -} - -.textLayer .highlight.selected { - background-color: rgb(0, 100, 0); -} - -.textLayer ::selection { background: rgb(0,0,255); } -.textLayer ::-moz-selection { background: rgb(0,0,255); } - -.textLayer .endOfContent { - display: block; - position: absolute; - left: 0px; - top: 100%; - right: 0px; - bottom: 0px; - z-index: -1; - cursor: default; - -webkit-user-select: none; - -ms-user-select: none; - -moz-user-select: none; -} - -.textLayer .endOfContent.active { - top: 0px; -} - - -.annotationLayer section { - position: absolute; -} - -.annotationLayer .linkAnnotation > a { - position: absolute; - font-size: 1em; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.annotationLayer .linkAnnotation > a /* -ms-a */ { - background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7") 0 0 repeat; -} - -.annotationLayer .linkAnnotation > a:hover { - opacity: 0.2; - background: #ff0; - box-shadow: 0px 2px 10px #ff0; -} - -.annotationLayer .textAnnotation img { - position: absolute; - cursor: pointer; -} - -.annotationLayer .popupWrapper { - position: absolute; - width: 20em; -} - -.annotationLayer .popup { - position: absolute; - z-index: 200; - max-width: 20em; - background-color: #FFFF99; - box-shadow: 0px 2px 5px #333; - border-radius: 2px; - padding: 0.6em; - margin-left: 5px; - cursor: pointer; - word-wrap: break-word; -} - -.annotationLayer .popup h1 { - font-size: 1em; - border-bottom: 1px solid #000000; - padding-bottom: 0.2em; -} - -.annotationLayer .popup p { - padding-top: 0.2em; -} - -.annotationLayer .highlightAnnotation, -.annotationLayer .underlineAnnotation, -.annotationLayer .squigglyAnnotation, -.annotationLayer .strikeoutAnnotation { - cursor: pointer; -} - -.pdfViewer .canvasWrapper { - overflow: hidden; -} - -.pdfViewer .page { - direction: ltr; - width: 816px; - height: 1056px; - margin: 1px auto -8px auto; - position: relative; - overflow: visible; - border: 9px solid transparent; - background-clip: content-box; - border-image: url(images/shadow.png) 9 9 repeat; - background-color: white; -} - -.pdfViewer.removePageBorders .page { - margin: 0px auto 10px auto; - border: none; -} - -.pdfViewer .page canvas { - margin: 0; - display: block; -} - -.pdfViewer .page .loadingIcon { - position: absolute; - display: block; - left: 0; - top: 0; - right: 0; - bottom: 0; - background: url('images/loading-icon.gif') center no-repeat; -} - -.pdfPresentationMode:-webkit-full-screen .pdfViewer .page { - margin-bottom: 100%; - border: 0; -} - -.pdfPresentationMode:-moz-full-screen .pdfViewer .page { - margin-bottom: 100%; - border: 0; -} - -.pdfPresentationMode:-ms-fullscreen .pdfViewer .page { - margin-bottom: 100% !important; - border: 0; -} - -.pdfPresentationMode:fullscreen .pdfViewer .page { - margin-bottom: 100%; - border: 0; -} - -* { - padding: 0; - margin: 0; -} - -html { - height: 100%; - /* Font size is needed to make the activity bar the correct size. */ - font-size: 10px; -} - -body { - height: 100%; - background-color: #404040; - background-image: url(images/texture.png); -} - -body, -input, -button, -select { - font: message-box; - outline: none; -} - -.hidden { - display: none !important; -} -[hidden] { - display: none !important; -} - -#viewerContainer.pdfPresentationMode:-webkit-full-screen { - top: 0px; - border-top: 2px solid transparent; - background-color: #000; - width: 100%; - height: 100%; - overflow: hidden; - cursor: none; - -webkit-user-select: none; -} - -#viewerContainer.pdfPresentationMode:-moz-full-screen { - top: 0px; - border-top: 2px solid transparent; - background-color: #000; - width: 100%; - height: 100%; - overflow: hidden; - cursor: none; - -moz-user-select: none; -} - -#viewerContainer.pdfPresentationMode:-ms-fullscreen { - top: 0px !important; - border-top: 2px solid transparent; - width: 100%; - height: 100%; - overflow: hidden !important; - cursor: none; - -ms-user-select: none; -} - -#viewerContainer.pdfPresentationMode:-ms-fullscreen::-ms-backdrop { - background-color: #000; -} - -#viewerContainer.pdfPresentationMode:fullscreen { - top: 0px; - border-top: 2px solid transparent; - background-color: #000; - width: 100%; - height: 100%; - overflow: hidden; - cursor: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; -} - -.pdfPresentationMode:-webkit-full-screen a:not(.internalLink) { - display: none; -} - -.pdfPresentationMode:-moz-full-screen a:not(.internalLink) { - display: none; -} - -.pdfPresentationMode:-ms-fullscreen a:not(.internalLink) { - display: none !important; -} - -.pdfPresentationMode:fullscreen a:not(.internalLink) { - display: none; -} - -.pdfPresentationMode:-webkit-full-screen .textLayer > div { - cursor: none; -} - -.pdfPresentationMode:-moz-full-screen .textLayer > div { - cursor: none; -} - -.pdfPresentationMode:-ms-fullscreen .textLayer > div { - cursor: none; -} - -.pdfPresentationMode:fullscreen .textLayer > div { - cursor: none; -} - -.pdfPresentationMode.pdfPresentationModeControls > *, -.pdfPresentationMode.pdfPresentationModeControls .textLayer > div { - cursor: default; -} - -/* outer/inner center provides horizontal center */ -.outerCenter { - pointer-events: none; - position: relative; -} -html[dir='ltr'] .outerCenter { - float: right; - right: 50%; -} -html[dir='rtl'] .outerCenter { - float: left; - left: 50%; -} -.innerCenter { - pointer-events: auto; - position: relative; -} -html[dir='ltr'] .innerCenter { - float: right; - right: -50%; -} -html[dir='rtl'] .innerCenter { - float: left; - left: -50%; -} - -#outerContainer { - width: 100%; - height: 100%; - position: relative; -} - -#sidebarContainer { - position: absolute; - top: 0; - bottom: 0; - width: 200px; - visibility: hidden; - -webkit-transition-duration: 200ms; - -webkit-transition-timing-function: ease; - transition-duration: 200ms; - transition-timing-function: ease; - -} -html[dir='ltr'] #sidebarContainer { - -webkit-transition-property: left; - transition-property: left; - left: -200px; -} -html[dir='rtl'] #sidebarContainer { - -webkit-transition-property: right; - transition-property: right; - right: -200px; -} - -#outerContainer.sidebarMoving > #sidebarContainer, -#outerContainer.sidebarOpen > #sidebarContainer { - visibility: visible; -} -html[dir='ltr'] #outerContainer.sidebarOpen > #sidebarContainer { - left: 0px; -} -html[dir='rtl'] #outerContainer.sidebarOpen > #sidebarContainer { - right: 0px; -} - -#mainContainer { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - min-width: 320px; - -webkit-transition-duration: 200ms; - -webkit-transition-timing-function: ease; - transition-duration: 200ms; - transition-timing-function: ease; -} -html[dir='ltr'] #outerContainer.sidebarOpen > #mainContainer { - -webkit-transition-property: left; - transition-property: left; - left: 200px; -} -html[dir='rtl'] #outerContainer.sidebarOpen > #mainContainer { - -webkit-transition-property: right; - transition-property: right; - right: 200px; -} - -#sidebarContent { - top: 32px; - bottom: 0; - overflow: auto; - -webkit-overflow-scrolling: touch; - position: absolute; - width: 200px; - background-color: hsla(0,0%,0%,.1); -} -html[dir='ltr'] #sidebarContent { - left: 0; - box-shadow: inset -1px 0 0 hsla(0,0%,0%,.25); -} -html[dir='rtl'] #sidebarContent { - right: 0; - box-shadow: inset 1px 0 0 hsla(0,0%,0%,.25); -} - -#viewerContainer { - overflow: auto; - -webkit-overflow-scrolling: touch; - position: absolute; - top: 32px; - right: 0; - bottom: 0; - left: 0; - outline: none; -} -html[dir='ltr'] #viewerContainer { - box-shadow: inset 1px 0 0 hsla(0,0%,100%,.05); -} -html[dir='rtl'] #viewerContainer { - box-shadow: inset -1px 0 0 hsla(0,0%,100%,.05); -} - -.toolbar { - position: relative; - left: 0; - right: 0; - z-index: 9999; - cursor: default; -} - -#toolbarContainer { - width: 100%; -} - -#toolbarSidebar { - width: 200px; - height: 32px; - background-color: #424242; /* fallback */ - background-image: url(images/texture.png), - linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); -} -html[dir='ltr'] #toolbarSidebar { - box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), - inset 0 -1px 0 hsla(0,0%,100%,.05), - 0 1px 0 hsla(0,0%,0%,.15), - 0 0 1px hsla(0,0%,0%,.1); -} -html[dir='rtl'] #toolbarSidebar { - box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25), - inset 0 1px 0 hsla(0,0%,100%,.05), - 0 1px 0 hsla(0,0%,0%,.15), - 0 0 1px hsla(0,0%,0%,.1); -} - -#toolbarContainer, .findbar, .secondaryToolbar { - position: relative; - height: 32px; - background-color: #474747; /* fallback */ - background-image: url(images/texture.png), - linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); -} -html[dir='ltr'] #toolbarContainer, .findbar, .secondaryToolbar { - box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08), - inset 0 1px 1px hsla(0,0%,0%,.15), - inset 0 -1px 0 hsla(0,0%,100%,.05), - 0 1px 0 hsla(0,0%,0%,.15), - 0 1px 1px hsla(0,0%,0%,.1); -} -html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { - box-shadow: inset -1px 0 0 hsla(0,0%,100%,.08), - inset 0 1px 1px hsla(0,0%,0%,.15), - inset 0 -1px 0 hsla(0,0%,100%,.05), - 0 1px 0 hsla(0,0%,0%,.15), - 0 1px 1px hsla(0,0%,0%,.1); -} - -#toolbarViewer { - height: 32px; -} - -#loadingBar { - position: relative; - width: 100%; - height: 4px; - background-color: #333; - border-bottom: 1px solid #333; -} - -#loadingBar .progress { - position: absolute; - top: 0; - left: 0; - width: 0%; - height: 100%; - background-color: #ddd; - overflow: hidden; - -webkit-transition: width 200ms; - transition: width 200ms; -} - -@-webkit-keyframes progressIndeterminate { - 0% { left: -142px; } - 100% { left: 0; } -} - -@keyframes progressIndeterminate { - 0% { left: -142px; } - 100% { left: 0; } -} - -#loadingBar .progress.indeterminate { - background-color: #999; - -webkit-transition: none; - transition: none; -} - -#loadingBar .progress.indeterminate .glimmer { - position: absolute; - top: 0; - left: 0; - height: 100%; - width: calc(100% + 150px); - - background: repeating-linear-gradient(135deg, - #bbb 0, #999 5px, - #999 45px, #ddd 55px, - #ddd 95px, #bbb 100px); - - -webkit-animation: progressIndeterminate 950ms linear infinite; - animation: progressIndeterminate 950ms linear infinite; -} - -.findbar, .secondaryToolbar { - top: 32px; - position: absolute; - z-index: 10000; - height: 32px; - - min-width: 16px; - padding: 0px 6px 0px 6px; - margin: 4px 2px 4px 2px; - color: hsl(0,0%,85%); - font-size: 12px; - line-height: 14px; - text-align: left; - cursor: default; -} - -html[dir='ltr'] .findbar { - left: 68px; -} - -html[dir='rtl'] .findbar { - right: 68px; -} - -.findbar label { - -webkit-user-select: none; - -moz-user-select: none; -} - -#findInput[data-status="pending"] { - background-image: url(images/loading-small.png); - background-repeat: no-repeat; - background-position: right; -} -html[dir='rtl'] #findInput[data-status="pending"] { - background-position: left; -} - -.secondaryToolbar { - padding: 6px; - height: auto; - z-index: 30000; -} -html[dir='ltr'] .secondaryToolbar { - right: 4px; -} -html[dir='rtl'] .secondaryToolbar { - left: 4px; -} - -#secondaryToolbarButtonContainer { - max-width: 200px; - max-height: 400px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - margin-bottom: -4px; -} - -.doorHanger, -.doorHangerRight { - border: 1px solid hsla(0,0%,0%,.5); - border-radius: 2px; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); -} -.doorHanger:after, .doorHanger:before, -.doorHangerRight:after, .doorHangerRight:before { - bottom: 100%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.doorHanger:after, -.doorHangerRight:after { - border-bottom-color: hsla(0,0%,32%,.99); - border-width: 8px; -} -.doorHanger:before, -.doorHangerRight:before { - border-bottom-color: hsla(0,0%,0%,.5); - border-width: 9px; -} - -html[dir='ltr'] .doorHanger:after, -html[dir='rtl'] .doorHangerRight:after { - left: 13px; - margin-left: -8px; -} - -html[dir='ltr'] .doorHanger:before, -html[dir='rtl'] .doorHangerRight:before { - left: 13px; - margin-left: -9px; -} - -html[dir='rtl'] .doorHanger:after, -html[dir='ltr'] .doorHangerRight:after { - right: 13px; - margin-right: -8px; -} - -html[dir='rtl'] .doorHanger:before, -html[dir='ltr'] .doorHangerRight:before { - right: 13px; - margin-right: -9px; -} - -#findResultsCount { - background-color: hsl(0, 0%, 85%); - color: hsl(0, 0%, 32%); - text-align: center; - padding: 3px 4px; -} - -#findMsg { - font-style: italic; - color: #A6B7D0; -} - -#findInput.notFound { - background-color: rgb(255, 102, 102); -} - -html[dir='ltr'] #toolbarViewerLeft { - margin-left: -1px; -} -html[dir='rtl'] #toolbarViewerRight { - margin-right: -1px; -} - -html[dir='ltr'] #toolbarViewerLeft, -html[dir='rtl'] #toolbarViewerRight { - position: absolute; - top: 0; - left: 0; -} -html[dir='ltr'] #toolbarViewerRight, -html[dir='rtl'] #toolbarViewerLeft { - position: absolute; - top: 0; - right: 0; -} -html[dir='ltr'] #toolbarViewerLeft > *, -html[dir='ltr'] #toolbarViewerMiddle > *, -html[dir='ltr'] #toolbarViewerRight > *, -html[dir='ltr'] .findbar > * { - position: relative; - float: left; -} -html[dir='rtl'] #toolbarViewerLeft > *, -html[dir='rtl'] #toolbarViewerMiddle > *, -html[dir='rtl'] #toolbarViewerRight > *, -html[dir='rtl'] .findbar > * { - position: relative; - float: right; -} - -html[dir='ltr'] .splitToolbarButton { - margin: 3px 2px 4px 0; - display: inline-block; -} -html[dir='rtl'] .splitToolbarButton { - margin: 3px 0 4px 2px; - display: inline-block; -} -html[dir='ltr'] .splitToolbarButton > .toolbarButton { - border-radius: 0; - float: left; -} -html[dir='rtl'] .splitToolbarButton > .toolbarButton { - border-radius: 0; - float: right; -} - -.toolbarButton, -.secondaryToolbarButton, -.overlayButton { - border: 0 none; - background: none; - width: 32px; - height: 25px; -} - -.toolbarButton > span { - display: inline-block; - width: 0; - height: 0; - overflow: hidden; -} - -.toolbarButton[disabled], -.secondaryToolbarButton[disabled], -.overlayButton[disabled] { - opacity: .5; -} - -.toolbarButton.group { - margin-right: 0; -} - -.splitToolbarButton.toggled .toolbarButton { - margin: 0; -} - -.splitToolbarButton:hover > .toolbarButton, -.splitToolbarButton:focus > .toolbarButton, -.splitToolbarButton.toggled > .toolbarButton, -.toolbarButton.textButton { - background-color: hsla(0,0%,0%,.12); - background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-clip: padding-box; - border: 1px solid hsla(0,0%,0%,.35); - border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); - box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, - 0 0 1px hsla(0,0%,100%,.15) inset, - 0 1px 0 hsla(0,0%,100%,.05); - -webkit-transition-property: background-color, border-color, box-shadow; - -webkit-transition-duration: 150ms; - -webkit-transition-timing-function: ease; - transition-property: background-color, border-color, box-shadow; - transition-duration: 150ms; - transition-timing-function: ease; - -} -.splitToolbarButton > .toolbarButton:hover, -.splitToolbarButton > .toolbarButton:focus, -.dropdownToolbarButton:hover, -.overlayButton:hover, -.overlayButton:focus, -.toolbarButton.textButton:hover, -.toolbarButton.textButton:focus { - background-color: hsla(0,0%,0%,.2); - box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, - 0 0 1px hsla(0,0%,100%,.15) inset, - 0 0 1px hsla(0,0%,0%,.05); - z-index: 199; -} -.splitToolbarButton > .toolbarButton { - position: relative; -} -html[dir='ltr'] .splitToolbarButton > .toolbarButton:first-child, -html[dir='rtl'] .splitToolbarButton > .toolbarButton:last-child { - position: relative; - margin: 0; - margin-right: -1px; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; - border-right-color: transparent; -} -html[dir='ltr'] .splitToolbarButton > .toolbarButton:last-child, -html[dir='rtl'] .splitToolbarButton > .toolbarButton:first-child { - position: relative; - margin: 0; - margin-left: -1px; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-left-color: transparent; -} -.splitToolbarButtonSeparator { - padding: 8px 0; - width: 1px; - background-color: hsla(0,0%,0%,.5); - z-index: 99; - box-shadow: 0 0 0 1px hsla(0,0%,100%,.08); - display: inline-block; - margin: 5px 0; -} -html[dir='ltr'] .splitToolbarButtonSeparator { - float: left; -} -html[dir='rtl'] .splitToolbarButtonSeparator { - float: right; -} -.splitToolbarButton:hover > .splitToolbarButtonSeparator, -.splitToolbarButton.toggled > .splitToolbarButtonSeparator { - padding: 12px 0; - margin: 1px 0; - box-shadow: 0 0 0 1px hsla(0,0%,100%,.03); - -webkit-transition-property: padding; - -webkit-transition-duration: 10ms; - -webkit-transition-timing-function: ease; - transition-property: padding; - transition-duration: 10ms; - transition-timing-function: ease; -} - -.toolbarButton, -.dropdownToolbarButton, -.secondaryToolbarButton, -.overlayButton { - min-width: 16px; - padding: 2px 6px 0; - border: 1px solid transparent; - border-radius: 2px; - color: hsla(0,0%,100%,.8); - font-size: 12px; - line-height: 14px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - /* Opera does not support user-select, use <... unselectable="on"> instead */ - cursor: default; - -webkit-transition-property: background-color, border-color, box-shadow; - -webkit-transition-duration: 150ms; - -webkit-transition-timing-function: ease; - transition-property: background-color, border-color, box-shadow; - transition-duration: 150ms; - transition-timing-function: ease; -} - -html[dir='ltr'] .toolbarButton, -html[dir='ltr'] .overlayButton, -html[dir='ltr'] .dropdownToolbarButton { - margin: 3px 2px 4px 0; -} -html[dir='rtl'] .toolbarButton, -html[dir='rtl'] .overlayButton, -html[dir='rtl'] .dropdownToolbarButton { - margin: 3px 0 4px 2px; -} - -.toolbarButton:hover, -.toolbarButton:focus, -.dropdownToolbarButton, -.overlayButton, -.secondaryToolbarButton:hover, -.secondaryToolbarButton:focus { - background-color: hsla(0,0%,0%,.12); - background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-clip: padding-box; - border: 1px solid hsla(0,0%,0%,.35); - border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); - box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, - 0 0 1px hsla(0,0%,100%,.15) inset, - 0 1px 0 hsla(0,0%,100%,.05); -} - -.toolbarButton:hover:active, -.overlayButton:hover:active, -.dropdownToolbarButton:hover:active, -.secondaryToolbarButton:hover:active { - background-color: hsla(0,0%,0%,.2); - background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45); - box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, - 0 0 1px hsla(0,0%,0%,.2) inset, - 0 1px 0 hsla(0,0%,100%,.05); - -webkit-transition-property: background-color, border-color, box-shadow; - -webkit-transition-duration: 10ms; - -webkit-transition-timing-function: linear; - transition-property: background-color, border-color, box-shadow; - transition-duration: 10ms; - transition-timing-function: linear; -} - -.toolbarButton.toggled, -.splitToolbarButton.toggled > .toolbarButton.toggled, -.secondaryToolbarButton.toggled { - background-color: hsla(0,0%,0%,.3); - background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.45) hsla(0,0%,0%,.5); - box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, - 0 0 1px hsla(0,0%,0%,.2) inset, - 0 1px 0 hsla(0,0%,100%,.05); - -webkit-transition-property: background-color, border-color, box-shadow; - -webkit-transition-duration: 10ms; - -webkit-transition-timing-function: linear; - transition-property: background-color, border-color, box-shadow; - transition-duration: 10ms; - transition-timing-function: linear; -} - -.toolbarButton.toggled:hover:active, -.splitToolbarButton.toggled > .toolbarButton.toggled:hover:active, -.secondaryToolbarButton.toggled:hover:active { - background-color: hsla(0,0%,0%,.4); - border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.5) hsla(0,0%,0%,.55); - box-shadow: 0 1px 1px hsla(0,0%,0%,.2) inset, - 0 0 1px hsla(0,0%,0%,.3) inset, - 0 1px 0 hsla(0,0%,100%,.05); -} - -.dropdownToolbarButton { - width: 120px; - max-width: 120px; - padding: 0; - overflow: hidden; - background: url(images/toolbarButton-menuArrows.png) no-repeat; -} -html[dir='ltr'] .dropdownToolbarButton { - background-position: 95%; -} -html[dir='rtl'] .dropdownToolbarButton { - background-position: 5%; -} - -.dropdownToolbarButton > select { - min-width: 140px; - font-size: 12px; - color: hsl(0,0%,95%); - margin: 0; - padding: 3px 2px 2px; - border: none; - background: rgba(0,0,0,0); /* Opera does not support 'transparent' -
    - -
    - -
    - - - - - - -
    - - - -
    -
    -
    -
    - -
    - -
    - -
    - -
    - - - -
    -
    - - - - - - - - - Current View - - -
    - - -
    -
    -
    -
    - -
    - -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - - diff --git a/public/plugins/pdfjs-1.4.20/web/viewer.js b/public/plugins/pdfjs-1.4.20/web/viewer.js deleted file mode 100644 index 1fc9d7bfe..000000000 --- a/public/plugins/pdfjs-1.4.20/web/viewer.js +++ /dev/null @@ -1,7952 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals PDFJS, PDFBug, FirefoxCom, Stats, ProgressBar, - DownloadManager, getFileName, getPDFFileNameFromURL, - PDFHistory, Preferences, SidebarView, ViewHistory, Stats, - PDFThumbnailViewer, URL, noContextMenuHandler, SecondaryToolbar, - PasswordPrompt, PDFPresentationMode, PDFDocumentProperties, HandTool, - Promise, PDFLinkService, PDFOutlineView, PDFAttachmentView, - OverlayManager, PDFFindController, PDFFindBar, PDFViewer, - PDFRenderingQueue, PresentationModeState, parseQueryString, - RenderingStates, UNKNOWN_SCALE, DEFAULT_SCALE_VALUE, - IGNORE_CURRENT_POSITION_ON_ZOOM: true */ - -'use strict'; - -var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf'; -var DEFAULT_SCALE_DELTA = 1.1; -var MIN_SCALE = 0.25; -var MAX_SCALE = 10.0; -var SCALE_SELECT_CONTAINER_PADDING = 8; -var SCALE_SELECT_PADDING = 22; -var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading'; -var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; - -function configure(PDFJS) { - PDFJS.imageResourcesPath = './images/'; - PDFJS.workerSrc = '../build/pdf.worker.js'; -} - -var CSS_UNITS = 96.0 / 72.0; -var DEFAULT_SCALE_VALUE = 'auto'; -var DEFAULT_SCALE = 1.0; -var UNKNOWN_SCALE = 0; -var MAX_AUTO_SCALE = 1.25; -var SCROLLBAR_PADDING = 40; -var VERTICAL_PADDING = 5; - -function getFileName(url) { - var anchor = url.indexOf('#'); - var query = url.indexOf('?'); - var end = Math.min( - anchor > 0 ? anchor : url.length, - query > 0 ? query : url.length); - return url.substring(url.lastIndexOf('/', end) + 1, end); -} - -/** - * Returns scale factor for the canvas. It makes sense for the HiDPI displays. - * @return {Object} The object with horizontal (sx) and vertical (sy) - scales. The scaled property is set to false if scaling is - not required, true otherwise. - */ -function getOutputScale(ctx) { - var devicePixelRatio = window.devicePixelRatio || 1; - var backingStoreRatio = ctx.webkitBackingStorePixelRatio || - ctx.mozBackingStorePixelRatio || - ctx.msBackingStorePixelRatio || - ctx.oBackingStorePixelRatio || - ctx.backingStorePixelRatio || 1; - var pixelRatio = devicePixelRatio / backingStoreRatio; - return { - sx: pixelRatio, - sy: pixelRatio, - scaled: pixelRatio !== 1 - }; -} - -/** - * Scrolls specified element into view of its parent. - * @param {Object} element - The element to be visible. - * @param {Object} spot - An object with optional top and left properties, - * specifying the offset from the top left edge. - * @param {boolean} skipOverflowHiddenElements - Ignore elements that have - * the CSS rule `overflow: hidden;` set. The default is false. - */ -function scrollIntoView(element, spot, skipOverflowHiddenElements) { - // Assuming offsetParent is available (it's not available when viewer is in - // hidden iframe or object). We have to scroll: if the offsetParent is not set - // producing the error. See also animationStartedClosure. - var parent = element.offsetParent; - if (!parent) { - console.error('offsetParent is not set -- cannot scroll'); - return; - } - var checkOverflow = skipOverflowHiddenElements || false; - var offsetY = element.offsetTop + element.clientTop; - var offsetX = element.offsetLeft + element.clientLeft; - while (parent.clientHeight === parent.scrollHeight || - (checkOverflow && getComputedStyle(parent).overflow === 'hidden')) { - if (parent.dataset._scaleY) { - offsetY /= parent.dataset._scaleY; - offsetX /= parent.dataset._scaleX; - } - offsetY += parent.offsetTop; - offsetX += parent.offsetLeft; - parent = parent.offsetParent; - if (!parent) { - return; // no need to scroll - } - } - if (spot) { - if (spot.top !== undefined) { - offsetY += spot.top; - } - if (spot.left !== undefined) { - offsetX += spot.left; - parent.scrollLeft = offsetX; - } - } - parent.scrollTop = offsetY; -} - -/** - * Helper function to start monitoring the scroll event and converting them into - * PDF.js friendly one: with scroll debounce and scroll direction. - */ -function watchScroll(viewAreaElement, callback) { - var debounceScroll = function debounceScroll(evt) { - if (rAF) { - return; - } - // schedule an invocation of scroll for next animation frame. - rAF = window.requestAnimationFrame(function viewAreaElementScrolled() { - rAF = null; - - var currentY = viewAreaElement.scrollTop; - var lastY = state.lastY; - if (currentY !== lastY) { - state.down = currentY > lastY; - } - state.lastY = currentY; - callback(state); - }); - }; - - var state = { - down: true, - lastY: viewAreaElement.scrollTop, - _eventHandler: debounceScroll - }; - - var rAF = null; - viewAreaElement.addEventListener('scroll', debounceScroll, true); - return state; -} - -/** - * Helper function to parse query string (e.g. ?param1=value&parm2=...). - */ -function parseQueryString(query) { - var parts = query.split('&'); - var params = {}; - for (var i = 0, ii = parts.length; i < ii; ++i) { - var param = parts[i].split('='); - var key = param[0].toLowerCase(); - var value = param.length > 1 ? param[1] : null; - params[decodeURIComponent(key)] = decodeURIComponent(value); - } - return params; -} - -/** - * Use binary search to find the index of the first item in a given array which - * passes a given condition. The items are expected to be sorted in the sense - * that if the condition is true for one item in the array, then it is also true - * for all following items. - * - * @returns {Number} Index of the first array element to pass the test, - * or |items.length| if no such element exists. - */ -function binarySearchFirstItem(items, condition) { - var minIndex = 0; - var maxIndex = items.length - 1; - - if (items.length === 0 || !condition(items[maxIndex])) { - return items.length; - } - if (condition(items[minIndex])) { - return minIndex; - } - - while (minIndex < maxIndex) { - var currentIndex = (minIndex + maxIndex) >> 1; - var currentItem = items[currentIndex]; - if (condition(currentItem)) { - maxIndex = currentIndex; - } else { - minIndex = currentIndex + 1; - } - } - return minIndex; /* === maxIndex */ -} - -/** - * Approximates float number as a fraction using Farey sequence (max order - * of 8). - * @param {number} x - Positive float number. - * @returns {Array} Estimated fraction: the first array item is a numerator, - * the second one is a denominator. - */ -function approximateFraction(x) { - // Fast paths for int numbers or their inversions. - if (Math.floor(x) === x) { - return [x, 1]; - } - var xinv = 1 / x; - var limit = 8; - if (xinv > limit) { - return [1, limit]; - } else if (Math.floor(xinv) === xinv) { - return [1, xinv]; - } - - var x_ = x > 1 ? xinv : x; - // a/b and c/d are neighbours in Farey sequence. - var a = 0, b = 1, c = 1, d = 1; - // Limiting search to order 8. - while (true) { - // Generating next term in sequence (order of q). - var p = a + c, q = b + d; - if (q > limit) { - break; - } - if (x_ <= p / q) { - c = p; d = q; - } else { - a = p; b = q; - } - } - // Select closest of the neighbours to x. - if (x_ - a / b < c / d - x_) { - return x_ === x ? [a, b] : [b, a]; - } else { - return x_ === x ? [c, d] : [d, c]; - } -} - -function roundToDivide(x, div) { - var r = x % div; - return r === 0 ? x : Math.round(x - r + div); -} - -/** - * Generic helper to find out what elements are visible within a scroll pane. - */ -function getVisibleElements(scrollEl, views, sortByVisibility) { - var top = scrollEl.scrollTop, bottom = top + scrollEl.clientHeight; - var left = scrollEl.scrollLeft, right = left + scrollEl.clientWidth; - - function isElementBottomBelowViewTop(view) { - var element = view.div; - var elementBottom = - element.offsetTop + element.clientTop + element.clientHeight; - return elementBottom > top; - } - - var visible = [], view, element; - var currentHeight, viewHeight, hiddenHeight, percentHeight; - var currentWidth, viewWidth; - var firstVisibleElementInd = (views.length === 0) ? 0 : - binarySearchFirstItem(views, isElementBottomBelowViewTop); - - for (var i = firstVisibleElementInd, ii = views.length; i < ii; i++) { - view = views[i]; - element = view.div; - currentHeight = element.offsetTop + element.clientTop; - viewHeight = element.clientHeight; - - if (currentHeight > bottom) { - break; - } - - currentWidth = element.offsetLeft + element.clientLeft; - viewWidth = element.clientWidth; - if (currentWidth + viewWidth < left || currentWidth > right) { - continue; - } - hiddenHeight = Math.max(0, top - currentHeight) + - Math.max(0, currentHeight + viewHeight - bottom); - percentHeight = ((viewHeight - hiddenHeight) * 100 / viewHeight) | 0; - - visible.push({ - id: view.id, - x: currentWidth, - y: currentHeight, - view: view, - percent: percentHeight - }); - } - - var first = visible[0]; - var last = visible[visible.length - 1]; - - if (sortByVisibility) { - visible.sort(function(a, b) { - var pc = a.percent - b.percent; - if (Math.abs(pc) > 0.001) { - return -pc; - } - return a.id - b.id; // ensure stability - }); - } - return {first: first, last: last, views: visible}; -} - -/** - * Event handler to suppress context menu. - */ -function noContextMenuHandler(e) { - e.preventDefault(); -} - -/** - * Returns the filename or guessed filename from the url (see issue 3455). - * url {String} The original PDF location. - * @return {String} Guessed PDF file name. - */ -function getPDFFileNameFromURL(url) { - var reURI = /^(?:([^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; - // SCHEME HOST 1.PATH 2.QUERY 3.REF - // Pattern to get last matching NAME.pdf - var reFilename = /[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i; - var splitURI = reURI.exec(url); - var suggestedFilename = reFilename.exec(splitURI[1]) || - reFilename.exec(splitURI[2]) || - reFilename.exec(splitURI[3]); - if (suggestedFilename) { - suggestedFilename = suggestedFilename[0]; - if (suggestedFilename.indexOf('%') !== -1) { - // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf - try { - suggestedFilename = - reFilename.exec(decodeURIComponent(suggestedFilename))[0]; - } catch(e) { // Possible (extremely rare) errors: - // URIError "Malformed URI", e.g. for "%AA.pdf" - // TypeError "null has no properties", e.g. for "%2F.pdf" - } - } - } - return suggestedFilename || 'document.pdf'; -} - -var ProgressBar = (function ProgressBarClosure() { - - function clamp(v, min, max) { - return Math.min(Math.max(v, min), max); - } - - function ProgressBar(id, opts) { - this.visible = true; - - // Fetch the sub-elements for later. - this.div = document.querySelector(id + ' .progress'); - - // Get the loading bar element, so it can be resized to fit the viewer. - this.bar = this.div.parentNode; - - // Get options, with sensible defaults. - this.height = opts.height || 100; - this.width = opts.width || 100; - this.units = opts.units || '%'; - - // Initialize heights. - this.div.style.height = this.height + this.units; - this.percent = 0; - } - - ProgressBar.prototype = { - - updateBar: function ProgressBar_updateBar() { - if (this._indeterminate) { - this.div.classList.add('indeterminate'); - this.div.style.width = this.width + this.units; - return; - } - - this.div.classList.remove('indeterminate'); - var progressSize = this.width * this._percent / 100; - this.div.style.width = progressSize + this.units; - }, - - get percent() { - return this._percent; - }, - - set percent(val) { - this._indeterminate = isNaN(val); - this._percent = clamp(val, 0, 100); - this.updateBar(); - }, - - setWidth: function ProgressBar_setWidth(viewer) { - if (viewer) { - var container = viewer.parentNode; - var scrollbarWidth = container.offsetWidth - viewer.offsetWidth; - if (scrollbarWidth > 0) { - this.bar.setAttribute('style', 'width: calc(100% - ' + - scrollbarWidth + 'px);'); - } - } - }, - - hide: function ProgressBar_hide() { - if (!this.visible) { - return; - } - this.visible = false; - this.bar.classList.add('hidden'); - document.body.classList.remove('loadingInProgress'); - }, - - show: function ProgressBar_show() { - if (this.visible) { - return; - } - this.visible = true; - document.body.classList.add('loadingInProgress'); - this.bar.classList.remove('hidden'); - } - }; - - return ProgressBar; -})(); - - - -var DEFAULT_PREFERENCES = { - showPreviousViewOnLoad: true, - defaultZoomValue: '', - sidebarViewOnLoad: 0, - enableHandToolOnLoad: false, - enableWebGL: false, - pdfBugEnabled: false, - disableRange: false, - disableStream: false, - disableAutoFetch: false, - disableFontFace: false, - disableTextLayer: false, - useOnlyCssZoom: false, - externalLinkTarget: 0, -}; - - -var SidebarView = { - NONE: 0, - THUMBS: 1, - OUTLINE: 2, - ATTACHMENTS: 3 -}; - -/** - * Preferences - Utility for storing persistent settings. - * Used for settings that should be applied to all opened documents, - * or every time the viewer is loaded. - */ -var Preferences = { - prefs: Object.create(DEFAULT_PREFERENCES), - isInitializedPromiseResolved: false, - initializedPromise: null, - - /** - * Initialize and fetch the current preference values from storage. - * @return {Promise} A promise that is resolved when the preferences - * have been initialized. - */ - initialize: function preferencesInitialize() { - return this.initializedPromise = - this._readFromStorage(DEFAULT_PREFERENCES).then(function(prefObj) { - this.isInitializedPromiseResolved = true; - if (prefObj) { - this.prefs = prefObj; - } - }.bind(this)); - }, - - /** - * Stub function for writing preferences to storage. - * NOTE: This should be overridden by a build-specific function defined below. - * @param {Object} prefObj The preferences that should be written to storage. - * @return {Promise} A promise that is resolved when the preference values - * have been written. - */ - _writeToStorage: function preferences_writeToStorage(prefObj) { - return Promise.resolve(); - }, - - /** - * Stub function for reading preferences from storage. - * NOTE: This should be overridden by a build-specific function defined below. - * @param {Object} prefObj The preferences that should be read from storage. - * @return {Promise} A promise that is resolved with an {Object} containing - * the preferences that have been read. - */ - _readFromStorage: function preferences_readFromStorage(prefObj) { - return Promise.resolve(); - }, - - /** - * Reset the preferences to their default values and update storage. - * @return {Promise} A promise that is resolved when the preference values - * have been reset. - */ - reset: function preferencesReset() { - return this.initializedPromise.then(function() { - this.prefs = Object.create(DEFAULT_PREFERENCES); - return this._writeToStorage(DEFAULT_PREFERENCES); - }.bind(this)); - }, - - /** - * Replace the current preference values with the ones from storage. - * @return {Promise} A promise that is resolved when the preference values - * have been updated. - */ - reload: function preferencesReload() { - return this.initializedPromise.then(function () { - this._readFromStorage(DEFAULT_PREFERENCES).then(function(prefObj) { - if (prefObj) { - this.prefs = prefObj; - } - }.bind(this)); - }.bind(this)); - }, - - /** - * Set the value of a preference. - * @param {string} name The name of the preference that should be changed. - * @param {boolean|number|string} value The new value of the preference. - * @return {Promise} A promise that is resolved when the value has been set, - * provided that the preference exists and the types match. - */ - set: function preferencesSet(name, value) { - return this.initializedPromise.then(function () { - if (DEFAULT_PREFERENCES[name] === undefined) { - throw new Error('preferencesSet: \'' + name + '\' is undefined.'); - } else if (value === undefined) { - throw new Error('preferencesSet: no value is specified.'); - } - var valueType = typeof value; - var defaultType = typeof DEFAULT_PREFERENCES[name]; - - if (valueType !== defaultType) { - if (valueType === 'number' && defaultType === 'string') { - value = value.toString(); - } else { - throw new Error('Preferences_set: \'' + value + '\' is a \"' + - valueType + '\", expected \"' + defaultType + '\".'); - } - } else { - if (valueType === 'number' && (value | 0) !== value) { - throw new Error('Preferences_set: \'' + value + - '\' must be an \"integer\".'); - } - } - this.prefs[name] = value; - return this._writeToStorage(this.prefs); - }.bind(this)); - }, - - /** - * Get the value of a preference. - * @param {string} name The name of the preference whose value is requested. - * @return {Promise} A promise that is resolved with a {boolean|number|string} - * containing the value of the preference. - */ - get: function preferencesGet(name) { - return this.initializedPromise.then(function () { - var defaultValue = DEFAULT_PREFERENCES[name]; - - if (defaultValue === undefined) { - throw new Error('preferencesGet: \'' + name + '\' is undefined.'); - } else { - var prefValue = this.prefs[name]; - - if (prefValue !== undefined) { - return prefValue; - } - } - return defaultValue; - }.bind(this)); - } -}; - - -Preferences._writeToStorage = function (prefObj) { - return new Promise(function (resolve) { - localStorage.setItem('pdfjs.preferences', JSON.stringify(prefObj)); - resolve(); - }); -}; - -Preferences._readFromStorage = function (prefObj) { - return new Promise(function (resolve) { - var readPrefs = JSON.parse(localStorage.getItem('pdfjs.preferences')); - resolve(readPrefs); - }); -}; - - -(function mozPrintCallbackPolyfillClosure() { - if ('mozPrintCallback' in document.createElement('canvas')) { - return; - } - // Cause positive result on feature-detection: - HTMLCanvasElement.prototype.mozPrintCallback = undefined; - - var canvases; // During print task: non-live NodeList of elements - var index; // Index of element that is being processed - - var print = window.print; - window.print = function print() { - if (canvases) { - console.warn('Ignored window.print() because of a pending print job.'); - return; - } - try { - dispatchEvent('beforeprint'); - } finally { - canvases = document.querySelectorAll('canvas'); - index = -1; - next(); - } - }; - - function dispatchEvent(eventType) { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent(eventType, false, false, 'custom'); - window.dispatchEvent(event); - } - - function next() { - if (!canvases) { - return; // Print task cancelled by user (state reset in abort()) - } - - renderProgress(); - if (++index < canvases.length) { - var canvas = canvases[index]; - if (typeof canvas.mozPrintCallback === 'function') { - canvas.mozPrintCallback({ - context: canvas.getContext('2d'), - abort: abort, - done: next - }); - } else { - next(); - } - } else { - renderProgress(); - print.call(window); - setTimeout(abort, 20); // Tidy-up - } - } - - function abort() { - if (canvases) { - canvases = null; - renderProgress(); - dispatchEvent('afterprint'); - } - } - - function renderProgress() { - var progressContainer = document.getElementById('mozPrintCallback-shim'); - if (canvases && canvases.length) { - var progress = Math.round(100 * index / canvases.length); - var progressBar = progressContainer.querySelector('progress'); - var progressPerc = progressContainer.querySelector('.relative-progress'); - progressBar.value = progress; - progressPerc.textContent = progress + '%'; - progressContainer.removeAttribute('hidden'); - progressContainer.onclick = abort; - } else { - progressContainer.setAttribute('hidden', ''); - } - } - - var hasAttachEvent = !!document.attachEvent; - - window.addEventListener('keydown', function(event) { - // Intercept Cmd/Ctrl + P in all browsers. - // Also intercept Cmd/Ctrl + Shift + P in Chrome and Opera - if (event.keyCode === 80/*P*/ && (event.ctrlKey || event.metaKey) && - !event.altKey && (!event.shiftKey || window.chrome || window.opera)) { - window.print(); - if (hasAttachEvent) { - // Only attachEvent can cancel Ctrl + P dialog in IE <=10 - // attachEvent is gone in IE11, so the dialog will re-appear in IE11. - return; - } - event.preventDefault(); - if (event.stopImmediatePropagation) { - event.stopImmediatePropagation(); - } else { - event.stopPropagation(); - } - return; - } - if (event.keyCode === 27 && canvases) { // Esc - abort(); - } - }, true); - if (hasAttachEvent) { - document.attachEvent('onkeydown', function(event) { - event = event || window.event; - if (event.keyCode === 80/*P*/ && event.ctrlKey) { - event.keyCode = 0; - return false; - } - }); - } - - if ('onbeforeprint' in window) { - // Do not propagate before/afterprint events when they are not triggered - // from within this polyfill. (FF/IE). - var stopPropagationIfNeeded = function(event) { - if (event.detail !== 'custom' && event.stopImmediatePropagation) { - event.stopImmediatePropagation(); - } - }; - window.addEventListener('beforeprint', stopPropagationIfNeeded, false); - window.addEventListener('afterprint', stopPropagationIfNeeded, false); - } -})(); - - - -var DownloadManager = (function DownloadManagerClosure() { - - function download(blobUrl, filename) { - var a = document.createElement('a'); - if (a.click) { - // Use a.click() if available. Otherwise, Chrome might show - // "Unsafe JavaScript attempt to initiate a navigation change - // for frame with URL" and not open the PDF at all. - // Supported by (not mentioned = untested): - // - Firefox 6 - 19 (4- does not support a.click, 5 ignores a.click) - // - Chrome 19 - 26 (18- does not support a.click) - // - Opera 9 - 12.15 - // - Internet Explorer 6 - 10 - // - Safari 6 (5.1- does not support a.click) - a.href = blobUrl; - a.target = '_parent'; - // Use a.download if available. This increases the likelihood that - // the file is downloaded instead of opened by another PDF plugin. - if ('download' in a) { - a.download = filename; - } - // must be in the document for IE and recent Firefox versions. - // (otherwise .click() is ignored) - (document.body || document.documentElement).appendChild(a); - a.click(); - a.parentNode.removeChild(a); - } else { - if (window.top === window && - blobUrl.split('#')[0] === window.location.href.split('#')[0]) { - // If _parent == self, then opening an identical URL with different - // location hash will only cause a navigation, not a download. - var padCharacter = blobUrl.indexOf('?') === -1 ? '?' : '&'; - blobUrl = blobUrl.replace(/#|$/, padCharacter + '$&'); - } - window.open(blobUrl, '_parent'); - } - } - - function DownloadManager() {} - - DownloadManager.prototype = { - downloadUrl: function DownloadManager_downloadUrl(url, filename) { - if (!PDFJS.isValidUrl(url, true)) { - return; // restricted/invalid URL - } - - download(url + '#pdfjs.action=download', filename); - }, - - downloadData: function DownloadManager_downloadData(data, filename, - contentType) { - if (navigator.msSaveBlob) { // IE10 and above - return navigator.msSaveBlob(new Blob([data], { type: contentType }), - filename); - } - - var blobUrl = PDFJS.createObjectURL(data, contentType); - download(blobUrl, filename); - }, - - download: function DownloadManager_download(blob, url, filename) { - if (!URL) { - // URL.createObjectURL is not supported - this.downloadUrl(url, filename); - return; - } - - if (navigator.msSaveBlob) { - // IE10 / IE11 - if (!navigator.msSaveBlob(blob, filename)) { - this.downloadUrl(url, filename); - } - return; - } - - var blobUrl = URL.createObjectURL(blob); - download(blobUrl, filename); - } - }; - - return DownloadManager; -})(); - - - - - -var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; - -/** - * View History - This is a utility for saving various view parameters for - * recently opened files. - * - * The way that the view parameters are stored depends on how PDF.js is built, - * for 'node make ' the following cases exist: - * - FIREFOX or MOZCENTRAL - uses sessionStorage. - * - GENERIC or CHROME - uses localStorage, if it is available. - */ -var ViewHistory = (function ViewHistoryClosure() { - function ViewHistory(fingerprint, cacheSize) { - this.fingerprint = fingerprint; - this.cacheSize = cacheSize || DEFAULT_VIEW_HISTORY_CACHE_SIZE; - this.isInitializedPromiseResolved = false; - this.initializedPromise = - this._readFromStorage().then(function (databaseStr) { - this.isInitializedPromiseResolved = true; - - var database = JSON.parse(databaseStr || '{}'); - if (!('files' in database)) { - database.files = []; - } - if (database.files.length >= this.cacheSize) { - database.files.shift(); - } - var index; - for (var i = 0, length = database.files.length; i < length; i++) { - var branch = database.files[i]; - if (branch.fingerprint === this.fingerprint) { - index = i; - break; - } - } - if (typeof index !== 'number') { - index = database.files.push({fingerprint: this.fingerprint}) - 1; - } - this.file = database.files[index]; - this.database = database; - }.bind(this)); - } - - ViewHistory.prototype = { - _writeToStorage: function ViewHistory_writeToStorage() { - return new Promise(function (resolve) { - var databaseStr = JSON.stringify(this.database); - - - localStorage.setItem('database', databaseStr); - resolve(); - }.bind(this)); - }, - - _readFromStorage: function ViewHistory_readFromStorage() { - return new Promise(function (resolve) { - - resolve(localStorage.getItem('database')); - }); - }, - - set: function ViewHistory_set(name, val) { - if (!this.isInitializedPromiseResolved) { - return; - } - this.file[name] = val; - return this._writeToStorage(); - }, - - setMultiple: function ViewHistory_setMultiple(properties) { - if (!this.isInitializedPromiseResolved) { - return; - } - for (var name in properties) { - this.file[name] = properties[name]; - } - return this._writeToStorage(); - }, - - get: function ViewHistory_get(name, defaultValue) { - if (!this.isInitializedPromiseResolved) { - return defaultValue; - } - return this.file[name] || defaultValue; - } - }; - - return ViewHistory; -})(); - - -/** - * Creates a "search bar" given a set of DOM elements that act as controls - * for searching or for setting search preferences in the UI. This object - * also sets up the appropriate events for the controls. Actual searching - * is done by PDFFindController. - */ -var PDFFindBar = (function PDFFindBarClosure() { - function PDFFindBar(options) { - this.opened = false; - this.bar = options.bar || null; - this.toggleButton = options.toggleButton || null; - this.findField = options.findField || null; - this.highlightAll = options.highlightAllCheckbox || null; - this.caseSensitive = options.caseSensitiveCheckbox || null; - this.findMsg = options.findMsg || null; - this.findResultsCount = options.findResultsCount || null; - this.findStatusIcon = options.findStatusIcon || null; - this.findPreviousButton = options.findPreviousButton || null; - this.findNextButton = options.findNextButton || null; - this.findController = options.findController || null; - - if (this.findController === null) { - throw new Error('PDFFindBar cannot be used without a ' + - 'PDFFindController instance.'); - } - - // Add event listeners to the DOM elements. - var self = this; - this.toggleButton.addEventListener('click', function() { - self.toggle(); - }); - - this.findField.addEventListener('input', function() { - self.dispatchEvent(''); - }); - - this.bar.addEventListener('keydown', function(evt) { - switch (evt.keyCode) { - case 13: // Enter - if (evt.target === self.findField) { - self.dispatchEvent('again', evt.shiftKey); - } - break; - case 27: // Escape - self.close(); - break; - } - }); - - this.findPreviousButton.addEventListener('click', function() { - self.dispatchEvent('again', true); - }); - - this.findNextButton.addEventListener('click', function() { - self.dispatchEvent('again', false); - }); - - this.highlightAll.addEventListener('click', function() { - self.dispatchEvent('highlightallchange'); - }); - - this.caseSensitive.addEventListener('click', function() { - self.dispatchEvent('casesensitivitychange'); - }); - } - - PDFFindBar.prototype = { - dispatchEvent: function PDFFindBar_dispatchEvent(type, findPrev) { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('find' + type, true, true, { - query: this.findField.value, - caseSensitive: this.caseSensitive.checked, - highlightAll: this.highlightAll.checked, - findPrevious: findPrev - }); - return window.dispatchEvent(event); - }, - - updateUIState: - function PDFFindBar_updateUIState(state, previous, matchCount) { - var notFound = false; - var findMsg = ''; - var status = ''; - - switch (state) { - case FindStates.FIND_FOUND: - break; - - case FindStates.FIND_PENDING: - status = 'pending'; - break; - - case FindStates.FIND_NOTFOUND: - findMsg = 'Phrase not found'; - notFound = true; - break; - - case FindStates.FIND_WRAPPED: - if (previous) { - findMsg = 'Reached top of document, continued from bottom'; - } else { - findMsg = 'Reached end of document, continued from top'; - } - break; - } - - if (notFound) { - this.findField.classList.add('notFound'); - } else { - this.findField.classList.remove('notFound'); - } - - this.findField.setAttribute('data-status', status); - this.findMsg.textContent = findMsg; - - this.updateResultsCount(matchCount); - }, - - updateResultsCount: function(matchCount) { - if (!this.findResultsCount) { - return; // no UI control is provided - } - - // If there are no matches, hide the counter - if (!matchCount) { - this.findResultsCount.classList.add('hidden'); - return; - } - - // Create the match counter - this.findResultsCount.textContent = matchCount.toLocaleString(); - - // Show the counter - this.findResultsCount.classList.remove('hidden'); - }, - - open: function PDFFindBar_open() { - if (!this.opened) { - this.opened = true; - this.toggleButton.classList.add('toggled'); - this.bar.classList.remove('hidden'); - } - this.findField.select(); - this.findField.focus(); - }, - - close: function PDFFindBar_close() { - if (!this.opened) { - return; - } - this.opened = false; - this.toggleButton.classList.remove('toggled'); - this.bar.classList.add('hidden'); - this.findController.active = false; - }, - - toggle: function PDFFindBar_toggle() { - if (this.opened) { - this.close(); - } else { - this.open(); - } - } - }; - return PDFFindBar; -})(); - - -var FindStates = { - FIND_FOUND: 0, - FIND_NOTFOUND: 1, - FIND_WRAPPED: 2, - FIND_PENDING: 3 -}; - -var FIND_SCROLL_OFFSET_TOP = -50; -var FIND_SCROLL_OFFSET_LEFT = -400; - -/** - * Provides "search" or "find" functionality for the PDF. - * This object actually performs the search for a given string. - */ -var PDFFindController = (function PDFFindControllerClosure() { - function PDFFindController(options) { - this.startedTextExtraction = false; - this.extractTextPromises = []; - this.pendingFindMatches = {}; - this.active = false; // If active, find results will be highlighted. - this.pageContents = []; // Stores the text for each page. - this.pageMatches = []; - this.matchCount = 0; - this.selected = { // Currently selected match. - pageIdx: -1, - matchIdx: -1 - }; - this.offset = { // Where the find algorithm currently is in the document. - pageIdx: null, - matchIdx: null - }; - this.pagesToSearch = null; - this.resumePageIdx = null; - this.state = null; - this.dirtyMatch = false; - this.findTimeout = null; - this.pdfViewer = options.pdfViewer || null; - this.integratedFind = options.integratedFind || false; - this.charactersToNormalize = { - '\u2018': '\'', // Left single quotation mark - '\u2019': '\'', // Right single quotation mark - '\u201A': '\'', // Single low-9 quotation mark - '\u201B': '\'', // Single high-reversed-9 quotation mark - '\u201C': '"', // Left double quotation mark - '\u201D': '"', // Right double quotation mark - '\u201E': '"', // Double low-9 quotation mark - '\u201F': '"', // Double high-reversed-9 quotation mark - '\u00BC': '1/4', // Vulgar fraction one quarter - '\u00BD': '1/2', // Vulgar fraction one half - '\u00BE': '3/4', // Vulgar fraction three quarters - }; - this.findBar = options.findBar || null; - - // Compile the regular expression for text normalization once - var replace = Object.keys(this.charactersToNormalize).join(''); - this.normalizationRegex = new RegExp('[' + replace + ']', 'g'); - - var events = [ - 'find', - 'findagain', - 'findhighlightallchange', - 'findcasesensitivitychange' - ]; - - this.firstPagePromise = new Promise(function (resolve) { - this.resolveFirstPage = resolve; - }.bind(this)); - this.handleEvent = this.handleEvent.bind(this); - - for (var i = 0, len = events.length; i < len; i++) { - window.addEventListener(events[i], this.handleEvent); - } - } - - PDFFindController.prototype = { - setFindBar: function PDFFindController_setFindBar(findBar) { - this.findBar = findBar; - }, - - reset: function PDFFindController_reset() { - this.startedTextExtraction = false; - this.extractTextPromises = []; - this.active = false; - }, - - normalize: function PDFFindController_normalize(text) { - var self = this; - return text.replace(this.normalizationRegex, function (ch) { - return self.charactersToNormalize[ch]; - }); - }, - - calcFindMatch: function PDFFindController_calcFindMatch(pageIndex) { - var pageContent = this.normalize(this.pageContents[pageIndex]); - var query = this.normalize(this.state.query); - var caseSensitive = this.state.caseSensitive; - var queryLen = query.length; - - if (queryLen === 0) { - // Do nothing: the matches should be wiped out already. - return; - } - - if (!caseSensitive) { - pageContent = pageContent.toLowerCase(); - query = query.toLowerCase(); - } - - var matches = []; - var matchIdx = -queryLen; - while (true) { - matchIdx = pageContent.indexOf(query, matchIdx + queryLen); - if (matchIdx === -1) { - break; - } - matches.push(matchIdx); - } - this.pageMatches[pageIndex] = matches; - this.updatePage(pageIndex); - if (this.resumePageIdx === pageIndex) { - this.resumePageIdx = null; - this.nextPageMatch(); - } - - // Update the matches count - if (matches.length > 0) { - this.matchCount += matches.length; - this.updateUIResultsCount(); - } - }, - - extractText: function PDFFindController_extractText() { - if (this.startedTextExtraction) { - return; - } - this.startedTextExtraction = true; - - this.pageContents = []; - var extractTextPromisesResolves = []; - var numPages = this.pdfViewer.pagesCount; - for (var i = 0; i < numPages; i++) { - this.extractTextPromises.push(new Promise(function (resolve) { - extractTextPromisesResolves.push(resolve); - })); - } - - var self = this; - function extractPageText(pageIndex) { - self.pdfViewer.getPageTextContent(pageIndex).then( - function textContentResolved(textContent) { - var textItems = textContent.items; - var str = []; - - for (var i = 0, len = textItems.length; i < len; i++) { - str.push(textItems[i].str); - } - - // Store the pageContent as a string. - self.pageContents.push(str.join('')); - - extractTextPromisesResolves[pageIndex](pageIndex); - if ((pageIndex + 1) < self.pdfViewer.pagesCount) { - extractPageText(pageIndex + 1); - } - } - ); - } - extractPageText(0); - }, - - handleEvent: function PDFFindController_handleEvent(e) { - if (this.state === null || e.type !== 'findagain') { - this.dirtyMatch = true; - } - this.state = e.detail; - this.updateUIState(FindStates.FIND_PENDING); - - this.firstPagePromise.then(function() { - this.extractText(); - - clearTimeout(this.findTimeout); - if (e.type === 'find') { - // Only trigger the find action after 250ms of silence. - this.findTimeout = setTimeout(this.nextMatch.bind(this), 250); - } else { - this.nextMatch(); - } - }.bind(this)); - }, - - updatePage: function PDFFindController_updatePage(index) { - if (this.selected.pageIdx === index) { - // If the page is selected, scroll the page into view, which triggers - // rendering the page, which adds the textLayer. Once the textLayer is - // build, it will scroll onto the selected match. - this.pdfViewer.scrollPageIntoView(index + 1); - } - - var page = this.pdfViewer.getPageView(index); - if (page.textLayer) { - page.textLayer.updateMatches(); - } - }, - - nextMatch: function PDFFindController_nextMatch() { - var previous = this.state.findPrevious; - var currentPageIndex = this.pdfViewer.currentPageNumber - 1; - var numPages = this.pdfViewer.pagesCount; - - this.active = true; - - if (this.dirtyMatch) { - // Need to recalculate the matches, reset everything. - this.dirtyMatch = false; - this.selected.pageIdx = this.selected.matchIdx = -1; - this.offset.pageIdx = currentPageIndex; - this.offset.matchIdx = null; - this.hadMatch = false; - this.resumePageIdx = null; - this.pageMatches = []; - this.matchCount = 0; - var self = this; - - for (var i = 0; i < numPages; i++) { - // Wipe out any previous highlighted matches. - this.updatePage(i); - - // As soon as the text is extracted start finding the matches. - if (!(i in this.pendingFindMatches)) { - this.pendingFindMatches[i] = true; - this.extractTextPromises[i].then(function(pageIdx) { - delete self.pendingFindMatches[pageIdx]; - self.calcFindMatch(pageIdx); - }); - } - } - } - - // If there's no query there's no point in searching. - if (this.state.query === '') { - this.updateUIState(FindStates.FIND_FOUND); - return; - } - - // If we're waiting on a page, we return since we can't do anything else. - if (this.resumePageIdx) { - return; - } - - var offset = this.offset; - // Keep track of how many pages we should maximally iterate through. - this.pagesToSearch = numPages; - // If there's already a matchIdx that means we are iterating through a - // page's matches. - if (offset.matchIdx !== null) { - var numPageMatches = this.pageMatches[offset.pageIdx].length; - if ((!previous && offset.matchIdx + 1 < numPageMatches) || - (previous && offset.matchIdx > 0)) { - // The simple case; we just have advance the matchIdx to select - // the next match on the page. - this.hadMatch = true; - offset.matchIdx = (previous ? offset.matchIdx - 1 : - offset.matchIdx + 1); - this.updateMatch(true); - return; - } - // We went beyond the current page's matches, so we advance to - // the next page. - this.advanceOffsetPage(previous); - } - // Start searching through the page. - this.nextPageMatch(); - }, - - matchesReady: function PDFFindController_matchesReady(matches) { - var offset = this.offset; - var numMatches = matches.length; - var previous = this.state.findPrevious; - - if (numMatches) { - // There were matches for the page, so initialize the matchIdx. - this.hadMatch = true; - offset.matchIdx = (previous ? numMatches - 1 : 0); - this.updateMatch(true); - return true; - } else { - // No matches, so attempt to search the next page. - this.advanceOffsetPage(previous); - if (offset.wrapped) { - offset.matchIdx = null; - if (this.pagesToSearch < 0) { - // No point in wrapping again, there were no matches. - this.updateMatch(false); - // while matches were not found, searching for a page - // with matches should nevertheless halt. - return true; - } - } - // Matches were not found (and searching is not done). - return false; - } - }, - - /** - * The method is called back from the text layer when match presentation - * is updated. - * @param {number} pageIndex - page index. - * @param {number} index - match index. - * @param {Array} elements - text layer div elements array. - * @param {number} beginIdx - start index of the div array for the match. - * @param {number} endIdx - end index of the div array for the match. - */ - updateMatchPosition: function PDFFindController_updateMatchPosition( - pageIndex, index, elements, beginIdx, endIdx) { - if (this.selected.matchIdx === index && - this.selected.pageIdx === pageIndex) { - var spot = { - top: FIND_SCROLL_OFFSET_TOP, - left: FIND_SCROLL_OFFSET_LEFT - }; - scrollIntoView(elements[beginIdx], spot, - /* skipOverflowHiddenElements = */ true); - } - }, - - nextPageMatch: function PDFFindController_nextPageMatch() { - if (this.resumePageIdx !== null) { - console.error('There can only be one pending page.'); - } - do { - var pageIdx = this.offset.pageIdx; - var matches = this.pageMatches[pageIdx]; - if (!matches) { - // The matches don't exist yet for processing by "matchesReady", - // so set a resume point for when they do exist. - this.resumePageIdx = pageIdx; - break; - } - } while (!this.matchesReady(matches)); - }, - - advanceOffsetPage: function PDFFindController_advanceOffsetPage(previous) { - var offset = this.offset; - var numPages = this.extractTextPromises.length; - offset.pageIdx = (previous ? offset.pageIdx - 1 : offset.pageIdx + 1); - offset.matchIdx = null; - - this.pagesToSearch--; - - if (offset.pageIdx >= numPages || offset.pageIdx < 0) { - offset.pageIdx = (previous ? numPages - 1 : 0); - offset.wrapped = true; - } - }, - - updateMatch: function PDFFindController_updateMatch(found) { - var state = FindStates.FIND_NOTFOUND; - var wrapped = this.offset.wrapped; - this.offset.wrapped = false; - - if (found) { - var previousPage = this.selected.pageIdx; - this.selected.pageIdx = this.offset.pageIdx; - this.selected.matchIdx = this.offset.matchIdx; - state = (wrapped ? FindStates.FIND_WRAPPED : FindStates.FIND_FOUND); - // Update the currently selected page to wipe out any selected matches. - if (previousPage !== -1 && previousPage !== this.selected.pageIdx) { - this.updatePage(previousPage); - } - } - - this.updateUIState(state, this.state.findPrevious); - if (this.selected.pageIdx !== -1) { - this.updatePage(this.selected.pageIdx); - } - }, - - updateUIResultsCount: - function PDFFindController_updateUIResultsCount() { - if (this.findBar === null) { - throw new Error('PDFFindController is not initialized with a ' + - 'PDFFindBar instance.'); - } - this.findBar.updateResultsCount(this.matchCount); - }, - - updateUIState: function PDFFindController_updateUIState(state, previous) { - if (this.integratedFind) { - FirefoxCom.request('updateFindControlState', - { result: state, findPrevious: previous }); - return; - } - if (this.findBar === null) { - throw new Error('PDFFindController is not initialized with a ' + - 'PDFFindBar instance.'); - } - this.findBar.updateUIState(state, previous, this.matchCount); - } - }; - return PDFFindController; -})(); - - -/** - * Performs navigation functions inside PDF, such as opening specified page, - * or destination. - * @class - * @implements {IPDFLinkService} - */ -var PDFLinkService = (function () { - /** - * @constructs PDFLinkService - */ - function PDFLinkService() { - this.baseUrl = null; - this.pdfDocument = null; - this.pdfViewer = null; - this.pdfHistory = null; - - this._pagesRefCache = null; - } - - PDFLinkService.prototype = { - setDocument: function PDFLinkService_setDocument(pdfDocument, baseUrl) { - this.baseUrl = baseUrl; - this.pdfDocument = pdfDocument; - this._pagesRefCache = Object.create(null); - }, - - setViewer: function PDFLinkService_setViewer(pdfViewer) { - this.pdfViewer = pdfViewer; - }, - - setHistory: function PDFLinkService_setHistory(pdfHistory) { - this.pdfHistory = pdfHistory; - }, - - /** - * @returns {number} - */ - get pagesCount() { - return this.pdfDocument.numPages; - }, - - /** - * @returns {number} - */ - get page() { - return this.pdfViewer.currentPageNumber; - }, - - /** - * @param {number} value - */ - set page(value) { - this.pdfViewer.currentPageNumber = value; - }, - - /** - * @param dest - The PDF destination object. - */ - navigateTo: function PDFLinkService_navigateTo(dest) { - var destString = ''; - var self = this; - - var goToDestination = function(destRef) { - // dest array looks like that: - var pageNumber = destRef instanceof Object ? - self._pagesRefCache[destRef.num + ' ' + destRef.gen + ' R'] : - (destRef + 1); - if (pageNumber) { - if (pageNumber > self.pagesCount) { - pageNumber = self.pagesCount; - } - self.pdfViewer.scrollPageIntoView(pageNumber, dest); - - if (self.pdfHistory) { - // Update the browsing history. - self.pdfHistory.push({ - dest: dest, - hash: destString, - page: pageNumber - }); - } - } else { - self.pdfDocument.getPageIndex(destRef).then(function (pageIndex) { - var pageNum = pageIndex + 1; - var cacheKey = destRef.num + ' ' + destRef.gen + ' R'; - self._pagesRefCache[cacheKey] = pageNum; - goToDestination(destRef); - }); - } - }; - - var destinationPromise; - if (typeof dest === 'string') { - destString = dest; - destinationPromise = this.pdfDocument.getDestination(dest); - } else { - destinationPromise = Promise.resolve(dest); - } - destinationPromise.then(function(destination) { - dest = destination; - if (!(destination instanceof Array)) { - return; // invalid destination - } - goToDestination(destination[0]); - }); - }, - - /** - * @param dest - The PDF destination object. - * @returns {string} The hyperlink to the PDF object. - */ - getDestinationHash: function PDFLinkService_getDestinationHash(dest) { - if (typeof dest === 'string') { - return this.getAnchorUrl('#' + escape(dest)); - } - if (dest instanceof Array) { - var destRef = dest[0]; // see navigateTo method for dest format - var pageNumber = destRef instanceof Object ? - this._pagesRefCache[destRef.num + ' ' + destRef.gen + ' R'] : - (destRef + 1); - if (pageNumber) { - var pdfOpenParams = this.getAnchorUrl('#page=' + pageNumber); - var destKind = dest[1]; - if (typeof destKind === 'object' && 'name' in destKind && - destKind.name === 'XYZ') { - var scale = (dest[4] || this.pdfViewer.currentScaleValue); - var scaleNumber = parseFloat(scale); - if (scaleNumber) { - scale = scaleNumber * 100; - } - pdfOpenParams += '&zoom=' + scale; - if (dest[2] || dest[3]) { - pdfOpenParams += ',' + (dest[2] || 0) + ',' + (dest[3] || 0); - } - } - return pdfOpenParams; - } - } - return this.getAnchorUrl(''); - }, - - /** - * Prefix the full url on anchor links to make sure that links are resolved - * relative to the current URL instead of the one defined in . - * @param {String} anchor The anchor hash, including the #. - * @returns {string} The hyperlink to the PDF object. - */ - getAnchorUrl: function PDFLinkService_getAnchorUrl(anchor) { - return (this.baseUrl || '') + anchor; - }, - - /** - * @param {string} hash - */ - setHash: function PDFLinkService_setHash(hash) { - if (hash.indexOf('=') >= 0) { - var params = parseQueryString(hash); - // borrowing syntax from "Parameters for Opening PDF Files" - if ('nameddest' in params) { - if (this.pdfHistory) { - this.pdfHistory.updateNextHashParam(params.nameddest); - } - this.navigateTo(params.nameddest); - return; - } - var pageNumber, dest; - if ('page' in params) { - pageNumber = (params.page | 0) || 1; - } - if ('zoom' in params) { - // Build the destination array. - var zoomArgs = params.zoom.split(','); // scale,left,top - var zoomArg = zoomArgs[0]; - var zoomArgNumber = parseFloat(zoomArg); - - if (zoomArg.indexOf('Fit') === -1) { - // If the zoomArg is a number, it has to get divided by 100. If it's - // a string, it should stay as it is. - dest = [null, { name: 'XYZ' }, - zoomArgs.length > 1 ? (zoomArgs[1] | 0) : null, - zoomArgs.length > 2 ? (zoomArgs[2] | 0) : null, - (zoomArgNumber ? zoomArgNumber / 100 : zoomArg)]; - } else { - if (zoomArg === 'Fit' || zoomArg === 'FitB') { - dest = [null, { name: zoomArg }]; - } else if ((zoomArg === 'FitH' || zoomArg === 'FitBH') || - (zoomArg === 'FitV' || zoomArg === 'FitBV')) { - dest = [null, { name: zoomArg }, - zoomArgs.length > 1 ? (zoomArgs[1] | 0) : null]; - } else if (zoomArg === 'FitR') { - if (zoomArgs.length !== 5) { - console.error('PDFLinkService_setHash: ' + - 'Not enough parameters for \'FitR\'.'); - } else { - dest = [null, { name: zoomArg }, - (zoomArgs[1] | 0), (zoomArgs[2] | 0), - (zoomArgs[3] | 0), (zoomArgs[4] | 0)]; - } - } else { - console.error('PDFLinkService_setHash: \'' + zoomArg + - '\' is not a valid zoom value.'); - } - } - } - if (dest) { - this.pdfViewer.scrollPageIntoView(pageNumber || this.page, dest); - } else if (pageNumber) { - this.page = pageNumber; // simple page - } - if ('pagemode' in params) { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('pagemode', true, true, { - mode: params.pagemode, - }); - this.pdfViewer.container.dispatchEvent(event); - } - } else if (/^\d+$/.test(hash)) { // page number - this.page = hash; - } else { // named destination - if (this.pdfHistory) { - this.pdfHistory.updateNextHashParam(unescape(hash)); - } - this.navigateTo(unescape(hash)); - } - }, - - /** - * @param {string} action - */ - executeNamedAction: function PDFLinkService_executeNamedAction(action) { - // See PDF reference, table 8.45 - Named action - switch (action) { - case 'GoBack': - if (this.pdfHistory) { - this.pdfHistory.back(); - } - break; - - case 'GoForward': - if (this.pdfHistory) { - this.pdfHistory.forward(); - } - break; - - case 'NextPage': - this.page++; - break; - - case 'PrevPage': - this.page--; - break; - - case 'LastPage': - this.page = this.pagesCount; - break; - - case 'FirstPage': - this.page = 1; - break; - - default: - break; // No action according to spec - } - - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('namedaction', true, true, { - action: action - }); - this.pdfViewer.container.dispatchEvent(event); - }, - - /** - * @param {number} pageNum - page number. - * @param {Object} pageRef - reference to the page. - */ - cachePageRef: function PDFLinkService_cachePageRef(pageNum, pageRef) { - var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; - this._pagesRefCache[refStr] = pageNum; - } - }; - - return PDFLinkService; -})(); - - -var PDFHistory = (function () { - function PDFHistory(options) { - this.linkService = options.linkService; - - this.initialized = false; - this.initialDestination = null; - this.initialBookmark = null; - } - - PDFHistory.prototype = { - /** - * @param {string} fingerprint - * @param {IPDFLinkService} linkService - */ - initialize: function pdfHistoryInitialize(fingerprint) { - this.initialized = true; - this.reInitialized = false; - this.allowHashChange = true; - this.historyUnlocked = true; - this.isViewerInPresentationMode = false; - - this.previousHash = window.location.hash.substring(1); - this.currentBookmark = ''; - this.currentPage = 0; - this.updatePreviousBookmark = false; - this.previousBookmark = ''; - this.previousPage = 0; - this.nextHashParam = ''; - - this.fingerprint = fingerprint; - this.currentUid = this.uid = 0; - this.current = {}; - - var state = window.history.state; - if (this._isStateObjectDefined(state)) { - // This corresponds to navigating back to the document - // from another page in the browser history. - if (state.target.dest) { - this.initialDestination = state.target.dest; - } else { - this.initialBookmark = state.target.hash; - } - this.currentUid = state.uid; - this.uid = state.uid + 1; - this.current = state.target; - } else { - // This corresponds to the loading of a new document. - if (state && state.fingerprint && - this.fingerprint !== state.fingerprint) { - // Reinitialize the browsing history when a new document - // is opened in the web viewer. - this.reInitialized = true; - } - this._pushOrReplaceState({fingerprint: this.fingerprint}, true); - } - - var self = this; - window.addEventListener('popstate', function pdfHistoryPopstate(evt) { - if (!self.historyUnlocked) { - return; - } - if (evt.state) { - // Move back/forward in the history. - self._goTo(evt.state); - return; - } - - // If the state is not set, then the user tried to navigate to a - // different hash by manually editing the URL and pressing Enter, or by - // clicking on an in-page link (e.g. the "current view" link). - // Save the current view state to the browser history. - - // Note: In Firefox, history.null could also be null after an in-page - // navigation to the same URL, and without dispatching the popstate - // event: https://bugzilla.mozilla.org/show_bug.cgi?id=1183881 - - if (self.uid === 0) { - // Replace the previous state if it was not explicitly set. - var previousParams = (self.previousHash && self.currentBookmark && - self.previousHash !== self.currentBookmark) ? - {hash: self.currentBookmark, page: self.currentPage} : - {page: 1}; - replacePreviousHistoryState(previousParams, function() { - updateHistoryWithCurrentHash(); - }); - } else { - updateHistoryWithCurrentHash(); - } - }, false); - - - function updateHistoryWithCurrentHash() { - self.previousHash = window.location.hash.slice(1); - self._pushToHistory({hash: self.previousHash}, false, true); - self._updatePreviousBookmark(); - } - - function replacePreviousHistoryState(params, callback) { - // To modify the previous history entry, the following happens: - // 1. history.back() - // 2. _pushToHistory, which calls history.replaceState( ... ) - // 3. history.forward() - // Because a navigation via the history API does not immediately update - // the history state, the popstate event is used for synchronization. - self.historyUnlocked = false; - - // Suppress the hashchange event to avoid side effects caused by - // navigating back and forward. - self.allowHashChange = false; - window.addEventListener('popstate', rewriteHistoryAfterBack); - history.back(); - - function rewriteHistoryAfterBack() { - window.removeEventListener('popstate', rewriteHistoryAfterBack); - window.addEventListener('popstate', rewriteHistoryAfterForward); - self._pushToHistory(params, false, true); - history.forward(); - } - function rewriteHistoryAfterForward() { - window.removeEventListener('popstate', rewriteHistoryAfterForward); - self.allowHashChange = true; - self.historyUnlocked = true; - callback(); - } - } - - function pdfHistoryBeforeUnload() { - var previousParams = self._getPreviousParams(null, true); - if (previousParams) { - var replacePrevious = (!self.current.dest && - self.current.hash !== self.previousHash); - self._pushToHistory(previousParams, false, replacePrevious); - self._updatePreviousBookmark(); - } - // Remove the event listener when navigating away from the document, - // since 'beforeunload' prevents Firefox from caching the document. - window.removeEventListener('beforeunload', pdfHistoryBeforeUnload, - false); - } - - window.addEventListener('beforeunload', pdfHistoryBeforeUnload, false); - - window.addEventListener('pageshow', function pdfHistoryPageShow(evt) { - // If the entire viewer (including the PDF file) is cached in - // the browser, we need to reattach the 'beforeunload' event listener - // since the 'DOMContentLoaded' event is not fired on 'pageshow'. - window.addEventListener('beforeunload', pdfHistoryBeforeUnload, false); - }, false); - - window.addEventListener('presentationmodechanged', function(e) { - self.isViewerInPresentationMode = !!e.detail.active; - }); - }, - - clearHistoryState: function pdfHistory_clearHistoryState() { - this._pushOrReplaceState(null, true); - }, - - _isStateObjectDefined: function pdfHistory_isStateObjectDefined(state) { - return (state && state.uid >= 0 && - state.fingerprint && this.fingerprint === state.fingerprint && - state.target && state.target.hash) ? true : false; - }, - - _pushOrReplaceState: function pdfHistory_pushOrReplaceState(stateObj, - replace) { - if (replace) { - window.history.replaceState(stateObj, '', document.URL); - } else { - window.history.pushState(stateObj, '', document.URL); - } - }, - - get isHashChangeUnlocked() { - if (!this.initialized) { - return true; - } - return this.allowHashChange; - }, - - _updatePreviousBookmark: function pdfHistory_updatePreviousBookmark() { - if (this.updatePreviousBookmark && - this.currentBookmark && this.currentPage) { - this.previousBookmark = this.currentBookmark; - this.previousPage = this.currentPage; - this.updatePreviousBookmark = false; - } - }, - - updateCurrentBookmark: function pdfHistoryUpdateCurrentBookmark(bookmark, - pageNum) { - if (this.initialized) { - this.currentBookmark = bookmark.substring(1); - this.currentPage = pageNum | 0; - this._updatePreviousBookmark(); - } - }, - - updateNextHashParam: function pdfHistoryUpdateNextHashParam(param) { - if (this.initialized) { - this.nextHashParam = param; - } - }, - - push: function pdfHistoryPush(params, isInitialBookmark) { - if (!(this.initialized && this.historyUnlocked)) { - return; - } - if (params.dest && !params.hash) { - params.hash = (this.current.hash && this.current.dest && - this.current.dest === params.dest) ? - this.current.hash : - this.linkService.getDestinationHash(params.dest).split('#')[1]; - } - if (params.page) { - params.page |= 0; - } - if (isInitialBookmark) { - var target = window.history.state.target; - if (!target) { - // Invoked when the user specifies an initial bookmark, - // thus setting initialBookmark, when the document is loaded. - this._pushToHistory(params, false); - this.previousHash = window.location.hash.substring(1); - } - this.updatePreviousBookmark = this.nextHashParam ? false : true; - if (target) { - // If the current document is reloaded, - // avoid creating duplicate entries in the history. - this._updatePreviousBookmark(); - } - return; - } - if (this.nextHashParam) { - if (this.nextHashParam === params.hash) { - this.nextHashParam = null; - this.updatePreviousBookmark = true; - return; - } else { - this.nextHashParam = null; - } - } - - if (params.hash) { - if (this.current.hash) { - if (this.current.hash !== params.hash) { - this._pushToHistory(params, true); - } else { - if (!this.current.page && params.page) { - this._pushToHistory(params, false, true); - } - this.updatePreviousBookmark = true; - } - } else { - this._pushToHistory(params, true); - } - } else if (this.current.page && params.page && - this.current.page !== params.page) { - this._pushToHistory(params, true); - } - }, - - _getPreviousParams: function pdfHistory_getPreviousParams(onlyCheckPage, - beforeUnload) { - if (!(this.currentBookmark && this.currentPage)) { - return null; - } else if (this.updatePreviousBookmark) { - this.updatePreviousBookmark = false; - } - if (this.uid > 0 && !(this.previousBookmark && this.previousPage)) { - // Prevent the history from getting stuck in the current state, - // effectively preventing the user from going back/forward in - // the history. - // - // This happens if the current position in the document didn't change - // when the history was previously updated. The reasons for this are - // either: - // 1. The current zoom value is such that the document does not need to, - // or cannot, be scrolled to display the destination. - // 2. The previous destination is broken, and doesn't actally point to a - // position within the document. - // (This is either due to a bad PDF generator, or the user making a - // mistake when entering a destination in the hash parameters.) - return null; - } - if ((!this.current.dest && !onlyCheckPage) || beforeUnload) { - if (this.previousBookmark === this.currentBookmark) { - return null; - } - } else if (this.current.page || onlyCheckPage) { - if (this.previousPage === this.currentPage) { - return null; - } - } else { - return null; - } - var params = {hash: this.currentBookmark, page: this.currentPage}; - if (this.isViewerInPresentationMode) { - params.hash = null; - } - return params; - }, - - _stateObj: function pdfHistory_stateObj(params) { - return {fingerprint: this.fingerprint, uid: this.uid, target: params}; - }, - - _pushToHistory: function pdfHistory_pushToHistory(params, - addPrevious, overwrite) { - if (!this.initialized) { - return; - } - if (!params.hash && params.page) { - params.hash = ('page=' + params.page); - } - if (addPrevious && !overwrite) { - var previousParams = this._getPreviousParams(); - if (previousParams) { - var replacePrevious = (!this.current.dest && - this.current.hash !== this.previousHash); - this._pushToHistory(previousParams, false, replacePrevious); - } - } - this._pushOrReplaceState(this._stateObj(params), - (overwrite || this.uid === 0)); - this.currentUid = this.uid++; - this.current = params; - this.updatePreviousBookmark = true; - }, - - _goTo: function pdfHistory_goTo(state) { - if (!(this.initialized && this.historyUnlocked && - this._isStateObjectDefined(state))) { - return; - } - if (!this.reInitialized && state.uid < this.currentUid) { - var previousParams = this._getPreviousParams(true); - if (previousParams) { - this._pushToHistory(this.current, false); - this._pushToHistory(previousParams, false); - this.currentUid = state.uid; - window.history.back(); - return; - } - } - this.historyUnlocked = false; - - if (state.target.dest) { - this.linkService.navigateTo(state.target.dest); - } else { - this.linkService.setHash(state.target.hash); - } - this.currentUid = state.uid; - if (state.uid > this.uid) { - this.uid = state.uid; - } - this.current = state.target; - this.updatePreviousBookmark = true; - - var currentHash = window.location.hash.substring(1); - if (this.previousHash !== currentHash) { - this.allowHashChange = false; - } - this.previousHash = currentHash; - - this.historyUnlocked = true; - }, - - back: function pdfHistoryBack() { - this.go(-1); - }, - - forward: function pdfHistoryForward() { - this.go(1); - }, - - go: function pdfHistoryGo(direction) { - if (this.initialized && this.historyUnlocked) { - var state = window.history.state; - if (direction === -1 && state && state.uid > 0) { - window.history.back(); - } else if (direction === 1 && state && state.uid < (this.uid - 1)) { - window.history.forward(); - } - } - } - }; - - return PDFHistory; -})(); - - -var SecondaryToolbar = { - opened: false, - previousContainerHeight: null, - newContainerHeight: null, - - initialize: function secondaryToolbarInitialize(options) { - this.toolbar = options.toolbar; - this.buttonContainer = this.toolbar.firstElementChild; - - // Define the toolbar buttons. - this.toggleButton = options.toggleButton; - this.presentationModeButton = options.presentationModeButton; - this.openFile = options.openFile; - this.print = options.print; - this.download = options.download; - this.viewBookmark = options.viewBookmark; - this.firstPage = options.firstPage; - this.lastPage = options.lastPage; - this.pageRotateCw = options.pageRotateCw; - this.pageRotateCcw = options.pageRotateCcw; - this.documentPropertiesButton = options.documentPropertiesButton; - - // Attach the event listeners. - var elements = [ - // Button to toggle the visibility of the secondary toolbar: - { element: this.toggleButton, handler: this.toggle }, - // All items within the secondary toolbar - // (except for toggleHandTool, hand_tool.js is responsible for it): - { element: this.presentationModeButton, - handler: this.presentationModeClick }, - { element: this.openFile, handler: this.openFileClick }, - { element: this.print, handler: this.printClick }, - { element: this.download, handler: this.downloadClick }, - { element: this.viewBookmark, handler: this.viewBookmarkClick }, - { element: this.firstPage, handler: this.firstPageClick }, - { element: this.lastPage, handler: this.lastPageClick }, - { element: this.pageRotateCw, handler: this.pageRotateCwClick }, - { element: this.pageRotateCcw, handler: this.pageRotateCcwClick }, - { element: this.documentPropertiesButton, - handler: this.documentPropertiesClick } - ]; - - for (var item in elements) { - var element = elements[item].element; - if (element) { - element.addEventListener('click', elements[item].handler.bind(this)); - } - } - }, - - // Event handling functions. - presentationModeClick: function secondaryToolbarPresentationModeClick(evt) { - PDFViewerApplication.requestPresentationMode(); - this.close(); - }, - - openFileClick: function secondaryToolbarOpenFileClick(evt) { - document.getElementById('fileInput').click(); - this.close(); - }, - - printClick: function secondaryToolbarPrintClick(evt) { - window.print(); - this.close(); - }, - - downloadClick: function secondaryToolbarDownloadClick(evt) { - PDFViewerApplication.download(); - this.close(); - }, - - viewBookmarkClick: function secondaryToolbarViewBookmarkClick(evt) { - this.close(); - }, - - firstPageClick: function secondaryToolbarFirstPageClick(evt) { - PDFViewerApplication.page = 1; - this.close(); - }, - - lastPageClick: function secondaryToolbarLastPageClick(evt) { - if (PDFViewerApplication.pdfDocument) { - PDFViewerApplication.page = PDFViewerApplication.pagesCount; - } - this.close(); - }, - - pageRotateCwClick: function secondaryToolbarPageRotateCwClick(evt) { - PDFViewerApplication.rotatePages(90); - }, - - pageRotateCcwClick: function secondaryToolbarPageRotateCcwClick(evt) { - PDFViewerApplication.rotatePages(-90); - }, - - documentPropertiesClick: function secondaryToolbarDocumentPropsClick(evt) { - PDFViewerApplication.pdfDocumentProperties.open(); - this.close(); - }, - - // Misc. functions for interacting with the toolbar. - setMaxHeight: function secondaryToolbarSetMaxHeight(container) { - if (!container || !this.buttonContainer) { - return; - } - this.newContainerHeight = container.clientHeight; - if (this.previousContainerHeight === this.newContainerHeight) { - return; - } - this.buttonContainer.setAttribute('style', - 'max-height: ' + (this.newContainerHeight - SCROLLBAR_PADDING) + 'px;'); - this.previousContainerHeight = this.newContainerHeight; - }, - - open: function secondaryToolbarOpen() { - if (this.opened) { - return; - } - this.opened = true; - this.toggleButton.classList.add('toggled'); - this.toolbar.classList.remove('hidden'); - }, - - close: function secondaryToolbarClose(target) { - if (!this.opened) { - return; - } else if (target && !this.toolbar.contains(target)) { - return; - } - this.opened = false; - this.toolbar.classList.add('hidden'); - this.toggleButton.classList.remove('toggled'); - }, - - toggle: function secondaryToolbarToggle() { - if (this.opened) { - this.close(); - } else { - this.open(); - } - } -}; - - -var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; // in ms -var DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms -var ACTIVE_SELECTOR = 'pdfPresentationMode'; -var CONTROLS_SELECTOR = 'pdfPresentationModeControls'; - -/** - * @typedef {Object} PDFPresentationModeOptions - * @property {HTMLDivElement} container - The container for the viewer element. - * @property {HTMLDivElement} viewer - (optional) The viewer element. - * @property {PDFViewer} pdfViewer - The document viewer. - * @property {PDFThumbnailViewer} pdfThumbnailViewer - (optional) The thumbnail - * viewer. - * @property {Array} contextMenuItems - (optional) The menuitems that are added - * to the context menu in Presentation Mode. - */ - -/** - * @class - */ -var PDFPresentationMode = (function PDFPresentationModeClosure() { - /** - * @constructs PDFPresentationMode - * @param {PDFPresentationModeOptions} options - */ - function PDFPresentationMode(options) { - this.container = options.container; - this.viewer = options.viewer || options.container.firstElementChild; - this.pdfViewer = options.pdfViewer; - this.pdfThumbnailViewer = options.pdfThumbnailViewer || null; - var contextMenuItems = options.contextMenuItems || null; - - this.active = false; - this.args = null; - this.contextMenuOpen = false; - this.mouseScrollTimeStamp = 0; - this.mouseScrollDelta = 0; - - if (contextMenuItems) { - for (var i = 0, ii = contextMenuItems.length; i < ii; i++) { - var item = contextMenuItems[i]; - item.element.addEventListener('click', function (handler) { - this.contextMenuOpen = false; - handler(); - }.bind(this, item.handler)); - } - } - } - - PDFPresentationMode.prototype = { - /** - * Request the browser to enter fullscreen mode. - * @returns {boolean} Indicating if the request was successful. - */ - request: function PDFPresentationMode_request() { - if (this.switchInProgress || this.active || - !this.viewer.hasChildNodes()) { - return false; - } - this._addFullscreenChangeListeners(); - this._setSwitchInProgress(); - this._notifyStateChange(); - - if (this.container.requestFullscreen) { - this.container.requestFullscreen(); - } else if (this.container.mozRequestFullScreen) { - this.container.mozRequestFullScreen(); - } else if (this.container.webkitRequestFullscreen) { - this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); - } else if (this.container.msRequestFullscreen) { - this.container.msRequestFullscreen(); - } else { - return false; - } - - this.args = { - page: this.pdfViewer.currentPageNumber, - previousScale: this.pdfViewer.currentScaleValue, - }; - - return true; - }, - - /** - * Switches page when the user scrolls (using a scroll wheel or a touchpad) - * with large enough motion, to prevent accidental page switches. - * @param {number} delta - The delta value from the mouse event. - */ - mouseScroll: function PDFPresentationMode_mouseScroll(delta) { - if (!this.active) { - return; - } - var MOUSE_SCROLL_COOLDOWN_TIME = 50; - var PAGE_SWITCH_THRESHOLD = 120; - var PageSwitchDirection = { - UP: -1, - DOWN: 1 - }; - - var currentTime = (new Date()).getTime(); - var storedTime = this.mouseScrollTimeStamp; - - // If we've already switched page, avoid accidentally switching again. - if (currentTime > storedTime && - currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { - return; - } - // If the scroll direction changed, reset the accumulated scroll delta. - if ((this.mouseScrollDelta > 0 && delta < 0) || - (this.mouseScrollDelta < 0 && delta > 0)) { - this._resetMouseScrollState(); - } - this.mouseScrollDelta += delta; - - if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) { - var pageSwitchDirection = (this.mouseScrollDelta > 0) ? - PageSwitchDirection.UP : PageSwitchDirection.DOWN; - var page = this.pdfViewer.currentPageNumber; - this._resetMouseScrollState(); - - // If we're at the first/last page, we don't need to do anything. - if ((page === 1 && pageSwitchDirection === PageSwitchDirection.UP) || - (page === this.pdfViewer.pagesCount && - pageSwitchDirection === PageSwitchDirection.DOWN)) { - return; - } - this.pdfViewer.currentPageNumber = (page + pageSwitchDirection); - this.mouseScrollTimeStamp = currentTime; - } - }, - - get isFullscreen() { - return !!(document.fullscreenElement || - document.mozFullScreen || - document.webkitIsFullScreen || - document.msFullscreenElement); - }, - - /** - * @private - */ - _notifyStateChange: function PDFPresentationMode_notifyStateChange() { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('presentationmodechanged', true, true, { - active: this.active, - switchInProgress: !!this.switchInProgress - }); - window.dispatchEvent(event); - }, - - /** - * Used to initialize a timeout when requesting Presentation Mode, - * i.e. when the browser is requested to enter fullscreen mode. - * This timeout is used to prevent the current page from being scrolled - * partially, or completely, out of view when entering Presentation Mode. - * NOTE: This issue seems limited to certain zoom levels (e.g. page-width). - * @private - */ - _setSwitchInProgress: function PDFPresentationMode_setSwitchInProgress() { - if (this.switchInProgress) { - clearTimeout(this.switchInProgress); - } - this.switchInProgress = setTimeout(function switchInProgressTimeout() { - this._removeFullscreenChangeListeners(); - delete this.switchInProgress; - this._notifyStateChange(); - }.bind(this), DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS); - }, - - /** - * @private - */ - _resetSwitchInProgress: - function PDFPresentationMode_resetSwitchInProgress() { - if (this.switchInProgress) { - clearTimeout(this.switchInProgress); - delete this.switchInProgress; - } - }, - - /** - * @private - */ - _enter: function PDFPresentationMode_enter() { - this.active = true; - this._resetSwitchInProgress(); - this._notifyStateChange(); - this.container.classList.add(ACTIVE_SELECTOR); - - // Ensure that the correct page is scrolled into view when entering - // Presentation Mode, by waiting until fullscreen mode in enabled. - setTimeout(function enterPresentationModeTimeout() { - this.pdfViewer.currentPageNumber = this.args.page; - this.pdfViewer.currentScaleValue = 'page-fit'; - }.bind(this), 0); - - this._addWindowListeners(); - this._showControls(); - this.contextMenuOpen = false; - this.container.setAttribute('contextmenu', 'viewerContextMenu'); - - // Text selection is disabled in Presentation Mode, thus it's not possible - // for the user to deselect text that is selected (e.g. with "Select all") - // when entering Presentation Mode, hence we remove any active selection. - window.getSelection().removeAllRanges(); - }, - - /** - * @private - */ - _exit: function PDFPresentationMode_exit() { - var page = this.pdfViewer.currentPageNumber; - this.container.classList.remove(ACTIVE_SELECTOR); - - // Ensure that the correct page is scrolled into view when exiting - // Presentation Mode, by waiting until fullscreen mode is disabled. - setTimeout(function exitPresentationModeTimeout() { - this.active = false; - this._removeFullscreenChangeListeners(); - this._notifyStateChange(); - - this.pdfViewer.currentScaleValue = this.args.previousScale; - this.pdfViewer.currentPageNumber = page; - this.args = null; - }.bind(this), 0); - - this._removeWindowListeners(); - this._hideControls(); - this._resetMouseScrollState(); - this.container.removeAttribute('contextmenu'); - this.contextMenuOpen = false; - - if (this.pdfThumbnailViewer) { - this.pdfThumbnailViewer.ensureThumbnailVisible(page); - } - }, - - /** - * @private - */ - _mouseDown: function PDFPresentationMode_mouseDown(evt) { - if (this.contextMenuOpen) { - this.contextMenuOpen = false; - evt.preventDefault(); - return; - } - if (evt.button === 0) { - // Enable clicking of links in presentation mode. Please note: - // Only links pointing to destinations in the current PDF document work. - var isInternalLink = (evt.target.href && - evt.target.classList.contains('internalLink')); - if (!isInternalLink) { - // Unless an internal link was clicked, advance one page. - evt.preventDefault(); - this.pdfViewer.currentPageNumber += (evt.shiftKey ? -1 : 1); - } - } - }, - - /** - * @private - */ - _contextMenu: function PDFPresentationMode_contextMenu() { - this.contextMenuOpen = true; - }, - - /** - * @private - */ - _showControls: function PDFPresentationMode_showControls() { - if (this.controlsTimeout) { - clearTimeout(this.controlsTimeout); - } else { - this.container.classList.add(CONTROLS_SELECTOR); - } - this.controlsTimeout = setTimeout(function showControlsTimeout() { - this.container.classList.remove(CONTROLS_SELECTOR); - delete this.controlsTimeout; - }.bind(this), DELAY_BEFORE_HIDING_CONTROLS); - }, - - /** - * @private - */ - _hideControls: function PDFPresentationMode_hideControls() { - if (!this.controlsTimeout) { - return; - } - clearTimeout(this.controlsTimeout); - this.container.classList.remove(CONTROLS_SELECTOR); - delete this.controlsTimeout; - }, - - /** - * Resets the properties used for tracking mouse scrolling events. - * @private - */ - _resetMouseScrollState: - function PDFPresentationMode_resetMouseScrollState() { - this.mouseScrollTimeStamp = 0; - this.mouseScrollDelta = 0; - }, - - /** - * @private - */ - _addWindowListeners: function PDFPresentationMode_addWindowListeners() { - this.showControlsBind = this._showControls.bind(this); - this.mouseDownBind = this._mouseDown.bind(this); - this.resetMouseScrollStateBind = this._resetMouseScrollState.bind(this); - this.contextMenuBind = this._contextMenu.bind(this); - - window.addEventListener('mousemove', this.showControlsBind); - window.addEventListener('mousedown', this.mouseDownBind); - window.addEventListener('keydown', this.resetMouseScrollStateBind); - window.addEventListener('contextmenu', this.contextMenuBind); - }, - - /** - * @private - */ - _removeWindowListeners: - function PDFPresentationMode_removeWindowListeners() { - window.removeEventListener('mousemove', this.showControlsBind); - window.removeEventListener('mousedown', this.mouseDownBind); - window.removeEventListener('keydown', this.resetMouseScrollStateBind); - window.removeEventListener('contextmenu', this.contextMenuBind); - - delete this.showControlsBind; - delete this.mouseDownBind; - delete this.resetMouseScrollStateBind; - delete this.contextMenuBind; - }, - - /** - * @private - */ - _fullscreenChange: function PDFPresentationMode_fullscreenChange() { - if (this.isFullscreen) { - this._enter(); - } else { - this._exit(); - } - }, - - /** - * @private - */ - _addFullscreenChangeListeners: - function PDFPresentationMode_addFullscreenChangeListeners() { - this.fullscreenChangeBind = this._fullscreenChange.bind(this); - - window.addEventListener('fullscreenchange', this.fullscreenChangeBind); - window.addEventListener('mozfullscreenchange', this.fullscreenChangeBind); - window.addEventListener('webkitfullscreenchange', - this.fullscreenChangeBind); - window.addEventListener('MSFullscreenChange', this.fullscreenChangeBind); - }, - - /** - * @private - */ - _removeFullscreenChangeListeners: - function PDFPresentationMode_removeFullscreenChangeListeners() { - window.removeEventListener('fullscreenchange', this.fullscreenChangeBind); - window.removeEventListener('mozfullscreenchange', - this.fullscreenChangeBind); - window.removeEventListener('webkitfullscreenchange', - this.fullscreenChangeBind); - window.removeEventListener('MSFullscreenChange', - this.fullscreenChangeBind); - - delete this.fullscreenChangeBind; - } - }; - - return PDFPresentationMode; -})(); - - - -var GrabToPan = (function GrabToPanClosure() { - /** - * Construct a GrabToPan instance for a given HTML element. - * @param options.element {Element} - * @param options.ignoreTarget {function} optional. See `ignoreTarget(node)` - * @param options.onActiveChanged {function(boolean)} optional. Called - * when grab-to-pan is (de)activated. The first argument is a boolean that - * shows whether grab-to-pan is activated. - */ - function GrabToPan(options) { - this.element = options.element; - this.document = options.element.ownerDocument; - if (typeof options.ignoreTarget === 'function') { - this.ignoreTarget = options.ignoreTarget; - } - this.onActiveChanged = options.onActiveChanged; - - // Bind the contexts to ensure that `this` always points to - // the GrabToPan instance. - this.activate = this.activate.bind(this); - this.deactivate = this.deactivate.bind(this); - this.toggle = this.toggle.bind(this); - this._onmousedown = this._onmousedown.bind(this); - this._onmousemove = this._onmousemove.bind(this); - this._endPan = this._endPan.bind(this); - - // This overlay will be inserted in the document when the mouse moves during - // a grab operation, to ensure that the cursor has the desired appearance. - var overlay = this.overlay = document.createElement('div'); - overlay.className = 'grab-to-pan-grabbing'; - } - GrabToPan.prototype = { - /** - * Class name of element which can be grabbed - */ - CSS_CLASS_GRAB: 'grab-to-pan-grab', - - /** - * Bind a mousedown event to the element to enable grab-detection. - */ - activate: function GrabToPan_activate() { - if (!this.active) { - this.active = true; - this.element.addEventListener('mousedown', this._onmousedown, true); - this.element.classList.add(this.CSS_CLASS_GRAB); - if (this.onActiveChanged) { - this.onActiveChanged(true); - } - } - }, - - /** - * Removes all events. Any pending pan session is immediately stopped. - */ - deactivate: function GrabToPan_deactivate() { - if (this.active) { - this.active = false; - this.element.removeEventListener('mousedown', this._onmousedown, true); - this._endPan(); - this.element.classList.remove(this.CSS_CLASS_GRAB); - if (this.onActiveChanged) { - this.onActiveChanged(false); - } - } - }, - - toggle: function GrabToPan_toggle() { - if (this.active) { - this.deactivate(); - } else { - this.activate(); - } - }, - - /** - * Whether to not pan if the target element is clicked. - * Override this method to change the default behaviour. - * - * @param node {Element} The target of the event - * @return {boolean} Whether to not react to the click event. - */ - ignoreTarget: function GrabToPan_ignoreTarget(node) { - // Use matchesSelector to check whether the clicked element - // is (a child of) an input element / link - return node[matchesSelector]( - 'a[href], a[href] *, input, textarea, button, button *, select, option' - ); - }, - - /** - * @private - */ - _onmousedown: function GrabToPan__onmousedown(event) { - if (event.button !== 0 || this.ignoreTarget(event.target)) { - return; - } - if (event.originalTarget) { - try { - /* jshint expr:true */ - event.originalTarget.tagName; - } catch (e) { - // Mozilla-specific: element is a scrollbar (XUL element) - return; - } - } - - this.scrollLeftStart = this.element.scrollLeft; - this.scrollTopStart = this.element.scrollTop; - this.clientXStart = event.clientX; - this.clientYStart = event.clientY; - this.document.addEventListener('mousemove', this._onmousemove, true); - this.document.addEventListener('mouseup', this._endPan, true); - // When a scroll event occurs before a mousemove, assume that the user - // dragged a scrollbar (necessary for Opera Presto, Safari and IE) - // (not needed for Chrome/Firefox) - this.element.addEventListener('scroll', this._endPan, true); - event.preventDefault(); - event.stopPropagation(); - this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING); - - var focusedElement = document.activeElement; - if (focusedElement && !focusedElement.contains(event.target)) { - focusedElement.blur(); - } - }, - - /** - * @private - */ - _onmousemove: function GrabToPan__onmousemove(event) { - this.element.removeEventListener('scroll', this._endPan, true); - if (isLeftMouseReleased(event)) { - this._endPan(); - return; - } - var xDiff = event.clientX - this.clientXStart; - var yDiff = event.clientY - this.clientYStart; - this.element.scrollTop = this.scrollTopStart - yDiff; - this.element.scrollLeft = this.scrollLeftStart - xDiff; - if (!this.overlay.parentNode) { - document.body.appendChild(this.overlay); - } - }, - - /** - * @private - */ - _endPan: function GrabToPan__endPan() { - this.element.removeEventListener('scroll', this._endPan, true); - this.document.removeEventListener('mousemove', this._onmousemove, true); - this.document.removeEventListener('mouseup', this._endPan, true); - if (this.overlay.parentNode) { - this.overlay.parentNode.removeChild(this.overlay); - } - } - }; - - // Get the correct (vendor-prefixed) name of the matches method. - var matchesSelector; - ['webkitM', 'mozM', 'msM', 'oM', 'm'].some(function(prefix) { - var name = prefix + 'atches'; - if (name in document.documentElement) { - matchesSelector = name; - } - name += 'Selector'; - if (name in document.documentElement) { - matchesSelector = name; - } - return matchesSelector; // If found, then truthy, and [].some() ends. - }); - - // Browser sniffing because it's impossible to feature-detect - // whether event.which for onmousemove is reliable - var isNotIEorIsIE10plus = !document.documentMode || document.documentMode > 9; - var chrome = window.chrome; - var isChrome15OrOpera15plus = chrome && (chrome.webstore || chrome.app); - // ^ Chrome 15+ ^ Opera 15+ - var isSafari6plus = /Apple/.test(navigator.vendor) && - /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent); - - /** - * Whether the left mouse is not pressed. - * @param event {MouseEvent} - * @return {boolean} True if the left mouse button is not pressed. - * False if unsure or if the left mouse button is pressed. - */ - function isLeftMouseReleased(event) { - if ('buttons' in event && isNotIEorIsIE10plus) { - // http://www.w3.org/TR/DOM-Level-3-Events/#events-MouseEvent-buttons - // Firefox 15+ - // Internet Explorer 10+ - return !(event.buttons | 1); - } - if (isChrome15OrOpera15plus || isSafari6plus) { - // Chrome 14+ - // Opera 15+ - // Safari 6.0+ - return event.which === 0; - } - } - - return GrabToPan; -})(); - -var HandTool = { - initialize: function handToolInitialize(options) { - var toggleHandTool = options.toggleHandTool; - this.handTool = new GrabToPan({ - element: options.container, - onActiveChanged: function(isActive) { - if (!toggleHandTool) { - return; - } - if (isActive) { - toggleHandTool.title = 'Disable hand tool'; - toggleHandTool.firstElementChild.textContent = 'Disable hand tool'; - } else { - toggleHandTool.title = 'Enable hand tool'; - toggleHandTool.firstElementChild.textContent = 'Enable hand tool'; - } - } - }); - if (toggleHandTool) { - toggleHandTool.addEventListener('click', this.toggle.bind(this), false); - - window.addEventListener('localized', function (evt) { - Preferences.get('enableHandToolOnLoad').then(function resolved(value) { - if (value) { - this.handTool.activate(); - } - }.bind(this), function rejected(reason) {}); - }.bind(this)); - - window.addEventListener('presentationmodechanged', function (evt) { - if (evt.detail.switchInProgress) { - return; - } - if (evt.detail.active) { - this.enterPresentationMode(); - } else { - this.exitPresentationMode(); - } - }.bind(this)); - } - }, - - toggle: function handToolToggle() { - this.handTool.toggle(); - SecondaryToolbar.close(); - }, - - enterPresentationMode: function handToolEnterPresentationMode() { - if (this.handTool.active) { - this.wasActive = true; - this.handTool.deactivate(); - } - }, - - exitPresentationMode: function handToolExitPresentationMode() { - if (this.wasActive) { - this.wasActive = null; - this.handTool.activate(); - } - } -}; - - -var OverlayManager = { - overlays: {}, - active: null, - - /** - * @param {string} name The name of the overlay that is registered. This must - * be equal to the ID of the overlay's DOM element. - * @param {function} callerCloseMethod (optional) The method that, if present, - * will call OverlayManager.close from the Object - * registering the overlay. Access to this method is - * necessary in order to run cleanup code when e.g. - * the overlay is force closed. The default is null. - * @param {boolean} canForceClose (optional) Indicates if opening the overlay - * will close an active overlay. The default is false. - * @returns {Promise} A promise that is resolved when the overlay has been - * registered. - */ - register: function overlayManagerRegister(name, - callerCloseMethod, canForceClose) { - return new Promise(function (resolve) { - var element, container; - if (!name || !(element = document.getElementById(name)) || - !(container = element.parentNode)) { - throw new Error('Not enough parameters.'); - } else if (this.overlays[name]) { - throw new Error('The overlay is already registered.'); - } - this.overlays[name] = { element: element, - container: container, - callerCloseMethod: (callerCloseMethod || null), - canForceClose: (canForceClose || false) }; - resolve(); - }.bind(this)); - }, - - /** - * @param {string} name The name of the overlay that is unregistered. - * @returns {Promise} A promise that is resolved when the overlay has been - * unregistered. - */ - unregister: function overlayManagerUnregister(name) { - return new Promise(function (resolve) { - if (!this.overlays[name]) { - throw new Error('The overlay does not exist.'); - } else if (this.active === name) { - throw new Error('The overlay cannot be removed while it is active.'); - } - delete this.overlays[name]; - - resolve(); - }.bind(this)); - }, - - /** - * @param {string} name The name of the overlay that should be opened. - * @returns {Promise} A promise that is resolved when the overlay has been - * opened. - */ - open: function overlayManagerOpen(name) { - return new Promise(function (resolve) { - if (!this.overlays[name]) { - throw new Error('The overlay does not exist.'); - } else if (this.active) { - if (this.overlays[name].canForceClose) { - this._closeThroughCaller(); - } else if (this.active === name) { - throw new Error('The overlay is already active.'); - } else { - throw new Error('Another overlay is currently active.'); - } - } - this.active = name; - this.overlays[this.active].element.classList.remove('hidden'); - this.overlays[this.active].container.classList.remove('hidden'); - - window.addEventListener('keydown', this._keyDown); - resolve(); - }.bind(this)); - }, - - /** - * @param {string} name The name of the overlay that should be closed. - * @returns {Promise} A promise that is resolved when the overlay has been - * closed. - */ - close: function overlayManagerClose(name) { - return new Promise(function (resolve) { - if (!this.overlays[name]) { - throw new Error('The overlay does not exist.'); - } else if (!this.active) { - throw new Error('The overlay is currently not active.'); - } else if (this.active !== name) { - throw new Error('Another overlay is currently active.'); - } - this.overlays[this.active].container.classList.add('hidden'); - this.overlays[this.active].element.classList.add('hidden'); - this.active = null; - - window.removeEventListener('keydown', this._keyDown); - resolve(); - }.bind(this)); - }, - - /** - * @private - */ - _keyDown: function overlayManager_keyDown(evt) { - var self = OverlayManager; - if (self.active && evt.keyCode === 27) { // Esc key. - self._closeThroughCaller(); - evt.preventDefault(); - } - }, - - /** - * @private - */ - _closeThroughCaller: function overlayManager_closeThroughCaller() { - if (this.overlays[this.active].callerCloseMethod) { - this.overlays[this.active].callerCloseMethod(); - } - if (this.active) { - this.close(this.active); - } - } -}; - - -var PasswordPrompt = { - overlayName: null, - updatePassword: null, - reason: null, - passwordField: null, - passwordText: null, - passwordSubmit: null, - passwordCancel: null, - - initialize: function secondaryToolbarInitialize(options) { - this.overlayName = options.overlayName; - this.passwordField = options.passwordField; - this.passwordText = options.passwordText; - this.passwordSubmit = options.passwordSubmit; - this.passwordCancel = options.passwordCancel; - - // Attach the event listeners. - this.passwordSubmit.addEventListener('click', - this.verifyPassword.bind(this)); - - this.passwordCancel.addEventListener('click', this.close.bind(this)); - - this.passwordField.addEventListener('keydown', function (e) { - if (e.keyCode === 13) { // Enter key - this.verifyPassword(); - } - }.bind(this)); - - OverlayManager.register(this.overlayName, this.close.bind(this), true); - }, - - open: function passwordPromptOpen() { - OverlayManager.open(this.overlayName).then(function () { - this.passwordField.type = 'password'; - this.passwordField.focus(); - - var promptString = 'Enter the password to open this PDF file.'; - - if (this.reason === PDFJS.PasswordResponses.INCORRECT_PASSWORD) { - promptString = 'Invalid password. Please try again.'; - } - - this.passwordText.textContent = promptString; - }.bind(this)); - }, - - close: function passwordPromptClose() { - OverlayManager.close(this.overlayName).then(function () { - this.passwordField.value = ''; - this.passwordField.type = ''; - }.bind(this)); - }, - - verifyPassword: function passwordPromptVerifyPassword() { - var password = this.passwordField.value; - if (password && password.length > 0) { - this.close(); - return this.updatePassword(password); - } - } -}; - - -/** - * @typedef {Object} PDFDocumentPropertiesOptions - * @property {string} overlayName - Name/identifier for the overlay. - * @property {Object} fields - Names and elements of the overlay's fields. - * @property {HTMLButtonElement} closeButton - Button for closing the overlay. - */ - -/** - * @class - */ -var PDFDocumentProperties = (function PDFDocumentPropertiesClosure() { - /** - * @constructs PDFDocumentProperties - * @param {PDFDocumentPropertiesOptions} options - */ - function PDFDocumentProperties(options) { - this.fields = options.fields; - this.overlayName = options.overlayName; - - this.rawFileSize = 0; - this.url = null; - this.pdfDocument = null; - - // Bind the event listener for the Close button. - if (options.closeButton) { - options.closeButton.addEventListener('click', this.close.bind(this)); - } - - this.dataAvailablePromise = new Promise(function (resolve) { - this.resolveDataAvailable = resolve; - }.bind(this)); - - OverlayManager.register(this.overlayName, this.close.bind(this)); - } - - PDFDocumentProperties.prototype = { - /** - * Open the document properties overlay. - */ - open: function PDFDocumentProperties_open() { - Promise.all([OverlayManager.open(this.overlayName), - this.dataAvailablePromise]).then(function () { - this._getProperties(); - }.bind(this)); - }, - - /** - * Close the document properties overlay. - */ - close: function PDFDocumentProperties_close() { - OverlayManager.close(this.overlayName); - }, - - /** - * Set the file size of the PDF document. This method is used to - * update the file size in the document properties overlay once it - * is known so we do not have to wait until the entire file is loaded. - * - * @param {number} fileSize - The file size of the PDF document. - */ - setFileSize: function PDFDocumentProperties_setFileSize(fileSize) { - if (fileSize > 0) { - this.rawFileSize = fileSize; - } - }, - - /** - * Set a reference to the PDF document and the URL in order - * to populate the overlay fields with the document properties. - * Note that the overlay will contain no information if this method - * is not called. - * - * @param {Object} pdfDocument - A reference to the PDF document. - * @param {string} url - The URL of the document. - */ - setDocumentAndUrl: - function PDFDocumentProperties_setDocumentAndUrl(pdfDocument, url) { - this.pdfDocument = pdfDocument; - this.url = url; - this.resolveDataAvailable(); - }, - - /** - * @private - */ - _getProperties: function PDFDocumentProperties_getProperties() { - if (!OverlayManager.active) { - // If the dialog was closed before dataAvailablePromise was resolved, - // don't bother updating the properties. - return; - } - // Get the file size (if it hasn't already been set). - this.pdfDocument.getDownloadInfo().then(function(data) { - if (data.length === this.rawFileSize) { - return; - } - this.setFileSize(data.length); - this._updateUI(this.fields['fileSize'], this._parseFileSize()); - }.bind(this)); - - // Get the document properties. - this.pdfDocument.getMetadata().then(function(data) { - var content = { - 'fileName': getPDFFileNameFromURL(this.url), - 'fileSize': this._parseFileSize(), - 'title': data.info.Title, - 'author': data.info.Author, - 'subject': data.info.Subject, - 'keywords': data.info.Keywords, - 'creationDate': this._parseDate(data.info.CreationDate), - 'modificationDate': this._parseDate(data.info.ModDate), - 'creator': data.info.Creator, - 'producer': data.info.Producer, - 'version': data.info.PDFFormatVersion, - 'pageCount': this.pdfDocument.numPages - }; - - // Show the properties in the dialog. - for (var identifier in content) { - this._updateUI(this.fields[identifier], content[identifier]); - } - }.bind(this)); - }, - - /** - * @private - */ - _updateUI: function PDFDocumentProperties_updateUI(field, content) { - if (field && content !== undefined && content !== '') { - field.textContent = content; - } - }, - - /** - * @private - */ - _parseFileSize: function PDFDocumentProperties_parseFileSize() { - var fileSize = this.rawFileSize, kb = fileSize / 1024; - if (!kb) { - return; - } else if (kb < 1024) { - return kb + ' KB ' + size_b + ' bytes'; - } else { - return (kb / 1024) + ' MB ' + size_b + ' bytes'; - } - }, - - /** - * @private - */ - _parseDate: function PDFDocumentProperties_parseDate(inputDate) { - // This is implemented according to the PDF specification, but note that - // Adobe Reader doesn't handle changing the date to universal time - // and doesn't use the user's time zone (they're effectively ignoring - // the HH' and mm' parts of the date string). - var dateToParse = inputDate; - if (dateToParse === undefined) { - return ''; - } - - // Remove the D: prefix if it is available. - if (dateToParse.substring(0,2) === 'D:') { - dateToParse = dateToParse.substring(2); - } - - // Get all elements from the PDF date string. - // JavaScript's Date object expects the month to be between - // 0 and 11 instead of 1 and 12, so we're correcting for this. - var year = parseInt(dateToParse.substring(0,4), 10); - var month = parseInt(dateToParse.substring(4,6), 10) - 1; - var day = parseInt(dateToParse.substring(6,8), 10); - var hours = parseInt(dateToParse.substring(8,10), 10); - var minutes = parseInt(dateToParse.substring(10,12), 10); - var seconds = parseInt(dateToParse.substring(12,14), 10); - var utRel = dateToParse.substring(14,15); - var offsetHours = parseInt(dateToParse.substring(15,17), 10); - var offsetMinutes = parseInt(dateToParse.substring(18,20), 10); - - // As per spec, utRel = 'Z' means equal to universal time. - // The other cases ('-' and '+') have to be handled here. - if (utRel === '-') { - hours += offsetHours; - minutes += offsetMinutes; - } else if (utRel === '+') { - hours -= offsetHours; - minutes -= offsetMinutes; - } - - // Return the new date format from the user's locale. - var date = new Date(Date.UTC(year, month, day, hours, minutes, seconds)); - var dateString = date.toLocaleDateString(); - var timeString = date.toLocaleTimeString(); - return dateString + ', ' + timeString; - } - }; - - return PDFDocumentProperties; -})(); - - -var PresentationModeState = { - UNKNOWN: 0, - NORMAL: 1, - CHANGING: 2, - FULLSCREEN: 3, -}; - -var IGNORE_CURRENT_POSITION_ON_ZOOM = false; -var DEFAULT_CACHE_SIZE = 10; - - -var CLEANUP_TIMEOUT = 30000; - -var RenderingStates = { - INITIAL: 0, - RUNNING: 1, - PAUSED: 2, - FINISHED: 3 -}; - -/** - * Controls rendering of the views for pages and thumbnails. - * @class - */ -var PDFRenderingQueue = (function PDFRenderingQueueClosure() { - /** - * @constructs - */ - function PDFRenderingQueue() { - this.pdfViewer = null; - this.pdfThumbnailViewer = null; - this.onIdle = null; - - this.highestPriorityPage = null; - this.idleTimeout = null; - this.printing = false; - this.isThumbnailViewEnabled = false; - } - - PDFRenderingQueue.prototype = /** @lends PDFRenderingQueue.prototype */ { - /** - * @param {PDFViewer} pdfViewer - */ - setViewer: function PDFRenderingQueue_setViewer(pdfViewer) { - this.pdfViewer = pdfViewer; - }, - - /** - * @param {PDFThumbnailViewer} pdfThumbnailViewer - */ - setThumbnailViewer: - function PDFRenderingQueue_setThumbnailViewer(pdfThumbnailViewer) { - this.pdfThumbnailViewer = pdfThumbnailViewer; - }, - - /** - * @param {IRenderableView} view - * @returns {boolean} - */ - isHighestPriority: function PDFRenderingQueue_isHighestPriority(view) { - return this.highestPriorityPage === view.renderingId; - }, - - renderHighestPriority: function - PDFRenderingQueue_renderHighestPriority(currentlyVisiblePages) { - if (this.idleTimeout) { - clearTimeout(this.idleTimeout); - this.idleTimeout = null; - } - - // Pages have a higher priority than thumbnails, so check them first. - if (this.pdfViewer.forceRendering(currentlyVisiblePages)) { - return; - } - // No pages needed rendering so check thumbnails. - if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) { - if (this.pdfThumbnailViewer.forceRendering()) { - return; - } - } - - if (this.printing) { - // If printing is currently ongoing do not reschedule cleanup. - return; - } - - if (this.onIdle) { - this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT); - } - }, - - getHighestPriority: function - PDFRenderingQueue_getHighestPriority(visible, views, scrolledDown) { - // The state has changed figure out which page has the highest priority to - // render next (if any). - // Priority: - // 1 visible pages - // 2 if last scrolled down page after the visible pages - // 2 if last scrolled up page before the visible pages - var visibleViews = visible.views; - - var numVisible = visibleViews.length; - if (numVisible === 0) { - return false; - } - for (var i = 0; i < numVisible; ++i) { - var view = visibleViews[i].view; - if (!this.isViewFinished(view)) { - return view; - } - } - - // All the visible views have rendered, try to render next/previous pages. - if (scrolledDown) { - var nextPageIndex = visible.last.id; - // ID's start at 1 so no need to add 1. - if (views[nextPageIndex] && - !this.isViewFinished(views[nextPageIndex])) { - return views[nextPageIndex]; - } - } else { - var previousPageIndex = visible.first.id - 2; - if (views[previousPageIndex] && - !this.isViewFinished(views[previousPageIndex])) { - return views[previousPageIndex]; - } - } - // Everything that needs to be rendered has been. - return null; - }, - - /** - * @param {IRenderableView} view - * @returns {boolean} - */ - isViewFinished: function PDFRenderingQueue_isViewFinished(view) { - return view.renderingState === RenderingStates.FINISHED; - }, - - /** - * Render a page or thumbnail view. This calls the appropriate function - * based on the views state. If the view is already rendered it will return - * false. - * @param {IRenderableView} view - */ - renderView: function PDFRenderingQueue_renderView(view) { - var state = view.renderingState; - switch (state) { - case RenderingStates.FINISHED: - return false; - case RenderingStates.PAUSED: - this.highestPriorityPage = view.renderingId; - view.resume(); - break; - case RenderingStates.RUNNING: - this.highestPriorityPage = view.renderingId; - break; - case RenderingStates.INITIAL: - this.highestPriorityPage = view.renderingId; - var continueRendering = function () { - this.renderHighestPriority(); - }.bind(this); - view.draw().then(continueRendering, continueRendering); - break; - } - return true; - }, - }; - - return PDFRenderingQueue; -})(); - - -var TEXT_LAYER_RENDER_DELAY = 200; // ms - -/** - * @typedef {Object} PDFPageViewOptions - * @property {HTMLDivElement} container - The viewer element. - * @property {number} id - The page unique ID (normally its number). - * @property {number} scale - The page scale display. - * @property {PageViewport} defaultViewport - The page viewport. - * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. - * @property {IPDFTextLayerFactory} textLayerFactory - * @property {IPDFAnnotationLayerFactory} annotationLayerFactory - */ - -/** - * @class - * @implements {IRenderableView} - */ -var PDFPageView = (function PDFPageViewClosure() { - /** - * @constructs PDFPageView - * @param {PDFPageViewOptions} options - */ - function PDFPageView(options) { - var container = options.container; - var id = options.id; - var scale = options.scale; - var defaultViewport = options.defaultViewport; - var renderingQueue = options.renderingQueue; - var textLayerFactory = options.textLayerFactory; - var annotationLayerFactory = options.annotationLayerFactory; - - this.id = id; - this.renderingId = 'page' + id; - - this.rotation = 0; - this.scale = scale || DEFAULT_SCALE; - this.viewport = defaultViewport; - this.pdfPageRotate = defaultViewport.rotation; - this.hasRestrictedScaling = false; - - this.renderingQueue = renderingQueue; - this.textLayerFactory = textLayerFactory; - this.annotationLayerFactory = annotationLayerFactory; - - this.renderingState = RenderingStates.INITIAL; - this.resume = null; - - this.onBeforeDraw = null; - this.onAfterDraw = null; - - this.textLayer = null; - - this.zoomLayer = null; - - this.annotationLayer = null; - - var div = document.createElement('div'); - div.id = 'pageContainer' + this.id; - div.className = 'page'; - div.style.width = Math.floor(this.viewport.width) + 'px'; - div.style.height = Math.floor(this.viewport.height) + 'px'; - div.setAttribute('data-page-number', this.id); - this.div = div; - - container.appendChild(div); - } - - PDFPageView.prototype = { - setPdfPage: function PDFPageView_setPdfPage(pdfPage) { - this.pdfPage = pdfPage; - this.pdfPageRotate = pdfPage.rotate; - var totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = pdfPage.getViewport(this.scale * CSS_UNITS, - totalRotation); - this.stats = pdfPage.stats; - this.reset(); - }, - - destroy: function PDFPageView_destroy() { - this.zoomLayer = null; - this.reset(); - if (this.pdfPage) { - this.pdfPage.cleanup(); - } - }, - - reset: function PDFPageView_reset(keepZoomLayer, keepAnnotations) { - if (this.renderTask) { - this.renderTask.cancel(); - } - this.resume = null; - this.renderingState = RenderingStates.INITIAL; - - var div = this.div; - div.style.width = Math.floor(this.viewport.width) + 'px'; - div.style.height = Math.floor(this.viewport.height) + 'px'; - - var childNodes = div.childNodes; - var currentZoomLayerNode = (keepZoomLayer && this.zoomLayer) || null; - var currentAnnotationNode = (keepAnnotations && this.annotationLayer && - this.annotationLayer.div) || null; - for (var i = childNodes.length - 1; i >= 0; i--) { - var node = childNodes[i]; - if (currentZoomLayerNode === node || currentAnnotationNode === node) { - continue; - } - div.removeChild(node); - } - div.removeAttribute('data-loaded'); - - if (currentAnnotationNode) { - // Hide annotationLayer until all elements are resized - // so they are not displayed on the already-resized page - this.annotationLayer.hide(); - } else { - this.annotationLayer = null; - } - - if (this.canvas && !currentZoomLayerNode) { - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - this.canvas.width = 0; - this.canvas.height = 0; - delete this.canvas; - } - - this.loadingIconDiv = document.createElement('div'); - this.loadingIconDiv.className = 'loadingIcon'; - div.appendChild(this.loadingIconDiv); - }, - - update: function PDFPageView_update(scale, rotation) { - this.scale = scale || this.scale; - - if (typeof rotation !== 'undefined') { - this.rotation = rotation; - } - - var totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = this.viewport.clone({ - scale: this.scale * CSS_UNITS, - rotation: totalRotation - }); - - var isScalingRestricted = false; - if (this.canvas && PDFJS.maxCanvasPixels > 0) { - var outputScale = this.outputScale; - var pixelsInViewport = this.viewport.width * this.viewport.height; - var maxScale = Math.sqrt(PDFJS.maxCanvasPixels / pixelsInViewport); - if (((Math.floor(this.viewport.width) * outputScale.sx) | 0) * - ((Math.floor(this.viewport.height) * outputScale.sy) | 0) > - PDFJS.maxCanvasPixels) { - isScalingRestricted = true; - } - } - - if (this.canvas) { - if (PDFJS.useOnlyCssZoom || - (this.hasRestrictedScaling && isScalingRestricted)) { - this.cssTransform(this.canvas, true); - - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('pagerendered', true, true, { - pageNumber: this.id, - cssTransform: true, - }); - this.div.dispatchEvent(event); - - return; - } - if (!this.zoomLayer) { - this.zoomLayer = this.canvas.parentNode; - this.zoomLayer.style.position = 'absolute'; - } - } - if (this.zoomLayer) { - this.cssTransform(this.zoomLayer.firstChild); - } - this.reset(/* keepZoomLayer = */ true, /* keepAnnotations = */ true); - }, - - /** - * Called when moved in the parent's container. - */ - updatePosition: function PDFPageView_updatePosition() { - if (this.textLayer) { - this.textLayer.render(TEXT_LAYER_RENDER_DELAY); - } - }, - - cssTransform: function PDFPageView_transform(canvas, redrawAnnotations) { - var CustomStyle = PDFJS.CustomStyle; - - // Scale canvas, canvas wrapper, and page container. - var width = this.viewport.width; - var height = this.viewport.height; - var div = this.div; - canvas.style.width = canvas.parentNode.style.width = div.style.width = - Math.floor(width) + 'px'; - canvas.style.height = canvas.parentNode.style.height = div.style.height = - Math.floor(height) + 'px'; - // The canvas may have been originally rotated, rotate relative to that. - var relativeRotation = this.viewport.rotation - canvas._viewport.rotation; - var absRotation = Math.abs(relativeRotation); - var scaleX = 1, scaleY = 1; - if (absRotation === 90 || absRotation === 270) { - // Scale x and y because of the rotation. - scaleX = height / width; - scaleY = width / height; - } - var cssTransform = 'rotate(' + relativeRotation + 'deg) ' + - 'scale(' + scaleX + ',' + scaleY + ')'; - CustomStyle.setProp('transform', canvas, cssTransform); - - if (this.textLayer) { - // Rotating the text layer is more complicated since the divs inside the - // the text layer are rotated. - // TODO: This could probably be simplified by drawing the text layer in - // one orientation then rotating overall. - var textLayerViewport = this.textLayer.viewport; - var textRelativeRotation = this.viewport.rotation - - textLayerViewport.rotation; - var textAbsRotation = Math.abs(textRelativeRotation); - var scale = width / textLayerViewport.width; - if (textAbsRotation === 90 || textAbsRotation === 270) { - scale = width / textLayerViewport.height; - } - var textLayerDiv = this.textLayer.textLayerDiv; - var transX, transY; - switch (textAbsRotation) { - case 0: - transX = transY = 0; - break; - case 90: - transX = 0; - transY = '-' + textLayerDiv.style.height; - break; - case 180: - transX = '-' + textLayerDiv.style.width; - transY = '-' + textLayerDiv.style.height; - break; - case 270: - transX = '-' + textLayerDiv.style.width; - transY = 0; - break; - default: - console.error('Bad rotation value.'); - break; - } - CustomStyle.setProp('transform', textLayerDiv, - 'rotate(' + textAbsRotation + 'deg) ' + - 'scale(' + scale + ', ' + scale + ') ' + - 'translate(' + transX + ', ' + transY + ')'); - CustomStyle.setProp('transformOrigin', textLayerDiv, '0% 0%'); - } - - if (redrawAnnotations && this.annotationLayer) { - this.annotationLayer.render(this.viewport, 'display'); - } - }, - - get width() { - return this.viewport.width; - }, - - get height() { - return this.viewport.height; - }, - - getPagePoint: function PDFPageView_getPagePoint(x, y) { - return this.viewport.convertToPdfPoint(x, y); - }, - - draw: function PDFPageView_draw() { - if (this.renderingState !== RenderingStates.INITIAL) { - console.error('Must be in new state before drawing'); - } - - this.renderingState = RenderingStates.RUNNING; - - var pdfPage = this.pdfPage; - var viewport = this.viewport; - var div = this.div; - // Wrap the canvas so if it has a css transform for highdpi the overflow - // will be hidden in FF. - var canvasWrapper = document.createElement('div'); - canvasWrapper.style.width = div.style.width; - canvasWrapper.style.height = div.style.height; - canvasWrapper.classList.add('canvasWrapper'); - - var canvas = document.createElement('canvas'); - canvas.id = 'page' + this.id; - // Keep the canvas hidden until the first draw callback, or until drawing - // is complete when `!this.renderingQueue`, to prevent black flickering. - canvas.setAttribute('hidden', 'hidden'); - var isCanvasHidden = true; - - canvasWrapper.appendChild(canvas); - if (this.annotationLayer && this.annotationLayer.div) { - // annotationLayer needs to stay on top - div.insertBefore(canvasWrapper, this.annotationLayer.div); - } else { - div.appendChild(canvasWrapper); - } - this.canvas = canvas; - - canvas.mozOpaque = true; - var ctx = canvas.getContext('2d', {alpha: false}); - var outputScale = getOutputScale(ctx); - this.outputScale = outputScale; - - if (PDFJS.useOnlyCssZoom) { - var actualSizeViewport = viewport.clone({scale: CSS_UNITS}); - // Use a scale that will make the canvas be the original intended size - // of the page. - outputScale.sx *= actualSizeViewport.width / viewport.width; - outputScale.sy *= actualSizeViewport.height / viewport.height; - outputScale.scaled = true; - } - - if (PDFJS.maxCanvasPixels > 0) { - var pixelsInViewport = viewport.width * viewport.height; - var maxScale = Math.sqrt(PDFJS.maxCanvasPixels / pixelsInViewport); - if (outputScale.sx > maxScale || outputScale.sy > maxScale) { - outputScale.sx = maxScale; - outputScale.sy = maxScale; - outputScale.scaled = true; - this.hasRestrictedScaling = true; - } else { - this.hasRestrictedScaling = false; - } - } - - var sfx = approximateFraction(outputScale.sx); - var sfy = approximateFraction(outputScale.sy); - canvas.width = roundToDivide(viewport.width * outputScale.sx, sfx[0]); - canvas.height = roundToDivide(viewport.height * outputScale.sy, sfy[0]); - canvas.style.width = roundToDivide(viewport.width, sfx[1]) + 'px'; - canvas.style.height = roundToDivide(viewport.height, sfy[1]) + 'px'; - // Add the viewport so it's known what it was originally drawn with. - canvas._viewport = viewport; - - var textLayerDiv = null; - var textLayer = null; - if (this.textLayerFactory) { - textLayerDiv = document.createElement('div'); - textLayerDiv.className = 'textLayer'; - textLayerDiv.style.width = canvasWrapper.style.width; - textLayerDiv.style.height = canvasWrapper.style.height; - if (this.annotationLayer && this.annotationLayer.div) { - // annotationLayer needs to stay on top - div.insertBefore(textLayerDiv, this.annotationLayer.div); - } else { - div.appendChild(textLayerDiv); - } - - textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, - this.id - 1, - this.viewport); - } - this.textLayer = textLayer; - - var resolveRenderPromise, rejectRenderPromise; - var promise = new Promise(function (resolve, reject) { - resolveRenderPromise = resolve; - rejectRenderPromise = reject; - }); - - // Rendering area - - var self = this; - function pageViewDrawCallback(error) { - // The renderTask may have been replaced by a new one, so only remove - // the reference to the renderTask if it matches the one that is - // triggering this callback. - if (renderTask === self.renderTask) { - self.renderTask = null; - } - - if (error === 'cancelled') { - rejectRenderPromise(error); - return; - } - - self.renderingState = RenderingStates.FINISHED; - - if (isCanvasHidden) { - self.canvas.removeAttribute('hidden'); - isCanvasHidden = false; - } - - if (self.loadingIconDiv) { - div.removeChild(self.loadingIconDiv); - delete self.loadingIconDiv; - } - - if (self.zoomLayer) { - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - var zoomLayerCanvas = self.zoomLayer.firstChild; - zoomLayerCanvas.width = 0; - zoomLayerCanvas.height = 0; - - div.removeChild(self.zoomLayer); - self.zoomLayer = null; - } - - self.error = error; - self.stats = pdfPage.stats; - if (self.onAfterDraw) { - self.onAfterDraw(); - } - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('pagerendered', true, true, { - pageNumber: self.id, - cssTransform: false, - }); - div.dispatchEvent(event); - // This custom event is deprecated, and will be removed in the future, - // please use the |pagerendered| event instead. - var deprecatedEvent = document.createEvent('CustomEvent'); - deprecatedEvent.initCustomEvent('pagerender', true, true, { - pageNumber: pdfPage.pageNumber - }); - div.dispatchEvent(deprecatedEvent); - - if (!error) { - resolveRenderPromise(undefined); - } else { - rejectRenderPromise(error); - } - } - - var renderContinueCallback = null; - if (this.renderingQueue) { - renderContinueCallback = function renderContinueCallback(cont) { - if (!self.renderingQueue.isHighestPriority(self)) { - self.renderingState = RenderingStates.PAUSED; - self.resume = function resumeCallback() { - self.renderingState = RenderingStates.RUNNING; - cont(); - }; - return; - } - if (isCanvasHidden) { - self.canvas.removeAttribute('hidden'); - isCanvasHidden = false; - } - cont(); - }; - } - - var transform = !outputScale.scaled ? null : - [outputScale.sx, 0, 0, outputScale.sy, 0, 0]; - var renderContext = { - canvasContext: ctx, - transform: transform, - viewport: this.viewport, - // intent: 'default', // === 'display' - }; - var renderTask = this.renderTask = this.pdfPage.render(renderContext); - renderTask.onContinue = renderContinueCallback; - - this.renderTask.promise.then( - function pdfPageRenderCallback() { - pageViewDrawCallback(null); - if (textLayer) { - self.pdfPage.getTextContent({ normalizeWhitespace: true }).then( - function textContentResolved(textContent) { - textLayer.setTextContent(textContent); - textLayer.render(TEXT_LAYER_RENDER_DELAY); - } - ); - } - }, - function pdfPageRenderError(error) { - pageViewDrawCallback(error); - } - ); - - if (this.annotationLayerFactory) { - if (!this.annotationLayer) { - this.annotationLayer = this.annotationLayerFactory. - createAnnotationLayerBuilder(div, this.pdfPage); - } - this.annotationLayer.render(this.viewport, 'display'); - } - div.setAttribute('data-loaded', true); - - if (self.onBeforeDraw) { - self.onBeforeDraw(); - } - return promise; - }, - - beforePrint: function PDFPageView_beforePrint() { - var CustomStyle = PDFJS.CustomStyle; - var pdfPage = this.pdfPage; - - var viewport = pdfPage.getViewport(1); - // Use the same hack we use for high dpi displays for printing to get - // better output until bug 811002 is fixed in FF. - var PRINT_OUTPUT_SCALE = 2; - var canvas = document.createElement('canvas'); - - // The logical size of the canvas. - canvas.width = Math.floor(viewport.width) * PRINT_OUTPUT_SCALE; - canvas.height = Math.floor(viewport.height) * PRINT_OUTPUT_SCALE; - - // The rendered size of the canvas, relative to the size of canvasWrapper. - canvas.style.width = (PRINT_OUTPUT_SCALE * 100) + '%'; - canvas.style.height = (PRINT_OUTPUT_SCALE * 100) + '%'; - - var cssScale = 'scale(' + (1 / PRINT_OUTPUT_SCALE) + ', ' + - (1 / PRINT_OUTPUT_SCALE) + ')'; - CustomStyle.setProp('transform' , canvas, cssScale); - CustomStyle.setProp('transformOrigin' , canvas, '0% 0%'); - - var printContainer = document.getElementById('printContainer'); - var canvasWrapper = document.createElement('div'); - canvasWrapper.style.width = viewport.width + 'pt'; - canvasWrapper.style.height = viewport.height + 'pt'; - canvasWrapper.appendChild(canvas); - printContainer.appendChild(canvasWrapper); - - canvas.mozPrintCallback = function(obj) { - var ctx = obj.context; - - ctx.save(); - ctx.fillStyle = 'rgb(255, 255, 255)'; - ctx.fillRect(0, 0, canvas.width, canvas.height); - ctx.restore(); - // Used by the mozCurrentTransform polyfill in src/display/canvas.js. - ctx._transformMatrix = - [PRINT_OUTPUT_SCALE, 0, 0, PRINT_OUTPUT_SCALE, 0, 0]; - ctx.scale(PRINT_OUTPUT_SCALE, PRINT_OUTPUT_SCALE); - - var renderContext = { - canvasContext: ctx, - viewport: viewport, - intent: 'print' - }; - - pdfPage.render(renderContext).promise.then(function() { - // Tell the printEngine that rendering this canvas/page has finished. - obj.done(); - }, function(error) { - console.error(error); - // Tell the printEngine that rendering this canvas/page has failed. - // This will make the print proces stop. - if ('abort' in obj) { - obj.abort(); - } else { - obj.done(); - } - }); - }; - }, - }; - - return PDFPageView; -})(); - - -/** - * @typedef {Object} TextLayerBuilderOptions - * @property {HTMLDivElement} textLayerDiv - The text layer container. - * @property {number} pageIndex - The page index. - * @property {PageViewport} viewport - The viewport of the text layer. - * @property {PDFFindController} findController - */ - -/** - * TextLayerBuilder provides text-selection functionality for the PDF. - * It does this by creating overlay divs over the PDF text. These divs - * contain text that matches the PDF text they are overlaying. This object - * also provides a way to highlight text that is being searched for. - * @class - */ -var TextLayerBuilder = (function TextLayerBuilderClosure() { - function TextLayerBuilder(options) { - this.textLayerDiv = options.textLayerDiv; - this.renderingDone = false; - this.divContentDone = false; - this.pageIdx = options.pageIndex; - this.pageNumber = this.pageIdx + 1; - this.matches = []; - this.viewport = options.viewport; - this.textDivs = []; - this.findController = options.findController || null; - this.textLayerRenderTask = null; - this._bindMouse(); - } - - TextLayerBuilder.prototype = { - _finishRendering: function TextLayerBuilder_finishRendering() { - this.renderingDone = true; - - var endOfContent = document.createElement('div'); - endOfContent.className = 'endOfContent'; - this.textLayerDiv.appendChild(endOfContent); - - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('textlayerrendered', true, true, { - pageNumber: this.pageNumber - }); - this.textLayerDiv.dispatchEvent(event); - }, - - /** - * Renders the text layer. - * @param {number} timeout (optional) if specified, the rendering waits - * for specified amount of ms. - */ - render: function TextLayerBuilder_render(timeout) { - if (!this.divContentDone || this.renderingDone) { - return; - } - - if (this.textLayerRenderTask) { - this.textLayerRenderTask.cancel(); - this.textLayerRenderTask = null; - } - - this.textDivs = []; - var textLayerFrag = document.createDocumentFragment(); - this.textLayerRenderTask = PDFJS.renderTextLayer({ - textContent: this.textContent, - container: textLayerFrag, - viewport: this.viewport, - textDivs: this.textDivs, - timeout: timeout - }); - this.textLayerRenderTask.promise.then(function () { - this.textLayerDiv.appendChild(textLayerFrag); - this._finishRendering(); - this.updateMatches(); - }.bind(this), function (reason) { - // canceled or failed to render text layer -- skipping errors - }); - }, - - setTextContent: function TextLayerBuilder_setTextContent(textContent) { - if (this.textLayerRenderTask) { - this.textLayerRenderTask.cancel(); - this.textLayerRenderTask = null; - } - this.textContent = textContent; - this.divContentDone = true; - }, - - convertMatches: function TextLayerBuilder_convertMatches(matches) { - var i = 0; - var iIndex = 0; - var bidiTexts = this.textContent.items; - var end = bidiTexts.length - 1; - var queryLen = (this.findController === null ? - 0 : this.findController.state.query.length); - var ret = []; - - for (var m = 0, len = matches.length; m < len; m++) { - // Calculate the start position. - var matchIdx = matches[m]; - - // Loop over the divIdxs. - while (i !== end && matchIdx >= (iIndex + bidiTexts[i].str.length)) { - iIndex += bidiTexts[i].str.length; - i++; - } - - if (i === bidiTexts.length) { - console.error('Could not find a matching mapping'); - } - - var match = { - begin: { - divIdx: i, - offset: matchIdx - iIndex - } - }; - - // Calculate the end position. - matchIdx += queryLen; - - // Somewhat the same array as above, but use > instead of >= to get - // the end position right. - while (i !== end && matchIdx > (iIndex + bidiTexts[i].str.length)) { - iIndex += bidiTexts[i].str.length; - i++; - } - - match.end = { - divIdx: i, - offset: matchIdx - iIndex - }; - ret.push(match); - } - - return ret; - }, - - renderMatches: function TextLayerBuilder_renderMatches(matches) { - // Early exit if there is nothing to render. - if (matches.length === 0) { - return; - } - - var bidiTexts = this.textContent.items; - var textDivs = this.textDivs; - var prevEnd = null; - var pageIdx = this.pageIdx; - var isSelectedPage = (this.findController === null ? - false : (pageIdx === this.findController.selected.pageIdx)); - var selectedMatchIdx = (this.findController === null ? - -1 : this.findController.selected.matchIdx); - var highlightAll = (this.findController === null ? - false : this.findController.state.highlightAll); - var infinity = { - divIdx: -1, - offset: undefined - }; - - function beginText(begin, className) { - var divIdx = begin.divIdx; - textDivs[divIdx].textContent = ''; - appendTextToDiv(divIdx, 0, begin.offset, className); - } - - function appendTextToDiv(divIdx, fromOffset, toOffset, className) { - var div = textDivs[divIdx]; - var content = bidiTexts[divIdx].str.substring(fromOffset, toOffset); - var node = document.createTextNode(content); - if (className) { - var span = document.createElement('span'); - span.className = className; - span.appendChild(node); - div.appendChild(span); - return; - } - div.appendChild(node); - } - - var i0 = selectedMatchIdx, i1 = i0 + 1; - if (highlightAll) { - i0 = 0; - i1 = matches.length; - } else if (!isSelectedPage) { - // Not highlighting all and this isn't the selected page, so do nothing. - return; - } - - for (var i = i0; i < i1; i++) { - var match = matches[i]; - var begin = match.begin; - var end = match.end; - var isSelected = (isSelectedPage && i === selectedMatchIdx); - var highlightSuffix = (isSelected ? ' selected' : ''); - - if (this.findController) { - this.findController.updateMatchPosition(pageIdx, i, textDivs, - begin.divIdx, end.divIdx); - } - - // Match inside new div. - if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { - // If there was a previous div, then add the text at the end. - if (prevEnd !== null) { - appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); - } - // Clear the divs and set the content until the starting point. - beginText(begin); - } else { - appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); - } - - if (begin.divIdx === end.divIdx) { - appendTextToDiv(begin.divIdx, begin.offset, end.offset, - 'highlight' + highlightSuffix); - } else { - appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, - 'highlight begin' + highlightSuffix); - for (var n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { - textDivs[n0].className = 'highlight middle' + highlightSuffix; - } - beginText(end, 'highlight end' + highlightSuffix); - } - prevEnd = end; - } - - if (prevEnd) { - appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); - } - }, - - updateMatches: function TextLayerBuilder_updateMatches() { - // Only show matches when all rendering is done. - if (!this.renderingDone) { - return; - } - - // Clear all matches. - var matches = this.matches; - var textDivs = this.textDivs; - var bidiTexts = this.textContent.items; - var clearedUntilDivIdx = -1; - - // Clear all current matches. - for (var i = 0, len = matches.length; i < len; i++) { - var match = matches[i]; - var begin = Math.max(clearedUntilDivIdx, match.begin.divIdx); - for (var n = begin, end = match.end.divIdx; n <= end; n++) { - var div = textDivs[n]; - div.textContent = bidiTexts[n].str; - div.className = ''; - } - clearedUntilDivIdx = match.end.divIdx + 1; - } - - if (this.findController === null || !this.findController.active) { - return; - } - - // Convert the matches on the page controller into the match format - // used for the textLayer. - this.matches = this.convertMatches(this.findController === null ? - [] : (this.findController.pageMatches[this.pageIdx] || [])); - this.renderMatches(this.matches); - }, - - /** - * Fixes text selection: adds additional div where mouse was clicked. - * This reduces flickering of the content if mouse slowly dragged down/up. - * @private - */ - _bindMouse: function TextLayerBuilder_bindMouse() { - var div = this.textLayerDiv; - div.addEventListener('mousedown', function (e) { - var end = div.querySelector('.endOfContent'); - if (!end) { - return; - } - // On non-Firefox browsers, the selection will feel better if the height - // of the endOfContent div will be adjusted to start at mouse click - // location -- this will avoid flickering when selections moves up. - // However it does not work when selection started on empty space. - var adjustTop = e.target !== div; - adjustTop = adjustTop && window.getComputedStyle(end). - getPropertyValue('-moz-user-select') !== 'none'; - if (adjustTop) { - var divBounds = div.getBoundingClientRect(); - var r = Math.max(0, (e.pageY - divBounds.top) / divBounds.height); - end.style.top = (r * 100).toFixed(2) + '%'; - } - end.classList.add('active'); - }); - div.addEventListener('mouseup', function (e) { - var end = div.querySelector('.endOfContent'); - if (!end) { - return; - } - end.style.top = ''; - end.classList.remove('active'); - }); - }, - }; - return TextLayerBuilder; -})(); - -/** - * @constructor - * @implements IPDFTextLayerFactory - */ -function DefaultTextLayerFactory() {} -DefaultTextLayerFactory.prototype = { - /** - * @param {HTMLDivElement} textLayerDiv - * @param {number} pageIndex - * @param {PageViewport} viewport - * @returns {TextLayerBuilder} - */ - createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport) { - return new TextLayerBuilder({ - textLayerDiv: textLayerDiv, - pageIndex: pageIndex, - viewport: viewport - }); - } -}; - - -/** - * @typedef {Object} AnnotationLayerBuilderOptions - * @property {HTMLDivElement} pageDiv - * @property {PDFPage} pdfPage - * @property {IPDFLinkService} linkService - */ - -/** - * @class - */ -var AnnotationLayerBuilder = (function AnnotationLayerBuilderClosure() { - /** - * @param {AnnotationLayerBuilderOptions} options - * @constructs AnnotationLayerBuilder - */ - function AnnotationLayerBuilder(options) { - this.pageDiv = options.pageDiv; - this.pdfPage = options.pdfPage; - this.linkService = options.linkService; - - this.div = null; - } - - AnnotationLayerBuilder.prototype = - /** @lends AnnotationLayerBuilder.prototype */ { - - /** - * @param {PageViewport} viewport - * @param {string} intent (default value is 'display') - */ - render: function AnnotationLayerBuilder_render(viewport, intent) { - var self = this; - var parameters = { - intent: (intent === undefined ? 'display' : intent), - }; - - this.pdfPage.getAnnotations(parameters).then(function (annotations) { - viewport = viewport.clone({ dontFlip: true }); - parameters = { - viewport: viewport, - div: self.div, - annotations: annotations, - page: self.pdfPage, - linkService: self.linkService - }; - - if (self.div) { - // If an annotationLayer already exists, refresh its children's - // transformation matrices. - PDFJS.AnnotationLayer.update(parameters); - } else { - // Create an annotation layer div and render the annotations - // if there is at least one annotation. - if (annotations.length === 0) { - return; - } - - self.div = document.createElement('div'); - self.div.className = 'annotationLayer'; - self.pageDiv.appendChild(self.div); - parameters.div = self.div; - - PDFJS.AnnotationLayer.render(parameters); - } - }); - }, - - hide: function AnnotationLayerBuilder_hide() { - if (!this.div) { - return; - } - this.div.setAttribute('hidden', 'true'); - } - }; - - return AnnotationLayerBuilder; -})(); - -/** - * @constructor - * @implements IPDFAnnotationLayerFactory - */ -function DefaultAnnotationLayerFactory() {} -DefaultAnnotationLayerFactory.prototype = { - /** - * @param {HTMLDivElement} pageDiv - * @param {PDFPage} pdfPage - * @returns {AnnotationLayerBuilder} - */ - createAnnotationLayerBuilder: function (pageDiv, pdfPage) { - return new AnnotationLayerBuilder({ - pageDiv: pageDiv, - pdfPage: pdfPage, - linkService: new SimpleLinkService(), - }); - } -}; - - -/** - * @typedef {Object} PDFViewerOptions - * @property {HTMLDivElement} container - The container for the viewer element. - * @property {HTMLDivElement} viewer - (optional) The viewer element. - * @property {IPDFLinkService} linkService - The navigation/linking service. - * @property {PDFRenderingQueue} renderingQueue - (optional) The rendering - * queue object. - * @property {boolean} removePageBorders - (optional) Removes the border shadow - * around the pages. The default is false. - */ - -/** - * Simple viewer control to display PDF content/pages. - * @class - * @implements {IRenderableView} - */ -var PDFViewer = (function pdfViewer() { - function PDFPageViewBuffer(size) { - var data = []; - this.push = function cachePush(view) { - var i = data.indexOf(view); - if (i >= 0) { - data.splice(i, 1); - } - data.push(view); - if (data.length > size) { - data.shift().destroy(); - } - }; - this.resize = function (newSize) { - size = newSize; - while (data.length > size) { - data.shift().destroy(); - } - }; - } - - function isSameScale(oldScale, newScale) { - if (newScale === oldScale) { - return true; - } - if (Math.abs(newScale - oldScale) < 1e-15) { - // Prevent unnecessary re-rendering of all pages when the scale - // changes only because of limited numerical precision. - return true; - } - return false; - } - - /** - * @constructs PDFViewer - * @param {PDFViewerOptions} options - */ - function PDFViewer(options) { - this.container = options.container; - this.viewer = options.viewer || options.container.firstElementChild; - this.linkService = options.linkService || new SimpleLinkService(); - this.removePageBorders = options.removePageBorders || false; - - this.defaultRenderingQueue = !options.renderingQueue; - if (this.defaultRenderingQueue) { - // Custom rendering queue is not specified, using default one - this.renderingQueue = new PDFRenderingQueue(); - this.renderingQueue.setViewer(this); - } else { - this.renderingQueue = options.renderingQueue; - } - - this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this)); - this.updateInProgress = false; - this.presentationModeState = PresentationModeState.UNKNOWN; - this._resetView(); - - if (this.removePageBorders) { - this.viewer.classList.add('removePageBorders'); - } - } - - PDFViewer.prototype = /** @lends PDFViewer.prototype */{ - get pagesCount() { - return this._pages.length; - }, - - getPageView: function (index) { - return this._pages[index]; - }, - - get currentPageNumber() { - return this._currentPageNumber; - }, - - set currentPageNumber(val) { - if (!this.pdfDocument) { - this._currentPageNumber = val; - return; - } - - var event = document.createEvent('UIEvents'); - event.initUIEvent('pagechange', true, true, window, 0); - event.updateInProgress = this.updateInProgress; - - if (!(0 < val && val <= this.pagesCount)) { - event.pageNumber = this._currentPageNumber; - event.previousPageNumber = val; - this.container.dispatchEvent(event); - return; - } - - event.previousPageNumber = this._currentPageNumber; - this._currentPageNumber = val; - event.pageNumber = val; - this.container.dispatchEvent(event); - - // Check if the caller is `PDFViewer_update`, to avoid breaking scrolling. - if (this.updateInProgress) { - return; - } - this.scrollPageIntoView(val); - }, - - /** - * @returns {number} - */ - get currentScale() { - return this._currentScale !== UNKNOWN_SCALE ? this._currentScale : - DEFAULT_SCALE; - }, - - /** - * @param {number} val - Scale of the pages in percents. - */ - set currentScale(val) { - if (isNaN(val)) { - throw new Error('Invalid numeric scale'); - } - if (!this.pdfDocument) { - this._currentScale = val; - this._currentScaleValue = val !== UNKNOWN_SCALE ? val.toString() : null; - return; - } - this._setScale(val, false); - }, - - /** - * @returns {string} - */ - get currentScaleValue() { - return this._currentScaleValue; - }, - - /** - * @param val - The scale of the pages (in percent or predefined value). - */ - set currentScaleValue(val) { - if (!this.pdfDocument) { - this._currentScale = isNaN(val) ? UNKNOWN_SCALE : val; - this._currentScaleValue = val; - return; - } - this._setScale(val, false); - }, - - /** - * @returns {number} - */ - get pagesRotation() { - return this._pagesRotation; - }, - - /** - * @param {number} rotation - The rotation of the pages (0, 90, 180, 270). - */ - set pagesRotation(rotation) { - this._pagesRotation = rotation; - - for (var i = 0, l = this._pages.length; i < l; i++) { - var pageView = this._pages[i]; - pageView.update(pageView.scale, rotation); - } - - this._setScale(this._currentScaleValue, true); - - if (this.defaultRenderingQueue) { - this.update(); - } - }, - - /** - * @param pdfDocument {PDFDocument} - */ - setDocument: function (pdfDocument) { - if (this.pdfDocument) { - this._resetView(); - } - - this.pdfDocument = pdfDocument; - if (!pdfDocument) { - return; - } - - var pagesCount = pdfDocument.numPages; - var self = this; - - var resolvePagesPromise; - var pagesPromise = new Promise(function (resolve) { - resolvePagesPromise = resolve; - }); - this.pagesPromise = pagesPromise; - pagesPromise.then(function () { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('pagesloaded', true, true, { - pagesCount: pagesCount - }); - self.container.dispatchEvent(event); - }); - - var isOnePageRenderedResolved = false; - var resolveOnePageRendered = null; - var onePageRendered = new Promise(function (resolve) { - resolveOnePageRendered = resolve; - }); - this.onePageRendered = onePageRendered; - - var bindOnAfterAndBeforeDraw = function (pageView) { - pageView.onBeforeDraw = function pdfViewLoadOnBeforeDraw() { - // Add the page to the buffer at the start of drawing. That way it can - // be evicted from the buffer and destroyed even if we pause its - // rendering. - self._buffer.push(this); - }; - // when page is painted, using the image as thumbnail base - pageView.onAfterDraw = function pdfViewLoadOnAfterDraw() { - if (!isOnePageRenderedResolved) { - isOnePageRenderedResolved = true; - resolveOnePageRendered(); - } - }; - }; - - var firstPagePromise = pdfDocument.getPage(1); - this.firstPagePromise = firstPagePromise; - - // Fetch a single page so we can get a viewport that will be the default - // viewport for all pages - return firstPagePromise.then(function(pdfPage) { - var scale = this.currentScale; - var viewport = pdfPage.getViewport(scale * CSS_UNITS); - for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { - var textLayerFactory = null; - if (!PDFJS.disableTextLayer) { - textLayerFactory = this; - } - var pageView = new PDFPageView({ - container: this.viewer, - id: pageNum, - scale: scale, - defaultViewport: viewport.clone(), - renderingQueue: this.renderingQueue, - textLayerFactory: textLayerFactory, - annotationLayerFactory: this - }); - bindOnAfterAndBeforeDraw(pageView); - this._pages.push(pageView); - } - - var linkService = this.linkService; - - // Fetch all the pages since the viewport is needed before printing - // starts to create the correct size canvas. Wait until one page is - // rendered so we don't tie up too many resources early on. - onePageRendered.then(function () { - if (!PDFJS.disableAutoFetch) { - var getPagesLeft = pagesCount; - for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { - pdfDocument.getPage(pageNum).then(function (pageNum, pdfPage) { - var pageView = self._pages[pageNum - 1]; - if (!pageView.pdfPage) { - pageView.setPdfPage(pdfPage); - } - linkService.cachePageRef(pageNum, pdfPage.ref); - getPagesLeft--; - if (!getPagesLeft) { - resolvePagesPromise(); - } - }.bind(null, pageNum)); - } - } else { - // XXX: Printing is semi-broken with auto fetch disabled. - resolvePagesPromise(); - } - }); - - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('pagesinit', true, true, null); - self.container.dispatchEvent(event); - - if (this.defaultRenderingQueue) { - this.update(); - } - - if (this.findController) { - this.findController.resolveFirstPage(); - } - }.bind(this)); - }, - - _resetView: function () { - this._pages = []; - this._currentPageNumber = 1; - this._currentScale = UNKNOWN_SCALE; - this._currentScaleValue = null; - this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); - this._location = null; - this._pagesRotation = 0; - this._pagesRequests = []; - - var container = this.viewer; - while (container.hasChildNodes()) { - container.removeChild(container.lastChild); - } - }, - - _scrollUpdate: function PDFViewer_scrollUpdate() { - if (this.pagesCount === 0) { - return; - } - this.update(); - for (var i = 0, ii = this._pages.length; i < ii; i++) { - this._pages[i].updatePosition(); - } - }, - - _setScaleDispatchEvent: function pdfViewer_setScaleDispatchEvent( - newScale, newValue, preset) { - var event = document.createEvent('UIEvents'); - event.initUIEvent('scalechange', true, true, window, 0); - event.scale = newScale; - if (preset) { - event.presetValue = newValue; - } - this.container.dispatchEvent(event); - }, - - _setScaleUpdatePages: function pdfViewer_setScaleUpdatePages( - newScale, newValue, noScroll, preset) { - this._currentScaleValue = newValue; - - if (isSameScale(this._currentScale, newScale)) { - if (preset) { - this._setScaleDispatchEvent(newScale, newValue, true); - } - return; - } - - for (var i = 0, ii = this._pages.length; i < ii; i++) { - this._pages[i].update(newScale); - } - this._currentScale = newScale; - - if (!noScroll) { - var page = this._currentPageNumber, dest; - if (this._location && !IGNORE_CURRENT_POSITION_ON_ZOOM && - !(this.isInPresentationMode || this.isChangingPresentationMode)) { - page = this._location.pageNumber; - dest = [null, { name: 'XYZ' }, this._location.left, - this._location.top, null]; - } - this.scrollPageIntoView(page, dest); - } - - this._setScaleDispatchEvent(newScale, newValue, preset); - - if (this.defaultRenderingQueue) { - this.update(); - } - }, - - _setScale: function pdfViewer_setScale(value, noScroll) { - var scale = parseFloat(value); - - if (scale > 0) { - this._setScaleUpdatePages(scale, value, noScroll, false); - } else { - var currentPage = this._pages[this._currentPageNumber - 1]; - if (!currentPage) { - return; - } - var hPadding = (this.isInPresentationMode || this.removePageBorders) ? - 0 : SCROLLBAR_PADDING; - var vPadding = (this.isInPresentationMode || this.removePageBorders) ? - 0 : VERTICAL_PADDING; - var pageWidthScale = (this.container.clientWidth - hPadding) / - currentPage.width * currentPage.scale; - var pageHeightScale = (this.container.clientHeight - vPadding) / - currentPage.height * currentPage.scale; - switch (value) { - case 'page-actual': - scale = 1; - break; - case 'page-width': - scale = pageWidthScale; - break; - case 'page-height': - scale = pageHeightScale; - break; - case 'page-fit': - scale = Math.min(pageWidthScale, pageHeightScale); - break; - case 'auto': - var isLandscape = (currentPage.width > currentPage.height); - // For pages in landscape mode, fit the page height to the viewer - // *unless* the page would thus become too wide to fit horizontally. - var horizontalScale = isLandscape ? - Math.min(pageHeightScale, pageWidthScale) : pageWidthScale; - scale = Math.min(MAX_AUTO_SCALE, horizontalScale); - break; - default: - console.error('pdfViewSetScale: \'' + value + - '\' is an unknown zoom value.'); - return; - } - this._setScaleUpdatePages(scale, value, noScroll, true); - } - }, - - /** - * Scrolls page into view. - * @param {number} pageNumber - * @param {Array} dest - (optional) original PDF destination array: - * - */ - scrollPageIntoView: function PDFViewer_scrollPageIntoView(pageNumber, - dest) { - if (!this.pdfDocument) { - return; - } - - var pageView = this._pages[pageNumber - 1]; - - if (this.isInPresentationMode) { - if (this._currentPageNumber !== pageView.id) { - // Avoid breaking getVisiblePages in presentation mode. - this.currentPageNumber = pageView.id; - return; - } - dest = null; - // Fixes the case when PDF has different page sizes. - this._setScale(this._currentScaleValue, true); - } - if (!dest) { - scrollIntoView(pageView.div); - return; - } - - var x = 0, y = 0; - var width = 0, height = 0, widthScale, heightScale; - var changeOrientation = (pageView.rotation % 180 === 0 ? false : true); - var pageWidth = (changeOrientation ? pageView.height : pageView.width) / - pageView.scale / CSS_UNITS; - var pageHeight = (changeOrientation ? pageView.width : pageView.height) / - pageView.scale / CSS_UNITS; - var scale = 0; - switch (dest[1].name) { - case 'XYZ': - x = dest[2]; - y = dest[3]; - scale = dest[4]; - // If x and/or y coordinates are not supplied, default to - // _top_ left of the page (not the obvious bottom left, - // since aligning the bottom of the intended page with the - // top of the window is rarely helpful). - x = x !== null ? x : 0; - y = y !== null ? y : pageHeight; - break; - case 'Fit': - case 'FitB': - scale = 'page-fit'; - break; - case 'FitH': - case 'FitBH': - y = dest[2]; - scale = 'page-width'; - // According to the PDF spec, section 12.3.2.2, a `null` value in the - // parameter should maintain the position relative to the new page. - if (y === null && this._location) { - x = this._location.left; - y = this._location.top; - } - break; - case 'FitV': - case 'FitBV': - x = dest[2]; - width = pageWidth; - height = pageHeight; - scale = 'page-height'; - break; - case 'FitR': - x = dest[2]; - y = dest[3]; - width = dest[4] - x; - height = dest[5] - y; - var hPadding = this.removePageBorders ? 0 : SCROLLBAR_PADDING; - var vPadding = this.removePageBorders ? 0 : VERTICAL_PADDING; - - widthScale = (this.container.clientWidth - hPadding) / - width / CSS_UNITS; - heightScale = (this.container.clientHeight - vPadding) / - height / CSS_UNITS; - scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); - break; - default: - return; - } - - if (scale && scale !== this._currentScale) { - this.currentScaleValue = scale; - } else if (this._currentScale === UNKNOWN_SCALE) { - this.currentScaleValue = DEFAULT_SCALE_VALUE; - } - - if (scale === 'page-fit' && !dest[4]) { - scrollIntoView(pageView.div); - return; - } - - var boundingRect = [ - pageView.viewport.convertToViewportPoint(x, y), - pageView.viewport.convertToViewportPoint(x + width, y + height) - ]; - var left = Math.min(boundingRect[0][0], boundingRect[1][0]); - var top = Math.min(boundingRect[0][1], boundingRect[1][1]); - - scrollIntoView(pageView.div, { left: left, top: top }); - }, - - _updateLocation: function (firstPage) { - var currentScale = this._currentScale; - var currentScaleValue = this._currentScaleValue; - var normalizedScaleValue = - parseFloat(currentScaleValue) === currentScale ? - Math.round(currentScale * 10000) / 100 : currentScaleValue; - - var pageNumber = firstPage.id; - var pdfOpenParams = '#page=' + pageNumber; - pdfOpenParams += '&zoom=' + normalizedScaleValue; - var currentPageView = this._pages[pageNumber - 1]; - var container = this.container; - var topLeft = currentPageView.getPagePoint( - (container.scrollLeft - firstPage.x), - (container.scrollTop - firstPage.y)); - var intLeft = Math.round(topLeft[0]); - var intTop = Math.round(topLeft[1]); - pdfOpenParams += ',' + intLeft + ',' + intTop; - - this._location = { - pageNumber: pageNumber, - scale: normalizedScaleValue, - top: intTop, - left: intLeft, - pdfOpenParams: pdfOpenParams - }; - }, - - update: function PDFViewer_update() { - var visible = this._getVisiblePages(); - var visiblePages = visible.views; - if (visiblePages.length === 0) { - return; - } - - this.updateInProgress = true; - - var suggestedCacheSize = Math.max(DEFAULT_CACHE_SIZE, - 2 * visiblePages.length + 1); - this._buffer.resize(suggestedCacheSize); - - this.renderingQueue.renderHighestPriority(visible); - - var currentId = this._currentPageNumber; - var firstPage = visible.first; - - for (var i = 0, ii = visiblePages.length, stillFullyVisible = false; - i < ii; ++i) { - var page = visiblePages[i]; - - if (page.percent < 100) { - break; - } - if (page.id === currentId) { - stillFullyVisible = true; - break; - } - } - - if (!stillFullyVisible) { - currentId = visiblePages[0].id; - } - - if (!this.isInPresentationMode) { - this.currentPageNumber = currentId; - } - - this._updateLocation(firstPage); - - this.updateInProgress = false; - - var event = document.createEvent('UIEvents'); - event.initUIEvent('updateviewarea', true, true, window, 0); - event.location = this._location; - this.container.dispatchEvent(event); - }, - - containsElement: function (element) { - return this.container.contains(element); - }, - - focus: function () { - this.container.focus(); - }, - - get isInPresentationMode() { - return this.presentationModeState === PresentationModeState.FULLSCREEN; - }, - - get isChangingPresentationMode() { - return this.presentationModeState === PresentationModeState.CHANGING; - }, - - get isHorizontalScrollbarEnabled() { - return (this.isInPresentationMode ? - false : (this.container.scrollWidth > this.container.clientWidth)); - }, - - _getVisiblePages: function () { - if (!this.isInPresentationMode) { - return getVisibleElements(this.container, this._pages, true); - } else { - // The algorithm in getVisibleElements doesn't work in all browsers and - // configurations when presentation mode is active. - var visible = []; - var currentPage = this._pages[this._currentPageNumber - 1]; - visible.push({ id: currentPage.id, view: currentPage }); - return { first: currentPage, last: currentPage, views: visible }; - } - }, - - cleanup: function () { - for (var i = 0, ii = this._pages.length; i < ii; i++) { - if (this._pages[i] && - this._pages[i].renderingState !== RenderingStates.FINISHED) { - this._pages[i].reset(); - } - } - }, - - /** - * @param {PDFPageView} pageView - * @returns {PDFPage} - * @private - */ - _ensurePdfPageLoaded: function (pageView) { - if (pageView.pdfPage) { - return Promise.resolve(pageView.pdfPage); - } - var pageNumber = pageView.id; - if (this._pagesRequests[pageNumber]) { - return this._pagesRequests[pageNumber]; - } - var promise = this.pdfDocument.getPage(pageNumber).then( - function (pdfPage) { - pageView.setPdfPage(pdfPage); - this._pagesRequests[pageNumber] = null; - return pdfPage; - }.bind(this)); - this._pagesRequests[pageNumber] = promise; - return promise; - }, - - forceRendering: function (currentlyVisiblePages) { - var visiblePages = currentlyVisiblePages || this._getVisiblePages(); - var pageView = this.renderingQueue.getHighestPriority(visiblePages, - this._pages, - this.scroll.down); - if (pageView) { - this._ensurePdfPageLoaded(pageView).then(function () { - this.renderingQueue.renderView(pageView); - }.bind(this)); - return true; - } - return false; - }, - - getPageTextContent: function (pageIndex) { - return this.pdfDocument.getPage(pageIndex + 1).then(function (page) { - return page.getTextContent({ normalizeWhitespace: true }); - }); - }, - - /** - * @param {HTMLDivElement} textLayerDiv - * @param {number} pageIndex - * @param {PageViewport} viewport - * @returns {TextLayerBuilder} - */ - createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport) { - return new TextLayerBuilder({ - textLayerDiv: textLayerDiv, - pageIndex: pageIndex, - viewport: viewport, - findController: this.isInPresentationMode ? null : this.findController - }); - }, - - /** - * @param {HTMLDivElement} pageDiv - * @param {PDFPage} pdfPage - * @returns {AnnotationLayerBuilder} - */ - createAnnotationLayerBuilder: function (pageDiv, pdfPage) { - return new AnnotationLayerBuilder({ - pageDiv: pageDiv, - pdfPage: pdfPage, - linkService: this.linkService - }); - }, - - setFindController: function (findController) { - this.findController = findController; - }, - }; - - return PDFViewer; -})(); - -var SimpleLinkService = (function SimpleLinkServiceClosure() { - function SimpleLinkService() {} - - SimpleLinkService.prototype = { - /** - * @returns {number} - */ - get page() { - return 0; - }, - /** - * @param {number} value - */ - set page(value) {}, - /** - * @param dest - The PDF destination object. - */ - navigateTo: function (dest) {}, - /** - * @param dest - The PDF destination object. - * @returns {string} The hyperlink to the PDF object. - */ - getDestinationHash: function (dest) { - return '#'; - }, - /** - * @param hash - The PDF parameters/hash. - * @returns {string} The hyperlink to the PDF object. - */ - getAnchorUrl: function (hash) { - return '#'; - }, - /** - * @param {string} hash - */ - setHash: function (hash) {}, - /** - * @param {string} action - */ - executeNamedAction: function (action) {}, - /** - * @param {number} pageNum - page number. - * @param {Object} pageRef - reference to the page. - */ - cachePageRef: function (pageNum, pageRef) {} - }; - return SimpleLinkService; -})(); - - -var THUMBNAIL_SCROLL_MARGIN = -19; - - -var THUMBNAIL_WIDTH = 98; // px -var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; // px - -/** - * @typedef {Object} PDFThumbnailViewOptions - * @property {HTMLDivElement} container - The viewer element. - * @property {number} id - The thumbnail's unique ID (normally its number). - * @property {PageViewport} defaultViewport - The page viewport. - * @property {IPDFLinkService} linkService - The navigation/linking service. - * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. - */ - -/** - * @class - * @implements {IRenderableView} - */ -var PDFThumbnailView = (function PDFThumbnailViewClosure() { - function getTempCanvas(width, height) { - var tempCanvas = PDFThumbnailView.tempImageCache; - if (!tempCanvas) { - tempCanvas = document.createElement('canvas'); - PDFThumbnailView.tempImageCache = tempCanvas; - } - tempCanvas.width = width; - tempCanvas.height = height; - - // Since this is a temporary canvas, we need to fill the canvas with a white - // background ourselves. |_getPageDrawContext| uses CSS rules for this. - tempCanvas.mozOpaque = true; - var ctx = tempCanvas.getContext('2d', {alpha: false}); - ctx.save(); - ctx.fillStyle = 'rgb(255, 255, 255)'; - ctx.fillRect(0, 0, width, height); - ctx.restore(); - return tempCanvas; - } - - /** - * @constructs PDFThumbnailView - * @param {PDFThumbnailViewOptions} options - */ - function PDFThumbnailView(options) { - var container = options.container; - var id = options.id; - var defaultViewport = options.defaultViewport; - var linkService = options.linkService; - var renderingQueue = options.renderingQueue; - - this.id = id; - this.renderingId = 'thumbnail' + id; - - this.pdfPage = null; - this.rotation = 0; - this.viewport = defaultViewport; - this.pdfPageRotate = defaultViewport.rotation; - - this.linkService = linkService; - this.renderingQueue = renderingQueue; - - this.hasImage = false; - this.resume = null; - this.renderingState = RenderingStates.INITIAL; - - this.pageWidth = this.viewport.width; - this.pageHeight = this.viewport.height; - this.pageRatio = this.pageWidth / this.pageHeight; - - this.canvasWidth = THUMBNAIL_WIDTH; - this.canvasHeight = (this.canvasWidth / this.pageRatio) | 0; - this.scale = this.canvasWidth / this.pageWidth; - - var anchor = document.createElement('a'); - anchor.href = linkService.getAnchorUrl('#page=' + id); - anchor.title = 'Page ' + id; - anchor.onclick = function stopNavigation() { - linkService.page = id; - return false; - }; - - var div = document.createElement('div'); - div.id = 'thumbnailContainer' + id; - div.className = 'thumbnail'; - this.div = div; - - if (id === 1) { - // Highlight the thumbnail of the first page when no page number is - // specified (or exists in cache) when the document is loaded. - div.classList.add('selected'); - } - - var ring = document.createElement('div'); - ring.className = 'thumbnailSelectionRing'; - var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; - ring.style.width = this.canvasWidth + borderAdjustment + 'px'; - ring.style.height = this.canvasHeight + borderAdjustment + 'px'; - this.ring = ring; - - div.appendChild(ring); - anchor.appendChild(div); - container.appendChild(anchor); - } - - PDFThumbnailView.prototype = { - setPdfPage: function PDFThumbnailView_setPdfPage(pdfPage) { - this.pdfPage = pdfPage; - this.pdfPageRotate = pdfPage.rotate; - var totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = pdfPage.getViewport(1, totalRotation); - this.reset(); - }, - - reset: function PDFThumbnailView_reset() { - if (this.renderTask) { - this.renderTask.cancel(); - } - this.hasImage = false; - this.resume = null; - this.renderingState = RenderingStates.INITIAL; - - this.pageWidth = this.viewport.width; - this.pageHeight = this.viewport.height; - this.pageRatio = this.pageWidth / this.pageHeight; - - this.canvasHeight = (this.canvasWidth / this.pageRatio) | 0; - this.scale = (this.canvasWidth / this.pageWidth); - - this.div.removeAttribute('data-loaded'); - var ring = this.ring; - var childNodes = ring.childNodes; - for (var i = childNodes.length - 1; i >= 0; i--) { - ring.removeChild(childNodes[i]); - } - var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; - ring.style.width = this.canvasWidth + borderAdjustment + 'px'; - ring.style.height = this.canvasHeight + borderAdjustment + 'px'; - - if (this.canvas) { - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - this.canvas.width = 0; - this.canvas.height = 0; - delete this.canvas; - } - if (this.image) { - this.image.removeAttribute('src'); - delete this.image; - } - }, - - update: function PDFThumbnailView_update(rotation) { - if (typeof rotation !== 'undefined') { - this.rotation = rotation; - } - var totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = this.viewport.clone({ - scale: 1, - rotation: totalRotation - }); - this.reset(); - }, - - /** - * @private - */ - _getPageDrawContext: - function PDFThumbnailView_getPageDrawContext(noCtxScale) { - var canvas = document.createElement('canvas'); - this.canvas = canvas; - - canvas.mozOpaque = true; - var ctx = canvas.getContext('2d', {alpha: false}); - var outputScale = getOutputScale(ctx); - - canvas.width = (this.canvasWidth * outputScale.sx) | 0; - canvas.height = (this.canvasHeight * outputScale.sy) | 0; - canvas.style.width = this.canvasWidth + 'px'; - canvas.style.height = this.canvasHeight + 'px'; - - if (!noCtxScale && outputScale.scaled) { - ctx.scale(outputScale.sx, outputScale.sy); - } - - var image = document.createElement('img'); - this.image = image; - - image.id = this.renderingId; - image.className = 'thumbnailImage'; - image.setAttribute('aria-label', 'Thumbnail of Page ' + this.id); - - image.style.width = canvas.style.width; - image.style.height = canvas.style.height; - - return ctx; - }, - - /** - * @private - */ - _convertCanvasToImage: function PDFThumbnailView_convertCanvasToImage() { - if (!this.canvas) { - return; - } - this.image.src = this.canvas.toDataURL(); - - this.div.setAttribute('data-loaded', true); - this.ring.appendChild(this.image); - - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - this.canvas.width = 0; - this.canvas.height = 0; - delete this.canvas; - }, - - draw: function PDFThumbnailView_draw() { - if (this.renderingState !== RenderingStates.INITIAL) { - console.error('Must be in new state before drawing'); - } - if (this.hasImage) { - return Promise.resolve(undefined); - } - this.hasImage = true; - this.renderingState = RenderingStates.RUNNING; - - var resolveRenderPromise, rejectRenderPromise; - var promise = new Promise(function (resolve, reject) { - resolveRenderPromise = resolve; - rejectRenderPromise = reject; - }); - - var self = this; - function thumbnailDrawCallback(error) { - // The renderTask may have been replaced by a new one, so only remove - // the reference to the renderTask if it matches the one that is - // triggering this callback. - if (renderTask === self.renderTask) { - self.renderTask = null; - } - if (error === 'cancelled') { - rejectRenderPromise(error); - return; - } - self.renderingState = RenderingStates.FINISHED; - self._convertCanvasToImage(); - - if (!error) { - resolveRenderPromise(undefined); - } else { - rejectRenderPromise(error); - } - } - - var ctx = this._getPageDrawContext(); - var drawViewport = this.viewport.clone({ scale: this.scale }); - var renderContinueCallback = function renderContinueCallback(cont) { - if (!self.renderingQueue.isHighestPriority(self)) { - self.renderingState = RenderingStates.PAUSED; - self.resume = function resumeCallback() { - self.renderingState = RenderingStates.RUNNING; - cont(); - }; - return; - } - cont(); - }; - - var renderContext = { - canvasContext: ctx, - viewport: drawViewport - }; - var renderTask = this.renderTask = this.pdfPage.render(renderContext); - renderTask.onContinue = renderContinueCallback; - - renderTask.promise.then( - function pdfPageRenderCallback() { - thumbnailDrawCallback(null); - }, - function pdfPageRenderError(error) { - thumbnailDrawCallback(error); - } - ); - return promise; - }, - - setImage: function PDFThumbnailView_setImage(pageView) { - var img = pageView.canvas; - if (this.hasImage || !img) { - return; - } - if (!this.pdfPage) { - this.setPdfPage(pageView.pdfPage); - } - this.hasImage = true; - this.renderingState = RenderingStates.FINISHED; - - var ctx = this._getPageDrawContext(true); - var canvas = ctx.canvas; - - if (img.width <= 2 * canvas.width) { - ctx.drawImage(img, 0, 0, img.width, img.height, - 0, 0, canvas.width, canvas.height); - this._convertCanvasToImage(); - return; - } - // drawImage does an awful job of rescaling the image, doing it gradually. - var MAX_NUM_SCALING_STEPS = 3; - var reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS; - var reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS; - var reducedImage = getTempCanvas(reducedWidth, reducedHeight); - var reducedImageCtx = reducedImage.getContext('2d'); - - while (reducedWidth > img.width || reducedHeight > img.height) { - reducedWidth >>= 1; - reducedHeight >>= 1; - } - reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, - 0, 0, reducedWidth, reducedHeight); - while (reducedWidth > 2 * canvas.width) { - reducedImageCtx.drawImage(reducedImage, - 0, 0, reducedWidth, reducedHeight, - 0, 0, reducedWidth >> 1, reducedHeight >> 1); - reducedWidth >>= 1; - reducedHeight >>= 1; - } - ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, - 0, 0, canvas.width, canvas.height); - this._convertCanvasToImage(); - } - }; - - return PDFThumbnailView; -})(); - -PDFThumbnailView.tempImageCache = null; - - -/** - * @typedef {Object} PDFThumbnailViewerOptions - * @property {HTMLDivElement} container - The container for the thumbnail - * elements. - * @property {IPDFLinkService} linkService - The navigation/linking service. - * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. - */ - -/** - * Simple viewer control to display thumbnails for pages. - * @class - * @implements {IRenderableView} - */ -var PDFThumbnailViewer = (function PDFThumbnailViewerClosure() { - /** - * @constructs PDFThumbnailViewer - * @param {PDFThumbnailViewerOptions} options - */ - function PDFThumbnailViewer(options) { - this.container = options.container; - this.renderingQueue = options.renderingQueue; - this.linkService = options.linkService; - - this.scroll = watchScroll(this.container, this._scrollUpdated.bind(this)); - this._resetView(); - } - - PDFThumbnailViewer.prototype = { - /** - * @private - */ - _scrollUpdated: function PDFThumbnailViewer_scrollUpdated() { - this.renderingQueue.renderHighestPriority(); - }, - - getThumbnail: function PDFThumbnailViewer_getThumbnail(index) { - return this.thumbnails[index]; - }, - - /** - * @private - */ - _getVisibleThumbs: function PDFThumbnailViewer_getVisibleThumbs() { - return getVisibleElements(this.container, this.thumbnails); - }, - - scrollThumbnailIntoView: - function PDFThumbnailViewer_scrollThumbnailIntoView(page) { - var selected = document.querySelector('.thumbnail.selected'); - if (selected) { - selected.classList.remove('selected'); - } - var thumbnail = document.getElementById('thumbnailContainer' + page); - if (thumbnail) { - thumbnail.classList.add('selected'); - } - var visibleThumbs = this._getVisibleThumbs(); - var numVisibleThumbs = visibleThumbs.views.length; - - // If the thumbnail isn't currently visible, scroll it into view. - if (numVisibleThumbs > 0) { - var first = visibleThumbs.first.id; - // Account for only one thumbnail being visible. - var last = (numVisibleThumbs > 1 ? visibleThumbs.last.id : first); - if (page <= first || page >= last) { - scrollIntoView(thumbnail, { top: THUMBNAIL_SCROLL_MARGIN }); - } - } - }, - - get pagesRotation() { - return this._pagesRotation; - }, - - set pagesRotation(rotation) { - this._pagesRotation = rotation; - for (var i = 0, l = this.thumbnails.length; i < l; i++) { - var thumb = this.thumbnails[i]; - thumb.update(rotation); - } - }, - - cleanup: function PDFThumbnailViewer_cleanup() { - var tempCanvas = PDFThumbnailView.tempImageCache; - if (tempCanvas) { - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - tempCanvas.width = 0; - tempCanvas.height = 0; - } - PDFThumbnailView.tempImageCache = null; - }, - - /** - * @private - */ - _resetView: function PDFThumbnailViewer_resetView() { - this.thumbnails = []; - this._pagesRotation = 0; - this._pagesRequests = []; - }, - - setDocument: function PDFThumbnailViewer_setDocument(pdfDocument) { - if (this.pdfDocument) { - // cleanup of the elements and views - var thumbsView = this.container; - while (thumbsView.hasChildNodes()) { - thumbsView.removeChild(thumbsView.lastChild); - } - this._resetView(); - } - - this.pdfDocument = pdfDocument; - if (!pdfDocument) { - return Promise.resolve(); - } - - return pdfDocument.getPage(1).then(function (firstPage) { - var pagesCount = pdfDocument.numPages; - var viewport = firstPage.getViewport(1.0); - for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { - var thumbnail = new PDFThumbnailView({ - container: this.container, - id: pageNum, - defaultViewport: viewport.clone(), - linkService: this.linkService, - renderingQueue: this.renderingQueue - }); - this.thumbnails.push(thumbnail); - } - }.bind(this)); - }, - - /** - * @param {PDFPageView} pageView - * @returns {PDFPage} - * @private - */ - _ensurePdfPageLoaded: - function PDFThumbnailViewer_ensurePdfPageLoaded(thumbView) { - if (thumbView.pdfPage) { - return Promise.resolve(thumbView.pdfPage); - } - var pageNumber = thumbView.id; - if (this._pagesRequests[pageNumber]) { - return this._pagesRequests[pageNumber]; - } - var promise = this.pdfDocument.getPage(pageNumber).then( - function (pdfPage) { - thumbView.setPdfPage(pdfPage); - this._pagesRequests[pageNumber] = null; - return pdfPage; - }.bind(this)); - this._pagesRequests[pageNumber] = promise; - return promise; - }, - - ensureThumbnailVisible: - function PDFThumbnailViewer_ensureThumbnailVisible(page) { - // Ensure that the thumbnail of the current page is visible - // when switching from another view. - scrollIntoView(document.getElementById('thumbnailContainer' + page)); - }, - - forceRendering: function () { - var visibleThumbs = this._getVisibleThumbs(); - var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, - this.thumbnails, - this.scroll.down); - if (thumbView) { - this._ensurePdfPageLoaded(thumbView).then(function () { - this.renderingQueue.renderView(thumbView); - }.bind(this)); - return true; - } - return false; - } - }; - - return PDFThumbnailViewer; -})(); - - -/** - * @typedef {Object} PDFOutlineViewOptions - * @property {HTMLDivElement} container - The viewer element. - * @property {Array} outline - An array of outline objects. - * @property {IPDFLinkService} linkService - The navigation/linking service. - */ - -/** - * @class - */ -var PDFOutlineView = (function PDFOutlineViewClosure() { - /** - * @constructs PDFOutlineView - * @param {PDFOutlineViewOptions} options - */ - function PDFOutlineView(options) { - this.container = options.container; - this.outline = options.outline; - this.linkService = options.linkService; - this.lastToggleIsShow = true; - } - - PDFOutlineView.prototype = { - reset: function PDFOutlineView_reset() { - var container = this.container; - while (container.firstChild) { - container.removeChild(container.firstChild); - } - this.lastToggleIsShow = true; - }, - - /** - * @private - */ - _dispatchEvent: function PDFOutlineView_dispatchEvent(outlineCount) { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('outlineloaded', true, true, { - outlineCount: outlineCount - }); - this.container.dispatchEvent(event); - }, - - /** - * @private - */ - _bindLink: function PDFOutlineView_bindLink(element, item) { - if (item.url) { - PDFJS.addLinkAttributes(element, { url: item.url }); - return; - } - var linkService = this.linkService; - element.href = linkService.getDestinationHash(item.dest); - element.onclick = function goToDestination(e) { - linkService.navigateTo(item.dest); - return false; - }; - }, - - /** - * Prepend a button before an outline item which allows the user to toggle - * the visibility of all outline items at that level. - * - * @private - */ - _addToggleButton: function PDFOutlineView_addToggleButton(div) { - var toggler = document.createElement('div'); - toggler.className = 'outlineItemToggler'; - toggler.onclick = function(event) { - event.stopPropagation(); - toggler.classList.toggle('outlineItemsHidden'); - - if (event.shiftKey) { - var shouldShowAll = !toggler.classList.contains('outlineItemsHidden'); - this._toggleOutlineItem(div, shouldShowAll); - } - }.bind(this); - div.insertBefore(toggler, div.firstChild); - }, - - /** - * Toggle the visibility of the subtree of an outline item. - * - * @param {Element} root - the root of the outline (sub)tree. - * @param {boolean} state - whether to show the outline (sub)tree. If false, - * the outline subtree rooted at |root| will be collapsed. - * - * @private - */ - _toggleOutlineItem: function PDFOutlineView_toggleOutlineItem(root, show) { - this.lastToggleIsShow = show; - var togglers = root.querySelectorAll('.outlineItemToggler'); - for (var i = 0, ii = togglers.length; i < ii; ++i) { - togglers[i].classList[show ? 'remove' : 'add']('outlineItemsHidden'); - } - }, - - /** - * Collapse or expand all subtrees of the outline. - */ - toggleOutlineTree: function PDFOutlineView_toggleOutlineTree() { - this._toggleOutlineItem(this.container, !this.lastToggleIsShow); - }, - - render: function PDFOutlineView_render() { - var outline = this.outline; - var outlineCount = 0; - - this.reset(); - - if (!outline) { - this._dispatchEvent(outlineCount); - return; - } - - var fragment = document.createDocumentFragment(); - var queue = [{ parent: fragment, items: this.outline }]; - var hasAnyNesting = false; - while (queue.length > 0) { - var levelData = queue.shift(); - for (var i = 0, len = levelData.items.length; i < len; i++) { - var item = levelData.items[i]; - var div = document.createElement('div'); - div.className = 'outlineItem'; - var element = document.createElement('a'); - this._bindLink(element, item); - element.textContent = PDFJS.removeNullCharacters(item.title); - div.appendChild(element); - - if (item.items.length > 0) { - hasAnyNesting = true; - this._addToggleButton(div); - - var itemsDiv = document.createElement('div'); - itemsDiv.className = 'outlineItems'; - div.appendChild(itemsDiv); - queue.push({ parent: itemsDiv, items: item.items }); - } - - levelData.parent.appendChild(div); - outlineCount++; - } - } - if (hasAnyNesting) { - this.container.classList.add('outlineWithDeepNesting'); - } - - this.container.appendChild(fragment); - - this._dispatchEvent(outlineCount); - } - }; - - return PDFOutlineView; -})(); - - -/** - * @typedef {Object} PDFAttachmentViewOptions - * @property {HTMLDivElement} container - The viewer element. - * @property {Array} attachments - An array of attachment objects. - * @property {DownloadManager} downloadManager - The download manager. - */ - -/** - * @class - */ -var PDFAttachmentView = (function PDFAttachmentViewClosure() { - /** - * @constructs PDFAttachmentView - * @param {PDFAttachmentViewOptions} options - */ - function PDFAttachmentView(options) { - this.container = options.container; - this.attachments = options.attachments; - this.downloadManager = options.downloadManager; - } - - PDFAttachmentView.prototype = { - reset: function PDFAttachmentView_reset() { - var container = this.container; - while (container.firstChild) { - container.removeChild(container.firstChild); - } - }, - - /** - * @private - */ - _dispatchEvent: function PDFAttachmentView_dispatchEvent(attachmentsCount) { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('attachmentsloaded', true, true, { - attachmentsCount: attachmentsCount - }); - this.container.dispatchEvent(event); - }, - - /** - * @private - */ - _bindLink: function PDFAttachmentView_bindLink(button, content, filename) { - button.onclick = function downloadFile(e) { - this.downloadManager.downloadData(content, filename, ''); - return false; - }.bind(this); - }, - - render: function PDFAttachmentView_render() { - var attachments = this.attachments; - var attachmentsCount = 0; - - this.reset(); - - if (!attachments) { - this._dispatchEvent(attachmentsCount); - return; - } - - var names = Object.keys(attachments).sort(function(a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()); - }); - attachmentsCount = names.length; - - for (var i = 0; i < attachmentsCount; i++) { - var item = attachments[names[i]]; - var filename = getFileName(item.filename); - var div = document.createElement('div'); - div.className = 'attachmentsItem'; - var button = document.createElement('button'); - this._bindLink(button, item.content, filename); - button.textContent = PDFJS.removeNullCharacters(filename); - div.appendChild(button); - this.container.appendChild(div); - } - - this._dispatchEvent(attachmentsCount); - } - }; - - return PDFAttachmentView; -})(); - - -var PDFViewerApplication = { - initialBookmark: document.location.hash.substring(1), - initialDestination: null, - initialized: false, - fellback: false, - pdfDocument: null, - pdfLoadingTask: null, - sidebarOpen: false, - printing: false, - /** @type {PDFViewer} */ - pdfViewer: null, - /** @type {PDFThumbnailViewer} */ - pdfThumbnailViewer: null, - /** @type {PDFRenderingQueue} */ - pdfRenderingQueue: null, - /** @type {PDFPresentationMode} */ - pdfPresentationMode: null, - /** @type {PDFDocumentProperties} */ - pdfDocumentProperties: null, - /** @type {PDFLinkService} */ - pdfLinkService: null, - /** @type {PDFHistory} */ - pdfHistory: null, - pageRotation: 0, - isInitialViewSet: false, - animationStartedPromise: null, - preferenceSidebarViewOnLoad: SidebarView.NONE, - preferencePdfBugEnabled: false, - preferenceShowPreviousViewOnLoad: true, - preferenceDefaultZoomValue: '', - isViewerEmbedded: (window.parent !== window), - url: '', - - // called once when the document is loaded - initialize: function pdfViewInitialize() { - var pdfRenderingQueue = new PDFRenderingQueue(); - pdfRenderingQueue.onIdle = this.cleanup.bind(this); - this.pdfRenderingQueue = pdfRenderingQueue; - - var pdfLinkService = new PDFLinkService(); - this.pdfLinkService = pdfLinkService; - - var container = document.getElementById('viewerContainer'); - var viewer = document.getElementById('viewer'); - this.pdfViewer = new PDFViewer({ - container: container, - viewer: viewer, - renderingQueue: pdfRenderingQueue, - linkService: pdfLinkService - }); - pdfRenderingQueue.setViewer(this.pdfViewer); - pdfLinkService.setViewer(this.pdfViewer); - - var thumbnailContainer = document.getElementById('thumbnailView'); - this.pdfThumbnailViewer = new PDFThumbnailViewer({ - container: thumbnailContainer, - renderingQueue: pdfRenderingQueue, - linkService: pdfLinkService - }); - pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer); - - Preferences.initialize(); - - this.pdfHistory = new PDFHistory({ - linkService: pdfLinkService - }); - pdfLinkService.setHistory(this.pdfHistory); - - this.findController = new PDFFindController({ - pdfViewer: this.pdfViewer, - integratedFind: this.supportsIntegratedFind - }); - this.pdfViewer.setFindController(this.findController); - - this.findBar = new PDFFindBar({ - bar: document.getElementById('findbar'), - toggleButton: document.getElementById('viewFind'), - findField: document.getElementById('findInput'), - highlightAllCheckbox: document.getElementById('findHighlightAll'), - caseSensitiveCheckbox: document.getElementById('findMatchCase'), - findMsg: document.getElementById('findMsg'), - findResultsCount: document.getElementById('findResultsCount'), - findStatusIcon: document.getElementById('findStatusIcon'), - findPreviousButton: document.getElementById('findPrevious'), - findNextButton: document.getElementById('findNext'), - findController: this.findController - }); - - this.findController.setFindBar(this.findBar); - - HandTool.initialize({ - container: container, - toggleHandTool: document.getElementById('toggleHandTool') - }); - - this.pdfDocumentProperties = new PDFDocumentProperties({ - overlayName: 'documentPropertiesOverlay', - closeButton: document.getElementById('documentPropertiesClose'), - fields: { - 'fileName': document.getElementById('fileNameField'), - 'fileSize': document.getElementById('fileSizeField'), - 'title': document.getElementById('titleField'), - 'author': document.getElementById('authorField'), - 'subject': document.getElementById('subjectField'), - 'keywords': document.getElementById('keywordsField'), - 'creationDate': document.getElementById('creationDateField'), - 'modificationDate': document.getElementById('modificationDateField'), - 'creator': document.getElementById('creatorField'), - 'producer': document.getElementById('producerField'), - 'version': document.getElementById('versionField'), - 'pageCount': document.getElementById('pageCountField') - } - }); - - SecondaryToolbar.initialize({ - toolbar: document.getElementById('secondaryToolbar'), - toggleButton: document.getElementById('secondaryToolbarToggle'), - presentationModeButton: - document.getElementById('secondaryPresentationMode'), - openFile: document.getElementById('secondaryOpenFile'), - print: document.getElementById('secondaryPrint'), - download: document.getElementById('secondaryDownload'), - viewBookmark: document.getElementById('secondaryViewBookmark'), - firstPage: document.getElementById('firstPage'), - lastPage: document.getElementById('lastPage'), - pageRotateCw: document.getElementById('pageRotateCw'), - pageRotateCcw: document.getElementById('pageRotateCcw'), - documentPropertiesButton: document.getElementById('documentProperties') - }); - - if (this.supportsFullscreen) { - var toolbar = SecondaryToolbar; - this.pdfPresentationMode = new PDFPresentationMode({ - container: container, - viewer: viewer, - pdfViewer: this.pdfViewer, - pdfThumbnailViewer: this.pdfThumbnailViewer, - contextMenuItems: [ - { element: document.getElementById('contextFirstPage'), - handler: toolbar.firstPageClick.bind(toolbar) }, - { element: document.getElementById('contextLastPage'), - handler: toolbar.lastPageClick.bind(toolbar) }, - { element: document.getElementById('contextPageRotateCw'), - handler: toolbar.pageRotateCwClick.bind(toolbar) }, - { element: document.getElementById('contextPageRotateCcw'), - handler: toolbar.pageRotateCcwClick.bind(toolbar) } - ] - }); - } - - PasswordPrompt.initialize({ - overlayName: 'passwordOverlay', - passwordField: document.getElementById('password'), - passwordText: document.getElementById('passwordText'), - passwordSubmit: document.getElementById('passwordSubmit'), - passwordCancel: document.getElementById('passwordCancel') - }); - - var self = this; - var initializedPromise = Promise.all([ - Preferences.get('enableWebGL').then(function resolved(value) { - PDFJS.disableWebGL = !value; - }), - Preferences.get('sidebarViewOnLoad').then(function resolved(value) { - self.preferenceSidebarViewOnLoad = value; - }), - Preferences.get('pdfBugEnabled').then(function resolved(value) { - self.preferencePdfBugEnabled = value; - }), - Preferences.get('showPreviousViewOnLoad').then(function resolved(value) { - self.preferenceShowPreviousViewOnLoad = value; - }), - Preferences.get('defaultZoomValue').then(function resolved(value) { - self.preferenceDefaultZoomValue = value; - }), - Preferences.get('disableTextLayer').then(function resolved(value) { - if (PDFJS.disableTextLayer === true) { - return; - } - PDFJS.disableTextLayer = value; - }), - Preferences.get('disableRange').then(function resolved(value) { - if (PDFJS.disableRange === true) { - return; - } - PDFJS.disableRange = value; - }), - Preferences.get('disableStream').then(function resolved(value) { - if (PDFJS.disableStream === true) { - return; - } - PDFJS.disableStream = value; - }), - Preferences.get('disableAutoFetch').then(function resolved(value) { - PDFJS.disableAutoFetch = value; - }), - Preferences.get('disableFontFace').then(function resolved(value) { - if (PDFJS.disableFontFace === true) { - return; - } - PDFJS.disableFontFace = value; - }), - Preferences.get('useOnlyCssZoom').then(function resolved(value) { - PDFJS.useOnlyCssZoom = value; - }), - Preferences.get('externalLinkTarget').then(function resolved(value) { - if (PDFJS.isExternalLinkTargetSet()) { - return; - } - PDFJS.externalLinkTarget = value; - }), - // TODO move more preferences and other async stuff here - ]).catch(function (reason) { }); - - return initializedPromise.then(function () { - if (self.isViewerEmbedded && !PDFJS.isExternalLinkTargetSet()) { - // Prevent external links from "replacing" the viewer, - // when it's embedded in e.g. an iframe or an object. - PDFJS.externalLinkTarget = PDFJS.LinkTarget.TOP; - } - - self.initialized = true; - }); - }, - - zoomIn: function pdfViewZoomIn(ticks) { - var newScale = this.pdfViewer.currentScale; - do { - newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2); - newScale = Math.ceil(newScale * 10) / 10; - newScale = Math.min(MAX_SCALE, newScale); - } while (--ticks > 0 && newScale < MAX_SCALE); - this.pdfViewer.currentScaleValue = newScale; - }, - - zoomOut: function pdfViewZoomOut(ticks) { - var newScale = this.pdfViewer.currentScale; - do { - newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2); - newScale = Math.floor(newScale * 10) / 10; - newScale = Math.max(MIN_SCALE, newScale); - } while (--ticks > 0 && newScale > MIN_SCALE); - this.pdfViewer.currentScaleValue = newScale; - }, - - get pagesCount() { - return this.pdfDocument.numPages; - }, - - set page(val) { - this.pdfLinkService.page = val; - }, - - get page() { // TODO remove - return this.pdfLinkService.page; - }, - - get supportsPrinting() { - var canvas = document.createElement('canvas'); - var value = 'mozPrintCallback' in canvas; - - return PDFJS.shadow(this, 'supportsPrinting', value); - }, - - get supportsFullscreen() { - var doc = document.documentElement; - var support = !!(doc.requestFullscreen || doc.mozRequestFullScreen || - doc.webkitRequestFullScreen || doc.msRequestFullscreen); - - if (document.fullscreenEnabled === false || - document.mozFullScreenEnabled === false || - document.webkitFullscreenEnabled === false || - document.msFullscreenEnabled === false) { - support = false; - } - if (support && PDFJS.disableFullscreen === true) { - support = false; - } - - return PDFJS.shadow(this, 'supportsFullscreen', support); - }, - - get supportsIntegratedFind() { - var support = false; - - return PDFJS.shadow(this, 'supportsIntegratedFind', support); - }, - - get supportsDocumentFonts() { - var support = true; - - return PDFJS.shadow(this, 'supportsDocumentFonts', support); - }, - - get supportsDocumentColors() { - var support = true; - - return PDFJS.shadow(this, 'supportsDocumentColors', support); - }, - - get loadingBar() { - var bar = new ProgressBar('#loadingBar', {}); - - return PDFJS.shadow(this, 'loadingBar', bar); - }, - - get supportedMouseWheelZoomModifierKeys() { - var support = { - ctrlKey: true, - metaKey: true, - }; - - return PDFJS.shadow(this, 'supportedMouseWheelZoomModifierKeys', support); - }, - - - setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) { - this.url = url; - try { - this.setTitle(decodeURIComponent(getFileName(url)) || url); - } catch (e) { - // decodeURIComponent may throw URIError, - // fall back to using the unprocessed url in that case - this.setTitle(url); - } - }, - - setTitle: function pdfViewSetTitle(title) { - if (this.isViewerEmbedded) { - // Embedded PDF viewers should not be changing their parent page's title. - return; - } - document.title = title; - }, - - /** - * Closes opened PDF document. - * @returns {Promise} - Returns the promise, which is resolved when all - * destruction is completed. - */ - close: function pdfViewClose() { - var errorWrapper = document.getElementById('errorWrapper'); - errorWrapper.setAttribute('hidden', 'true'); - - if (!this.pdfLoadingTask) { - return Promise.resolve(); - } - - var promise = this.pdfLoadingTask.destroy(); - this.pdfLoadingTask = null; - - if (this.pdfDocument) { - this.pdfDocument = null; - - this.pdfThumbnailViewer.setDocument(null); - this.pdfViewer.setDocument(null); - this.pdfLinkService.setDocument(null, null); - } - - if (typeof PDFBug !== 'undefined') { - PDFBug.cleanup(); - } - return promise; - }, - - /** - * Opens PDF document specified by URL or array with additional arguments. - * @param {string|TypedArray|ArrayBuffer} file - PDF location or binary data. - * @param {Object} args - (optional) Additional arguments for the getDocument - * call, e.g. HTTP headers ('httpHeaders') or - * alternative data transport ('range'). - * @returns {Promise} - Returns the promise, which is resolved when document - * is opened. - */ - open: function pdfViewOpen(file, args) { - var scale = 0; - if (arguments.length > 2 || typeof args === 'number') { - console.warn('Call of open() with obsolete signature.'); - if (typeof args === 'number') { - scale = args; // scale argument was found - } - args = arguments[4] || null; - if (arguments[3] && typeof arguments[3] === 'object') { - // The pdfDataRangeTransport argument is present. - args = Object.create(args); - args.range = arguments[3]; - } - if (typeof arguments[2] === 'string') { - // The password argument is present. - args = Object.create(args); - args.password = arguments[2]; - } - } - - if (this.pdfLoadingTask) { - // We need to destroy already opened document. - return this.close().then(function () { - // Reload the preferences if a document was previously opened. - Preferences.reload(); - // ... and repeat the open() call. - return this.open(file, args); - }.bind(this)); - } - - var parameters = Object.create(null); - if (typeof file === 'string') { // URL - this.setTitleUsingUrl(file); - parameters.url = file; - } else if (file && 'byteLength' in file) { // ArrayBuffer - parameters.data = file; - } else if (file.url && file.originalUrl) { - this.setTitleUsingUrl(file.originalUrl); - parameters.url = file.url; - } - if (args) { - for (var prop in args) { - parameters[prop] = args[prop]; - } - } - - var self = this; - self.downloadComplete = false; - - var loadingTask = PDFJS.getDocument(parameters); - this.pdfLoadingTask = loadingTask; - - loadingTask.onPassword = function passwordNeeded(updatePassword, reason) { - PasswordPrompt.updatePassword = updatePassword; - PasswordPrompt.reason = reason; - PasswordPrompt.open(); - }; - - loadingTask.onProgress = function getDocumentProgress(progressData) { - self.progress(progressData.loaded / progressData.total); - }; - - // Listen for unsupported features to trigger the fallback UI. - loadingTask.onUnsupportedFeature = this.fallback.bind(this); - - var result = loadingTask.promise.then( - function getDocumentCallback(pdfDocument) { - self.load(pdfDocument, scale); - }, - function getDocumentError(exception) { - var message = exception && exception.message; - var loadingErrorMessage = 'An error occurred while loading the PDF.'; - - if (exception instanceof PDFJS.InvalidPDFException) { - // change error message also for other builds - loadingErrorMessage = 'Invalid or corrupted PDF file.'; - } else if (exception instanceof PDFJS.MissingPDFException) { - // special message for missing PDF's - loadingErrorMessage = 'Missing PDF file.'; - } else if (exception instanceof PDFJS.UnexpectedResponseException) { - loadingErrorMessage = 'Unexpected server response.'; - } - - var moreInfo = { - message: message - }; - self.error(loadingErrorMessage, moreInfo); - - throw new Error(loadingErrorMessage); - } - ); - - if (args && args.length) { - PDFViewerApplication.pdfDocumentProperties.setFileSize(args.length); - } - return result; - }, - - download: function pdfViewDownload() { - function downloadByUrl() { - downloadManager.downloadUrl(url, filename); - } - - var url = this.url.split('#')[0]; - var filename = getPDFFileNameFromURL(url); - var downloadManager = new DownloadManager(); - downloadManager.onerror = function (err) { - // This error won't really be helpful because it's likely the - // fallback won't work either (or is already open). - PDFViewerApplication.error('PDF failed to download.'); - }; - - if (!this.pdfDocument) { // the PDF is not ready yet - downloadByUrl(); - return; - } - - if (!this.downloadComplete) { // the PDF is still downloading - downloadByUrl(); - return; - } - - this.pdfDocument.getData().then( - function getDataSuccess(data) { - var blob = PDFJS.createBlob(data, 'application/pdf'); - downloadManager.download(blob, url, filename); - }, - downloadByUrl // Error occurred try downloading with just the url. - ).then(null, downloadByUrl); - }, - - fallback: function pdfViewFallback(featureId) { - }, - - /** - * Show the error box. - * @param {String} message A message that is human readable. - * @param {Object} moreInfo (optional) Further information about the error - * that is more technical. Should have a 'message' - * and optionally a 'stack' property. - */ - error: function pdfViewError(message, moreInfo) { - var moreInfoText = 'PDF.js v' + (PDFJS.version || '?') + '(build: ' + (PDFJS.build || '?') + ')\n'; - if (moreInfo) { - moreInfoText += 'Message: ' + moreInfo.message - if (moreInfo.stack) { - moreInfoText += '\nStack: ' + moreInfo.stack; - } else { - if (moreInfo.filename) { - moreInfoText += '\nFile: ' + moreInfo.filename; - } - if (moreInfo.lineNumber) { - moreInfoText += '\nLine: ' + moreInfo.lineNumber; - } - } - } - - var errorWrapper = document.getElementById('errorWrapper'); - errorWrapper.removeAttribute('hidden'); - - var errorMessage = document.getElementById('errorMessage'); - errorMessage.textContent = message; - - var closeButton = document.getElementById('errorClose'); - closeButton.onclick = function() { - errorWrapper.setAttribute('hidden', 'true'); - }; - - var errorMoreInfo = document.getElementById('errorMoreInfo'); - var moreInfoButton = document.getElementById('errorShowMore'); - var lessInfoButton = document.getElementById('errorShowLess'); - moreInfoButton.onclick = function() { - errorMoreInfo.removeAttribute('hidden'); - moreInfoButton.setAttribute('hidden', 'true'); - lessInfoButton.removeAttribute('hidden'); - errorMoreInfo.style.height = errorMoreInfo.scrollHeight + 'px'; - }; - lessInfoButton.onclick = function() { - errorMoreInfo.setAttribute('hidden', 'true'); - moreInfoButton.removeAttribute('hidden'); - lessInfoButton.setAttribute('hidden', 'true'); - }; - moreInfoButton.oncontextmenu = noContextMenuHandler; - lessInfoButton.oncontextmenu = noContextMenuHandler; - closeButton.oncontextmenu = noContextMenuHandler; - moreInfoButton.removeAttribute('hidden'); - lessInfoButton.setAttribute('hidden', 'true'); - errorMoreInfo.value = moreInfoText; - }, - - progress: function pdfViewProgress(level) { - var percent = Math.round(level * 100); - // When we transition from full request to range requests, it's possible - // that we discard some of the loaded data. This can cause the loading - // bar to move backwards. So prevent this by only updating the bar if it - // increases. - if (percent > this.loadingBar.percent || isNaN(percent)) { - this.loadingBar.percent = percent; - - // When disableAutoFetch is enabled, it's not uncommon for the entire file - // to never be fetched (depends on e.g. the file structure). In this case - // the loading bar will not be completely filled, nor will it be hidden. - // To prevent displaying a partially filled loading bar permanently, we - // hide it when no data has been loaded during a certain amount of time. - if (PDFJS.disableAutoFetch && percent) { - if (this.disableAutoFetchLoadingBarTimeout) { - clearTimeout(this.disableAutoFetchLoadingBarTimeout); - this.disableAutoFetchLoadingBarTimeout = null; - } - this.loadingBar.show(); - - this.disableAutoFetchLoadingBarTimeout = setTimeout(function () { - this.loadingBar.hide(); - this.disableAutoFetchLoadingBarTimeout = null; - }.bind(this), DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT); - } - } - }, - - load: function pdfViewLoad(pdfDocument, scale) { - var self = this; - scale = scale || UNKNOWN_SCALE; - - this.findController.reset(); - - this.pdfDocument = pdfDocument; - - this.pdfDocumentProperties.setDocumentAndUrl(pdfDocument, this.url); - - var downloadedPromise = pdfDocument.getDownloadInfo().then(function() { - self.downloadComplete = true; - self.loadingBar.hide(); - }); - - var pagesCount = pdfDocument.numPages; - document.getElementById('numPages').textContent = 'of ' + pagesCount; - document.getElementById('pageNumber').max = pagesCount; - - var id = this.documentFingerprint = pdfDocument.fingerprint; - var store = this.store = new ViewHistory(id); - - var baseDocumentUrl = null; - this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl); - - var pdfViewer = this.pdfViewer; - pdfViewer.currentScale = scale; - pdfViewer.setDocument(pdfDocument); - var firstPagePromise = pdfViewer.firstPagePromise; - var pagesPromise = pdfViewer.pagesPromise; - var onePageRendered = pdfViewer.onePageRendered; - - this.pageRotation = 0; - this.isInitialViewSet = false; - - this.pdfThumbnailViewer.setDocument(pdfDocument); - - firstPagePromise.then(function(pdfPage) { - downloadedPromise.then(function () { - var event = document.createEvent('CustomEvent'); - event.initCustomEvent('documentload', true, true, {}); - window.dispatchEvent(event); - }); - - self.loadingBar.setWidth(document.getElementById('viewer')); - - if (!PDFJS.disableHistory && !self.isViewerEmbedded) { - // The browsing history is only enabled when the viewer is standalone, - // i.e. not when it is embedded in a web page. - if (!self.preferenceShowPreviousViewOnLoad) { - self.pdfHistory.clearHistoryState(); - } - self.pdfHistory.initialize(self.documentFingerprint); - - if (self.pdfHistory.initialDestination) { - self.initialDestination = self.pdfHistory.initialDestination; - } else if (self.pdfHistory.initialBookmark) { - self.initialBookmark = self.pdfHistory.initialBookmark; - } - } - - var initialParams = { - destination: self.initialDestination, - bookmark: self.initialBookmark, - hash: null, - }; - - store.initializedPromise.then(function resolved() { - var storedHash = null; - if (self.preferenceShowPreviousViewOnLoad && - store.get('exists', false)) { - var pageNum = store.get('page', '1'); - var zoom = self.preferenceDefaultZoomValue || - store.get('zoom', DEFAULT_SCALE_VALUE); - var left = store.get('scrollLeft', '0'); - var top = store.get('scrollTop', '0'); - - storedHash = 'page=' + pageNum + '&zoom=' + zoom + ',' + - left + ',' + top; - } else if (self.preferenceDefaultZoomValue) { - storedHash = 'page=1&zoom=' + self.preferenceDefaultZoomValue; - } - self.setInitialView(storedHash, scale); - - initialParams.hash = storedHash; - - // Make all navigation keys work on document load, - // unless the viewer is embedded in a web page. - if (!self.isViewerEmbedded) { - self.pdfViewer.focus(); - } - }, function rejected(reason) { - console.error(reason); - self.setInitialView(null, scale); - }); - - // For documents with different page sizes, - // ensure that the correct location becomes visible on load. - pagesPromise.then(function resolved() { - if (!initialParams.destination && !initialParams.bookmark && - !initialParams.hash) { - return; - } - if (self.hasEqualPageSizes) { - return; - } - self.initialDestination = initialParams.destination; - self.initialBookmark = initialParams.bookmark; - - self.pdfViewer.currentScaleValue = self.pdfViewer.currentScaleValue; - self.setInitialView(initialParams.hash, scale); - }); - }); - - pagesPromise.then(function() { - if (self.supportsPrinting) { - pdfDocument.getJavaScript().then(function(javaScript) { - if (javaScript.length) { - console.warn('Warning: JavaScript is not supported'); - self.fallback(PDFJS.UNSUPPORTED_FEATURES.javaScript); - } - // Hack to support auto printing. - var regex = /\bprint\s*\(/; - for (var i = 0, ii = javaScript.length; i < ii; i++) { - var js = javaScript[i]; - if (js && regex.test(js)) { - setTimeout(function() { - window.print(); - }); - return; - } - } - }); - } - }); - - // outline depends on pagesRefMap - var promises = [pagesPromise, this.animationStartedPromise]; - Promise.all(promises).then(function() { - pdfDocument.getOutline().then(function(outline) { - var container = document.getElementById('outlineView'); - self.outline = new PDFOutlineView({ - container: container, - outline: outline, - linkService: self.pdfLinkService - }); - self.outline.render(); - document.getElementById('viewOutline').disabled = !outline; - - if (!outline && !container.classList.contains('hidden')) { - self.switchSidebarView('thumbs'); - } - if (outline && - self.preferenceSidebarViewOnLoad === SidebarView.OUTLINE) { - self.switchSidebarView('outline', true); - } - }); - pdfDocument.getAttachments().then(function(attachments) { - var container = document.getElementById('attachmentsView'); - self.attachments = new PDFAttachmentView({ - container: container, - attachments: attachments, - downloadManager: new DownloadManager() - }); - self.attachments.render(); - document.getElementById('viewAttachments').disabled = !attachments; - - if (!attachments && !container.classList.contains('hidden')) { - self.switchSidebarView('thumbs'); - } - if (attachments && - self.preferenceSidebarViewOnLoad === SidebarView.ATTACHMENTS) { - self.switchSidebarView('attachments', true); - } - }); - }); - - if (self.preferenceSidebarViewOnLoad === SidebarView.THUMBS) { - Promise.all([firstPagePromise, onePageRendered]).then(function () { - self.switchSidebarView('thumbs', true); - }); - } - - pdfDocument.getMetadata().then(function(data) { - var info = data.info, metadata = data.metadata; - self.documentInfo = info; - self.metadata = metadata; - - // Provides some basic debug information - console.log('PDF ' + pdfDocument.fingerprint + ' [' + - info.PDFFormatVersion + ' ' + (info.Producer || '-').trim() + - ' / ' + (info.Creator || '-').trim() + ']' + - ' (PDF.js: ' + (PDFJS.version || '-') + - (!PDFJS.disableWebGL ? ' [WebGL]' : '') + ')'); - - var pdfTitle; - if (metadata && metadata.has('dc:title')) { - var title = metadata.get('dc:title'); - // Ghostscript sometimes return 'Untitled', sets the title to 'Untitled' - if (title !== 'Untitled') { - pdfTitle = title; - } - } - - if (!pdfTitle && info && info['Title']) { - pdfTitle = info['Title']; - } - - if (pdfTitle) { - self.setTitle(pdfTitle + ' - ' + document.title); - } - - if (info.IsAcroFormPresent) { - console.warn('Warning: AcroForm/XFA is not supported'); - self.fallback(PDFJS.UNSUPPORTED_FEATURES.forms); - } - - }); - }, - - setInitialView: function pdfViewSetInitialView(storedHash, scale) { - this.isInitialViewSet = true; - - // When opening a new file, when one is already loaded in the viewer, - // ensure that the 'pageNumber' element displays the correct value. - document.getElementById('pageNumber').value = - this.pdfViewer.currentPageNumber; - - if (this.initialDestination) { - this.pdfLinkService.navigateTo(this.initialDestination); - this.initialDestination = null; - } else if (this.initialBookmark) { - this.pdfLinkService.setHash(this.initialBookmark); - this.pdfHistory.push({ hash: this.initialBookmark }, true); - this.initialBookmark = null; - } else if (storedHash) { - this.pdfLinkService.setHash(storedHash); - } else if (scale) { - this.pdfViewer.currentScaleValue = scale; - this.page = 1; - } - - if (!this.pdfViewer.currentScaleValue) { - // Scale was not initialized: invalid bookmark or scale was not specified. - // Setting the default one. - this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; - } - }, - - cleanup: function pdfViewCleanup() { - if (!this.pdfDocument) { - return; // run cleanup when document is loaded - } - this.pdfViewer.cleanup(); - this.pdfThumbnailViewer.cleanup(); - this.pdfDocument.cleanup(); - }, - - forceRendering: function pdfViewForceRendering() { - this.pdfRenderingQueue.printing = this.printing; - this.pdfRenderingQueue.isThumbnailViewEnabled = this.sidebarOpen; - this.pdfRenderingQueue.renderHighestPriority(); - }, - - refreshThumbnailViewer: function pdfViewRefreshThumbnailViewer() { - var pdfViewer = this.pdfViewer; - var thumbnailViewer = this.pdfThumbnailViewer; - - // set thumbnail images of rendered pages - var pagesCount = pdfViewer.pagesCount; - for (var pageIndex = 0; pageIndex < pagesCount; pageIndex++) { - var pageView = pdfViewer.getPageView(pageIndex); - if (pageView && pageView.renderingState === RenderingStates.FINISHED) { - var thumbnailView = thumbnailViewer.getThumbnail(pageIndex); - thumbnailView.setImage(pageView); - } - } - - thumbnailViewer.scrollThumbnailIntoView(this.page); - }, - - switchSidebarView: function pdfViewSwitchSidebarView(view, openSidebar) { - if (openSidebar && !this.sidebarOpen) { - document.getElementById('sidebarToggle').click(); - } - var thumbsView = document.getElementById('thumbnailView'); - var outlineView = document.getElementById('outlineView'); - var attachmentsView = document.getElementById('attachmentsView'); - - var thumbsButton = document.getElementById('viewThumbnail'); - var outlineButton = document.getElementById('viewOutline'); - var attachmentsButton = document.getElementById('viewAttachments'); - - switch (view) { - case 'thumbs': - var wasAnotherViewVisible = thumbsView.classList.contains('hidden'); - - thumbsButton.classList.add('toggled'); - outlineButton.classList.remove('toggled'); - attachmentsButton.classList.remove('toggled'); - thumbsView.classList.remove('hidden'); - outlineView.classList.add('hidden'); - attachmentsView.classList.add('hidden'); - - this.forceRendering(); - - if (wasAnotherViewVisible) { - this.pdfThumbnailViewer.ensureThumbnailVisible(this.page); - } - break; - - case 'outline': - if (outlineButton.disabled) { - return; - } - thumbsButton.classList.remove('toggled'); - outlineButton.classList.add('toggled'); - attachmentsButton.classList.remove('toggled'); - thumbsView.classList.add('hidden'); - outlineView.classList.remove('hidden'); - attachmentsView.classList.add('hidden'); - break; - - case 'attachments': - if (attachmentsButton.disabled) { - return; - } - thumbsButton.classList.remove('toggled'); - outlineButton.classList.remove('toggled'); - attachmentsButton.classList.add('toggled'); - thumbsView.classList.add('hidden'); - outlineView.classList.add('hidden'); - attachmentsView.classList.remove('hidden'); - break; - } - }, - - beforePrint: function pdfViewSetupBeforePrint() { - if (!this.supportsPrinting) { - var printMessage = 'Warning: Printing is not fully supported by this browser.'; - this.error(printMessage); - return; - } - - var alertNotReady = false; - var i, ii; - if (!this.pdfDocument || !this.pagesCount) { - alertNotReady = true; - } else { - for (i = 0, ii = this.pagesCount; i < ii; ++i) { - if (!this.pdfViewer.getPageView(i).pdfPage) { - alertNotReady = true; - break; - } - } - } - if (alertNotReady) { - var notReadyMessage = 'Warning: The PDF is not fully loaded for printing.'; - window.alert(notReadyMessage); - return; - } - - this.printing = true; - this.forceRendering(); - - var body = document.querySelector('body'); - body.setAttribute('data-mozPrintCallback', true); - - if (!this.hasEqualPageSizes) { - console.warn('Not all pages have the same size. The printed result ' + - 'may be incorrect!'); - } - - // Insert a @page + size rule to make sure that the page size is correctly - // set. Note that we assume that all pages have the same size, because - // variable-size pages are not supported yet (at least in Chrome & Firefox). - // TODO(robwu): Use named pages when size calculation bugs get resolved - // (e.g. https://crbug.com/355116) AND when support for named pages is - // added (http://www.w3.org/TR/css3-page/#using-named-pages). - // In browsers where @page + size is not supported (such as Firefox, - // https://bugzil.la/851441), the next stylesheet will be ignored and the - // user has to select the correct paper size in the UI if wanted. - this.pageStyleSheet = document.createElement('style'); - var pageSize = this.pdfViewer.getPageView(0).pdfPage.getViewport(1); - this.pageStyleSheet.textContent = - // "size: " is what we need. But also add "A4" because - // Firefox incorrectly reports support for the other value. - '@supports ((size:A4) and (size:1pt 1pt)) {' + - '@page { size: ' + pageSize.width + 'pt ' + pageSize.height + 'pt;}' + - // The canvas and each ancestor node must have a height of 100% to make - // sure that each canvas is printed on exactly one page. - '#printContainer {height:100%}' + - '#printContainer > div {width:100% !important;height:100% !important;}' + - '}'; - body.appendChild(this.pageStyleSheet); - - for (i = 0, ii = this.pagesCount; i < ii; ++i) { - this.pdfViewer.getPageView(i).beforePrint(); - } - - }, - - // Whether all pages of the PDF have the same width and height. - get hasEqualPageSizes() { - var firstPage = this.pdfViewer.getPageView(0); - for (var i = 1, ii = this.pagesCount; i < ii; ++i) { - var pageView = this.pdfViewer.getPageView(i); - if (pageView.width !== firstPage.width || - pageView.height !== firstPage.height) { - return false; - } - } - return true; - }, - - afterPrint: function pdfViewSetupAfterPrint() { - var div = document.getElementById('printContainer'); - while (div.hasChildNodes()) { - div.removeChild(div.lastChild); - } - - if (this.pageStyleSheet && this.pageStyleSheet.parentNode) { - this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet); - this.pageStyleSheet = null; - } - - this.printing = false; - this.forceRendering(); - }, - - rotatePages: function pdfViewRotatePages(delta) { - var pageNumber = this.page; - this.pageRotation = (this.pageRotation + 360 + delta) % 360; - this.pdfViewer.pagesRotation = this.pageRotation; - this.pdfThumbnailViewer.pagesRotation = this.pageRotation; - - this.forceRendering(); - - this.pdfViewer.scrollPageIntoView(pageNumber); - }, - - requestPresentationMode: function pdfViewRequestPresentationMode() { - if (!this.pdfPresentationMode) { - return; - } - this.pdfPresentationMode.request(); - }, - - /** - * @param {number} delta - The delta value from the mouse event. - */ - scrollPresentationMode: function pdfViewScrollPresentationMode(delta) { - if (!this.pdfPresentationMode) { - return; - } - this.pdfPresentationMode.mouseScroll(delta); - } -}; -window.PDFView = PDFViewerApplication; // obsolete name, using it as an alias - - -var HOSTED_VIEWER_ORIGINS = ['null', - 'http://mozilla.github.io', 'https://mozilla.github.io']; -function validateFileURL(file) { - try { - var viewerOrigin = new URL(window.location.href).origin || 'null'; - if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) { - // Hosted or local viewer, allow for any file locations - return; - } - var fileOrigin = new URL(file, window.location.href).origin; - // Removing of the following line will not guarantee that the viewer will - // start accepting URLs from foreign origin -- CORS headers on the remote - // server must be properly configured. - if (fileOrigin !== viewerOrigin) { - throw new Error('file origin does not match viewer\'s'); - } - } catch (e) { - var message = e && e.message; - var loadingErrorMessage = 'An error occurred while loading the PDF.'; - - var moreInfo = { - message: message - }; - PDFViewerApplication.error(loadingErrorMessage, moreInfo); - throw e; - } -} - -function webViewerLoad(evt) { - configure(PDFJS); - PDFViewerApplication.initialize().then(webViewerInitialized); -} - -function webViewerInitialized() { - var queryString = document.location.search.substring(1); - var params = parseQueryString(queryString); - var file = 'file' in params ? params.file : DEFAULT_URL; - validateFileURL(file); - - var fileInput = document.createElement('input'); - fileInput.id = 'fileInput'; - fileInput.className = 'fileInput'; - fileInput.setAttribute('type', 'file'); - fileInput.oncontextmenu = noContextMenuHandler; - document.body.appendChild(fileInput); - - if (!window.File || !window.FileReader || !window.FileList || !window.Blob) { - document.getElementById('openFile').setAttribute('hidden', 'true'); - document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true'); - } else { - document.getElementById('fileInput').value = null; - } - - var locale = PDFJS.locale || navigator.language; - - if (PDFViewerApplication.preferencePdfBugEnabled) { - // Special debugging flags in the hash section of the URL. - var hash = document.location.hash.substring(1); - var hashParams = parseQueryString(hash); - - if ('disableworker' in hashParams) { - PDFJS.disableWorker = (hashParams['disableworker'] === 'true'); - } - if ('disablerange' in hashParams) { - PDFJS.disableRange = (hashParams['disablerange'] === 'true'); - } - if ('disablestream' in hashParams) { - PDFJS.disableStream = (hashParams['disablestream'] === 'true'); - } - if ('disableautofetch' in hashParams) { - PDFJS.disableAutoFetch = (hashParams['disableautofetch'] === 'true'); - } - if ('disablefontface' in hashParams) { - PDFJS.disableFontFace = (hashParams['disablefontface'] === 'true'); - } - if ('disablehistory' in hashParams) { - PDFJS.disableHistory = (hashParams['disablehistory'] === 'true'); - } - if ('webgl' in hashParams) { - PDFJS.disableWebGL = (hashParams['webgl'] !== 'true'); - } - if ('useonlycsszoom' in hashParams) { - PDFJS.useOnlyCssZoom = (hashParams['useonlycsszoom'] === 'true'); - } - if ('verbosity' in hashParams) { - PDFJS.verbosity = hashParams['verbosity'] | 0; - } - if ('ignorecurrentpositiononzoom' in hashParams) { - IGNORE_CURRENT_POSITION_ON_ZOOM = - (hashParams['ignorecurrentpositiononzoom'] === 'true'); - } - if ('locale' in hashParams) { - locale = hashParams['locale']; - } - if ('textlayer' in hashParams) { - switch (hashParams['textlayer']) { - case 'off': - PDFJS.disableTextLayer = true; - break; - case 'visible': - case 'shadow': - case 'hover': - var viewer = document.getElementById('viewer'); - viewer.classList.add('textLayer-' + hashParams['textlayer']); - break; - } - } - if ('pdfbug' in hashParams) { - PDFJS.pdfBug = true; - var pdfBug = hashParams['pdfbug']; - var enabled = pdfBug.split(','); - PDFBug.enable(enabled); - PDFBug.init(); - } - } - - if (!PDFViewerApplication.supportsPrinting) { - document.getElementById('print').classList.add('hidden'); - document.getElementById('secondaryPrint').classList.add('hidden'); - } - - if (!PDFViewerApplication.supportsFullscreen) { - document.getElementById('presentationMode').classList.add('hidden'); - document.getElementById('secondaryPresentationMode'). - classList.add('hidden'); - } - - if (PDFViewerApplication.supportsIntegratedFind) { - document.getElementById('viewFind').classList.add('hidden'); - } - - // Suppress context menus for some controls - document.getElementById('scaleSelect').oncontextmenu = noContextMenuHandler; - - var mainContainer = document.getElementById('mainContainer'); - var outerContainer = document.getElementById('outerContainer'); - mainContainer.addEventListener('transitionend', function(e) { - if (e.target === mainContainer) { - var event = document.createEvent('UIEvents'); - event.initUIEvent('resize', false, false, window, 0); - window.dispatchEvent(event); - outerContainer.classList.remove('sidebarMoving'); - } - }, true); - - document.getElementById('sidebarToggle').addEventListener('click', - function() { - this.classList.toggle('toggled'); - outerContainer.classList.add('sidebarMoving'); - outerContainer.classList.toggle('sidebarOpen'); - PDFViewerApplication.sidebarOpen = - outerContainer.classList.contains('sidebarOpen'); - if (PDFViewerApplication.sidebarOpen) { - PDFViewerApplication.refreshThumbnailViewer(); - } - PDFViewerApplication.forceRendering(); - }); - - document.getElementById('viewThumbnail').addEventListener('click', - function() { - PDFViewerApplication.switchSidebarView('thumbs'); - }); - - document.getElementById('viewOutline').addEventListener('click', - function() { - PDFViewerApplication.switchSidebarView('outline'); - }); - - document.getElementById('viewOutline').addEventListener('dblclick', - function() { - PDFViewerApplication.outline.toggleOutlineTree(); - }); - - document.getElementById('viewAttachments').addEventListener('click', - function() { - PDFViewerApplication.switchSidebarView('attachments'); - }); - - document.getElementById('previous').addEventListener('click', - function() { - PDFViewerApplication.page--; - }); - - document.getElementById('next').addEventListener('click', - function() { - PDFViewerApplication.page++; - }); - - document.getElementById('zoomIn').addEventListener('click', - function() { - PDFViewerApplication.zoomIn(); - }); - - document.getElementById('zoomOut').addEventListener('click', - function() { - PDFViewerApplication.zoomOut(); - }); - - document.getElementById('pageNumber').addEventListener('click', function() { - this.select(); - }); - - document.getElementById('pageNumber').addEventListener('change', function() { - // Handle the user inputting a floating point number. - PDFViewerApplication.page = (this.value | 0); - - if (this.value !== (this.value | 0).toString()) { - this.value = PDFViewerApplication.page; - } - }); - - document.getElementById('scaleSelect').addEventListener('change', function() { - if (this.value === 'custom') { - return; - } - PDFViewerApplication.pdfViewer.currentScaleValue = this.value; - }); - - document.getElementById('presentationMode').addEventListener('click', - SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar)); - - document.getElementById('openFile').addEventListener('click', - SecondaryToolbar.openFileClick.bind(SecondaryToolbar)); - - document.getElementById('print').addEventListener('click', - SecondaryToolbar.printClick.bind(SecondaryToolbar)); - - document.getElementById('download').addEventListener('click', - SecondaryToolbar.downloadClick.bind(SecondaryToolbar)); - - - if (file && file.lastIndexOf('file:', 0) === 0) { - // file:-scheme. Load the contents in the main thread because QtWebKit - // cannot load file:-URLs in a Web Worker. file:-URLs are usually loaded - // very quickly, so there is no need to set up progress event listeners. - PDFViewerApplication.setTitleUsingUrl(file); - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - PDFViewerApplication.open(new Uint8Array(xhr.response)); - }; - try { - xhr.open('GET', file); - xhr.responseType = 'arraybuffer'; - xhr.send(); - } catch (e) { - PDFViewerApplication.error('An error occurred while loading the PDF.', e); - } - return; - } - - if (file) { - PDFViewerApplication.open(file); - } -} - -document.addEventListener('DOMContentLoaded', webViewerLoad, true); - -document.addEventListener('pagerendered', function (e) { - var pageNumber = e.detail.pageNumber; - var pageIndex = pageNumber - 1; - var pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex); - - if (PDFViewerApplication.sidebarOpen) { - var thumbnailView = PDFViewerApplication.pdfThumbnailViewer. - getThumbnail(pageIndex); - thumbnailView.setImage(pageView); - } - - if (PDFJS.pdfBug && Stats.enabled && pageView.stats) { - Stats.add(pageNumber, pageView.stats); - } - - if (pageView.error) { - PDFViewerApplication.error('An error occurred while rendering the page.', pageView.error); - } - - // If the page is still visible when it has finished rendering, - // ensure that the page number input loading indicator is hidden. - if (pageNumber === PDFViewerApplication.page) { - var pageNumberInput = document.getElementById('pageNumber'); - pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR); - } - -}, true); - -document.addEventListener('textlayerrendered', function (e) { - var pageIndex = e.detail.pageNumber - 1; - var pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex); - -}, true); - -document.addEventListener('pagemode', function (evt) { - if (!PDFViewerApplication.initialized) { - return; - } - // Handle the 'pagemode' hash parameter, see also `PDFLinkService_setHash`. - var mode = evt.detail.mode; - switch (mode) { - case 'bookmarks': - // Note: Our code calls this property 'outline', even though the - // Open Parameter specification calls it 'bookmarks'. - mode = 'outline'; - /* falls through */ - case 'thumbs': - case 'attachments': - PDFViewerApplication.switchSidebarView(mode, true); - break; - case 'none': - if (PDFViewerApplication.sidebarOpen) { - document.getElementById('sidebarToggle').click(); - } - break; - } -}, true); - -document.addEventListener('namedaction', function (e) { - if (!PDFViewerApplication.initialized) { - return; - } - // Processing couple of named actions that might be useful. - // See also PDFLinkService.executeNamedAction - var action = e.detail.action; - switch (action) { - case 'GoToPage': - document.getElementById('pageNumber').focus(); - break; - - case 'Find': - if (!PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication.findBar.toggle(); - } - break; - } -}, true); - -window.addEventListener('presentationmodechanged', function (e) { - var active = e.detail.active; - var switchInProgress = e.detail.switchInProgress; - PDFViewerApplication.pdfViewer.presentationModeState = - switchInProgress ? PresentationModeState.CHANGING : - active ? PresentationModeState.FULLSCREEN : PresentationModeState.NORMAL; -}); - -window.addEventListener('updateviewarea', function (evt) { - if (!PDFViewerApplication.initialized) { - return; - } - var location = evt.location; - - PDFViewerApplication.store.initializedPromise.then(function() { - PDFViewerApplication.store.setMultiple({ - 'exists': true, - 'page': location.pageNumber, - 'zoom': location.scale, - 'scrollLeft': location.left, - 'scrollTop': location.top - }).catch(function() { - // unable to write to storage - }); - }); - var href = - PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams); - document.getElementById('viewBookmark').href = href; - document.getElementById('secondaryViewBookmark').href = href; - - // Update the current bookmark in the browsing history. - PDFViewerApplication.pdfHistory.updateCurrentBookmark(location.pdfOpenParams, - location.pageNumber); - - // Show/hide the loading indicator in the page number input element. - var pageNumberInput = document.getElementById('pageNumber'); - var currentPage = - PDFViewerApplication.pdfViewer.getPageView(PDFViewerApplication.page - 1); - - if (currentPage.renderingState === RenderingStates.FINISHED) { - pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR); - } else { - pageNumberInput.classList.add(PAGE_NUMBER_LOADING_INDICATOR); - } -}, true); - -window.addEventListener('resize', function webViewerResize(evt) { - if (PDFViewerApplication.initialized) { - var currentScaleValue = PDFViewerApplication.pdfViewer.currentScaleValue; - if (currentScaleValue === 'auto' || - currentScaleValue === 'page-fit' || - currentScaleValue === 'page-width') { - // Note: the scale is constant for 'page-actual'. - PDFViewerApplication.pdfViewer.currentScaleValue = currentScaleValue; - } else if (!currentScaleValue) { - // Normally this shouldn't happen, but if the scale wasn't initialized - // we set it to the default value in order to prevent any issues. - // (E.g. the document being rendered with the wrong scale on load.) - PDFViewerApplication.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; - } - PDFViewerApplication.pdfViewer.update(); - } - - // Set the 'max-height' CSS property of the secondary toolbar. - SecondaryToolbar.setMaxHeight(document.getElementById('viewerContainer')); -}); - -window.addEventListener('hashchange', function webViewerHashchange(evt) { - if (PDFViewerApplication.pdfHistory.isHashChangeUnlocked) { - var hash = document.location.hash.substring(1); - if (!hash) { - return; - } - if (!PDFViewerApplication.isInitialViewSet) { - PDFViewerApplication.initialBookmark = hash; - } else { - PDFViewerApplication.pdfLinkService.setHash(hash); - } - } -}); - -window.addEventListener('change', function webViewerChange(evt) { - var files = evt.target.files; - if (!files || files.length === 0) { - return; - } - var file = files[0]; - - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - PDFViewerApplication.open(URL.createObjectURL(file)); - } else { - // Read the local file into a Uint8Array. - var fileReader = new FileReader(); - fileReader.onload = function webViewerChangeFileReaderOnload(evt) { - var buffer = evt.target.result; - var uint8Array = new Uint8Array(buffer); - PDFViewerApplication.open(uint8Array); - }; - fileReader.readAsArrayBuffer(file); - } - - PDFViewerApplication.setTitleUsingUrl(file.name); - - // URL does not reflect proper document location - hiding some icons. - document.getElementById('viewBookmark').setAttribute('hidden', 'true'); - document.getElementById('secondaryViewBookmark'). - setAttribute('hidden', 'true'); - document.getElementById('download').setAttribute('hidden', 'true'); - document.getElementById('secondaryDownload').setAttribute('hidden', 'true'); -}, true); - -function selectScaleOption(value) { - var options = document.getElementById('scaleSelect').options; - var predefinedValueFound = false; - for (var i = 0, ii = options.length; i < ii; i++) { - var option = options[i]; - if (option.value !== value) { - option.selected = false; - continue; - } - option.selected = true; - predefinedValueFound = true; - } - return predefinedValueFound; -} - -window.addEventListener('localized', function localized(evt) { -// document.getElementsByTagName('html')[0].dir = mozL10n.getDirection(); - - PDFViewerApplication.animationStartedPromise.then(function() { - // Adjust the width of the zoom box to fit the content. - // Note: If the window is narrow enough that the zoom box is not visible, - // we temporarily show it to be able to adjust its width. - var container = document.getElementById('scaleSelectContainer'); - if (container.clientWidth === 0) { - container.setAttribute('style', 'display: inherit;'); - } - if (container.clientWidth > 0) { - var select = document.getElementById('scaleSelect'); - select.setAttribute('style', 'min-width: inherit;'); - var width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING; - select.setAttribute('style', 'min-width: ' + - (width + SCALE_SELECT_PADDING) + 'px;'); - container.setAttribute('style', 'min-width: ' + width + 'px; ' + - 'max-width: ' + width + 'px;'); - } - - // Set the 'max-height' CSS property of the secondary toolbar. - SecondaryToolbar.setMaxHeight(document.getElementById('viewerContainer')); - }); -}, true); - -window.addEventListener('scalechange', function scalechange(evt) { - document.getElementById('zoomOut').disabled = (evt.scale === MIN_SCALE); - document.getElementById('zoomIn').disabled = (evt.scale === MAX_SCALE); - - // Update the 'scaleSelect' DOM element. - var predefinedValueFound = selectScaleOption(evt.presetValue || - '' + evt.scale); - if (!predefinedValueFound) { - var customScaleOption = document.getElementById('customScaleOption'); - var customScale = Math.round(evt.scale * 10000) / 100; - customScaleOption.textContent = customScale + '%'; - customScaleOption.selected = true; - } - if (!PDFViewerApplication.initialized) { - return; - } - PDFViewerApplication.pdfViewer.update(); -}, true); - -window.addEventListener('pagechange', function pagechange(evt) { - var page = evt.pageNumber; - if (evt.previousPageNumber !== page) { - document.getElementById('pageNumber').value = page; - if (PDFViewerApplication.sidebarOpen) { - PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(page); - } - } - var numPages = PDFViewerApplication.pagesCount; - - document.getElementById('previous').disabled = (page <= 1); - document.getElementById('next').disabled = (page >= numPages); - - document.getElementById('firstPage').disabled = (page <= 1); - document.getElementById('lastPage').disabled = (page >= numPages); - - // we need to update stats - if (PDFJS.pdfBug && Stats.enabled) { - var pageView = PDFViewerApplication.pdfViewer.getPageView(page - 1); - if (pageView.stats) { - Stats.add(page, pageView.stats); - } - } -}, true); - -function handleMouseWheel(evt) { - var MOUSE_WHEEL_DELTA_FACTOR = 40; - var ticks = (evt.type === 'DOMMouseScroll') ? -evt.detail : - evt.wheelDelta / MOUSE_WHEEL_DELTA_FACTOR; - var direction = (ticks < 0) ? 'zoomOut' : 'zoomIn'; - - var pdfViewer = PDFViewerApplication.pdfViewer; - if (pdfViewer.isInPresentationMode) { - evt.preventDefault(); - PDFViewerApplication.scrollPresentationMode(ticks * - MOUSE_WHEEL_DELTA_FACTOR); - } else if (evt.ctrlKey || evt.metaKey) { - var support = PDFViewerApplication.supportedMouseWheelZoomModifierKeys; - if ((evt.ctrlKey && !support.ctrlKey) || - (evt.metaKey && !support.metaKey)) { - return; - } - // Only zoom the pages, not the entire viewer. - evt.preventDefault(); - - var previousScale = pdfViewer.currentScale; - - PDFViewerApplication[direction](Math.abs(ticks)); - - var currentScale = pdfViewer.currentScale; - if (previousScale !== currentScale) { - // After scaling the page via zoomIn/zoomOut, the position of the upper- - // left corner is restored. When the mouse wheel is used, the position - // under the cursor should be restored instead. - var scaleCorrectionFactor = currentScale / previousScale - 1; - var rect = pdfViewer.container.getBoundingClientRect(); - var dx = evt.clientX - rect.left; - var dy = evt.clientY - rect.top; - pdfViewer.container.scrollLeft += dx * scaleCorrectionFactor; - pdfViewer.container.scrollTop += dy * scaleCorrectionFactor; - } - } -} - -window.addEventListener('DOMMouseScroll', handleMouseWheel); -window.addEventListener('mousewheel', handleMouseWheel); - -window.addEventListener('click', function click(evt) { - if (SecondaryToolbar.opened && - PDFViewerApplication.pdfViewer.containsElement(evt.target)) { - SecondaryToolbar.close(); - } -}, false); - -window.addEventListener('keydown', function keydown(evt) { - if (OverlayManager.active) { - return; - } - - var handled = false; - var cmd = (evt.ctrlKey ? 1 : 0) | - (evt.altKey ? 2 : 0) | - (evt.shiftKey ? 4 : 0) | - (evt.metaKey ? 8 : 0); - - var pdfViewer = PDFViewerApplication.pdfViewer; - var isViewerInPresentationMode = pdfViewer && pdfViewer.isInPresentationMode; - - // First, handle the key bindings that are independent whether an input - // control is selected or not. - if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) { - // either CTRL or META key with optional SHIFT. - switch (evt.keyCode) { - case 70: // f - if (!PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication.findBar.open(); - handled = true; - } - break; - case 71: // g - if (!PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication.findBar.dispatchEvent('again', - cmd === 5 || cmd === 12); - handled = true; - } - break; - case 61: // FF/Mac '=' - case 107: // FF '+' and '=' - case 187: // Chrome '+' - case 171: // FF with German keyboard - if (!isViewerInPresentationMode) { - PDFViewerApplication.zoomIn(); - } - handled = true; - break; - case 173: // FF/Mac '-' - case 109: // FF '-' - case 189: // Chrome '-' - if (!isViewerInPresentationMode) { - PDFViewerApplication.zoomOut(); - } - handled = true; - break; - case 48: // '0' - case 96: // '0' on Numpad of Swedish keyboard - if (!isViewerInPresentationMode) { - // keeping it unhandled (to restore page zoom to 100%) - setTimeout(function () { - // ... and resetting the scale after browser adjusts its scale - pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; - }); - handled = false; - } - break; - } - } - - // CTRL or META without shift - if (cmd === 1 || cmd === 8) { - switch (evt.keyCode) { - case 83: // s - PDFViewerApplication.download(); - handled = true; - break; - } - } - - // CTRL+ALT or Option+Command - if (cmd === 3 || cmd === 10) { - switch (evt.keyCode) { - case 80: // p - PDFViewerApplication.requestPresentationMode(); - handled = true; - break; - case 71: // g - // focuses input#pageNumber field - document.getElementById('pageNumber').select(); - handled = true; - break; - } - } - - if (handled) { - evt.preventDefault(); - return; - } - - // Some shortcuts should not get handled if a control/input element - // is selected. - var curElement = document.activeElement || document.querySelector(':focus'); - var curElementTagName = curElement && curElement.tagName.toUpperCase(); - if (curElementTagName === 'INPUT' || - curElementTagName === 'TEXTAREA' || - curElementTagName === 'SELECT') { - // Make sure that the secondary toolbar is closed when Escape is pressed. - if (evt.keyCode !== 27) { // 'Esc' - return; - } - } - var ensureViewerFocused = false; - - if (cmd === 0) { // no control key pressed at all. - switch (evt.keyCode) { - case 38: // up arrow - case 33: // pg up - case 8: // backspace - if (!isViewerInPresentationMode && - pdfViewer.currentScaleValue !== 'page-fit') { - break; - } - /* in presentation mode */ - /* falls through */ - case 37: // left arrow - // horizontal scrolling using arrow keys - if (pdfViewer.isHorizontalScrollbarEnabled) { - break; - } - /* falls through */ - case 75: // 'k' - case 80: // 'p' - PDFViewerApplication.page--; - handled = true; - break; - case 27: // esc key - if (SecondaryToolbar.opened) { - SecondaryToolbar.close(); - handled = true; - } - if (!PDFViewerApplication.supportsIntegratedFind && - PDFViewerApplication.findBar.opened) { - PDFViewerApplication.findBar.close(); - handled = true; - } - break; - case 40: // down arrow - case 34: // pg down - case 32: // spacebar - if (!isViewerInPresentationMode && - pdfViewer.currentScaleValue !== 'page-fit') { - break; - } - /* falls through */ - case 39: // right arrow - // horizontal scrolling using arrow keys - if (pdfViewer.isHorizontalScrollbarEnabled) { - break; - } - /* falls through */ - case 74: // 'j' - case 78: // 'n' - PDFViewerApplication.page++; - handled = true; - break; - - case 36: // home - if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { - PDFViewerApplication.page = 1; - handled = true; - ensureViewerFocused = true; - } - break; - case 35: // end - if (isViewerInPresentationMode || (PDFViewerApplication.pdfDocument && - PDFViewerApplication.page < PDFViewerApplication.pagesCount)) { - PDFViewerApplication.page = PDFViewerApplication.pagesCount; - handled = true; - ensureViewerFocused = true; - } - break; - - case 72: // 'h' - if (!isViewerInPresentationMode) { - HandTool.toggle(); - } - break; - case 82: // 'r' - PDFViewerApplication.rotatePages(90); - break; - } - } - - if (cmd === 4) { // shift-key - switch (evt.keyCode) { - case 32: // spacebar - if (!isViewerInPresentationMode && - pdfViewer.currentScaleValue !== 'page-fit') { - break; - } - PDFViewerApplication.page--; - handled = true; - break; - - case 82: // 'r' - PDFViewerApplication.rotatePages(-90); - break; - } - } - - if (!handled && !isViewerInPresentationMode) { - // 33=Page Up 34=Page Down 35=End 36=Home - // 37=Left 38=Up 39=Right 40=Down - // 32=Spacebar - if ((evt.keyCode >= 33 && evt.keyCode <= 40) || - (evt.keyCode === 32 && curElementTagName !== 'BUTTON')) { - ensureViewerFocused = true; - } - } - - if (cmd === 2) { // alt-key - switch (evt.keyCode) { - case 37: // left arrow - if (isViewerInPresentationMode) { - PDFViewerApplication.pdfHistory.back(); - handled = true; - } - break; - case 39: // right arrow - if (isViewerInPresentationMode) { - PDFViewerApplication.pdfHistory.forward(); - handled = true; - } - break; - } - } - - if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) { - // The page container is not focused, but a page navigation key has been - // pressed. Change the focus to the viewer container to make sure that - // navigation by keyboard works as expected. - pdfViewer.focus(); - } - - if (handled) { - evt.preventDefault(); - } -}); - -window.addEventListener('beforeprint', function beforePrint(evt) { - PDFViewerApplication.beforePrint(); -}); - -window.addEventListener('afterprint', function afterPrint(evt) { - PDFViewerApplication.afterPrint(); -}); - -(function animationStartedClosure() { - // The offsetParent is not set until the pdf.js iframe or object is visible. - // Waiting for first animation. - PDFViewerApplication.animationStartedPromise = new Promise( - function (resolve) { - window.requestAnimationFrame(resolve); - }); -})(); - diff --git a/public/plugins/simplemde-1.10.1/simplemde.min.css b/public/plugins/simplemde-1.10.1/simplemde.min.css deleted file mode 100644 index bc07d4379..000000000 --- a/public/plugins/simplemde-1.10.1/simplemde.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/** - * simplemde v1.10.1 - * Copyright Next Step Webs, Inc. - * @link https://github.com/NextStepWebs/simplemde-markdown-editor - * @license MIT - */ -.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror,.CodeMirror-scroll{min-height:300px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)} \ No newline at end of file diff --git a/public/plugins/simplemde-1.10.1/simplemde.min.js b/public/plugins/simplemde-1.10.1/simplemde.min.js deleted file mode 100644 index 89bee7f35..000000000 --- a/public/plugins/simplemde-1.10.1/simplemde.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * simplemde v1.10.1 - * Copyright Next Step Webs, Inc. - * @link https://github.com/NextStepWebs/simplemde-markdown-editor - * @license MIT - */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SimpleMDE=e()}}(function(){var e;return function t(e,n,r){function i(l,a){if(!n[l]){if(!e[l]){var s="function"==typeof require&&require;if(!a&&s)return s(l,!0);if(o)return o(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[l]={exports:{}};e[l][0].call(u.exports,function(t){var n=e[l][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;lo;o++)for(var a=this.compoundRules[o],s=0,c=a.length;c>s;s++)this.compoundRuleCodes[a[s]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n);for(var o in this.compoundRuleCodes)0==this.compoundRuleCodes[o].length&&delete this.compoundRuleCodes[o];for(var o=0,l=this.compoundRules.length;l>o;o++){for(var u=this.compoundRules[o],d="",s=0,c=u.length;c>s;s++){var h=u[s];d+=h in this.compoundRuleCodes?"("+this.compoundRuleCodes[h].join("|")+")":h}this.compoundRules[o]=new RegExp(d,"i")}}return this};o.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(e,t){t||(t="ISO8859-1");var n=new XMLHttpRequest;return n.open("GET",e,!1),n.overrideMimeType&&n.overrideMimeType("text/plain; charset="+t),n.send(null),n.responseText},_parseAFF:function(e){var t={};e=this._removeAffixComments(e);for(var n=e.split("\n"),r=0,i=n.length;i>r;r++){var o=n[r],l=o.split(/\s+/),a=l[0];if("PFX"==a||"SFX"==a){for(var s=l[1],c=l[2],u=parseInt(l[3],10),d=[],h=r+1,f=r+1+u;f>h;h++){var o=n[h],p=o.split(/\s+/),m=p[2],g=p[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),x=p[4],b={};b.add=v,y.length>0&&(b.continuationClasses=y),"."!==x&&("SFX"===a?b.match=new RegExp(x+"$"):b.match=new RegExp("^"+x)),"0"!=m&&("SFX"===a?b.remove=new RegExp(m+"$"):b.remove=m),d.push(b)}t[s]={type:a,combineable:"Y"==c,entries:d},r+=u}else if("COMPOUNDRULE"===a){for(var u=parseInt(l[1],10),h=r+1,f=r+1+u;f>h;h++){var o=n[h],p=o.split(/\s+/);this.compoundRules.push(p[1])}r+=u}else if("REP"===a){var p=o.split(/\s+/);3===p.length&&this.replacementTable.push([p[1],p[2]])}else this.flags[a]=l[1]}return t},_removeAffixComments:function(e){return e=e.replace(/#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in r&&"object"==typeof r[e]||(r[e]=[]),r[e].push(t)}e=this._removeDicComments(e);for(var n=e.split("\n"),r={},i=1,o=n.length;o>i;i++){var l=n[i],a=l.split("/",2),s=a[0];if(a.length>1){var c=this.parseRuleCodes(a[1]);"NEEDAFFIX"in this.flags&&-1!=c.indexOf(this.flags.NEEDAFFIX)||t(s,c);for(var u=0,d=c.length;d>u;u++){var h=c[u],f=this.rules[h];if(f)for(var p=this._applyRule(s,f),m=0,g=p.length;g>m;m++){var v=p[m];if(t(v,[]),f.combineable)for(var y=u+1;d>y;y++){var x=c[y],b=this.rules[x];if(b&&b.combineable&&f.type!=b.type)for(var w=this._applyRule(v,b),k=0,C=w.length;C>k;k++){var S=w[k];t(S,[])}}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(s)}}else t(s.trim(),[])}return r},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,r=e.length;r>n;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?textCode.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;o>i;i++){var l=n[i];if(!l.match||e.match(l.match)){var a=e;if(l.remove&&(a=a.replace(l.remove,"")),"SFX"===t.type?a+=l.add:a=l.add+a,r.push(a),"continuationClasses"in l)for(var s=0,c=l.continuationClasses.length;c>s;s++){var u=this.rules[l.continuationClasses[s]];u&&(r=r.concat(this._applyRule(a,u)))}}}return r},check:function(e){var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var r=t.toLowerCase();if(r!==t){if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if("undefined"==typeof t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;r>n;n++)if(e.match(this.compoundRules[n]))return!0;return!1}for(var n=0,r=t.length;r>n;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1},hasFlag:function(e,t,n){if(t in this.flags){if("undefined"==typeof n)var n=Array.prototype.concat.apply([],this.dictionaryTable[e]);if(n&&-1!==n.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(e,t){function n(e){for(var t=[],n=0,r=e.length;r>n;n++){for(var i=e[n],o=[],l=0,a=i.length+1;a>l;l++)o.push([i.substring(0,l),i.substring(l,i.length)]);for(var s=[],l=0,a=o.length;a>l;l++){var u=o[l];u[1]&&s.push(u[0]+u[1].substring(1))}for(var d=[],l=0,a=o.length;a>l;l++){var u=o[l];u[1].length>1&&d.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2))}for(var h=[],l=0,a=o.length;a>l;l++){var u=o[l];if(u[1])for(var f=0,p=c.alphabet.length;p>f;f++)h.push(u[0]+c.alphabet[f]+u[1].substring(1))}for(var m=[],l=0,a=o.length;a>l;l++){var u=o[l];if(u[1])for(var f=0,p=c.alphabet.length;p>f;f++)h.push(u[0]+c.alphabet[f]+u[1])}t=t.concat(s),t=t.concat(d),t=t.concat(h),t=t.concat(m)}return t}function r(e){for(var t=[],n=0;nu;u++)a[u]in s?s[a[u]]+=1:s[a[u]]=1;var h=[];for(var u in s)h.push([u,s[u]]);h.sort(i).reverse();for(var f=[],u=0,d=Math.min(t,h.length);d>u;u++)c.hasFlag(h[u][0],"NOSUGGEST")||f.push(h[u][0]);return f}if(t||(t=5),this.check(e))return[];for(var o=0,l=this.replacementTable.length;l>o;o++){var a=this.replacementTable[o];if(-1!==e.indexOf(a[0])){var s=e.replace(a[0],a[1]);if(this.check(s))return[s]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",i(e)}},i("undefined"!=typeof o?o:window.Typo)}).call(e,void 0,void 0,void 0,void 0,function(e){t.exports=e})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})})},{"../../lib/codemirror":7}],4:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,l){var a=l&&l!=e.Init;if(o&&!a)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&a){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})})},{"../../lib/codemirror":7}],5:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),l=[],a=0;a")>=0?f[2]:parseInt(f[3],10)+1+f[4];l[a]="\n"+p+g+m}}i.replaceSelections(l)}})},{"../../lib/codemirror":7}],6:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)bo&&setTimeout(function(){s.display.input.reset(!0)},20),_t(this),Xi(),bt(this),this.curOp.forceUpdate=!0,Yr(this,i),r.autofocus&&!Ao||s.hasFocus()?setTimeout(zi(vn,this),20):yn(this);for(var u in el)el.hasOwnProperty(u)&&el[u](this,r[u],tl);k(this),r.finishInit&&r.finishInit(this);for(var d=0;dbo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),wo||go&&Ao||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function i(e){e.options.lineWrapping?(Zl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Yl(e.display.wrapper,"CodeMirror-wrap"),h(e)),l(e),Dt(e),at(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(kr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;lt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function f(e){var t=Ii(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ue(e.display));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?n:0,docHeight:r,scrollHeight:r+$e(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=_i("div",[_i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=_i("div",[_i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Al(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Al(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&8>bo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Yl(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Al(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Zl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var n=e.display.barWidth,r=e.display.barHeight;x(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&H(e),x(e,p(e)),n=e.display.barWidth,r=e.display.barHeight}function x(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function b(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-qe(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ni(t,r),l=ni(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;o>a?(o=a,l=ni(t,ri(Zr(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=ni(t,ri(Zr(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function w(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=S(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==jt(e))return!1;k(e)&&(Ft(e),t.dims=I(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Po&&(o=br(e.doc,o),l=wr(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Bt(e,o,l),n.viewOffset=ri(Zr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=jt(e);if(!a&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Gi();return s>4&&(n.lineDiv.style.display="none"),E(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Gi()!=c&&c.offsetHeight&&c.focus(),qi(n.cursorDiv),qi(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Re(e,400)),n.updateLineNumbers=null,!0}function N(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ve(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ue(e.display)-Ke(e),n.top)}),t.visible=b(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);r=!1){H(e);var i=p(e);Ee(e),O(e,i),y(e,i)}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 A(e,t){var n=new L(e,t);if(M(e,n)){H(e),N(e,n);var r=p(e);Ee(e),O(e,r),y(e,r),n.finish()}}function O(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=Math.max(t.docHeight+e.display.barHeight+$e(e),t.clientHeight)+"px"}function H(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;rbo){var l=o.node.offsetTop+o.node.offsetHeight;i=l-n,n=l}else{var a=o.node.getBoundingClientRect();i=a.bottom-a.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(ei(o.line,i),W(o.line),o.rest))for(var c=0;c=t&&d.lineNumber;d.changes&&(Ii(d.changes,"gutter")>-1&&(h=!1),D(e,d,c,n)),h&&(qi(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(C(e.options,c)))),a=d.node.nextSibling}else{var f=q(e,d,c,n);l.insertBefore(f,a)}c+=d.size}for(;a;)a=r(a)}function D(e,t,n,r){for(var i=0;ibo&&(e.node.style.zIndex=2)),e.node}function F(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=P(e);e.background=n.insertBefore(_i("div",null,t),n.firstChild)}}function z(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):zr(e,t)}function R(e,t){var n=t.text.className,r=z(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,B(t)):n&&(t.text.className=n)}function B(e){F(e),e.line.wrapClass?P(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function j(e,t,n,r){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=P(t);t.gutterBackground=_i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=P(t),l=t.gutter=_i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),i.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(_i("div",C(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a1)if(Ro&&Ro.join("\n")==t){if(r.ranges.length%Ro.length==0){s=[];for(var c=0;c=0;c--){var u=r.ranges[c],d=u.from(),h=u.to();u.empty()&&(n&&n>0?d=Fo(d.line,d.ch-n):e.state.overwrite&&!l&&(h=Fo(h.line,Math.min(Zr(o,h.line).text.length,h.ch+Wi(a).length))));var f=e.curOp.updateInput,p={from:d,to:h,text:s?s[c%s.length]:a,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,p),Si(e,"inputRead",e,p)}t&&!l&&J(e,t),zn(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||At(t,function(){Z(t,n,0,null,"paste")}),!0):void 0}function J(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Bn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Bn(e,i.head.line,"smart"));l&&Si(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],n=[],r=0;ri?c.map:u[i],l=0;li?e.line:e.rest[i]),d=o[l]+r;return(0>r||a!=t)&&(d=o[l+(r?1:0)]),Fo(s,d)}}}var i=e.text.firstChild,o=!1;if(!t||!Vl(i,t))return le(Fo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var l=e.rest?Wi(e.rest):e.line;return le(Fo(ti(l),l.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,d=r(a,s,n);if(d)return le(d,o);for(var h=s.nextSibling,f=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(d=r(h,h.firstChild,0))return le(Fo(d.line,d.ch-f),o);f+=h.textContent.length}for(var p=s.previousSibling,f=n;p;p=p.previousSibling){if(d=r(p,p.firstChild,-1))return le(Fo(d.line,d.ch+f),o);f+=h.textContent.length}}function ce(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(a+=n);var u,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(Fo(r,0),Fo(i+1,0),o(+d));return void(h.length&&(u=h[0].find())&&(a+=Qr(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var f=0;f=0){var l=X(o.from(),i.from()),a=K(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new de(s?a:l,s?l:a))}}return new ue(e,t)}function fe(e,t){return new ue([new de(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.linen?Fo(n,Zr(e,n).text.length):ge(t,Zr(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Fo(e.line,t):0>n?Fo(e.line,0):e}function ve(e,t){return t>=e.first&&t=t.ch:a.to>t.ch))){if(i&&(Wl(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var c,u=s.find(0>r?1:-1);if((0>r?s.inclusiveRight:s.inclusiveLeft)&&(u=Ie(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=zo(u,n))&&(0>r?0>c:c>0))return He(e,u,t,r,i)}var d=s.find(0>r?-1:1);return(0>r?s.inclusiveLeft:s.inclusiveRight)&&(d=Ie(e,d,r,d.line==t.line?o:null)),d?He(e,d,t,r,i):null}}return t}function We(e,t,n,r,i){var o=r||1,l=He(e,t,n,o,i)||!i&&He(e,t,n,o,!0)||He(e,t,n,-o,i)||!i&&He(e,t,n,-o,!0);return l?l:(e.cantEdit=!0,Fo(e.first,0))}function Ie(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,Fo(t.line-1)):null:n>0&&t.ch==(r||Zr(e,t.line)).text.length?t.line=e.display.viewTo||a.to().linet&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(_i("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return ht(e,Fo(t,n),"div",d,r)}var a,s,d=Zr(l,t),h=d.text.length;return eo(ii(d),n||0,null==i?h:i,function(e,t,l){var d,f,p,m=o(e,"left");if(e==t)d=m,f=p=m.left;else{if(d=o(t-1,"right"),"rtl"==l){var g=m;m=d,d=g}f=m.left,p=d.right}null==n&&0==e&&(f=c),d.top-m.top>3&&(r(f,m.top,null,m.bottom),f=c,m.bottoms.bottom||d.bottom==s.bottom&&d.right>s.right)&&(s=d),c+1>f&&(f=c),r(f,d.top,p-f,d.bottom)}),{start:a,end:s}}var o=e.display,l=e.doc,a=document.createDocumentFragment(),s=Ge(e.display),c=s.left,u=Math.max(o.sizerWidth,Ve(e)-o.sizer.offsetLeft)-s.right,d=t.from(),h=t.to();if(d.line==h.line)i(d.line,d.ch,h.ch);else{var f=Zr(l,d.line),p=Zr(l,h.line),m=yr(f)==yr(p),g=i(d.line,d.ch,m?f.text.length+1:null).end,v=i(h.line,m?0:null,h.ch).start;m&&(g.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,r=al(t.mode,_e(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength,s=Er(e,o,a?al(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!l||l.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn?(Re(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;tl;--a){if(a<=o.first)return o.first;var s=Zr(o,a-1);if(s.stateAfter&&(!n||a<=o.frontier))return a;var c=Rl(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function _e(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=je(e,t,n),l=o>r.first&&Zr(r,o-1).stateAfter;return l=l?al(r.mode,l):sl(r.mode),r.iter(o,t,function(n){Pr(e,n.text,l);var a=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ye(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ze(e,t){t=yr(t);var n=ti(t),r=e.display.externalMeasured=new It(e.doc,t,n);r.lineN=n;var i=r.built=zr(e,r);return r.text=i.pre,Ui(e.display.lineMeasure,i.pre),r}function Qe(e,t,n,r){return tt(e,et(e,t),n,r)}function Je(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt?(i=0,o=1,l="left"):c>t?(i=t-s,o=i+1):(a==e.length-3||t==c&&e[a+3]>t)&&(o=c-s,i=o-1,t>=c&&(l="right")),null!=i){if(r=e[a+2],s==c&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;a&&e[a-2]==e[a-3]&&e[a-1].insertLeft;)r=e[(a-=3)+2],l="left";if("right"==n&&i==c-s)for(;au;u++){for(;a&&ji(t.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+sbo&&0==a&&s==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(xo&&e.options.lineWrapping){var d=ql(l,a,s).getClientRects();i=d.length?d["right"==r?d.length-1:0]:qo}else i=ql(l,a,s).getBoundingClientRect()||qo;if(i.left||i.right||0==a)break;s=a,a-=1,c="right"}xo&&11>bo&&(i=it(e.display.measure,i))}else{a>0&&(c=r="right");var d;i=e.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==r?d.length-1:0]:l.getBoundingClientRect()}if(xo&&9>bo&&!a&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}:qo}for(var f=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(f+p)/2,g=t.view.measure.heights,u=0;un.from?l(e-1):l(e,r)}r=r||Zr(e.doc,t.line),i||(i=et(e,r));var s=ii(r),c=t.ch;if(!s)return l(c);var u=co(s,c),d=a(c,u);return null!=oa&&(d.other=a(c,oa)),d}function pt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Zr(e.doc,t.line),i=ri(r)+qe(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=Fo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ni(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Zr(r,o).text.length,!0,1);0>t&&(t=0);for(var l=Zr(r,i);;){var a=vt(e,l,i,t,n),s=gr(l),c=s&&s.find(0,!0);if(!s||!(a.ch>c.from.ch||a.ch==c.from.ch&&a.xRel>0))return a;i=ti(l=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=ft(e,Fo(n,r),"line",t,c);return a=!0,l>i.bottom?i.left-s:lg)return mt(n,f,v,1);for(;;){if(u?f==h||f==ho(t,h,1):1>=f-h){for(var y=p>r||g-r>=r-p?h:f,x=r-(y==h?p:g);ji(t.text.charAt(y));)++y;var b=mt(n,y,y==h?m:v,-1>x?-1:x>1?1:0);return b}var w=Math.ceil(d/2),k=h+w;if(u){k=h;for(var C=0;w>C;++C)k=ho(t,k,1)}var S=o(k);S>r?(f=k,g=S,(v=a)&&(g+=1e3),d=w):(h=k,p=S,m=a,d-=w)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Bo){Bo=_i("pre");for(var t=0;49>t;++t)Bo.appendChild(document.createTextNode("x")),Bo.appendChild(_i("br"));Bo.appendChild(document.createTextNode("x"))}Ui(e.measure,Bo);var n=Bo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),qi(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=_i("span","xxxxxxxxxx"),n=_i("pre",[t]);Ui(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Go},Uo?Uo.ops.push(e.curOp):e.curOp.ownsGroup=Uo={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new L(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&H(t),e.barMeasure=p(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+$e(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ve(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=r){var l=new It(e.doc,Zr(e.doc,o),o);r=o+l.size,i.push(l)}return i}function Dt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Po&&br(e.doc,t)i.viewFrom?Ft(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Ft(e);else if(t<=i.viewFrom){var o=Rt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Ft(e)}else if(n>=i.viewTo){var o=Rt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Ft(e)}else{var l=Rt(e,t,t,-1),a=Rt(e,n,n+r,1);l&&a?(i.view=i.view.slice(0,l.index).concat(Et(e,l.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=r):Ft(e)}var s=i.externalMeasured;s&&(n=i.lineN&&t=r.viewTo)){var o=r.view[zt(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Ii(l,n)&&l.push(n)}}}function Ft(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;rt)return r}function Rt(e,t,n,r){var i,o=zt(e,t),l=e.display.view;if(!Po||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=0,s=e.display.viewFrom;o>a;a++)s+=l[a].size;if(s!=t){if(r>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;br(e.doc,n)!=n;){if(o==(0>r?0:l.length-1))return null;n+=r*l[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Bt(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Et(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Et(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,zt(e,n)))),r.viewTo=n}function jt(e){for(var t=e.display.view,n=0,r=0;r400}var i=e.display;Al(i.scroller,"mousedown",Ot(e,Vt)),xo&&11>bo?Al(i.scroller,"dblclick",Ot(e,function(t){if(!Ti(e,t)){var n=$t(e,t);if(n&&!Qt(e,t)&&!Gt(e.display,t)){Tl(t);var r=e.findWordAt(n);be(e.doc,r.anchor,r.head)}}})):Al(i.scroller,"dblclick",function(t){Ti(e,t)||Tl(t)}),Eo||Al(i.scroller,"contextmenu",function(t){xn(e,t)});var o,l={end:0};Al(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Al(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Al(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Gt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,a=e.coordsChar(i.activeTouch,"page");l=!o.prev||r(o,o.prev)?new de(a,a):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(a):new de(Fo(a.line,0),me(e.doc,Fo(a.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Tl(n)}t()}),Al(i.scroller,"touchcancel",t),Al(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rn(e,i.scroller.scrollTop),on(e,i.scroller.scrollLeft,!0),Wl(e,"scroll",e))}),Al(i.scroller,"mousewheel",function(t){ln(e,t)}),Al(i.scroller,"DOMMouseScroll",function(t){ln(e,t)}),Al(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Nl(t)},over:function(t){Ti(e,t)||(tn(e,t),Nl(t))},start:function(t){en(e,t)},drop:Ot(e,Jt),leave:function(){nn(e)}};var a=i.input.getField();Al(a,"keyup",function(t){pn.call(e,t)}),Al(a,"keydown",Ot(e,hn)),Al(a,"keypress",Ot(e,mn)),Al(a,"focus",zi(vn,e)),Al(a,"blur",zi(yn,e))}function qt(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,l=n?Al:Hl;l(t.display.scroller,"dragstart",o.start),l(t.display.scroller,"dragenter",o.enter),l(t.display.scroller,"dragover",o.over),l(t.display.scroller,"dragleave",o.leave),l(t.display.scroller,"drop",o.drop)}}function Ut(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gt(e,t){for(var n=wi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function $t(e,t,n,r){var i=e.display;if(!n&&"true"==wi(t).getAttribute("cm-not-content"))return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(t){return null}var s,c=gt(e,o,l);if(r&&1==c.xRel&&(s=Zr(e.doc,c.line).text).length==c.ch){var u=Rl(s,s.length,e.options.tabSize)-s.length;c=Fo(c.line,Math.max(0,Math.round((o-Ge(e.display).left)/xt(e.display))-u))}return c}function Vt(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Gt(n,e))return void(wo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Qt(t,e)){var r=$t(t,e);switch(window.focus(),ki(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Kt(t,e,r):wi(e)==n.scroller&&Tl(e);break;case 2:wo&&(t.state.lastMiddleDown=+new Date),r&&be(t.doc,r),setTimeout(function(){n.input.focus()},20),Tl(e);break;case 3:Eo?xn(t,e):gn(t)}}}}function Kt(e,t,n){xo?setTimeout(zi(Y,e),0):e.curOp.focus=Gi();var r,i=+new Date;_o&&_o.time>i-400&&0==zo(_o.pos,n)?r="triple":jo&&jo.time>i-400&&0==zo(jo.pos,n)?(r="double",_o={time:i,pos:n}):(r="single",jo={time:i,pos:n});var o,l=e.doc.sel,a=Oo?t.metaKey:t.ctrlKey;e.options.dragDrop&&Jl&&!e.isReadOnly()&&"single"==r&&(o=l.contains(n))>-1&&(zo((o=l.ranges[o]).from(),n)<0||n.xRel>0)&&(zo(o.to(),n)>0||n.xRel<0)?Xt(e,t,n,a):Yt(e,t,n,r,a)}function Xt(e,t,n,r){var i=e.display,o=+new Date,l=Ot(e,function(a){wo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Hl(document,"mouseup",l),Hl(i.scroller,"drop",l),Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10&&(Tl(a),!r&&+new Date-200=p;p++){var v=Zr(c,p).text,y=Bl(v,s,o);s==f?i.push(new de(Fo(p,y),Fo(p,y))):v.length>y&&i.push(new de(Fo(p,y),Fo(p,Bl(v,f,o))))}i.length||i.push(new de(n,n)),Te(c,he(h.ranges.slice(0,d).concat(i),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=u,b=x.anchor,w=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new de(Fo(t.line,0),me(c,Fo(t.line+1,0)));zo(k.anchor,b)>0?(w=k.head,b=X(x.from(),k.anchor)):(w=k.anchor,b=K(x.to(),k.head))}var i=h.ranges.slice(0);i[d]=new de(me(c,b),w),Te(c,he(i,d),Fl)}}function l(t){var n=++y,i=$t(e,t,!0,"rect"==r);if(i)if(0!=zo(i,g)){e.curOp.focus=Gi(),o(i);var a=b(s,c);(i.line>=a.to||i.linev.bottom?20:0;u&&setTimeout(Ot(e,function(){y==n&&(s.scroller.scrollTop+=u,l(t))}),50)}}function a(t){e.state.selectingText=!1,y=1/0,Tl(t),s.input.focus(),Hl(document,"mousemove",x),Hl(document,"mouseup",w),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;Tl(t);var u,d,h=c.sel,f=h.ranges;if(i&&!t.shiftKey?(d=c.sel.contains(n),u=d>-1?f[d]:new de(n,n)):(u=c.sel.primary(),d=c.sel.primIndex),t.altKey)r="rect",i||(u=new de(n,n)),n=$t(e,t,!0,!0),d=-1;else if("double"==r){var p=e.findWordAt(n);u=e.display.shift||c.extend?xe(c,u,p.anchor,p.head):p}else if("triple"==r){var m=new de(Fo(n.line,0),me(c,Fo(n.line+1,0)));u=e.display.shift||c.extend?xe(c,u,m.anchor,m.head):m}else u=xe(c,u,n);i?-1==d?(d=f.length,Te(c,he(f.concat([u]),d),{scroll:!1,origin:"*mouse"})):f.length>1&&f[d].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(f.slice(0,d).concat(f.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),h=c.sel):ke(c,d,u,Fl):(d=0,Te(c,new ue([u],0),Fl),h=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,x=Ot(e,function(e){ki(e)?l(e):a(e)}),w=Ot(e,a);e.state.selectingText=w,Al(document,"mousemove",x),Al(document,"mouseup",w)}function Zt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Tl(t);var l=e.display,a=l.lineDiv.getBoundingClientRect(); -if(o>a.bottom||!Ni(e,n))return bi(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var u=ni(e.doc,o),d=e.options.gutters[s];return Wl(e,n,e,u,d,t),bi(t)}}}function Qt(e,t){return Zt(e,t,"gutterClick",!0)}function Jt(e){var t=this;if(nn(t),!Ti(t,e)&&!Gt(t.display,e)){Tl(e),xo&&($o=+new Date);var n=$t(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,a=function(e,r){if(!t.options.allowDropFileTypes||-1!=Ii(t.options.allowDropFileTypes,e.type)){var a=new FileReader;a.onload=Ot(t,function(){var e=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++l==i){n=me(t.doc,n);var s={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,s),Le(t.doc,fe(n,Qo(s)))}}),a.readAsText(e)}},s=0;i>s;++s)a(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Oo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Me(t.doc,fe(n,n)),c)for(var s=0;sl.clientWidth,s=l.scrollHeight>l.clientHeight;if(r&&a||i&&s){if(i&&Oo&&wo)e:for(var c=t.target,u=o.view;c!=l;c=c.parentNode)for(var d=0;dh?f=Math.max(0,f+h-50):p=Math.min(e.doc.height,p+h+50),A(e,{top:f,bottom:p})}20>Vo&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ko=(Ko*Vo+n)/(Vo+1),++Vo)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function an(e,t,n){if("string"==typeof t&&(t=cl[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Dl}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function sn(e,t,n){for(var r=0;rbo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=un(t,e);So&&(Zo=r?n:null,!r&&88==n&&!na&&(Oo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fn(t)}}function fn(e){function t(e){18!=e.keyCode&&e.altKey||(Yl(n,"CodeMirror-crosshair"),Hl(document,"keyup",t),Hl(document,"mouseover",t))}var n=e.display.lineDiv;Zl(n,"CodeMirror-crosshair"),Al(document,"keyup",t),Al(document,"mouseover",t)}function pn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ti(this,e)}function mn(e){var t=this;if(!(Gt(t.display,e)||Ti(t,e)||e.ctrlKey&&!e.altKey||Oo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(So&&n==Zo)return Zo=null,void Tl(e);if(!So||e.which&&!(e.which<10)||!un(t,e)){var i=String.fromCharCode(null==r?n:r);dn(t,e,i)||t.display.input.onKeyPress(e)}}}function gn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function vn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Wl(e,"focus",e),e.state.focused=!0,Zl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ze(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(Wl(e,"blur",e),e.state.focused=!1,Yl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xn(e,t){Gt(e.display,t)||bn(e,t)||Ti(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function bn(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wn(e,t){if(zo(e,t.from)<0)return e;if(zo(e,t.to)<=0)return Qo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Qo(t).ch-t.to.ch),Fo(n,r)}function kn(e,t){for(var n=[],r=0;r=0;--i)Mn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Mn(e,t)}}function Mn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=zo(t.from,t.to)){var n=kn(e,t);ci(e,t,n,e.cm?e.cm.curOp.id:NaN),On(e,t,n,or(e,t));var r=[];Xr(e,function(e,n){n||-1!=Ii(r,e.history)||(xi(e.history,t),r.push(e.history)),On(e,t,null,or(e,t))})}}function Nn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,a="undo"==t?i.undone:i.done,s=0;s=0;--s){var d=r.changes[s];if(d.origin=t,u&&!Ln(e,d,!1))return void(l.length=0);c.push(li(e,d));var h=s?kn(e,d):Wi(l);On(e,d,h,ar(e,d)),!s&&e.cm&&e.cm.scrollIntoView({from:d.from,to:Qo(d)});var f=[];Xr(e,function(e,t){t||-1!=Ii(f,e.history)||(xi(e.history,d),f.push(e.history)),On(e,d,null,ar(e,d))})}}}}function An(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(Ei(e.sel.ranges,function(e){return new de(Fo(e.anchor.line+t,e.anchor.ch),Fo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Fo(o,Zr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qr(e,t.from,t.to),n||(n=kn(e,t)),e.cm?Hn(e.cm,t,r):$r(e,t,r),Me(e,n,Pl)}}function Hn(e,t,n){var r=e.doc,i=e.display,l=t.from,a=t.to,s=!1,c=l.line;e.options.lineWrapping||(c=ti(yr(Zr(r,l.line))),r.iter(c,a.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Mi(e),$r(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,l.line+t.text.length,function(e){var t=d(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,l.line),Re(e,400);var u=t.text.length-(a.line-l.line)-1;t.full?Dt(e):l.line!=a.line||1!=t.text.length||Gr(e.doc,t)?Dt(e,l.line,a.line+1,u):Pt(e,l.line,"text");var h=Ni(e,"changes"),f=Ni(e,"change");if(f||h){var p={from:l,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&Si(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function Wn(e,t,n,r,i){if(r||(r=n),zo(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function In(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=_i("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-qe(e.display))+"px; height: "+(t.bottom-t.top+$e(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function En(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,l=ft(e,t),a=n&&n!=t?ft(e,n):l,s=Pn(e,Math.min(l.left,a.left),Math.min(l.top,a.top)-r,Math.max(l.left,a.left),Math.max(l.bottom,a.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(rn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(on(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return l}function Dn(e,t,n,r,i){var o=Pn(e,t,n,r,i);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function Pn(e,t,n,r,i){var o=e.display,l=yt(e.display);0>n&&(n=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ke(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+Ue(o),d=l>n,h=i>u-l;if(a>n)c.scrollTop=d?0:n;else if(i>a+s){var f=Math.min(n,(h?u:i)-s);f!=a&&(c.scrollTop=f)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ve(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:p>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+p-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Fn(e,t,n){null==t&&null==n||Rn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function zn(e){Rn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Fo(t.line,t.ch-1):t,r=Fo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Rn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pt(e,t.from),r=pt(e,t.to),i=Pn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Bn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=_e(e,t):n="prev");var l=e.options.tabSize,a=Zr(o,t),s=Rl(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(i,a.text.slice(u.length),a.text),c==Dl||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Rl(Zr(o,t-1).text,null,l):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/l);f;--f)h+=l,d+=" ";if(c>h&&(d+=Hi(c-h)),d!=u)return Wn(o,d,Fo(t,0),Fo(t,u.length),"+input"),a.stateAfter=null,!0;for(var f=0;f=0;t--)Wn(e.doc,"",r[t].from,r[t].to,"+delete");zn(e)})}function qn(e,t,n,r,i){function o(){var t=a+n;return t=e.first+e.size?!1:(a=t,u=Zr(e,t))}function l(e){var t=(i?ho:fo)(u,s,n,!0);if(null==t){if(e||!o())return!1;s=i?(0>n?io:ro)(u):0>n?u.text.length:0}else s=t;return!0}var a=t.line,s=t.ch,c=n,u=Zr(e,a);if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>n)||l(!p);p=!1){var m=u.text.charAt(s)||"\n",g=Ri(m,f)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),d&&d!=g){0>n&&(n=1,l());break}if(g&&(d=g),n>0&&!l(!p))break}var v=We(e,Fo(a,s),t,c,!0);return zo(t,v)||(v.hitSide=!0),v}function Un(e,t,n,r){var i,o=e.doc,l=t.left;if("page"==r){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(a-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,l,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Gn(t,n,r,i){e.defaults[t]=n,r&&(el[t]=i?function(e,t,n){n!=tl&&r(e,t,n)}:r)}function $n(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=_i("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vr(e,t.line,t,n,o)||t.line!=n.line&&vr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Po=!0}o.addToHistory&&ci(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&yr(e)==c.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&ei(e,0),nr(e,new Jn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){kr(e,t)&&ei(t,0)}),o.clearOnEnter&&Al(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Do=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ml,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Dt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Pt(c,u,"text");o.atomic&&Ae(c.doc),Si(c,"markerAdded",c,o)}return o}function Xn(e,t,n,r,i){r=Fi(r),r.shared=!1;var o=[Kn(e,t,n,r,i)],l=o[0],a=r.widgetNode;return Xr(e,function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Kn(e,me(e,t),me(e,n),r,i));for(var s=0;s=t:o.to>t);(r||(r=[])).push(new Jn(l,o.from,s?null:o.to))}}return r}function ir(e,t,n){if(e)for(var r,i=0;i=t:o.to>t);if(a||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var d=0;dd;++d)p.push(m);p.push(s)}return p}function lr(e){for(var t=0;t0)){var u=[s,1],d=zo(c.from,a.from),h=zo(c.to,a.to);(0>d||!l.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(h>0||!l.inclusiveRight&&!h)&&u.push({from:a.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function cr(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&0>=d||0>=u&&d>=0)&&(0>=u&&(zo(c.to,n)>0||s.marker.inclusiveRight&&i.inclusiveLeft)||u>=0&&(zo(c.from,r)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=gr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function br(e,t){var n=Zr(e,t),r=yr(n);return n==r?t:ti(r)}function wr(e,t){if(t>e.lastLine())return t;var n,r=Zr(e,t);if(!kr(e,r))return t;for(;n=gr(r);)r=n.find(1,!0).line;return ti(r)+1}function kr(e,t){var n=Po&&t.markedSpans;if(n)for(var r,i=0;io;o++){i&&(i[0]=e.innerMode(t,r).mode);var l=t.token(n,r);if(n.pos>n.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function Wr(e,t,n,r){function i(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?al(l.mode,u):u}}var o,l=e.doc,a=l.mode;t=me(l,t);var s,c=Zr(l,t.line),u=_e(e,t.line,n),d=new pl(c.text,e.options.tabSize);for(r&&(s=[]);(r||d.pose.options.maxHighlightLength?(a=!1,l&&Pr(e,t,r,d.pos),d.pos=t.length,s=null):s=Ar(Hr(n,d,r,h),o),h){var f=h[0].name;f&&(s="m-"+(s?f+" "+s:f))}if(!a||u!=s){for(;cc;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=_e(e,ti(t)),i=Er(e,t,t.text.length>e.options.maxHighlightLength?al(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Pr(e,t,n,r){var i=e.doc.mode,o=new pl(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Or(i,n);!o.eol();)Hr(i,o,n),o.start=o.pos}function Fr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?wl:bl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function zr(e,t){var n=_i("span",null,null,wo?"padding-right: .1px":null),r={pre:_i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(xo||wo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Br,Qi(e.display.measure)&&(o=ii(l))&&(r.addToken=_r(r.addToken,o)),r.map=[];var a=t!=e.display.externalMeasured&&ti(l);Ur(l,r,Dr(e,l,a)),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=Vi(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=Vi(l.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return wo&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),Wl(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Vi(r.pre.className,r.textClass||"")),r}function Rr(e){var t=_i("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Br(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?t.replace(/ {3,}/g,jr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),d=0;;){s.lastIndex=d;var h=s.exec(t),f=h?h.index-d:t.length-d;if(f){var p=document.createTextNode(a.slice(d,d+f));xo&&9>bo?u.appendChild(_i("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+f,p),e.col+=f,e.pos+=f}if(!h)break;if(d+=f+1," "==h[0]){var m=e.cm.options.tabSize,g=m-e.col%m,p=u.appendChild(_i("span",Hi(g),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=g}else if("\r"==h[0]||"\n"==h[0]){var p=u.appendChild(_i("span","\r"==h[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",h[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(h[0]);p.setAttribute("cm-text",h[0]),xo&&9>bo?u.appendChild(_i("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(a);e.map.push(e.pos,e.pos+t.length,u),xo&&9>bo&&(c=!0),e.pos+=t.length}if(n||r||i||c||l){var v=n||"";r&&(v+=r),i&&(v+=i);var y=_i("span",[u],v,l);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function jr(e){for(var t=" ",n=0;nc&&h.from<=c)break}if(h.to>=u)return e(n,r,i,o,l,a,s);e(n,r.slice(0,h.to-c),i,o,null,a,s),o=null,r=r.slice(h.to-c),c=h.to}}}function qr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Ur(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,c,u,d,h,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=d=a="",h=null,v=1/0;for(var y,x=[],b=0;bp||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(a=(a?a+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!d&&(d=k.title),k.collapsed&&(!h||fr(h.marker,k)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(var b=0;b=f)break;for(var C=Math.min(f,v);;){if(g){var S=p+g.length;if(!h){var L=S>C?g.slice(0,C-p):g;t.addToken(t,L,l?l+s:s,u,p+L.length==v?c:"",d,a)}if(S>=C){g=g.slice(C-p),p=C;break}p=S,u=""}g=i.slice(o,o=n[m++]),l=Fr(n[m++],t.cm.options)}}else for(var m=1;mn;++n)o.push(new xl(c[n],i(n),r));return o}var a=t.from,s=t.to,c=t.text,u=Zr(e,a.line),d=Zr(e,s.line),h=Wi(c),f=i(c.length-1),p=s.line-a.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,t)){var m=l(0,c.length-1);o(d,d.text,f),p&&e.remove(a.line,p),m.length&&e.insert(a.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,a.ch)+h+u.text.slice(s.ch),f);else{var m=l(1,c.length-1);m.push(new xl(h+u.text.slice(s.ch),f,r)),o(u,u.text.slice(0,a.ch)+c[0],i(0)),e.insert(a.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,a.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(a.line+1,p);else{o(u,u.text.slice(0,a.ch)+c[0],i(0)),o(d,h+d.text.slice(s.ch),f);var m=l(1,c.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}Si(e,"change",e,t)}function Vr(e){this.lines=e,this.parent=null;for(var t=0,n=0;tt||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Qr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Jr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ei(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ti(e){if(null==e.parent)return null;for(var t=e.parent,n=Ii(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ni(e,t){var n=e.first;e:do{for(var r=0;rt){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;rt)break;t-=a}return n+r}function ri(e){e=yr(e);for(var t=0,n=e.parent,r=0;r1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Wi(e.done)):void 0}function ci(e,t,n,r){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=si(i,i.lastOp==r))){var a=Wi(o.changes);0==zo(t.from,t.to)&&0==zo(t.from,a.to)?a.to=Qo(t):o.changes.push(li(e,t))}else{var s=Wi(i.done);for(s&&s.ranges||hi(e.sel,i.done),o={changes:[li(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(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Wl(e,"historyAdded")}function ui(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function di(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ui(e,o,Wi(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ai(i.undone)}function hi(e,t){var n=Wi(t);n&&n.ranges&&n.equals(e)||t.push(e)}function fi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,n=0;n-1&&(Wi(a)[d]=u[d],delete u[d])}}}return i}function vi(e,t,n,r){n0?r.slice():Ol:r||Ol}function Si(e,t){function n(e){return function(){e.apply(null,o)}}var r=Ci(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Uo?i=Uo.delayedCallbacks:Il?i=Il:(i=Il=[],setTimeout(Li,0));for(var l=0;l0}function Ai(e){e.prototype.on=function(e,t){Al(this,e,t)},e.prototype.off=function(e,t){Hl(this,e,t)}}function Oi(){this.id=null}function Hi(e){for(;jl.length<=e;)jl.push(Wi(jl)+" ");return jl[e]}function Wi(e){return e[e.length-1]}function Ii(e,t){for(var n=0;n-1&&Gl(e)?!0:t.test(e):Gl(e)}function Bi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function ji(e){return e.charCodeAt(0)>=768&&$l.test(e)}function _i(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Ui(e,t){return qi(e).appendChild(t)}function Gi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function $i(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Vi(e,t){for(var n=e.split(" "),r=0;r2&&!(xo&&8>bo))}var n=Kl?_i("span","​"):_i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Qi(e){if(null!=Xl)return Xl;var t=Ui(e,document.createTextNode("AخA")),n=ql(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=ql(t,1,2).getBoundingClientRect();return Xl=r.right-n.right<3}function Ji(e){if(null!=ra)return ra;var t=Ui(e,_i("span","x")),n=t.getBoundingClientRect(),r=ql(t,0,1).getBoundingClientRect();return ra=Math.abs(n.left-r.left)>1}function eo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;ot||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function ro(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?no(Wi(t)):e.text.length}function oo(e,t){var n=Zr(e.doc,t),r=yr(n);r!=n&&(t=ti(r));var i=ii(r),o=i?i[0].level%2?io(r):ro(r):0;return Fo(t,o)}function lo(e,t){for(var n,r=Zr(e.doc,t);n=gr(r);)r=n.find(1,!0).line,t=null;var i=ii(r),o=i?i[0].level%2?ro(r):io(r):r.text.length;return Fo(null==t?ti(r):t,o)}function ao(e,t){var n=oo(e,t.line),r=Zr(e.doc,n.line),i=ii(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return Fo(n.line,l?0:o)}return n}function so(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function co(e,t){oa=null;for(var n,r=0;rt)return r;if(i.from==t||i.to==t){if(null!=n)return so(e,i.level,e[n].level)?(i.from!=i.to&&(oa=n),r):(i.from!=i.to&&(oa=r),n);n=r}}return n}function uo(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&ji(e.text.charAt(t)));return t}function ho(e,t,n,r){var i=ii(e);if(!i)return fo(e,t,n,r);for(var o=co(i,t),l=i[o],a=uo(e,t,l.level%2?-n:n,r);;){if(a>l.from&&a0==l.level%2?l.to:l.from);if(l=i[o+=n],!l)return null;a=n>0==l.level%2?uo(e,l.to,-1,r):uo(e,l.from,1,r)}}function fo(e,t,n,r){var i=t+n;if(r)for(;i>0&&ji(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,mo=navigator.platform,go=/gecko\/\d/i.test(po),vo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),xo=vo||yo,bo=xo&&(vo?document.documentMode||6:yo[1]),wo=/WebKit\//.test(po),ko=wo&&/Qt\/\d+\.\d+/.test(po),Co=/Chrome\//.test(po),So=/Opera\//.test(po),Lo=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Ao=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Oo=No||/Mac/.test(mo),Ho=/win/i.test(mo),Wo=So&&po.match(/Version\/(\d*\.\d*)/);Wo&&(Wo=Number(Wo[1])),Wo&&Wo>=15&&(So=!1,wo=!0);var Io=Oo&&(ko||So&&(null==Wo||12.11>Wo)),Eo=go||xo&&bo>=9,Do=!1,Po=!1;m.prototype=Fi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);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";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Oo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oi,this.disableVert=new Oi},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Fi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},L.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},L.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Al(o,"paste",function(e){Ti(r,e)||Q(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Al(o,"cut",t),Al(o,"copy",t),Al(e.scroller,"paste",function(t){Gt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Al(e.lineSpace,"selectstart",function(t){Gt(e,t)||Tl(t)}),Al(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Al(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var i=ft(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Ui(n.cursorDiv,e.cursors),Ui(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=na&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var l=t?"-":n||r.getSelection();this.textarea.value=l,r.state.focused&&_l(this.textarea),xo&&bo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",xo&&bo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Ao||Gi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||ta(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&bo>=9&&this.hasSelection===r||Oo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(n.length,r.length);l>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var a=this;return At(e,function(){Z(e,r.slice(o),n.length-o,null,a.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=a.prevInput="":a.prevInput=r,a.composing&&(a.composing.range.clear(),a.composing.range=e.markText(a.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&bo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t="​"+(e?l.value:"");l.value="⇚",l.value=t,r.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=d,l.style.cssText=u,xo&&9>bo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=l.selectionStart){(!xo||xo&&9>bo)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==r.prevInput?Ot(i,cl.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,l=r.textarea,a=$t(i,e),s=o.scroller.scrollTop;if(a&&!So){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(a)&&Ot(i,Te)(i.doc,fe(a),Pl);var u=l.style.cssText,d=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();if(l.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",wo)var f=window.scrollY;if(o.input.focus(),wo&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(l.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&bo>=9&&t(),Eo){Nl(e);var p=function(){Hl(window,"mouseup",p),setTimeout(n,20)};Al(window,"mouseup",p)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Di,needsContentAttribute:!1},ne.prototype),ie.prototype=Fi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Ro=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Ro=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Pl),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Ro.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Ro.join("\n");var o=document.activeElement;_l(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;te(i),Al(i,"paste",function(e){Ti(r,e)||Q(e,r)}),Al(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(n.composing.sel=fe(Fo(i.head.line,l),Fo(i.head.line,l+t.length)))}}),Al(i,"compositionupdate",function(e){n.composing.data=e.data}),Al(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Al(i,"touchstart",function(){n.forceCompositionEnd()}),Al(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||At(n.cm,function(){Dt(r)})}),Al(i,"copy",t),Al(i,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=ae(this.cm,e.anchorNode,e.anchorOffset),r=ae(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=zo(X(n,r),t.from())||0!=zo(K(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var l=this.cm.display.view,a=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=l[l.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var u=ql(i.node,i.offset,o.offset,o.node)}catch(d){}u&&(!go&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),a&&null==e.anchorNode?e.addRange(a):go&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ui(this.cm.display.cursorDiv,e.cursors),Ui(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Vl(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=ae(t,e.anchorNode,e.anchorOffset),r=ae(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,fe(n,r),Pl),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.linet.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=zt(e,r.line)))var l=ti(t.view[0].line),a=t.view[0].node;else var l=ti(t.view[o].line),a=t.view[o-1].node.nextSibling;var s=zt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ti(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var d=e.doc.splitLines(ce(e,a,u,l,c)),h=Qr(e.doc,Fo(l,0),Fo(c,Zr(e.doc,c).text.length));d.length>1&&h.length>1;)if(Wi(d)==Wi(h))d.pop(),h.pop(),c--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),l++}for(var f=0,p=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);v>f&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var y=Wi(d),x=Wi(h),b=Math.min(y.length-(1==d.length?f:0),x.length-(1==h.length?f:0));b>p&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;d[d.length-1]=y.slice(0,y.length-p),d[0]=d[0].slice(f);var w=Fo(l,f),k=Fo(c,h.length?Wi(h).length-p:0);return d.length>1||d[0]||zo(w,k)?(Wn(e.doc,d,w,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Ot(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Ot(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Ot(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Di,resetPosition:Di,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&zo(e,r.to())<=0)return n}return-1}},de.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return K(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Bo,jo,_o,qo={left:0,right:0,top:0,bottom:0},Uo=null,Go=0,$o=0,Vo=0,Ko=null;xo?Ko=-.53:go?Ko=15:Co?Ko=-.7:Lo&&(Ko=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);return t.x*=Ko,t.y*=Ko,t};var Yo=new Oi,Zo=null,Qo=e.changeEnd=function(e){return e.text?Fo(e.from.line+e.text.length-1,Wi(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,el.hasOwnProperty(e)&&Ot(this,el[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Vn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Bn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&zn(this));else{var o=i.from(),l=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;n>s;++s)Bn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&ke(this.doc,r,new de(o,c[r].to()),Pl)}}}),getTokenAt:function(e,t){return Wr(this,e,t)},getLineTokens:function(e,t){return Wr(this,Fo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Zr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]a?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!ll.hasOwnProperty(t))return n;var r=ll[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;oi&&(e=i,r=!0),n=Zr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ri(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ht(function(e,t,n){return jn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Bi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ht(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Pt(t,r,"gutter"),Bi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Zr(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=ft(this,me(this.doc,e));var l=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&Dn(this,a,l,a+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ht(hn),triggerOnKeyPress:Ht(mn),triggerOnKeyUp:pn,execCommand:function(e){return cl.hasOwnProperty(e)?cl[e].call(null,this):void 0},triggerElectric:Ht(function(e){J(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=me(this.doc,e);t>o&&(l=qn(this.doc,l,i,n,r),!l.hitSide);++o);return l},moveH:Ht(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?qn(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to(); -},zl)}),deleteH:Ht(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):_n(this,function(n){var i=qn(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var l=0,a=me(this.doc,e);t>l;++l){var s=ft(this,a,"div");if(null==o?o=s.left:s.left=o,a=Un(this,s,i,n),a.hitSide)break}return a},moveV:Ht(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var a=ft(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),i.push(a.left);var s=Un(n,a,e,t);return"page"==t&&l==r.sel.primary()&&Fn(n,null,ht(n,s,"div").top-a.top),s},zl),i.length)for(var l=0;l0&&a(n.charAt(r-1));)--r;for(;i.5)&&l(this),Wl(this,"refresh",this)}),swapDoc:Ht(function(e){var t=this.doc;return t.cm=null,Yr(this,e),at(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Si(this,"swapDoc",this,t),t}),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}},Ai(e);var Jo=e.defaults={},el=e.optionHandlers={},tl=e.Init={toString:function(){return"CodeMirror.Init"}};Gn("value","",function(e,t){e.setValue(t)},!0),Gn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Gn("indentUnit",2,n,!0),Gn("indentWithTabs",!1),Gn("smartIndent",!0),Gn("tabSize",4,function(e){r(e),at(e),Dt(e)},!0),Gn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Fo(r,o))}r++});for(var i=n.length-1;i>=0;i--)Wn(e.doc,t,n[i],Fo(n[i].line,n[i].ch+t.length))}}),Gn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Gn("specialCharPlaceholder",Rr,function(e){e.refresh()},!0),Gn("electricChars",!0),Gn("inputStyle",Ao?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Gn("rtlMoveVisually",!Ho),Gn("wholeLineUpdateBefore",!0),Gn("theme","default",function(e){a(e),s(e)},!0),Gn("keyMap","default",function(t,n,r){var i=Vn(n),o=r!=e.Init&&Vn(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Gn("extraKeys",null),Gn("lineWrapping",!1,i,!0),Gn("gutters",[],function(e){f(e.options),s(e)},!0),Gn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?S(e.display)+"px":"0",e.refresh()},!0),Gn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Gn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Gn("lineNumbers",!1,function(e){f(e.options),s(e)},!0),Gn("firstLineNumber",1,s,!0),Gn("lineNumberFormatter",function(e){return e},s,!0),Gn("showCursorWhenSelecting",!1,Ee,!0),Gn("resetSelectionOnContextMenu",!0),Gn("lineWiseCopyCut",!0),Gn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Gn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Gn("dragDrop",!0,qt),Gn("allowDropFileTypes",null),Gn("cursorBlinkRate",530),Gn("cursorScrollMargin",0),Gn("cursorHeight",1,Ee,!0),Gn("singleCursorHeightPerLine",!0,Ee,!0),Gn("workTime",100),Gn("workDelay",100),Gn("flattenSpans",!0,r,!0),Gn("addModeClass",!1,r,!0),Gn("pollInterval",100),Gn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Gn("historyEventDelay",1250),Gn("viewportMargin",10,function(e){e.refresh()},!0),Gn("maxHighlightLength",1e4,r,!0),Gn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Gn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Gn("autofocus",null);var nl=e.modes={},rl=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),nl[t]=n},e.defineMIME=function(e,t){rl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&rl.hasOwnProperty(t))t=rl[t];else if(t&&"string"==typeof t.name&&rl.hasOwnProperty(t.name)){var n=rl[t.name];"string"==typeof n&&(n={name:n}),t=Pi(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=nl[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(il.hasOwnProperty(n.name)){var o=il[n.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var l in n.modeProps)i[l]=n.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var il=e.modeExtensions={};e.extendMode=function(e,t){var n=il.hasOwnProperty(e)?il[e]:il[e]={};Fi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Cl.prototype[e]=t},e.defineOption=Gn;var ol=[];e.defineInitHook=function(e){ol.push(e)};var ll=e.helpers={};e.registerHelper=function(t,n,r){ll.hasOwnProperty(t)||(ll[t]=e[t]={_global:[]}),ll[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),ll[t]._global.push({pred:r,val:i})};var al=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},sl=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var cl=e.commands={selectAll:function(e){e.setSelection(Fo(e.firstLine(),0),Fo(e.lastLine()),Pl)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Pl)},killLine:function(e){_n(e,function(t){if(t.empty()){var n=Zr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new Fo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Fo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Zr(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Fo(i.line-1,l.length-1),Fo(i.line,1),"+transpose")}n.push(new de(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}zn(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},ul=e.keyMap={};ul.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"},ul.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"},ul.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"},ul.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"]},ul["default"]=Oo?ul.macDefault:ul.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Ei(n.split(" "),$n),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ml=0,gl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ml};Ai(gl),gl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),Ni(this,"clear")){var n=this.find();n&&Si(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&Si(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},gl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;in;++n){var i=this.lines[n];this.height-=i.height,Nr(i),Si(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;re;++e)if(n(this.lines[e]))return!0}},Kr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;ne){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Vr))){var a=[];this.collapse(a),this.children=[new Vr(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),a=new Vr(l);i.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Kr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ii(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Kr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var kl=0,Cl=e.Doc=function(e,t,n,r){if(!(this instanceof Cl))return new Cl(e,t,n,r);null==n&&(n=0),Kr.call(this,[new Vr([new xl("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=Fo(n,0);this.sel=fe(i),this.history=new oi(null),this.id=++kl,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),$r(this,{from:i,to:i,text:e}),Te(this,fe(i),Pl)};Cl.prototype=Pi(Kr.prototype,{constructor:Cl,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r=0;o--)Tn(this,r[o]);a?Le(this,a):this.cm&&zn(this.cm)}),undo:Wt(function(){Nn(this,"undo")}),redo:Wt(function(){Nn(this,"redo")}),undoSelection:Wt(function(){Nn(this,"undo",!0)}),redoSelection:Wt(function(){Nn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;as.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re?(t=e,!0):(e-=i,void++n)}),me(this,Fo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.toa||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}},Bl=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},jl=[""],_l=function(e){e.select()};No?_l=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&(_l=function(e){try{e.select()}catch(t){}});var ql,Ul=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Gl=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ul.test(e))},$l=/[\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]/;ql=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Vl=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&11>bo&&(Gi=function(){try{return document.activeElement}catch(e){return document.body}});var Kl,Xl,Yl=e.rmClass=function(e,t){var n=e.className,r=$i(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Zl=e.addClass=function(e,t){var n=e.className;$i(t).test(n)||(e.className+=(n?" ":"")+t)},Ql=!1,Jl=function(){if(xo&&9>bo)return!1;var e=_i("div");return"draggable"in e||"dragDrop"in e}(),ea=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ta=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},na=function(){var e=_i("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ra=null,ia=e.keyNames={3:"Enter",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:"/",127:"Delete",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"};!function(){for(var e=0;10>e;e++)ia[e+48]=ia[e+96]=String(e);for(var e=65;90>=e;e++)ia[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ia[e+111]=ia[e+63235]="F"+e}();var oa,la=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,a=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,d=[],h=0;u>h;++h)d.push(r=e(n.charCodeAt(h)));for(var h=0,f=c;u>h;++h){var r=d[h];"m"==r?d[h]=f:f=r}for(var h=0,p=c;u>h;++h){var r=d[h];"1"==r&&"r"==p?d[h]="n":l.test(r)&&(p=r,"r"==r&&(d[h]="R"))}for(var h=1,f=d[0];u-1>h;++h){var r=d[h];"+"==r&&"1"==f&&"1"==d[h+1]?d[h]="1":","!=r||f!=d[h+1]||"1"!=f&&"n"!=f||(d[h]=f),f=r}for(var h=0;u>h;++h){var r=d[h];if(","==r)d[h]="N";else if("%"==r){for(var m=h+1;u>m&&"%"==d[m];++m);for(var g=h&&"!"==d[h-1]||u>m&&"1"==d[m]?"1":"N",v=h;m>v;++v)d[v]=g;h=m-1}}for(var h=0,p=c;u>h;++h){var r=d[h];"L"==p&&"1"==r?d[h]="L":l.test(r)&&(p=r)}for(var h=0;u>h;++h)if(o.test(d[h])){for(var m=h+1;u>m&&o.test(d[m]);++m);for(var y="L"==(h?d[h-1]:c),x="L"==(u>m?d[m]:c),g=y||x?"L":"R",v=h;m>v;++v)d[v]=g;h=m-1}for(var b,w=[],h=0;u>h;)if(a.test(d[h])){var k=h;for(++h;u>h&&a.test(d[h]);++h);w.push(new t(0,k,h))}else{var C=h,S=w.length;for(++h;u>h&&"L"!=d[h];++h);for(var v=C;h>v;)if(s.test(d[v])){v>C&&w.splice(S,0,new t(1,C,v));var L=v;for(++v;h>v&&s.test(d[v]);++v);w.splice(S,0,new t(2,L,v)),C=v}else++v;h>C&&w.splice(S,0,new t(1,C,h))}return 1==w[0].level&&(b=n.match(/^\s+/))&&(w[0].from=b[0].length,w.unshift(new t(0,0,b[0].length))),1==Wi(w).level&&(b=n.match(/\s+$/))&&(Wi(w).to-=b[0].length,w.push(new t(0,u-b[0].length,u))),2==w[0].level&&w.unshift(new t(1,w[0].to,w[0].to)),w[0].level!=Wi(w).level&&w.push(new t(w[0].level,u,u)),w}}();return e.version="5.12.1",e})},{}],8:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],i):i(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,l={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var l=1+e.pos-i;return n.code?l===o&&(n.code=!1):(o=l,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var s in r)a[s]=r[s];return a.name="markdown",e.overlayMode(e.getMode(n,a),l)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":6,"../../lib/codemirror":7,"../markdown/markdown":9}],9:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../xml/xml","../meta"],i):i(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function l(e){return!e||!/\S/.test(e.string)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,C&&e.f==c&&(e.f=p,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(e,t){var o=e.sol(),a=t.list!==!1,s=t.indentedCode;t.indentedCode=!1,a&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?t.list=null:t.list=!1);var c=null;if(t.indentationDiff>=4)return e.skipToEnd(),s||l(t.prevLine)?(t.indentation-=4,t.indentedCode=!0,S.code):null;if(e.eatSpace())return null;if((c=e.match(O))&&c[1].length<=6)return t.header=c[1].length,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,h(t);if(!(l(t.prevLine)||t.quote||a||s)&&(c=e.match(H)))return t.header="="==c[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,h(t);if(e.eat(">"))return t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),h(t);if("["===e.peek())return i(e,t,y);if(e.match(T,!0))return t.hr=!0,S.hr;if((l(t.prevLine)||a)&&(e.match(M,!1)||e.match(N,!1))){var d=null;for(e.match(M,!0)?d="ul":(e.match(N,!0),d="ol"),t.indentation=e.column()+e.current().length,t.list=!0;t.listStack&&e.column()")>-1)&&(n.f=p,n.block=s,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=d,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S.code)}function d(e,t){e.match(t.fencedChars),t.block=s,t.f=p,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=h(t);return t.code=0,r}function h(e){var t=[];if(e.formatting){t.push(S.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?t.push(S.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(S.linkHref,"url"):(e.strong&&t.push(S.strong),e.em&&t.push(S.em),e.strikethrough&&t.push(S.strikethrough),e.linkText&&t.push(S.linkText),e.code&&t.push(S.code)),e.header&&t.push(S.header,S.header+"-"+e.header),e.quote&&(t.push(S.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.quote+"-"+e.quote):t.push(S.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(S.list2):t.push(S.list3):t.push(S.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function f(e,t){return e.match(W,!0)?h(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,h(r);if(r.taskList){var l="x"!==t.match(A,!0)[1];return l?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,h(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),h(r);var a=t.sol(),s=t.next();if(r.linkTitle){r.linkTitle=!1;var u=s;"("===s&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var d="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(d),!0))return S.linkHref}if("`"===s){var f=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0==r.code)return r.code=p,h(r);if(p==r.code){var v=h(r);return r.code=0,v}return r.formatting=f,h(r)}if(r.code)return h(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var y=h(r),x=S.formatting+"-escape";return y?y+" "+x:x}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=g,S.image;if("["===s&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),h(r);if("]"===s&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=h(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkEmail}if("<"===s&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var w=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(w)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(k),o(t,r,c)}if("<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var L=t.pos-2;if(L>=0){var T=t.string.charAt(L);"_"!==T&&T.match(/(\w)/,!1)&&(C=!0)}}if("*"===s||"_"===s&&!C)if(a&&" "===t.peek());else{if(r.strong===s&&t.eat(s)){n.highlightFormatting&&(r.formatting="strong");var v=h(r);return r.strong=!1,v}if(!r.strong&&t.eat(s))return r.strong=s,n.highlightFormatting&&(r.formatting="strong"),h(r);if(r.em===s){n.highlightFormatting&&(r.formatting="em");var v=h(r);return r.em=!1,v}if(!r.em)return r.em=s,n.highlightFormatting&&(r.formatting="em"),h(r)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return h(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=h(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),h(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return h(r);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),h(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=h(t);return i?i+=" ":i="",i+S.linkInline}return e.match(/^[^>]+/,!0),S.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,h(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=h(r);return r.linkHref=!1,o}return t.match(w(e),!0)&&t.backUp(1),r.linkHref=!0,h(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=x,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,h(t)):i(e,t,p)}function x(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=h(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,S.linkHref+" url")}function w(e){return E[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),E[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),E[e]}var k=e.getMode(t,"text/html"),C="null"==k.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var S={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var L in S)S.hasOwnProperty(L)&&n.tokenTypeOverrides[L]&&(S[L]=n.tokenTypeOverrides[L]);var T=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^[*\-+]\s+/,N=/^[0-9]+([.)])\s+/,A=/^\[(x| )\](?=\s)/,O=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,H=/^ *(?:\={1,}|-{1,})\s*$/,W=/^[^#!\[\]*_\\<>` "'(~]+/,I=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#]*)"),E=[],D={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:p,text:f,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(k,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(a(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:k}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:D}},blankLine:a,getType:h,fold:"markdown"};return D},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":7,"../meta":10,"../xml/xml":11}],10:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../lib/codemirror")):"function"==typeof e&&e.amd?e(["../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog", -ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=l,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function l(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=f,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=a(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=l;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!C.contextGrabbers.hasOwnProperty(n)||!C.contextGrabbers[n].hasOwnProperty(t))return;d(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:f}function p(e,t,n){return"word"==e?(n.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&C.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r||C.matchClosing===!1?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,n){return"endTag"!=e?(M="error",g):(d(n),f)}function v(e,t,n){return M="error",g(e,t,n)}function y(e,t,n){if("word"==e)return M="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),f}return M="error",y}function x(e,t,n){return"equals"==e?b:(C.allowMissing||(M="error"),y(e,t,n))}function b(e,t,n){return"string"==e?w:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var k=r.indentUnit,C={},S=i.htmlMode?t:n;for(var L in S)C[L]=S[L];for(var L in i)C[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:f,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(M=null,t.state=t.state(T||n,e,t),M&&(n="error"==M?n+" error":M)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=l&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":7}],12:[function(t,n,r){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function i(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function o(e){this.options=e||{}}function l(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function s(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function d(e){for(var t,n,r=1;rAn error occured:

    "+a(u.message+"",!0)+"
    ";throw u}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};f.bullet=/(?:[*+-]|\d+\.)/,f.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,f.item=c(f.item,"gm")(/bull/g,f.bullet)(),f.list=c(f.list)(/bull/g,f.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+f.def.source+")")(),f.blockquote=c(f.blockquote)("def",f.def)(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",f.html=c(f.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,f._tag)(),f.paragraph=c(f.paragraph)("hr",f.hr)("heading",f.heading)("lheading",f.lheading)("blockquote",f.blockquote)("tag","<"+f._tag)("def",f.def)(),f.normal=d({},f),f.gfm=d({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=c(f.paragraph)("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|")(),f.tables=d({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=f,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,l,a,s,c,u,d,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),l=o[2],this.tokens.push({type:"list_start",ordered:l.length>1}),o=o[0].match(this.rules.item),r=!1,d=o.length,u=0;d>u;u++)s=o[u],c=s.length,s=s.replace(/^ *([*+-]|\d+\.) +/,""),~s.indexOf("\n ")&&(c-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==d-1&&(a=f.bullet.exec(o[u+1])[0],l===a||l.length>1&&a.length>1||(e=o.slice(u+1).join("\n")+e,u=d-1)),i=r||/\n\n(?!\s*$)/.test(s),u!==d-1&&(r="\n"===s.charAt(s.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=c(p.link)("inside",p._inside)("href",p._href)(),p.reflink=c(p.reflink)("inside",p._inside)(),p.normal=d({},p),p.pedantic=d({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=d({},p.normal,{escape:c(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=d({},p.gfm,{br:c(p.br)("{2,}","*")(),text:c(p.gfm.text)("{2,}","*")()}),i.rules=p,i.output=function(e,t,n){var r=new i(t,n);return r.output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=a(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):a(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(a(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(a(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=a(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},o.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"'+e+"\n"},o.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},o.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},o.prototype.paragraph=function(e){return"

    "+e+"

    \n"},o.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},o.prototype.tablerow=function(e){return"\n"+e+"\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},o.prototype.strong=function(e){return""+e+""},o.prototype.em=function(e){return""+e+""},o.prototype.codespan=function(e){return""+e+""},o.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},o.prototype.del=function(e){return""+e+""},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(s(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='
    "},o.prototype.image=function(e,t,n){var r=''+n+'":">"},o.prototype.text=function(e){return e},l.parse=function(e,t,n){var r=new l(t,n);return r.parse(e)},l.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",l="";for(n="",e=0;e=0&&(f=c.getLineHandle(o),!t(f));o--);var v,y,x,b,w=c.getTokenAt({line:o,ch:1}),k=n(w).fencedChars;t(c.getLineHandle(u.line))?(v="",y=u.line):t(c.getLineHandle(u.line-1))?(v="",y=u.line-1):(v=k+"\n",y=u.line),t(c.getLineHandle(d.line))?(x="",b=d.line,0===d.ch&&(b+=1)):0!==d.ch&&t(c.getLineHandle(d.line+1))?(x="",b=d.line+1):(x=k+"\n",b=d.line+1),0===d.ch&&(b-=1),c.operation(function(){c.replaceRange(x,{line:b,ch:0},{line:b+(x?0:1),ch:0}),c.replaceRange(v,{line:y,ch:0},{line:y+(v?0:1),ch:0})}),c.setSelection({line:y+(v?1:0),ch:0},{line:b+(v?1:-1),ch:0}),c.focus()}else{var C=u.line;if(t(c.getLineHandle(u.line))&&("fenced"===r(c,u.line+1)?(o=u.line,C=u.line+1):(l=u.line,C=u.line-1)),void 0===o)for(o=C;o>=0&&(f=c.getLineHandle(o),!t(f));o--);if(void 0===l)for(a=c.lineCount(),l=C;a>l&&(f=c.getLineHandle(l),!t(f));l++);c.operation(function(){c.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),c.replaceRange("",{line:l-1,ch:0},{line:l,ch:0})}),c.focus()}else if("indented"===p){if(u.line!==d.line||u.ch!==d.ch)o=u.line,l=d.line,0===d.ch&&l--;else{for(o=u.line;o>=0;o--)if(f=c.getLineHandle(o),!f.text.match(/^\s*$/)&&"indented"!==r(c,o,f)){o+=1;break}for(a=c.lineCount(),l=u.line;a>l;l++)if(f=c.getLineHandle(l),!f.text.match(/^\s*$/)&&"indented"!==r(c,l,f)){l-=1;break}}var S=c.getLineHandle(l+1),L=S&&c.getTokenAt({line:l+1,ch:S.text.length-1}),T=L&&n(L).indentedCode;T&&c.replaceRange("\n",{line:l+1,ch:0});for(var M=o;l>=M;M++)c.indentLine(M,"subtract");c.focus()}else{var N=u.line===d.line&&u.ch===d.ch&&0===u.ch,A=u.line!==d.line;N||A?i(c,u,d,s):O(c,!1,["`","`"])}}function f(e){var t=e.codemirror;W(t,"quote")}function p(e){var t=e.codemirror;H(t,"smaller")}function m(e){var t=e.codemirror;H(t,"bigger")}function g(e){var t=e.codemirror;H(t,void 0,1)}function v(e){var t=e.codemirror;H(t,void 0,2)}function y(e){var t=e.codemirror;H(t,void 0,3)}function x(e){var t=e.codemirror;W(t,"unordered-list")}function b(e){var t=e.codemirror;W(t,"ordered-list")}function w(e){var t=e.codemirror;E(t)}function k(e){var t=e.codemirror,n=a(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.link),!i)?!1:void O(t,n.link,r.insertTexts.link,i)}function C(e){var t=e.codemirror,n=a(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.image),!i)?!1:void O(t,n.image,r.insertTexts.image,i)}function S(e){var t=e.codemirror,n=a(t),r=e.options;O(t,n.table,r.insertTexts.table)}function L(e){var t=e.codemirror,n=a(t),r=e.options;O(t,n.image,r.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function M(e){var t=e.codemirror;t.redo(),t.focus()}function N(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||s(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);var l=n.lastChild;if(/editor-preview-active/.test(l.className)){l.className=l.className.replace(/\s*editor-preview-active\s*/g,"");var a=e.toolbarElements.preview,c=n.previousSibling;a.className=a.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}var u=function(){r.innerHTML=e.options.previewRender(e.value(),r)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=u),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction)}function A(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=e.options.toolbar?e.toolbarElements.preview:!1,o=n.lastChild;o&&/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var l=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(l.className)&&N(e)}function O(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],l=n[1],a=e.getCursor("start"),s=e.getCursor("end");r&&(l=l.replace("#url#",r)),t?(i=e.getLine(a.line),o=i.slice(0,a.ch),l=i.slice(a.ch),e.replaceRange(o+l,{line:a.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+l),a.ch+=o.length,a!==s&&(s.ch+=o.length)),e.setSelection(a,s),e.focus()}}function H(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){ -for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/);i=void 0!==t?0>=o?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?0>=o?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?0>=o?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):0>=o?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o);e.focus()}}function W(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=a(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},l={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)!function(r){var i=e.getLine(r);i=n[t]?i.replace(o[t],"$1"):l[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(s);e.focus()}}function I(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r="undefined"==typeof r?n:r;var i,o=e.codemirror,l=a(o),s=n,c=r,u=o.getCursor("start"),d=o.getCursor("end");l[t]?(i=o.getLine(u.line),s=i.slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==d&&(d.ch-=2)):"italic"==t&&(u.ch-=1,u!==d&&(d.ch-=1))):(i=o.getSelection(),"bold"==t?(i=i.split("**").join(""),i=i.split("__").join("")):"italic"==t?(i=i.split("*").join(""),i=i.split("_").join("")):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,d.ch=u.ch+i.length),o.setSelection(u,d),o.focus()}}function E(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=e.getLine(i),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}function D(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=D(e[n]||{},t[n]):e[n]=t[n]);return e}function P(e){for(var t=1;t=19968?n[i].length:1;return r}function z(e){e=e||{},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,r=0;r-1&&(t=!1);if(t){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar){e.toolbar=[];for(var o in K)K.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(K[o]["default"]===!0||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=P({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=P({},X,e.insertTexts||{}),e.promptTexts=Y,e.blockStyles=P({},Z,e.blockStyles||{}),e.shortcuts=P({},U,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}function R(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var B=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js"),e("spell-checker");var j=e("marked"),_=/Mac/.test(navigator.platform),q={toggleBold:c,toggleItalic:u,drawLink:k,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:C,toggleBlockquote:f,toggleOrderedList:b,toggleUnorderedList:x,toggleCodeBlock:h,togglePreview:A,toggleStrikethrough:d,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:S,drawHorizontalRule:L,undo:T,redo:M,toggleSideBySide:N,toggleFullScreen:s},U={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},G=function(e){for(var t in q)if(q[t]===e)return t;return null},$=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},V="",K={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:d,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:f,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:x,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:b,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:k,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:C,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:S,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:L,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:A,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:N,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:s,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:M,className:"fa fa-repeat no-disable",title:"Redo"}},X={link:["[","](#url#)"],image:["![","](#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Y={link:"URL for the link:",image:"URL of the image:"},Z={bold:"**",code:"```",italic:"*"};z.prototype.markdown=function(e){if(j){var t={};return this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),j.setOptions(t),j(e)}},z.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,i={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==q[o]&&!function(e){i[r(t.shortcuts[e])]=function(){q[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(e){e.getOption("fullScreen")&&s(n)},document.addEventListener("keydown",function(e){e=e||window.event,27==e.keyCode&&n.codemirror.getOption("fullScreen")&&s(n)},!1);var l,a;if(t.spellChecker!==!1?(l="spell-checker",a=t.parsingConfig,a.name="gfm",a.gitHubSpice=!1):(l=t.parsingConfig,l.name="gfm",l.gitHubSpice=!1),this.codemirror=B.fromTextArea(e,{mode:l,backdrop:a,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:i,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||""}),t.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element}},z.prototype.autosave=function(){if(R()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",l=r;l>=12&&(l=r-12,o="pm"),0==l&&(l=12),i=10>i?"0"+i:i,t.innerHTML="Autosaved: "+l+":"+i+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},z.prototype.clearAutosavedValue=function(){if(R()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},z.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var r=!1,i=!1;return e.on("scroll",function(e){if(r)return void(r=!1);i=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,l=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=l}),n.onscroll=function(){if(i)return void(i=!1);r=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,l=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,l)},n},z.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t;for(t=0;t